neo.mjs 6.18.1 → 6.18.3
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/colors/view/HeaderToolbar.mjs +6 -6
- package/apps/portal/view/HeaderToolbar.mjs +1 -2
- package/apps/portal/view/home/MainContainer.mjs +21 -21
- package/apps/portal/view/home/parts/AfterMath.mjs +19 -16
- package/apps/portal/view/home/parts/BaseContainer.mjs +38 -0
- package/apps/portal/view/home/parts/Colors.mjs +15 -15
- package/apps/portal/view/home/parts/Features.mjs +6 -6
- package/apps/portal/view/home/parts/Helix.mjs +9 -12
- package/apps/portal/view/home/parts/How.mjs +8 -8
- package/apps/portal/view/home/parts/MainNeo.mjs +14 -12
- package/apps/portal/view/learn/ContentView.mjs +3 -1
- package/examples/ServiceWorker.mjs +2 -2
- package/examples/model/dialog/EditUserDialog.mjs +1 -8
- package/package.json +4 -4
- package/resources/data/deck/learnneo/pages/2023-10-14T19-25-08-153Z.md +2 -2
- package/resources/data/deck/learnneo/pages/ComponentModels.md +6 -6
- package/resources/data/deck/learnneo/pages/ComponentsAndContainers.md +10 -10
- package/resources/data/deck/learnneo/pages/Config.md +6 -6
- package/resources/data/deck/learnneo/pages/CustomComponents.md +4 -4
- package/resources/data/deck/learnneo/pages/DescribingTheUI.md +4 -4
- package/resources/data/deck/learnneo/pages/Earthquakes.md +2 -2
- package/resources/data/deck/learnneo/pages/Events.md +7 -7
- package/resources/data/deck/learnneo/pages/Extending.md +7 -7
- package/resources/data/deck/learnneo/pages/GuideEvents.md +17 -18
- package/resources/data/deck/learnneo/pages/GuideViewModels.md +444 -0
- package/resources/data/deck/learnneo/pages/References.md +8 -8
- package/resources/data/deck/learnneo/pages/TestLivePreview.md +5 -4
- package/resources/data/deck/learnneo/pages/TodoList.md +9 -9
- package/resources/data/deck/learnneo/pages/Welcome.md +3 -3
- package/resources/data/deck/learnneo/pages/WhyNeo-Multi-Window.md +2 -2
- package/resources/data/deck/learnneo/pages/WhyNeo-Speed.md +2 -2
- package/resources/data/deck/learnneo/tree.json +1 -0
- package/resources/scss/src/apps/portal/HeaderToolbar.scss +1 -47
- package/resources/scss/src/apps/portal/home/MainContainer.scss +0 -32
- package/resources/scss/src/apps/portal/home/parts/BaseContainer.scss +56 -0
- package/resources/scss/src/apps/portal/home/parts/MainNeo.scss +3 -1
- package/resources/scss/src/apps/portal/learn/ContentTreeList.scss +1 -1
- package/resources/scss/src/calendar/view/EditEventContainer.scss +1 -1
- package/resources/scss/src/calendar/view/calendars/List.scss +1 -1
- package/resources/scss/src/{apps/portal/learn → code}/LivePreview.scss +1 -1
- package/resources/scss/src/component/Helix.scss +1 -2
- package/resources/scss/src/dialog/Base.scss +1 -6
- package/resources/scss/theme-dark/dialog/Base.scss +1 -0
- package/resources/scss/theme-light/dialog/Base.scss +1 -0
- package/resources/scss/theme-neo-light/Global.scss +13 -11
- package/resources/scss/theme-neo-light/dialog/Base.scss +1 -0
- package/src/DefaultConfig.mjs +2 -2
- package/src/button/Base.mjs +3 -2
- package/src/calendar/view/EditEventContainer.mjs +1 -1
- package/{apps/portal/view/learn → src/code}/LivePreview.mjs +43 -27
- package/src/component/Base.mjs +1 -6
- package/src/controller/Base.mjs +5 -5
- package/src/dialog/Base.mjs +23 -45
- package/src/form/field/Color.mjs +5 -5
- package/src/main/addon/ResizeObserver.mjs +18 -2
- package/src/selection/DateSelectorModel.mjs +2 -2
- package/src/util/HashHistory.mjs +45 -12
- package/src/worker/Base.mjs +15 -8
- package/apps/portal/view/home/parts/HelloWorld.mjs +0 -85
- package/apps/portal/view/home/preview/PageCodeContainer.mjs +0 -55
- package/resources/scss/src/apps/portal/Viewport.scss +0 -3
- package/resources/scss/src/apps/portal/home/preview/PageCodeContainer.scss +0 -115
@@ -0,0 +1,56 @@
|
|
1
|
+
.portal-home-content-view {
|
2
|
+
min-height : 100%;
|
3
|
+
scroll-snap-align: center;
|
4
|
+
|
5
|
+
@keyframes appear-left {
|
6
|
+
0% {opacity: 0; transform: translateX(-400%);}
|
7
|
+
90% {opacity: .3;}
|
8
|
+
100% {opacity: 1; transform: translateX(0);}
|
9
|
+
}
|
10
|
+
|
11
|
+
@keyframes appear-right {
|
12
|
+
0% {opacity: 0; transform: translateX(400%);}
|
13
|
+
90% {opacity: .3;}
|
14
|
+
100% {opacity: 1; transform: translateX(0);}
|
15
|
+
}
|
16
|
+
|
17
|
+
&:not(:first-child) {
|
18
|
+
&:not(:last-child) {
|
19
|
+
animation-timeline : view(block 100% -500%);
|
20
|
+
animation-fill-mode : both;
|
21
|
+
animation-duration : 1ms; /* Firefox requires this to apply the animation */
|
22
|
+
animation-timing-function: linear;
|
23
|
+
|
24
|
+
&:nth-child(even) {
|
25
|
+
animation-name: appear-right;
|
26
|
+
}
|
27
|
+
|
28
|
+
&:nth-child(odd) {
|
29
|
+
animation-name: appear-left;
|
30
|
+
}
|
31
|
+
}
|
32
|
+
}
|
33
|
+
|
34
|
+
.neo-content {
|
35
|
+
font-size: min(max(2.3vw, 16px), 30px);
|
36
|
+
}
|
37
|
+
|
38
|
+
.neo-h1 {
|
39
|
+
font-size : min(max(5.5vw, 30px), 64px);
|
40
|
+
text-align : center;
|
41
|
+
margin : 0;
|
42
|
+
line-height: 1em;
|
43
|
+
}
|
44
|
+
|
45
|
+
.neo-h2 {
|
46
|
+
font-size : min(max(3.5vw, 24px), 44px);
|
47
|
+
font-weight: 600;
|
48
|
+
text-align : center;
|
49
|
+
margin : 0;
|
50
|
+
line-height: 1em;
|
51
|
+
}
|
52
|
+
|
53
|
+
.page-live-preview {
|
54
|
+
margin: 0;
|
55
|
+
}
|
56
|
+
}
|
@@ -4,7 +4,6 @@
|
|
4
4
|
display : flex;
|
5
5
|
font-family : var(--neo-font-family);
|
6
6
|
margin : 0;
|
7
|
-
overflow : hidden;
|
8
7
|
padding : 0;
|
9
8
|
perspective : 800px;
|
10
9
|
transform : translateZ(0px);
|
@@ -65,7 +64,7 @@
|
|
65
64
|
height : 160px;
|
66
65
|
overflow : hidden;
|
67
66
|
width : 120px;
|
68
|
-
will-change :
|
67
|
+
will-change : auto;
|
69
68
|
|
70
69
|
&:focus {
|
71
70
|
outline: 0;
|
@@ -30,6 +30,7 @@
|
|
30
30
|
|
31
31
|
.neo-dialog {
|
32
32
|
border : 1px solid var(--dialog-border-color);
|
33
|
+
box-shadow : var(--dialog-box-shadow);
|
33
34
|
display : flex;
|
34
35
|
flex-direction: column;
|
35
36
|
|
@@ -61,12 +62,6 @@
|
|
61
62
|
}
|
62
63
|
}
|
63
64
|
|
64
|
-
&.neo-centered {
|
65
|
-
left : 50%;
|
66
|
-
top : 50%;
|
67
|
-
transform : translate(-50%, -50%);
|
68
|
-
}
|
69
|
-
|
70
65
|
&.neo-panel {
|
71
66
|
.neo-footer-toolbar {
|
72
67
|
border : none;
|
@@ -46,17 +46,19 @@
|
|
46
46
|
font-style: italic;
|
47
47
|
}
|
48
48
|
|
49
|
-
code
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
49
|
+
code {
|
50
|
+
&:not(.hljs) {
|
51
|
+
background-color: #F0F2F0;
|
52
|
+
border : 1px solid var(--sem-color-border-subtle);
|
53
|
+
border-radius : 4px;
|
54
|
+
color : var(--sem-color-fg-neutral-contrast);
|
55
|
+
font-family : var(--core-fontfamily-mono);
|
56
|
+
font-size : var(--core-fontsize-body);
|
57
|
+
font-weight : var(--core-fontweight-regular);
|
58
|
+
line-height : var(--core-lineheight-headline);
|
59
|
+
padding : 2px 0.3em;
|
60
|
+
font-size : 16px;
|
61
|
+
}
|
60
62
|
}
|
61
63
|
|
62
64
|
mark {
|
package/src/DefaultConfig.mjs
CHANGED
@@ -260,12 +260,12 @@ const DefaultConfig = {
|
|
260
260
|
useVdomWorker: true,
|
261
261
|
/**
|
262
262
|
* buildScripts/injectPackageVersion.mjs will update this value
|
263
|
-
* @default '6.18.
|
263
|
+
* @default '6.18.3'
|
264
264
|
* @memberOf! module:Neo
|
265
265
|
* @name config.version
|
266
266
|
* @type String
|
267
267
|
*/
|
268
|
-
version: '6.18.
|
268
|
+
version: '6.18.3'
|
269
269
|
};
|
270
270
|
|
271
271
|
Object.assign(DefaultConfig, {
|
package/src/button/Base.mjs
CHANGED
@@ -440,12 +440,13 @@ class Base extends Component {
|
|
440
440
|
* @protected
|
441
441
|
*/
|
442
442
|
changeRoute() {
|
443
|
-
let me
|
443
|
+
let me = this,
|
444
|
+
{windowId} = me;
|
444
445
|
|
445
446
|
if (me.editRoute) {
|
446
447
|
Neo.Main.editRoute(me.route)
|
447
448
|
} else {
|
448
|
-
Neo.Main.setRoute({value: me.route})
|
449
|
+
Neo.Main.setRoute({value: me.route, windowId})
|
449
450
|
}
|
450
451
|
}
|
451
452
|
|
@@ -239,7 +239,7 @@ class EditEventContainer extends FormContainer {
|
|
239
239
|
*/
|
240
240
|
onCalendarFieldChange(data) {
|
241
241
|
if (!Neo.isEmpty(data.value)) {
|
242
|
-
this.record.calendarId = data.
|
242
|
+
this.record.calendarId = data.value[data.component.store.keyProperty]
|
243
243
|
}
|
244
244
|
}
|
245
245
|
|
@@ -1,6 +1,6 @@
|
|
1
|
-
import Container from '
|
2
|
-
import MonacoEditor from '
|
3
|
-
import TabContainer from '
|
1
|
+
import Container from '../container/Base.mjs';
|
2
|
+
import MonacoEditor from '../component/wrapper/MonacoEditor.mjs'
|
3
|
+
import TabContainer from '../tab/Container.mjs';
|
4
4
|
|
5
5
|
const
|
6
6
|
classDeclarationRegex = /class\s+([a-zA-Z$_][a-zA-Z0-9$_]*)\s*(?:extends\s+[a-zA-Z$_][a-zA-Z0-9$_]*)?\s*{[\s\S]*?}/g,
|
@@ -8,7 +8,7 @@ const
|
|
8
8
|
importRegex = /import\s+([\w-]+)\s+from\s+['"]([^'"]+)['"]/;
|
9
9
|
|
10
10
|
/**
|
11
|
-
* @class
|
11
|
+
* @class Neo.code.LivePreview
|
12
12
|
* @extends Neo.container.Base
|
13
13
|
*/
|
14
14
|
class LivePreview extends Container {
|
@@ -22,10 +22,10 @@ class LivePreview extends Container {
|
|
22
22
|
|
23
23
|
static config = {
|
24
24
|
/**
|
25
|
-
* @member {String} className='
|
25
|
+
* @member {String} className='Neo.code.LivePreview'
|
26
26
|
* @protected
|
27
27
|
*/
|
28
|
-
className: '
|
28
|
+
className: 'Neo.code.LivePreview',
|
29
29
|
/**
|
30
30
|
* @member {String} ntype='live-preview'
|
31
31
|
* @protected
|
@@ -36,14 +36,22 @@ class LivePreview extends Container {
|
|
36
36
|
* @member {String} activeView_='source'
|
37
37
|
*/
|
38
38
|
activeView_: 'source',
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
39
|
+
/**
|
40
|
+
* @member {String[]} baseCls=['neo-code-live-preview']
|
41
|
+
*/
|
42
|
+
baseCls: ['neo-code-live-preview'],
|
43
|
+
/**
|
44
|
+
* @member {Boolean} disableRunSource=false
|
45
|
+
*/
|
44
46
|
disableRunSource: false,
|
45
|
-
|
46
|
-
|
47
|
+
/**
|
48
|
+
* @member {Number} height=400
|
49
|
+
*/
|
50
|
+
height: 400,
|
51
|
+
/**
|
52
|
+
* @member {Object|String} layout='fit'
|
53
|
+
*/
|
54
|
+
layout: 'fit',
|
47
55
|
/**
|
48
56
|
* @member {Object[]} items
|
49
57
|
*/
|
@@ -56,27 +64,21 @@ class LivePreview extends Container {
|
|
56
64
|
items: [{
|
57
65
|
module : MonacoEditor,
|
58
66
|
hideLabel : true,
|
67
|
+
listeners : {editorChange: 'up.onEditorChange'},
|
59
68
|
style : {height: '100%'},
|
60
69
|
reference : 'editor',
|
61
|
-
tabButtonConfig: {
|
62
|
-
text: 'Source'
|
63
|
-
},
|
64
|
-
listeners : {
|
65
|
-
editorChange: data => {
|
66
|
-
let container = data.component.up({className: 'Portal.view.learn.LivePreview'});
|
67
|
-
container.editorValue = data.value;
|
68
|
-
|
69
|
-
if (container.previewContainer) {
|
70
|
-
container.doRunSource()
|
71
|
-
}
|
72
|
-
}
|
73
|
-
}
|
70
|
+
tabButtonConfig: {text: 'Source'}
|
74
71
|
}, {
|
75
72
|
module : Container,
|
76
73
|
reference : 'preview',
|
77
74
|
tabButtonConfig: {text: 'Preview'}
|
78
75
|
}]
|
79
|
-
}]
|
76
|
+
}],
|
77
|
+
/**
|
78
|
+
* The code to display inside the Monaco editor
|
79
|
+
* @member {String|null} value_=null
|
80
|
+
*/
|
81
|
+
value_: null,
|
80
82
|
}
|
81
83
|
|
82
84
|
/**
|
@@ -300,6 +302,20 @@ class LivePreview extends Container {
|
|
300
302
|
me.activeView === 'preview' && me.doRunSource()
|
301
303
|
}
|
302
304
|
|
305
|
+
/**
|
306
|
+
* @param {Object} data
|
307
|
+
*/
|
308
|
+
onEditorChange(data) {
|
309
|
+
let me = this;
|
310
|
+
|
311
|
+
me.editorValue = data.value;
|
312
|
+
|
313
|
+
// We are not using getPreviewContainer(), since we only want to update the LivePreview in case it is visible.
|
314
|
+
if (me.previewContainer) {
|
315
|
+
me.doRunSource()
|
316
|
+
}
|
317
|
+
}
|
318
|
+
|
303
319
|
/**
|
304
320
|
* @param {Object} data
|
305
321
|
*/
|
package/src/component/Base.mjs
CHANGED
@@ -1491,12 +1491,7 @@ class Base extends CoreBase {
|
|
1491
1491
|
* @param {String} id=this.id
|
1492
1492
|
*/
|
1493
1493
|
focus(id=this.id) {
|
1494
|
-
Neo.main.DomAccess.focus({
|
1495
|
-
id,
|
1496
|
-
windowId: this.id
|
1497
|
-
}).catch(err => {
|
1498
|
-
console.log('Error attempting to receive focus for component', err, this)
|
1499
|
-
})
|
1494
|
+
Neo.main.DomAccess.focus({id, windowId: this.windowId})
|
1500
1495
|
}
|
1501
1496
|
|
1502
1497
|
/**
|
package/src/controller/Base.mjs
CHANGED
@@ -96,15 +96,15 @@ class Base extends CoreBase {
|
|
96
96
|
*
|
97
97
|
*/
|
98
98
|
async onConstructed() {
|
99
|
-
let me
|
100
|
-
|
101
|
-
|
99
|
+
let me = this,
|
100
|
+
{defaultHash, windowId} = me,
|
101
|
+
currentHash = HashHistory.first(windowId);
|
102
102
|
|
103
103
|
// get outside the construction chain => a related cmp & vm has to be constructed too
|
104
104
|
await me.timeout(1);
|
105
105
|
|
106
106
|
if (currentHash) {
|
107
|
-
if (currentHash.windowId ===
|
107
|
+
if (currentHash.windowId === windowId) {
|
108
108
|
await me.onHashChange(currentHash, null)
|
109
109
|
}
|
110
110
|
} else {
|
@@ -113,7 +113,7 @@ class Base extends CoreBase {
|
|
113
113
|
* We only want to set a default route, in case the HashHistory is empty and there is no initial
|
114
114
|
* value that will get consumed.
|
115
115
|
*/
|
116
|
-
!Neo.config.hash && defaultHash && Neo.Main.setRoute({value: defaultHash})
|
116
|
+
!Neo.config.hash && defaultHash && Neo.Main.setRoute({value: defaultHash, windowId})
|
117
117
|
}
|
118
118
|
}
|
119
119
|
|
package/src/dialog/Base.mjs
CHANGED
@@ -136,17 +136,10 @@ class Base extends Panel {
|
|
136
136
|
title_: null,
|
137
137
|
/**
|
138
138
|
* Set to `true` to have tabbing wrap within this Dialog.
|
139
|
-
*
|
140
139
|
* Should be used with `modal`.
|
141
140
|
* @member {Boolean} trapFocus_=false
|
142
141
|
*/
|
143
|
-
trapFocus_: false
|
144
|
-
/**
|
145
|
-
* Set to `true` to have this Dialog centered in the viewport.
|
146
|
-
*
|
147
|
-
* @member {Boolean} centered_=false
|
148
|
-
*/
|
149
|
-
centered_: false
|
142
|
+
trapFocus_: false
|
150
143
|
}
|
151
144
|
|
152
145
|
/**
|
@@ -154,22 +147,7 @@ class Base extends Panel {
|
|
154
147
|
*/
|
155
148
|
construct(config) {
|
156
149
|
super.construct(config);
|
157
|
-
|
158
|
-
let me = this,
|
159
|
-
{style} = me;
|
160
|
-
|
161
|
-
me.createHeader();
|
162
|
-
|
163
|
-
if (!me.animateTargetId && !me.centered) {
|
164
|
-
Neo.assignDefaults(style, {
|
165
|
-
left : '50%',
|
166
|
-
top : '50%',
|
167
|
-
transform: 'translate(-50%, -50%)',
|
168
|
-
width : '50%'
|
169
|
-
});
|
170
|
-
|
171
|
-
me.style = style
|
172
|
-
}
|
150
|
+
this.createHeader()
|
173
151
|
}
|
174
152
|
|
175
153
|
/**
|
@@ -204,17 +182,6 @@ class Base extends Panel {
|
|
204
182
|
super.afterSetAppName(value, oldValue)
|
205
183
|
}
|
206
184
|
|
207
|
-
/**
|
208
|
-
* Triggered after the centered config got changed
|
209
|
-
* @param {Boolean} value
|
210
|
-
* @param {Boolean} oldValue
|
211
|
-
* @protected
|
212
|
-
*/
|
213
|
-
afterSetCentered(value, oldValue) {
|
214
|
-
NeoArray.toggle(this.vdom.cls, 'neo-centered', value);
|
215
|
-
this.update();
|
216
|
-
}
|
217
|
-
|
218
185
|
/**
|
219
186
|
* Triggered after the draggable config got changed
|
220
187
|
* @param {Boolean} value
|
@@ -392,8 +359,12 @@ class Base extends Panel {
|
|
392
359
|
{appName, id, style} = me,
|
393
360
|
rect = await me.getDomRect(me.animateTargetId);
|
394
361
|
|
362
|
+
// rendered outside the visible area
|
395
363
|
await me.render(true);
|
396
364
|
|
365
|
+
let [dialogRect, bodyRect] = await me.getDomRect([me.id, 'document.body']);
|
366
|
+
console.log(dialogRect, bodyRect);
|
367
|
+
|
397
368
|
// Move to cover the animation target
|
398
369
|
await Neo.applyDeltas(appName, {
|
399
370
|
id,
|
@@ -415,11 +386,10 @@ class Base extends Panel {
|
|
415
386
|
add: ['animated-hiding-showing']
|
416
387
|
},
|
417
388
|
style: {
|
418
|
-
height
|
419
|
-
left
|
420
|
-
top
|
421
|
-
|
422
|
-
width : style?.width || '50%'
|
389
|
+
height: style?.height || `${dialogRect.height}px`,
|
390
|
+
left : style?.left || `${Math.round(bodyRect.width / 2 - dialogRect.width / 2)}px`,
|
391
|
+
top : style?.top || `${Math.round(bodyRect.height / 2 - dialogRect.height / 2)}px`,
|
392
|
+
width : style?.width || `${dialogRect.width}px`
|
423
393
|
}
|
424
394
|
});
|
425
395
|
|
@@ -699,8 +669,11 @@ class Base extends Panel {
|
|
699
669
|
}
|
700
670
|
}
|
701
671
|
|
672
|
+
/**
|
673
|
+
*
|
674
|
+
*/
|
702
675
|
onKeyDownEscape() {
|
703
|
-
this.hidden = true
|
676
|
+
this.hidden = true
|
704
677
|
}
|
705
678
|
|
706
679
|
/**
|
@@ -710,7 +683,7 @@ class Base extends Panel {
|
|
710
683
|
let me = this;
|
711
684
|
|
712
685
|
if (animate) {
|
713
|
-
me.animateShow()
|
686
|
+
me.animateShow()
|
714
687
|
} else {
|
715
688
|
if (!me.rendered) {
|
716
689
|
me.render(true)
|
@@ -726,16 +699,21 @@ class Base extends Panel {
|
|
726
699
|
* @param {String} id=this.id
|
727
700
|
*/
|
728
701
|
syncModalMask(id=this.id) {
|
702
|
+
let {modal, windowId} = this;
|
703
|
+
|
729
704
|
// This should sync the visibility and position of the modal mask element.
|
730
|
-
Neo.main.DomAccess.syncModalMask({id, modal
|
705
|
+
Neo.main.DomAccess.syncModalMask({id, modal, windowId})
|
731
706
|
}
|
732
707
|
|
733
708
|
/**
|
734
709
|
*
|
735
710
|
*/
|
736
711
|
syncTrapFocus() {
|
737
|
-
|
738
|
-
|
712
|
+
let me = this,
|
713
|
+
{id, windowId} = me;
|
714
|
+
|
715
|
+
if (me.mounted) {
|
716
|
+
Neo.main.DomAccess.trapFocus({id, trap: me.trapFocus, windowId})
|
739
717
|
}
|
740
718
|
}
|
741
719
|
}
|
package/src/form/field/Color.mjs
CHANGED
@@ -19,9 +19,9 @@ class Color extends ComboBox {
|
|
19
19
|
*/
|
20
20
|
ntype: 'colorfield',
|
21
21
|
/**
|
22
|
-
* @member {String[]} baseCls=['neo-colorfield','neo-
|
22
|
+
* @member {String[]} baseCls=['neo-colorfield','neo-combobox','neo-pickerfield','neo-textfield']
|
23
23
|
*/
|
24
|
-
baseCls: ['neo-colorfield', 'neo-
|
24
|
+
baseCls: ['neo-colorfield', 'neo-combobox', 'neo-pickerfield', 'neo-textfield'],
|
25
25
|
/**
|
26
26
|
* The data.Model field which contains the color value
|
27
27
|
* @member {String} colorField='name'
|
@@ -95,10 +95,10 @@ class Color extends ComboBox {
|
|
95
95
|
* @returns {String}
|
96
96
|
*/
|
97
97
|
getColor() {
|
98
|
-
let me
|
99
|
-
{
|
98
|
+
let me = this,
|
99
|
+
{inputValue, value} = me;
|
100
100
|
|
101
|
-
return
|
101
|
+
return value ? me.colorFormatter(me, value) : me.forceSelection ? null : inputValue
|
102
102
|
}
|
103
103
|
|
104
104
|
/**
|
@@ -19,6 +19,12 @@ class NeoResizeObserver extends Base {
|
|
19
19
|
* @protected
|
20
20
|
*/
|
21
21
|
instance: null,
|
22
|
+
/**
|
23
|
+
* If a target node is not found when calling register(),
|
24
|
+
* we can specify the amount of retries with a 100ms delay.
|
25
|
+
* @member {Number} registerAttempts=3
|
26
|
+
*/
|
27
|
+
registerAttempts: 3,
|
22
28
|
/**
|
23
29
|
* Remote method access for other workers
|
24
30
|
* @member {Object} remote
|
@@ -92,9 +98,19 @@ class NeoResizeObserver extends Base {
|
|
92
98
|
/**
|
93
99
|
* @param {Object} data
|
94
100
|
* @param {String} data.id
|
101
|
+
* @param {Number} count=0
|
95
102
|
*/
|
96
|
-
register(data) {
|
97
|
-
this
|
103
|
+
async register(data, count=0) {
|
104
|
+
let me = this,
|
105
|
+
node = DomAccess.getElement(data.id);
|
106
|
+
|
107
|
+
if (node) {
|
108
|
+
me.instance.observe(node)
|
109
|
+
} else if (count < me.registerAttempts) {
|
110
|
+
await me.timeout(100);
|
111
|
+
count++;
|
112
|
+
me.register(data, count)
|
113
|
+
}
|
98
114
|
}
|
99
115
|
|
100
116
|
/**
|
@@ -138,7 +138,7 @@ class DateSelectorModel extends Model {
|
|
138
138
|
super.register(component);
|
139
139
|
|
140
140
|
let scope = {scope: this.id},
|
141
|
-
{view} = this
|
141
|
+
{view} = this;
|
142
142
|
|
143
143
|
view.keys?._keys.push(
|
144
144
|
{fn: 'onKeyDownDown' ,key: 'Down' ,...scope},
|
@@ -153,7 +153,7 @@ class DateSelectorModel extends Model {
|
|
153
153
|
*/
|
154
154
|
unregister() {
|
155
155
|
let scope = {scope: this.id},
|
156
|
-
{view} = this
|
156
|
+
{view} = this;
|
157
157
|
|
158
158
|
view.keys?.removeKeys([
|
159
159
|
{fn: 'onKeyDownDown' ,key: 'Down' ,...scope},
|