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.
Files changed (63) hide show
  1. package/apps/ServiceWorker.mjs +2 -2
  2. package/apps/colors/view/HeaderToolbar.mjs +6 -6
  3. package/apps/portal/view/HeaderToolbar.mjs +1 -2
  4. package/apps/portal/view/home/MainContainer.mjs +21 -21
  5. package/apps/portal/view/home/parts/AfterMath.mjs +19 -16
  6. package/apps/portal/view/home/parts/BaseContainer.mjs +38 -0
  7. package/apps/portal/view/home/parts/Colors.mjs +15 -15
  8. package/apps/portal/view/home/parts/Features.mjs +6 -6
  9. package/apps/portal/view/home/parts/Helix.mjs +9 -12
  10. package/apps/portal/view/home/parts/How.mjs +8 -8
  11. package/apps/portal/view/home/parts/MainNeo.mjs +14 -12
  12. package/apps/portal/view/learn/ContentView.mjs +3 -1
  13. package/examples/ServiceWorker.mjs +2 -2
  14. package/examples/model/dialog/EditUserDialog.mjs +1 -8
  15. package/package.json +4 -4
  16. package/resources/data/deck/learnneo/pages/2023-10-14T19-25-08-153Z.md +2 -2
  17. package/resources/data/deck/learnneo/pages/ComponentModels.md +6 -6
  18. package/resources/data/deck/learnneo/pages/ComponentsAndContainers.md +10 -10
  19. package/resources/data/deck/learnneo/pages/Config.md +6 -6
  20. package/resources/data/deck/learnneo/pages/CustomComponents.md +4 -4
  21. package/resources/data/deck/learnneo/pages/DescribingTheUI.md +4 -4
  22. package/resources/data/deck/learnneo/pages/Earthquakes.md +2 -2
  23. package/resources/data/deck/learnneo/pages/Events.md +7 -7
  24. package/resources/data/deck/learnneo/pages/Extending.md +7 -7
  25. package/resources/data/deck/learnneo/pages/GuideEvents.md +17 -18
  26. package/resources/data/deck/learnneo/pages/GuideViewModels.md +444 -0
  27. package/resources/data/deck/learnneo/pages/References.md +8 -8
  28. package/resources/data/deck/learnneo/pages/TestLivePreview.md +5 -4
  29. package/resources/data/deck/learnneo/pages/TodoList.md +9 -9
  30. package/resources/data/deck/learnneo/pages/Welcome.md +3 -3
  31. package/resources/data/deck/learnneo/pages/WhyNeo-Multi-Window.md +2 -2
  32. package/resources/data/deck/learnneo/pages/WhyNeo-Speed.md +2 -2
  33. package/resources/data/deck/learnneo/tree.json +1 -0
  34. package/resources/scss/src/apps/portal/HeaderToolbar.scss +1 -47
  35. package/resources/scss/src/apps/portal/home/MainContainer.scss +0 -32
  36. package/resources/scss/src/apps/portal/home/parts/BaseContainer.scss +56 -0
  37. package/resources/scss/src/apps/portal/home/parts/MainNeo.scss +3 -1
  38. package/resources/scss/src/apps/portal/learn/ContentTreeList.scss +1 -1
  39. package/resources/scss/src/calendar/view/EditEventContainer.scss +1 -1
  40. package/resources/scss/src/calendar/view/calendars/List.scss +1 -1
  41. package/resources/scss/src/{apps/portal/learn → code}/LivePreview.scss +1 -1
  42. package/resources/scss/src/component/Helix.scss +1 -2
  43. package/resources/scss/src/dialog/Base.scss +1 -6
  44. package/resources/scss/theme-dark/dialog/Base.scss +1 -0
  45. package/resources/scss/theme-light/dialog/Base.scss +1 -0
  46. package/resources/scss/theme-neo-light/Global.scss +13 -11
  47. package/resources/scss/theme-neo-light/dialog/Base.scss +1 -0
  48. package/src/DefaultConfig.mjs +2 -2
  49. package/src/button/Base.mjs +3 -2
  50. package/src/calendar/view/EditEventContainer.mjs +1 -1
  51. package/{apps/portal/view/learn → src/code}/LivePreview.mjs +43 -27
  52. package/src/component/Base.mjs +1 -6
  53. package/src/controller/Base.mjs +5 -5
  54. package/src/dialog/Base.mjs +23 -45
  55. package/src/form/field/Color.mjs +5 -5
  56. package/src/main/addon/ResizeObserver.mjs +18 -2
  57. package/src/selection/DateSelectorModel.mjs +2 -2
  58. package/src/util/HashHistory.mjs +45 -12
  59. package/src/worker/Base.mjs +15 -8
  60. package/apps/portal/view/home/parts/HelloWorld.mjs +0 -85
  61. package/apps/portal/view/home/preview/PageCodeContainer.mjs +0 -55
  62. package/resources/scss/src/apps/portal/Viewport.scss +0 -3
  63. 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
