neo.mjs 8.11.0 → 8.13.0
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/TableContainer.mjs +1 -1
- package/apps/covid/Util.mjs +9 -9
- package/apps/portal/index.html +1 -1
- package/apps/portal/view/home/FooterContainer.mjs +1 -1
- package/apps/sharedcovid/Util.mjs +2 -2
- package/examples/ConfigurationViewport.mjs +1 -7
- package/examples/ServiceWorker.mjs +2 -2
- package/examples/grid/covid/Util.mjs +3 -3
- package/examples/table/covid/Util.mjs +2 -2
- package/package.json +2 -2
- package/resources/scss/src/draggable/DragProxyComponent.scss +9 -0
- package/resources/scss/src/draggable/grid/header/toolbar/SortZone.scss +16 -0
- package/resources/scss/src/draggable/table/header/toolbar/SortZone.scss +32 -0
- package/resources/scss/src/grid/header/Toolbar.scss +0 -1
- package/resources/scss/src/table/header/Button.scss +0 -4
- package/resources/scss/theme-dark/draggable/grid/header/toolbar/SortZone.scss +3 -0
- package/resources/scss/theme-dark/draggable/table/header/toolbar/SortZone.scss +3 -0
- package/resources/scss/theme-light/draggable/grid/header/toolbar/SortZone.scss +3 -0
- package/resources/scss/theme-light/draggable/table/header/toolbar/SortZone.scss +3 -0
- package/resources/scss/theme-neo-light/draggable/grid/header/toolbar/SortZone.scss +3 -0
- package/resources/scss/theme-neo-light/draggable/table/header/toolbar/SortZone.scss +3 -0
- package/src/DefaultConfig.mjs +2 -2
- package/src/component/Base.mjs +2 -6
- package/src/draggable/grid/header/toolbar/SortZone.mjs +74 -0
- package/src/draggable/table/header/toolbar/SortZone.mjs +70 -0
- package/src/draggable/toolbar/SortZone.mjs +23 -14
- package/src/grid/View.mjs +19 -21
- package/src/grid/header/Button.mjs +7 -115
- package/src/grid/header/Toolbar.mjs +32 -0
- package/src/main/DomAccess.mjs +1 -1
- package/src/main/DomEvents.mjs +10 -50
- package/src/main/addon/AmCharts.mjs +28 -9
- package/src/main/addon/DragDrop.mjs +9 -20
- package/src/main/mixin/DeltaUpdates.mjs +13 -7
- package/src/selection/grid/BaseModel.mjs +1 -1
- package/src/selection/grid/RowModel.mjs +57 -18
- package/src/selection/table/BaseModel.mjs +1 -1
- package/src/selection/table/RowModel.mjs +57 -17
- package/src/table/Container.mjs +6 -6
- package/src/table/View.mjs +28 -26
- package/src/table/header/Button.mjs +7 -111
- package/src/table/header/Toolbar.mjs +34 -2
- package/src/util/Rectangle.mjs +1 -1
package/src/grid/View.mjs
CHANGED
@@ -381,13 +381,14 @@ class GridView extends Component {
|
|
381
381
|
* @param {Object} data
|
382
382
|
* @param {String} [data.cellId]
|
383
383
|
* @param {Object} data.column
|
384
|
+
* @param {Number} data.columnIndex
|
384
385
|
* @param {Neo.grid.Container} data.gridContainer
|
385
|
-
* @param {Number} data.index
|
386
386
|
* @param {Object} data.record
|
387
|
+
* @param {Number} data.rowIndex
|
387
388
|
* @returns {Object}
|
388
389
|
*/
|
389
390
|
applyRendererOutput(data) {
|
390
|
-
let {cellId, column, gridContainer,
|
391
|
+
let {cellId, column, columnIndex, gridContainer, record, rowIndex} = data,
|
391
392
|
me = this,
|
392
393
|
cellCls = ['neo-grid-cell'],
|
393
394
|
colspan = record[me.colspanField],
|
@@ -401,10 +402,11 @@ class GridView extends Component {
|
|
401
402
|
|
402
403
|
rendererOutput = column.renderer.call(column.rendererScope || gridContainer, {
|
403
404
|
column,
|
405
|
+
columnIndex,
|
404
406
|
dataField,
|
405
407
|
gridContainer,
|
406
|
-
index,
|
407
408
|
record,
|
409
|
+
rowIndex,
|
408
410
|
value: fieldValue
|
409
411
|
});
|
410
412
|
|
@@ -447,7 +449,7 @@ class GridView extends Component {
|
|
447
449
|
}
|
448
450
|
|
449
451
|
cellConfig = {
|
450
|
-
'aria-colindex':
|
452
|
+
'aria-colindex': columnIndex + 1, // 1 based
|
451
453
|
id : cellId,
|
452
454
|
cls : cellCls,
|
453
455
|
role : 'gridcell',
|
@@ -511,10 +513,7 @@ class GridView extends Component {
|
|
511
513
|
|
512
514
|
if (selectedRows?.includes(id)) {
|
513
515
|
trCls.push('neo-selected');
|
514
|
-
|
515
|
-
gridContainer.fire('select', {
|
516
|
-
record
|
517
|
-
})
|
516
|
+
gridContainer.fire('select', {record})
|
518
517
|
}
|
519
518
|
|
520
519
|
gridRow = {
|
@@ -535,7 +534,7 @@ class GridView extends Component {
|
|
535
534
|
|
536
535
|
for (i=startIndex; i <= endIndex; i++) {
|
537
536
|
column = columns[i];
|
538
|
-
config = me.applyRendererOutput({column, gridContainer,
|
537
|
+
config = me.applyRendererOutput({column, columnIndex: i, gridContainer, record, rowIndex});
|
539
538
|
|
540
539
|
if (column.dock) {
|
541
540
|
config.cls = ['neo-locked', ...config.cls || []]
|
@@ -817,17 +816,16 @@ class GridView extends Component {
|
|
817
816
|
* @param {Object} opts.record
|
818
817
|
*/
|
819
818
|
onStoreRecordChange({fields, record}) {
|
820
|
-
let me
|
821
|
-
fieldNames
|
822
|
-
needsUpdate
|
823
|
-
{gridContainer}
|
824
|
-
|
825
|
-
{vdom}
|
826
|
-
cellId, cellNode, cellStyle, cellVdom, column,
|
819
|
+
let me = this,
|
820
|
+
fieldNames = fields.map(field => field.name),
|
821
|
+
needsUpdate = false,
|
822
|
+
{gridContainer} = me,
|
823
|
+
rowIndex = me.store.indexOf(record),
|
824
|
+
{selectionModel, vdom} = me,
|
825
|
+
cellId, cellNode, cellStyle, cellVdom, column, columnIndex;
|
827
826
|
|
828
827
|
if (fieldNames.includes(me.colspanField)) {
|
829
|
-
|
830
|
-
me.vdom.cn[index] = me.createRow({record, rowIndex: index});
|
828
|
+
me.vdom.cn[rowIndex] = me.createRow({record, rowIndex});
|
831
829
|
me.update()
|
832
830
|
} else {
|
833
831
|
fields.forEach(field => {
|
@@ -843,8 +841,8 @@ class GridView extends Component {
|
|
843
841
|
if (cellNode?.vdom) {
|
844
842
|
cellStyle = cellNode.vdom.style;
|
845
843
|
column = me.getColumn(field.name);
|
846
|
-
|
847
|
-
cellVdom = me.applyRendererOutput({cellId, column, gridContainer,
|
844
|
+
columnIndex = cellNode.index;
|
845
|
+
cellVdom = me.applyRendererOutput({cellId, column, columnIndex, gridContainer, record, rowIndex});
|
848
846
|
needsUpdate = true;
|
849
847
|
|
850
848
|
// The cell-positioning logic happens outside applyRendererOutput()
|
@@ -854,7 +852,7 @@ class GridView extends Component {
|
|
854
852
|
width: cellStyle.width
|
855
853
|
});
|
856
854
|
|
857
|
-
cellNode.parentNode.cn[
|
855
|
+
cellNode.parentNode.cn[columnIndex] = cellVdom
|
858
856
|
}
|
859
857
|
}
|
860
858
|
})
|
@@ -45,10 +45,6 @@ class Button extends BaseButton {
|
|
45
45
|
* @member {String} defaultSortDirection='ASC'
|
46
46
|
*/
|
47
47
|
defaultSortDirection: 'ASC',
|
48
|
-
/**
|
49
|
-
* @member {Boolean} draggable_=true
|
50
|
-
*/
|
51
|
-
draggable_: true,
|
52
48
|
/**
|
53
49
|
* @member {Object} editorConfig=null
|
54
50
|
*/
|
@@ -100,43 +96,6 @@ class Button extends BaseButton {
|
|
100
96
|
sortable_: true
|
101
97
|
}
|
102
98
|
|
103
|
-
/**
|
104
|
-
* @param {Object} config
|
105
|
-
*/
|
106
|
-
construct(config) {
|
107
|
-
super.construct(config);
|
108
|
-
|
109
|
-
let me = this;
|
110
|
-
|
111
|
-
me.draggable && me.addDomListeners({
|
112
|
-
dragend : me.onDragEnd,
|
113
|
-
dragenter: me.onDragEnter,
|
114
|
-
dragleave: me.onDragLeave,
|
115
|
-
dragover : me.onDragOver,
|
116
|
-
dragstart: me.onDragStart,
|
117
|
-
drop : me.onDrop,
|
118
|
-
scope : me
|
119
|
-
})
|
120
|
-
}
|
121
|
-
|
122
|
-
/**
|
123
|
-
* Triggered after the draggable config got changed
|
124
|
-
* @param {Boolean} value
|
125
|
-
* @param {Boolean} oldValue
|
126
|
-
* @protected
|
127
|
-
*/
|
128
|
-
afterSetDraggable(value, oldValue) {
|
129
|
-
let me = this;
|
130
|
-
|
131
|
-
if (value === true) {
|
132
|
-
me.getVdomRoot().draggable = true
|
133
|
-
} else {
|
134
|
-
delete me.getVdomRoot().draggable
|
135
|
-
}
|
136
|
-
|
137
|
-
me.update()
|
138
|
-
}
|
139
|
-
|
140
99
|
/**
|
141
100
|
* Triggered after the isSorted config got changed
|
142
101
|
* @param {String|null} value
|
@@ -269,13 +228,14 @@ class Button extends BaseButton {
|
|
269
228
|
}
|
270
229
|
|
271
230
|
/**
|
272
|
-
* @param {Object}
|
273
|
-
* @param {Neo.button.Base}
|
274
|
-
* @param {
|
231
|
+
* @param {Object} data
|
232
|
+
* @param {Neo.button.Base} data.column
|
233
|
+
* @param {Number} data.columnIndex
|
234
|
+
* @param {String} data.dataField
|
275
235
|
* @param {Neo.grid.Container} data.gridContainer
|
276
|
-
* @param {
|
277
|
-
* @param {
|
278
|
-
* @param {Number|String}
|
236
|
+
* @param {Object} data.record
|
237
|
+
* @param {Number} data.rowIndex
|
238
|
+
* @param {Number|String} data.value
|
279
239
|
* @returns {*}
|
280
240
|
*/
|
281
241
|
cellRenderer(data) {
|
@@ -315,74 +275,6 @@ class Button extends BaseButton {
|
|
315
275
|
me.isSorted = map[me.isSorted + '']
|
316
276
|
}
|
317
277
|
|
318
|
-
/**
|
319
|
-
* @protected
|
320
|
-
*/
|
321
|
-
onDragEnd() {
|
322
|
-
let me = this,
|
323
|
-
{style} = me;
|
324
|
-
|
325
|
-
delete style.opacity;
|
326
|
-
me.style = style
|
327
|
-
}
|
328
|
-
|
329
|
-
/**
|
330
|
-
* @protected
|
331
|
-
*/
|
332
|
-
onDragEnter() {
|
333
|
-
let me = this,
|
334
|
-
{cls} = me;
|
335
|
-
|
336
|
-
NeoArray.add(cls, 'neo-drag-over');
|
337
|
-
me.cls = cls
|
338
|
-
}
|
339
|
-
|
340
|
-
/**
|
341
|
-
* @protected
|
342
|
-
*/
|
343
|
-
onDragLeave() {
|
344
|
-
let me = this,
|
345
|
-
{cls} = me;
|
346
|
-
|
347
|
-
NeoArray.remove(cls, 'neo-drag-over');
|
348
|
-
me.cls = cls
|
349
|
-
}
|
350
|
-
|
351
|
-
/**
|
352
|
-
* @param {Object} event
|
353
|
-
*/
|
354
|
-
onDragOver(event) {
|
355
|
-
//console.log('onDragOver', event);
|
356
|
-
}
|
357
|
-
|
358
|
-
/**
|
359
|
-
* @protected
|
360
|
-
*/
|
361
|
-
onDragStart() {
|
362
|
-
let me = this,
|
363
|
-
{style} = me;
|
364
|
-
|
365
|
-
style.opacity = 0.4;
|
366
|
-
me.style = style
|
367
|
-
}
|
368
|
-
|
369
|
-
/**
|
370
|
-
* @param {Object} data
|
371
|
-
*/
|
372
|
-
onDrop(data) {
|
373
|
-
let me = this,
|
374
|
-
headerToolbar = me.parent,
|
375
|
-
{style} = me,
|
376
|
-
gridContainer = headerToolbar.parent;
|
377
|
-
|
378
|
-
me.onDragLeave();
|
379
|
-
headerToolbar.switchItems(me.id, data.srcId);
|
380
|
-
gridContainer.createViewData(gridContainer.store.data);
|
381
|
-
|
382
|
-
style.opacity = 1;
|
383
|
-
me.style = style
|
384
|
-
}
|
385
|
-
|
386
278
|
/**
|
387
279
|
* @param {Object} data
|
388
280
|
*/
|
@@ -21,6 +21,10 @@ class Toolbar extends BaseToolbar {
|
|
21
21
|
* @member {String[]} baseCls=['neo-grid-header-toolbar','neo-toolbar']
|
22
22
|
*/
|
23
23
|
baseCls: ['neo-grid-header-toolbar', 'neo-toolbar'],
|
24
|
+
/**
|
25
|
+
* @member {Boolean} draggable_=true
|
26
|
+
*/
|
27
|
+
draggable_: true,
|
24
28
|
/**
|
25
29
|
* @member {Neo.grid.Container|null} gridContainer=null
|
26
30
|
*/
|
@@ -40,6 +44,8 @@ class Toolbar extends BaseToolbar {
|
|
40
44
|
*/
|
41
45
|
showHeaderFilters_: false,
|
42
46
|
/**
|
47
|
+
* Convenience shortcut to pass sortable to all toolbar items.
|
48
|
+
* If set to true, header clicks will sort the matching column (ASC, DESC, null)
|
43
49
|
* @member {Boolean} sortable=true
|
44
50
|
*/
|
45
51
|
sortable: true,
|
@@ -50,6 +56,31 @@ class Toolbar extends BaseToolbar {
|
|
50
56
|
{'aria-rowindex': 1, cn: [{cn: []}]}
|
51
57
|
}
|
52
58
|
|
59
|
+
/**
|
60
|
+
* Triggered after the draggable config got changed
|
61
|
+
* @param {Boolean} value
|
62
|
+
* @param {Boolean} oldValue
|
63
|
+
* @protected
|
64
|
+
*/
|
65
|
+
afterSetDraggable(value, oldValue) {
|
66
|
+
let me = this;
|
67
|
+
|
68
|
+
if (value && !me.sortZone) {
|
69
|
+
import('../../draggable/grid/header/toolbar/SortZone.mjs').then(module => {
|
70
|
+
let {appName, id, windowId} = me;
|
71
|
+
|
72
|
+
me.sortZone = Neo.create({
|
73
|
+
module : module.default,
|
74
|
+
appName,
|
75
|
+
boundaryContainerId: id,
|
76
|
+
owner : me,
|
77
|
+
windowId,
|
78
|
+
...me.sortZoneConfig
|
79
|
+
})
|
80
|
+
})
|
81
|
+
}
|
82
|
+
}
|
83
|
+
|
53
84
|
/**
|
54
85
|
* Triggered after the mounted config got changed
|
55
86
|
* @param {Boolean} value
|
@@ -98,6 +129,7 @@ class Toolbar extends BaseToolbar {
|
|
98
129
|
})
|
99
130
|
});
|
100
131
|
|
132
|
+
me.updateDepth = 2;
|
101
133
|
me.update()
|
102
134
|
}
|
103
135
|
}
|
package/src/main/DomAccess.mjs
CHANGED
@@ -576,7 +576,7 @@ class DomAccess extends Base {
|
|
576
576
|
* Include a script into the document.head
|
577
577
|
* You can add more attributes if needed. See: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script
|
578
578
|
* @param {String} src
|
579
|
-
* @param {Object} opts=defer:true}
|
579
|
+
* @param {Object} opts={defer:true}
|
580
580
|
* @param {Boolean} [opts.async]
|
581
581
|
* @param {Boolean} [opts.defer]
|
582
582
|
* @returns {Promise<unknown>}
|
package/src/main/DomEvents.mjs
CHANGED
@@ -194,7 +194,7 @@ class DomEvents extends Base {
|
|
194
194
|
|
195
195
|
/**
|
196
196
|
* Local domEvent listener
|
197
|
-
* @param {
|
197
|
+
* @param {Event} event
|
198
198
|
*/
|
199
199
|
domEventListener(event) {
|
200
200
|
let me = this,
|
@@ -211,40 +211,7 @@ class DomEvents extends Base {
|
|
211
211
|
}
|
212
212
|
};
|
213
213
|
|
214
|
-
// console.log('domEventListener', event.type, target.id, target.value, event);
|
215
|
-
|
216
214
|
switch (event.type) {
|
217
|
-
case 'dragend':
|
218
|
-
me.dragElementId = null;
|
219
|
-
break
|
220
|
-
case 'dragenter':
|
221
|
-
if (me.dragElementId === target.id) {
|
222
|
-
return // ignore target and source to be the same
|
223
|
-
}
|
224
|
-
break
|
225
|
-
case 'dragleave':
|
226
|
-
if (me.dragElementId === target.id) {
|
227
|
-
return // ignore target and source to be the same
|
228
|
-
}
|
229
|
-
break
|
230
|
-
case 'dragover':
|
231
|
-
me.onDragOver(event);
|
232
|
-
event.preventDefault();
|
233
|
-
break
|
234
|
-
case 'dragstart':
|
235
|
-
me.dragElementId = target.id;
|
236
|
-
break
|
237
|
-
case 'drop':
|
238
|
-
if (!me.dragElementId || me.dragElementId === target.id) {
|
239
|
-
return // drop fires twice by default & drop should not trigger on the drag element
|
240
|
-
}
|
241
|
-
if (event.stopPropagation) {
|
242
|
-
event.stopPropagation() // stops the browser from redirecting.
|
243
|
-
}
|
244
|
-
event.preventDefault();
|
245
|
-
config.data.srcId = me.dragElementId;
|
246
|
-
me.dragElementId = null;
|
247
|
-
break
|
248
215
|
case 'mousemove':
|
249
216
|
Object.assign(config.data, me.getMouseEventData(event));
|
250
217
|
break
|
@@ -427,10 +394,10 @@ class DomEvents extends Base {
|
|
427
394
|
* @param {Object} event
|
428
395
|
*/
|
429
396
|
onBeforeUnload(event) {
|
430
|
-
let
|
397
|
+
let {Manager} = Neo.worker;
|
431
398
|
|
432
|
-
|
433
|
-
|
399
|
+
Manager.appNames.forEach(appName => {
|
400
|
+
Manager.broadcast({action: 'disconnect', appName, windowId: Manager.windowId})
|
434
401
|
})
|
435
402
|
}
|
436
403
|
|
@@ -498,13 +465,6 @@ class DomEvents extends Base {
|
|
498
465
|
me.testPathInclusion(event, preventClickTargets) && event.preventDefault()
|
499
466
|
}
|
500
467
|
|
501
|
-
/**
|
502
|
-
* @param {Object} event
|
503
|
-
*/
|
504
|
-
onDragOver(event) {
|
505
|
-
event.dataTransfer.dropEffect = 'move'
|
506
|
-
}
|
507
|
-
|
508
468
|
/**
|
509
469
|
* @param {FocusEvent} event
|
510
470
|
*/
|
@@ -616,13 +576,11 @@ class DomEvents extends Base {
|
|
616
576
|
* @param {Event} event
|
617
577
|
*/
|
618
578
|
onOrientationChange(event) {
|
619
|
-
|
620
|
-
{orientation} = screen,
|
579
|
+
let {orientation} = screen,
|
621
580
|
{angle, type} = orientation,
|
622
|
-
layout = angle === 0 || angle === 180 ? 'portrait' : 'landscape'
|
623
|
-
{Manager} = Neo.worker;
|
581
|
+
layout = angle === 0 || angle === 180 ? 'portrait' : 'landscape';
|
624
582
|
|
625
|
-
Manager.sendMessage('app', {
|
583
|
+
Neo.worker.Manager.sendMessage('app', {
|
626
584
|
action: 'orientationChange',
|
627
585
|
data : {angle, layout, type}
|
628
586
|
})
|
@@ -633,7 +591,9 @@ class DomEvents extends Base {
|
|
633
591
|
*/
|
634
592
|
onScroll(event) {
|
635
593
|
let {clientHeight, clientWidth, scrollLeft, scrollTop} = event.target;
|
636
|
-
|
594
|
+
|
595
|
+
event.preventDefault();
|
596
|
+
|
637
597
|
this.sendMessageToApp({
|
638
598
|
...this.getEventData(event),
|
639
599
|
clientHeight,
|
@@ -28,15 +28,15 @@ class AmCharts extends Base {
|
|
28
28
|
*/
|
29
29
|
dataMap: {},
|
30
30
|
/**
|
31
|
-
* @member {String} downloadPath='https//
|
31
|
+
* @member {String} downloadPath='https//cdn.amcharts.com/lib/4/'
|
32
32
|
* @protected
|
33
33
|
*/
|
34
|
-
downloadPath: 'https://
|
34
|
+
downloadPath: 'https://cdn.amcharts.com/lib/4/',
|
35
35
|
/**
|
36
|
-
* @member {String} fallbackPath='https://
|
36
|
+
* @member {String} fallbackPath='https://raw.githubusercontent.com/neomjs/pages/main/resources_pub/amCharts'
|
37
37
|
* @protected
|
38
38
|
*/
|
39
|
-
fallbackPath: 'https://
|
39
|
+
fallbackPath: 'https://raw.githubusercontent.com/neomjs/pages/main/resources_pub/amCharts/',
|
40
40
|
/**
|
41
41
|
* Remote method access for other workers
|
42
42
|
* @member {Object} remote
|
@@ -51,7 +51,13 @@ class AmCharts extends Base {
|
|
51
51
|
'setProperty',
|
52
52
|
'updateData'
|
53
53
|
]
|
54
|
-
}
|
54
|
+
},
|
55
|
+
/**
|
56
|
+
* Enforce using the fallbackPath
|
57
|
+
* @member {Boolean} useFallbackPath=false
|
58
|
+
* @protected
|
59
|
+
*/
|
60
|
+
useFallbackPath: false
|
55
61
|
}
|
56
62
|
|
57
63
|
/**
|
@@ -187,8 +193,19 @@ class AmCharts extends Base {
|
|
187
193
|
* @param {Boolean} useFallback=false
|
188
194
|
*/
|
189
195
|
loadFiles(useFallback=false) {
|
190
|
-
let me
|
191
|
-
|
196
|
+
let me = this,
|
197
|
+
useFallbackPath = me.useFallbackPath || useFallback,
|
198
|
+
basePath;
|
199
|
+
|
200
|
+
if (useFallbackPath && Neo.config.isGitHubPages) {
|
201
|
+
basePath = '../../../../resources_pub/amCharts/';
|
202
|
+
|
203
|
+
if (Neo.config.environment !== 'development') {
|
204
|
+
basePath = `../../${basePath}`
|
205
|
+
}
|
206
|
+
} else {
|
207
|
+
basePath = useFallbackPath ? me.fallbackPath : me.downloadPath
|
208
|
+
}
|
192
209
|
|
193
210
|
me.isLoading = true;
|
194
211
|
|
@@ -203,8 +220,10 @@ class AmCharts extends Base {
|
|
203
220
|
me.isReady = true
|
204
221
|
})
|
205
222
|
}).catch(e => {
|
206
|
-
|
207
|
-
|
223
|
+
if (!useFallback && !me.useFallbackPath) {
|
224
|
+
console.log('Download from amcharts.com failed, switching to fallback', e);
|
225
|
+
me.loadFiles(true)
|
226
|
+
}
|
208
227
|
})
|
209
228
|
}
|
210
229
|
|
@@ -196,17 +196,13 @@ class DragDrop extends Base {
|
|
196
196
|
}
|
197
197
|
|
198
198
|
/**
|
199
|
-
* @param {
|
199
|
+
* @param {Event} event
|
200
200
|
*/
|
201
201
|
onDragEnd(event) {
|
202
202
|
let me = this,
|
203
203
|
parsedEvent = me.getEventData(event),
|
204
204
|
isDrop = me.pathIncludesDropZone(parsedEvent.targetPath);
|
205
205
|
|
206
|
-
DomAccess.setBodyCls({
|
207
|
-
remove: ['neo-unselectable']
|
208
|
-
});
|
209
|
-
|
210
206
|
if (me.bodyCursorStyle) {
|
211
207
|
DomAccess.setStyle({
|
212
208
|
id : 'document.body',
|
@@ -254,7 +250,7 @@ class DragDrop extends Base {
|
|
254
250
|
}
|
255
251
|
|
256
252
|
/**
|
257
|
-
* @param {
|
253
|
+
* @param {Event} event
|
258
254
|
*/
|
259
255
|
onDragMove(event) {
|
260
256
|
let me = this,
|
@@ -290,17 +286,14 @@ class DragDrop extends Base {
|
|
290
286
|
}
|
291
287
|
}
|
292
288
|
|
293
|
-
if (
|
294
|
-
left =
|
289
|
+
if (me.moveHorizontal) {
|
290
|
+
me.dragProxyElement.style.left = `${left}px`
|
295
291
|
}
|
296
292
|
|
297
|
-
me.dragProxyElement.style.left = `${left}px`;
|
298
293
|
|
299
|
-
if (
|
300
|
-
top =
|
294
|
+
if (me.moveVertical) {
|
295
|
+
me.dragProxyElement.style.top = `${top}px`
|
301
296
|
}
|
302
|
-
|
303
|
-
me.dragProxyElement.style.top = `${top}px`
|
304
297
|
}
|
305
298
|
|
306
299
|
if (!me.dragProxyElement || me.alwaysFireDragMove) {
|
@@ -318,16 +311,12 @@ class DragDrop extends Base {
|
|
318
311
|
}
|
319
312
|
|
320
313
|
/**
|
321
|
-
* @param {
|
314
|
+
* @param {Event} event
|
322
315
|
*/
|
323
316
|
onDragStart(event) {
|
324
317
|
let me = this,
|
325
318
|
rect = event.target.getBoundingClientRect();
|
326
319
|
|
327
|
-
DomAccess.setBodyCls({
|
328
|
-
add: ['neo-unselectable']
|
329
|
-
});
|
330
|
-
|
331
320
|
Object.assign(me, {
|
332
321
|
dragProxyRect: rect,
|
333
322
|
offsetX : event.detail.clientX - rect.left,
|
@@ -341,7 +330,7 @@ class DragDrop extends Base {
|
|
341
330
|
}
|
342
331
|
|
343
332
|
/**
|
344
|
-
* @param {
|
333
|
+
* @param {Event} event
|
345
334
|
*/
|
346
335
|
onMouseEnter(event) {
|
347
336
|
let me = this;
|
@@ -356,7 +345,7 @@ class DragDrop extends Base {
|
|
356
345
|
}
|
357
346
|
|
358
347
|
/**
|
359
|
-
* @param {
|
348
|
+
* @param {Event} event
|
360
349
|
*/
|
361
350
|
onMouseLeave(event) {
|
362
351
|
let me = this;
|
@@ -115,18 +115,24 @@ class DeltaUpdates extends Base {
|
|
115
115
|
* @param {String} delta.index
|
116
116
|
* @param {String} delta.parentId
|
117
117
|
*/
|
118
|
-
du_moveNode(
|
119
|
-
let
|
120
|
-
|
121
|
-
|
118
|
+
du_moveNode({id, index, parentId}) {
|
119
|
+
let node = this.getElement(id),
|
120
|
+
parentNode = this.getElement(parentId),
|
121
|
+
currentNode;
|
122
122
|
|
123
123
|
if (node && parentNode) {
|
124
124
|
if (index >= parentNode.children.length) {
|
125
125
|
parentNode.appendChild(node)
|
126
126
|
} else {
|
127
|
-
|
128
|
-
|
129
|
-
|
127
|
+
currentNode = parentNode.children[index];
|
128
|
+
|
129
|
+
if (node && currentNode.id !== id) {
|
130
|
+
// Check for a direct swap OP
|
131
|
+
if (node === currentNode.nextElementSibling) {
|
132
|
+
node.replaceWith(currentNode)
|
133
|
+
}
|
134
|
+
|
135
|
+
parentNode.insertBefore(node, currentNode)
|
130
136
|
}
|
131
137
|
}
|
132
138
|
}
|