neo.mjs 8.14.1 → 8.14.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.14.1'
23
+ * @member {String} version='8.14.2'
24
24
  */
25
- version: '8.14.1'
25
+ version: '8.14.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-02-03",
19
+ "datePublished": "2025-02-04",
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.14.1'
110
+ html : 'v8.14.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.14.1'
23
+ * @member {String} version='8.14.2'
24
24
  */
25
- version: '8.14.1'
25
+ version: '8.14.2'
26
26
  }
27
27
 
28
28
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "neo.mjs",
3
- "version": "8.14.1",
3
+ "version": "8.14.2",
4
4
  "description": "The webworkers driven UI framework",
5
5
  "type": "module",
6
6
  "repository": {
@@ -14,6 +14,10 @@
14
14
  .neo-dragproxy {
15
15
  .neo-grid-container {
16
16
  border: none;
17
+
18
+ * {
19
+ scrollbar-width: none;
20
+ }
17
21
  }
18
22
 
19
23
  .neo-grid-header-toolbar {
@@ -23,10 +27,6 @@
23
27
  border-right: 1px solid var(--grid-container-border-color);
24
28
  }
25
29
  }
26
-
27
- .neo-grid-row {
28
- position: unset;
29
- }
30
30
  }
31
31
 
32
32
  .neo-grid-header-toolbar {
@@ -262,12 +262,12 @@ const DefaultConfig = {
262
262
  useVdomWorker: true,
263
263
  /**
264
264
  * buildScripts/injectPackageVersion.mjs will update this value
265
- * @default '8.14.1'
265
+ * @default '8.14.2'
266
266
  * @memberOf! module:Neo
267
267
  * @name config.version
268
268
  * @type String
269
269
  */
270
- version: '8.14.1'
270
+ version: '8.14.2'
271
271
  };
272
272
 
273
273
  Object.assign(DefaultConfig, {
@@ -19,7 +19,7 @@ class SortZone extends BaseSortZone {
19
19
  */
20
20
  ntype: 'grid-header-toolbar-sortzone',
21
21
  /**
22
- * @member {String|null} itemMargin=null
22
+ * @member {String|null} itemMargin='1px'
23
23
  * @protected
24
24
  */
25
25
  itemMargin: '1px',
@@ -52,28 +52,29 @@ class SortZone extends BaseSortZone {
52
52
  return await super.createDragProxy(data, createComponent)
53
53
  }
54
54
 
55
- let me = this,
56
- grid = me.owner.parent,
57
- {view} = grid,
58
- gridRows = view.getVdomRoot().cn,
59
- columnIndex = me.dragElement['aria-colindex'] - 1,
60
- {dataField} = view.columnPositions[columnIndex],
61
- cells = view.getColumnCells(dataField),
62
- rows = [],
63
- config = await super.createDragProxy(data, false),
64
- rect = await grid.getDomRect(),
55
+ let me = this,
56
+ grid = me.owner.parent,
57
+ {view} = grid,
58
+ gridRows = view.getVdomRoot().cn,
59
+ columnIndex = me.dragElement['aria-colindex'] - 1,
60
+ {dataField} = view.columnPositions[columnIndex],
61
+ cells = view.getColumnCells(dataField),
62
+ rows = [],
63
+ config = await super.createDragProxy(data, false),
64
+ rect = await grid.getDomRect(),
65
+ viewWrapperId = Neo.getId('grid-view-wrapper'),
65
66
  row;
66
67
 
67
68
  config.cls = ['neo-grid-wrapper', me.owner.getTheme()];
68
69
 
69
- config.style.height = rect.height + 'px';
70
+ config.style.height = `${rect.height - 2}px`; // minus border-bottom & border-top
70
71
 
71
72
  cells.forEach((cell, index) => {
72
- row = VdomUtil.clone({cls: gridRows[index].cls, cn: [cell]}); // clone to remove ids
73
-
74
- row.style = {
75
- height: view.rowHeight + 'px'
76
- };
73
+ row = VdomUtil.clone({ // clone to remove ids
74
+ cls : gridRows[index].cls,
75
+ cn : [cell],
76
+ style: gridRows[index].style
77
+ });
77
78
 
78
79
  delete row.cn[0].style.left;
79
80
 
@@ -84,10 +85,24 @@ class SortZone extends BaseSortZone {
84
85
  {cn: [
85
86
  {cls: ['neo-grid-container'], cn: [
86
87
  {...config.vdom, cls: ['neo-grid-header-toolbar', 'neo-toolbar']},
87
- {cls: ['neo-grid-view'], cn: rows}
88
+ {cls: ['neo-grid-view-wrapper'], id: viewWrapperId, cn: [
89
+ {cls: ['neo-grid-view'], cn: rows},
90
+ {cls: ['neo-grid-scrollbar'], style: {height: view.vdom.cn[1].height}}
91
+ ]}
88
92
  ]}
89
93
  ]};
90
94
 
95
+ config.listeners = {
96
+ mounted() {
97
+ Neo.main.DomAccess.scrollTo({
98
+ direction: 'top',
99
+ id : viewWrapperId,
100
+ value : view.scrollPosition.y,
101
+ windowId : this.windowId
102
+ })
103
+ }
104
+ };
105
+
91
106
  if (createComponent) {
92
107
  return me.dragProxy = Neo.create(config)
93
108
  }
@@ -154,31 +169,40 @@ class SortZone extends BaseSortZone {
154
169
  * @param {Number} index2
155
170
  */
156
171
  switchItems(index1, index2) {
172
+ super.switchItems(index1, index2);
173
+
157
174
  if (this.moveColumnContent) {
158
- let {view} = this.owner.parent,
175
+ let me = this,
176
+ {itemRects} = me,
177
+ {view} = me.owner.parent,
159
178
  columnPositions = view._columnPositions, // no clone
160
179
  column1Cells = view.getColumnCells(columnPositions[index1].dataField),
161
- column2Cells = view.getColumnCells(columnPositions[index2].dataField),
162
- x;
180
+ column2Cells = view.getColumnCells(columnPositions[index2].dataField);
163
181
 
164
- x = columnPositions[index1].x;
165
- columnPositions[index1].x = columnPositions[index2].x;
166
- columnPositions[index2].x = x;
182
+ Object.assign(columnPositions[index1], {
183
+ width: itemRects[index2].width,
184
+ x : itemRects[index2].x + 1
185
+ });
186
+
187
+ Object.assign(columnPositions[index2], {
188
+ width: itemRects[index1].width,
189
+ x : itemRects[index1].x + 1
190
+ });
167
191
 
168
192
  NeoArray.move(columnPositions, index1, index2);
169
193
 
170
194
  column1Cells.forEach(node => {
171
- node.style.left = columnPositions[index2].x + 'px'
195
+ node.style.left = columnPositions[index2].x + 'px';
196
+ node.style.width = columnPositions[index2].width + 'px'
172
197
  });
173
198
 
174
199
  column2Cells.forEach(node => {
175
- node.style.left = columnPositions[index1].x + 'px'
200
+ node.style.left = columnPositions[index1].x + 'px';
201
+ node.style.width = columnPositions[index1].width + 'px'
176
202
  });
177
203
 
178
204
  view.update()
179
205
  }
180
-
181
- super.switchItems(index1, index2);
182
206
  }
183
207
  }
184
208