@revolist/revogrid 4.4.0-next.2 → 4.4.0-next.20
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/custom-element/columnService.js +1 -1
- package/custom-element/consts.js +2 -1
- package/custom-element/consts.js.map +1 -1
- package/custom-element/localScrollService.js +1 -1
- package/custom-element/localScrollService.js.map +1 -1
- package/custom-element/revo-grid.js +167 -97
- package/custom-element/revo-grid.js.map +1 -1
- package/custom-element/revogr-clipboard.js +24 -5
- package/custom-element/revogr-clipboard.js.map +1 -1
- package/custom-element/revogr-edit2.js +12 -6
- package/custom-element/revogr-edit2.js.map +1 -1
- package/custom-element/revogr-focus2.js +1 -1
- package/custom-element/revogr-focus2.js.map +1 -1
- package/custom-element/revogr-header2.js +25 -11
- package/custom-element/revogr-header2.js.map +1 -1
- package/custom-element/revogr-overlay-selection2.js +99 -32
- package/custom-element/revogr-overlay-selection2.js.map +1 -1
- package/custom-element/revogr-row-headers2.js +1 -2
- package/custom-element/revogr-row-headers2.js.map +1 -1
- package/custom-element/revogr-viewport-scroll2.js +39 -6
- package/custom-element/revogr-viewport-scroll2.js.map +1 -1
- package/dist/cjs/{debounce-525dd66c.js → debounce-f50730b6.js} +1 -38
- package/dist/cjs/debounce-f50730b6.js.map +1 -0
- package/dist/cjs/dispatcher-20520c70.js +21 -0
- package/dist/cjs/dispatcher-20520c70.js.map +1 -0
- package/dist/cjs/events-030618fc.js +459 -0
- package/dist/cjs/events-030618fc.js.map +1 -0
- package/dist/cjs/filter.button-6badec7a.js +44 -0
- package/dist/cjs/filter.button-6badec7a.js.map +1 -0
- package/dist/cjs/{index-aad39b7b.js → index-ee2ef5ae.js} +96 -36
- package/dist/cjs/index-ee2ef5ae.js.map +1 -0
- package/dist/cjs/index-effc94b9.js +3944 -0
- package/dist/cjs/index-effc94b9.js.map +1 -0
- package/dist/cjs/isString-3dde8d95.js +38 -0
- package/dist/cjs/isString-3dde8d95.js.map +1 -0
- package/dist/cjs/keyCodes.utils-d665ebed.js +271 -0
- package/dist/cjs/keyCodes.utils-d665ebed.js.map +1 -0
- package/dist/cjs/loader.cjs.js +3 -3
- package/dist/cjs/loader.cjs.js.map +1 -1
- package/dist/cjs/localScrollService-a81823c5.js +403 -0
- package/dist/cjs/localScrollService-a81823c5.js.map +1 -0
- package/dist/cjs/revo-grid.cjs.entry.js +3862 -0
- package/dist/cjs/revo-grid.cjs.entry.js.map +1 -0
- package/dist/cjs/revo-grid.cjs.js +3 -3
- package/dist/cjs/revo-grid.cjs.js.map +1 -1
- package/dist/cjs/revogr-clipboard.cjs.entry.js +24 -6
- package/dist/cjs/revogr-clipboard.cjs.entry.js.map +1 -1
- package/dist/cjs/revogr-data_3.cjs.entry.js +1138 -0
- package/dist/cjs/revogr-data_3.cjs.entry.js.map +1 -0
- package/dist/cjs/revogr-edit_2.cjs.entry.js +325 -0
- package/dist/cjs/revogr-edit_2.cjs.entry.js.map +1 -0
- package/dist/cjs/revogr-filter-panel.cjs.entry.js +6 -5
- package/dist/cjs/revogr-filter-panel.cjs.entry.js.map +1 -1
- package/dist/cjs/revogr-focus_5.cjs.entry.js +1231 -0
- package/dist/cjs/revogr-focus_5.cjs.entry.js.map +1 -0
- package/dist/cjs/{revo-grid_11.cjs.entry.js → viewport.helpers-70ccec8f.js} +13978 -25269
- package/dist/cjs/viewport.helpers-70ccec8f.js.map +1 -0
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/clipboard/revogr-clipboard.d.ts +6 -2
- package/dist/collection/components/clipboard/revogr-clipboard.js +46 -5
- package/dist/collection/components/clipboard/revogr-clipboard.js.map +1 -1
- package/dist/collection/components/header/headerCellRenderer.d.ts +2 -1
- package/dist/collection/components/header/headerCellRenderer.js +1 -1
- package/dist/collection/components/header/headerCellRenderer.js.map +1 -1
- package/dist/collection/components/header/headerRenderer.d.ts +2 -2
- package/dist/collection/components/header/headerRenderer.js +1 -1
- package/dist/collection/components/header/headerRenderer.js.map +1 -1
- package/dist/collection/components/header/revogr-header.d.ts +15 -1
- package/dist/collection/components/header/revogr-header.js +34 -8
- package/dist/collection/components/header/revogr-header.js.map +1 -1
- package/dist/collection/components/overlay/autofill.service.d.ts +7 -3
- package/dist/collection/components/overlay/autofill.service.js +32 -12
- package/dist/collection/components/overlay/autofill.service.js.map +1 -1
- package/dist/collection/components/overlay/clipboard.service.d.ts +1 -1
- package/dist/collection/components/overlay/clipboard.service.js +2 -2
- package/dist/collection/components/overlay/clipboard.service.js.map +1 -1
- package/dist/collection/components/overlay/keyboard.service.js +2 -6
- package/dist/collection/components/overlay/keyboard.service.js.map +1 -1
- package/dist/collection/components/overlay/revogr-edit.d.ts +8 -0
- package/dist/collection/components/overlay/revogr-edit.js +34 -9
- package/dist/collection/components/overlay/revogr-edit.js.map +1 -1
- package/dist/collection/components/overlay/revogr-overlay-selection.d.ts +32 -10
- package/dist/collection/components/overlay/revogr-overlay-selection.js +80 -12
- package/dist/collection/components/overlay/revogr-overlay-selection.js.map +1 -1
- package/dist/collection/components/overlay/revogr-overlay-style.css +71 -4
- package/dist/collection/components/revoGrid/revo-grid.d.ts +15 -4
- package/dist/collection/components/revoGrid/revo-grid.js +60 -19
- package/dist/collection/components/revoGrid/revo-grid.js.map +1 -1
- package/dist/collection/components/revoGrid/viewport.scrolling.service.d.ts +6 -2
- package/dist/collection/components/revoGrid/viewport.scrolling.service.js +30 -4
- package/dist/collection/components/revoGrid/viewport.scrolling.service.js.map +1 -1
- package/dist/collection/components/revoGrid/viewport.section.d.ts +3 -2
- package/dist/collection/components/revoGrid/viewport.section.js +8 -4
- package/dist/collection/components/revoGrid/viewport.section.js.map +1 -1
- package/dist/collection/components/revoGrid/viewport.service.d.ts +4 -0
- package/dist/collection/components/revoGrid/viewport.service.js +15 -3
- package/dist/collection/components/revoGrid/viewport.service.js.map +1 -1
- package/dist/collection/components/rowHeaders/revogr-row-headers.js.map +1 -1
- package/dist/collection/components/scroll/revogr-viewport-scroll-style.css +3 -0
- package/dist/collection/components/scroll/revogr-viewport-scroll.d.ts +16 -5
- package/dist/collection/components/scroll/revogr-viewport-scroll.js +64 -9
- package/dist/collection/components/scroll/revogr-viewport-scroll.js.map +1 -1
- package/dist/collection/components/selectionFocus/revogr-focus-style.css +1 -1
- package/dist/collection/components.d.ts +110 -6
- package/dist/collection/interfaces.d.ts +4 -1
- package/dist/collection/plugins/groupingColumn/columnGroupsRenderer.d.ts +3 -2
- package/dist/collection/plugins/groupingColumn/columnGroupsRenderer.js +2 -2
- package/dist/collection/plugins/groupingColumn/columnGroupsRenderer.js.map +1 -1
- package/dist/collection/plugins/groupingColumn/headerGroupRenderer.d.ts +2 -2
- package/dist/collection/plugins/groupingColumn/headerGroupRenderer.js +1 -1
- package/dist/collection/plugins/groupingColumn/headerGroupRenderer.js.map +1 -1
- package/dist/collection/plugins/sorting/sorting.plugin.d.ts +21 -13
- package/dist/collection/plugins/sorting/sorting.plugin.js +77 -70
- package/dist/collection/plugins/sorting/sorting.plugin.js.map +1 -1
- package/dist/collection/serve/controller.js +183 -0
- package/dist/collection/services/localScrollService.js +1 -1
- package/dist/collection/services/localScrollService.js.map +1 -1
- package/dist/collection/services/resizable.directive.d.ts +8 -7
- package/dist/collection/services/resizable.directive.js +13 -36
- package/dist/collection/services/resizable.directive.js.map +1 -1
- package/dist/collection/services/resizable.element.d.ts +4 -0
- package/dist/collection/services/resizable.element.js +39 -0
- package/dist/collection/services/resizable.element.js.map +1 -0
- package/dist/collection/stencil-public-runtime.d.ts +1 -0
- package/dist/collection/store/viewPort/viewport.store.js +0 -1
- package/dist/collection/store/viewPort/viewport.store.js.map +1 -1
- package/dist/collection/utils/consts.d.ts +1 -0
- package/dist/collection/utils/consts.js +1 -0
- package/dist/collection/utils/consts.js.map +1 -1
- package/dist/collection/utils/events.d.ts +2 -1
- package/dist/collection/utils/events.js +18 -2
- package/dist/collection/utils/events.js.map +1 -1
- package/dist/collection/utils/mobile.d.ts +1 -0
- package/dist/collection/utils/mobile.js +7 -0
- package/dist/collection/utils/mobile.js.map +1 -0
- package/dist/esm/{debounce-301fd4d2.js → debounce-820b5a8b.js} +2 -34
- package/dist/esm/debounce-820b5a8b.js.map +1 -0
- package/dist/esm/dispatcher-9e9c0233.js +19 -0
- package/dist/esm/dispatcher-9e9c0233.js.map +1 -0
- package/dist/esm/events-31272e5e.js +454 -0
- package/dist/esm/events-31272e5e.js.map +1 -0
- package/dist/esm/filter.button-21ce90ef.js +38 -0
- package/dist/esm/filter.button-21ce90ef.js.map +1 -0
- package/dist/esm/{index-5e90b19b.js → index-05947c5f.js} +97 -37
- package/dist/esm/index-05947c5f.js.map +1 -0
- package/dist/esm/index-728bf6e3.js +3889 -0
- package/dist/esm/index-728bf6e3.js.map +1 -0
- package/dist/esm/isString-d539060a.js +36 -0
- package/dist/esm/isString-d539060a.js.map +1 -0
- package/dist/esm/keyCodes.utils-c0064460.js +265 -0
- package/dist/esm/keyCodes.utils-c0064460.js.map +1 -0
- package/dist/esm/loader.js +4 -4
- package/dist/esm/loader.js.map +1 -1
- package/dist/esm/localScrollService-884d8952.js +400 -0
- package/dist/esm/localScrollService-884d8952.js.map +1 -0
- package/dist/esm/revo-grid.entry.js +3858 -0
- package/dist/esm/revo-grid.entry.js.map +1 -0
- package/dist/esm/revo-grid.js +4 -4
- package/dist/esm/revo-grid.js.map +1 -1
- package/dist/esm/revogr-clipboard.entry.js +24 -6
- package/dist/esm/revogr-clipboard.entry.js.map +1 -1
- package/dist/esm/revogr-data_3.entry.js +1132 -0
- package/dist/esm/revogr-data_3.entry.js.map +1 -0
- package/dist/esm/revogr-edit_2.entry.js +320 -0
- package/dist/esm/revogr-edit_2.entry.js.map +1 -0
- package/dist/esm/revogr-filter-panel.entry.js +3 -2
- package/dist/esm/revogr-filter-panel.entry.js.map +1 -1
- package/dist/esm/revogr-focus_5.entry.js +1223 -0
- package/dist/esm/revogr-focus_5.entry.js.map +1 -0
- package/dist/esm/{revo-grid_11.entry.js → viewport.helpers-c08e729e.js} +13790 -25093
- package/dist/esm/viewport.helpers-c08e729e.js.map +1 -0
- package/dist/revo-grid/debounce-820b5a8b.js +5 -0
- package/dist/revo-grid/debounce-820b5a8b.js.map +1 -0
- package/dist/revo-grid/dispatcher-9e9c0233.js +5 -0
- package/dist/revo-grid/dispatcher-9e9c0233.js.map +1 -0
- package/dist/revo-grid/events-31272e5e.js +5 -0
- package/dist/revo-grid/events-31272e5e.js.map +1 -0
- package/dist/revo-grid/filter.button-21ce90ef.js +5 -0
- package/dist/revo-grid/filter.button-21ce90ef.js.map +1 -0
- package/dist/revo-grid/index-05947c5f.js +6 -0
- package/dist/revo-grid/index-05947c5f.js.map +1 -0
- package/dist/revo-grid/index-728bf6e3.js +5 -0
- package/dist/revo-grid/index-728bf6e3.js.map +1 -0
- package/dist/revo-grid/isString-d539060a.js +5 -0
- package/dist/revo-grid/isString-d539060a.js.map +1 -0
- package/dist/revo-grid/keyCodes.utils-c0064460.js +5 -0
- package/dist/revo-grid/keyCodes.utils-c0064460.js.map +1 -0
- package/dist/revo-grid/localScrollService-884d8952.js +5 -0
- package/dist/revo-grid/localScrollService-884d8952.js.map +1 -0
- package/dist/revo-grid/revo-grid.entry.js +5 -0
- package/dist/revo-grid/revo-grid.entry.js.map +1 -0
- 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-clipboard.entry.js +1 -1
- package/dist/revo-grid/revogr-clipboard.entry.js.map +1 -1
- package/dist/revo-grid/revogr-data_3.entry.js +5 -0
- package/dist/revo-grid/revogr-data_3.entry.js.map +1 -0
- package/dist/revo-grid/revogr-edit_2.entry.js +5 -0
- package/dist/revo-grid/revogr-edit_2.entry.js.map +1 -0
- package/dist/revo-grid/revogr-filter-panel.entry.js +1 -1
- package/dist/revo-grid/revogr-filter-panel.entry.js.map +1 -1
- package/dist/revo-grid/revogr-focus_5.entry.js +5 -0
- package/dist/revo-grid/revogr-focus_5.entry.js.map +1 -0
- package/dist/revo-grid/viewport.helpers-c08e729e.js +5 -0
- package/dist/revo-grid/viewport.helpers-c08e729e.js.map +1 -0
- package/dist/types/components/clipboard/revogr-clipboard.d.ts +6 -2
- package/dist/types/components/header/headerCellRenderer.d.ts +2 -1
- package/dist/types/components/header/headerRenderer.d.ts +2 -2
- package/dist/types/components/header/revogr-header.d.ts +15 -1
- package/dist/types/components/overlay/autofill.service.d.ts +7 -3
- package/dist/types/components/overlay/clipboard.service.d.ts +1 -1
- package/dist/types/components/overlay/revogr-edit.d.ts +8 -0
- package/dist/types/components/overlay/revogr-overlay-selection.d.ts +32 -10
- package/dist/types/components/revoGrid/revo-grid.d.ts +15 -4
- package/dist/types/components/revoGrid/viewport.scrolling.service.d.ts +6 -2
- package/dist/types/components/revoGrid/viewport.section.d.ts +3 -2
- package/dist/types/components/revoGrid/viewport.service.d.ts +4 -0
- package/dist/types/components/scroll/revogr-viewport-scroll.d.ts +16 -5
- package/dist/types/components.d.ts +110 -6
- package/dist/types/interfaces.d.ts +4 -1
- package/dist/types/plugins/groupingColumn/columnGroupsRenderer.d.ts +3 -2
- package/dist/types/plugins/groupingColumn/headerGroupRenderer.d.ts +2 -2
- package/dist/types/plugins/sorting/sorting.plugin.d.ts +21 -13
- package/dist/types/services/resizable.directive.d.ts +8 -7
- package/dist/types/services/resizable.element.d.ts +4 -0
- package/dist/types/stencil-public-runtime.d.ts +1 -0
- package/dist/types/utils/consts.d.ts +1 -0
- package/dist/types/utils/events.d.ts +2 -1
- package/dist/types/utils/mobile.d.ts +1 -0
- package/package.json +4 -3
- package/dist/cjs/debounce-525dd66c.js.map +0 -1
- package/dist/cjs/index-aad39b7b.js.map +0 -1
- package/dist/cjs/revo-grid_11.cjs.entry.js.map +0 -1
- package/dist/esm/debounce-301fd4d2.js.map +0 -1
- package/dist/esm/index-5e90b19b.js.map +0 -1
- package/dist/esm/revo-grid_11.entry.js.map +0 -1
- package/dist/revo-grid/debounce-301fd4d2.js +0 -5
- package/dist/revo-grid/debounce-301fd4d2.js.map +0 -1
- package/dist/revo-grid/index-5e90b19b.js +0 -6
- package/dist/revo-grid/index-5e90b19b.js.map +0 -1
- package/dist/revo-grid/revo-grid_11.entry.js +0 -5
- package/dist/revo-grid/revo-grid_11.entry.js.map +0 -1
- /package/dist/collection/{utilsExternal/generate-data.js → serve/data.js} +0 -0
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { h } from '@stencil/core/internal/client';
|
|
5
5
|
import { c as createStore, d as setStore, b as getVisibleSourceItem, g as getSourceItem, s as setSourceByVirtualIndex } from './data.store.js';
|
|
6
|
-
import { G as GRID_INTERNALS,
|
|
6
|
+
import { G as GRID_INTERNALS, j as CELL_CLASS, k as DISABLED_CLASS } from './consts.js';
|
|
7
7
|
import { l as lodash } from './lodash.js';
|
|
8
8
|
|
|
9
9
|
const GROUP_DEPTH = `${GRID_INTERNALS}-depth`;
|
package/custom-element/consts.js
CHANGED
|
@@ -39,12 +39,13 @@ const DRAG_ICON_CLASS = 'revo-drag-icon';
|
|
|
39
39
|
const DRAGGABLE_CLASS = 'revo-draggable';
|
|
40
40
|
const FOCUS_CLASS = 'focused-cell';
|
|
41
41
|
const SELECTION_BORDER_CLASS = 'selection-border-range';
|
|
42
|
+
const MOBILE_CLASS = 'mobile-handler';
|
|
42
43
|
const TMP_SELECTION_BG_CLASS = 'temp-bg-range';
|
|
43
44
|
const CELL_HANDLER_CLASS = 'autofill-handle';
|
|
44
45
|
const EDIT_INPUT_WR = 'edit-input-wrapper';
|
|
45
46
|
const DRAGG_TEXT = 'Draggable item';
|
|
46
47
|
const GRID_INTERNALS = '__rvgr';
|
|
47
48
|
|
|
48
|
-
export { CELL_HANDLER_CLASS as C, DRAGGABLE_CLASS as D, EDIT_INPUT_WR as E, FOCUS_CLASS as F, GRID_INTERNALS as G, HEADER_CLASS as H, MIN_COL_SIZE as M, RESIZE_INTERVAL as R, SELECTION_BORDER_CLASS as S, TMP_SELECTION_BG_CLASS as T, UUID as U, _arrayMap as _, DRAG_ICON_CLASS as a, DATA_COL as b, DATA_ROW as c, HEADER_SORTABLE_CLASS as d, HEADER_ROW_CLASS as e, HEADER_ACTUAL_ROW_CLASS as f, DRAGG_TEXT as g,
|
|
49
|
+
export { CELL_HANDLER_CLASS as C, DRAGGABLE_CLASS as D, EDIT_INPUT_WR as E, FOCUS_CLASS as F, GRID_INTERNALS as G, HEADER_CLASS as H, MIN_COL_SIZE as M, RESIZE_INTERVAL as R, SELECTION_BORDER_CLASS as S, TMP_SELECTION_BG_CLASS as T, UUID as U, _arrayMap as _, DRAG_ICON_CLASS as a, DATA_COL as b, DATA_ROW as c, HEADER_SORTABLE_CLASS as d, HEADER_ROW_CLASS as e, HEADER_ACTUAL_ROW_CLASS as f, DRAGG_TEXT as g, MOBILE_CLASS as h, ROW_HEADER_TYPE as i, CELL_CLASS as j, DISABLED_CLASS as k };
|
|
49
50
|
|
|
50
51
|
//# sourceMappingURL=consts.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"consts.js","mappings":";;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,QAAQ,CAAC,KAAK,EAAE,QAAQ,EAAE;AACnC,EAAE,IAAI,KAAK,GAAG,CAAC,CAAC;AAChB,MAAM,MAAM,GAAG,KAAK,IAAI,IAAI,GAAG,CAAC,GAAG,KAAK,CAAC,MAAM;AAC/C,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC;AAC7B;AACA,EAAE,OAAO,EAAE,KAAK,GAAG,MAAM,EAAE;AAC3B,IAAI,MAAM,CAAC,KAAK,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;AACzD,GAAG;AACH,EAAE,OAAO,MAAM,CAAC;AAChB,CAAC;AACD;aACc,GAAG;;MCpBJ,YAAY,GAAG,GAAG;MAClB,eAAe,GAAG,GAAG;MAErB,QAAQ,GAAG,aAAa;MACxB,QAAQ,GAAG,aAAa;MAExB,IAAI,GAAG,YAAY;MAEnB,cAAc,GAAG,WAAW;MAC5B,UAAU,GAAG,SAAS;MACtB,eAAe,GAAG,aAAa;MAC/B,YAAY,GAAG,eAAe;MAC9B,qBAAqB,GAAG,WAAW;MACnC,gBAAgB,GAAG,eAAe;MAClC,uBAAuB,GAAG,eAAe;MAEzC,eAAe,GAAG,iBAAiB;MACnC,eAAe,GAAG,iBAAiB;MAEnC,WAAW,GAAG,eAAe;MAC7B,sBAAsB,GAAG,yBAAyB;MAClD,sBAAsB,GAAG,gBAAgB;MAEzC,kBAAkB,GAAG,kBAAkB;MAEvC,aAAa,GAAG,qBAAqB;MAErC,UAAU,GAAG,iBAAiB;MAC9B,cAAc,GAAG;;;;","names":[],"sources":["./node_modules/lodash/_arrayMap.js","./src/utils/consts.ts"],"sourcesContent":["/**\n * A specialized version of `_.map` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\nfunction arrayMap(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length,\n result = Array(length);\n\n while (++index < length) {\n result[index] = iteratee(array[index], index, array);\n }\n return result;\n}\n\nmodule.exports = arrayMap;\n","export const MIN_COL_SIZE = 30;\nexport const RESIZE_INTERVAL = 40;\n\nexport const DATA_COL = 'data-rgCol';\nexport const DATA_ROW = 'data-rgRow';\n\nexport const UUID = 'grid-uuid';\n\nexport const DISABLED_CLASS = 'disabled';\nexport const CELL_CLASS = 'rgCell';\nexport const ROW_HEADER_TYPE = 'rowHeaders';\nexport const HEADER_CLASS = 'rgHeaderCell';\nexport const HEADER_SORTABLE_CLASS = 'sortable';\nexport const HEADER_ROW_CLASS = 'header-rgRow';\nexport const HEADER_ACTUAL_ROW_CLASS = 'actual-rgRow';\n\nexport const DRAG_ICON_CLASS = 'revo-drag-icon';\nexport const DRAGGABLE_CLASS = 'revo-draggable';\n\nexport const FOCUS_CLASS = 'focused-cell';\nexport const SELECTION_BORDER_CLASS = 'selection-border-range';\nexport const TMP_SELECTION_BG_CLASS = 'temp-bg-range';\n\nexport const CELL_HANDLER_CLASS = 'autofill-handle';\n\nexport const EDIT_INPUT_WR = 'edit-input-wrapper';\n\nexport const DRAGG_TEXT = 'Draggable item';\nexport const GRID_INTERNALS = '__rvgr';\n"],"version":3}
|
|
1
|
+
{"file":"consts.js","mappings":";;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,QAAQ,CAAC,KAAK,EAAE,QAAQ,EAAE;AACnC,EAAE,IAAI,KAAK,GAAG,CAAC,CAAC;AAChB,MAAM,MAAM,GAAG,KAAK,IAAI,IAAI,GAAG,CAAC,GAAG,KAAK,CAAC,MAAM;AAC/C,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC;AAC7B;AACA,EAAE,OAAO,EAAE,KAAK,GAAG,MAAM,EAAE;AAC3B,IAAI,MAAM,CAAC,KAAK,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;AACzD,GAAG;AACH,EAAE,OAAO,MAAM,CAAC;AAChB,CAAC;AACD;aACc,GAAG;;MCpBJ,YAAY,GAAG,GAAG;MAClB,eAAe,GAAG,GAAG;MAErB,QAAQ,GAAG,aAAa;MACxB,QAAQ,GAAG,aAAa;MAExB,IAAI,GAAG,YAAY;MAEnB,cAAc,GAAG,WAAW;MAC5B,UAAU,GAAG,SAAS;MACtB,eAAe,GAAG,aAAa;MAC/B,YAAY,GAAG,eAAe;MAC9B,qBAAqB,GAAG,WAAW;MACnC,gBAAgB,GAAG,eAAe;MAClC,uBAAuB,GAAG,eAAe;MAEzC,eAAe,GAAG,iBAAiB;MACnC,eAAe,GAAG,iBAAiB;MAEnC,WAAW,GAAG,eAAe;MAC7B,sBAAsB,GAAG,yBAAyB;MAClD,YAAY,GAAG,iBAAiB;MAChC,sBAAsB,GAAG,gBAAgB;MAEzC,kBAAkB,GAAG,kBAAkB;MAEvC,aAAa,GAAG,qBAAqB;MAErC,UAAU,GAAG,iBAAiB;MAC9B,cAAc,GAAG;;;;","names":[],"sources":["./node_modules/lodash/_arrayMap.js","./src/utils/consts.ts"],"sourcesContent":["/**\n * A specialized version of `_.map` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\nfunction arrayMap(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length,\n result = Array(length);\n\n while (++index < length) {\n result[index] = iteratee(array[index], index, array);\n }\n return result;\n}\n\nmodule.exports = arrayMap;\n","export const MIN_COL_SIZE = 30;\nexport const RESIZE_INTERVAL = 40;\n\nexport const DATA_COL = 'data-rgCol';\nexport const DATA_ROW = 'data-rgRow';\n\nexport const UUID = 'grid-uuid';\n\nexport const DISABLED_CLASS = 'disabled';\nexport const CELL_CLASS = 'rgCell';\nexport const ROW_HEADER_TYPE = 'rowHeaders';\nexport const HEADER_CLASS = 'rgHeaderCell';\nexport const HEADER_SORTABLE_CLASS = 'sortable';\nexport const HEADER_ROW_CLASS = 'header-rgRow';\nexport const HEADER_ACTUAL_ROW_CLASS = 'actual-rgRow';\n\nexport const DRAG_ICON_CLASS = 'revo-drag-icon';\nexport const DRAGGABLE_CLASS = 'revo-draggable';\n\nexport const FOCUS_CLASS = 'focused-cell';\nexport const SELECTION_BORDER_CLASS = 'selection-border-range';\nexport const MOBILE_CLASS = 'mobile-handler';\nexport const TMP_SELECTION_BG_CLASS = 'temp-bg-range';\n\nexport const CELL_HANDLER_CLASS = 'autofill-handle';\n\nexport const EDIT_INPUT_WR = 'edit-input-wrapper';\n\nexport const DRAGG_TEXT = 'Draggable item';\nexport const GRID_INTERNALS = '__rvgr';\n"],"version":3}
|
|
@@ -30,7 +30,7 @@ class LocalScrollService {
|
|
|
30
30
|
this.cancelScroll(e.dimension);
|
|
31
31
|
const frameAnimation = new Promise((resolve, reject) => {
|
|
32
32
|
const animationId = window.requestAnimationFrame(() => {
|
|
33
|
-
resolve(
|
|
33
|
+
resolve();
|
|
34
34
|
});
|
|
35
35
|
this.preventArtificialScroll[e.dimension] = reject.bind(null, animationId);
|
|
36
36
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"localScrollService.js","mappings":";;;;;AAgBA,MAAM,aAAa,GAAW;EAC5B,WAAW,EAAE,CAAC;EACd,UAAU,EAAE,CAAC;EACb,WAAW,EAAE,CAAC;EACd,OAAO,EAAE,CAAC;CACX,CAAC;AACF,MAAM,aAAa,GAAG,CAAC,CAAC,CAAC;MACJ,kBAAkB;EAMrC,YAAoB,GAAW;IAAX,QAAG,GAAH,GAAG,CAAQ;IALvB,4BAAuB,GAAsD,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;;IAE1G,mBAAc,GAA2C,EAAE,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,aAAa,EAAE,CAAC;IACxG,WAAM,GAA2C,EAAE,KAAK,oBAAO,aAAa,CAAE,EAAE,KAAK,oBAAO,aAAa,CAAE,EAAE,CAAC;GAEnF;EAEnC,OAAO,qBAAqB,CAAC,WAAmB,EAAE,UAAkB,EAAE,cAAsB,CAAC;IAC3F,OAAO,WAAW,IAAI,WAAW,GAAG,UAAU,GAAG,WAAW,GAAG,CAAC,CAAC,CAAC;GACnE;EAED,SAAS,CAAC,MAAc,EAAE,SAAiC;IACzD,MAAM,kBAAkB,GAAG,kBAAkB,CAAC,qBAAqB,CAAC,MAAM,CAAC,WAAW,EAAE,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,WAAW,CAAC,CAAC;IAC/H,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,mCACjB,MAAM,KACT,OAAO,EAAE,kBAAkB,GAAG,MAAM,CAAC,UAAU,EAC/C,kBAAkB,GACnB,CAAC;GACH;;EAGD,MAAM,SAAS,CAAC,CAA+B;IAC7C,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;IAE/B,MAAM,cAAc,GAAG,IAAI,OAAO,
|
|
1
|
+
{"file":"localScrollService.js","mappings":"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","names":[],"sources":["./src/services/localScrollService.ts"],"sourcesContent":["import { scaleValue } from '../utils';\nimport { RevoGrid } from '../interfaces';\n\ninterface Config {\n beforeScroll(e: RevoGrid.ViewPortScrollEvent): void;\n afterScroll(e: RevoGrid.ViewPortScrollEvent): void;\n}\n\ntype Params = {\n contentSize: number;\n virtualContentSize?: number;\n clientSize: number;\n virtualSize: number;\n maxSize?: number;\n};\n\nconst initialParams: Params = {\n contentSize: 0,\n clientSize: 0,\n virtualSize: 0,\n maxSize: 0,\n};\nconst NO_COORDINATE = -1;\nexport default class LocalScrollService {\n private preventArtificialScroll: Record<RevoGrid.DimensionType, () => void | null> = { rgRow: null, rgCol: null };\n // to check if scroll changed\n private previousScroll: Record<RevoGrid.DimensionType, number> = { rgRow: NO_COORDINATE, rgCol: NO_COORDINATE };\n private params: Record<RevoGrid.DimensionType, Params> = { rgRow: { ...initialParams }, rgCol: { ...initialParams } };\n\n constructor(private cfg: Config) {}\n\n static getVirtualContentSize(contentSize: number, clientSize: number, virtualSize: number = 0): number {\n return contentSize + (virtualSize ? clientSize - virtualSize : 0);\n }\n\n setParams(params: Params, dimension: RevoGrid.DimensionType) {\n const virtualContentSize = LocalScrollService.getVirtualContentSize(params.contentSize, params.clientSize, params.virtualSize);\n this.params[dimension] = {\n ...params,\n maxSize: virtualContentSize - params.clientSize,\n virtualContentSize,\n };\n }\n\n // apply scroll values after scroll done\n async setScroll(e: RevoGrid.ViewPortScrollEvent) {\n this.cancelScroll(e.dimension);\n\n const frameAnimation = new Promise<void>((resolve, reject) => {\n const animationId = window.requestAnimationFrame(() => {\n resolve();\n });\n this.preventArtificialScroll[e.dimension] = reject.bind(null, animationId);\n });\n try {\n await frameAnimation;\n const params = this.getParams(e.dimension);\n e.coordinate = Math.ceil(e.coordinate);\n this.previousScroll[e.dimension] = this.wrapCoordinate(e.coordinate, params);\n this.preventArtificialScroll[e.dimension] = null;\n this.cfg.afterScroll({\n ...e,\n coordinate: params.virtualSize ? this.convert(e.coordinate, params, false) : e.coordinate,\n });\n\n } catch (id) {\n window.cancelAnimationFrame(id);\n }\n }\n\n // initiate scrolling event\n scroll(\n coordinate: number,\n dimension: RevoGrid.DimensionType,\n force = false,\n delta?: number,\n outside = false\n ) {\n this.cancelScroll(dimension);\n if (!force && this.previousScroll[dimension] === coordinate) {\n this.previousScroll[dimension] = NO_COORDINATE;\n return;\n }\n\n const param = this.getParams(dimension);\n this.cfg.beforeScroll({\n dimension: dimension,\n coordinate: param.virtualSize ? this.convert(coordinate, param) : coordinate,\n delta,\n outside\n });\n }\n\n private getParams(dimension: RevoGrid.DimensionType): Params {\n return this.params[dimension];\n }\n\n // check if scroll outside of region to avoid looping\n private wrapCoordinate(c: number, param: Params): number {\n if (c < 0) {\n return NO_COORDINATE;\n }\n\n if (c > param.maxSize) {\n return param.maxSize;\n }\n return c;\n }\n\n // prevent already started scroll, performance optimization\n private cancelScroll(dimension: RevoGrid.DimensionType) {\n const canceler = this.preventArtificialScroll[dimension];\n if (canceler) {\n canceler();\n this.preventArtificialScroll[dimension] = null;\n }\n }\n\n /* convert virtual to real and back, scale range */\n private convert(pos: number, param: Params, toReal: boolean = true): number {\n const minRange: number = param.clientSize;\n const from: [number, number] = [0, param.virtualContentSize - minRange];\n const to: [number, number] = [0, param.contentSize - param.virtualSize];\n if (toReal) {\n return scaleValue(pos, from, to);\n }\n return scaleValue(pos, to, from);\n }\n}\n"],"version":3}
|
|
@@ -14,10 +14,10 @@ import { t as timeout, g as getScrollbarWidth } from './index2.js';
|
|
|
14
14
|
import { F as FILTER_PROP, i as isFilterBtn } from './filter.button.js';
|
|
15
15
|
import { _ as _getTag } from './_stringToPath.js';
|
|
16
16
|
import { i as isString_1, d as defineCustomElement$a } from './revogr-edit2.js';
|
|
17
|
+
import { d as debounce_1 } from './debounce.js';
|
|
17
18
|
import { t as toInteger_1 } from './toInteger.js';
|
|
18
19
|
import { i as isGrouping, g as getGroupingName, G as GROUP_EXPANDED, a as getParsedGroup, b as isSameGroup, c as GROUP_DEPTH, P as PSEUDO_GROUP_ITEM_VALUE, d as PSEUDO_GROUP_ITEM_ID, e as GROUPING_ROW_TYPE, f as PSEUDO_GROUP_COLUMN, h as GROUP_EXPAND_EVENT, j as gatherGrouping, k as isGroupingColumn, E as EMPTY_INDEX, S as SelectionStoreConnector } from './columnService.js';
|
|
19
20
|
import { g as getLastCell, H as HEADER_SLOT, C as CONTENT_SLOT, F as FOOTER_SLOT, D as DATA_SLOT, d as defineCustomElement$2 } from './revogr-viewport-scroll2.js';
|
|
20
|
-
import { d as debounce_1 } from './debounce.js';
|
|
21
21
|
import { d as dispatch, a as defineCustomElement$8 } from './revogr-header2.js';
|
|
22
22
|
import { g as getFromEvent, d as defineCustomElement$6 } from './revogr-overlay-selection2.js';
|
|
23
23
|
import { d as defineCustomElement$b } from './revogr-data2.js';
|
|
@@ -1595,45 +1595,40 @@ var size_1 = size;
|
|
|
1595
1595
|
|
|
1596
1596
|
/**
|
|
1597
1597
|
* lifecycle
|
|
1598
|
-
* 1) @event beforesorting - sorting just started, nothing happened yet
|
|
1598
|
+
* 1) @event beforesorting - sorting just started, nothing happened yet, can be from column or from source, if type is from rows - column will be undefined
|
|
1599
1599
|
* 2) @metod updateColumnSorting - column sorting icon applied to grid and column get updated, data still untiuched
|
|
1600
|
-
* 3) @event beforesortingapply - before we applied sorting data to data source, you can prevent data
|
|
1601
|
-
* 4) @event afterSortingApply - sorting applied, just finished event
|
|
1600
|
+
* 3) @event beforesortingapply - before we applied sorting data to data source, you can prevent event and data will not be sorted. It's called only from column sorting click
|
|
1601
|
+
* 4) @event afterSortingApply - sorting applied, just finished event, from rows and columns
|
|
1602
1602
|
*
|
|
1603
1603
|
* If you prevent event it'll not reach farther steps
|
|
1604
1604
|
*/
|
|
1605
1605
|
class SortingPlugin extends BasePlugin {
|
|
1606
|
-
get hasSorting() {
|
|
1607
|
-
return !!this.sorting;
|
|
1608
|
-
}
|
|
1609
1606
|
constructor(revogrid) {
|
|
1610
1607
|
super(revogrid);
|
|
1611
1608
|
this.revogrid = revogrid;
|
|
1609
|
+
// sorting order per column
|
|
1612
1610
|
this.sorting = null;
|
|
1611
|
+
// sorting function per column, multiple columns sorting supported
|
|
1613
1612
|
this.sortingFunc = null;
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
if (
|
|
1613
|
+
this.doSort = debounce_1((order, comparison) => this.sort(order, comparison), 50);
|
|
1614
|
+
const aftersourceset = async ({ detail: { type } }) => {
|
|
1615
|
+
// if sorting was provided - sort data
|
|
1616
|
+
if (!!this.sorting && this.sortingFunc) {
|
|
1617
|
+
const beforeEvent = this.emit('beforesorting', { type });
|
|
1618
|
+
if (beforeEvent.defaultPrevented) {
|
|
1620
1619
|
return;
|
|
1621
1620
|
}
|
|
1622
|
-
|
|
1623
|
-
const data = this.setData(detail.source, detail.type);
|
|
1624
|
-
if (data) {
|
|
1625
|
-
detail.source = data;
|
|
1621
|
+
this.doSort(this.sorting, this.sortingFunc);
|
|
1626
1622
|
}
|
|
1627
1623
|
};
|
|
1628
1624
|
const aftercolumnsset = async ({ detail: { order } }) => {
|
|
1629
1625
|
const columns = await this.revogrid.getColumns();
|
|
1630
1626
|
const sortingFunc = {};
|
|
1631
1627
|
for (let prop in order) {
|
|
1632
|
-
const
|
|
1633
|
-
|
|
1634
|
-
sortingFunc[prop] = order[prop] == 'desc' ? this.descCellCompare(cmp) : cmp;
|
|
1628
|
+
const cmp = this.getComparer(ColumnDataProvider.getColumnByProp(columns, prop), order[prop]);
|
|
1629
|
+
sortingFunc[prop] = cmp;
|
|
1635
1630
|
}
|
|
1636
|
-
this.
|
|
1631
|
+
this.doSort(order, sortingFunc);
|
|
1637
1632
|
};
|
|
1638
1633
|
const headerclick = async (e) => {
|
|
1639
1634
|
var _a, _b;
|
|
@@ -1645,10 +1640,24 @@ class SortingPlugin extends BasePlugin {
|
|
|
1645
1640
|
}
|
|
1646
1641
|
this.headerclick(e.detail.column, e.detail.index, (_b = (_a = e.detail) === null || _a === void 0 ? void 0 : _a.originalEvent) === null || _b === void 0 ? void 0 : _b.shiftKey);
|
|
1647
1642
|
};
|
|
1648
|
-
this.addEventListener('
|
|
1643
|
+
this.addEventListener('after-any-source', aftersourceset);
|
|
1649
1644
|
this.addEventListener('aftercolumnsset', aftercolumnsset);
|
|
1650
1645
|
this.addEventListener('initialHeaderClick', headerclick);
|
|
1651
1646
|
}
|
|
1647
|
+
getComparer(column, order) {
|
|
1648
|
+
const cellCmp = (column === null || column === void 0 ? void 0 : column.cellCompare.bind({ order })) || this.defaultCellCompare;
|
|
1649
|
+
if (order == 'asc') {
|
|
1650
|
+
return cellCmp;
|
|
1651
|
+
}
|
|
1652
|
+
if (order == 'desc') {
|
|
1653
|
+
return this.descCellCompare(cellCmp);
|
|
1654
|
+
}
|
|
1655
|
+
return undefined;
|
|
1656
|
+
}
|
|
1657
|
+
/**
|
|
1658
|
+
* Apply sorting to data on header click
|
|
1659
|
+
* If additive - add to existing sorting, multiple columns can be sorted
|
|
1660
|
+
*/
|
|
1652
1661
|
async headerclick(column, index, additive) {
|
|
1653
1662
|
let order = this.getNextOrder(column.order);
|
|
1654
1663
|
const beforeEvent = this.emit('beforesorting', { column, order, additive });
|
|
@@ -1663,13 +1672,13 @@ class SortingPlugin extends BasePlugin {
|
|
|
1663
1672
|
return;
|
|
1664
1673
|
}
|
|
1665
1674
|
order = beforeApplyEvent.detail.order;
|
|
1666
|
-
const
|
|
1667
|
-
const cmp = order == 'asc' ? cellCmp : order == 'desc' ? this.descCellCompare(cellCmp) : undefined;
|
|
1675
|
+
const cmp = this.getComparer(column, order);
|
|
1668
1676
|
if (additive && this.sorting) {
|
|
1669
1677
|
const sorting = {};
|
|
1670
1678
|
const sortingFunc = {};
|
|
1671
|
-
Object.assign(
|
|
1672
|
-
|
|
1679
|
+
this.sorting = Object.assign(Object.assign({}, this.sorting), sorting);
|
|
1680
|
+
// extend sorting function with new sorting for multiple columns sorting
|
|
1681
|
+
this.sortingFunc = Object.assign(Object.assign({}, this.sortingFunc), sortingFunc);
|
|
1673
1682
|
if (column.prop in sorting && size_1(sorting) > 1 && order === undefined) {
|
|
1674
1683
|
delete sorting[column.prop];
|
|
1675
1684
|
delete sortingFunc[column.prop];
|
|
@@ -1678,38 +1687,46 @@ class SortingPlugin extends BasePlugin {
|
|
|
1678
1687
|
sorting[column.prop] = order;
|
|
1679
1688
|
sortingFunc[column.prop] = cmp;
|
|
1680
1689
|
}
|
|
1681
|
-
this.sort(sorting, sortingFunc);
|
|
1682
1690
|
}
|
|
1683
1691
|
else {
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
setData(data, type) {
|
|
1688
|
-
// sorting available for rgRow type only
|
|
1689
|
-
if (type === 'rgRow' && this.sortingFunc) {
|
|
1690
|
-
return this.sortItems(data, this.sortingFunc);
|
|
1692
|
+
// reset sorting
|
|
1693
|
+
this.sorting = { [column.prop]: order };
|
|
1694
|
+
this.sortingFunc = { [column.prop]: cmp };
|
|
1691
1695
|
}
|
|
1696
|
+
this.doSort(this.sorting, this.sortingFunc);
|
|
1692
1697
|
}
|
|
1693
1698
|
/**
|
|
1694
|
-
*
|
|
1699
|
+
* Sort items by sorting function
|
|
1700
|
+
* @requires proxyItems applied to row store
|
|
1701
|
+
* @requires source applied to row store
|
|
1702
|
+
*
|
|
1695
1703
|
* @param sorting - per column sorting
|
|
1696
1704
|
* @param data - this.stores['rgRow'].store.get('source')
|
|
1697
1705
|
*/
|
|
1698
|
-
async sort(sorting, sortingFunc) {
|
|
1706
|
+
async sort(sorting, sortingFunc, types = ['rgRow', 'rowPinStart', 'rowPinEnd']) {
|
|
1707
|
+
// if no sorting - reset
|
|
1699
1708
|
if (!size_1(sorting)) {
|
|
1700
1709
|
this.sorting = null;
|
|
1701
1710
|
this.sortingFunc = null;
|
|
1702
1711
|
return;
|
|
1703
1712
|
}
|
|
1713
|
+
// set sorting
|
|
1704
1714
|
this.sorting = sorting;
|
|
1705
1715
|
this.sortingFunc = sortingFunc;
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
source
|
|
1712
|
-
|
|
1716
|
+
// by default it'll sort by rgRow store
|
|
1717
|
+
// todo: support multiple stores
|
|
1718
|
+
for (let type of types) {
|
|
1719
|
+
const store = await this.revogrid.getSourceStore(type);
|
|
1720
|
+
// row data
|
|
1721
|
+
const source = store.get('source');
|
|
1722
|
+
// row indexes
|
|
1723
|
+
const proxyItems = store.get('proxyItems');
|
|
1724
|
+
const data = this.sortIndexByItems([...proxyItems], source, sortingFunc);
|
|
1725
|
+
setStore(store, {
|
|
1726
|
+
proxyItems: data,
|
|
1727
|
+
source: [...source],
|
|
1728
|
+
});
|
|
1729
|
+
}
|
|
1713
1730
|
this.emit('afterSortingApply');
|
|
1714
1731
|
}
|
|
1715
1732
|
defaultCellCompare(prop, a, b) {
|
|
@@ -1724,41 +1741,30 @@ class SortingPlugin extends BasePlugin {
|
|
|
1724
1741
|
};
|
|
1725
1742
|
}
|
|
1726
1743
|
sortIndexByItems(indexes, source, sortingFunc) {
|
|
1727
|
-
//
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
return [...Array(indexes.length).keys()];
|
|
1732
|
-
}
|
|
1744
|
+
// if no sorting - return unsorted indexes
|
|
1745
|
+
if (Object.entries(sortingFunc).length === 0) {
|
|
1746
|
+
// Unsort indexes
|
|
1747
|
+
return [...Array(indexes.length).keys()];
|
|
1733
1748
|
}
|
|
1749
|
+
//
|
|
1750
|
+
/**
|
|
1751
|
+
* go through all indexes and align in new order
|
|
1752
|
+
* performs a multi-level sorting by applying multiple comparison functions to determine the order of the items based on different properties.
|
|
1753
|
+
*/
|
|
1734
1754
|
return indexes.sort((a, b) => {
|
|
1735
|
-
|
|
1736
|
-
for (let prop in sortingFunc) {
|
|
1737
|
-
const cmp = sortingFunc[prop];
|
|
1755
|
+
for (const [prop, cmp] of Object.entries(sortingFunc)) {
|
|
1738
1756
|
const itemA = source[a];
|
|
1739
1757
|
const itemB = source[b];
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
return sorted;
|
|
1746
|
-
});
|
|
1747
|
-
}
|
|
1748
|
-
sortItems(source, sortingFunc) {
|
|
1749
|
-
return source.sort((a, b) => {
|
|
1750
|
-
let sorted = 0;
|
|
1751
|
-
for (let prop in sortingFunc) {
|
|
1752
|
-
const cmp = sortingFunc[prop];
|
|
1753
|
-
if (!cmp) {
|
|
1754
|
-
continue;
|
|
1755
|
-
}
|
|
1756
|
-
sorted = cmp(prop, a, b);
|
|
1758
|
+
/**
|
|
1759
|
+
* If the comparison function returns a non-zero value (sorted), it means that the items should be sorted based on the given property. In such a case, the function immediately returns the sorted value, indicating the order in which the items should be arranged.
|
|
1760
|
+
* If none of the comparison functions result in a non-zero value, indicating that the items are equal or should remain in the same order, the function eventually returns 0.
|
|
1761
|
+
*/
|
|
1762
|
+
const sorted = cmp(prop, itemA, itemB);
|
|
1757
1763
|
if (sorted) {
|
|
1758
|
-
|
|
1764
|
+
return sorted;
|
|
1759
1765
|
}
|
|
1760
1766
|
}
|
|
1761
|
-
return
|
|
1767
|
+
return 0;
|
|
1762
1768
|
});
|
|
1763
1769
|
}
|
|
1764
1770
|
getNextOrder(currentOrder) {
|
|
@@ -2593,6 +2599,7 @@ class ViewportService {
|
|
|
2593
2599
|
}
|
|
2594
2600
|
/**
|
|
2595
2601
|
* Transform data from stores and apply it to different components
|
|
2602
|
+
* Handle columns
|
|
2596
2603
|
*/
|
|
2597
2604
|
getViewportColumnData(contentHeight) {
|
|
2598
2605
|
const columns = [];
|
|
@@ -2627,7 +2634,12 @@ class ViewportService {
|
|
|
2627
2634
|
segmentSelection.setLastCell(rgRow.lastCell);
|
|
2628
2635
|
// register selection store for Row
|
|
2629
2636
|
const rowSelectionStore = this.registerRow(rgRow.position.y, rgRow.type);
|
|
2630
|
-
const rowDef = Object.assign(Object.assign({}, rgRow), { rowSelectionStore, segmentSelectionStore: segmentSelection.store, ref: (e) => this.sv.selectionStoreConnector.registerSection(e), onSetRange: e =>
|
|
2637
|
+
const rowDef = Object.assign(Object.assign({}, rgRow), { rowSelectionStore, segmentSelectionStore: segmentSelection.store, ref: (e) => this.sv.selectionStoreConnector.registerSection(e), onSetRange: e => {
|
|
2638
|
+
segmentSelection.setRangeArea(e.detail);
|
|
2639
|
+
}, onSetTempRange: e => {
|
|
2640
|
+
segmentSelection.setTempArea(e.detail);
|
|
2641
|
+
}, onFocusCell: e => {
|
|
2642
|
+
// todo: multi focus
|
|
2631
2643
|
segmentSelection.clearFocus();
|
|
2632
2644
|
this.sv.selectionStoreConnector.focus(segmentSelection, e.detail);
|
|
2633
2645
|
} });
|
|
@@ -2673,6 +2685,7 @@ class ViewportService {
|
|
|
2673
2685
|
dimensionCol: data.dimensions[data.colType].store,
|
|
2674
2686
|
groups: data.colStore.get('groups'),
|
|
2675
2687
|
groupingDepth: data.colStore.get('groupingDepth'),
|
|
2688
|
+
resizeHandler: data.colType === 'colPinEnd' ? ['l'] : undefined,
|
|
2676
2689
|
onHeaderresize: data.onHeaderresize,
|
|
2677
2690
|
};
|
|
2678
2691
|
return {
|
|
@@ -2724,7 +2737,7 @@ class ViewportService {
|
|
|
2724
2737
|
scrollToCell(cell) {
|
|
2725
2738
|
for (let key in cell) {
|
|
2726
2739
|
const coordinate = cell[key];
|
|
2727
|
-
this.sv.scrollingService.
|
|
2740
|
+
this.sv.scrollingService.scrollService({ dimension: key === 'x' ? 'rgCol' : 'rgRow', coordinate });
|
|
2728
2741
|
}
|
|
2729
2742
|
}
|
|
2730
2743
|
/**
|
|
@@ -2736,14 +2749,19 @@ class ViewportService {
|
|
|
2736
2749
|
clearEdit() {
|
|
2737
2750
|
this.sv.selectionStoreConnector.setEdit(false);
|
|
2738
2751
|
}
|
|
2752
|
+
/**
|
|
2753
|
+
* Collect focused element data
|
|
2754
|
+
*/
|
|
2739
2755
|
getFocused() {
|
|
2740
2756
|
const focused = this.sv.selectionStoreConnector.focusedStore;
|
|
2741
2757
|
if (!focused) {
|
|
2742
2758
|
return null;
|
|
2743
2759
|
}
|
|
2760
|
+
// get column data
|
|
2744
2761
|
const colType = this.sv.selectionStoreConnector.storesXToType[focused.position.x];
|
|
2745
2762
|
const column = this.sv.columnProvider.getColumn(focused.cell.x, colType);
|
|
2746
|
-
|
|
2763
|
+
// get row data
|
|
2764
|
+
const rowType = this.sv.selectionStoreConnector.storesYToType[focused.position.y];
|
|
2747
2765
|
const model = this.sv.dataProvider.getModel(focused.cell.y, rowType);
|
|
2748
2766
|
return {
|
|
2749
2767
|
column,
|
|
@@ -2774,27 +2792,34 @@ class ViewportService {
|
|
|
2774
2792
|
}
|
|
2775
2793
|
}
|
|
2776
2794
|
|
|
2795
|
+
function isMobileDevice() {
|
|
2796
|
+
return /Mobi/i.test(navigator.userAgent) || /Android/i.test(navigator.userAgent) || navigator.maxTouchPoints > 0;
|
|
2797
|
+
}
|
|
2798
|
+
|
|
2777
2799
|
/**
|
|
2778
2800
|
* All render based on sections
|
|
2779
2801
|
* First we render vertical parts - pinned start, data, pinned end
|
|
2780
2802
|
* Per each column we render data collections: headers, pinned top, center data, pinned bottom
|
|
2781
2803
|
*/
|
|
2782
|
-
const ViewPortSections = ({ resize, editors, rowClass, readonly, range, columns, useClipboard, columnFilter, applyEditorChangesOnClose, additionalData, onCancelEdit, registerElement, onEdit,
|
|
2804
|
+
const ViewPortSections = ({ resize, editors, rowClass, readonly, range, columns, useClipboard, columnFilter, applyEditorChangesOnClose, additionalData, onCancelEdit, registerElement, onEdit, scrollSection, focusTemplate, onSelectAll, scrollSectionSilent, }) => {
|
|
2805
|
+
const isMobile = isMobileDevice();
|
|
2783
2806
|
const viewPortHtml = [];
|
|
2784
2807
|
/** render viewports columns */
|
|
2785
2808
|
for (let view of columns) {
|
|
2786
2809
|
/** render viewports rows */
|
|
2787
2810
|
const headerProperties = Object.assign(Object.assign({}, view.headerProp), { type: view.type, additionalData, viewportCol: view.viewportCol, selectionStore: view.columnSelectionStore, canResize: resize, columnFilter });
|
|
2788
|
-
const dataViews = [
|
|
2811
|
+
const dataViews = [
|
|
2812
|
+
h("revogr-header", Object.assign({}, headerProperties, { slot: HEADER_SLOT })),
|
|
2813
|
+
];
|
|
2789
2814
|
view.dataPorts.forEach((data, j) => {
|
|
2790
2815
|
const key = view.prop.key + (j + 1);
|
|
2791
|
-
const dataView = (h("revogr-overlay-selection", Object.assign({}, data, {
|
|
2816
|
+
const dataView = (h("revogr-overlay-selection", Object.assign({}, data, { isMobileDevice: isMobile, selectionStore: data.segmentSelectionStore, onSelectall: () => onSelectAll(), editors: editors, readonly: readonly, range: range, useClipboard: useClipboard, onCancelEdit: () => onCancelEdit(), applyChangesOnClose: applyEditorChangesOnClose, onSetEdit: ({ detail }) => onEdit(detail), additionalData: additionalData, slot: data.slot }),
|
|
2792
2817
|
h("revogr-data", Object.assign({}, data, { [UUID]: data.uuid }, { key: key, readonly: readonly, range: range, rowClass: rowClass, rowSelectionStore: data.rowSelectionStore, additionalData: additionalData, slot: DATA_SLOT })),
|
|
2793
2818
|
h("revogr-temp-range", { selectionStore: data.segmentSelectionStore, dimensionRow: data.dimensionRow, dimensionCol: data.dimensionCol }),
|
|
2794
2819
|
h("revogr-focus", { colData: data.colData, dataStore: data.dataStore, focusTemplate: focusTemplate, rowType: data.type, colType: view.type, selectionStore: data.segmentSelectionStore, dimensionRow: data.dimensionRow, dimensionCol: data.dimensionCol })));
|
|
2795
2820
|
dataViews.push(dataView);
|
|
2796
2821
|
});
|
|
2797
|
-
viewPortHtml.push(h("revogr-viewport-scroll", Object.assign({}, view.prop, { ref: el => registerElement(el, view.prop.key), onScrollViewport: e =>
|
|
2822
|
+
viewPortHtml.push(h("revogr-viewport-scroll", Object.assign({}, view.prop, { ref: el => registerElement(el, view.prop.key), onScrollViewport: e => scrollSection(e.detail, view.prop.key), onSilentScroll: e => scrollSectionSilent(e.detail, view.prop.key) }), dataViews));
|
|
2798
2823
|
}
|
|
2799
2824
|
return viewPortHtml;
|
|
2800
2825
|
};
|
|
@@ -2804,32 +2829,57 @@ class GridScrollingService {
|
|
|
2804
2829
|
this.setViewport = setViewport;
|
|
2805
2830
|
this.elements = {};
|
|
2806
2831
|
}
|
|
2807
|
-
async
|
|
2832
|
+
async scrollService(e, key) {
|
|
2808
2833
|
let newEvent;
|
|
2834
|
+
let event = e;
|
|
2835
|
+
// skip negative scroll
|
|
2836
|
+
if (e.coordinate < 0) {
|
|
2837
|
+
return;
|
|
2838
|
+
}
|
|
2809
2839
|
for (let elKey in this.elements) {
|
|
2810
2840
|
if (e.dimension === 'rgCol' && elKey === 'headerRow') {
|
|
2811
2841
|
continue;
|
|
2842
|
+
// pinned column only
|
|
2812
2843
|
}
|
|
2813
2844
|
else if (this.isPinnedColumn(key) && e.dimension === 'rgCol') {
|
|
2814
2845
|
if (elKey === key || !e.delta) {
|
|
2815
2846
|
continue;
|
|
2816
2847
|
}
|
|
2817
2848
|
for (let el of this.elements[elKey]) {
|
|
2818
|
-
|
|
2849
|
+
if (el.changeScroll) {
|
|
2850
|
+
newEvent = el.changeScroll(e);
|
|
2851
|
+
}
|
|
2819
2852
|
}
|
|
2820
2853
|
}
|
|
2821
2854
|
else {
|
|
2822
2855
|
for (let el of this.elements[elKey]) {
|
|
2823
|
-
el.setScroll(e);
|
|
2856
|
+
await el.setScroll(e);
|
|
2824
2857
|
}
|
|
2825
2858
|
}
|
|
2826
2859
|
}
|
|
2827
|
-
let event = e;
|
|
2828
2860
|
if (newEvent) {
|
|
2829
2861
|
event = await newEvent;
|
|
2830
2862
|
}
|
|
2831
2863
|
this.setViewport(event);
|
|
2832
2864
|
}
|
|
2865
|
+
/**
|
|
2866
|
+
* Silent scroll update for mobile devices when we have negative scroll top
|
|
2867
|
+
*/
|
|
2868
|
+
async scrollSilentService(e, key) {
|
|
2869
|
+
var _a;
|
|
2870
|
+
for (let elKey in this.elements) {
|
|
2871
|
+
// skip same element update
|
|
2872
|
+
if (elKey === key) {
|
|
2873
|
+
continue;
|
|
2874
|
+
}
|
|
2875
|
+
if (columnTypes.includes(key) && (elKey === 'headerRow' || columnTypes.includes(elKey))) {
|
|
2876
|
+
for (let el of this.elements[elKey]) {
|
|
2877
|
+
await ((_a = el.changeScroll) === null || _a === void 0 ? void 0 : _a.call(el, e, true));
|
|
2878
|
+
}
|
|
2879
|
+
continue;
|
|
2880
|
+
}
|
|
2881
|
+
}
|
|
2882
|
+
}
|
|
2833
2883
|
isPinnedColumn(key) {
|
|
2834
2884
|
return ['colPinStart', 'colPinEnd'].indexOf(key) > -1;
|
|
2835
2885
|
}
|
|
@@ -3215,6 +3265,7 @@ const RevoGridComponent = /*@__PURE__*/ proxyCustomElement(class RevoGridCompone
|
|
|
3215
3265
|
this.beforesourceset = createEvent(this, "beforesourceset", 7);
|
|
3216
3266
|
this.beforeAnySource = createEvent(this, "before-any-source", 7);
|
|
3217
3267
|
this.aftersourceset = createEvent(this, "aftersourceset", 7);
|
|
3268
|
+
this.afterAnySource = createEvent(this, "after-any-source", 7);
|
|
3218
3269
|
this.beforecolumnsset = createEvent(this, "beforecolumnsset", 7);
|
|
3219
3270
|
this.beforecolumnapplied = createEvent(this, "beforecolumnapplied", 7);
|
|
3220
3271
|
this.aftercolumnsset = createEvent(this, "aftercolumnsset", 7);
|
|
@@ -3414,7 +3465,8 @@ const RevoGridComponent = /*@__PURE__*/ proxyCustomElement(class RevoGridCompone
|
|
|
3414
3465
|
* Clear current grid focus
|
|
3415
3466
|
*/
|
|
3416
3467
|
async clearFocus() {
|
|
3417
|
-
|
|
3468
|
+
var _a;
|
|
3469
|
+
const focused = (_a = this.viewport) === null || _a === void 0 ? void 0 : _a.getFocused();
|
|
3418
3470
|
const event = this.beforefocuslost.emit(focused);
|
|
3419
3471
|
if (event.defaultPrevented) {
|
|
3420
3472
|
return;
|
|
@@ -3450,14 +3502,24 @@ const RevoGridComponent = /*@__PURE__*/ proxyCustomElement(class RevoGridCompone
|
|
|
3450
3502
|
return (_a = this.viewport) === null || _a === void 0 ? void 0 : _a.getSelectedRange();
|
|
3451
3503
|
}
|
|
3452
3504
|
mousedownHandle(event) {
|
|
3453
|
-
|
|
3505
|
+
const screenX = getFromEvent(event, 'screenX');
|
|
3506
|
+
const screenY = getFromEvent(event, 'screenY');
|
|
3507
|
+
if (screenX === null || screenY === null) {
|
|
3508
|
+
return;
|
|
3509
|
+
}
|
|
3510
|
+
this.clickTrackForFocusClear = screenX + screenY;
|
|
3454
3511
|
}
|
|
3455
3512
|
mouseupHandle(event) {
|
|
3513
|
+
const screenX = getFromEvent(event, 'screenX');
|
|
3514
|
+
const screenY = getFromEvent(event, 'screenY');
|
|
3515
|
+
if (screenX === null || screenY === null) {
|
|
3516
|
+
return;
|
|
3517
|
+
}
|
|
3456
3518
|
if (event.defaultPrevented) {
|
|
3457
3519
|
return;
|
|
3458
3520
|
}
|
|
3459
3521
|
const target = event.target;
|
|
3460
|
-
const pos =
|
|
3522
|
+
const pos = screenX + screenY;
|
|
3461
3523
|
// detect if mousemove then do nothing
|
|
3462
3524
|
if (Math.abs(this.clickTrackForFocusClear - pos) > 10) {
|
|
3463
3525
|
return;
|
|
@@ -3549,6 +3611,12 @@ const RevoGridComponent = /*@__PURE__*/ proxyCustomElement(class RevoGridCompone
|
|
|
3549
3611
|
e.preventDefault();
|
|
3550
3612
|
}
|
|
3551
3613
|
}
|
|
3614
|
+
/**
|
|
3615
|
+
* Column format change will trigger column structure update
|
|
3616
|
+
*/
|
|
3617
|
+
columnTypesChanged() {
|
|
3618
|
+
this.columnChanged(this.columns);
|
|
3619
|
+
}
|
|
3552
3620
|
columnChanged(newVal = []) {
|
|
3553
3621
|
// clear existing data
|
|
3554
3622
|
this.dimensionProvider.dropColumns();
|
|
@@ -3596,7 +3664,12 @@ const RevoGridComponent = /*@__PURE__*/ proxyCustomElement(class RevoGridCompone
|
|
|
3596
3664
|
newVal = beforesourceset.detail.source;
|
|
3597
3665
|
break;
|
|
3598
3666
|
}
|
|
3599
|
-
this.
|
|
3667
|
+
const beforesourceset = this.beforeAnySource.emit({
|
|
3668
|
+
type,
|
|
3669
|
+
source: newVal,
|
|
3670
|
+
});
|
|
3671
|
+
const newSource = [...beforesourceset.detail.source];
|
|
3672
|
+
this.dataProvider.setData(newSource, type);
|
|
3600
3673
|
/** applied for source only for cross compatability between plugins */
|
|
3601
3674
|
if (watchName === 'source') {
|
|
3602
3675
|
this.aftersourceset.emit({
|
|
@@ -3604,6 +3677,10 @@ const RevoGridComponent = /*@__PURE__*/ proxyCustomElement(class RevoGridCompone
|
|
|
3604
3677
|
source: newVal,
|
|
3605
3678
|
});
|
|
3606
3679
|
}
|
|
3680
|
+
this.afterAnySource.emit({
|
|
3681
|
+
type,
|
|
3682
|
+
source: newVal,
|
|
3683
|
+
});
|
|
3607
3684
|
}
|
|
3608
3685
|
rowDefChanged(after, before) {
|
|
3609
3686
|
const { detail: { vals: newVal, oldVals: oldVal } } = this.beforerowdefinition.emit({
|
|
@@ -3676,14 +3753,6 @@ const RevoGridComponent = /*@__PURE__*/ proxyCustomElement(class RevoGridCompone
|
|
|
3676
3753
|
rowHeadersChange(rowHeaders) {
|
|
3677
3754
|
this.rowheaderschanged.emit(rowHeaders);
|
|
3678
3755
|
}
|
|
3679
|
-
dataSourceApply(source = [], type = 'rgRow') {
|
|
3680
|
-
const beforesourceset = this.beforeAnySource.emit({
|
|
3681
|
-
type,
|
|
3682
|
-
source,
|
|
3683
|
-
});
|
|
3684
|
-
const newSource = [...beforesourceset.detail.source];
|
|
3685
|
-
return this.dataProvider.setData(newSource, type);
|
|
3686
|
-
}
|
|
3687
3756
|
connectedCallback() {
|
|
3688
3757
|
this.viewportProvider = new ViewportProvider();
|
|
3689
3758
|
this.themeService = new ThemeService({
|
|
@@ -3768,7 +3837,7 @@ const RevoGridComponent = /*@__PURE__*/ proxyCustomElement(class RevoGridCompone
|
|
|
3768
3837
|
const views = [];
|
|
3769
3838
|
if (this.rowHeaders && this.viewport.columns.length) {
|
|
3770
3839
|
const anyView = this.viewport.columns[0];
|
|
3771
|
-
views.push(h("revogr-row-headers", { additionalData: this.additionalData, height: contentHeight, rowClass: this.rowClass, resize: this.resize, dataPorts: anyView.dataPorts, headerProp: anyView.headerProp, uiid: anyView.prop[UUID], rowHeaderColumn: typeof this.rowHeaders === 'object' ? this.rowHeaders : undefined, onScrollViewport: ({ detail: e }) => this.scrollingService.
|
|
3840
|
+
views.push(h("revogr-row-headers", { additionalData: this.additionalData, height: contentHeight, rowClass: this.rowClass, resize: this.resize, dataPorts: anyView.dataPorts, headerProp: anyView.headerProp, uiid: anyView.prop[UUID], rowHeaderColumn: typeof this.rowHeaders === 'object' ? this.rowHeaders : undefined, onScrollViewport: ({ detail: e }) => this.scrollingService.scrollService(e, 'headerRow'), onElementToScroll: ({ detail: e }) => this.scrollingService.registerElement(e, 'headerRow') }));
|
|
3772
3841
|
}
|
|
3773
3842
|
views.push(h(ViewPortSections, { additionalData: this.additionalData, columnFilter: !!this.filter, resize: this.resize, readonly: this.readonly, range: this.range, rowClass: this.rowClass, editors: this.editors, applyEditorChangesOnClose: this.applyOnClose, useClipboard: this.useClipboard, columns: this.viewport.columns, onSelectAll: () => {
|
|
3774
3843
|
this.selectionStoreConnector.selectAll();
|
|
@@ -3779,11 +3848,12 @@ const RevoGridComponent = /*@__PURE__*/ proxyCustomElement(class RevoGridCompone
|
|
|
3779
3848
|
}
|
|
3780
3849
|
}, onCancelEdit: () => {
|
|
3781
3850
|
this.selectionStoreConnector.setEdit(false);
|
|
3782
|
-
}, registerElement: (e, k) => this.scrollingService.registerElement(e, k),
|
|
3783
|
-
return (h(Host, Object.assign({}, { [`${UUID}`]: this.uuid }), h(RevoViewPort, { viewports: this.viewportProvider.stores, dimensions: this.dimensionProvider.stores, orderRef: e => (this.orderService = e), registerElement: (e, k) => this.scrollingService.registerElement(e, k), nakedClick: () => this.viewport.clearEdit(), onScroll: details => this.scrollingService.
|
|
3851
|
+
}, registerElement: (e, k) => this.scrollingService.registerElement(e, k), scrollSection: (details, k) => this.scrollingService.scrollService(details, k), scrollSectionSilent: (details, k) => this.scrollingService.scrollSilentService(details, k), focusTemplate: this.focusTemplate }));
|
|
3852
|
+
return (h(Host, Object.assign({}, { [`${UUID}`]: this.uuid }), h(RevoViewPort, { viewports: this.viewportProvider.stores, dimensions: this.dimensionProvider.stores, orderRef: e => (this.orderService = e), registerElement: (e, k) => this.scrollingService.registerElement(e, k), nakedClick: () => this.viewport.clearEdit(), onScroll: details => this.scrollingService.scrollService(details) }, views), this.extraElements));
|
|
3784
3853
|
}
|
|
3785
3854
|
get element() { return this; }
|
|
3786
3855
|
static get watchers() { return {
|
|
3856
|
+
"columnTypes": ["columnTypesChanged"],
|
|
3787
3857
|
"columns": ["columnChanged"],
|
|
3788
3858
|
"rowSize": ["rowSizeChanged"],
|
|
3789
3859
|
"theme": ["themeChanged"],
|