+ }
@@ -1,4 +1,6 @@
1
- .portal-home-main-neo.page {
1
+ .portal-home-main-neo.portal-home-content-view {
2
+ padding: 3em;
3
+
2
4
  .button-group {
3
5
  display : flex !important;
4
6
  flex-direction: row-reverse !important;
@@ -7,7 +7,7 @@
7
7
  padding : 8px 2px 8px 8px;
8
8
 
9
9
  .neo-list-container {
10
- padding: 0 3px 3px 3px;
10
+ padding: 3px;
11
11
  }
12
12
 
13
13
  .neo-list-container>.neo-list-item {
@@ -5,7 +5,7 @@
5
5
  padding : .7em;
6
6
  position : absolute;
7
7
  top : 0;
8
- z-index : 10000;
8
+ z-index : 900;
9
9
 
10
10
  &:before {
11
11
  border-bottom: 12px solid transparent;
@@ -1,4 +1,4 @@
1
- .neo-calendars-list {
1
+ .neo-calendars-list.neo-list {
2
2
  .neo-checkboxfield {
3
3
  align-items: center;
4
4
  display : flex;
@@ -1,4 +1,4 @@
1
- .learn-live-preview {
1
+ .neo-code-live-preview {
2
2
  margin-bottom: 2em;
3
3
 
4
4
  .live-preview-container {
@@ -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 : transform;
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;
@@ -1,5 +1,6 @@
1
1
  :root .neo-theme-dark { // .neo-dialog
2
2
  --dialog-border-color: #3c3f41;
3
+ --dialog-box-shadow : 0 5px 10px rgba(0,0,0,.4);
3
4
  --dialog-header-color: floralwhite;
4
5
  --dialog-icon-color : floralwhite;
5
6
  }
@@ -1,5 +1,6 @@
1
1
  :root .neo-theme-light { // .neo-dialog
2
2
  --dialog-border-color: #ddd;
3
+ --dialog-box-shadow : 0 5px 10px rgba(0,0,0,.4);
3
4
  --dialog-header-color: #1c60a0;
4
5
  --dialog-icon-color : #1c60a0;
5
6
  }
@@ -46,17 +46,19 @@
46
46
  font-style: italic;
47
47
  }
48
48
 
49
- code &:not(.hljs) {
50
- background-color: #F0F2F0;
51
- border : 1px solid var(--sem-color-border-subtle);
52
- border-radius : 4px;
53
- color : var(--sem-color-fg-neutral-contrast);
54
- font-family : var(--core-fontfamily-mono);
55
- font-size : var(--core-fontsize-body);
56
- font-weight : var(--core-fontweight-regular);
57
- line-height : var(--core-lineheight-headline);
58
- padding : 2px 0.3em;
59
- font-size : 16px;
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 {
@@ -1,5 +1,6 @@
1
1
  :root .neo-theme-neo-light { // .neo-dialog
2
2
  --dialog-border-color: #ddd;
3
+ --dialog-box-shadow : 0 5px 10px rgba(0,0,0,.4);
3
4
  --dialog-header-color: #1c60a0;
4
5
  --dialog-icon-color : #1c60a0;
5
6
  }
@@ -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.1'
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.1'
268
+ version: '6.18.3'
269
269
  };
270
270
 
271
271
  Object.assign(DefaultConfig, {
@@ -440,12 +440,13 @@ class Base extends Component {
440
440
  * @protected
441
441
  */
442
442
  changeRoute() {
443
- let me = this;
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.record[data.component.store.keyProperty]
242
+ this.record.calendarId = data.value[data.component.store.keyProperty]
243
243
  }
244
244
  }
245
245
 
@@ -1,6 +1,6 @@
1
- import Container from '../../../../src/container/Base.mjs';
2
- import MonacoEditor from '../../../../src/component/wrapper/MonacoEditor.mjs'
3
- import TabContainer from '../../../../src/tab/Container.mjs';
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 Portal.view.learn.LivePreview
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='Portal.view.learn.LivePreview'
25
+ * @member {String} className='Neo.code.LivePreview'
26
26
  * @protected
27
27
  */
28
- className: 'Portal.view.learn.LivePreview',
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
- baseCls : ['learn-live-preview'],
41
- value_ : null,
42
- autoMount : true,
43
- autoRender : true,
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
- height : 400,
46
- layout : 'fit',
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
  */
@@ -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
  /**
@@ -96,15 +96,15 @@ class Base extends CoreBase {
96
96
  *
97
97
  */
98
98
  async onConstructed() {
99
- let me = this,
100
- currentHash = HashHistory.first(),
101
- {defaultHash} = me;
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 === me.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
 
@@ -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 : style?.height || null, // height will point to the animation origin, so we need a reset
419
- left : style?.left || '50%',
420
- top : style?.top || '50%',
421
- transform: style?.transform || 'translate(-50%, -50%)',
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: this.modal})
705
+ Neo.main.DomAccess.syncModalMask({id, modal, windowId})
731
706
  }
732
707
 
733
708
  /**
734
709
  *
735
710
  */
736
711
  syncTrapFocus() {
737
- if (this.mounted) {
738
- Neo.main.DomAccess.trapFocus({id: this.id, trap: this.trapFocus})
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
  }
@@ -19,9 +19,9 @@ class Color extends ComboBox {
19
19
  */
20
20
  ntype: 'colorfield',
21
21
  /**
22
- * @member {String[]} baseCls=['neo-colorfield','neo-selectfield','neo-pickerfield','neo-textfield']
22
+ * @member {String[]} baseCls=['neo-colorfield','neo-combobox','neo-pickerfield','neo-textfield']
23
23
  */
24
- baseCls: ['neo-colorfield', 'neo-selectfield', 'neo-pickerfield', 'neo-textfield'],
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 = this,
99
- {record, value} = me;
98
+ let me = this,
99
+ {inputValue, value} = me;
100
100
 
101
- return record ? me.colorFormatter(me, record) : me.forceSelection ? null : value
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.instance.observe(DomAccess.getElement(data.id))
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.view;
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.view;
156
+ {view} = this;
157
157
 
158
158
  view.keys?.removeKeys([
159
159
  {fn: 'onKeyDownDown' ,key: 'Down' ,...scope},