neo.mjs 8.1.0 → 8.1.2

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.
@@ -20,9 +20,9 @@ class ServiceWorker extends ServiceBase {
20
20
  */
21
21
  singleton: true,
22
22
  /**
23
- * @member {String} version='8.1.0'
23
+ * @member {String} version='8.1.2'
24
24
  */
25
- version: '8.1.0'
25
+ version: '8.1.2'
26
26
  }
27
27
 
28
28
  /**
@@ -16,7 +16,7 @@
16
16
  "@type": "Organization",
17
17
  "name": "Neo.mjs"
18
18
  },
19
- "datePublished": "2025-01-11",
19
+ "datePublished": "2025-01-12",
20
20
  "publisher": {
21
21
  "@type": "Organization",
22
22
  "name": "Neo.mjs"
@@ -107,7 +107,7 @@ class FooterContainer extends Container {
107
107
  }, {
108
108
  module: Component,
109
109
  cls : ['neo-version'],
110
- html : 'v8.1.0'
110
+ html : 'v8.1.2'
111
111
  }]
112
112
  }],
113
113
  /**
@@ -20,9 +20,9 @@ class ServiceWorker extends ServiceBase {
20
20
  */
21
21
  singleton: true,
22
22
  /**
23
- * @member {String} version='8.1.0'
23
+ * @member {String} version='8.1.2'
24
24
  */
25
- version: '8.1.0'
25
+ version: '8.1.2'
26
26
  }
27
27
 
28
28
  /**
@@ -20,7 +20,7 @@ class MainContainerController extends ComponentController {
20
20
  construct(config) {
21
21
  super.construct(config);
22
22
  Neo.main.addon.HighlightJS.switchTheme('dark');
23
- Neo.main.addon.HighlightJS.loadLibrary({})
23
+ Neo.main.addon.HighlightJS.loadFiles({})
24
24
  }
25
25
 
26
26
  /**
@@ -72,7 +72,9 @@ class MainContainerController extends ComponentController {
72
72
  }
73
73
  })
74
74
 
75
- values.appName = me.component.appName;
75
+ values.appName = me.component.appName;
76
+ values.windowId = me.component.windowId;
77
+
76
78
  Neo.toast(values)
77
79
  }
78
80
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "neo.mjs",
3
- "version": "8.1.0",
3
+ "version": "8.1.2",
4
4
  "description": "The webworkers driven UI framework",
5
5
  "type": "module",
6
6
  "repository": {
@@ -1,7 +1,9 @@
1
1
  .neo-grid-wrapper {
2
- overflow-x: auto;
3
- overflow-y: hidden;
4
- position : relative;
2
+ overflow-anchor : none;
3
+ overflow-x : auto;
4
+ overflow-y : hidden;
5
+ overscroll-behavior: none;
6
+ position : relative;
5
7
  }
6
8
 
7
9
  .neo-grid-container {
@@ -1,8 +1,9 @@
1
1
  .neo-grid-view-wrapper {
2
- height : 100%;
3
- overflow-x: hidden;
4
- overflow-y: auto;
5
- position : relative;
2
+ height : 100%;
3
+ overflow-anchor: none;
4
+ overflow-x : hidden;
5
+ overflow-y : auto;
6
+ position : relative;
6
7
 
7
8
  .neo-grid-scrollbar {
8
9
  height : 1px;
@@ -1,5 +1,5 @@
1
1
  .neo-grid-header-toolbar {
2
- border-bottom: 2px solid var(--grid-container-border-color);
2
+ border-bottom: 1px solid var(--grid-container-border-color);
3
3
  border-top : 1px solid var(--grid-container-border-color);
4
4
  padding : 0;
5
5
  width : max-content;
@@ -262,12 +262,12 @@ const DefaultConfig = {
262
262
  useVdomWorker: true,
263
263
  /**
264
264
  * buildScripts/injectPackageVersion.mjs will update this value
265
- * @default '8.1.0'
265
+ * @default '8.1.2'
266
266
  * @memberOf! module:Neo
267
267
  * @name config.version
268
268
  * @type String
269
269
  */
270
- version: '8.1.0'
270
+ version: '8.1.2'
271
271
  };
272
272
 
273
273
  Object.assign(DefaultConfig, {
@@ -1,4 +1,4 @@
1
- import Base from '../component/Base.mjs';
1
+ import Component from '../component/Base.mjs';
2
2
  import NeoArray from "../util/Array.mjs";
3
3
  import ToastManager from '../manager/Toast.mjs';
4
4
 
@@ -20,7 +20,7 @@ import ToastManager from '../manager/Toast.mjs';
20
20
  title : 'Alarm Clock' // null
21
21
  })
22
22
  */
