neo.mjs 6.5.9 → 6.6.0
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/apps/ServiceWorker.mjs +2 -2
- package/apps/sharedcovid/view/MainContainerController.mjs +3 -3
- package/examples/ServiceWorker.mjs +2 -2
- package/examples/dialog/DemoDialog.mjs +42 -3
- package/examples/dialog/MainContainer.mjs +9 -1
- package/examples/tabs/MainContainer.mjs +2 -2
- package/package.json +1 -1
- package/resources/scss/src/dialog/Base.scss +21 -16
- package/src/DefaultConfig.mjs +2 -2
- package/src/calendar/view/SettingsContainer.mjs +2 -2
- package/src/component/Base.mjs +25 -13
- package/src/component/Splitter.mjs +4 -4
- package/src/controller/Component.mjs +2 -6
- package/src/dialog/Base.mjs +165 -161
- package/src/form/field/FileUpload.mjs +35 -21
- package/src/grid/View.mjs +1 -1
- package/src/main/DomAccess.mjs +83 -46
- package/src/menu/List.mjs +1 -1
- package/src/model/Component.mjs +2 -6
package/apps/ServiceWorker.mjs
CHANGED
@@ -255,10 +255,10 @@ class MainContainerController extends ComponentController {
|
|
255
255
|
|
256
256
|
console.log('onAppConnect', name);
|
257
257
|
|
258
|
-
switch
|
258
|
+
switch(name) {
|
259
259
|
case 'SharedCovidChart':
|
260
|
-
view
|
261
|
-
parentView =
|
260
|
+
view = me.getReference('controls-panel');
|
261
|
+
parentView = view.parent;
|
262
262
|
parentView.storeReferences();
|
263
263
|
|
264
264
|
toolbar = me.getReference('controls-panel-header');
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import Button from '../../src/button/Base.mjs';
|
1
2
|
import Dialog from '../../src/dialog/Base.mjs';
|
2
3
|
import SelectField from '../../src/form/field/Select.mjs';
|
3
4
|
|
@@ -13,9 +14,18 @@ class DemoDialog extends Dialog {
|
|
13
14
|
|
14
15
|
wrapperStyle: {
|
15
16
|
width : '40%'
|
16
|
-
}
|
17
|
+
}
|
18
|
+
}
|
19
|
+
|
20
|
+
/**
|
21
|
+
* @param {Object} config
|
22
|
+
*/
|
23
|
+
construct(config) {
|
24
|
+
super.construct(config);
|
25
|
+
|
26
|
+
const me = this;
|
17
27
|
|
18
|
-
items
|
28
|
+
me.items = [{
|
19
29
|
module : SelectField,
|
20
30
|
labelText: 'Select',
|
21
31
|
|
@@ -33,7 +43,36 @@ class DemoDialog extends Dialog {
|
|
33
43
|
return result;
|
34
44
|
})()
|
35
45
|
}
|
36
|
-
}
|
46
|
+
}, {
|
47
|
+
module : Button,
|
48
|
+
handler: me.createDialog.bind(me),
|
49
|
+
iconCls: 'fa fa-window-maximize',
|
50
|
+
text : 'Create new modal Dialog',
|
51
|
+
}];
|
52
|
+
}
|
53
|
+
|
54
|
+
/**
|
55
|
+
* @param {Object} data
|
56
|
+
*/
|
57
|
+
createDialog(data) {
|
58
|
+
let me = this;
|
59
|
+
|
60
|
+
data.component.disabled = true;
|
61
|
+
|
62
|
+
me.dialog = Neo.create(DemoDialog, {
|
63
|
+
appName : me.appName,
|
64
|
+
boundaryContainerId: me.boundaryContainerId,
|
65
|
+
listeners : {close: me.onWindowClose, scope: me},
|
66
|
+
modal : true
|
67
|
+
});
|
68
|
+
}
|
69
|
+
|
70
|
+
onWindowClose() {
|
71
|
+
let button = this.down({
|
72
|
+
text: 'Create new modal Dialog'
|
73
|
+
});
|
74
|
+
|
75
|
+
button.disabled = false;
|
37
76
|
}
|
38
77
|
}
|
39
78
|
|
@@ -50,6 +50,13 @@ class MainContainer extends Viewport {
|
|
50
50
|
listeners : {change: me.onDragLimitChange, scope: me},
|
51
51
|
style : {marginLeft: '3em'},
|
52
52
|
valueLabelText: 'Limit Drag&Drop to the document.body'
|
53
|
+
}, {
|
54
|
+
module : CheckBox,
|
55
|
+
checked : true,
|
56
|
+
hideLabel : true,
|
57
|
+
hideValueLabel: false,
|
58
|
+
style : {marginLeft: '3em'},
|
59
|
+
valueLabelText: 'Modal'
|
53
60
|
}, '->', {
|
54
61
|
module : Button,
|
55
62
|
handler: me.switchTheme.bind(me),
|
@@ -71,7 +78,8 @@ class MainContainer extends Viewport {
|
|
71
78
|
animateTargetId : data.component.id,
|
72
79
|
appName : me.appName,
|
73
80
|
boundaryContainerId: me.boundaryContainerId,
|
74
|
-
listeners : {close: me.onWindowClose, scope: me}
|
81
|
+
listeners : {close: me.onWindowClose, scope: me},
|
82
|
+
modal : me.down({ valueLabelText : 'Modal' }).checked
|
75
83
|
});
|
76
84
|
}
|
77
85
|
|
@@ -97,7 +97,7 @@ class MainContainer extends TabContainer {
|
|
97
97
|
text : 'Move Fields',
|
98
98
|
handler: function () {
|
99
99
|
let field = Neo.getComponent('firstNameField'),
|
100
|
-
parent =
|
100
|
+
parent = field.parent,
|
101
101
|
cn = parent.vdom.cn,
|
102
102
|
tmp = cn[1];
|
103
103
|
|
@@ -114,7 +114,7 @@ class MainContainer extends TabContainer {
|
|
114
114
|
text : 'Insert Textfield',
|
115
115
|
handler: function () {
|
116
116
|
let button = Neo.getComponent('firstNameField'),
|
117
|
-
parent =
|
117
|
+
parent = button.parent;
|
118
118
|
|
119
119
|
// global variable for testing
|
120
120
|
if (!this.fieldCount) {
|
package/package.json
CHANGED
@@ -17,20 +17,33 @@
|
|
17
17
|
}
|
18
18
|
}
|
19
19
|
|
20
|
-
.neo-dialog-
|
21
|
-
|
22
|
-
|
23
|
-
|
20
|
+
.neo-dialog-modal-mask {
|
21
|
+
position : fixed;
|
22
|
+
top : 0;
|
23
|
+
left : 0;
|
24
|
+
bottom : 0;
|
25
|
+
right : 0;
|
26
|
+
background-color : rgba(100, 100, 100, 0.5);
|
27
|
+
backdrop-filter : blur(1px);
|
28
|
+
z-index : 1000;
|
29
|
+
}
|
24
30
|
|
25
|
-
|
26
|
-
|
27
|
-
|
31
|
+
.neo-dialog {
|
32
|
+
border : 1px solid var(--dialog-border-color);
|
33
|
+
display : flex;
|
34
|
+
flex-direction: column;
|
35
|
+
|
36
|
+
&.animated-hiding-showing {
|
37
|
+
transition-duration : 200ms;
|
38
|
+
transition-property : height, left, top, transform, width;
|
39
|
+
transition-timing-function: ease-out;
|
40
|
+
}
|
28
41
|
|
29
42
|
&.neo-maximized {
|
30
43
|
height : 98% !important;
|
31
44
|
left : 1% !important;
|
32
45
|
top : 1% !important;
|
33
|
-
transform: none;
|
46
|
+
transform: none!important;
|
34
47
|
width : 98% !important;
|
35
48
|
|
36
49
|
&.neo-panel {
|
@@ -41,14 +54,6 @@
|
|
41
54
|
}
|
42
55
|
}
|
43
56
|
}
|
44
|
-
}
|
45
|
-
|
46
|
-
.neo-dialog {
|
47
|
-
border : 1px solid var(--dialog-border-color);
|
48
|
-
display : flex;
|
49
|
-
flex : 1 0 auto;
|
50
|
-
flex-direction: column;
|
51
|
-
position : relative;
|
52
57
|
|
53
58
|
&.neo-panel {
|
54
59
|
.neo-footer-toolbar {
|
package/src/DefaultConfig.mjs
CHANGED
@@ -236,12 +236,12 @@ const DefaultConfig = {
|
|
236
236
|
useVdomWorker: true,
|
237
237
|
/**
|
238
238
|
* buildScripts/injectPackageVersion.mjs will update this value
|
239
|
-
* @default '6.
|
239
|
+
* @default '6.6.0'
|
240
240
|
* @memberOf! module:Neo
|
241
241
|
* @name config.version
|
242
242
|
* @type String
|
243
243
|
*/
|
244
|
-
version: '6.
|
244
|
+
version: '6.6.0'
|
245
245
|
};
|
246
246
|
|
247
247
|
Object.assign(DefaultConfig, {
|
@@ -57,7 +57,7 @@ class SettingsContainer extends Container {
|
|
57
57
|
me._style = style; // silent update
|
58
58
|
me._vdom.style = style; // silent update
|
59
59
|
|
60
|
-
|
60
|
+
me.parent.promiseUpdate().then(() => {
|
61
61
|
setTimeout(() => {
|
62
62
|
me.collapsed = true;
|
63
63
|
|
@@ -145,7 +145,7 @@ class SettingsContainer extends Container {
|
|
145
145
|
|
146
146
|
delete me.vdom.removeDom;
|
147
147
|
|
148
|
-
|
148
|
+
me.parent.promiseUpdate().then(() => {
|
149
149
|
me.collapsed = false;
|
150
150
|
me.mounted = true;
|
151
151
|
|
package/src/component/Base.mjs
CHANGED
@@ -367,6 +367,14 @@ class Base extends CoreBase {
|
|
367
367
|
this._listeners = value
|
368
368
|
}
|
369
369
|
|
370
|
+
/**
|
371
|
+
* Convenience method to access the parent component
|
372
|
+
* @returns {Neo.component.Base|null}
|
373
|
+
*/
|
374
|
+
get parent() {
|
375
|
+
return this.parentId !== 'document.body' ? Neo.getComponent(this.parentId) : null
|
376
|
+
}
|
377
|
+
|
370
378
|
/**
|
371
379
|
* True after the component render() method was called. Also fires the rendered event.
|
372
380
|
* @member {Boolean} rendered=false
|
@@ -894,20 +902,24 @@ class Base extends CoreBase {
|
|
894
902
|
* @returns {Promise<void>}
|
895
903
|
*/
|
896
904
|
async alignTo(spec={}) {
|
897
|
-
const
|
905
|
+
const
|
906
|
+
me = this,
|
907
|
+
align = {
|
908
|
+
...me.align,
|
909
|
+
...spec,
|
910
|
+
id : me.id,
|
911
|
+
configuredFlex : me.configuredFlex,
|
912
|
+
configuredWidth : me.configuredWidth,
|
913
|
+
configuredHeight : me.configuredHeight,
|
914
|
+
configuredMinWidth : me.configuredMinWidth,
|
915
|
+
configuredMinHeight : me.configuredMinHeight,
|
916
|
+
configuredMaxWidth : me.configuredMaxWidth,
|
917
|
+
configuredMaxHeight : me.configuredMaxHeight
|
918
|
+
};
|
898
919
|
|
899
|
-
|
900
|
-
|
901
|
-
|
902
|
-
id : me.id,
|
903
|
-
configuredFlex : me.configuredFlex,
|
904
|
-
configuredWidth : me.configuredWidth,
|
905
|
-
configuredHeight : me.configuredHeight,
|
906
|
-
configuredMinWidth : me.configuredMinWidth,
|
907
|
-
configuredMinHeight : me.configuredMinHeight,
|
908
|
-
configuredMaxWidth : me.configuredMaxWidth,
|
909
|
-
configuredMaxHeight : me.configuredMaxHeight
|
910
|
-
});
|
920
|
+
if (align.target) {
|
921
|
+
await Neo.main.DomAccess.align(align);
|
922
|
+
}
|
911
923
|
}
|
912
924
|
|
913
925
|
/**
|
@@ -145,12 +145,13 @@ class Splitter extends Component {
|
|
145
145
|
onDragEnd(data) {
|
146
146
|
let me = this,
|
147
147
|
style = me.style || {},
|
148
|
+
parent = me.parent,
|
148
149
|
parentId = me.parentId,
|
149
150
|
resizeNext = me.resizeTarget === 'next',
|
150
151
|
size = me.size,
|
151
|
-
index, newSize, sibling
|
152
|
+
index, newSize, sibling;
|
152
153
|
|
153
|
-
|
154
|
+
parent.disabled = false;
|
154
155
|
|
155
156
|
me.dragZone.dragEnd(data);
|
156
157
|
|
@@ -159,7 +160,6 @@ class Splitter extends Component {
|
|
159
160
|
me.style = style;
|
160
161
|
|
161
162
|
me.getDomRect(parentId).then(parentRect => {
|
162
|
-
parent = Neo.getComponent(parentId);
|
163
163
|
index = parent.indexOf(me);
|
164
164
|
sibling = parent.items[resizeNext ? index + 1 :index - 1];
|
165
165
|
style = sibling.style || {};
|
@@ -204,7 +204,7 @@ class Splitter extends Component {
|
|
204
204
|
style = me.style || {},
|
205
205
|
vertical = me.direction === 'vertical';
|
206
206
|
|
207
|
-
|
207
|
+
me.parent.disabled = true;
|
208
208
|
|
209
209
|
if (!me.dragZone) {
|
210
210
|
me.dragZone = Neo.create({
|
@@ -93,17 +93,13 @@ class Component extends Base {
|
|
93
93
|
* @returns {Neo.controller.Component|null}
|
94
94
|
*/
|
95
95
|
getParent() {
|
96
|
-
let me = this
|
97
|
-
parentComponent, parentId;
|
96
|
+
let me = this;
|
98
97
|
|
99
98
|
if (me.parent) {
|
100
99
|
return me.parent;
|
101
100
|
}
|
102
101
|
|
103
|
-
|
104
|
-
parentComponent = parentId && Neo.getComponent(parentId);
|
105
|
-
|
106
|
-
return parentComponent?.getController() || null
|
102
|
+
return me.component.parent?.getController() || null
|
107
103
|
}
|
108
104
|
|
109
105
|
/**
|