cavalion-vcl 1.1.72 → 1.1.74
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.md +35 -30
- package/CHANGELOG.md +24 -1
- package/SNIPPETS.md +10 -0
- package/package.json +1 -1
- package/src/Component.js +13 -8
- package/src/Control.js +6 -0
- package/src/Factory.js +15 -16
- package/src/Reader.js +31 -52
- package/src/data/Array.js +1 -1
- package/src/prototypes/App.desktop.js +3 -3
- package/src/prototypes/App.toast.js +18 -3
- package/src/prototypes/ui/forms/Home.tree.js +29 -34
- package/src/ui/List.js +1 -1
- package/src/ui/Popup.js +35 -29
- package/src/ui/Select.js +2 -1
- package/src/ui/Tree.js +3 -2
package/.md
CHANGED
|
@@ -1,38 +1,40 @@
|
|
|
1
1
|
* [CHANGELOG.md]() - [README.md]() - [package.json]()
|
|
2
|
-
* [.
|
|
2
|
+
* [SNIPPETS.md]()
|
|
3
|
+
* [.workspace](`(devtools/Workspace<${ws.getSpecializer()}>)`) - [.js]() - [src](:/)
|
|
3
4
|
|
|
4
|
-
#
|
|
5
|
+
# `2023/05/12` Gelijk trekken textRenders en rendering
|
|
5
6
|
|
|
6
|
-
*
|
|
7
|
+
* Control vs ListColumn?
|
|
8
|
+
|
|
9
|
+
# `2023/05/11` up() does not find closeable nodes
|
|
10
|
+
|
|
11
|
+
Sigh! The infamous vcl/ui/Node.closeable seems to bite me in the ass.
|
|
7
12
|
|
|
8
|
-
|
|
13
|
+
* **Solution**: Use [Node-closeable](src/vcl/ui/:.js) instead
|
|
9
14
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
*
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
* [
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
* [
|
|
27
|
-
* [
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
* [
|
|
33
|
-
* [Tree](src/ui/:.js)
|
|
34
|
-
* [Node](src/ui/:.js)
|
|
35
|
-
* [.closeable](src/ui/Node:.js)
|
|
15
|
+
# cavalion-vcl / classes
|
|
16
|
+
|
|
17
|
+
* [Factory](src/:.js) [.parse](src/Factory:.js) - [Reader](src/:.js) - [Writer](src/:.js)
|
|
18
|
+
* [CssRules](src/:.js) - [Listeners](src/:.js)
|
|
19
|
+
* **[Component](src/:.js)** [.query](src/Component:.js)
|
|
20
|
+
* **[Application](src/:.js)** - **[Action](src/:.js)**
|
|
21
|
+
* [data](src/:/) / [Array](src/data/:.js)
|
|
22
|
+
* [entities](src/:/) / [Query](src/entities/:.js) - [Instance](src/entities/:.js)
|
|
23
|
+
* **[Control](src/:.js)** < [ui](src/:/) / [Sizer](src/ui/:.js)
|
|
24
|
+
* [Element](src/ui/:.js) < [LargeIcon](src/ui/:.js) << _smdl - alert_
|
|
25
|
+
* [Input](src/ui/:.js) < [Checkbox](src/ui/:.js) - [Combobox](src/ui/:.js) - [DatePicker](src/ui/:.js)
|
|
26
|
+
* [Button](src/ui/:.js) < [PopupButton](src/ui/:.js)
|
|
27
|
+
* [Select](src/ui/:.js)
|
|
28
|
+
* [Container](src/ui/:.js)
|
|
29
|
+
* [Group](src/ui/:.js)
|
|
30
|
+
* [CheckGroup](src/ui/:.js)
|
|
31
|
+
* [Bar](src/ui/:.js)
|
|
32
|
+
* [Tabs](src/ui/:.js) - [Tab](src/ui/:.js)
|
|
33
|
+
* [Panel](src/ui/:.js)
|
|
34
|
+
* [Popup](src/ui/:.js) - [Ace](src/ui/:.js) - [Console](src/ui/:.js)
|
|
35
|
+
* ( [Form](src/ui/:.js) - [FormContainer](src/ui/:.js) ) _where does onActive/Deactive go?_
|
|
36
|
+
* [List](src/ui/:.js) | [ListColumn](src/ui/:.js) - [ListBody](src/ui/:.js) - [ListFooter](src/ui/:.js) - [ListHeader](src/ui/:.js) - [ListRow](src/ui/:.js)
|
|
37
|
+
* [Tree](src/ui/:.js) - [Node](src/ui/:.js) [.closeable](src/ui/Node:.js)
|
|
36
38
|
|
|
37
39
|
# prototypes `2022/04/17`
|
|
38
40
|
|
|
@@ -61,4 +63,7 @@
|
|
|
61
63
|
* [Query](src/prototypes/ui/entities/:.js) - [.scaffold](src/prototypes/ui/entities/Query:.js) - [scaffold.future](src/prototypes/ui/entities/Query:.js)
|
|
62
64
|
* [QueryFilters](src/prototypes/ui/entities/:.js)
|
|
63
65
|
|
|
66
|
+
# cavalion-entities // va-objects
|
|
67
|
+
|
|
68
|
+
* Interpret, modify, kvp via a model
|
|
64
69
|
|
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,27 @@
|
|
|
1
|
+
### 2023/05/29 - 1.1.74
|
|
2
|
+
|
|
3
|
+
* Node.closeable deprecated
|
|
4
|
+
|
|
5
|
+
* `af4757a` - refactors Node.closeable => Node-closeable updates loading style for Nodes adds SNIPPETS.md
|
|
6
|
+
|
|
7
|
+
* Adding debugging tools
|
|
8
|
+
|
|
9
|
+
* `3d7b43e` - adds Control.tree() - useful for debugging nested structure of controls
|
|
10
|
+
* `9421731` - adds dumpControls snippet removes comments fixes deps global
|
|
11
|
+
|
|
12
|
+
* Working on vcl/prototype
|
|
13
|
+
|
|
14
|
+
* `1720907` - fixes message params situation
|
|
15
|
+
* `fc159df` - fixes ms situation with toasts fixes toast styles
|
|
16
|
+
|
|
17
|
+
* Minor changes
|
|
18
|
+
|
|
19
|
+
* `6e3222b` - updates toast style
|
|
20
|
+
|
|
21
|
+
### 2023/03/26 - 1.1.73
|
|
22
|
+
|
|
23
|
+
* Fixes issues with Component.getImplicitBasesByUri
|
|
24
|
+
|
|
1
25
|
### 2022/12/11 - 1.1.72
|
|
2
26
|
|
|
3
27
|
* ListHeader: Fixes the rendering bug which appeared in Chrome 107+
|
|
@@ -9,7 +33,6 @@
|
|
|
9
33
|
* Query: fixes some bug in error handling
|
|
10
34
|
* List: improves rendering while loading
|
|
11
35
|
|
|
12
|
-
|
|
13
36
|
### 2022/10/30 - 1.1.70
|
|
14
37
|
|
|
15
38
|
`#VA-20221028-1`, `-2` & `-3`
|
package/SNIPPETS.md
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# `2023/05/06` Snippet
|
|
2
|
+
|
|
3
|
+
const dumpControls = (parent) => parent.getControls().reduce((r, c) => {
|
|
4
|
+
r[js.nameOf(c)] = dumpControls(c);
|
|
5
|
+
return r;
|
|
6
|
+
}, Object.create(parent, { hashCode: { value: () => ";-)" } }));
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
* [Control.js](src/Control.js) - require("vcl/Control").dump
|
|
10
|
+
|
package/package.json
CHANGED
package/src/Component.js
CHANGED
|
@@ -1232,7 +1232,11 @@ define(function (require) {
|
|
|
1232
1232
|
if (base !== null) {
|
|
1233
1233
|
var keys = Component.getKeysByUri(uri);
|
|
1234
1234
|
var classes = keys.classes;
|
|
1235
|
-
var spec_classes = keys.specializer_classes;
|
|
1235
|
+
var spec_classes = [].concat(keys.specializer_classes);
|
|
1236
|
+
|
|
1237
|
+
// Always inherit the implicit base first
|
|
1238
|
+
r.push(base);
|
|
1239
|
+
|
|
1236
1240
|
if (classes.length > 1) {
|
|
1237
1241
|
// [A] Each class expands
|
|
1238
1242
|
classes.forEach(function (cls) {
|
|
@@ -1240,10 +1244,11 @@ define(function (require) {
|
|
|
1240
1244
|
r.push(Component.getUriByKeys(keys));
|
|
1241
1245
|
});
|
|
1242
1246
|
} else if (classes.length === 1) {
|
|
1243
|
-
if (spec_classes.length > 1) {
|
|
1247
|
+
if (spec_classes.length/* > 1*/) {
|
|
1244
1248
|
// [B] Each specializer_class expands
|
|
1245
1249
|
spec_classes.forEach(function (cls) {
|
|
1246
|
-
keys.specializer_classes = [
|
|
1250
|
+
keys.specializer_classes = [];
|
|
1251
|
+
keys.specializer = cls;
|
|
1247
1252
|
r.push(Component.getUriByKeys(keys));
|
|
1248
1253
|
});
|
|
1249
1254
|
} else if (spec_classes.length === 1) {
|
|
@@ -1261,10 +1266,12 @@ define(function (require) {
|
|
|
1261
1266
|
} else {
|
|
1262
1267
|
// [J] equals [G], continue on prototypes/ prefix
|
|
1263
1268
|
}
|
|
1264
|
-
} else if (spec_classes.length > 1) {
|
|
1269
|
+
} else if (spec_classes.length/* > 1*/) {
|
|
1265
1270
|
// [E] Each specializer_class expands
|
|
1266
1271
|
spec_classes.forEach(function (cls) {
|
|
1267
|
-
keys.specializer_classes = [cls];
|
|
1272
|
+
// keys.specializer_classes = [cls];
|
|
1273
|
+
keys.specializer_classes = [];
|
|
1274
|
+
keys.specializer = cls;
|
|
1268
1275
|
r.push(Component.getUriByKeys(keys));
|
|
1269
1276
|
});
|
|
1270
1277
|
} else if (spec_classes.length === 1) {
|
|
@@ -1279,8 +1286,6 @@ define(function (require) {
|
|
|
1279
1286
|
// empty specifier due to: ComponentClass<>
|
|
1280
1287
|
}
|
|
1281
1288
|
|
|
1282
|
-
// Always inherit the implicit base
|
|
1283
|
-
r.push(base);
|
|
1284
1289
|
|
|
1285
1290
|
} else if (uri.indexOf(Factory.PREFIX_PROTOTYPES) !== 0) {
|
|
1286
1291
|
r.push(String.format("%s%s", Factory.PREFIX_PROTOTYPES, uri));
|
|
@@ -1517,7 +1522,7 @@ define(function (require) {
|
|
|
1517
1522
|
type: Type.EVENT
|
|
1518
1523
|
},
|
|
1519
1524
|
"onDispatchChildEvent": {
|
|
1520
|
-
type: Type.EVENT
|
|
1525
|
+
type: Type.EVENT // component, name, evt, f, args) {
|
|
1521
1526
|
},
|
|
1522
1527
|
"onMessage": {
|
|
1523
1528
|
type: Type.EVENT
|
package/src/Control.js
CHANGED
|
@@ -1852,6 +1852,12 @@ this._updateCalls = this._updateCalls || 0; this._updateCalls++;
|
|
|
1852
1852
|
updateCallCount: 0,
|
|
1853
1853
|
|
|
1854
1854
|
focused: null,
|
|
1855
|
+
|
|
1856
|
+
tree: (root) => root.getControls().reduce((r, c) => {
|
|
1857
|
+
r[js.nameOf(c)] = Control.tree(c);
|
|
1858
|
+
return r;
|
|
1859
|
+
}, Object.create(root, { hashCode: { value: () => ";-)" } })),
|
|
1860
|
+
|
|
1855
1861
|
|
|
1856
1862
|
findByNode: function(node) {
|
|
1857
1863
|
while(node !== null && node[EventDispatcher.elementKey] === undefined) {
|
package/src/Factory.js
CHANGED
|
@@ -141,21 +141,17 @@ define(function(require) {
|
|
|
141
141
|
},
|
|
142
142
|
load: function(source, success, failure) {
|
|
143
143
|
if(source.charAt(0) === "\"" && source.indexOf("\"use strict\";") !== 0) {
|
|
144
|
+
/*- Parse require section */
|
|
144
145
|
if(source.indexOf("\"use ") === 0) {
|
|
145
|
-
// TODO this should be the default
|
|
146
|
-
source = "\"" + source.substring(5);
|
|
146
|
+
source = "\"" + source.substring(5); // TODO this should be the default
|
|
147
147
|
}
|
|
148
|
-
/*- Parse require section */
|
|
149
148
|
var i = source.indexOf("\";");
|
|
150
149
|
if(i !== -1) {
|
|
151
|
-
deps = source.substring(1, i).replace(/\s/g, "");
|
|
152
|
-
deps = deps.split(",");
|
|
153
|
-
|
|
150
|
+
var deps = source.substring(1, i).replace(/\s/g, "");
|
|
154
151
|
/*- require all dependecies */
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
}, failure);
|
|
152
|
+
return this._parentRequire(deps.split(","),
|
|
153
|
+
() => this.doLoad(source, success, failure),
|
|
154
|
+
failure);
|
|
159
155
|
}
|
|
160
156
|
}
|
|
161
157
|
return this.doLoad(source, success, failure);
|
|
@@ -515,6 +511,12 @@ define(function(require) {
|
|
|
515
511
|
DEFAULT_NAMESPACES: {
|
|
516
512
|
},
|
|
517
513
|
|
|
514
|
+
overrides: function(reg, req) {
|
|
515
|
+
for(var k in reg) {
|
|
516
|
+
define(js.sf("vcl/Factory!%s", k), reg[k], new Factory(req || window.require, k))
|
|
517
|
+
}
|
|
518
|
+
},
|
|
519
|
+
|
|
518
520
|
implicit_sources: {},
|
|
519
521
|
|
|
520
522
|
load: function(name, parentRequire, load, config) {
|
|
@@ -530,13 +532,10 @@ define(function(require) {
|
|
|
530
532
|
var p = "";//local ? ".skip-fetch.local" : "";
|
|
531
533
|
var factory = new Factory(parentRequire, name + p, sourceUri + p);
|
|
532
534
|
// console.log("instantiate", name + p);
|
|
533
|
-
factory.load(source,
|
|
534
|
-
load(factory, source);
|
|
535
|
-
});
|
|
535
|
+
factory.load(source, () => load(factory, source));
|
|
536
536
|
}
|
|
537
537
|
|
|
538
538
|
function fallback() {
|
|
539
|
-
// console.log("fallback");
|
|
540
539
|
parentRequire([sourceUri], instantiate, function(err) {
|
|
541
540
|
// Source not found, assume it...
|
|
542
541
|
var source = Component.getImplicitSourceByUri(name);
|
|
@@ -545,12 +544,13 @@ define(function(require) {
|
|
|
545
544
|
}
|
|
546
545
|
//console.log("304", name, "-->", source);
|
|
547
546
|
Factory.implicit_sources[sourceUri] = source;
|
|
547
|
+
// console.log(name, "implicit source generated", source);
|
|
548
548
|
instantiate(source);
|
|
549
549
|
});
|
|
550
550
|
}
|
|
551
551
|
|
|
552
552
|
if(name.endsWith(".skip-fetch")) {
|
|
553
|
-
console.log("skip-fetch", name);
|
|
553
|
+
// console.log("skip-fetch", name);
|
|
554
554
|
name = name.split(".");
|
|
555
555
|
name.pop();
|
|
556
556
|
name = name.join(".");
|
|
@@ -660,6 +660,5 @@ console.log("skip-fetch", name);
|
|
|
660
660
|
},
|
|
661
661
|
getFactoryUri: getFactoryUri
|
|
662
662
|
}
|
|
663
|
-
|
|
664
663
|
}));
|
|
665
664
|
});
|
package/src/Reader.js
CHANGED
|
@@ -26,9 +26,6 @@ define(function(require) {
|
|
|
26
26
|
_uri: null,
|
|
27
27
|
_references: null,
|
|
28
28
|
|
|
29
|
-
/**
|
|
30
|
-
*
|
|
31
|
-
*/
|
|
32
29
|
constructor: function(factory, root) {
|
|
33
30
|
this._factory = factory;
|
|
34
31
|
if(root !== undefined) {
|
|
@@ -36,17 +33,17 @@ define(function(require) {
|
|
|
36
33
|
}
|
|
37
34
|
},
|
|
38
35
|
|
|
39
|
-
/**
|
|
40
|
-
* Read the source of a component. Basically instantiates a
|
|
41
|
-
* component
|
|
42
|
-
*
|
|
43
|
-
* @param source
|
|
44
|
-
* The actual source
|
|
45
|
-
* @param uri
|
|
46
|
-
* The uri of the source and thus the resulting root
|
|
47
|
-
* component
|
|
48
|
-
*/
|
|
49
36
|
read: function(source, uri) {
|
|
37
|
+
/**
|
|
38
|
+
* Read the source of a component. Basically instantiates a
|
|
39
|
+
* component
|
|
40
|
+
*
|
|
41
|
+
* @param source
|
|
42
|
+
* The actual source
|
|
43
|
+
* @param uri
|
|
44
|
+
* The uri of the source and thus the resulting root
|
|
45
|
+
* component
|
|
46
|
+
*/
|
|
50
47
|
var deferred = new Deferred();
|
|
51
48
|
var thisObj = this;
|
|
52
49
|
|
|
@@ -81,22 +78,21 @@ define(function(require) {
|
|
|
81
78
|
|
|
82
79
|
return deferred;
|
|
83
80
|
},
|
|
84
|
-
|
|
85
|
-
/**
|
|
86
|
-
* Instantiates a component based upon a definition hold by a node
|
|
87
|
-
* which was delivered/parsed by Reader.evaluate. It figures out
|
|
88
|
-
* whether the node references a inherited ComponentClass or
|
|
89
|
-
* inherited component.
|
|
90
|
-
*
|
|
91
|
-
* @param node
|
|
92
|
-
* The actual node holding information to it's inherited
|
|
93
|
-
* prototypes, name, properties, children
|
|
94
|
-
* @param success
|
|
95
|
-
* To receive the component
|
|
96
|
-
* @param failure
|
|
97
|
-
* To receive errors
|
|
98
|
-
*/
|
|
99
81
|
instantiateComponent: function(node, success, failure) {
|
|
82
|
+
/**
|
|
83
|
+
* Instantiates a component based upon a definition hold by a node
|
|
84
|
+
* which was delivered/parsed by Reader.evaluate. It figures out
|
|
85
|
+
* whether the node references a inherited ComponentClass or
|
|
86
|
+
* inherited component.
|
|
87
|
+
*
|
|
88
|
+
* @param node
|
|
89
|
+
* The actual node holding information to it's inherited
|
|
90
|
+
* prototypes, name, properties, children
|
|
91
|
+
* @param success
|
|
92
|
+
* To receive the component
|
|
93
|
+
* @param failure
|
|
94
|
+
* To receive errors
|
|
95
|
+
*/
|
|
100
96
|
var component, me = this;
|
|
101
97
|
if(node.inherits instanceof Array) {
|
|
102
98
|
// inherits (a) ComponentClass-instance(s), require all the
|
|
@@ -133,10 +129,6 @@ define(function(require) {
|
|
|
133
129
|
success(component);
|
|
134
130
|
}
|
|
135
131
|
},
|
|
136
|
-
|
|
137
|
-
/**
|
|
138
|
-
*
|
|
139
|
-
*/
|
|
140
132
|
createRootComponent: function(rootNode, success, failure) {
|
|
141
133
|
var me = this;
|
|
142
134
|
|
|
@@ -185,10 +177,6 @@ define(function(require) {
|
|
|
185
177
|
f(this._root);
|
|
186
178
|
}
|
|
187
179
|
},
|
|
188
|
-
|
|
189
|
-
/**
|
|
190
|
-
*
|
|
191
|
-
*/
|
|
192
180
|
initializeComponent: function(component, node, success, failure) {
|
|
193
181
|
if(component !== this._root) {
|
|
194
182
|
// This is an owned/nested component
|
|
@@ -220,10 +208,6 @@ define(function(require) {
|
|
|
220
208
|
success(component);
|
|
221
209
|
}
|
|
222
210
|
},
|
|
223
|
-
|
|
224
|
-
/**
|
|
225
|
-
*
|
|
226
|
-
*/
|
|
227
211
|
createComponents: function(nodes, success, failure) {
|
|
228
212
|
var count = nodes.length;
|
|
229
213
|
var result;
|
|
@@ -245,16 +229,12 @@ define(function(require) {
|
|
|
245
229
|
});
|
|
246
230
|
}
|
|
247
231
|
},
|
|
248
|
-
|
|
249
|
-
/**
|
|
250
|
-
*
|
|
251
|
-
*/
|
|
252
232
|
setProperties: function(component, node) {
|
|
253
233
|
// extend properties
|
|
254
234
|
component['@properties'] = js.extend(component['@properties'] || {}, node.properties);
|
|
255
235
|
|
|
256
236
|
var properties = component.defineProperties();
|
|
257
|
-
for(
|
|
237
|
+
for(var k in node.properties) {
|
|
258
238
|
var property;
|
|
259
239
|
if((property = properties[k]) === undefined) {
|
|
260
240
|
// console.warn(String.format("Property %n.%s does not exist - %n", component.constructor, k,
|
|
@@ -265,14 +245,13 @@ define(function(require) {
|
|
|
265
245
|
}
|
|
266
246
|
}
|
|
267
247
|
},
|
|
268
|
-
|
|
269
|
-
/**
|
|
270
|
-
*
|
|
271
|
-
* @param property
|
|
272
|
-
* @param component
|
|
273
|
-
* @param value
|
|
274
|
-
*/
|
|
275
248
|
setPropertyValue: function(property, component, value) {
|
|
249
|
+
/**
|
|
250
|
+
*
|
|
251
|
+
* @param property
|
|
252
|
+
* @param component
|
|
253
|
+
* @param value
|
|
254
|
+
*/
|
|
276
255
|
if(property.isReference()) {
|
|
277
256
|
this._references.push({
|
|
278
257
|
property: property,
|
package/src/data/Array.js
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
var scope = this.getScope();
|
|
16
16
|
var elem = new Element(this);
|
|
17
17
|
|
|
18
|
-
var timeout = options.hasOwnProperty("timeout") ? options.timeout : 1500;
|
|
18
|
+
var timeout = options.ms || (options.hasOwnProperty("timeout") ? options.timeout : 1500);
|
|
19
19
|
var content = options.content || "No toast content";
|
|
20
20
|
var classes = options.classes || "fade";
|
|
21
21
|
|
|
@@ -64,9 +64,10 @@
|
|
|
64
64
|
},
|
|
65
65
|
right: "0",
|
|
66
66
|
left: "0",
|
|
67
|
-
bottom: "
|
|
67
|
+
bottom: "20px",
|
|
68
68
|
"z-index": "20000",
|
|
69
69
|
"pointer-events": "none",
|
|
70
|
+
|
|
70
71
|
".{./Element}": {
|
|
71
72
|
"pointer-events": "all",
|
|
72
73
|
"a": {
|
|
@@ -117,7 +118,21 @@
|
|
|
117
118
|
"&.padding-right-20px": {
|
|
118
119
|
"padding-right": "20px"
|
|
119
120
|
},
|
|
120
|
-
|
|
121
|
+
"&.centered": {
|
|
122
|
+
"text-align": "center",
|
|
123
|
+
// ".{./Element}": {
|
|
124
|
+
"margin-left": "auto",
|
|
125
|
+
"margin-right": "auto",
|
|
126
|
+
"text-align": "left",
|
|
127
|
+
"float": "none"
|
|
128
|
+
// },
|
|
129
|
+
},
|
|
130
|
+
"&.paragraph": {
|
|
131
|
+
'max-width': "35%"
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
|
|
135
|
+
|
|
121
136
|
}
|
|
122
137
|
}]
|
|
123
138
|
]];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"vcl/ui/LargeIcon, vcl/ui/Node, vcl/ui/FormContainer, vcl/ui/Node
|
|
1
|
+
"vcl/ui/LargeIcon, vcl/ui/Node, vcl/ui/FormContainer, vcl/ui/Node-closeable";
|
|
2
2
|
|
|
3
3
|
var Node = require("vcl/ui/Node");
|
|
4
4
|
var FormContainer = require("vcl/ui/FormContainer");
|
|
@@ -219,7 +219,7 @@ var Handlers = {
|
|
|
219
219
|
}
|
|
220
220
|
};
|
|
221
221
|
|
|
222
|
-
["", {
|
|
222
|
+
[(""), {
|
|
223
223
|
vars: {
|
|
224
224
|
"App": {
|
|
225
225
|
getState: function() {
|
|
@@ -297,22 +297,16 @@ var Handlers = {
|
|
|
297
297
|
}
|
|
298
298
|
}
|
|
299
299
|
},
|
|
300
|
-
onMessage: function(name,
|
|
300
|
+
onMessage: function(name, message, sender) {
|
|
301
301
|
var scope = this.getScope();
|
|
302
302
|
|
|
303
303
|
if(name === "openform") {
|
|
304
|
-
var Node = require("vcl/ui/Node
|
|
304
|
+
var Node = require("vcl/ui/Node-closeable");
|
|
305
305
|
var FormContainer = require("vcl/ui/FormContainer");
|
|
306
306
|
|
|
307
307
|
// TODO Merge with Portal
|
|
308
308
|
|
|
309
|
-
var parent =
|
|
310
|
-
|
|
311
|
-
// TODO find the correct parent based upon the sender
|
|
312
|
-
// while(parent && parent.getVar("control")._form !== sender._owner) {
|
|
313
|
-
// parent = parent._parent;
|
|
314
|
-
// }
|
|
315
|
-
|
|
309
|
+
var parent = message.parent || scope.tree.getSelection()[0];
|
|
316
310
|
var node = new Node(this);
|
|
317
311
|
node.override({
|
|
318
312
|
onclick: function(evt) {
|
|
@@ -326,21 +320,22 @@ var Handlers = {
|
|
|
326
320
|
node.addClass("closeable");
|
|
327
321
|
|
|
328
322
|
var container = new FormContainer(node);
|
|
329
|
-
container.setFormUri(
|
|
330
|
-
if(
|
|
331
|
-
container.setFormParams(
|
|
332
|
-
node.setVars(
|
|
323
|
+
container.setFormUri(message.uri);
|
|
324
|
+
if(message.params) {
|
|
325
|
+
container.setFormParams(message.params);
|
|
326
|
+
node.setVars(message.params);
|
|
333
327
|
}
|
|
334
328
|
|
|
335
|
-
if(
|
|
336
|
-
node.print("varring path",
|
|
337
|
-
node.vars("path",
|
|
329
|
+
if(message.path) {
|
|
330
|
+
node.print("varring path", message.path);
|
|
331
|
+
node.vars("path", message.path);
|
|
338
332
|
}
|
|
339
333
|
|
|
340
334
|
// @overrides ui/forms/Home<>
|
|
341
335
|
container.setVisible(false);
|
|
342
336
|
container.setParent(scope.client);
|
|
343
|
-
|
|
337
|
+
|
|
338
|
+
node.setText(message.text || message.title || " ");
|
|
344
339
|
node.setVar("control", container);
|
|
345
340
|
node.setParent(parent || scope.tree);
|
|
346
341
|
node.update(function() {
|
|
@@ -354,12 +349,12 @@ var Handlers = {
|
|
|
354
349
|
},
|
|
355
350
|
"formloadstart": function() {
|
|
356
351
|
node.addClass("loading");
|
|
357
|
-
node.setText(
|
|
352
|
+
node.setText(message.title || " ");
|
|
358
353
|
},
|
|
359
354
|
"formloadend": function() {
|
|
360
355
|
node.removeClass("loading");
|
|
361
|
-
if(
|
|
362
|
-
|
|
356
|
+
if(message.callback) {
|
|
357
|
+
message.callback(this._form);
|
|
363
358
|
}
|
|
364
359
|
},
|
|
365
360
|
"formload": function() {
|
|
@@ -370,7 +365,7 @@ var Handlers = {
|
|
|
370
365
|
if (text instanceof Array) {
|
|
371
366
|
node.setText(text.join(""));
|
|
372
367
|
} else {
|
|
373
|
-
node.setText(String.format("%H", text ||
|
|
368
|
+
node.setText(String.format("%H", text || message.title));
|
|
374
369
|
}
|
|
375
370
|
}
|
|
376
371
|
form.on("captionchanged", f);
|
|
@@ -382,17 +377,17 @@ var Handlers = {
|
|
|
382
377
|
parent.setExpanded(true);
|
|
383
378
|
}
|
|
384
379
|
|
|
385
|
-
if(
|
|
380
|
+
if(message.activate !== false) {
|
|
386
381
|
scope.tree.setSelection([node]);
|
|
387
|
-
} else if(
|
|
382
|
+
} else if(message.lazyLoad !== true) {
|
|
388
383
|
container.forceLoad();
|
|
389
384
|
}
|
|
390
385
|
|
|
391
|
-
parent && parent.setTimeout("update", () => {
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
}, 500);
|
|
386
|
+
// parent && parent.setTimeout("update", () => {
|
|
387
|
+
// // Hmprf, what is going on here?
|
|
388
|
+
// parent._parent.updateChildren(true, true);
|
|
389
|
+
// parent._parent.updateChildren(true, true);
|
|
390
|
+
// }, 500);
|
|
396
391
|
|
|
397
392
|
return true;
|
|
398
393
|
}
|
|
@@ -407,11 +402,11 @@ var Handlers = {
|
|
|
407
402
|
"padding-left": "16px",
|
|
408
403
|
".{./Node}": {
|
|
409
404
|
"&.loading": {
|
|
410
|
-
"background-image": "url(/shared/vcl/images/loading.gif)",
|
|
411
|
-
"background-repeat": "no-repeat",
|
|
412
|
-
"background-position": "-8px 4px",
|
|
413
405
|
">.selection": {
|
|
414
|
-
|
|
406
|
+
"background-image": "url(/shared/vcl/images/loading.gif)",
|
|
407
|
+
"background-repeat": "no-repeat",
|
|
408
|
+
"background-position": "10px 5px",
|
|
409
|
+
// "opacity": "0.5"
|
|
415
410
|
},
|
|
416
411
|
"&.selected >.text": {
|
|
417
412
|
"font-weight": "normal"
|
package/src/ui/List.js
CHANGED
|
@@ -191,7 +191,7 @@ define(function(require) {
|
|
|
191
191
|
s.left = String.format("%dpx", bw);
|
|
192
192
|
s.top = String.format("%dpx", bh + rect.top);
|
|
193
193
|
|
|
194
|
-
thisObj._body.setBounds(rect.left, rect.top, undefined, undefined, bw, bh);
|
|
194
|
+
thisObj._body.setBounds(rect.left, rect.top - 3, undefined, undefined, bw, bh);
|
|
195
195
|
}];
|
|
196
196
|
|
|
197
197
|
args.callee = arguments.callee;
|
package/src/ui/Popup.js
CHANGED
|
@@ -15,25 +15,20 @@ define(function(require) {
|
|
|
15
15
|
|
|
16
16
|
this._hook = new DocumentHook(undefined, true);
|
|
17
17
|
js.mixIn(this._hook, {
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
*
|
|
21
|
-
*/
|
|
22
|
-
keydown: function(evt) {
|
|
18
|
+
keydown: (evt) => {
|
|
23
19
|
if(evt.keyCode === 27) {
|
|
24
20
|
popup.close();
|
|
25
21
|
evt.preventDefault();
|
|
26
22
|
}
|
|
27
23
|
},
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
*/
|
|
32
|
-
click: function(evt) {
|
|
33
|
-
if(!HtmlElement.hasParent(evt.target, popup._node)) {
|
|
24
|
+
click: (evt) => {
|
|
25
|
+
var hasParent = HtmlElement.hasParent(evt.target, popup._node);
|
|
26
|
+
if(popup._autoClose || !hasParent) {
|
|
34
27
|
popup.close();
|
|
35
|
-
|
|
36
|
-
|
|
28
|
+
if(!hasParent) {
|
|
29
|
+
evt.bubbleUp = false;
|
|
30
|
+
evt.preventDefault(); // for A's
|
|
31
|
+
}
|
|
37
32
|
}
|
|
38
33
|
}
|
|
39
34
|
});
|
|
@@ -45,6 +40,7 @@ define(function(require) {
|
|
|
45
40
|
},
|
|
46
41
|
|
|
47
42
|
_visible: false,
|
|
43
|
+
_autoClose: true,
|
|
48
44
|
_autoSize: "both",
|
|
49
45
|
_hook: null,
|
|
50
46
|
|
|
@@ -58,25 +54,29 @@ define(function(require) {
|
|
|
58
54
|
* @param relativeTo
|
|
59
55
|
* @param onClose
|
|
60
56
|
*/
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
57
|
+
const align = () => {
|
|
58
|
+
|
|
59
|
+
var p = relativeTo.clientToDocument(0, 0);
|
|
60
|
+
var cs = relativeTo.getComputedStyle();
|
|
61
|
+
var cs_ = this.getComputedStyle();
|
|
62
|
+
|
|
63
|
+
if(this._parent) {
|
|
64
|
+
p = this._parent.documentToClient(p);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
if(position.origin === "bottom-left") {
|
|
68
|
+
this.setLeft(p.x + (position.dx || 0));
|
|
69
|
+
this.setTop(p.y + parseInt(cs.height, 10) + (position.dy || 0));
|
|
70
|
+
} else if(position.origin === "bottom-right") {
|
|
71
|
+
this.setLeft(p.x + parseInt(cs.width, 10) + (position.dx || 0) - parseInt(cs_.width, 10));
|
|
72
|
+
this.setTop(p.y + parseInt(cs.height, 10) + (position.dy || 0));
|
|
73
|
+
}
|
|
74
|
+
};
|
|
69
75
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
this.setTop(p.y + parseInt(cs.height, 10) + (position.dy || 0));
|
|
73
|
-
} else if(position.origin === "bottom-right") {
|
|
74
|
-
this.setLeft(p.x + parseInt(cs.width, 10) + (position.dx || 0) - parseInt(cs_.width, 10));
|
|
75
|
-
this.setTop(p.y + parseInt(cs.height, 10) + (position.dy || 0));
|
|
76
|
-
}
|
|
76
|
+
var n = 2;
|
|
77
|
+
if(!this._hook.isActive()) {
|
|
77
78
|
|
|
78
79
|
this.setVisible(true);
|
|
79
|
-
|
|
80
80
|
this._hook.activate();
|
|
81
81
|
|
|
82
82
|
this._hook.release = function() {
|
|
@@ -86,8 +86,11 @@ define(function(require) {
|
|
|
86
86
|
onClose();
|
|
87
87
|
};
|
|
88
88
|
|
|
89
|
+
this.update(align);
|
|
89
90
|
this.onpopup();
|
|
90
91
|
}
|
|
92
|
+
|
|
93
|
+
align();
|
|
91
94
|
},
|
|
92
95
|
close: function() {
|
|
93
96
|
if(this._hook.isActive()) {
|
|
@@ -134,6 +137,9 @@ define(function(require) {
|
|
|
134
137
|
}
|
|
135
138
|
},
|
|
136
139
|
properties: {
|
|
140
|
+
"autoClose": {
|
|
141
|
+
type: Class.Type.BOOLEAN
|
|
142
|
+
},
|
|
137
143
|
"onPopup": {
|
|
138
144
|
type: Class.Type.EVENT
|
|
139
145
|
},
|
package/src/ui/Select.js
CHANGED
package/src/ui/Tree.js
CHANGED
|
@@ -28,13 +28,14 @@ define(function (require) {
|
|
|
28
28
|
},
|
|
29
29
|
".{./Node}": {
|
|
30
30
|
display: "block",
|
|
31
|
+
cursor: "pointer",
|
|
31
32
|
"list-style-type": "none",
|
|
32
33
|
"white-space": "nowrap",
|
|
33
34
|
">.close": {
|
|
34
35
|
position: "absolute",
|
|
35
36
|
right: "4px",
|
|
36
37
|
"padding-top": "2px",
|
|
37
|
-
cursor: "pointer",
|
|
38
|
+
// cursor: "pointer",
|
|
38
39
|
display: "none"
|
|
39
40
|
},
|
|
40
41
|
">ol": {
|
|
@@ -75,8 +76,8 @@ define(function (require) {
|
|
|
75
76
|
},
|
|
76
77
|
">.text": {
|
|
77
78
|
'input[type=checkbox]': `position:relative;top:${checkbox_top}px;`,
|
|
78
|
-
cursor: "pointer",
|
|
79
79
|
position: "relative",
|
|
80
|
+
// cursor: "pointer",//"default",
|
|
80
81
|
// width: "100%",
|
|
81
82
|
display: 'inline-block',
|
|
82
83
|
'margin-left': "2px",
|