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.
- package/apps/ServiceWorker.mjs +2 -2
- package/apps/portal/index.html +1 -1
- package/apps/portal/view/home/FooterContainer.mjs +1 -1
- package/examples/ServiceWorker.mjs +2 -2
- package/package.json +1 -1
- package/resources/scss/src/draggable/grid/header/toolbar/SortZone.scss +4 -4
- package/src/DefaultConfig.mjs +2 -2
- package/src/draggable/grid/header/toolbar/SortZone.mjs +52 -28
package/apps/ServiceWorker.mjs
CHANGED
package/apps/portal/index.html
CHANGED
package/package.json
CHANGED
@@ -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 {
|
package/src/DefaultConfig.mjs
CHANGED
@@ -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.
|
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.
|
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=
|
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
|
56
|
-
grid
|
57
|
-
{view}
|
58
|
-
gridRows
|
59
|
-
columnIndex
|
60
|
-
{dataField}
|
61
|
-
cells
|
62
|
-
rows
|
63
|
-
config
|
64
|
-
rect
|
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
|
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({
|
73
|
-
|
74
|
-
|
75
|
-
|
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:
|
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
|
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
|
-
|
165
|
-
|
166
|
-
|
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
|
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
|
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
|
|