@revolist/revogrid 4.9.37 → 4.9.40
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/dist/cjs/{column.drag.plugin-ffe1918f.js → column.drag.plugin-fcd892ec.js} +18 -18
- package/dist/cjs/column.drag.plugin-fcd892ec.js.map +1 -0
- package/dist/cjs/{index-947f3534.js → column.service-26c61ed6.js} +1256 -469
- package/dist/cjs/column.service-26c61ed6.js.map +1 -0
- package/dist/cjs/{edit.utils-68a4f1c4.js → edit.utils-179c0800.js} +2 -2
- package/dist/cjs/{edit.utils-68a4f1c4.js.map → edit.utils-179c0800.js.map} +1 -1
- package/dist/cjs/{header-cell-renderer-57fb8f18.js → header-cell-renderer-d879d95e.js} +2 -2
- package/dist/cjs/{header-cell-renderer-57fb8f18.js.map → header-cell-renderer-d879d95e.js.map} +1 -1
- package/dist/cjs/index-3ab26ab9.js +513 -0
- package/dist/cjs/index-3ab26ab9.js.map +1 -0
- package/dist/cjs/index.cjs.js +21 -20
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/cjs/{key.utils-da2ead49.js → key.utils-f49d7bee.js} +2 -2
- package/dist/cjs/{key.utils-da2ead49.js.map → key.utils-f49d7bee.js.map} +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/revo-grid.cjs.entry.js +87 -55
- package/dist/cjs/revo-grid.cjs.entry.js.map +1 -1
- package/dist/cjs/revo-grid.cjs.js +1 -1
- package/dist/cjs/revogr-attribution_7.cjs.entry.js +13 -13
- package/dist/cjs/revogr-attribution_7.cjs.entry.js.map +1 -1
- package/dist/cjs/revogr-clipboard_3.cjs.entry.js +21 -18
- package/dist/cjs/revogr-clipboard_3.cjs.entry.js.map +1 -1
- package/dist/cjs/revogr-data_4.cjs.entry.js +9 -9
- package/dist/cjs/revogr-data_4.cjs.entry.js.map +1 -1
- package/dist/cjs/{row-header-utils-fe2264e7.js → row-header-utils-c37f76e4.js} +6 -5
- package/dist/cjs/row-header-utils-c37f76e4.js.map +1 -0
- package/dist/cjs/{text-editor-55511a6a.js → text-editor-b756d6b3.js} +3 -3
- package/dist/cjs/{text-editor-55511a6a.js.map → text-editor-b756d6b3.js.map} +1 -1
- package/dist/cjs/{throttle-2ae258fb.js → throttle-a57f51f9.js} +2 -2
- package/dist/cjs/{throttle-2ae258fb.js.map → throttle-a57f51f9.js.map} +1 -1
- package/dist/collection/components/order/revogr-order-editor.js +99 -27
- package/dist/collection/components/order/revogr-order-editor.js.map +1 -1
- package/dist/collection/components/overlay/revogr-overlay-selection.js +2 -2
- package/dist/collection/components/overlay/revogr-overlay-selection.js.map +1 -1
- package/dist/collection/components/revoGrid/revo-grid.js +10 -0
- package/dist/collection/components/revoGrid/revo-grid.js.map +1 -1
- package/dist/collection/plugins/sorting/sorting.plugin.js +25 -27
- package/dist/collection/plugins/sorting/sorting.plugin.js.map +1 -1
- package/dist/collection/services/data.provider.js +12 -5
- package/dist/collection/services/data.provider.js.map +1 -1
- package/dist/collection/services/dimension.provider.js +22 -0
- package/dist/collection/services/dimension.provider.js.map +1 -1
- package/dist/collection/store/dataSource/data.proxy.js +19 -6
- package/dist/collection/store/dataSource/data.proxy.js.map +1 -1
- package/dist/collection/store/dataSource/data.store.js +3 -0
- package/dist/collection/store/dataSource/data.store.js.map +1 -1
- package/dist/collection/types/events.js +1 -0
- package/dist/collection/types/events.js.map +1 -1
- package/dist/esm/{column.drag.plugin-bbd79520.js → column.drag.plugin-3cc77986.js} +6 -6
- package/dist/esm/{column.drag.plugin-bbd79520.js.map → column.drag.plugin-3cc77986.js.map} +1 -1
- package/dist/esm/{index-8eeaa30d.js → column.service-751345b2.js} +1216 -427
- package/dist/esm/column.service-751345b2.js.map +1 -0
- package/dist/esm/{debounce-7b511afc.js → debounce-72878ced.js} +2 -2
- package/dist/esm/{debounce-7b511afc.js.map → debounce-72878ced.js.map} +1 -1
- package/dist/esm/{edit.utils-aeb2dc7c.js → edit.utils-6fc686b9.js} +2 -2
- package/dist/esm/{edit.utils-aeb2dc7c.js.map → edit.utils-6fc686b9.js.map} +1 -1
- package/dist/esm/{header-cell-renderer-1aec2328.js → header-cell-renderer-32d2ed96.js} +2 -2
- package/dist/esm/{header-cell-renderer-1aec2328.js.map → header-cell-renderer-32d2ed96.js.map} +1 -1
- package/dist/esm/index-1dcad6ef.js +476 -0
- package/dist/esm/index-1dcad6ef.js.map +1 -0
- package/dist/esm/index.js +9 -8
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/{key.utils-9ee5fa40.js → key.utils-17273f42.js} +2 -2
- package/dist/esm/{key.utils-9ee5fa40.js.map → key.utils-17273f42.js.map} +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/revo-grid.entry.js +67 -35
- package/dist/esm/revo-grid.entry.js.map +1 -1
- package/dist/esm/revo-grid.js +1 -1
- package/dist/esm/revogr-attribution_7.entry.js +9 -9
- package/dist/esm/revogr-attribution_7.entry.js.map +1 -1
- package/dist/esm/revogr-clipboard_3.entry.js +22 -19
- package/dist/esm/revogr-clipboard_3.entry.js.map +1 -1
- package/dist/esm/revogr-data_4.entry.js +5 -5
- package/dist/esm/revogr-filter-panel.entry.js +1 -1
- package/dist/esm/{row-header-utils-3220f80d.js → row-header-utils-3dfbb81f.js} +3 -2
- package/dist/esm/row-header-utils-3dfbb81f.js.map +1 -0
- package/dist/esm/{text-editor-d9dcf56d.js → text-editor-901c3eb8.js} +3 -3
- package/dist/esm/{text-editor-d9dcf56d.js.map → text-editor-901c3eb8.js.map} +1 -1
- package/dist/esm/{throttle-ce8e57c9.js → throttle-138d69c3.js} +3 -3
- package/dist/esm/{throttle-ce8e57c9.js.map → throttle-138d69c3.js.map} +1 -1
- package/dist/revo-grid/column.drag.plugin-3cc77986.js +5 -0
- package/dist/revo-grid/{column.drag.plugin-bbd79520.js.map → column.drag.plugin-3cc77986.js.map} +1 -1
- package/dist/revo-grid/column.service-751345b2.js +5 -0
- package/dist/revo-grid/column.service-751345b2.js.map +1 -0
- package/dist/revo-grid/{debounce-7b511afc.js → debounce-72878ced.js} +2 -2
- package/dist/revo-grid/{edit.utils-aeb2dc7c.js → edit.utils-6fc686b9.js} +2 -2
- package/dist/revo-grid/{header-cell-renderer-1aec2328.js → header-cell-renderer-32d2ed96.js} +2 -2
- package/dist/revo-grid/index-1dcad6ef.js +5 -0
- package/dist/revo-grid/index-1dcad6ef.js.map +1 -0
- package/dist/revo-grid/index.esm.js +1 -1
- package/dist/revo-grid/index.esm.js.map +1 -1
- package/dist/revo-grid/key.utils-17273f42.js +5 -0
- package/dist/revo-grid/{key.utils-9ee5fa40.js.map → key.utils-17273f42.js.map} +1 -1
- package/dist/revo-grid/revo-grid.entry.js +1 -1
- package/dist/revo-grid/revo-grid.entry.js.map +1 -1
- package/dist/revo-grid/revo-grid.esm.js +1 -1
- package/dist/revo-grid/revo-grid.esm.js.map +1 -1
- package/dist/revo-grid/revogr-attribution_7.entry.js +1 -1
- package/dist/revo-grid/revogr-attribution_7.entry.js.map +1 -1
- package/dist/revo-grid/revogr-clipboard_3.entry.js +1 -1
- package/dist/revo-grid/revogr-clipboard_3.entry.js.map +1 -1
- package/dist/revo-grid/revogr-data_4.entry.js +1 -1
- package/dist/revo-grid/revogr-data_4.entry.js.map +1 -1
- package/dist/revo-grid/revogr-filter-panel.entry.js +1 -1
- package/dist/revo-grid/row-header-utils-3dfbb81f.js +5 -0
- package/dist/revo-grid/{row-header-utils-3220f80d.js.map → row-header-utils-3dfbb81f.js.map} +1 -1
- package/dist/revo-grid/text-editor-901c3eb8.js +5 -0
- package/dist/revo-grid/{throttle-ce8e57c9.js → throttle-138d69c3.js} +2 -2
- package/dist/types/components/order/revogr-order-editor.d.ts +18 -4
- package/dist/types/components/overlay/revogr-overlay-selection.d.ts +2 -4
- package/dist/types/components/revoGrid/revo-grid.d.ts +1 -0
- package/dist/types/components.d.ts +25 -6
- package/dist/types/plugins/sorting/sorting.plugin.d.ts +4 -4
- package/dist/types/services/data.provider.d.ts +5 -0
- package/dist/types/services/dimension.provider.d.ts +1 -0
- package/dist/types/store/dataSource/data.proxy.d.ts +9 -3
- package/dist/types/store/dataSource/data.store.d.ts +1 -0
- package/dist/types/types/events.d.ts +1 -1
- package/hydrate/index.js +127 -75
- package/hydrate/index.mjs +127 -75
- package/package.json +1 -1
- package/standalone/column.service.js +1 -1
- package/standalone/data.store.js +28 -31
- package/standalone/data.store.js.map +1 -1
- package/standalone/dimension.helpers.js +1 -1
- package/standalone/identity.js +26 -0
- package/standalone/identity.js.map +1 -0
- package/standalone/index.js +2 -1
- package/standalone/index.js.map +1 -1
- package/standalone/revo-grid.js +64 -31
- package/standalone/revo-grid.js.map +1 -1
- package/standalone/revogr-header2.js +1 -1
- package/standalone/revogr-order-editor2.js +18 -15
- package/standalone/revogr-order-editor2.js.map +1 -1
- package/standalone/revogr-overlay-selection2.js +2 -2
- package/standalone/revogr-overlay-selection2.js.map +1 -1
- package/dist/cjs/column.drag.plugin-ffe1918f.js.map +0 -1
- package/dist/cjs/column.service-e9ab1aa3.js +0 -1286
- package/dist/cjs/column.service-e9ab1aa3.js.map +0 -1
- package/dist/cjs/index-947f3534.js.map +0 -1
- package/dist/cjs/row-header-utils-fe2264e7.js.map +0 -1
- package/dist/esm/column.service-397b7249.js +0 -1249
- package/dist/esm/column.service-397b7249.js.map +0 -1
- package/dist/esm/index-8eeaa30d.js.map +0 -1
- package/dist/esm/row-header-utils-3220f80d.js.map +0 -1
- package/dist/revo-grid/column.drag.plugin-bbd79520.js +0 -5
- package/dist/revo-grid/column.service-397b7249.js +0 -5
- package/dist/revo-grid/column.service-397b7249.js.map +0 -1
- package/dist/revo-grid/index-8eeaa30d.js +0 -5
- package/dist/revo-grid/index-8eeaa30d.js.map +0 -1
- package/dist/revo-grid/key.utils-9ee5fa40.js +0 -5
- package/dist/revo-grid/row-header-utils-3220f80d.js +0 -5
- package/dist/revo-grid/text-editor-d9dcf56d.js +0 -5
- /package/dist/revo-grid/{debounce-7b511afc.js.map → debounce-72878ced.js.map} +0 -0
- /package/dist/revo-grid/{edit.utils-aeb2dc7c.js.map → edit.utils-6fc686b9.js.map} +0 -0
- /package/dist/revo-grid/{header-cell-renderer-1aec2328.js.map → header-cell-renderer-32d2ed96.js.map} +0 -0
- /package/dist/revo-grid/{text-editor-d9dcf56d.js.map → text-editor-901c3eb8.js.map} +0 -0
- /package/dist/revo-grid/{throttle-ce8e57c9.js.map → throttle-138d69c3.js.map} +0 -0
package/hydrate/index.mjs
CHANGED
|
@@ -3295,12 +3295,48 @@ class FilterPanel {
|
|
|
3295
3295
|
}; }
|
|
3296
3296
|
}
|
|
3297
3297
|
|
|
3298
|
+
const MIN_COL_SIZE = 30;
|
|
3299
|
+
const RESIZE_INTERVAL = 40;
|
|
3300
|
+
const DATA_COL = 'data-rgCol';
|
|
3301
|
+
const DATA_ROW = 'data-rgRow';
|
|
3302
|
+
const DISABLED_CLASS = 'disabled';
|
|
3303
|
+
const CELL_CLASS = 'rgCell';
|
|
3304
|
+
const ROW_HEADER_TYPE = 'rowHeaders';
|
|
3305
|
+
const HEADER_CLASS = 'rgHeaderCell';
|
|
3306
|
+
const HEADER_SORTABLE_CLASS = 'sortable';
|
|
3307
|
+
const HEADER_ROW_CLASS = 'header-rgRow';
|
|
3308
|
+
const HEADER_ACTUAL_ROW_CLASS = 'actual-rgRow';
|
|
3309
|
+
const DRAG_ICON_CLASS = 'revo-drag-icon';
|
|
3310
|
+
const DRAGGABLE_CLASS = 'revo-draggable';
|
|
3311
|
+
const FOCUS_CLASS = 'focused-cell';
|
|
3312
|
+
const SELECTION_BORDER_CLASS = 'selection-border-range';
|
|
3313
|
+
const MOBILE_CLASS = 'mobile-handler';
|
|
3314
|
+
const TMP_SELECTION_BG_CLASS = 'temp-bg-range';
|
|
3315
|
+
const CELL_HANDLER_CLASS = 'autofill-handle';
|
|
3316
|
+
const EDIT_INPUT_WR = 'edit-input-wrapper';
|
|
3317
|
+
const DRAGG_TEXT = 'Draggable item';
|
|
3318
|
+
const GRID_INTERNALS = '__rvgr';
|
|
3319
|
+
const ROW_FOCUSED_CLASS = 'focused-rgRow';
|
|
3320
|
+
|
|
3298
3321
|
/**
|
|
3299
|
-
*
|
|
3300
|
-
*
|
|
3301
|
-
*
|
|
3322
|
+
* Proxy plugin for data source.
|
|
3323
|
+
* This plugin is used to sort the data source.
|
|
3324
|
+
* It keeps the order of the items but does not modify the final source.
|
|
3325
|
+
* It is also used to filter the items in the data source.
|
|
3326
|
+
* The `set` method takes a key and a new value as arguments.
|
|
3327
|
+
* If the key is 'proxyItems' it will filter the items in the data source according to the new value.
|
|
3328
|
+
* The new value should be an array of numbers representing the indexes of the items that should be visible.
|
|
3329
|
+
* The method will return a new array of numbers with the indexes of the items that should be visible.
|
|
3330
|
+
* The method will also update the 'items' property of the store with the new array.
|
|
3302
3331
|
*/
|
|
3303
3332
|
const proxyPlugin = (store) => ({
|
|
3333
|
+
/**
|
|
3334
|
+
* Set the value of a property in the store.
|
|
3335
|
+
* If the key is 'proxyItems' it will filter the items in the data source according to the new value.
|
|
3336
|
+
* The new value should be an array of numbers representing the indexes of the items that should be visible.
|
|
3337
|
+
* The method will return a new array of numbers with the indexes of the items that should be visible.
|
|
3338
|
+
* The method will also update the 'items' property of the store with the new array.
|
|
3339
|
+
*/
|
|
3304
3340
|
set(k, newVal) {
|
|
3305
3341
|
if (!isProxy(k)) {
|
|
3306
3342
|
return;
|
|
@@ -3310,15 +3346,15 @@ const proxyPlugin = (store) => ({
|
|
|
3310
3346
|
* Mark indexes as visible
|
|
3311
3347
|
*/
|
|
3312
3348
|
const oldItems = store.get('items').reduce((r, v) => {
|
|
3313
|
-
r
|
|
3349
|
+
r.add(v);
|
|
3314
3350
|
return r;
|
|
3315
|
-
},
|
|
3351
|
+
}, new Set());
|
|
3316
3352
|
/**
|
|
3317
3353
|
* Check if new values where present in items
|
|
3318
3354
|
* Filter item collection according presense
|
|
3319
3355
|
*/
|
|
3320
3356
|
const newItems = newVal.reduce((r, i) => {
|
|
3321
|
-
if (oldItems
|
|
3357
|
+
if (oldItems.has(i)) {
|
|
3322
3358
|
r.push(i);
|
|
3323
3359
|
}
|
|
3324
3360
|
return r;
|
|
@@ -6359,6 +6395,9 @@ class DataStore {
|
|
|
6359
6395
|
trimmed = Object.assign(Object.assign({}, trimmed), some);
|
|
6360
6396
|
setStore(this.store, { trimmed });
|
|
6361
6397
|
}
|
|
6398
|
+
setSourceData(items, mutate = true) {
|
|
6399
|
+
setSourceByVirtualIndex(this.store, items, mutate);
|
|
6400
|
+
}
|
|
6362
6401
|
// local data update
|
|
6363
6402
|
setData(input) {
|
|
6364
6403
|
const data = Object.assign({}, input);
|
|
@@ -7800,29 +7839,6 @@ function isRowType(type) {
|
|
|
7800
7839
|
return rowTypes.indexOf(type) > -1;
|
|
7801
7840
|
}
|
|
7802
7841
|
|
|
7803
|
-
const MIN_COL_SIZE = 30;
|
|
7804
|
-
const RESIZE_INTERVAL = 40;
|
|
7805
|
-
const DATA_COL = 'data-rgCol';
|
|
7806
|
-
const DATA_ROW = 'data-rgRow';
|
|
7807
|
-
const DISABLED_CLASS = 'disabled';
|
|
7808
|
-
const CELL_CLASS = 'rgCell';
|
|
7809
|
-
const ROW_HEADER_TYPE = 'rowHeaders';
|
|
7810
|
-
const HEADER_CLASS = 'rgHeaderCell';
|
|
7811
|
-
const HEADER_SORTABLE_CLASS = 'sortable';
|
|
7812
|
-
const HEADER_ROW_CLASS = 'header-rgRow';
|
|
7813
|
-
const HEADER_ACTUAL_ROW_CLASS = 'actual-rgRow';
|
|
7814
|
-
const DRAG_ICON_CLASS = 'revo-drag-icon';
|
|
7815
|
-
const DRAGGABLE_CLASS = 'revo-draggable';
|
|
7816
|
-
const FOCUS_CLASS = 'focused-cell';
|
|
7817
|
-
const SELECTION_BORDER_CLASS = 'selection-border-range';
|
|
7818
|
-
const MOBILE_CLASS = 'mobile-handler';
|
|
7819
|
-
const TMP_SELECTION_BG_CLASS = 'temp-bg-range';
|
|
7820
|
-
const CELL_HANDLER_CLASS = 'autofill-handle';
|
|
7821
|
-
const EDIT_INPUT_WR = 'edit-input-wrapper';
|
|
7822
|
-
const DRAGG_TEXT = 'Draggable item';
|
|
7823
|
-
const GRID_INTERNALS = '__rvgr';
|
|
7824
|
-
const ROW_FOCUSED_CLASS = 'focused-rgRow';
|
|
7825
|
-
|
|
7826
7842
|
class RowOrderService {
|
|
7827
7843
|
constructor(config) {
|
|
7828
7844
|
this.config = config;
|
|
@@ -7902,17 +7918,19 @@ class OrderEditor {
|
|
|
7902
7918
|
this.rowDrag = createEvent(this, "rowdragmoveinit", 7);
|
|
7903
7919
|
this.rowMouseMove = createEvent(this, "rowdragmousemove", 7);
|
|
7904
7920
|
this.rowDropped = createEvent(this, "rowdropinit", 7);
|
|
7921
|
+
this.rowOrderChange = createEvent(this, "roworderchange", 7);
|
|
7905
7922
|
this.events = [];
|
|
7906
7923
|
this.rowMoveFunc = debounce$1((y) => {
|
|
7907
7924
|
const rgRow = this.rowOrderService.move(y, this.getData());
|
|
7908
7925
|
if (rgRow !== null) {
|
|
7909
|
-
this.rowDrag.emit(rgRow);
|
|
7926
|
+
this.rowDrag.emit(Object.assign(Object.assign({}, rgRow), { rowType: this.rowType }));
|
|
7910
7927
|
}
|
|
7911
7928
|
}, 5);
|
|
7912
7929
|
this.parent = undefined;
|
|
7913
7930
|
this.dimensionRow = undefined;
|
|
7914
7931
|
this.dimensionCol = undefined;
|
|
7915
7932
|
this.dataStore = undefined;
|
|
7933
|
+
this.rowType = undefined;
|
|
7916
7934
|
}
|
|
7917
7935
|
// #endregion
|
|
7918
7936
|
// #region Methods
|
|
@@ -7930,6 +7948,7 @@ class OrderEditor {
|
|
|
7930
7948
|
text: DRAGG_TEXT,
|
|
7931
7949
|
pos,
|
|
7932
7950
|
event: e.originalEvent,
|
|
7951
|
+
rowType: this.rowType,
|
|
7933
7952
|
});
|
|
7934
7953
|
if (dragStartEvent.defaultPrevented) {
|
|
7935
7954
|
return;
|
|
@@ -7960,28 +7979,28 @@ class OrderEditor {
|
|
|
7960
7979
|
this.rowOrderService.clear();
|
|
7961
7980
|
this.events.forEach(v => document.removeEventListener(v.name, v.listener));
|
|
7962
7981
|
this.events.length = 0;
|
|
7963
|
-
this.rowDragEnd.emit();
|
|
7982
|
+
this.rowDragEnd.emit({ rowType: this.rowType });
|
|
7964
7983
|
}
|
|
7965
7984
|
// #endregion
|
|
7966
7985
|
move({ x, y }) {
|
|
7967
|
-
this.rowMouseMove.emit({ x, y });
|
|
7986
|
+
this.rowMouseMove.emit({ x, y, rowType: this.rowType });
|
|
7968
7987
|
this.rowMoveFunc(y);
|
|
7969
7988
|
}
|
|
7970
7989
|
connectedCallback() {
|
|
7971
7990
|
this.rowOrderService = new RowOrderService({
|
|
7972
|
-
positionChanged: (
|
|
7991
|
+
positionChanged: (from, to) => {
|
|
7992
|
+
const dropEvent = this.rowDropped.emit({
|
|
7993
|
+
from,
|
|
7994
|
+
to,
|
|
7995
|
+
rowType: this.rowType,
|
|
7996
|
+
});
|
|
7997
|
+
if (dropEvent.defaultPrevented) {
|
|
7998
|
+
return;
|
|
7999
|
+
}
|
|
8000
|
+
this.rowOrderChange.emit(dropEvent.detail);
|
|
8001
|
+
},
|
|
7973
8002
|
});
|
|
7974
8003
|
}
|
|
7975
|
-
onPositionChanged(from, to) {
|
|
7976
|
-
const dropEvent = this.rowDropped.emit({ from, to });
|
|
7977
|
-
if (dropEvent.defaultPrevented) {
|
|
7978
|
-
return;
|
|
7979
|
-
}
|
|
7980
|
-
const items = [...this.dataStore.get('items')];
|
|
7981
|
-
const toMove = items.splice(from, 1);
|
|
7982
|
-
items.splice(to, 0, ...toMove);
|
|
7983
|
-
setItems(this.dataStore, items);
|
|
7984
|
-
}
|
|
7985
8004
|
getData() {
|
|
7986
8005
|
return {
|
|
7987
8006
|
el: this.parent,
|
|
@@ -7997,6 +8016,7 @@ class OrderEditor {
|
|
|
7997
8016
|
"dimensionRow": [16],
|
|
7998
8017
|
"dimensionCol": [16],
|
|
7999
8018
|
"dataStore": [16],
|
|
8019
|
+
"rowType": [1, "row-type"],
|
|
8000
8020
|
"dragStart": [64],
|
|
8001
8021
|
"endOrder": [64],
|
|
8002
8022
|
"clearOrder": [64]
|
|
@@ -9573,10 +9593,10 @@ class OverlaySelection {
|
|
|
9573
9593
|
}
|
|
9574
9594
|
// Order
|
|
9575
9595
|
if (this.canDrag) {
|
|
9576
|
-
nodes.push(hAsync("revogr-order-editor", { ref: e => (this.orderEditor = e), dataStore: this.dataStore, dimensionRow: this.dimensionRow, dimensionCol: this.dimensionCol, parent: this.element, onRowdragstartinit: e => this.rowDragStart(e) }));
|
|
9596
|
+
nodes.push(hAsync("revogr-order-editor", { ref: e => (this.orderEditor = e), dataStore: this.dataStore, dimensionRow: this.dimensionRow, dimensionCol: this.dimensionCol, parent: this.element, rowType: this.types.rowType, onRowdragstartinit: e => this.rowDragStart(e) }));
|
|
9577
9597
|
}
|
|
9578
9598
|
}
|
|
9579
|
-
return (hAsync(Host, { key: '
|
|
9599
|
+
return (hAsync(Host, { key: '53847b6211a31f69b2f2df1b191544a3b6dfefd8', class: { mobile: this.isMobileDevice }, onDblClick: (e) => this.onElementDblClick(e), onMouseDown: (e) => this.onElementMouseDown(e), onTouchStart: (e) => this.onElementMouseDown(e, true) }, nodes, hAsync("slot", { key: '012c496c34954b7074a53a4d9e949ac9e3d072af', name: "data" })));
|
|
9580
9600
|
}
|
|
9581
9601
|
/**
|
|
9582
9602
|
* Executes the focus operation on the specified range of cells.
|
|
@@ -10325,11 +10345,19 @@ class DataProvider {
|
|
|
10325
10345
|
const store = this.stores[type].store;
|
|
10326
10346
|
return getSourceItem(store, virtualIndex);
|
|
10327
10347
|
}
|
|
10348
|
+
changeOrder({ rowType = 'rgRow', from, to }) {
|
|
10349
|
+
const service = this.stores[rowType];
|
|
10350
|
+
const items = [...service.store.get('items')];
|
|
10351
|
+
const prevItems = [...items];
|
|
10352
|
+
const toMove = items.splice(from, 1);
|
|
10353
|
+
items.splice(to, 0, ...toMove);
|
|
10354
|
+
this.dimensionProvider.updateSizesPositionByNewDataIndexes(rowType, items, prevItems);
|
|
10355
|
+
service.setData({ items });
|
|
10356
|
+
}
|
|
10328
10357
|
setCellData({ type, rowIndex, prop, val }, mutate = true) {
|
|
10329
10358
|
const model = this.getModel(rowIndex, type);
|
|
10330
10359
|
model[prop] = val;
|
|
10331
|
-
|
|
10332
|
-
setSourceByVirtualIndex(this.stores[type].store, { [rowIndex]: model }, mutate);
|
|
10360
|
+
this.stores[type].setSourceData({ [rowIndex]: model }, mutate);
|
|
10333
10361
|
}
|
|
10334
10362
|
setRangeData(data, type) {
|
|
10335
10363
|
const items = {};
|
|
@@ -10342,8 +10370,7 @@ class DataProvider {
|
|
|
10342
10370
|
oldModel[prop] = data[rowIndex][prop];
|
|
10343
10371
|
}
|
|
10344
10372
|
}
|
|
10345
|
-
|
|
10346
|
-
setSourceByVirtualIndex(this.stores[type].store, items);
|
|
10373
|
+
this.stores[type].setSourceData(items);
|
|
10347
10374
|
}
|
|
10348
10375
|
refresh(type = 'all') {
|
|
10349
10376
|
if (isRowType(type)) {
|
|
@@ -10518,6 +10545,28 @@ class DimensionProvider {
|
|
|
10518
10545
|
this.stores[s].setStore(data);
|
|
10519
10546
|
}
|
|
10520
10547
|
}
|
|
10548
|
+
updateSizesPositionByNewDataIndexes(type, newItemsOrder, prevItemsOrder = []) {
|
|
10549
|
+
// Move custom sizes to new order
|
|
10550
|
+
const dimService = this.stores[type];
|
|
10551
|
+
const customSizes = Object.assign({}, dimService.store.get('sizes'));
|
|
10552
|
+
if (Object.keys(customSizes).length) {
|
|
10553
|
+
const originalIndices = new Map();
|
|
10554
|
+
prevItemsOrder.forEach((value, index) => {
|
|
10555
|
+
originalIndices.set(value, index);
|
|
10556
|
+
});
|
|
10557
|
+
const newSizes = {};
|
|
10558
|
+
newItemsOrder.forEach((value, newIndex) => {
|
|
10559
|
+
const originalIndex = originalIndices.get(value);
|
|
10560
|
+
if (originalIndex !== newIndex && customSizes[originalIndex]) {
|
|
10561
|
+
newSizes[newIndex] = customSizes[originalIndex];
|
|
10562
|
+
delete customSizes[originalIndex];
|
|
10563
|
+
}
|
|
10564
|
+
});
|
|
10565
|
+
if (Object.keys(newSizes).length) {
|
|
10566
|
+
this.setCustomSizes(type, Object.assign(Object.assign({}, customSizes), newSizes));
|
|
10567
|
+
}
|
|
10568
|
+
}
|
|
10569
|
+
}
|
|
10521
10570
|
}
|
|
10522
10571
|
|
|
10523
10572
|
class ViewportProvider {
|
|
@@ -11546,9 +11595,9 @@ function size$1(collection) {
|
|
|
11546
11595
|
* Note: If you prevent an event, it will not proceed to the subsequent steps.
|
|
11547
11596
|
*/
|
|
11548
11597
|
class SortingPlugin extends BasePlugin {
|
|
11549
|
-
|
|
11598
|
+
runSorting(order, comparison) {
|
|
11550
11599
|
var _a;
|
|
11551
|
-
|
|
11600
|
+
this.sort(order, comparison);
|
|
11552
11601
|
(_a = this.sortingPromise) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
11553
11602
|
this.sortingPromise = null;
|
|
11554
11603
|
}
|
|
@@ -11556,8 +11605,8 @@ class SortingPlugin extends BasePlugin {
|
|
|
11556
11605
|
super(revogrid, providers);
|
|
11557
11606
|
this.revogrid = revogrid;
|
|
11558
11607
|
this.sortingPromise = null;
|
|
11559
|
-
this.postponeSort = debounce$1(
|
|
11560
|
-
const beforeanysource =
|
|
11608
|
+
this.postponeSort = debounce$1((order, comparison) => this.runSorting(order, comparison), 50);
|
|
11609
|
+
const beforeanysource = ({ detail: { type }, }) => {
|
|
11561
11610
|
// if sorting was provided - sort data
|
|
11562
11611
|
if (!!this.sorting && this.sortingFunc) {
|
|
11563
11612
|
const beforeEvent = this.emit('beforesorting', { type });
|
|
@@ -11567,8 +11616,8 @@ class SortingPlugin extends BasePlugin {
|
|
|
11567
11616
|
this.startSorting(this.sorting, this.sortingFunc);
|
|
11568
11617
|
}
|
|
11569
11618
|
};
|
|
11570
|
-
const aftercolumnsset =
|
|
11571
|
-
const columns =
|
|
11619
|
+
const aftercolumnsset = ({ detail: { order }, }) => {
|
|
11620
|
+
const columns = this.providers.column.getColumns();
|
|
11572
11621
|
const sortingFunc = {};
|
|
11573
11622
|
for (let prop in order) {
|
|
11574
11623
|
const cmp = this.getComparer(getColumnByProp(columns, prop), order[prop]);
|
|
@@ -11576,7 +11625,7 @@ class SortingPlugin extends BasePlugin {
|
|
|
11576
11625
|
}
|
|
11577
11626
|
this.runSorting(order, sortingFunc);
|
|
11578
11627
|
};
|
|
11579
|
-
const headerclick =
|
|
11628
|
+
const headerclick = (e) => {
|
|
11580
11629
|
var _a, _b;
|
|
11581
11630
|
if (e.defaultPrevented) {
|
|
11582
11631
|
return;
|
|
@@ -11613,7 +11662,7 @@ class SortingPlugin extends BasePlugin {
|
|
|
11613
11662
|
* Apply sorting to data on header click
|
|
11614
11663
|
* If additive - add to existing sorting, multiple columns can be sorted
|
|
11615
11664
|
*/
|
|
11616
|
-
|
|
11665
|
+
headerclick(column, index, additive) {
|
|
11617
11666
|
var _a, _b;
|
|
11618
11667
|
let order = this.getNextOrder(column.order);
|
|
11619
11668
|
const beforeEvent = this.emit('beforesorting', { column, order, additive });
|
|
@@ -11621,7 +11670,7 @@ class SortingPlugin extends BasePlugin {
|
|
|
11621
11670
|
return;
|
|
11622
11671
|
}
|
|
11623
11672
|
order = beforeEvent.detail.order;
|
|
11624
|
-
const newCol =
|
|
11673
|
+
const newCol = this.providers.column.updateColumnSorting(beforeEvent.detail.column, index, order, additive);
|
|
11625
11674
|
// apply sort data
|
|
11626
11675
|
const beforeApplyEvent = this.emit('beforesortingapply', {
|
|
11627
11676
|
column: newCol,
|
|
@@ -11669,38 +11718,37 @@ class SortingPlugin extends BasePlugin {
|
|
|
11669
11718
|
* @param sorting - per column sorting
|
|
11670
11719
|
* @param data - this.stores['rgRow'].store.get('source')
|
|
11671
11720
|
*/
|
|
11672
|
-
|
|
11721
|
+
sort(sorting, sortingFunc, types = rowTypes) {
|
|
11673
11722
|
// if no sorting - reset
|
|
11674
11723
|
if (!size$1(sorting)) {
|
|
11675
11724
|
this.sorting = undefined;
|
|
11676
11725
|
this.sortingFunc = undefined;
|
|
11677
11726
|
for (let type of types) {
|
|
11678
|
-
const
|
|
11727
|
+
const storeService = this.providers.data.stores[type];
|
|
11679
11728
|
// row data
|
|
11680
|
-
const source = store.get('source');
|
|
11729
|
+
const source = storeService.store.get('source');
|
|
11681
11730
|
// row indexes
|
|
11682
|
-
const proxyItems =
|
|
11683
|
-
|
|
11684
|
-
|
|
11685
|
-
|
|
11686
|
-
});
|
|
11731
|
+
const proxyItems = storeService.store.get('proxyItems');
|
|
11732
|
+
// row indexes
|
|
11733
|
+
const newItemsOrder = storeService.store.get('items'); // recover indexes range(0, source.length)
|
|
11734
|
+
this.providers.dimension.updateSizesPositionByNewDataIndexes(type, newItemsOrder, proxyItems);
|
|
11735
|
+
storeService.setData({ proxyItems: newItemsOrder, source: [...source] });
|
|
11687
11736
|
}
|
|
11688
11737
|
}
|
|
11689
11738
|
else {
|
|
11690
11739
|
// set sorting
|
|
11691
11740
|
this.sorting = sorting;
|
|
11692
11741
|
this.sortingFunc = sortingFunc;
|
|
11693
|
-
// by default it'll sort by rgRow store
|
|
11694
|
-
// todo: support multiple stores
|
|
11695
11742
|
for (let type of types) {
|
|
11696
|
-
const
|
|
11743
|
+
const storeService = this.providers.data.stores[type];
|
|
11697
11744
|
// row data
|
|
11698
|
-
const source = store.get('source');
|
|
11745
|
+
const source = storeService.store.get('source');
|
|
11699
11746
|
// row indexes
|
|
11700
|
-
const proxyItems = store.get('proxyItems');
|
|
11701
|
-
const
|
|
11702
|
-
|
|
11703
|
-
|
|
11747
|
+
const proxyItems = storeService.store.get('proxyItems');
|
|
11748
|
+
const newItemsOrder = this.sortIndexByItems([...proxyItems], source, sortingFunc);
|
|
11749
|
+
this.providers.dimension.updateSizesPositionByNewDataIndexes(type, newItemsOrder, proxyItems);
|
|
11750
|
+
storeService.setData({
|
|
11751
|
+
proxyItems: newItemsOrder,
|
|
11704
11752
|
source: [...source],
|
|
11705
11753
|
});
|
|
11706
11754
|
}
|
|
@@ -13999,6 +14047,10 @@ class RevoGridComponent {
|
|
|
13999
14047
|
var _a;
|
|
14000
14048
|
(_a = this.orderService) === null || _a === void 0 ? void 0 : _a.end();
|
|
14001
14049
|
}
|
|
14050
|
+
onRowOrderChange(e) {
|
|
14051
|
+
var _a;
|
|
14052
|
+
(_a = this.dataProvider) === null || _a === void 0 ? void 0 : _a.changeOrder(e.detail);
|
|
14053
|
+
}
|
|
14002
14054
|
onRowDrag({ detail }) {
|
|
14003
14055
|
var _a;
|
|
14004
14056
|
(_a = this.orderService) === null || _a === void 0 ? void 0 : _a.move(detail);
|
|
@@ -14558,7 +14610,7 @@ class RevoGridComponent {
|
|
|
14558
14610
|
"getContentSize": [64],
|
|
14559
14611
|
"getSelectedRange": [64]
|
|
14560
14612
|
},
|
|
14561
|
-
"$listeners$": [[5, "touchstart", "mousedownHandle"], [5, "mousedown", "mousedownHandle"], [5, "touchend", "mouseupHandle"], [5, "mouseup", "mouseupHandle"], [0, "rowdragstartinit", "onRowDragStarted"], [0, "rowdragendinit", "onRowDragEnd"], [0, "rowdragmoveinit", "onRowDrag"], [0, "rowdragmousemove", "onRowMouseMove"], [0, "celleditapply", "onCellEdit"], [0, "rangeeditapply", "onRangeEdit"], [0, "selectionchangeinit", "onRangeChanged"], [0, "rowdropinit", "onRowDropped"], [0, "beforeheaderclick", "onHeaderClick"], [0, "beforecellfocusinit", "onCellFocus"]],
|
|
14613
|
+
"$listeners$": [[5, "touchstart", "mousedownHandle"], [5, "mousedown", "mousedownHandle"], [5, "touchend", "mouseupHandle"], [5, "mouseup", "mouseupHandle"], [0, "rowdragstartinit", "onRowDragStarted"], [0, "rowdragendinit", "onRowDragEnd"], [0, "roworderchange", "onRowOrderChange"], [0, "rowdragmoveinit", "onRowDrag"], [0, "rowdragmousemove", "onRowMouseMove"], [0, "celleditapply", "onCellEdit"], [0, "rangeeditapply", "onRangeEdit"], [0, "selectionchangeinit", "onRangeChanged"], [0, "rowdropinit", "onRowDropped"], [0, "beforeheaderclick", "onHeaderClick"], [0, "beforecellfocusinit", "onCellFocus"]],
|
|
14562
14614
|
"$lazyBundleId$": "-",
|
|
14563
14615
|
"$attrsToReflect$": [["theme", "theme"], ["rowClass", "row-class"]]
|
|
14564
14616
|
}; }
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Built by Revolist OU ❤️
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
4
|
+
import { x as keys, o as isArrayLike, w as baseIteratee, k as isArray, j as createStore, i as setStore, m as isIterateeCall, l as toInteger, a as getVisibleSourceItem, b as getSourceItem } from './data.store.js';
|
|
5
5
|
import '@stencil/core/internal/client';
|
|
6
6
|
import { G as GRID_INTERNALS, C as CELL_CLASS, b as DISABLED_CLASS } from './consts.js';
|
|
7
7
|
import './platform.js';
|
package/standalone/data.store.js
CHANGED
|
@@ -2,14 +2,28 @@
|
|
|
2
2
|
* Built by Revolist OU ❤️
|
|
3
3
|
*/
|
|
4
4
|
import { a as isObject, b as baseGetTag, r as root, S as Symbol, i as isObjectLike, f as freeGlobal, c as isSymbol, t as toNumber } from './toNumber.js';
|
|
5
|
+
import { i as identity } from './identity.js';
|
|
5
6
|
import { getRenderingRef, forceUpdate } from '@stencil/core/internal/client';
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
9
|
+
* Proxy plugin for data source.
|
|
10
|
+
* This plugin is used to sort the data source.
|
|
11
|
+
* It keeps the order of the items but does not modify the final source.
|
|
12
|
+
* It is also used to filter the items in the data source.
|
|
13
|
+
* The `set` method takes a key and a new value as arguments.
|
|
14
|
+
* If the key is 'proxyItems' it will filter the items in the data source according to the new value.
|
|
15
|
+
* The new value should be an array of numbers representing the indexes of the items that should be visible.
|
|
16
|
+
* The method will return a new array of numbers with the indexes of the items that should be visible.
|
|
17
|
+
* The method will also update the 'items' property of the store with the new array.
|
|
11
18
|
*/
|
|
12
19
|
const proxyPlugin = (store) => ({
|
|
20
|
+
/**
|
|
21
|
+
* Set the value of a property in the store.
|
|
22
|
+
* If the key is 'proxyItems' it will filter the items in the data source according to the new value.
|
|
23
|
+
* The new value should be an array of numbers representing the indexes of the items that should be visible.
|
|
24
|
+
* The method will return a new array of numbers with the indexes of the items that should be visible.
|
|
25
|
+
* The method will also update the 'items' property of the store with the new array.
|
|
26
|
+
*/
|
|
13
27
|
set(k, newVal) {
|
|
14
28
|
if (!isProxy(k)) {
|
|
15
29
|
return;
|
|
@@ -19,15 +33,15 @@ const proxyPlugin = (store) => ({
|
|
|
19
33
|
* Mark indexes as visible
|
|
20
34
|
*/
|
|
21
35
|
const oldItems = store.get('items').reduce((r, v) => {
|
|
22
|
-
r
|
|
36
|
+
r.add(v);
|
|
23
37
|
return r;
|
|
24
|
-
},
|
|
38
|
+
}, new Set());
|
|
25
39
|
/**
|
|
26
40
|
* Check if new values where present in items
|
|
27
41
|
* Filter item collection according presense
|
|
28
42
|
*/
|
|
29
43
|
const newItems = newVal.reduce((r, i) => {
|
|
30
|
-
if (oldItems
|
|
44
|
+
if (oldItems.has(i)) {
|
|
31
45
|
r.push(i);
|
|
32
46
|
}
|
|
33
47
|
return r;
|
|
@@ -1763,9 +1777,9 @@ var Promise$1 = getNative(root, 'Promise');
|
|
|
1763
1777
|
const Promise$2 = Promise$1;
|
|
1764
1778
|
|
|
1765
1779
|
/* Built-in method references that are verified to be native. */
|
|
1766
|
-
var Set = getNative(root, 'Set');
|
|
1780
|
+
var Set$1 = getNative(root, 'Set');
|
|
1767
1781
|
|
|
1768
|
-
const Set$
|
|
1782
|
+
const Set$2 = Set$1;
|
|
1769
1783
|
|
|
1770
1784
|
/* Built-in method references that are verified to be native. */
|
|
1771
1785
|
var WeakMap = getNative(root, 'WeakMap');
|
|
@@ -1785,7 +1799,7 @@ var dataViewTag = '[object DataView]';
|
|
|
1785
1799
|
var dataViewCtorString = toSource(DataView$1),
|
|
1786
1800
|
mapCtorString = toSource(Map$2),
|
|
1787
1801
|
promiseCtorString = toSource(Promise$2),
|
|
1788
|
-
setCtorString = toSource(Set$
|
|
1802
|
+
setCtorString = toSource(Set$2),
|
|
1789
1803
|
weakMapCtorString = toSource(WeakMap$1);
|
|
1790
1804
|
|
|
1791
1805
|
/**
|
|
@@ -1801,7 +1815,7 @@ var getTag = baseGetTag;
|
|
|
1801
1815
|
if ((DataView$1 && getTag(new DataView$1(new ArrayBuffer(1))) != dataViewTag) ||
|
|
1802
1816
|
(Map$2 && getTag(new Map$2) != mapTag) ||
|
|
1803
1817
|
(Promise$2 && getTag(Promise$2.resolve()) != promiseTag) ||
|
|
1804
|
-
(Set$
|
|
1818
|
+
(Set$2 && getTag(new Set$2) != setTag) ||
|
|
1805
1819
|
(WeakMap$1 && getTag(new WeakMap$1) != weakMapTag)) {
|
|
1806
1820
|
getTag = function(value) {
|
|
1807
1821
|
var result = baseGetTag(value),
|
|
@@ -2446,26 +2460,6 @@ function baseMatchesProperty(path, srcValue) {
|
|
|
2446
2460
|
};
|
|
2447
2461
|
}
|
|
2448
2462
|
|
|
2449
|
-
/**
|
|
2450
|
-
* This method returns the first argument it receives.
|
|
2451
|
-
*
|
|
2452
|
-
* @static
|
|
2453
|
-
* @since 0.1.0
|
|
2454
|
-
* @memberOf _
|
|
2455
|
-
* @category Util
|
|
2456
|
-
* @param {*} value Any value.
|
|
2457
|
-
* @returns {*} Returns `value`.
|
|
2458
|
-
* @example
|
|
2459
|
-
*
|
|
2460
|
-
* var object = { 'a': 1 };
|
|
2461
|
-
*
|
|
2462
|
-
* console.log(_.identity(object) === object);
|
|
2463
|
-
* // => true
|
|
2464
|
-
*/
|
|
2465
|
-
function identity(value) {
|
|
2466
|
-
return value;
|
|
2467
|
-
}
|
|
2468
|
-
|
|
2469
2463
|
/**
|
|
2470
2464
|
* The base implementation of `_.property` without support for deep paths.
|
|
2471
2465
|
*
|
|
@@ -3068,6 +3062,9 @@ class DataStore {
|
|
|
3068
3062
|
trimmed = Object.assign(Object.assign({}, trimmed), some);
|
|
3069
3063
|
setStore(this.store, { trimmed });
|
|
3070
3064
|
}
|
|
3065
|
+
setSourceData(items, mutate = true) {
|
|
3066
|
+
setSourceByVirtualIndex(this.store, items, mutate);
|
|
3067
|
+
}
|
|
3071
3068
|
// local data update
|
|
3072
3069
|
setData(input) {
|
|
3073
3070
|
const data = Object.assign({}, input);
|
|
@@ -3153,6 +3150,6 @@ function getSourceItemVirtualIndexByProp(store, prop) {
|
|
|
3153
3150
|
return items.indexOf(physicalIndex);
|
|
3154
3151
|
}
|
|
3155
3152
|
|
|
3156
|
-
export { DataStore as D, getVisibleSourceItem as a, getSourceItem as b, getSourcePhysicalIndex as c, setSourceByPhysicalIndex as d, setItems as e, getSourceItemVirtualIndexByProp as f, getPhysical as g, gatherTrimmedItems as h, setStore as i, createStore as j,
|
|
3153
|
+
export { DataStore as D, getVisibleSourceItem as a, getSourceItem as b, getSourcePhysicalIndex as c, setSourceByPhysicalIndex as d, setItems as e, getSourceItemVirtualIndexByProp as f, getPhysical as g, gatherTrimmedItems as h, setStore as i, createStore as j, isArray$1 as k, toInteger as l, isIterateeCall as m, baseProperty as n, isArrayLike as o, proxyPlugin as p, getTag$1 as q, baseKeys as r, setSourceByVirtualIndex as s, trimmedPlugin as t, findIndex as u, getNative as v, baseIteratee as w, keys as x };
|
|
3157
3154
|
|
|
3158
3155
|
//# sourceMappingURL=data.store.js.map
|