Skip to content

Commit 08ebbd6

Browse files
committed
Merge remote-tracking branch 'upstream/master'
2 parents e7d6fbd + bf23453 commit 08ebbd6

9 files changed

+129
-128
lines changed

lib/Viewer.js

+19-19
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22

33
var assign = require('lodash/object/assign'),
44
omit = require('lodash/object/omit'),
5-
isString = require('lodash/lang/isString'),
6-
isNumber = require('lodash/lang/isNumber');
5+
isString = require('lodash/lang/isString');
76

87
var domify = require('min-dom/lib/domify'),
98
domQuery = require('min-dom/lib/query'),
@@ -52,19 +51,9 @@ function checkValidationError(err) {
5251
}
5352

5453
var DEFAULT_OPTIONS = {
55-
width: '100%',
56-
position: 'relative',
5754
container: 'body'
5855
};
5956

60-
61-
/**
62-
* Ensure the passed argument is a proper unit (defaulting to px)
63-
*/
64-
function ensureUnit(val) {
65-
return val + (isNumber(val) ? 'px' : '');
66-
}
67-
6857
/**
6958
* A viewer for DMN tables.
7059
*
@@ -128,12 +117,6 @@ function Viewer(options) {
128117

129118
var container = this.container = domify('<div class="dmn-table"></div>');
130119
parent.appendChild(container);
131-
132-
assign(container.style, {
133-
width: ensureUnit(options.width),
134-
height: ensureUnit(options.height),
135-
position: options.position
136-
});
137120
}
138121

139122
Viewer.prototype.importXML = function(xml, done) {
@@ -225,6 +208,19 @@ Viewer.prototype.importDefinitions = function(definitions, done) {
225208

226209
Viewer.prototype._init = function(table) {
227210
initListeners(table, this.__listeners || []);
211+
212+
var container = table.get('sheet').getContainer();
213+
214+
/**
215+
* The code in the <project-logo></project-logo> area
216+
* must not be changed, see http://bpmn.io/license for more information
217+
*
218+
* <project-logo>
219+
*/
220+
container.appendChild(domify('<a href="http://bpmn.io" class="dmn-js-logo"></a>'));
221+
/**
222+
* </project-logo>
223+
*/
228224
};
229225

230226
Viewer.prototype._createTable = function(options) {
@@ -240,7 +236,11 @@ Viewer.prototype._createTable = function(options) {
240236
options = omit(options, 'additionalModules');
241237

242238
options = assign(options, {
243-
sheet: { container: this.container },
239+
sheet: {
240+
width: options.width,
241+
height: options.height,
242+
container: this.container
243+
},
244244
modules: modules
245245
});
246246

lib/features/annotations/Annotations.js

+1-9
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,8 @@ function Annotations(eventBus, sheet, elementRegistry, graphicsFactory, hideTech
2828
return element._type === 'cell' && element.column === self.column && element.row.isLabelRow;
2929
})[0];
3030
labelCell.rowspan = hideTechControl.isHidden() ? 2 : 4;
31-
/**
32-
* The code in the <project-logo></project-logo> area
33-
* must not be changed, see http://bpmn.io/license for more information
34-
*
35-
* <project-logo>
36-
*/
3731

38-
labelCell.content = domify('<a href="http://bpmn.io" class="dmn-js-logo"></a>Annotation');
39-
40-
/* </project-logo> */
32+
labelCell.content = domify('Annotation');
4133

4234
graphicsFactory.update('column', self.column, elementRegistry.getGraphics(self.column.id));
4335

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "dmn-js",
3-
"version": "0.4.1",
3+
"version": "0.5.0",
44
"description": "A dmn toolkit and web modeler",
55
"scripts": {
66
"test": "grunt test"
@@ -78,6 +78,6 @@
7878
"min-dom": "^0.2.0",
7979
"object-refs": "^0.1.0",
8080
"selection-update": "^0.1.2",
81-
"table-js": "^0.4.0"
81+
"table-js": "^0.5.0"
8282
}
8383
}

styles/dmn-combobox.less

+1-3
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,10 @@
4242
position: absolute;
4343
display: block;
4444
right: 0;
45-
width: 1.2em;
4645
height: @line-height-computed;
4746
line-height: @line-height-computed;
48-
height: 1.2em;
4947
top: 50%;
50-
margin-top: -0.6em;
48+
margin-top: 0 - round(@line-height-computed * 0.5);
5149
content: '\E801';
5250
}
5351

styles/dmn-contextmenu.less

+25-10
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@
1919
li {
2020
margin: 0;
2121
padding: 0;
22+
list-style: none;
2223
}
2324

