@revolist/revogrid 4.8.19 → 4.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{column.service-ad5ffa3c.js → column.service-6f691f50.js} +2 -2
- package/dist/cjs/{column.service-ad5ffa3c.js.map → column.service-6f691f50.js.map} +1 -1
- package/dist/cjs/{header-cell-renderer-d92249e4.js → header-cell-renderer-81a22b00.js} +2 -2
- package/dist/cjs/{header-cell-renderer-d92249e4.js.map → header-cell-renderer-81a22b00.js.map} +1 -1
- package/dist/cjs/{index-a9f1b728.js → index-2410bbd9.js} +1 -3
- package/dist/cjs/index-2410bbd9.js.map +1 -0
- package/dist/cjs/{key.utils-e6c8a895.js → key.utils-1e48ab8f.js} +2 -2
- package/dist/cjs/{key.utils-e6c8a895.js.map → key.utils-1e48ab8f.js.map} +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/revo-grid.cjs.entry.js +15 -19
- 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_6.cjs.entry.js +4 -4
- package/dist/cjs/revogr-clipboard_3.cjs.entry.js +2 -2
- package/dist/cjs/revogr-data_4.cjs.entry.js +4 -4
- package/dist/cjs/revogr-filter-panel.cjs.entry.js +14 -17
- package/dist/cjs/revogr-filter-panel.cjs.entry.js.map +1 -1
- package/dist/cjs/{throttle-46478b04.js → throttle-bcc4740d.js} +2 -2
- package/dist/cjs/{throttle-46478b04.js.map → throttle-bcc4740d.js.map} +1 -1
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/revoGrid/revo-grid.js +10 -15
- package/dist/collection/components/revoGrid/revo-grid.js.map +1 -1
- package/dist/collection/plugins/filter/{filter.pop.js → filter.panel.js} +23 -43
- package/dist/collection/plugins/filter/filter.panel.js.map +1 -0
- package/dist/collection/plugins/filter/filter.plugin.js +2 -2
- package/dist/collection/plugins/filter/filter.plugin.js.map +1 -1
- package/dist/collection/types/viewport.interfaces.js.map +1 -1
- package/dist/collection/utils/consts.js +0 -1
- package/dist/collection/utils/consts.js.map +1 -1
- package/dist/esm/{column.service-dce8aabc.js → column.service-0e41057a.js} +2 -2
- package/dist/esm/{column.service-dce8aabc.js.map → column.service-0e41057a.js.map} +1 -1
- package/dist/esm/{header-cell-renderer-171a011c.js → header-cell-renderer-6d8ac25d.js} +2 -2
- package/dist/esm/{header-cell-renderer-171a011c.js.map → header-cell-renderer-6d8ac25d.js.map} +1 -1
- package/dist/esm/{index-5a722722.js → index-4e881436.js} +2 -3
- package/dist/esm/index-4e881436.js.map +1 -0
- package/dist/esm/{key.utils-f82409ff.js → key.utils-425c987d.js} +2 -2
- package/dist/esm/{key.utils-f82409ff.js.map → key.utils-425c987d.js.map} +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/revo-grid.entry.js +15 -19
- package/dist/esm/revo-grid.entry.js.map +1 -1
- package/dist/esm/revo-grid.js +1 -1
- package/dist/esm/revogr-attribution_6.entry.js +4 -4
- package/dist/esm/revogr-clipboard_3.entry.js +2 -2
- package/dist/esm/revogr-data_4.entry.js +4 -4
- package/dist/esm/revogr-filter-panel.entry.js +15 -18
- package/dist/esm/revogr-filter-panel.entry.js.map +1 -1
- package/dist/esm/{throttle-eeca0062.js → throttle-1b1dd9d2.js} +2 -2
- package/dist/esm/{throttle-eeca0062.js.map → throttle-1b1dd9d2.js.map} +1 -1
- package/dist/revo-grid/{column.service-dce8aabc.js → column.service-0e41057a.js} +2 -2
- package/dist/revo-grid/{header-cell-renderer-171a011c.js → header-cell-renderer-6d8ac25d.js} +2 -2
- package/dist/revo-grid/index-4e881436.js +5 -0
- package/dist/revo-grid/index-4e881436.js.map +1 -0
- package/dist/revo-grid/{key.utils-f82409ff.js → key.utils-425c987d.js} +2 -2
- 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_6.entry.js +1 -1
- package/dist/revo-grid/revogr-clipboard_3.entry.js +1 -1
- package/dist/revo-grid/revogr-data_4.entry.js +1 -1
- 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/{throttle-eeca0062.js → throttle-1b1dd9d2.js} +2 -2
- package/dist/types/components/revoGrid/revo-grid.d.ts +0 -1
- package/dist/types/components.d.ts +2 -4
- package/dist/types/plugins/filter/{filter.pop.d.ts → filter.panel.d.ts} +1 -2
- package/dist/types/plugins/filter/filter.plugin.d.ts +2 -2
- package/dist/types/types/viewport.interfaces.d.ts +0 -2
- package/dist/types/utils/consts.d.ts +0 -1
- package/hydrate/index.js +27 -36
- package/hydrate/index.mjs +27 -36
- package/package.json +1 -1
- package/standalone/consts.js +1 -2
- package/standalone/consts.js.map +1 -1
- package/standalone/index.d.ts +1 -1
- package/standalone/revo-grid.js +13 -17
- package/standalone/revo-grid.js.map +1 -1
- package/standalone/revogr-filter-panel.js +14 -18
- package/standalone/revogr-filter-panel.js.map +1 -1
- package/dist/cjs/index-a9f1b728.js.map +0 -1
- package/dist/collection/plugins/filter/filter.pop.js.map +0 -1
- package/dist/esm/index-5a722722.js.map +0 -1
- package/dist/revo-grid/index-5a722722.js +0 -5
- package/dist/revo-grid/index-5a722722.js.map +0 -1
- /package/dist/revo-grid/{column.service-dce8aabc.js.map → column.service-0e41057a.js.map} +0 -0
- /package/dist/revo-grid/{header-cell-renderer-171a011c.js.map → header-cell-renderer-6d8ac25d.js.map} +0 -0
- /package/dist/revo-grid/{key.utils-f82409ff.js.map → key.utils-425c987d.js.map} +0 -0
- /package/dist/revo-grid/{throttle-eeca0062.js.map → throttle-1b1dd9d2.js.map} +0 -0
package/dist/esm/revo-grid.js
CHANGED
|
@@ -19,7 +19,7 @@ var patchBrowser = () => {
|
|
|
19
19
|
|
|
20
20
|
patchBrowser().then(async (options) => {
|
|
21
21
|
await globalScripts();
|
|
22
|
-
return bootstrapLazy([["revo-grid",[[4,"revo-grid",{"rowHeaders":[4,"row-headers"],"frameSize":[2,"frame-size"],"rowSize":[2,"row-size"],"colSize":[2,"col-size"],"range":[4],"readonly":[4],"resize":[4],"canFocus":[4,"can-focus"],"useClipboard":[4,"use-clipboard"],"columns":[16],"source":[16],"pinnedTopSource":[16],"pinnedBottomSource":[16],"rowDefinitions":[16],"editors":[16],"applyOnClose":[4,"apply-on-close"],"plugins":[16],"columnTypes":[16],"theme":[1537],"rowClass":[513,"row-class"],"autoSizeColumn":[4,"auto-size-column"],"filter":[4],"focusTemplate":[16],"canMoveColumns":[4,"can-move-columns"],"trimmedRows":[16],"exporting":[4],"grouping":[16],"stretch":[8],"additionalData":[8,"additional-data"],"disableVirtualX":[4,"disable-virtual-x"],"disableVirtualY":[4,"disable-virtual-y"],"hideAttribution":[4,"hide-attribution"],"jobsBeforeRender":[16],"registerVNode":[16],"refresh":[64],"setDataAt":[64],"scrollToRow":[64],"scrollToColumnIndex":[64],"scrollToColumnProp":[64],"updateColumns":[64],"addTrimmed":[64],"scrollToCoordinate":[64],"setCellEdit":[64],"setCellsFocus":[64],"getSource":[64],"getVisibleSource":[64],"getSourceStore":[64],"getColumnStore":[64],"updateColumnSorting":[64],"clearSorting":[64],"getColumns":[64],"clearFocus":[64],"getPlugins":[64],"getFocused":[64],"getContentSize":[64],"getSelectedRange":[64]},[[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"]],{"columnTypes":["columnTypesChanged"],"columns":["columnChanged"],"disableVirtualX":["disableVirtualXChanged"],"rowSize":["rowSizeChanged"],"theme":["themeChanged"],"source":["dataSourceChanged"],"pinnedBottomSource":["dataSourceChanged"],"pinnedTopSource":["dataSourceChanged"],"disableVirtualY":["disableVirtualYChanged"],"rowDefinitions":["rowDefChanged"],"trimmedRows":["trimmedRowsChanged"],"grouping":["groupingChanged"],"stretch":["applyStretch"],"filter":["applyFilter"],"rowHeaders":["rowHeadersChange"],"registerVNode":["registerOutsideVNodes"],"additionalData":["additionalDataChanged"]}]]],["revogr-filter-panel",[[0,"revogr-filter-panel",{"
|
|
22
|
+
return bootstrapLazy([["revo-grid",[[4,"revo-grid",{"rowHeaders":[4,"row-headers"],"frameSize":[2,"frame-size"],"rowSize":[2,"row-size"],"colSize":[2,"col-size"],"range":[4],"readonly":[4],"resize":[4],"canFocus":[4,"can-focus"],"useClipboard":[4,"use-clipboard"],"columns":[16],"source":[16],"pinnedTopSource":[16],"pinnedBottomSource":[16],"rowDefinitions":[16],"editors":[16],"applyOnClose":[4,"apply-on-close"],"plugins":[16],"columnTypes":[16],"theme":[1537],"rowClass":[513,"row-class"],"autoSizeColumn":[4,"auto-size-column"],"filter":[4],"focusTemplate":[16],"canMoveColumns":[4,"can-move-columns"],"trimmedRows":[16],"exporting":[4],"grouping":[16],"stretch":[8],"additionalData":[8,"additional-data"],"disableVirtualX":[4,"disable-virtual-x"],"disableVirtualY":[4,"disable-virtual-y"],"hideAttribution":[4,"hide-attribution"],"jobsBeforeRender":[16],"registerVNode":[16],"refresh":[64],"setDataAt":[64],"scrollToRow":[64],"scrollToColumnIndex":[64],"scrollToColumnProp":[64],"updateColumns":[64],"addTrimmed":[64],"scrollToCoordinate":[64],"setCellEdit":[64],"setCellsFocus":[64],"getSource":[64],"getVisibleSource":[64],"getSourceStore":[64],"getColumnStore":[64],"updateColumnSorting":[64],"clearSorting":[64],"getColumns":[64],"clearFocus":[64],"getPlugins":[64],"getFocused":[64],"getContentSize":[64],"getSelectedRange":[64]},[[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"]],{"columnTypes":["columnTypesChanged"],"columns":["columnChanged"],"disableVirtualX":["disableVirtualXChanged"],"rowSize":["rowSizeChanged"],"theme":["themeChanged"],"source":["dataSourceChanged"],"pinnedBottomSource":["dataSourceChanged"],"pinnedTopSource":["dataSourceChanged"],"disableVirtualY":["disableVirtualYChanged"],"rowDefinitions":["rowDefChanged"],"trimmedRows":["trimmedRowsChanged"],"grouping":["groupingChanged"],"stretch":["applyStretch"],"filter":["applyFilter"],"rowHeaders":["rowHeadersChange"],"registerVNode":["registerOutsideVNodes"],"additionalData":["additionalDataChanged"]}]]],["revogr-filter-panel",[[0,"revogr-filter-panel",{"filterItems":[16],"filterTypes":[16],"filterNames":[16],"filterEntities":[16],"filterCaptions":[16],"disableDynamicFiltering":[4,"disable-dynamic-filtering"],"isFilterIdSet":[32],"filterId":[32],"currentFilterId":[32],"currentFilterType":[32],"changes":[32],"show":[64],"getChanges":[64]},[[5,"mousedown","onMouseDown"]]]]],["revogr-clipboard_3",[[0,"revogr-clipboard",{"readonly":[4],"doCopy":[64]},[[4,"paste","onPaste"],[4,"copy","copyStarted"],[4,"cut","cutStarted"]]],[0,"revogr-edit",{"editCell":[16],"column":[16],"editor":[16],"saveOnClose":[4,"save-on-close"],"additionalData":[8,"additional-data"],"cancelChanges":[64],"beforeDisconnect":[64]}],[0,"revogr-order-editor",{"parent":[16],"dimensionRow":[16],"dimensionCol":[16],"dataStore":[16],"dragStart":[64],"endOrder":[64],"clearOrder":[64]}]]],["revogr-data_4",[[4,"revogr-data",{"readonly":[4],"range":[4],"rowClass":[1,"row-class"],"additionalData":[8,"additional-data"],"rowSelectionStore":[16],"viewportRow":[16],"viewportCol":[16],"dimensionRow":[16],"colData":[16],"dataStore":[16],"type":[513],"colType":[513,"col-type"],"jobsBeforeRender":[16],"providers":[32],"updateCell":[64]},null,{"dataStore":["onDataStoreChange"],"colData":["onColDataChange"]}],[0,"revogr-header",{"viewportCol":[16],"dimensionCol":[16],"selectionStore":[16],"groups":[16],"groupingDepth":[2,"grouping-depth"],"readonly":[4],"canResize":[4,"can-resize"],"resizeHandler":[16],"colData":[16],"columnFilter":[4,"column-filter"],"type":[1],"additionalData":[8,"additional-data"]}],[4,"revogr-viewport-scroll",{"rowHeader":[4,"row-header"],"contentWidth":[2,"content-width"],"contentHeight":[2,"content-height"],"colType":[1,"col-type"],"setScroll":[64],"changeScroll":[64],"applyScroll":[64]},[[0,"mousewheel-vertical","mousewheelVertical"],[0,"mousewheel-horizontal","mousewheelHorizontal"],[0,"scroll-coordinate","scrollApply"]]],[0,"vnode-html",{"redraw":[16]}]]],["revogr-attribution_6",[[0,"revogr-row-headers",{"height":[2],"dataPorts":[16],"headerProp":[16],"rowClass":[1,"row-class"],"resize":[4],"rowHeaderColumn":[16],"additionalData":[8,"additional-data"],"jobsBeforeRender":[16]}],[4,"revogr-overlay-selection",{"readonly":[4],"range":[4],"canDrag":[4,"can-drag"],"useClipboard":[4,"use-clipboard"],"selectionStore":[16],"dimensionRow":[16],"dimensionCol":[16],"dataStore":[16],"colData":[16],"lastCell":[16],"editors":[16],"applyChangesOnClose":[4,"apply-changes-on-close"],"additionalData":[8,"additional-data"],"isMobileDevice":[4,"is-mobile-device"]},[[5,"touchmove","onMouseMove"],[5,"mousemove","onMouseMove"],[5,"touchend","onMouseUp"],[5,"mouseup","onMouseUp"],[5,"mouseleave","onMouseUp"],[0,"dragstartcell","onCellDrag"],[4,"keyup","onKeyUp"],[4,"keydown","onKeyDown"]],{"selectionStore":["selectionServiceSet"],"dimensionRow":["createAutoFillService"],"dimensionCol":["createAutoFillService"],"dataStore":["columnServiceSet"],"colData":["columnServiceSet"]}],[0,"revogr-attribution"],[4,"revogr-focus",{"colType":[1,"col-type"],"rowType":[1,"row-type"],"selectionStore":[16],"dimensionRow":[16],"dimensionCol":[16],"dataStore":[16],"colData":[16],"focusTemplate":[16]}],[0,"revogr-scroll-virtual",{"dimension":[1],"viewportStore":[16],"dimensionStore":[16],"setScroll":[64],"changeScroll":[64]}],[0,"revogr-temp-range",{"selectionStore":[16],"dimensionRow":[16],"dimensionCol":[16]}]]]], options);
|
|
23
23
|
});
|
|
24
24
|
|
|
25
25
|
//# sourceMappingURL=revo-grid.js.map
|
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
* Built by Revolist OU ❤️
|
|
3
3
|
*/
|
|
4
4
|
import { r as registerInstance, h, H as Host, c as createEvent, a as getElement } from './index-a61f225b.js';
|
|
5
|
-
import { F as FOCUS_CLASS, t as timeout, R as RESIZE_INTERVAL, a as CELL_HANDLER_CLASS, M as MOBILE_CLASS, S as SELECTION_BORDER_CLASS, b as ROW_HEADER_TYPE, g as getScrollbarSize, T as TMP_SELECTION_BG_CLASS } from './index-
|
|
5
|
+
import { F as FOCUS_CLASS, t as timeout, R as RESIZE_INTERVAL, a as CELL_HANDLER_CLASS, M as MOBILE_CLASS, S as SELECTION_BORDER_CLASS, b as ROW_HEADER_TYPE, g as getScrollbarSize, T as TMP_SELECTION_BG_CLASS } from './index-4e881436.js';
|
|
6
6
|
import { i as getItemByPosition, j as getItemByIndex, b as getSourceItem, D as DataStore } from './dimension.helpers-91398565.js';
|
|
7
7
|
import './toNumber-8de324a7.js';
|
|
8
8
|
import { g as getPropertyFromEvent, v as verifyTouchTarget, c as calculateRowHeaderSize } from './events-77b43b40.js';
|
|
9
|
-
import { n as ColumnService, H as HEADER_SLOT } from './column.service-
|
|
10
|
-
import { c as codesLetter, i as isClear, a as isEnterKeyValue, b as isCopy, d as isCut, e as isPaste, f as isAll, g as isLetterKey, h as isEditInput } from './key.utils-
|
|
9
|
+
import { n as ColumnService, H as HEADER_SLOT } from './column.service-0e41057a.js';
|
|
10
|
+
import { c as codesLetter, i as isClear, a as isEnterKeyValue, b as isCopy, d as isCut, e as isPaste, f as isAll, g as isLetterKey, h as isEditInput } from './key.utils-425c987d.js';
|
|
11
11
|
import { g as getRange, a as isRangeSingleCell } from './selection.helpers-50e9f09d.js';
|
|
12
12
|
import { d as debounce_1 } from './debounce-7781346d.js';
|
|
13
13
|
import { V as ViewportStore } from './viewport.store-bfd0b036.js';
|
|
14
|
-
import { L as LocalScrollTimer, a as LocalScrollService, g as getContentSize, t as throttle_1 } from './throttle-
|
|
14
|
+
import { L as LocalScrollTimer, a as LocalScrollService, g as getContentSize, t as throttle_1 } from './throttle-1b1dd9d2.js';
|
|
15
15
|
|
|
16
16
|
const Attribution = class {
|
|
17
17
|
constructor(hostRef) {
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* Built by Revolist OU ❤️
|
|
3
3
|
*/
|
|
4
4
|
import { r as registerInstance, c as createEvent, h, H as Host, a as getElement } from './index-a61f225b.js';
|
|
5
|
-
import { t as timeout, E as EDIT_INPUT_WR, c as DRAGG_TEXT } from './index-
|
|
6
|
-
import { a as isEnterKeyValue, j as isTab, k as isEditorCtrConstructible } from './key.utils-
|
|
5
|
+
import { t as timeout, E as EDIT_INPUT_WR, c as DRAGG_TEXT } from './index-4e881436.js';
|
|
6
|
+
import { a as isEnterKeyValue, j as isTab, k as isEditorCtrConstructible } from './key.utils-425c987d.js';
|
|
7
7
|
import { d as debounce_1 } from './debounce-7781346d.js';
|
|
8
8
|
import { i as getItemByPosition, d as setItems } from './dimension.helpers-91398565.js';
|
|
9
9
|
import './toNumber-8de324a7.js';
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
* Built by Revolist OU ❤️
|
|
3
3
|
*/
|
|
4
4
|
import { h, r as registerInstance, c as createEvent, H as Host, a as getElement } from './index-a61f225b.js';
|
|
5
|
-
import { o as GROUP_EXPAND_BTN, h as GROUP_EXPAND_EVENT, p as PSEUDO_GROUP_ITEM, G as GROUP_EXPANDED, c as GROUP_DEPTH, q as isRowDragService, r as getCellData, n as ColumnService, i as isGrouping, H as HEADER_SLOT, C as CONTENT_SLOT, F as FOOTER_SLOT } from './column.service-
|
|
6
|
-
import { d as DATA_ROW, e as ROW_FOCUSED_CLASS, f as DRAG_ICON_CLASS, h as DRAGGABLE_CLASS, i as DATA_COL, F as FOCUS_CLASS, H as HEADER_CLASS, j as HEADER_SORTABLE_CLASS, k as MIN_COL_SIZE, l as HEADER_ROW_CLASS, m as HEADER_ACTUAL_ROW_CLASS } from './index-
|
|
5
|
+
import { o as GROUP_EXPAND_BTN, h as GROUP_EXPAND_EVENT, p as PSEUDO_GROUP_ITEM, G as GROUP_EXPANDED, c as GROUP_DEPTH, q as isRowDragService, r as getCellData, n as ColumnService, i as isGrouping, H as HEADER_SLOT, C as CONTENT_SLOT, F as FOOTER_SLOT } from './column.service-0e41057a.js';
|
|
6
|
+
import { d as DATA_ROW, e as ROW_FOCUSED_CLASS, f as DRAG_ICON_CLASS, h as DRAGGABLE_CLASS, i as DATA_COL, F as FOCUS_CLASS, H as HEADER_CLASS, j as HEADER_SORTABLE_CLASS, k as MIN_COL_SIZE, l as HEADER_ROW_CLASS, m as HEADER_ACTUAL_ROW_CLASS } from './index-4e881436.js';
|
|
7
7
|
import { b as getSourceItem, E as _getNative, q as _baseEach, _ as _baseIteratee, v as isArray_1, o as findIndex_1, j as getItemByIndex } from './dimension.helpers-91398565.js';
|
|
8
8
|
import './toNumber-8de324a7.js';
|
|
9
9
|
import { a as FilterButton } from './filter.button-37373672.js';
|
|
10
|
-
import { H as HeaderCellRenderer } from './header-cell-renderer-
|
|
11
|
-
import { t as throttle_1, L as LocalScrollTimer, a as LocalScrollService } from './throttle-
|
|
10
|
+
import { H as HeaderCellRenderer } from './header-cell-renderer-6d8ac25d.js';
|
|
11
|
+
import { t as throttle_1, L as LocalScrollTimer, a as LocalScrollService } from './throttle-1b1dd9d2.js';
|
|
12
12
|
import './selection.helpers-50e9f09d.js';
|
|
13
13
|
import './dispatcher-ea08404f.js';
|
|
14
14
|
import './debounce-7781346d.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Built by Revolist OU ❤️
|
|
3
3
|
*/
|
|
4
|
-
import { r as registerInstance, c as createEvent, h, H as Host } from './index-a61f225b.js';
|
|
4
|
+
import { r as registerInstance, c as createEvent, h, H as Host, a as getElement } from './index-a61f225b.js';
|
|
5
5
|
import { i as isFilterBtn, A as AndOrButton, T as TrashButton } from './filter.button-37373672.js';
|
|
6
6
|
import { d as debounce_1 } from './debounce-7781346d.js';
|
|
7
7
|
import './toNumber-8de324a7.js';
|
|
@@ -39,7 +39,7 @@ const FilterPanel = class {
|
|
|
39
39
|
title: 'Filter by',
|
|
40
40
|
save: 'Save',
|
|
41
41
|
// drops the filter
|
|
42
|
-
reset: '
|
|
42
|
+
reset: 'Clear changes',
|
|
43
43
|
cancel: 'Close',
|
|
44
44
|
add: 'Add more condition...',
|
|
45
45
|
placeholder: 'Enter value...',
|
|
@@ -54,7 +54,6 @@ const FilterPanel = class {
|
|
|
54
54
|
this.currentFilterId = -1;
|
|
55
55
|
this.currentFilterType = defaultType;
|
|
56
56
|
this.changes = undefined;
|
|
57
|
-
this.uuid = undefined;
|
|
58
57
|
this.filterItems = {};
|
|
59
58
|
this.filterTypes = {};
|
|
60
59
|
this.filterNames = {};
|
|
@@ -65,7 +64,18 @@ const FilterPanel = class {
|
|
|
65
64
|
onMouseDown(e) {
|
|
66
65
|
if (this.changes && !e.defaultPrevented) {
|
|
67
66
|
const el = e.target;
|
|
68
|
-
|
|
67
|
+
const select = document.getElementById('add-filter');
|
|
68
|
+
if (select) {
|
|
69
|
+
select.value = defaultType;
|
|
70
|
+
}
|
|
71
|
+
this.currentFilterType = defaultType;
|
|
72
|
+
if (this.changes) {
|
|
73
|
+
this.changes.type = defaultType;
|
|
74
|
+
}
|
|
75
|
+
this.currentFilterId = -1;
|
|
76
|
+
const path = e.composedPath();
|
|
77
|
+
const isOutside = !path.includes(this.element);
|
|
78
|
+
if (isOutside && !isFilterBtn(el)) {
|
|
69
79
|
this.changes = undefined;
|
|
70
80
|
}
|
|
71
81
|
}
|
|
@@ -278,20 +288,7 @@ const FilterPanel = class {
|
|
|
278
288
|
throw new Error('Changes required per edit');
|
|
279
289
|
}
|
|
280
290
|
}
|
|
281
|
-
|
|
282
|
-
const select = document.getElementById('add-filter');
|
|
283
|
-
if (select)
|
|
284
|
-
select.value = defaultType;
|
|
285
|
-
this.currentFilterType = defaultType;
|
|
286
|
-
if (this.changes) {
|
|
287
|
-
this.changes.type = defaultType;
|
|
288
|
-
}
|
|
289
|
-
this.currentFilterId = -1;
|
|
290
|
-
if (e === null || e === void 0 ? void 0 : e.classList.contains(`[uuid="${this.uuid}"]`)) {
|
|
291
|
-
return false;
|
|
292
|
-
}
|
|
293
|
-
return !(e === null || e === void 0 ? void 0 : e.closest(`[uuid="${this.uuid}"]`));
|
|
294
|
-
}
|
|
291
|
+
get element() { return getElement(this); }
|
|
295
292
|
};
|
|
296
293
|
FilterPanel.style = RevogrFilterPanelStyle0;
|
|
297
294
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"revogr-filter-panel.entry.js","mappings":";;;;;;;;AAAA,CAAC,SAAS,OAAO;IACf,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,OAAO,EAAE;QAC9B,OAAO,CAAC,SAAS,CAAC,OAAO;YACrB,OAAO,CAAC,SAA+E,CAAC,iBAAiB,IAAI,OAAO,CAAC,SAAS,CAAC,qBAAqB,CAAC;KAC1J;IAED,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,OA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;;;;;","names":["debounce"],"sources":["src/utils/closest.polifill.ts","src/plugins/filter/filter.style.scss?tag=revogr-filter-panel","src/plugins/filter/filter.pop.tsx"],"sourcesContent":["(function closest() {\n if (!Element.prototype.matches) {\n Element.prototype.matches =\n ((Element.prototype as unknown) as { msMatchesSelector: (selectors: string) => boolean }).msMatchesSelector || Element.prototype.webkitMatchesSelector;\n }\n\n if (!Element.prototype.closest) {\n Element.prototype.closest = function (s: string) {\n let el: HTMLElement | Element | (Node & ParentNode) = this;\n\n do {\n if (Element.prototype.matches.call(el, s)) {\n return el;\n }\n el = el.parentElement || el.parentNode;\n } while (el !== null && el.nodeType === 1);\n return null;\n };\n }\n})();\n","revogr-filter-panel {\n position: absolute;\n display: block;\n top: 0;\n left: 0;\n z-index: 100;\n\n opacity: 1;\n transform: none;\n background-color: #fff;\n transform-origin: 62px 0px;\n box-shadow: 0 5px 18px -2px rgba(black, 20%);\n padding: 10px;\n border-radius: 4px;\n\n min-width: 220px;\n text-align: left;\n\n .filter-holder > div {\n display: flex;\n flex-direction: column;\n }\n\n label {\n font-size: 13px;\n display: block;\n padding: 8px 0;\n }\n\n select {\n width: 100%;\n }\n\n input[type='text'] {\n border: 0;\n min-height: 34px;\n margin: 5px 0;\n background: #f3f3f3;\n border-radius: 5px;\n padding: 0 10px;\n box-sizing: border-box;\n width: 100%;\n }\n\n button {\n margin-top: 10px;\n margin-right: 5px;\n }\n\n .filter-actions {\n text-align: right;\n margin-right: -5px;\n }\n}\n\n.rgHeaderCell {\n &:hover .rv-filter {\n transition:\n opacity 267ms cubic-bezier(0.4, 0, 0.2, 1) 0ms,\n transform 178ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;\n }\n &:hover .rv-filter,\n .rv-filter.active {\n opacity: 1;\n }\n\n .rv-filter {\n $btn-size: 24px;\n height: $btn-size;\n width: $btn-size;\n background: none;\n border: 0;\n opacity: 0;\n visibility: visible;\n cursor: pointer;\n border-radius: 4px;\n\n &.active {\n color: #10224a;\n }\n\n .filter-img {\n $img-size: 11px;\n color: gray;\n width: $img-size;\n }\n }\n}\n\n.select-css {\n $gradient: 'data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23007CB2%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E';\n $linearGradient: linear-gradient(to bottom, #ffffff 0%, #ffffff 100%);\n $borderColor: #f1f1f1;\n\n display: block;\n font-family: sans-serif;\n font-weight: 600;\n color: #444;\n line-height: 1.3;\n padding: 0.6em 1.4em 0.5em 0.8em;\n width: 100%;\n max-width: 100%; /* useful when width is set to anything other than 100% */\n box-sizing: border-box;\n margin: 0;\n border: 1px solid $borderColor;\n box-shadow: transparent;\n border-radius: 0.5em;\n appearance: none;\n background-color: #fff;\n background-image: url($gradient), $linearGradient;\n background-repeat: no-repeat, repeat;\n /* arrow icon position (1em from the right, 50% vertical) , then gradient position*/\n background-position:\n right 0.7em top 50%,\n 0 0;\n /* icon size, then gradient */\n background-size:\n 0.65em auto,\n 100%;\n\n /* Hide arrow icon in IE browsers */\n &::-ms-expand {\n display: none;\n }\n /* Hover style */\n &:hover {\n border-color: rgb(197, 197, 197);\n }\n /* Focus style */\n &:focus {\n border-color: $borderColor;\n box-shadow: 0 0 1px 3px rgba(59, 153, 252, 0.7);\n box-shadow: 0 0 0 3px -moz-mac-focusring;\n color: #222;\n outline: none;\n }\n\n /* Set options to normal weight */\n option {\n font-weight: normal;\n }\n\n /* Disabled styles */\n &:disabled,\n &[aria-disabled='true'] {\n color: gray;\n background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22graytext%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E'),\n linear-gradient(to bottom, #ffffff 0%, #ffffff 100%);\n }\n\n &:disabled:hover,\n &[aria-disabled='true'] {\n border-color: $borderColor;\n }\n}\n\n.multi-filter-list {\n margin-top: 5px;\n margin-bottom: 5px;\n\n div {\n white-space: nowrap;\n }\n\n .multi-filter-list-action {\n display: flex;\n\n justify-content: space-between;\n align-items: center;\n }\n\n .and-or-button {\n margin: 0 0 0 10px;\n min-width: 58px;\n cursor: pointer;\n }\n .trash-button {\n $btn-remove-size: 22px;\n margin: 0 0 -2px 6px;\n cursor: pointer;\n\n width: $btn-remove-size;\n height: 100%;\n font-size: 16px;\n\n .trash-img {\n width: 1em;\n }\n }\n}\n\n.add-filter-divider {\n display: block;\n margin: 0 -10px 10px -10px;\n\n border-bottom: 1px solid #d9d9d9;\n height: 10px;\n}\n\n.select-input {\n display: flex;\n justify-content: space-between;\n align-items: center;\n}\n","import { Component, Event, EventEmitter, h, Host, Listen, Method, Prop, State, VNode } from '@stencil/core';\nimport { FilterType } from './filter.service';\nimport { AndOrButton, isFilterBtn, TrashButton } from './filter.button';\nimport '../../utils/closest.polifill';\nimport { LogicFunction } from './filter.types';\nimport { FilterCaptions } from './filter.plugin';\nimport debounce from 'lodash/debounce';\nimport { ColumnProp } from '@type';\n\nexport type FilterItem = {\n // column id\n prop?: ColumnProp;\n // filter type definition\n type?: FilterType;\n // value for additional filtering, text value or some id\n value?: any;\n};\n\nexport type FilterData = {\n id: number;\n type: FilterType;\n value?: any;\n relation: 'and' | 'or';\n};\n\nexport type MultiFilterItem = {\n [prop: string]: FilterData[];\n};\n\nexport type ShowData = {\n x: number;\n y: number;\n /**\n * Auto correct position if it is out of document bounds\n */\n autoCorrect?: boolean;\n} & FilterItem;\n\nconst defaultType: FilterType = 'none';\n\nconst FILTER_LIST_CLASS = 'multi-filter-list';\nconst FILTER_LIST_CLASS_ACTION = 'multi-filter-list-action';\n\n/**\n * Filter panel for editing filters\n */\n/**\n * @internal\n */\n@Component({\n tag: 'revogr-filter-panel',\n styleUrl: 'filter.style.scss',\n})\nexport class FilterPanel {\n private filterCaptionsInternal: FilterCaptions = {\n title: 'Filter by',\n save: 'Save',\n // drops the filter\n reset: 'Cancel',\n cancel: 'Close',\n add: 'Add more condition...',\n placeholder: 'Enter value...',\n and: 'and',\n or: 'or',\n };\n @State() isFilterIdSet = false;\n @State() filterId = 0;\n @State() currentFilterId = -1;\n @State() currentFilterType: FilterType = defaultType;\n @State() changes: ShowData | undefined;\n @Prop({ mutable: true, reflect: true }) uuid: string;\n @Prop() filterItems: MultiFilterItem = {};\n @Prop() filterTypes: Record<string, string[]> = {};\n @Prop() filterNames: Record<string, string> = {};\n @Prop() filterEntities: Record<string, LogicFunction> = {};\n @Prop() filterCaptions: FilterCaptions | undefined;\n @Prop() disableDynamicFiltering = false;\n @Event() filterChange: EventEmitter<MultiFilterItem>;\n @Listen('mousedown', { target: 'document' }) onMouseDown(e: MouseEvent) {\n if (this.changes && !e.defaultPrevented) {\n const el = e.target as HTMLElement;\n if (this.isOutside(el) && !isFilterBtn(el)) {\n this.changes = undefined;\n }\n }\n }\n @Method() async show(newEntity?: ShowData) {\n this.changes = newEntity;\n if (this.changes) {\n this.changes.type = this.changes.type || defaultType;\n }\n }\n\n @Method() async getChanges() {\n return this.changes;\n }\n\n componentWillRender() {\n if (!this.isFilterIdSet) {\n this.isFilterIdSet = true;\n const filterItems = Object.keys(this.filterItems);\n for (const prop of filterItems) {\n // we set the proper filterId so there won't be any conflict when removing filters\n this.filterId += this.filterItems[prop].length;\n }\n }\n }\n\n renderSelectOptions(type: FilterType, isDefaultTypeRemoved = false) {\n const options: VNode[] = [];\n const prop = this.changes?.prop;\n\n if (!isDefaultTypeRemoved) {\n const capts = Object.assign(this.filterCaptionsInternal, this.filterCaptions);\n\n options.push(\n <option selected={this.currentFilterType === defaultType} value={defaultType}>\n {prop && this.filterItems[prop] && this.filterItems[prop].length > 0 ? capts.add : this.filterNames[defaultType]}\n </option>,\n );\n }\n\n for (let gIndex in this.filterTypes) {\n options.push(\n ...this.filterTypes[gIndex].map(k => (\n <option value={k} selected={type === k}>\n {this.filterNames[k]}\n </option>\n )),\n );\n options.push(<option disabled></option>);\n }\n return options;\n }\n\n renderExtra(prop: ColumnProp, index: number) {\n const currentFilter = this.filterItems[prop];\n\n if (!currentFilter) return '';\n\n if (this.filterEntities[currentFilter[index].type].extra !== 'input') return '';\n\n const capts = Object.assign(this.filterCaptionsInternal, this.filterCaptions);\n\n return (\n <input\n id={`filter-input-${currentFilter[index].id}`}\n placeholder={capts.placeholder}\n type=\"text\"\n value={currentFilter[index].value}\n onInput={this.onUserInput.bind(this, index, prop)}\n onKeyDown={e => this.onKeyDown(e)}\n />\n );\n }\n\n getFilterItemsList() {\n const prop = this.changes?.prop;\n if (!(prop || prop === 0)) return '';\n\n const propFilters = this.filterItems[prop] || [];\n const capts = Object.assign(this.filterCaptionsInternal, this.filterCaptions);\n return (\n <div key={this.filterId}>\n {propFilters.map((d, index) => {\n let andOrButton;\n\n // hide toggle button if there is only one filter and the last one\n if (index !== this.filterItems[prop].length - 1) {\n andOrButton = (\n <div onClick={() => this.toggleFilterAndOr(d.id)}>\n <AndOrButton text={d.relation === 'and' ? capts.and : capts.or} />\n </div>\n );\n }\n\n return (\n <div key={d.id} class={FILTER_LIST_CLASS}>\n <div class={{ 'select-input': true }}>\n <select class=\"select-css select-filter\" onChange={e => this.onFilterTypeChange(e, prop, index)}>\n {this.renderSelectOptions(this.filterItems[prop][index].type, true)}\n </select>\n <div class={FILTER_LIST_CLASS_ACTION}>{andOrButton}</div>\n <div onClick={() => this.onRemoveFilter(d.id)}>\n <TrashButton />\n </div>\n </div>\n <div>{this.renderExtra(prop, index)}</div>\n </div>\n );\n })}\n\n {propFilters.length > 0 ? <div class=\"add-filter-divider\"/> : ''}\n </div>\n );\n }\n\n private autoCorrect(el?: HTMLElement | null) {\n if (!el) {\n return;\n }\n const pos = el.getBoundingClientRect();\n const maxLeft = window.innerWidth - pos.width;\n\n if (pos.left > maxLeft && el.offsetLeft) {\n el.style.left = `${maxLeft - (el.parentElement?.getBoundingClientRect().left ?? 0)}px`;\n }\n }\n \n render() {\n if (!this.changes) {\n return <Host style={{ display: 'none' }}></Host>;\n }\n const style = {\n display: 'block',\n left: `${this.changes.x}px`,\n top: `${this.changes.y}px`,\n };\n\n const capts = Object.assign(this.filterCaptionsInternal, this.filterCaptions);\n\n return (\n <Host style={style} ref={(el) => { this.changes?.autoCorrect && this.autoCorrect(el) }}>\n <label>{capts.title}</label>\n <div class=\"filter-holder\">{this.getFilterItemsList()}</div>\n\n <div class=\"add-filter\">\n <select id=\"add-filter\" class=\"select-css\" onChange={e => this.onAddNewFilter(e)}>\n {this.renderSelectOptions(this.currentFilterType)}\n </select>\n </div>\n <div class=\"filter-actions\">\n {this.disableDynamicFiltering &&\n <button id=\"revo-button-save\" aria-label=\"save\" class=\"revo-button green\" onClick={() => this.onSave()}>\n {capts.save}\n </button>\n }\n <button id=\"revo-button-reset\" aria-label=\"reset\" class=\"revo-button light\" onClick={() => this.onReset()}>\n {capts.reset}\n </button>\n <button id=\"revo-button-cancel\" aria-label=\"cancel\" class=\"revo-button light\" onClick={() => this.onCancel()}>\n {capts.cancel}\n </button>\n </div>\n </Host>\n );\n }\n\n private onFilterTypeChange(e: Event, prop: ColumnProp, index: number) {\n const el = e.target as HTMLSelectElement;\n this.filterItems[prop][index].type = el.value as FilterType;\n\n // this re-renders the input to know if we need extra input\n this.filterId++;\n\n // adding setTimeout will wait for the next tick DOM update then focus on input\n setTimeout(() => {\n const input = document.getElementById('filter-input-' + this.filterItems[prop][index].id) as HTMLInputElement;\n if (input) input.focus();\n }, 0);\n\n if (!this.disableDynamicFiltering) this.debouncedApplyFilter();\n }\n\n private debouncedApplyFilter = debounce(() => {\n this.filterChange.emit(this.filterItems);\n }, 400);\n\n private onAddNewFilter(e: Event) {\n const el = e.target as HTMLSelectElement;\n this.currentFilterType = el.value as FilterType;\n this.addNewFilterToProp();\n\n // reset value after adding new filter\n const select = document.getElementById('add-filter') as HTMLSelectElement;\n if (select) {\n select.value = defaultType;\n this.currentFilterType = defaultType;\n }\n\n if (!this.disableDynamicFiltering) this.debouncedApplyFilter();\n }\n\n private addNewFilterToProp() {\n const prop = this.changes?.prop;\n if (!(prop || prop === 0)) return;\n\n if (!this.filterItems[prop]) {\n this.filterItems[prop] = [];\n }\n\n if (this.currentFilterType === 'none') return;\n\n this.filterId++;\n this.currentFilterId = this.filterId;\n\n this.filterItems[prop].push({\n id: this.currentFilterId,\n type: this.currentFilterType,\n value: '',\n relation: 'and',\n });\n\n // adding setTimeout will wait for the next tick DOM update then focus on input\n setTimeout(() => {\n const input = document.getElementById('filter-input-' + this.currentFilterId) as HTMLInputElement;\n if (input) input.focus();\n }, 0);\n }\n\n private onUserInput(index: number, prop: ColumnProp, event: Event) {\n // update the value of the filter item\n this.filterItems[prop][index].value = (event.target as HTMLInputElement).value;\n\n if (!this.disableDynamicFiltering) this.debouncedApplyFilter();\n }\n\n private onKeyDown(e: KeyboardEvent) {\n if (e.key.toLowerCase() === 'enter') {\n const select = document.getElementById('add-filter') as HTMLSelectElement;\n if (select) {\n select.value = defaultType;\n this.currentFilterType = defaultType;\n this.addNewFilterToProp();\n select.focus();\n }\n return;\n }\n // keep event local, don't escalate farther to dom\n e.stopPropagation();\n }\n\n private onSave() {\n this.filterChange.emit(this.filterItems);\n }\n\n private onCancel() {\n this.changes = undefined;\n }\n\n private onReset() {\n this.assertChanges();\n\n delete this.filterItems[this.changes?.prop ?? ''];\n\n // this updates the DOM which is used by getFilterItemsList() key\n this.filterId++;\n\n this.filterChange.emit(this.filterItems);\n }\n\n private onRemoveFilter(id: number) {\n this.assertChanges();\n\n // this is for reactivity issues for getFilterItemsList()\n this.filterId++;\n\n const prop = this.changes?.prop;\n\n const items = this.filterItems[prop ?? ''];\n if (!items) return;\n\n const index = items.findIndex(d => d.id === id);\n if (index === -1) return;\n items.splice(index, 1);\n\n // let's remove the prop if no more filters so the filter icon will be removed\n if (items.length === 0) delete this.filterItems[prop ?? ''];\n\n if (!this.disableDynamicFiltering) this.debouncedApplyFilter();\n }\n\n private toggleFilterAndOr(id: number) {\n this.assertChanges();\n\n // this is for reactivity issues for getFilterItemsList()\n this.filterId++;\n\n const prop = this.changes?.prop;\n\n const items = this.filterItems[prop ?? ''];\n if (!items) return;\n\n const index = items.findIndex(d => d.id === id);\n if (index === -1) return;\n\n items[index].relation = items[index].relation === 'and' ? 'or' : 'and';\n if (!this.disableDynamicFiltering) this.debouncedApplyFilter();\n }\n\n private assertChanges() {\n if (!this.changes) {\n throw new Error('Changes required per edit');\n }\n }\n\n private isOutside(e: HTMLElement | null) {\n const select = document.getElementById('add-filter') as HTMLSelectElement;\n if (select) select.value = defaultType;\n\n this.currentFilterType = defaultType;\n if (this.changes) {\n this.changes.type = defaultType;\n }\n this.currentFilterId = -1;\n if (e?.classList.contains(`[uuid=\"${this.uuid}\"]`)) {\n return false;\n }\n return !e?.closest(`[uuid=\"${this.uuid}\"]`);\n }\n}\n"],"version":3}
|
|
1
|
+
{"file":"revogr-filter-panel.entry.js","mappings":";;;;;;;;AAAA,CAAC,SAAS,OAAO;IACf,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,OAAO,EAAE;QAC9B,OAAO,CAAC,SAAS,CAAC,O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closest.polifill.ts","src/plugins/filter/filter.style.scss?tag=revogr-filter-panel","src/plugins/filter/filter.panel.tsx"],"sourcesContent":["(function closest() {\n if (!Element.prototype.matches) {\n Element.prototype.matches =\n ((Element.prototype as unknown) as { msMatchesSelector: (selectors: string) => boolean }).msMatchesSelector || Element.prototype.webkitMatchesSelector;\n }\n\n if (!Element.prototype.closest) {\n Element.prototype.closest = function (s: string) {\n let el: HTMLElement | Element | (Node & ParentNode) = this;\n\n do {\n if (Element.prototype.matches.call(el, s)) {\n return el;\n }\n el = el.parentElement || el.parentNode;\n } while (el !== null && el.nodeType === 1);\n return null;\n };\n }\n})();\n","revogr-filter-panel {\n position: absolute;\n display: block;\n top: 0;\n left: 0;\n z-index: 100;\n\n opacity: 1;\n transform: none;\n background-color: #fff;\n transform-origin: 62px 0px;\n box-shadow: 0 5px 18px -2px rgba(black, 20%);\n padding: 10px;\n border-radius: 4px;\n\n min-width: 220px;\n text-align: left;\n\n .filter-holder > div {\n display: flex;\n flex-direction: column;\n }\n\n label {\n font-size: 13px;\n display: block;\n padding: 8px 0;\n }\n\n select {\n width: 100%;\n }\n\n input[type='text'] {\n border: 0;\n min-height: 34px;\n margin: 5px 0;\n background: #f3f3f3;\n border-radius: 5px;\n padding: 0 10px;\n box-sizing: border-box;\n width: 100%;\n }\n\n button {\n margin-top: 10px;\n margin-right: 5px;\n }\n\n .filter-actions {\n text-align: right;\n margin-right: -5px;\n }\n}\n\n.rgHeaderCell {\n &:hover .rv-filter {\n transition:\n opacity 267ms cubic-bezier(0.4, 0, 0.2, 1) 0ms,\n transform 178ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;\n }\n &:hover .rv-filter,\n .rv-filter.active {\n opacity: 1;\n }\n\n .rv-filter {\n $btn-size: 24px;\n height: $btn-size;\n width: $btn-size;\n background: none;\n border: 0;\n opacity: 0;\n visibility: visible;\n cursor: pointer;\n border-radius: 4px;\n\n &.active {\n color: #10224a;\n }\n\n .filter-img {\n $img-size: 11px;\n color: gray;\n width: $img-size;\n }\n }\n}\n\n.select-css {\n $gradient: 'data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23007CB2%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E';\n $linearGradient: linear-gradient(to bottom, #ffffff 0%, #ffffff 100%);\n $borderColor: #f1f1f1;\n\n display: block;\n font-family: sans-serif;\n font-weight: 600;\n color: #444;\n line-height: 1.3;\n padding: 0.6em 1.4em 0.5em 0.8em;\n width: 100%;\n max-width: 100%; /* useful when width is set to anything other than 100% */\n box-sizing: border-box;\n margin: 0;\n border: 1px solid $borderColor;\n box-shadow: transparent;\n border-radius: 0.5em;\n appearance: none;\n background-color: #fff;\n background-image: url($gradient), $linearGradient;\n background-repeat: no-repeat, repeat;\n /* arrow icon position (1em from the right, 50% vertical) , then gradient position*/\n background-position:\n right 0.7em top 50%,\n 0 0;\n /* icon size, then gradient */\n background-size:\n 0.65em auto,\n 100%;\n\n /* Hide arrow icon in IE browsers */\n &::-ms-expand {\n display: none;\n }\n /* Hover style */\n &:hover {\n border-color: rgb(197, 197, 197);\n }\n /* Focus style */\n &:focus {\n border-color: $borderColor;\n box-shadow: 0 0 1px 3px rgba(59, 153, 252, 0.7);\n box-shadow: 0 0 0 3px -moz-mac-focusring;\n color: #222;\n outline: none;\n }\n\n /* Set options to normal weight */\n option {\n font-weight: normal;\n }\n\n /* Disabled styles */\n &:disabled,\n &[aria-disabled='true'] {\n color: gray;\n background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22graytext%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E'),\n linear-gradient(to bottom, #ffffff 0%, #ffffff 100%);\n }\n\n &:disabled:hover,\n &[aria-disabled='true'] {\n border-color: $borderColor;\n }\n}\n\n.multi-filter-list {\n margin-top: 5px;\n margin-bottom: 5px;\n\n div {\n white-space: nowrap;\n }\n\n .multi-filter-list-action {\n display: flex;\n\n justify-content: space-between;\n align-items: center;\n }\n\n .and-or-button {\n margin: 0 0 0 10px;\n min-width: 58px;\n cursor: pointer;\n }\n .trash-button {\n $btn-remove-size: 22px;\n margin: 0 0 -2px 6px;\n cursor: pointer;\n\n width: $btn-remove-size;\n height: 100%;\n font-size: 16px;\n\n .trash-img {\n width: 1em;\n }\n }\n}\n\n.add-filter-divider {\n display: block;\n margin: 0 -10px 10px -10px;\n\n border-bottom: 1px solid #d9d9d9;\n height: 10px;\n}\n\n.select-input {\n display: flex;\n justify-content: space-between;\n align-items: center;\n}\n","import { Component, Event, EventEmitter, h, Host, Listen, Method, Prop, State, VNode, Element } from '@stencil/core';\nimport { FilterType } from './filter.service';\nimport { AndOrButton, isFilterBtn, TrashButton } from './filter.button';\nimport '../../utils/closest.polifill';\nimport { LogicFunction } from './filter.types';\nimport { FilterCaptions } from './filter.plugin';\nimport debounce from 'lodash/debounce';\nimport { ColumnProp } from '@type';\n\nexport type FilterItem = {\n // column id\n prop?: ColumnProp;\n // filter type definition\n type?: FilterType;\n // value for additional filtering, text value or some id\n value?: any;\n};\n\nexport type FilterData = {\n id: number;\n type: FilterType;\n value?: any;\n relation: 'and' | 'or';\n};\n\nexport type MultiFilterItem = {\n [prop: string]: FilterData[];\n};\n\nexport type ShowData = {\n x: number;\n y: number;\n /**\n * Auto correct position if it is out of document bounds\n */\n autoCorrect?: boolean;\n} & FilterItem;\n\nconst defaultType: FilterType = 'none';\n\nconst FILTER_LIST_CLASS = 'multi-filter-list';\nconst FILTER_LIST_CLASS_ACTION = 'multi-filter-list-action';\n\n/**\n * Filter panel for editing filters\n */\n/**\n * @internal\n */\n@Component({\n tag: 'revogr-filter-panel',\n styleUrl: 'filter.style.scss',\n})\nexport class FilterPanel {\n private filterCaptionsInternal: FilterCaptions = {\n title: 'Filter by',\n save: 'Save',\n // drops the filter\n reset: 'Clear changes',\n cancel: 'Close',\n add: 'Add more condition...',\n placeholder: 'Enter value...',\n and: 'and',\n or: 'or',\n };\n\n @Element() element!: HTMLElement;\n @State() isFilterIdSet = false;\n @State() filterId = 0;\n @State() currentFilterId = -1;\n @State() currentFilterType: FilterType = defaultType;\n @State() changes: ShowData | undefined;\n @Prop() filterItems: MultiFilterItem = {};\n @Prop() filterTypes: Record<string, string[]> = {};\n @Prop() filterNames: Record<string, string> = {};\n @Prop() filterEntities: Record<string, LogicFunction> = {};\n @Prop() filterCaptions: FilterCaptions | undefined;\n @Prop() disableDynamicFiltering = false;\n @Event() filterChange: EventEmitter<MultiFilterItem>;\n @Listen('mousedown', { target: 'document' }) onMouseDown(e: MouseEvent) {\n if (this.changes && !e.defaultPrevented) {\n const el = e.target as HTMLElement;\n\n const select = document.getElementById('add-filter') as HTMLSelectElement;\n if (select) {\n select.value = defaultType;\n }\n this.currentFilterType = defaultType;\n if (this.changes) {\n this.changes.type = defaultType;\n }\n this.currentFilterId = -1;\n\n const path = e.composedPath();\n const isOutside = !path.includes(this.element);\n\n if (isOutside && !isFilterBtn(el)) {\n this.changes = undefined;\n }\n }\n }\n\n @Method() async show(newEntity?: ShowData) {\n this.changes = newEntity;\n if (this.changes) {\n this.changes.type = this.changes.type || defaultType;\n }\n }\n\n @Method() async getChanges() {\n return this.changes;\n }\n\n componentWillRender() {\n if (!this.isFilterIdSet) {\n this.isFilterIdSet = true;\n const filterItems = Object.keys(this.filterItems);\n for (const prop of filterItems) {\n // we set the proper filterId so there won't be any conflict when removing filters\n this.filterId += this.filterItems[prop].length;\n }\n }\n }\n\n renderSelectOptions(type: FilterType, isDefaultTypeRemoved = false) {\n const options: VNode[] = [];\n const prop = this.changes?.prop;\n\n if (!isDefaultTypeRemoved) {\n const capts = Object.assign(this.filterCaptionsInternal, this.filterCaptions);\n\n options.push(\n <option selected={this.currentFilterType === defaultType} value={defaultType}>\n {prop && this.filterItems[prop] && this.filterItems[prop].length > 0 ? capts.add : this.filterNames[defaultType]}\n </option>,\n );\n }\n\n for (let gIndex in this.filterTypes) {\n options.push(\n ...this.filterTypes[gIndex].map(k => (\n <option value={k} selected={type === k}>\n {this.filterNames[k]}\n </option>\n )),\n );\n options.push(<option disabled></option>);\n }\n return options;\n }\n\n renderExtra(prop: ColumnProp, index: number) {\n const currentFilter = this.filterItems[prop];\n\n if (!currentFilter) return '';\n\n if (this.filterEntities[currentFilter[index].type].extra !== 'input') return '';\n\n const capts = Object.assign(this.filterCaptionsInternal, this.filterCaptions);\n\n return (\n <input\n id={`filter-input-${currentFilter[index].id}`}\n placeholder={capts.placeholder}\n type=\"text\"\n value={currentFilter[index].value}\n onInput={this.onUserInput.bind(this, index, prop)}\n onKeyDown={e => this.onKeyDown(e)}\n />\n );\n }\n\n getFilterItemsList() {\n const prop = this.changes?.prop;\n if (!(prop || prop === 0)) return '';\n\n const propFilters = this.filterItems[prop] || [];\n const capts = Object.assign(this.filterCaptionsInternal, this.filterCaptions);\n return (\n <div key={this.filterId}>\n {propFilters.map((d, index) => {\n let andOrButton;\n\n // hide toggle button if there is only one filter and the last one\n if (index !== this.filterItems[prop].length - 1) {\n andOrButton = (\n <div onClick={() => this.toggleFilterAndOr(d.id)}>\n <AndOrButton text={d.relation === 'and' ? capts.and : capts.or} />\n </div>\n );\n }\n\n return (\n <div key={d.id} class={FILTER_LIST_CLASS}>\n <div class={{ 'select-input': true }}>\n <select class=\"select-css select-filter\" onChange={e => this.onFilterTypeChange(e, prop, index)}>\n {this.renderSelectOptions(this.filterItems[prop][index].type, true)}\n </select>\n <div class={FILTER_LIST_CLASS_ACTION}>{andOrButton}</div>\n <div onClick={() => this.onRemoveFilter(d.id)}>\n <TrashButton />\n </div>\n </div>\n <div>{this.renderExtra(prop, index)}</div>\n </div>\n );\n })}\n\n {propFilters.length > 0 ? <div class=\"add-filter-divider\"/> : ''}\n </div>\n );\n }\n\n private autoCorrect(el?: HTMLElement | null) {\n if (!el) {\n return;\n }\n const pos = el.getBoundingClientRect();\n const maxLeft = window.innerWidth - pos.width;\n\n if (pos.left > maxLeft && el.offsetLeft) {\n el.style.left = `${maxLeft - (el.parentElement?.getBoundingClientRect().left ?? 0)}px`;\n }\n }\n \n render() {\n if (!this.changes) {\n return <Host style={{ display: 'none' }}></Host>;\n }\n const style = {\n display: 'block',\n left: `${this.changes.x}px`,\n top: `${this.changes.y}px`,\n };\n\n const capts = Object.assign(this.filterCaptionsInternal, this.filterCaptions);\n\n return (\n <Host style={style} ref={(el) => { this.changes?.autoCorrect && this.autoCorrect(el) }}>\n <label>{capts.title}</label>\n <div class=\"filter-holder\">{this.getFilterItemsList()}</div>\n\n <div class=\"add-filter\">\n <select id=\"add-filter\" class=\"select-css\" onChange={e => this.onAddNewFilter(e)}>\n {this.renderSelectOptions(this.currentFilterType)}\n </select>\n </div>\n <div class=\"filter-actions\">\n {this.disableDynamicFiltering &&\n <button id=\"revo-button-save\" aria-label=\"save\" class=\"revo-button green\" onClick={() => this.onSave()}>\n {capts.save}\n </button>\n }\n <button id=\"revo-button-reset\" aria-label=\"reset\" class=\"revo-button light\" onClick={() => this.onReset()}>\n {capts.reset}\n </button>\n <button id=\"revo-button-cancel\" aria-label=\"cancel\" class=\"revo-button light\" onClick={() => this.onCancel()}>\n {capts.cancel}\n </button>\n </div>\n </Host>\n );\n }\n\n private onFilterTypeChange(e: Event, prop: ColumnProp, index: number) {\n const el = e.target as HTMLSelectElement;\n this.filterItems[prop][index].type = el.value as FilterType;\n\n // this re-renders the input to know if we need extra input\n this.filterId++;\n\n // adding setTimeout will wait for the next tick DOM update then focus on input\n setTimeout(() => {\n const input = document.getElementById('filter-input-' + this.filterItems[prop][index].id) as HTMLInputElement;\n if (input) input.focus();\n }, 0);\n\n if (!this.disableDynamicFiltering) this.debouncedApplyFilter();\n }\n\n private debouncedApplyFilter = debounce(() => {\n this.filterChange.emit(this.filterItems);\n }, 400);\n\n private onAddNewFilter(e: Event) {\n const el = e.target as HTMLSelectElement;\n this.currentFilterType = el.value as FilterType;\n this.addNewFilterToProp();\n\n // reset value after adding new filter\n const select = document.getElementById('add-filter') as HTMLSelectElement;\n if (select) {\n select.value = defaultType;\n this.currentFilterType = defaultType;\n }\n\n if (!this.disableDynamicFiltering) this.debouncedApplyFilter();\n }\n\n private addNewFilterToProp() {\n const prop = this.changes?.prop;\n if (!(prop || prop === 0)) return;\n\n if (!this.filterItems[prop]) {\n this.filterItems[prop] = [];\n }\n\n if (this.currentFilterType === 'none') return;\n\n this.filterId++;\n this.currentFilterId = this.filterId;\n\n this.filterItems[prop].push({\n id: this.currentFilterId,\n type: this.currentFilterType,\n value: '',\n relation: 'and',\n });\n\n // adding setTimeout will wait for the next tick DOM update then focus on input\n setTimeout(() => {\n const input = document.getElementById('filter-input-' + this.currentFilterId) as HTMLInputElement;\n if (input) input.focus();\n }, 0);\n }\n\n private onUserInput(index: number, prop: ColumnProp, event: Event) {\n // update the value of the filter item\n this.filterItems[prop][index].value = (event.target as HTMLInputElement).value;\n\n if (!this.disableDynamicFiltering) this.debouncedApplyFilter();\n }\n\n private onKeyDown(e: KeyboardEvent) {\n if (e.key.toLowerCase() === 'enter') {\n const select = document.getElementById('add-filter') as HTMLSelectElement;\n if (select) {\n select.value = defaultType;\n this.currentFilterType = defaultType;\n this.addNewFilterToProp();\n select.focus();\n }\n return;\n }\n // keep event local, don't escalate farther to dom\n e.stopPropagation();\n }\n\n private onSave() {\n this.filterChange.emit(this.filterItems);\n }\n\n private onCancel() {\n this.changes = undefined;\n }\n\n private onReset() {\n this.assertChanges();\n\n delete this.filterItems[this.changes?.prop ?? ''];\n\n // this updates the DOM which is used by getFilterItemsList() key\n this.filterId++;\n\n this.filterChange.emit(this.filterItems);\n }\n\n private onRemoveFilter(id: number) {\n this.assertChanges();\n\n // this is for reactivity issues for getFilterItemsList()\n this.filterId++;\n\n const prop = this.changes?.prop;\n\n const items = this.filterItems[prop ?? ''];\n if (!items) return;\n\n const index = items.findIndex(d => d.id === id);\n if (index === -1) return;\n items.splice(index, 1);\n\n // let's remove the prop if no more filters so the filter icon will be removed\n if (items.length === 0) delete this.filterItems[prop ?? ''];\n\n if (!this.disableDynamicFiltering) this.debouncedApplyFilter();\n }\n\n private toggleFilterAndOr(id: number) {\n this.assertChanges();\n\n // this is for reactivity issues for getFilterItemsList()\n this.filterId++;\n\n const prop = this.changes?.prop;\n\n const items = this.filterItems[prop ?? ''];\n if (!items) return;\n\n const index = items.findIndex(d => d.id === id);\n if (index === -1) return;\n\n items[index].relation = items[index].relation === 'and' ? 'or' : 'and';\n if (!this.disableDynamicFiltering) this.debouncedApplyFilter();\n }\n\n private assertChanges() {\n if (!this.changes) {\n throw new Error('Changes required per edit');\n }\n }\n}\n"],"version":3}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Built by Revolist OU ❤️
|
|
3
3
|
*/
|
|
4
|
-
import { s as scaleValue } from './index-
|
|
4
|
+
import { s as scaleValue } from './index-4e881436.js';
|
|
5
5
|
import { d as debounce_1 } from './debounce-7781346d.js';
|
|
6
6
|
import { i as isObject_1 } from './toNumber-8de324a7.js';
|
|
7
7
|
|
|
@@ -232,4 +232,4 @@ var throttle_1 = throttle;
|
|
|
232
232
|
|
|
233
233
|
export { LocalScrollTimer as L, LocalScrollService as a, getContentSize as g, throttle_1 as t };
|
|
234
234
|
|
|
235
|
-
//# sourceMappingURL=throttle-
|
|
235
|
+
//# sourceMappingURL=throttle-1b1dd9d2.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"throttle-eeca0062.js","mappings":";;;;;;;AAqBA,MAAM,aAAa,GAAW;IAC5B,WAAW,EAAE,CAAC;IACd,UAAU,EAAE,CAAC;IACb,WAAW,EAAE,CAAC;IACd,OAAO,EAAE,CAAC;CACX,CAAC;AACF,MAAM,aAAa,GAAG,CAAC,CAAC,CAAC;AAEzB;;;;SAIgB,cAAc,CAC5B,WAAmB,EACnB,UAAkB,EAClB,WAAW,GAAG,CAAC;IAEf,OAAO,WAAW,IAAI,WAAW,GAAG,UAAU,GAAG,WAAW,GAAG,CAAC,CAAC,CAAC;AACpE,CAAC;MAEoB,kBAAkB;IAerC,YAAoB,GAAW;QAAX,QAAG,GAAH,GAAG,CAAQ;QAdvB,4BAAuB,GAA6C;YAC1E,KAAK,EAAE,IAAI;YACX,KAAK,EAAE,IAAI;SACZ,CAAC;;QAEM,mBAAc,GAAkC;YACtD,KAAK,EAAE,aAAa;YACpB,KAAK,EAAE,aAAa;SACrB,CAAC;QACM,WAAM,GAAkC;YAC9C,KAAK,oBAAO,aAAa,CAAE;YAC3B,KAAK,oBAAO,aAAa,CAAE;SAC5B,CAAC;KAEiC;IAEnC,SAAS,CAAC,MAAc,EAAE,SAAwB;QAChD,MAAM,kBAAkB,GAAG,cAAc,CACvC,MAAM,CAAC,WAAW,EAClB,MAAM,CAAC,UAAU,EACjB,MAAM,CAAC,WAAW,CACnB,CAAC;QACF,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,mCACjB,MAAM,KACT,OAAO,EAAE,kBAAkB,GAAG,MAAM,CAAC,UAAU,EAC/C,kBAAkB,GACnB,CAAC;KACH;;IAGD,M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ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,QAAQ,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE;AACvC,EAAE,IAAI,OAAO,GAAG,IAAI;AACpB,MAAM,QAAQ,GAAG,IAAI,CAAC;AACtB;AACA,EAAE,IAAI,OAAO,IAAI,IAAI,UAAU,EAAE;AACjC,IAAI,MAAM,IAAI,SAAS,CAAC,eAAe,CAAC,CAAC;AACzC,GAAG;AACH,EAAE,IAAI,QAAQ,CAAC,OAAO,CAAC,EAAE;AACzB,IAAI,OAAO,GAAG,SAAS,IAAI,OAAO,GAAG,CAAC,CAAC,OAAO,CAAC,OAAO,GAAG,OAAO,CAAC;AACjE,IAAI,QAAQ,GAAG,UAAU,IAAI,OAAO,GAAG,CAAC,CAAC,OAAO,CAAC,QAAQ,GAAG,QAAQ,CAAC;AACrE,GAAG;AACH,EAAE,OAAO,QAAQ,CAAC,IAAI,EAAE,IAAI,EAAE;AAC9B,IAAI,SAAS,EAAE,OAAO;AACtB,IAAI,SAAS,EAAE,IAAI;AACnB,IAAI,UAAU,EAAE,QAAQ;AACxB,GAAG,CAAC,CAAC;AACL,CAAC;AACD;IACA,UAAc,GAAG;;;;","names":["require$$0","require$$1"],"sources":["src/services/local.scroll.service.ts","src/services/local.scroll.timer.ts","node_modules/lodash/throttle.js"],"sourcesContent":["import type { DimensionType, ViewPortScrollEvent } from '@type';\nimport { scaleValue } from '../utils';\n\ninterface Config {\n skipAnimationFrame?: boolean;\n // scroll event inited and direction cached\n // scrollingService.proxyScroll get tiggered\n // setScroll event called from scrollingService\n runScroll(e: ViewPortScrollEvent): void;\n // all operation finished, apply scroll values\n applyScroll(e: 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;\n\n/**\n * Based on content size, client size and virtual size\n * return full size\n */\nexport function getContentSize(\n contentSize: number,\n clientSize: number,\n virtualSize = 0,\n): number {\n return contentSize + (virtualSize ? clientSize - virtualSize : 0);\n}\n\nexport default class LocalScrollService {\n private preventArtificialScroll: Record<DimensionType, () => void | null> = {\n rgRow: null,\n rgCol: null,\n };\n // to check if scroll changed\n private previousScroll: Record<DimensionType, number> = {\n rgRow: NO_COORDINATE,\n rgCol: NO_COORDINATE,\n };\n private params: Record<DimensionType, Params> = {\n rgRow: { ...initialParams },\n rgCol: { ...initialParams },\n };\n\n constructor(private cfg: Config) {}\n\n setParams(params: Params, dimension: DimensionType) {\n const virtualContentSize = getContentSize(\n params.contentSize,\n params.clientSize,\n params.virtualSize,\n );\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: ViewPortScrollEvent) {\n this.cancelScroll(e.dimension);\n\n // start frame animation\n const frameAnimation = new Promise<void>((resolve, reject) => {\n // for example safari desktop has issues with animation frame\n if (this.cfg.skipAnimationFrame) {\n return resolve();\n }\n const animationId = window.requestAnimationFrame(() => {\n resolve();\n });\n this.preventArtificialScroll[e.dimension] = reject.bind(\n null,\n animationId,\n );\n });\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(\n e.coordinate,\n params,\n );\n this.preventArtificialScroll[e.dimension] = null;\n this.cfg.applyScroll({\n ...e,\n coordinate: params.virtualSize\n ? this.convert(e.coordinate, params, false)\n : e.coordinate,\n });\n } catch (id) {\n window.cancelAnimationFrame(id);\n }\n }\n\n /**\n * On scroll event started\n */\n scroll(\n coordinate: number,\n dimension: DimensionType,\n force = false,\n delta?: number,\n outside = false,\n ) {\n // cancel all previous scrolls for same dimension\n this.cancelScroll(dimension);\n\n // drop if no change\n if (!force && this.previousScroll[dimension] === coordinate) {\n this.previousScroll[dimension] = NO_COORDINATE;\n return;\n }\n\n const param = this.getParams(dimension);\n // let component know about scroll event started\n this.cfg.runScroll({\n dimension: dimension,\n coordinate: param.virtualSize\n ? this.convert(coordinate, param)\n : coordinate,\n delta,\n outside,\n });\n }\n\n private getParams(dimension: 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: DimensionType) {\n this.preventArtificialScroll[dimension]?.();\n this.preventArtificialScroll[dimension] = null;\n }\n\n /* convert virtual to real and back, scale range */\n private convert(pos: number, param: Params, toReal = true): number {\n const minRange = 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","import type { DimensionType } from '@type';\n/**\n * Apply changes only if mousewheel event happened some time ago (scrollThrottling)\n */\nexport class LocalScrollTimer {\n /**\n * Last mw event time for trigger scroll function below\n * If mousewheel function was ignored we still need to trigger render\n */\n private mouseWheelScrollTimestamp: Record<DimensionType, number> = {\n rgCol: 0,\n rgRow: 0,\n };\n private lastKnownScrollCoordinate: Record<DimensionType, number> = {\n rgCol: 0,\n rgRow: 0,\n };\n\n constructor(private scrollThrottling = 10) {}\n\n setCoordinate(e: { dimension: DimensionType; coordinate: number }) {\n this.lastKnownScrollCoordinate[e.dimension] = e.coordinate;\n }\n\n /**\n * Remember last mw event time\n */\n latestScrollUpdate(dimension: DimensionType) {\n this.mouseWheelScrollTimestamp[dimension] = new Date().getTime();\n }\n\n /**\n * Check if scroll is ready to accept new value\n */\n isReady(type: DimensionType, coordinate: number) {\n const change = new Date().getTime() - this.mouseWheelScrollTimestamp[type];\n // apply after throttling\n return (\n change > this.scrollThrottling &&\n coordinate !== this.lastKnownScrollCoordinate[type]\n );\n }\n}\n","var debounce = require('./debounce'),\n isObject = require('./isObject');\n\n/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/**\n * Creates a throttled function that only invokes `func` at most once per\n * every `wait` milliseconds. The throttled function comes with a `cancel`\n * method to cancel delayed `func` invocations and a `flush` method to\n * immediately invoke them. Provide `options` to indicate whether `func`\n * should be invoked on the leading and/or trailing edge of the `wait`\n * timeout. The `func` is invoked with the last arguments provided to the\n * throttled function. Subsequent calls to the throttled function return the\n * result of the last `func` invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the throttled function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.throttle` and `_.debounce`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to throttle.\n * @param {number} [wait=0] The number of milliseconds to throttle invocations to.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=true]\n * Specify invoking on the leading edge of the timeout.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new throttled function.\n * @example\n *\n * // Avoid excessively updating the position while scrolling.\n * jQuery(window).on('scroll', _.throttle(updatePosition, 100));\n *\n * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.\n * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });\n * jQuery(element).on('click', throttled);\n *\n * // Cancel the trailing throttled invocation.\n * jQuery(window).on('popstate', throttled.cancel);\n */\nfunction throttle(func, wait, options) {\n var leading = true,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n if (isObject(options)) {\n leading = 'leading' in options ? !!options.leading : leading;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n return debounce(func, wait, {\n 'leading': leading,\n 'maxWait': wait,\n 'trailing': trailing\n });\n}\n\nmodule.exports = throttle;\n"],"version":3}
|
|
1
|
+
{"file":"throttle-1b1dd9d2.js","mappings":";;;;;;;AAqBA,MAAM,aAAa,GAAW;IAC5B,WAAW,EAAE,CAAC;IACd,UAAU,EAAE,CAAC;IACb,WAAW,EAAE,CAAC;IACd,OAAO,EAAE,CAAC;CACX,CAAC;AACF,MAAM,aAAa,GAAG,CAAC,CAAC,CAAC;AAEzB;;;;SAIgB,cAAc,CAC5B,WAAmB,EACnB,UAAkB,EAClB,WAAW,GAAG,CAAC;IAEf,OAAO,WAAW,IAAI,WAAW,GAAG,UAAU,GAAG,WAAW,GAAG,CAAC,CAAC,CAAC;AACpE,CAAC;MAEoB,kBAAkB;IAerC,YAAoB,GAAW;QAAX,QAAG,GAAH,GAAG,CAAQ;QAdvB,4BAAuB,GAA6C;YAC1E,KAAK,EAAE,IAAI;YACX,KAAK,EAAE,IAAI;SACZ,CAAC;;QAEM,mBAAc,GAAkC;YACtD,KAAK,EAAE,aAAa;YACpB,KAAK,EAAE,aAAa;SACrB,CAAC;QACM,WAAM,GAAkC;YAC9C,KAAK,oBAAO,aAAa,CAAE;YAC3B,KAAK,oBAAO,aAAa,CAAE;SAC5B,CAAC;KAEiC;IAEnC,SAAS,CAAC,MAAc,EAAE,SAAwB;QAChD,MAAM,kBAAkB,GAAG,cAAc,CACvC,MAAM,CAAC,WAAW,EAClB,MAAM,CAAC,UAAU,EACjB,MAAM,CAAC,WAAW,CACnB,CAAC;QACF,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,mCACjB,MAAM,KACT,OAAO,EAAE,kBAAkB,GAAG,MAAM,CAAC,UAAU,EAC/C,kBAAkB,GACnB,CAAC;KAC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AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,QAAQ,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE;AACvC,EAAE,IAAI,OAAO,GAAG,IAAI;AACpB,MAAM,QAAQ,GAAG,IAAI,CAAC;AACtB;AACA,EAAE,IAAI,OAAO,IAAI,IAAI,UAAU,EAAE;AACjC,IAAI,MAAM,IAAI,SAAS,CAAC,eAAe,CAAC,CAAC;AACzC,GAAG;AACH,EAAE,IAAI,QAAQ,CAAC,OAAO,CAAC,EAAE;AACzB,IAAI,OAAO,GAAG,SAAS,IAAI,OAAO,GAAG,CAAC,CAAC,OAAO,CAAC,OAAO,GAAG,OAAO,CAAC;AACjE,IAAI,QAAQ,GAAG,UAAU,IAAI,OAAO,GAAG,CAAC,CAAC,OAAO,CAAC,QAAQ,GAAG,QAAQ,CAAC;AACrE,GAAG;AACH,EAAE,OAAO,QAAQ,CAAC,IAAI,EAAE,IAAI,EAAE;AAC9B,IAAI,SAAS,EAAE,OAAO;AACtB,IAAI,SAAS,EAAE,IAAI;AACnB,IAAI,UAAU,EAAE,QAAQ;AACxB,GAAG,CAAC,CAAC;AACL,CAAC;AACD;IACA,UAAc,GAAG;;;;","names":["require$$0","require$$1"],"sources":["src/services/local.scroll.service.ts","src/services/local.scroll.timer.ts","node_modules/lodash/throttle.js"],"sourcesContent":["import type { DimensionType, ViewPortScrollEvent } from '@type';\nimport { scaleValue } from '../utils';\n\ninterface Config {\n skipAnimationFrame?: boolean;\n // scroll event inited and direction cached\n // scrollingService.proxyScroll get tiggered\n // setScroll event called from scrollingService\n runScroll(e: ViewPortScrollEvent): void;\n // all operation finished, apply scroll values\n applyScroll(e: 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;\n\n/**\n * Based on content size, client size and virtual size\n * return full size\n */\nexport function getContentSize(\n contentSize: number,\n clientSize: number,\n virtualSize = 0,\n): number {\n return contentSize + (virtualSize ? clientSize - virtualSize : 0);\n}\n\nexport default class LocalScrollService {\n private preventArtificialScroll: Record<DimensionType, () => void | null> = {\n rgRow: null,\n rgCol: null,\n };\n // to check if scroll changed\n private previousScroll: Record<DimensionType, number> = {\n rgRow: NO_COORDINATE,\n rgCol: NO_COORDINATE,\n };\n private params: Record<DimensionType, Params> = {\n rgRow: { ...initialParams },\n rgCol: { ...initialParams },\n };\n\n constructor(private cfg: Config) {}\n\n setParams(params: Params, dimension: DimensionType) {\n const virtualContentSize = getContentSize(\n params.contentSize,\n params.clientSize,\n params.virtualSize,\n );\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: ViewPortScrollEvent) {\n this.cancelScroll(e.dimension);\n\n // start frame animation\n const frameAnimation = new Promise<void>((resolve, reject) => {\n // for example safari desktop has issues with animation frame\n if (this.cfg.skipAnimationFrame) {\n return resolve();\n }\n const animationId = window.requestAnimationFrame(() => {\n resolve();\n });\n this.preventArtificialScroll[e.dimension] = reject.bind(\n null,\n animationId,\n );\n });\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(\n e.coordinate,\n params,\n );\n this.preventArtificialScroll[e.dimension] = null;\n this.cfg.applyScroll({\n ...e,\n coordinate: params.virtualSize\n ? this.convert(e.coordinate, params, false)\n : e.coordinate,\n });\n } catch (id) {\n window.cancelAnimationFrame(id);\n }\n }\n\n /**\n * On scroll event started\n */\n scroll(\n coordinate: number,\n dimension: DimensionType,\n force = false,\n delta?: number,\n outside = false,\n ) {\n // cancel all previous scrolls for same dimension\n this.cancelScroll(dimension);\n\n // drop if no change\n if (!force && this.previousScroll[dimension] === coordinate) {\n this.previousScroll[dimension] = NO_COORDINATE;\n return;\n }\n\n const param = this.getParams(dimension);\n // let component know about scroll event started\n this.cfg.runScroll({\n dimension: dimension,\n coordinate: param.virtualSize\n ? this.convert(coordinate, param)\n : coordinate,\n delta,\n outside,\n });\n }\n\n private getParams(dimension: 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: DimensionType) {\n this.preventArtificialScroll[dimension]?.();\n this.preventArtificialScroll[dimension] = null;\n }\n\n /* convert virtual to real and back, scale range */\n private convert(pos: number, param: Params, toReal = true): number {\n const minRange = 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","import type { DimensionType } from '@type';\n/**\n * Apply changes only if mousewheel event happened some time ago (scrollThrottling)\n */\nexport class LocalScrollTimer {\n /**\n * Last mw event time for trigger scroll function below\n * If mousewheel function was ignored we still need to trigger render\n */\n private mouseWheelScrollTimestamp: Record<DimensionType, number> = {\n rgCol: 0,\n rgRow: 0,\n };\n private lastKnownScrollCoordinate: Record<DimensionType, number> = {\n rgCol: 0,\n rgRow: 0,\n };\n\n constructor(private scrollThrottling = 10) {}\n\n setCoordinate(e: { dimension: DimensionType; coordinate: number }) {\n this.lastKnownScrollCoordinate[e.dimension] = e.coordinate;\n }\n\n /**\n * Remember last mw event time\n */\n latestScrollUpdate(dimension: DimensionType) {\n this.mouseWheelScrollTimestamp[dimension] = new Date().getTime();\n }\n\n /**\n * Check if scroll is ready to accept new value\n */\n isReady(type: DimensionType, coordinate: number) {\n const change = new Date().getTime() - this.mouseWheelScrollTimestamp[type];\n // apply after throttling\n return (\n change > this.scrollThrottling &&\n coordinate !== this.lastKnownScrollCoordinate[type]\n );\n }\n}\n","var debounce = require('./debounce'),\n isObject = require('./isObject');\n\n/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/**\n * Creates a throttled function that only invokes `func` at most once per\n * every `wait` milliseconds. The throttled function comes with a `cancel`\n * method to cancel delayed `func` invocations and a `flush` method to\n * immediately invoke them. Provide `options` to indicate whether `func`\n * should be invoked on the leading and/or trailing edge of the `wait`\n * timeout. The `func` is invoked with the last arguments provided to the\n * throttled function. Subsequent calls to the throttled function return the\n * result of the last `func` invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the throttled function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.throttle` and `_.debounce`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to throttle.\n * @param {number} [wait=0] The number of milliseconds to throttle invocations to.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=true]\n * Specify invoking on the leading edge of the timeout.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new throttled function.\n * @example\n *\n * // Avoid excessively updating the position while scrolling.\n * jQuery(window).on('scroll', _.throttle(updatePosition, 100));\n *\n * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.\n * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });\n * jQuery(element).on('click', throttled);\n *\n * // Cancel the trailing throttled invocation.\n * jQuery(window).on('popstate', throttled.cancel);\n */\nfunction throttle(func, wait, options) {\n var leading = true,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n if (isObject(options)) {\n leading = 'leading' in options ? !!options.leading : leading;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n return debounce(func, wait, {\n 'leading': leading,\n 'maxWait': wait,\n 'trailing': trailing\n });\n}\n\nmodule.exports = throttle;\n"],"version":3}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Built by Revolist OU ❤️
|
|
3
3
|
*/
|
|
4
|
-
import{C as t,B as n,a as e,b as o}from"./dimension.helpers-91398565.js";import"./toNumber-8de324a7.js";import"./index-a61f225b.js";import{g as s}from"./selection.helpers-50e9f09d.js";import{G as r,C as i,D as c}from"./index-
|
|
5
|
-
//# sourceMappingURL=column.service-
|
|
4
|
+
import{C as t,B as n,a as e,b as o}from"./dimension.helpers-91398565.js";import"./toNumber-8de324a7.js";import"./index-a61f225b.js";import{g as s}from"./selection.helpers-50e9f09d.js";import{G as r,C as i,D as c}from"./index-4e881436.js";const a=`${r}-depth`;const u=`${r}-name`;const f=`${r}-id`;const l=`${r}-value`;const d=`${r}-column`;const p=`${r}-expanded`;const h=`${r}-original-index`;const y=`group-expand`;const v=`groupexpandclick`;const g="rgRow";function m(t,n){return t[n]||null}function x(t,n,{prevExpanded:e,expandedAll:o,getGroupValue:s=m}){const r=new Map;t.forEach(((t,e)=>{const o=n.map((n=>s(t,n)));const i=o.pop();let c=r;o.forEach((t=>{if(!c.has(t)){c.set(t,new Map)}c=c.get(t)}));if(!c.has(i)){c.set(i,[])}const a=c.get(i);a.push(Object.assign(Object.assign({},t),{[h]:e}))}));let i=-1;const c=n.length;const d={};const y={};const v={};const g=[];function x(t,n,s){const r=n.length;t.forEach(((t,c)=>{const m=[...n,c];const j=m.join(",");const b=s&&(!!o||!!(e===null||e===void 0?void 0:e[j]));g.push({[u]:c,[a]:r,[f]:JSON.stringify(m),[l]:j,[p]:b});i+=1;if(!b&&r){d[i]=true}if(Array.isArray(t)){t.forEach((t=>{i+=1;if(!b){d[i]=true}y[t[h]]=i;const n=m.map(((t,n)=>m.slice(0,n+1).join(",")));n.forEach((t=>{if(!v[t]){v[t]=[]}v[t].push(i)}))}));g.push(...t)}else{x(t,m,b)}}))}x(r,[],true);return{sourceWithGroups:g,depth:c,trimmed:d,oldNewIndexMap:y,childrenByGroup:v}}function j(t){return t&&t[u]}function b(t){return t&&typeof t[u]!=="undefined"}function O(t){return t&&typeof t[d]!=="undefined"}function w(t,n){const e=t.length;let o=0;for(;o<e;o++){if(t[o]!==n[o]){return o}}return o}function I(t){const n=JSON.parse(t);if(!Array.isArray(n)){return null}return n}function C(t,n,e){const o=I(e[f]);if(!o){return false}const s=w(t,o);return n[a]<s}const D="header";const R="footer";const T="content";const $="data";function A(t,n){const e=t.viewports[t.colType].store.get("realCount");const o=t.viewports[n].store.get("realCount");return{x:e,y:o}}function G(t,n,e){var o=-1,s=t.length;if(n<0){n=-n>s?0:s+n}e=e>s?s:e;if(e<0){e+=s}s=n>e?0:e-n>>>0;n>>>=0;var r=Array(s);while(++o<s){r[o]=t[o+n]}return r}var M=G;var N=M,P=t,S=n;function k(t,n,e){var o=t==null?0:t.length;if(!o){return[]}if(e&&typeof e!="number"&&P(t,n,e)){n=0;e=o}else{n=n==null?0:S(n);e=e===undefined?o:S(e)}return N(t,n,e)}var B=k;class E{get columns(){return e(this.source)}constructor(t,n){this.dataStore=t;this.source=n;this.unsubscribe=[];this.hasGrouping=false;this.unsubscribe.push(n.onChange("source",(t=>this.checkGrouping(t))));this.checkGrouping(n.get("source"));this.type=n.get("type")}checkGrouping(t){for(let n of t){if(O(n)){this.hasGrouping=true;return}this.hasGrouping=false}}isReadOnly(t,n){var e;const o=(e=this.columns[n])===null||e===void 0?void 0:e.readonly;if(typeof o==="function"){const e=this.rowDataModel(t,n);return o(e)}return o}mergeProperties(t,n,e,o,s){const r={[i]:true,[c]:this.isReadOnly(t,n)};let a=Object.assign(Object.assign({},e),{class:r});const u=s===null||s===void 0?void 0:s(o);if(!u){return a}return F(a,u)}getRowClass(t,n){const e=o(this.dataStore,t)||{};return e[n]||""}getCellData(t,n){const e=this.rowDataModel(t,n);return J(e.model[e.prop])}getSaveData(t,n,e){if(typeof e==="undefined"){e=this.getCellData(t,n)}const o=this.rowDataModel(t,n);return{prop:o.prop,rowIndex:t,colIndex:n,val:e,model:o.model,colType:this.type,type:this.dataStore.get("type")}}getCellEditor(t,n,e){var o;const s=(o=this.columns[n])===null||o===void 0?void 0:o.editor;if(!s){return undefined}if(typeof s==="string"){return e[s]}return s}rowDataModel(t,n){const e=this.columns[n];const s=e===null||e===void 0?void 0:e.prop;const r=o(this.dataStore,t)||{};const i=r[s];const c=this.dataStore.get("type");return{prop:s,model:r,data:this.dataStore.get("source"),column:e,rowIndex:t,colIndex:n,colType:this.type,type:c,value:i}}getRangeData(t,n){var e;const s={};const r=t.oldRange.x1-t.oldRange.x+1;const i=t.oldRange.y1-t.oldRange.y+1;const c={};for(let a=t.newRange.y,u=0;a<t.newRange.y1+1;a++,u++){const f=t.oldRange.y+u%i;const l=o(this.dataStore,f)||{};for(let o=t.newRange.x,i=0;o<t.newRange.x1+1;o++,i++){if(a>=t.oldRange.y&&a<=t.oldRange.y1&&o>=t.oldRange.x&&o<=t.oldRange.x1){continue}if(!this.columns[o]){continue}const u=(e=this.columns[o])===null||e===void 0?void 0:e.prop;const d=t.oldRange.x+i%r;const p=n[d].prop;if(!this.isReadOnly(a,o)){if(!s[a]){s[a]={}}s[a][u]=l[p];if(!c[a]){c[a]={}}c[a][u]={colIndex:d,colProp:p,rowIndex:f}}}}return{changed:s,mapping:c}}getTransformedDataToApply(t,n){const e={};const o=n.length;const r=this.columns.length;const i=this.dataStore.get("items").length;let c=t.y;let a=0;for(let s=0;c<i&&s<o;c++,s++){const i=n[s%o];const u=(i===null||i===void 0?void 0:i.length)||0;let f=t.x;for(let t=0;f<r&&t<u;f++,t++){const n=this.columns[f].prop;const o=t%r;if(!this.isReadOnly(c,f)){if(!e[c]){e[c]={}}e[c][n]=i[o]}}a=Math.max(a,f-1)}const u=s(t,{y:c-1,x:a});return{changed:e,range:u}}getRangeStaticData(t,n){const e={};for(let o=t.y,s=0;o<t.y1+1;o++,s++){for(let s=t.x,r=0;s<t.x1+1;s++,r++){if(!this.columns[s]){continue}const t=this.columns[s].prop;if(!this.isReadOnly(o,s)){if(!e[o]){e[o]={}}e[o][t]=n}}}return e}getRangeTransformedToProps(t,n){var e;const s=[];const r=this.dataStore.get("type");for(let i=t.y,c=0;i<t.y1+1;i++,c++){for(let c=t.x,a=0;c<t.x1+1;c++,a++){const t=(e=this.columns[c])===null||e===void 0?void 0:e.prop;s.push({prop:t,rowIndex:i,colIndex:c,model:o(n,i),type:r,colType:this.type})}}return s}copyRangeArray(t,n){const e=[...this.columns];const s=B(e,t.x,t.x1+1).map((t=>t.prop));const r=[];const i={};for(let e=t.y;e<=t.y1;e++){const t=[];i[e]={};for(let r of s){const s=o(n,e);if(!s){continue}const c=s[r];t.push(c);i[e][r]=c}r.push(t)}return{data:r,mapping:i}}destroy(){this.unsubscribe.forEach((t=>t()))}}function J(t){if(typeof t==="undefined"||t===null){return""}return t}function q(t,n){if(typeof t==="function"){return t(n)}return!!t}function F(t,n){let e=Object.assign(Object.assign({},n),t);if(n.class){if(typeof n.class==="object"&&typeof e.class==="object"){e.class=Object.assign(Object.assign({},n.class),e.class)}else if(typeof n.class==="string"&&typeof e.class==="object"){e.class[n.class]=true}else if(typeof e.class==="string"){e.class+=" "+n.class}}if(n.style){e.style=Object.assign(Object.assign({},n.style),e.style)}return e}export{T as C,$ as D,R as F,p as G,D as H,l as P,I as a,C as b,a as c,f as d,g as e,d as f,j as g,v as h,b as i,x as j,O as k,A as l,F as m,E as n,y as o,u as p,q,J as r};
|
|
5
|
+
//# sourceMappingURL=column.service-0e41057a.js.map
|
package/dist/revo-grid/{header-cell-renderer-171a011c.js → header-cell-renderer-6d8ac25d.js}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Built by Revolist OU ❤️
|
|
3
3
|
*/
|
|
4
|
-
import{h as t}from"./index-a61f225b.js";import{d as i}from"./dispatcher-ea08404f.js";import{m as s}from"./column.service-
|
|
5
|
-
//# sourceMappingURL=header-cell-renderer-
|
|
4
|
+
import{h as t}from"./index-a61f225b.js";import{d as i}from"./dispatcher-ea08404f.js";import{m as s}from"./column.service-0e41057a.js";var e;(function(t){t["start"]="resize:start";t["move"]="resize:move";t["end"]="resize:end"})(e||(e={}));const h={"resizable-r":{bit:1,cursor:"ew-resize"},"resizable-rb":{bit:3,cursor:"se-resize"},"resizable-b":{bit:2,cursor:"s-resize"},"resizable-lb":{bit:6,cursor:"sw-resize"},"resizable-l":{bit:4,cursor:"w-resize"},"resizable-lt":{bit:12,cursor:"nw-resize"},"resizable-t":{bit:8,cursor:"n-resize"},"resizable-rt":{bit:9,cursor:"ne-resize"}};const o={l:1,t:2,w:4,h:8};const n=t=>Object.assign(Object.assign({},t),{fitParent:t.fitParent||false,active:t.active||[],disableAttributes:t.disableAttributes||[],minWidth:t.minWidth||0,minHeight:t.minHeight||0});class r{constructor(t,i){this.initialProps=t;this.$event=i;this.mouseX=0;this.mouseY=0;this.width=0;this.height=0;this.changeX=0;this.changeY=0;this.disableCalcMap=15;this.props=n(t);this.mouseMoveFunc=this.handleMove.bind(this);this.mouseUpFunc=this.handleUp.bind(this);this.minW=this.props.minWidth;this.minH=this.props.minHeight;this.maxW=this.props.maxWidth;this.maxH=this.props.maxHeight;this.parent={width:0,height:0};this.resizeState=0}set(t){this.$el=t;this.props.disableAttributes.forEach((t=>{switch(t){case"l":this.disableCalcMap&=~o.l;break;case"t":this.disableCalcMap&=~o.t;break;case"w":this.disableCalcMap&=~o.w;break;case"h":this.disableCalcMap&=~o.h}}))}emitEvent(t,i){var s;if(!this.$event){return}const e=(s=this.activeResizer)===null||s===void 0?void 0:s.classList.contains("resizable-l");this.$event(Object.assign({eventName:t,width:this.width+this.changeX*(e?-1:1),height:this.height+this.changeY,changedX:this.changeX,changedY:this.changeY},i))}static isTouchEvent(t){var i;const s=t;return((i=s.touches)===null||i===void 0?void 0:i.length)>=0}handleMove(t){var i;if(!this.resizeState){return}let s,n;if(r.isTouchEvent(t)){s=t.touches[0].clientY;n=t.touches[0].clientX}else{s=t.clientY;n=t.clientX}let l=this.resizeState&h["resizable-r"].bit||this.resizeState&h["resizable-l"].bit;let c=this.resizeState&h["resizable-t"].bit||this.resizeState&h["resizable-b"].bit;if(c&&this.disableCalcMap&o.h){let t=s-this.mouseY;let i=this.changeY+t;const e=this.height+i;if(e<this.minH){i=-(this.height-this.minH)}if(this.maxH&&e>this.maxH){i=this.maxH-this.height}this.changeY=i;this.mouseY=s;if(this.activeResizer){this.activeResizer.style.bottom=`${-this.changeY}px`}}if(l&&this.disableCalcMap&o.w){const t=(i=this.activeResizer)===null||i===void 0?void 0:i.classList.contains("resizable-l");let s=n-this.mouseX;let e=this.changeX+s;const h=this.width+e*(t?-1:1);if(h<this.minW){e=-(this.width-this.minW)}if(this.maxW&&h>this.maxW){e=this.maxW-this.width}this.changeX=e;this.mouseX=n;if(this.activeResizer){if(!t){this.activeResizer.style.right=`${-this.changeX}px`}else{this.activeResizer.style.left=`${this.changeX}px`}}}this.emitEvent(e.move)}handleDown(t){if(t.defaultPrevented){return}t.preventDefault();this.dropInitial();for(let i in h){const s=t.target;if(this.$el.contains(s)&&(s===null||s===void 0?void 0:s.classList.contains(i))){document.body.style.cursor=h[i].cursor;if(r.isTouchEvent(t)){this.setInitials(t.touches[0],s)}else{t.preventDefault&&t.preventDefault();this.setInitials(t,s)}this.resizeState=h[i].bit;const o=e.start;this.emitEvent(o);break}}this.bindMove()}handleUp(t){t.preventDefault();if(this.resizeState!==0){this.resizeState=0;document.body.style.cursor="";const t=e.end;this.emitEvent(t)}this.dropInitial();this.unbindMove()}setInitials({clientX:t,clientY:i},s){const e=getComputedStyle(this.$el);this.$el.classList.add("active");this.activeResizer=s;if(this.disableCalcMap&o.w){this.mouseX=t;this.width=this.$el.clientWidth;this.parent.width=this.$el.parentElement.clientWidth;const i=parseFloat(e.paddingLeft)+parseFloat(e.paddingRight);this.minW=Math.max(i,this.initialProps.minWidth||0);if(this.initialProps.maxWidth){this.maxW=Math.max(this.width,this.initialProps.maxWidth)}}if(this.disableCalcMap&o.h){this.mouseY=i;this.height=this.$el.clientHeight;this.parent.height=this.$el.parentElement.clientHeight;const t=parseFloat(e.paddingTop)+parseFloat(e.paddingBottom);this.minH=Math.max(t,this.initialProps.minHeight||0);if(this.initialProps.maxHeight){this.maxH=Math.max(this.height,this.initialProps.maxHeight)}}}dropInitial(){this.changeX=this.changeY=this.minW=this.minH;this.width=this.height=0;if(this.activeResizer){this.activeResizer.removeAttribute("style")}this.$el.classList.remove("active");this.activeResizer=null}bindMove(){document.documentElement.addEventListener("mouseup",this.mouseUpFunc,true);document.documentElement.addEventListener("touchend",this.mouseUpFunc,true);document.documentElement.addEventListener("mousemove",this.mouseMoveFunc,true);document.documentElement.addEventListener("touchmove",this.mouseMoveFunc,true);document.documentElement.addEventListener("mouseleave",this.mouseUpFunc)}unbindMove(){document.documentElement.removeEventListener("mouseup",this.mouseUpFunc,true);document.documentElement.removeEventListener("touchend",this.mouseUpFunc,true);document.documentElement.removeEventListener("mousemove",this.mouseMoveFunc,true);document.documentElement.removeEventListener("touchmove",this.mouseMoveFunc,true);document.documentElement.removeEventListener("mouseleave",this.mouseUpFunc)}}const l=(i,s)=>{const h=[];const o=i.canResize&&new r(i,(t=>{if(t.eventName===e.end){i.onResize&&i.onResize(t)}}))||null;if(i.canResize){if(i.active){for(let s in i.active){h.push(t("div",{onClick:t=>t.preventDefault(),onDblClick:t=>{var s;t.preventDefault();(s=i.onDoubleClick)===null||s===void 0?void 0:s.call(i,t)},onMouseDown:t=>o===null||o===void 0?void 0:o.handleDown(t),onTouchStart:t=>o===null||o===void 0?void 0:o.handleDown(t),class:`resizable resizable-${i.active[s]}`}))}}}else{if(i.active){for(let s in i.active){h.push(t("div",{onClick:t=>t.preventDefault(),onTouchStart:t=>t.preventDefault(),onDblClick:t=>{var s;t.preventDefault();(s=i.onDoubleClick)===null||s===void 0?void 0:s.call(i,t)},class:`no-resize resizable resizable-${i.active[s]}`}))}}}return t("div",Object.assign({},i,{ref:t=>o===null||o===void 0?void 0:o.set(t)}),s,h)};const c="columnclick";const a=({data:e,props:h,additionalData:o},n)=>{let r=(e===null||e===void 0?void 0:e.name)||"";let a=h;if(e===null||e===void 0?void 0:e.columnTemplate){r=e.columnTemplate(t,e,o)}if(e===null||e===void 0?void 0:e.columnProperties){const t=e.columnProperties(e);if(t&&typeof t==="object"){a=s(h,t)}}return t(l,Object.assign({},a,{onMouseDown:t=>{i(t.currentTarget,c,{data:e,event:t})}}),t("div",{class:"header-content"},r),n)};export{a as H,c as O};
|
|
5
|
+
//# sourceMappingURL=header-cell-renderer-6d8ac25d.js.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Built by Revolist OU ❤️
|
|
3
|
+
*/
|
|
4
|
+
const s=30;const a=40;const o="data-rgCol";const t="data-rgRow";const n="disabled";const e="rgCell";const c="rowHeaders";const r="rgHeaderCell";const l="sortable";const d="header-rgRow";const g="actual-rgRow";const i="revo-drag-icon";const u="revo-draggable";const b="focused-cell";const p="selection-border-range";const w="mobile-handler";const f="temp-bg-range";const m="autofill-handle";const h="edit-input-wrapper";const R="Draggable item";const v="__rvgr";const x="focused-rgRow";function C(s){const a=s.createElement("div");a.style.overflow="scroll";a.style.visibility="hidden";a.style.position="absolute";a.style.top="-9999px";a.style.width="50px";a.style.height="50px";s.body.appendChild(a);const o=a.offsetWidth-a.clientWidth;s.body.removeChild(a);return o}function H(s,a,o){return(o[1]-o[0])*(s-a[0])/(a[1]-a[0])+o[0]}async function D(s=0){await new Promise((a=>{setTimeout((()=>a()),s)}))}export{e as C,n as D,h as E,b as F,v as G,r as H,w as M,a as R,p as S,f as T,m as a,c as b,R as c,t as d,x as e,i as f,C as g,u as h,o as i,l as j,s as k,d as l,g as m,H as s,D as t};
|
|
5
|
+
//# sourceMappingURL=index-4e881436.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["MIN_COL_SIZE","RESIZE_INTERVAL","DATA_COL","DATA_ROW","DISABLED_CLASS","CELL_CLASS","ROW_HEADER_TYPE","HEADER_CLASS","HEADER_SORTABLE_CLASS","HEADER_ROW_CLASS","HEADER_ACTUAL_ROW_CLASS","DRAG_ICON_CLASS","DRAGGABLE_CLASS","FOCUS_CLASS","SELECTION_BORDER_CLASS","MOBILE_CLASS","TMP_SELECTION_BG_CLASS","CELL_HANDLER_CLASS","EDIT_INPUT_WR","DRAGG_TEXT","GRID_INTERNALS","ROW_FOCUSED_CLASS","getScrollbarSize","document","container","createElement","style","overflow","visibility","position","top","width","height","body","appendChild","scrollbarWidth","offsetWidth","clientWidth","removeChild","scaleValue","value","from","to","async","timeout","delay","Promise","r","setTimeout"],"sources":["src/utils/consts.ts","src/utils/index.ts"],"sourcesContent":["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 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';\nexport const ROW_FOCUSED_CLASS = 'focused-rgRow';\n","/* Generate range on size\n */\nexport function range(size: number, startAt = 0): number[] {\n const res: number[] = [];\n const end = startAt + size;\n for (let i = startAt; i < end; i++) {\n res.push(i);\n }\n return res;\n}\n\n/* Find index position in array */\nexport function findPositionInArray<T>(this: T[], el: T, compareFn: (el: T, el2: T) => number): number {\n return (function (arr): number {\n let m = 0;\n let n = arr.length - 1;\n\n while (m <= n) {\n const k = (n + m) >> 1;\n const cmp = compareFn(el, arr[k]);\n\n if (cmp > 0) {\n m = k + 1;\n } else if (cmp < 0) {\n n = k - 1;\n } else {\n return k;\n }\n }\n\n return -m - 1;\n })(this);\n}\n\n/**\n * Sorted push\n */\nexport function pushSorted<T>(arr: T[], el: T, fn: (el: T, el2: T) => number): T[] {\n arr.splice(findPositionInArray.bind(arr)(el, fn), 0, el);\n return arr;\n}\n\n// (arr1[index1] < arr2[index2])\nfunction simpleCompare<T>(el1: T, el2: T): boolean {\n return el1 < el2;\n}\n\n/**\n * Merge sorted array helper function\n */\nexport function mergeSortedArray<T>(arr1: T[], arr2: T[], compareFn: (el: T, el2: T) => boolean = simpleCompare): T[] {\n const merged: T[] = [];\n let index1 = 0;\n let index2 = 0;\n let current = 0;\n\n while (current < arr1.length + arr2.length) {\n let isArr1Depleted = index1 >= arr1.length;\n let isArr2Depleted = index2 >= arr2.length;\n\n if (!isArr1Depleted && (isArr2Depleted || compareFn(arr1[index1], arr2[index2]))) {\n merged[current] = arr1[index1];\n index1++;\n } else {\n merged[current] = arr2[index2];\n index2++;\n }\n\n current++;\n }\n\n return merged;\n}\n\n/**\n * Calculate system scrollbar size\n */\nexport function getScrollbarSize(document: Document): number {\n // Create a temporary div container and append it to the body\n const container = document.createElement('div');\n\n // Apply styling to ensure the div is scrollable\n container.style.overflow = 'scroll';\n container.style.visibility = 'hidden'; // make sure the container isn't visible\n container.style.position = 'absolute';\n container.style.top = '-9999px'; // move it out of the screen\n container.style.width = '50px'; // arbitrary width\n container.style.height = '50px'; // arbitrary height\n\n // Append the div to the body\n document.body.appendChild(container);\n\n // Calculate the width of the scrollbar\n const scrollbarWidth = container.offsetWidth - container.clientWidth;\n\n // Remove the div from the body after calculation\n document.body.removeChild(container);\n\n // Return the calculated width of the scrollbar\n return scrollbarWidth;\n}\n\n/* Scale a value between 2 ranges\n *\n * Sample:\n * // 55 from a 0-100 range to a 0-1000 range (Ranges don't have to be positive)\n * const n = scaleValue(55, [0,100], [0,1000]);\n *\n * Ranges of two values\n * @from\n * @to\n *\n * ~~ return value does the equivalent of Math.floor but faster.\n */\nexport function scaleValue(value: number, from: [number, number], to: [number, number]): number {\n return ((to[1] - to[0]) * (value - from[0])) / (from[1] - from[0]) + to[0];\n}\n\n/**\n * Async timeout\n */\nexport async function timeout(delay = 0): Promise<void> {\n await new Promise((r: (v?: any) => void) => {\n setTimeout(() => r(), delay);\n });\n}\n\n/**\n * Type script mixins\n */\nexport function applyMixins(derivedCtor: any, constructors: any[]) {\n constructors.forEach(baseCtor => {\n Object.getOwnPropertyNames(baseCtor.prototype).forEach(name => {\n Object.defineProperty(derivedCtor.prototype, name, Object.getOwnPropertyDescriptor(baseCtor.prototype, name) || Object.create(null));\n });\n });\n}\n"],"mappings":";;;MAAaA,EAAe,G,MACfC,EAAkB,G,MAElBC,EAAW,a,MACXC,EAAW,a,MAEXC,EAAiB,W,MACjBC,EAAa,S,MACbC,EAAkB,a,MAClBC,EAAe,e,MACfC,EAAwB,W,MACxBC,EAAmB,e,MACnBC,EAA0B,e,MAE1BC,EAAkB,iB,MAClBC,EAAkB,iB,MAElBC,EAAc,e,MACdC,EAAyB,yB,MACzBC,EAAe,iB,MACfC,EAAyB,gB,MAEzBC,EAAqB,kB,MAErBC,EAAgB,qB,MAEhBC,EAAa,iB,MACbC,EAAiB,S,MACjBC,EAAoB,gB,SCiDjBC,EAAiBC,GAE/B,MAAMC,EAAYD,EAASE,cAAc,OAGzCD,EAAUE,MAAMC,SAAW,SAC3BH,EAAUE,MAAME,WAAa,SAC7BJ,EAAUE,MAAMG,SAAW,WAC3BL,EAAUE,MAAMI,IAAM,UACtBN,EAAUE,MAAMK,MAAQ,OACxBP,EAAUE,MAAMM,OAAS,OAGzBT,EAASU,KAAKC,YAAYV,GAG1B,MAAMW,EAAiBX,EAAUY,YAAcZ,EAAUa,YAGzDd,EAASU,KAAKK,YAAYd,GAG1B,OAAOW,CACT,C,SAcgBI,EAAWC,EAAeC,EAAwBC,GAChE,OAASA,EAAG,GAAKA,EAAG,KAAOF,EAAQC,EAAK,KAAQA,EAAK,GAAKA,EAAK,IAAMC,EAAG,EAC1E,CAKOC,eAAeC,EAAQC,EAAQ,SAC9B,IAAIC,SAASC,IACjBC,YAAW,IAAMD,KAAKF,EAAM,GAEhC,Q","ignoreList":[]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Built by Revolist OU ❤️
|
|
3
3
|
*/
|
|
4
|
-
import{E as n}from"./index-
|
|
5
|
-
//# sourceMappingURL=key.utils-
|
|
4
|
+
import{E as n}from"./index-4e881436.js";var e;(function(n){n[n["MOUSE_LEFT"]=1]="MOUSE_LEFT";n[n["MOUSE_RIGHT"]=3]="MOUSE_RIGHT";n[n["MOUSE_MIDDLE"]=2]="MOUSE_MIDDLE";n[n["BACKSPACE"]=8]="BACKSPACE";n[n["COMMA"]=188]="COMMA";n[n["INSERT"]=45]="INSERT";n[n["DELETE"]=46]="DELETE";n[n["END"]=35]="END";n[n["ENTER"]=13]="ENTER";n[n["ESCAPE"]=27]="ESCAPE";n[n["CONTROL"]=17]="CONTROL";n[n["COMMAND_LEFT"]=91]="COMMAND_LEFT";n[n["COMMAND_RIGHT"]=93]="COMMAND_RIGHT";n[n["COMMAND_FIREFOX"]=224]="COMMAND_FIREFOX";n[n["ALT"]=18]="ALT";n[n["HOME"]=36]="HOME";n[n["PAGE_DOWN"]=34]="PAGE_DOWN";n[n["PAGE_UP"]=33]="PAGE_UP";n[n["PERIOD"]=190]="PERIOD";n[n["SPACE"]=32]="SPACE";n[n["SHIFT"]=16]="SHIFT";n[n["CAPS_LOCK"]=20]="CAPS_LOCK";n[n["TAB"]=9]="TAB";n[n["ARROW_RIGHT"]=39]="ARROW_RIGHT";n[n["ARROW_LEFT"]=37]="ARROW_LEFT";n[n["ARROW_UP"]=38]="ARROW_UP";n[n["ARROW_DOWN"]=40]="ARROW_DOWN";n[n["F1"]=112]="F1";n[n["F2"]=113]="F2";n[n["F3"]=114]="F3";n[n["F4"]=115]="F4";n[n["F5"]=116]="F5";n[n["F6"]=117]="F6";n[n["F7"]=118]="F7";n[n["F8"]=119]="F8";n[n["F9"]=120]="F9";n[n["F10"]=121]="F10";n[n["F11"]=122]="F11";n[n["F12"]=123]="F12";n[n["A"]=65]="A";n[n["C"]=67]="C";n[n["D"]=68]="D";n[n["F"]=70]="F";n[n["L"]=76]="L";n[n["O"]=79]="O";n[n["P"]=80]="P";n[n["S"]=83]="S";n[n["V"]=86]="V";n[n["X"]=88]="X"})(e||(e={}));var r;(function(n){n["ENTER"]="Enter";n["ENTER_NUM"]="NumpadEnter";n["A"]="KeyA";n["C"]="KeyC";n["X"]="KeyX";n["V"]="KeyV";n["ESCAPE"]="Escape";n["TAB"]="Tab";n["BACKSPACE"]="Backspace";n["DELETE"]="Delete";n["ARROW_RIGHT"]="ArrowRight";n["ARROW_LEFT"]="ArrowLeft";n["ARROW_UP"]="ArrowUp";n["ARROW_DOWN"]="ArrowDown";n["SHIFT"]="Shift"})(r||(r={}));var t;(function(n){n["ENTER"]="Enter";n["TAB"]="Tab"})(t||(t={}));function o(e){return!!(e===null||e===void 0?void 0:e.closest(`.${n}`))}function E(n){return typeof n==="function"&&typeof n.prototype==="object"}var u;(function(n){n["mac"]="Mac"})(u||(u={}));function A(n){return n===32||n>=48&&n<=57||n>=96&&n<=111||n>=186&&n<=192||n>=219&&n<=222||n>=226||n>=65&&n<=90}function a(n){return r.BACKSPACE===n||r.DELETE===n}function i(n){return r.TAB===n}function c(n){return t.ENTER===n}function f(n){return n.ctrlKey&&n.code==="KeyX"||n.metaKey&&n.code==="KeyX"}function O(n){return n.ctrlKey&&n.code==="KeyC"||n.metaKey&&n.code==="KeyC"}function F(n){return n.ctrlKey&&n.code==="KeyV"||n.metaKey&&n.code==="KeyV"}function R(n){return n.ctrlKey&&n.code==="KeyA"||n.metaKey&&n.code==="KeyA"}export{c as a,O as b,r as c,f as d,F as e,R as f,A as g,o as h,a as i,i as j,E as k};
|
|
5
|
+
//# sourceMappingURL=key.utils-425c987d.js.map
|