neo.mjs 8.21.2 → 8.23.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/.github/CODEBASE_OVERVIEW.md +0 -1
- package/.github/CODE_OF_CONDUCT.md +0 -1
- package/.github/CONCEPT.md +0 -1
- package/.github/GETTING_STARTED.md +0 -1
- package/.github/NEOMJS_HISTORY.md +0 -1
- package/.github/STORY.md +0 -1
- package/.github/VISION.md +2 -126
- package/BACKERS.md +0 -1
- package/CONTRIBUTING.md +0 -1
- package/LICENSE +1 -1
- package/README.md +5 -1
- package/apps/ServiceWorker.mjs +2 -2
- package/apps/portal/index.html +1 -1
- package/apps/portal/view/about/Container.mjs +1 -1
- package/apps/portal/view/home/FooterContainer.mjs +1 -1
- package/apps/portal/view/services/Component.mjs +0 -9
- package/examples/ConfigurationViewport.mjs +21 -8
- package/examples/ServiceWorker.mjs +2 -2
- package/examples/component/magicmovetext/MainContainer.mjs +90 -0
- package/examples/component/magicmovetext/app.mjs +6 -0
- package/examples/component/magicmovetext/index.html +11 -0
- package/examples/component/magicmovetext/neo-config.json +6 -0
- package/examples/grid/bigData/ControlsContainer.mjs +142 -84
- package/package.json +9 -7
- package/resources/scss/src/component/MagicMoveText.scss +45 -0
- package/resources/scss/src/examples/ConfigurationViewport.scss +27 -0
- package/resources/scss/src/examples/grid/bigData/ControlsContainer.scss +10 -1
- package/src/DefaultConfig.mjs +2 -2
- package/src/component/MagicMoveText.mjs +306 -0
- package/src/data/Store.mjs +12 -0
- package/src/grid/Container.mjs +1 -1
- package/src/grid/View.mjs +183 -67
- package/src/grid/header/Toolbar.mjs +1 -1
- package/src/main/DomAccess.mjs +18 -24
- package/src/selection/grid/CellModel.mjs +7 -3
- package/src/selection/grid/RowModel.mjs +2 -0
- package/src/selection/grid/_export.mjs +8 -0
- package/src/util/ClassSystem.mjs +4 -4
- package/resources/scss/src/examples/ConfigurationPanel.scss +0 -25
package/src/grid/View.mjs
CHANGED
@@ -81,6 +81,18 @@ class GridView extends Component {
|
|
81
81
|
* @member {Object} keys
|
82
82
|
*/
|
83
83
|
keys: {},
|
84
|
+
/**
|
85
|
+
* Stores the indexes of the first & last mounted columns, including bufferColumnRange
|
86
|
+
* @member {Number[]} mountedColumns_=[0,0]
|
87
|
+
* @protected
|
88
|
+
*/
|
89
|
+
mountedColumns_: [0, 0],
|
90
|
+
/**
|
91
|
+
* Stores the indexes of the first & last mounted rows, including bufferRowRange
|
92
|
+
* @member {Number[]} mountedRows=[0,0]
|
93
|
+
* @protected
|
94
|
+
*/
|
95
|
+
mountedRows: [0, 0],
|
84
96
|
/**
|
85
97
|
* @member {String} role='rowgroup'
|
86
98
|
*/
|
@@ -112,10 +124,16 @@ class GridView extends Component {
|
|
112
124
|
store_: null,
|
113
125
|
/**
|
114
126
|
* Stores the indexes of the first & last painted columns
|
115
|
-
* @member {Number[]}
|
127
|
+
* @member {Number[]} visibleColumns=[0,0]
|
128
|
+
* @protected
|
129
|
+
*/
|
130
|
+
visibleColumns: [0, 0],
|
131
|
+
/**
|
132
|
+
* Stores the indexes of the first & last visible rows, excluding bufferRowRange
|
133
|
+
* @member {Number[]} visibleRows=[0,0]
|
116
134
|
* @protected
|
117
135
|
*/
|
118
|
-
|
136
|
+
visibleRows: [0, 0],
|
119
137
|
/**
|
120
138
|
* @member {String[]} wrapperCls=[]
|
121
139
|
*/
|
@@ -146,6 +164,19 @@ class GridView extends Component {
|
|
146
164
|
*/
|
147
165
|
scrollTimeoutId = null
|
148
166
|
|
167
|
+
/**
|
168
|
+
* @member {String[]} selectedRows
|
169
|
+
*/
|
170
|
+
get selectedCells() {
|
171
|
+
let {selectionModel} = this;
|
172
|
+
|
173
|
+
if (selectionModel.ntype.includes('cell')) {
|
174
|
+
return selectionModel.items
|
175
|
+
}
|
176
|
+
|
177
|
+
return []
|
178
|
+
}
|
179
|
+
|
149
180
|
/**
|
150
181
|
* @member {String[]} selectedRows
|
151
182
|
*/
|
@@ -193,7 +224,7 @@ class GridView extends Component {
|
|
193
224
|
*/
|
194
225
|
afterSetAvailableHeight(value, oldValue) {
|
195
226
|
if (value > 0) {
|
196
|
-
this.availableRows = Math.ceil(value / this.rowHeight)
|
227
|
+
this.availableRows = Math.ceil(value / this.rowHeight) - 1
|
197
228
|
}
|
198
229
|
}
|
199
230
|
|
@@ -204,9 +235,7 @@ class GridView extends Component {
|
|
204
235
|
* @protected
|
205
236
|
*/
|
206
237
|
afterSetAvailableRows(value, oldValue) {
|
207
|
-
|
208
|
-
this.createViewData()
|
209
|
-
}
|
238
|
+
value > 0 && this.createViewData()
|
210
239
|
}
|
211
240
|
|
212
241
|
/**
|
@@ -252,9 +281,7 @@ class GridView extends Component {
|
|
252
281
|
* @protected
|
253
282
|
*/
|
254
283
|
afterSetContainerWidth(value, oldValue) {
|
255
|
-
|
256
|
-
this.updateVisibleColumns()
|
257
|
-
}
|
284
|
+
value > 0 && this.updateMountedAndVisibleColumns()
|
258
285
|
}
|
259
286
|
|
260
287
|
/**
|
@@ -280,6 +307,16 @@ class GridView extends Component {
|
|
280
307
|
this.toggleCls('neo-is-scrolling', value)
|
281
308
|
}
|
282
309
|
|
310
|
+
/**
|
311
|
+
* Triggered after the mountedColumns config got changed
|
312
|
+
* @param {Number[]} value
|
313
|
+
* @param {Number[]} oldValue
|
314
|
+
* @protected
|
315
|
+
*/
|
316
|
+
afterSetMountedColumns(value, oldValue) {
|
317
|
+
oldValue !== undefined && this.createViewData()
|
318
|
+
}
|
319
|
+
|
283
320
|
/**
|
284
321
|
* Triggered after the rowHeight config got changed
|
285
322
|
* @param {Number} value
|
@@ -302,16 +339,17 @@ class GridView extends Component {
|
|
302
339
|
newStartIndex;
|
303
340
|
|
304
341
|
if (value.x !== oldValue?.x) {
|
305
|
-
me.
|
342
|
+
me.updateMountedAndVisibleColumns()
|
306
343
|
}
|
307
344
|
|
308
345
|
if (value.y !== oldValue?.y) {
|
309
346
|
newStartIndex = Math.floor(value.y / me.rowHeight);
|
310
347
|
|
311
|
-
if (newStartIndex
|
312
|
-
me.startIndex = 0
|
313
|
-
} else if (Math.abs(me.startIndex - newStartIndex) >= bufferRowRange) {
|
348
|
+
if (Math.abs(me.startIndex - newStartIndex) >= bufferRowRange) {
|
314
349
|
me.startIndex = newStartIndex
|
350
|
+
} else {
|
351
|
+
me.visibleRows[0] = newStartIndex;
|
352
|
+
me.visibleRows[1] = newStartIndex + me.availableRows
|
315
353
|
}
|
316
354
|
}
|
317
355
|
}
|
@@ -336,18 +374,6 @@ class GridView extends Component {
|
|
336
374
|
oldValue !== undefined && this.createViewData()
|
337
375
|
}
|
338
376
|
|
339
|
-
/**
|
340
|
-
* Triggered after the visibleColumns config got changed
|
341
|
-
* @param {Number[]} value
|
342
|
-
* @param {Number[]} oldValue
|
343
|
-
* @protected
|
344
|
-
*/
|
345
|
-
afterSetVisibleColumns(value, oldValue) {
|
346
|
-
if (oldValue !== undefined) {
|
347
|
-
this.createViewData()
|
348
|
-
}
|
349
|
-
}
|
350
|
-
|
351
377
|
/**
|
352
378
|
* @param {Object} data
|
353
379
|
* @param {String} [data.cellId]
|
@@ -359,13 +385,13 @@ class GridView extends Component {
|
|
359
385
|
*/
|
360
386
|
applyRendererOutput(data) {
|
361
387
|
let {cellId, column, columnIndex, record, rowIndex} = data,
|
362
|
-
me
|
363
|
-
gridContainer
|
364
|
-
{store}
|
365
|
-
cellCls
|
366
|
-
colspan
|
367
|
-
{dataField}
|
368
|
-
fieldValue
|
388
|
+
me = this,
|
389
|
+
gridContainer = me.parent,
|
390
|
+
{selectedCells, store} = me,
|
391
|
+
cellCls = ['neo-grid-cell'],
|
392
|
+
colspan = record[me.colspanField],
|
393
|
+
{dataField} = column,
|
394
|
+
fieldValue = record[dataField],
|
369
395
|
cellConfig, rendererOutput;
|
370
396
|
|
371
397
|
if (fieldValue === null || fieldValue === undefined) {
|
@@ -421,6 +447,10 @@ class GridView extends Component {
|
|
421
447
|
cellId = me.getCellId(record, column.dataField)
|
422
448
|
}
|
423
449
|
|
450
|
+
if (selectedCells.includes(cellId)) {
|
451
|
+
cellCls.push('neo-selected')
|
452
|
+
}
|
453
|
+
|
424
454
|
cellConfig = {
|
425
455
|
'aria-colindex': columnIndex + 1, // 1 based
|
426
456
|
id : cellId,
|
@@ -486,12 +516,12 @@ class GridView extends Component {
|
|
486
516
|
}
|
487
517
|
|
488
518
|
let me = this,
|
489
|
-
{
|
519
|
+
{mountedColumns, selectedRows} = me,
|
490
520
|
gridContainer = me.parent,
|
491
521
|
columns = gridContainer.headerToolbar.items,
|
492
522
|
id = me.getRowId(record, rowIndex),
|
493
523
|
rowCls = me.getRowClass(record, rowIndex),
|
494
|
-
config, column, columnPosition,
|
524
|
+
config, column, columnPosition, gridRow, i;
|
495
525
|
|
496
526
|
if (rowIndex % 2 !== 0) {
|
497
527
|
rowCls.push('neo-even')
|
@@ -519,10 +549,7 @@ class GridView extends Component {
|
|
519
549
|
}
|
520
550
|
};
|
521
551
|
|
522
|
-
|
523
|
-
startIndex = Math.max(0, visibleColumns[0] - bufferColumnRange);
|
524
|
-
|
525
|
-
for (i=startIndex; i <= endIndex; i++) {
|
552
|
+
for (i=mountedColumns[0]; i <= mountedColumns[1]; i++) {
|
526
553
|
column = columns[i];
|
527
554
|
config = me.applyRendererOutput({column, columnIndex: i, record, rowIndex});
|
528
555
|
|
@@ -553,26 +580,25 @@ class GridView extends Component {
|
|
553
580
|
*
|
554
581
|
*/
|
555
582
|
createViewData() {
|
556
|
-
let me
|
557
|
-
{
|
558
|
-
|
559
|
-
|
560
|
-
endIndex, i;
|
583
|
+
let me = this,
|
584
|
+
{mountedRows, store} = me,
|
585
|
+
rows = [],
|
586
|
+
i;
|
561
587
|
|
562
588
|
if (
|
563
589
|
store.isLoading ||
|
564
590
|
me.availableRows < 1 ||
|
565
591
|
me._containerWidth < 1 || // we are not checking me.containerWidth, since we want to ignore the config symbol
|
566
592
|
me.columnPositions.getCount() < 1 ||
|
567
|
-
me.
|
593
|
+
me.mountedColumns[1] < 1
|
568
594
|
) {
|
569
595
|
return
|
570
596
|
}
|
571
597
|
|
572
|
-
|
573
|
-
|
598
|
+
// Creates the new start & end indexes
|
599
|
+
me.updateMountedAndVisibleRows();
|
574
600
|
|
575
|
-
for (i=
|
601
|
+
for (i=mountedRows[0]; i < mountedRows[1]; i++) {
|
576
602
|
rows.push(me.createRow({record: store.items[i], rowIndex: i}))
|
577
603
|
}
|
578
604
|
|
@@ -700,6 +726,7 @@ class GridView extends Component {
|
|
700
726
|
|
701
727
|
/**
|
702
728
|
* Get the matching record by passing a row id, a cell id or an id inside a grid cell.
|
729
|
+
* Limited to mounted rows (must be inside the vdom).
|
703
730
|
* @param {String} nodeId
|
704
731
|
* @returns {Object|null}
|
705
732
|
*/
|
@@ -714,7 +741,7 @@ class GridView extends Component {
|
|
714
741
|
|
715
742
|
parentNodes = VDomUtil.getParentNodes(me.vdom, nodeId);
|
716
743
|
|
717
|
-
for (node of parentNodes) {
|
744
|
+
for (node of parentNodes || []) {
|
718
745
|
record = me.getRecordByRowId(node.id);
|
719
746
|
|
720
747
|
if (record) {
|
@@ -725,6 +752,22 @@ class GridView extends Component {
|
|
725
752
|
return null
|
726
753
|
}
|
727
754
|
|
755
|
+
/**
|
756
|
+
* @param {String} cellId
|
757
|
+
* @returns {Record}
|
758
|
+
*/
|
759
|
+
getRecordByCellId(cellId) {
|
760
|
+
let recordId = cellId.split('__')[1],
|
761
|
+
{store} = this,
|
762
|
+
keyType = store.getKeyType();
|
763
|
+
|
764
|
+
if (keyType === 'int' || keyType === 'integer') {
|
765
|
+
recordId = parseInt(recordId)
|
766
|
+
}
|
767
|
+
|
768
|
+
return store.get(recordId)
|
769
|
+
}
|
770
|
+
|
728
771
|
/**
|
729
772
|
* @param {String} rowId
|
730
773
|
* @returns {Record}
|
@@ -732,9 +775,7 @@ class GridView extends Component {
|
|
732
775
|
getRecordByRowId(rowId) {
|
733
776
|
let recordId = rowId.split('__')[2],
|
734
777
|
{store} = this,
|
735
|
-
|
736
|
-
keyField = model?.getField(store.getKeyProperty()),
|
737
|
-
keyType = keyField?.type?.toLowerCase();
|
778
|
+
keyType = store.getKeyType();
|
738
779
|
|
739
780
|
if (keyType === 'int' || keyType === 'integer') {
|
740
781
|
recordId = parseInt(recordId)
|
@@ -823,6 +864,7 @@ class GridView extends Component {
|
|
823
864
|
/**
|
824
865
|
* Only triggers for vertical scrolling
|
825
866
|
* @param {Object} data
|
867
|
+
* @protected
|
826
868
|
*/
|
827
869
|
onScroll({scrollTop, touches}) {
|
828
870
|
let me = this,
|
@@ -941,29 +983,64 @@ class GridView extends Component {
|
|
941
983
|
}
|
942
984
|
|
943
985
|
/**
|
944
|
-
*
|
986
|
+
* Used for keyboard navigation (selection models)
|
987
|
+
* @param {Number} index
|
988
|
+
* @param {Number} step
|
945
989
|
*/
|
946
|
-
|
947
|
-
let me
|
948
|
-
|
949
|
-
|
990
|
+
scrollByRows(index, step) {
|
991
|
+
let me = this,
|
992
|
+
{mountedRows, visibleRows} = me,
|
993
|
+
countRecords = me.store.getCount(),
|
994
|
+
newIndex = index + step,
|
995
|
+
lastRowGap, mounted, scrollPosition, visible;
|
996
|
+
|
997
|
+
if (newIndex >= countRecords) {
|
998
|
+
newIndex %= countRecords;
|
999
|
+
step = newIndex - index
|
1000
|
+
}
|
950
1001
|
|
951
|
-
|
952
|
-
|
953
|
-
|
1002
|
+
while (newIndex < 0) {
|
1003
|
+
newIndex += countRecords;
|
1004
|
+
step += countRecords
|
1005
|
+
}
|
1006
|
+
|
1007
|
+
mounted = newIndex >= mountedRows[0] && newIndex <= mountedRows[1];
|
1008
|
+
|
1009
|
+
// Not using >= or <=, since the first / last row might not be fully visible
|
1010
|
+
visible = newIndex > visibleRows[0] && newIndex < visibleRows[1];
|
1011
|
+
|
1012
|
+
if (!visible) {
|
1013
|
+
// Leaving the mounted area will re-calculate the visibleRows for us
|
1014
|
+
if (mounted) {
|
1015
|
+
visibleRows[0] += step;
|
1016
|
+
visibleRows[1] += step
|
1017
|
+
}
|
1018
|
+
|
1019
|
+
if (step < 0) {
|
1020
|
+
scrollPosition = newIndex * me.rowHeight
|
1021
|
+
} else {
|
1022
|
+
lastRowGap = me.rowHeight - (me.availableHeight % me.rowHeight);
|
1023
|
+
scrollPosition = (newIndex - me.availableRows) * me.rowHeight + lastRowGap
|
1024
|
+
}
|
1025
|
+
|
1026
|
+
Neo.main.DomAccess.scrollTo({
|
1027
|
+
id : me.vdom.id,
|
1028
|
+
value : scrollPosition,
|
1029
|
+
windowId: me.windowId
|
1030
|
+
})
|
954
1031
|
}
|
955
1032
|
}
|
956
1033
|
|
957
1034
|
/**
|
958
1035
|
*
|
959
1036
|
*/
|
960
|
-
|
961
|
-
let me
|
962
|
-
{columnPositions} = me,
|
963
|
-
{x}
|
964
|
-
i
|
965
|
-
len
|
966
|
-
endIndex
|
1037
|
+
updateMountedAndVisibleColumns() {
|
1038
|
+
let me = this,
|
1039
|
+
{bufferColumnRange, columnPositions, visibleColumns} = me,
|
1040
|
+
{x} = me.scrollPosition,
|
1041
|
+
i = 0,
|
1042
|
+
len = columnPositions.getCount(),
|
1043
|
+
endIndex = len - 1,
|
967
1044
|
column, startIndex;
|
968
1045
|
|
969
1046
|
if (len < 1) {
|
@@ -987,7 +1064,46 @@ class GridView extends Component {
|
|
987
1064
|
Math.abs(startIndex - me.visibleColumns[0]) >= me.bufferColumnRange ||
|
988
1065
|
me.visibleColumns[1] < 1 // initial call
|
989
1066
|
) {
|
990
|
-
|
1067
|
+
visibleColumns[0] = startIndex;
|
1068
|
+
visibleColumns[1] = endIndex;
|
1069
|
+
|
1070
|
+
endIndex = Math.min(len - 1, visibleColumns[1] + bufferColumnRange);
|
1071
|
+
startIndex = Math.max(0, visibleColumns[0] - bufferColumnRange);
|
1072
|
+
|
1073
|
+
me.mountedColumns = [startIndex, endIndex]
|
1074
|
+
}
|
1075
|
+
}
|
1076
|
+
|
1077
|
+
/**
|
1078
|
+
*
|
1079
|
+
*/
|
1080
|
+
updateMountedAndVisibleRows() {
|
1081
|
+
let me = this,
|
1082
|
+
{bufferRowRange, startIndex, store} = me,
|
1083
|
+
countRecords = store.getCount(),
|
1084
|
+
endIndex = Math.min(countRecords, startIndex + me.availableRows);
|
1085
|
+
|
1086
|
+
me.visibleRows[0] = startIndex; // update the array inline
|
1087
|
+
me.visibleRows[1] = endIndex;
|
1088
|
+
|
1089
|
+
startIndex = Math.max(0, startIndex - bufferRowRange);
|
1090
|
+
endIndex = Math.min(countRecords, endIndex + bufferRowRange);
|
1091
|
+
|
1092
|
+
me.mountedRows[0] = startIndex; // update the array inline
|
1093
|
+
me.mountedRows[1] = endIndex;
|
1094
|
+
}
|
1095
|
+
|
1096
|
+
/**
|
1097
|
+
* @param {Boolean} silent=false
|
1098
|
+
*/
|
1099
|
+
updateScrollHeight(silent=false) {
|
1100
|
+
let me = this,
|
1101
|
+
countRecords = me.store.getCount(),
|
1102
|
+
{rowHeight} = me;
|
1103
|
+
|
1104
|
+
if (countRecords > 0 && rowHeight > 0) {
|
1105
|
+
me.vdom.cn[0].height = `${(countRecords + 1) * rowHeight}px`;
|
1106
|
+
!silent && me.update()
|
991
1107
|
}
|
992
1108
|
}
|
993
1109
|
}
|
package/src/main/DomAccess.mjs
CHANGED
@@ -888,20 +888,17 @@ class DomAccess extends Base {
|
|
888
888
|
}
|
889
889
|
|
890
890
|
/**
|
891
|
+
* See: https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollBy
|
891
892
|
* @param {Object} data
|
892
|
-
* @param {String} data.
|
893
|
+
* @param {String} data.behavior='auto' auto, instant, smooth
|
894
|
+
* @param {String} data.direction='top' left, top
|
893
895
|
* @param {String} data.id
|
894
896
|
* @param {Number} data.value
|
895
897
|
* @returns {Object} obj.id => the passed id
|
896
898
|
*/
|
897
|
-
scrollBy(
|
898
|
-
|
899
|
-
|
900
|
-
if (node) {
|
901
|
-
node[`scroll${Neo.capitalize(data.direction)}`] += data.value
|
902
|
-
}
|
903
|
-
|
904
|
-
return {id: data.id}
|
899
|
+
scrollBy({behavior='auto', direction='top', id, value}) {
|
900
|
+
this.getElement(id)?.scrollBy({behavior, [direction]: value});
|
901
|
+
return {id}
|
905
902
|
}
|
906
903
|
|
907
904
|
/**
|
@@ -928,7 +925,7 @@ class DomAccess extends Base {
|
|
928
925
|
if (node) {
|
929
926
|
let hasListener = 'scrollend' in window;
|
930
927
|
|
931
|
-
hasListener && document.addEventListener('scrollend', () =>resolve(), {capture: true, once: true});
|
928
|
+
hasListener && document.addEventListener('scrollend', () => resolve(), {capture: true, once: true});
|
932
929
|
|
933
930
|
node.scrollIntoView(opts);
|
934
931
|
|
@@ -941,31 +938,28 @@ class DomAccess extends Base {
|
|
941
938
|
}
|
942
939
|
|
943
940
|
/**
|
941
|
+
* See: https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollTo
|
944
942
|
* @param {Object} data
|
943
|
+
* @param {String} data.behavior='auto' auto, instant, smooth
|
945
944
|
* @param {String} data.direction='top' left, top
|
946
945
|
* @param {String} data.id
|
947
946
|
* @param {Number} data.value
|
948
947
|
* @returns {Object} obj.id => the passed id
|
949
948
|
*/
|
950
|
-
scrollTo({direction='top', id, value}) {
|
951
|
-
|
952
|
-
|
953
|
-
if (node) {
|
954
|
-
node[`scroll${Neo.capitalize(direction)}`] = value
|
955
|
-
}
|
956
|
-
|
949
|
+
scrollTo({behavior='auto', direction='top', id, value}) {
|
950
|
+
this.getElement(id)?.scrollTo({behavior, [direction]: value});
|
957
951
|
return {id}
|
958
952
|
}
|
959
953
|
|
960
954
|
/**
|
961
955
|
* @param {Object} data
|
962
956
|
* @param {String} data.id
|
963
|
-
* @param {String}
|
964
|
-
* @param {
|
957
|
+
* @param {String} data.behavior='smooth'
|
958
|
+
* @param {Number} data.offset=34
|
965
959
|
* @returns {Object} obj.id => the passed id
|
966
960
|
*/
|
967
|
-
scrollToTableRow(
|
968
|
-
let node = this.getElement(
|
961
|
+
scrollToTableRow({id, behavior='smooth', offset=34}) {
|
962
|
+
let node = this.getElement(id); // tr tag
|
969
963
|
|
970
964
|
if (node) {
|
971
965
|
let tableNode = node.parentNode.parentNode,
|
@@ -974,12 +968,12 @@ class DomAccess extends Base {
|
|
974
968
|
top = node.getBoundingClientRect().top;
|
975
969
|
|
976
970
|
wrapperNode.scrollTo({
|
977
|
-
behavior
|
978
|
-
top
|
971
|
+
behavior,
|
972
|
+
top: top - tableTop - offset
|
979
973
|
})
|
980
974
|
}
|
981
975
|
|
982
|
-
return {id
|
976
|
+
return {id}
|
983
977
|
}
|
984
978
|
|
985
979
|
/**
|
@@ -112,10 +112,10 @@ class CellModel extends BaseModel {
|
|
112
112
|
{view} = me,
|
113
113
|
{store} = view,
|
114
114
|
currentIndex = 0,
|
115
|
-
dataField, newIndex;
|
115
|
+
dataField, newIndex, record;
|
116
116
|
|
117
117
|
if (me.hasSelection()) {
|
118
|
-
currentIndex = store.indexOf(view.
|
118
|
+
currentIndex = store.indexOf(view.getRecordByCellId(me.items[0]));
|
119
119
|
dataField = view.getDataField(me.items[0])
|
120
120
|
} else {
|
121
121
|
dataField = me.dataFields[0]
|
@@ -127,7 +127,11 @@ class CellModel extends BaseModel {
|
|
127
127
|
newIndex += store.getCount()
|
128
128
|
}
|
129
129
|
|
130
|
-
|
130
|
+
record = store.getAt(newIndex);
|
131
|
+
|
132
|
+
me.select(view.getCellId(record, dataField));
|
133
|
+
|
134
|
+
view.scrollByRows(currentIndex, step)
|
131
135
|
}
|
132
136
|
|
133
137
|
/**
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import CellColumnModel from './CellColumnModel.mjs';
|
2
|
+
import CellColumnRowModel from './CellColumnRowModel.mjs';
|
3
|
+
import CellModel from './CellModel.mjs';
|
4
|
+
import CellRowModel from './CellRowModel.mjs';
|
5
|
+
import ColumnModel from './ColumnModel.mjs';
|
6
|
+
import RowModel from './RowModel.mjs';
|
7
|
+
|
8
|
+
export {CellColumnModel, CellColumnRowModel, CellModel, CellRowModel, ColumnModel, RowModel};
|
package/src/util/ClassSystem.mjs
CHANGED
@@ -21,7 +21,7 @@ class ClassSystem extends Base {
|
|
21
21
|
* @returns {Neo.core.Base} instance
|
22
22
|
*/
|
23
23
|
static beforeSetInstance(config, DefaultClass=null, defaultValues={}) {
|
24
|
-
let
|
24
|
+
let configType = Neo.typeOf(config);
|
25
25
|
|
26
26
|
if (Neo.isString(DefaultClass)) {
|
27
27
|
DefaultClass = Neo.ns(DefaultClass)
|
@@ -29,9 +29,9 @@ class ClassSystem extends Base {
|
|
29
29
|
|
30
30
|
if (!config && DefaultClass) {
|
31
31
|
config = Neo.create(DefaultClass, defaultValues)
|
32
|
-
} else if (
|
32
|
+
} else if (configType === 'NeoClass') {
|
33
33
|
config = Neo.create(config, defaultValues)
|
34
|
-
} else if (
|
34
|
+
} else if (configType === 'Object') {
|
35
35
|
if (config.ntype) {
|
36
36
|
config = Neo.ntype({
|
37
37
|
...defaultValues,
|
@@ -51,7 +51,7 @@ class ClassSystem extends Base {
|
|
51
51
|
|
52
52
|
config = Neo.create(newConfig)
|
53
53
|
}
|
54
|
-
} else if (
|
54
|
+
} else if (configType === 'NeoInstance') {
|
55
55
|
if (defaultValues?.listeners) {
|
56
56
|
config.on(defaultValues.listeners)
|
57
57
|
}
|
@@ -1,25 +0,0 @@
|
|
1
|
-
.neo-configuration-panel {
|
2
|
-
transition: width .5s ease-in-out;
|
3
|
-
|
4
|
-
.neo-details-label {
|
5
|
-
background-color: #323232;
|
6
|
-
color : #ddd;
|
7
|
-
font-size : 13px;
|
8
|
-
margin : 10px;
|
9
|
-
padding : 10px;
|
10
|
-
white-space : normal;
|
11
|
-
}
|
12
|
-
|
13
|
-
.neo-toolbar {
|
14
|
-
border : 0;
|
15
|
-
border-bottom: 1px solid var(--panel-border-color);
|
16
|
-
}
|
17
|
-
}
|
18
|
-
|
19
|
-
.neo-configuration-panel-body {
|
20
|
-
overflow-y: scroll;
|
21
|
-
}
|
22
|
-
|
23
|
-
.neo-examples-tab-component {
|
24
|
-
background-color: var(--examples-tab-component-background-color);
|
25
|
-
}
|