23
- class Toast extends Base {
23
+ class Toast extends Component {
24
24
  /**
25
25
  * Valid values for positions
26
26
  * @member {String[]} positions = ['tl','tc','tr','bl','bc','br']
@@ -614,10 +614,16 @@ class GridContainer extends BaseContainer {
614
614
  let me = this,
615
615
  [containerRect, headerRect] = await me.getDomRect([me.id, me.headerToolbarId]);
616
616
 
617
- me.view[silent ? 'setSilent' : 'set']({
618
- availableHeight: containerRect.height - headerRect.height,
619
- containerWidth : containerRect.width
620
- })
617
+ // delay for slow connections, where the container-sizing is not done yet
618
+ if (containerRect.height === headerRect.height) {
619
+ await me.timeout(100);
620
+ await me.passSizeToView(silent)
621
+ } else {
622
+ me.view[silent ? 'setSilent' : 'set']({
623
+ availableHeight: containerRect.height - headerRect.height,
624
+ containerWidth : containerRect.width
625
+ })
626
+ }
621
627
  }
622
628
 
623
629
  /**
@@ -28,9 +28,9 @@ class Button extends BaseButton {
28
28
  */
29
29
  ntype: 'grid-header-button',
30
30
  /**
31
- * @member {String[]} baseCls=['neo-grid-header-button']
31
+ * @member {String[]} baseCls=['neo-grid-header-button','neo-button']
32
32
  */
33
- baseCls: ['neo-grid-header-button'],
33
+ baseCls: ['neo-grid-header-button', 'neo-button'],
34
34
  /**
35
35
  * Alignment of the matching grid cells. Valid values are left, center, right
36
36
  * @member {String} cellAlign_='left'
@@ -131,11 +131,12 @@ class Toolbar extends BaseToolbar {
131
131
  if (item.dock) {
132
132
  NeoArray.add(item.vdom.cls, 'neo-locked');
133
133
 
134
- if (item.dock === 'left') {
134
+ /*if (item.dock === 'left') {
135
135
  style.left = dockLeftWidth + 'px'
136
136
  }
137
137
 
138
138
  dockLeftWidth += (item.width + 1) // todo: borders fix
139
+ */
139
140
  }
140
141
 
141
142
  item.sortable = me.sortable;
@@ -144,14 +145,14 @@ class Toolbar extends BaseToolbar {
144
145
  // inverse loop direction
145
146
  item = items[len - index -1];
146
147
 
147
- if (item.dock === 'right') {
148
+ /*if (item.dock === 'right') {
148
149
  style = item.wrapperStyle;
149
150
  style.right = dockRightWidth + 'px';
150
151
 
151
152
  item.wrapperStyle = style;
152
153
 
153
154
  dockRightWidth += (item.width + 1) // todo: borders fix
154
- }
155
+ }*/
155
156
  });
156
157
 
157
158
  me.update()
@@ -178,14 +179,32 @@ class Toolbar extends BaseToolbar {
178
179
  * @returns {Promise<void>}
179
180
  */
180
181
  async passSizeToView(silent=false) {
181
- let me = this,
182
- rects = await me.getDomRect(me.items.map(item => item.id)),
183
- lastItem = rects[rects.length - 1];
184
-
185
- me.gridContainer.view[silent ? 'setSilent' : 'set']({
186
- availableWidth : lastItem.x + lastItem.width - rects[0].x,
187
- columnPositions: rects.map(item => ({width: item.width, x: item.x - rects[0].x}))
188
- })
182
+ let me = this,
183
+ rects = await me.getDomRect(me.items.map(item => item.id)),
184
+ lastItem = rects[rects.length - 1],
185
+ columnPositions = rects.map(item => ({width: item.width, x: item.x - rects[0].x})),
186
+ i = 1,
187
+ len = columnPositions.length,
188
+ layoutFinished = true;
189
+
190
+ // If the css sizing is not done, columns after the first one can get x = 0
191
+ for (; i < len; i++) {
192
+ if (columnPositions[i].x === 0) {
193
+ layoutFinished = false;
194
+ break;
195
+ }
196
+ }
197
+
198
+ // Delay for slow connections, where the container-sizing is not done yet
199
+ if (!layoutFinished) {
200
+ await me.timeout(100);
201
+ await me.passSizeToView(silent)
202
+ } else {
203
+ me.gridContainer.view[silent ? 'setSilent' : 'set']({
204
+ availableWidth: lastItem.x + lastItem.width - rects[0].x,
205
+ columnPositions
206
+ })
207
+ }
189
208
  }
190
209
  }
191
210
 
@@ -126,8 +126,8 @@ class HighlightJS extends Base {
126
126
  */
127
127
  switchTheme(theme) {
128
128
  let definedThemes = {
129
- dark : './resources/highlightjs-custom-dark-theme.css',
130
- light: './resources/highlightjs-custom-github-theme.css'
129
+ dark : './resources/lib/highlightjs-custom-dark-theme.css',
130
+ light: './resources/lib/highlightjs-custom-github-theme.css'
131
131
  },
132
132
  switchToTheme = definedThemes[theme];
133
133
 
@@ -427,9 +427,9 @@ class DomEvent extends Base {
427
427
  if (!eventConfigKeys.includes(key)) {
428
428
  me.register({
429
429
  bubble : domListener.bubble || value.bubble,
430
- delegate : domListener.delegate || value.delegate || '#' + component.vdom.id,
430
+ delegate : domListener.delegate || value.delegate || '#' + (component.vdom.id || component.id),
431
431
  eventName : key,
432
- id : component.vdom.id, // honor wrapper nodes
432
+ id : component.vdom.id || component.id, // honor wrapper nodes
433
433
  opts : value,
434
434
  originalConfig: domListener,
435
435
  ownerId : component.id,