24-
ul {
25-
list-style: none;
25+
ul:not(.tjs-menu > ul) {
2626
.fancy-list;
2727
}
2828

@@ -35,6 +35,11 @@
3535
font-size: 100%;
3636
font-weight: normal;
3737
padding: 0;
38+
39+
&:hover,
40+
&:focus {
41+
color: @dmn-gray-darker;
42+
}
3843
}
3944

4045
.tjs-icon {
@@ -66,20 +71,15 @@
6671
&.clear:before { content: '\e812'; }
6772
}
6873

69-
a.disabled,
70-
a.disabled:hover {
71-
color: @dmn-gray-dark;
72-
cursor: default;
73-
}
74-
7574
ul:empty {
7675
display: none;
7776
}
7877

7978
> ul > li {
80-
padding-top: @dmn-vertical-padding;
81-
padding-bottom: @dmn-vertical-padding;
79+
padding-top: @dmn-vertical-padding * 2;
80+
padding-bottom: @dmn-vertical-padding * 2;
8281
border-bottom: 1px dotted @dmn-gray-light;
82+
8383
&:last-child {
8484
border-bottom: none;
8585
}
@@ -145,4 +145,19 @@
145145
background-color: @dmn-output-color;
146146
}
147147
}
148+
149+
.tjs-dropdown-menu > *:not(.tjs-context-menu > .tjs-dropdown-menu > *) {
150+
padding-left: 5px;
151+
}
152+
153+
a.disabled,
154+
a.disabled:hover {
155+
color: @dmn-gray;
156+
cursor: default;
157+
border-bottom: none;
158+
.tjs-label {
159+
font-weight: 700;
160+
color: @dmn-gray;
161+
}
162+
}
148163
}

styles/dmn-dragdrop.less

+9-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323

2424
table > tbody tr {
2525
&.drop {
26-
2726
&.above {
2827
border-top: 6px double @dmn-primary;
2928
}
@@ -37,11 +36,16 @@
3736
cursor: ns-resize;
3837

3938
&:before {
39+
visibility: hidden;
4040
float: left;
4141
cursor: move;
4242
cursor: ns-resize;
4343
}
4444

45+
&:hover:before {
46+
visibility: visible;
47+
}
48+
4549
span {
4650
float: right;
4751
width: auto;
@@ -62,6 +66,7 @@
6266
}
6367

6468
.drag-handle {
69+
visibility: hidden;
6570
float: left;
6671
width: 1em;
6772
cursor: move;
@@ -72,6 +77,9 @@
7277
display: inline-block;
7378
}
7479
}
80+
&:hover .drag-handle {
81+
visibility: visible;
82+
}
7583
}
7684
}
7785
}

styles/dmn-mixins.less

+10-13
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
.empty(@color: @dmn-gray) {
1+
.empty(@color: @dmn-gray-light) {
22
&:empty:before {
3-
// content: '…';
43
content: '-';
54
display: inline-block;
65
width: 100%;
@@ -76,6 +75,7 @@
7675

7776
&:after {
7877
.dmn-font;
78+
margin: 0;
7979
content: '\e807';
8080
text-align: right;
8181
font-size: 3em;
@@ -98,16 +98,17 @@
9898
content: '';
9999
position: absolute;
100100
z-index: 1;
101-
background-color: rgba(200, 200, 200, .3);
101+
background-color: rgba(200, 200, 200, .2);
102102
height: 100%;
103103
top: 0;
104104
left: 0;
105105
width: 0;
106-
.transition(width 0.218s ease);
106+
// .transition(width 0.218s ease, left 0.218s ease);
107107
}
108108

109109
&:hover:after {
110-
width: 1.6em;
110+
width: 3px;
111+
left: 2px;
111112
}
112113

113114
li:hover:after {
@@ -126,9 +127,9 @@
126127
}
127128

128129

129-
.tjs-label() {
130-
color: @dmn-gray-darker;
131-
font-weight: bold;
130+
.tjs-label(@color: @dmn-gray) {
131+
color: @color;
132+
font-weight: 700;
132133
background-color: transparent;
133134
}
134135

@@ -143,16 +144,12 @@
143144
}
144145

145146
.links-item(@color: @dmn-primary,
146-
@bg-color: @dmn-gray-light,
147+
@bg-color: @dmn-gray-lighter,
147148
@pad-horizontal: @dmn-vertical-padding,
148149
@pad-vertical: @dmn-horizontal-padding) {
149150
.link(@color);
150151
display: block;
151152
padding: @pad-horizontal @pad-vertical;
152-
153-
&:hover {
154-
background-color: @bg-color;
155-
}
156153
}
157154

158155
.borderbox() {

0 commit comments

Comments
 (0)