@revolist/revogrid 4.4.0-next.2 → 4.4.0-next.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/custom-element/columnService.js +1 -1
- package/custom-element/consts.js +2 -1
- package/custom-element/consts.js.map +1 -1
- package/custom-element/localScrollService.js +1 -1
- package/custom-element/localScrollService.js.map +1 -1
- package/custom-element/revo-grid.js +163 -97
- package/custom-element/revo-grid.js.map +1 -1
- package/custom-element/revogr-clipboard.js +24 -5
- package/custom-element/revogr-clipboard.js.map +1 -1
- package/custom-element/revogr-edit2.js +12 -6
- package/custom-element/revogr-edit2.js.map +1 -1
- package/custom-element/revogr-focus2.js +1 -1
- package/custom-element/revogr-focus2.js.map +1 -1
- package/custom-element/revogr-header2.js +25 -11
- package/custom-element/revogr-header2.js.map +1 -1
- package/custom-element/revogr-overlay-selection2.js +99 -32
- package/custom-element/revogr-overlay-selection2.js.map +1 -1
- package/custom-element/revogr-row-headers2.js +1 -2
- package/custom-element/revogr-row-headers2.js.map +1 -1
- package/custom-element/revogr-viewport-scroll2.js +39 -6
- package/custom-element/revogr-viewport-scroll2.js.map +1 -1
- package/dist/cjs/{debounce-525dd66c.js → debounce-f50730b6.js} +1 -38
- package/dist/cjs/debounce-f50730b6.js.map +1 -0
- package/dist/cjs/dispatcher-20520c70.js +21 -0
- package/dist/cjs/dispatcher-20520c70.js.map +1 -0
- package/dist/cjs/events-030618fc.js +459 -0
- package/dist/cjs/events-030618fc.js.map +1 -0
- package/dist/cjs/filter.button-6badec7a.js +44 -0
- package/dist/cjs/filter.button-6badec7a.js.map +1 -0
- package/dist/cjs/{index-aad39b7b.js → index-ee2ef5ae.js} +96 -36
- package/dist/cjs/index-ee2ef5ae.js.map +1 -0
- package/dist/cjs/index-effc94b9.js +3944 -0
- package/dist/cjs/index-effc94b9.js.map +1 -0
- package/dist/cjs/isString-3dde8d95.js +38 -0
- package/dist/cjs/isString-3dde8d95.js.map +1 -0
- package/dist/cjs/keyCodes.utils-d665ebed.js +271 -0
- package/dist/cjs/keyCodes.utils-d665ebed.js.map +1 -0
- package/dist/cjs/loader.cjs.js +3 -3
- package/dist/cjs/loader.cjs.js.map +1 -1
- package/dist/cjs/localScrollService-a81823c5.js +403 -0
- package/dist/cjs/localScrollService-a81823c5.js.map +1 -0
- package/dist/cjs/revo-grid.cjs.entry.js +3858 -0
- package/dist/cjs/revo-grid.cjs.entry.js.map +1 -0
- package/dist/cjs/revo-grid.cjs.js +3 -3
- package/dist/cjs/revo-grid.cjs.js.map +1 -1
- package/dist/cjs/revogr-clipboard.cjs.entry.js +24 -6
- package/dist/cjs/revogr-clipboard.cjs.entry.js.map +1 -1
- package/dist/cjs/revogr-data_3.cjs.entry.js +1138 -0
- package/dist/cjs/revogr-data_3.cjs.entry.js.map +1 -0
- package/dist/cjs/revogr-edit_2.cjs.entry.js +325 -0
- package/dist/cjs/revogr-edit_2.cjs.entry.js.map +1 -0
- package/dist/cjs/revogr-filter-panel.cjs.entry.js +6 -5
- package/dist/cjs/revogr-filter-panel.cjs.entry.js.map +1 -1
- package/dist/cjs/revogr-focus_5.cjs.entry.js +1231 -0
- package/dist/cjs/revogr-focus_5.cjs.entry.js.map +1 -0
- package/dist/cjs/{revo-grid_11.cjs.entry.js → viewport.helpers-70ccec8f.js} +13978 -25269
- package/dist/cjs/viewport.helpers-70ccec8f.js.map +1 -0
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/clipboard/revogr-clipboard.d.ts +6 -2
- package/dist/collection/components/clipboard/revogr-clipboard.js +46 -5
- package/dist/collection/components/clipboard/revogr-clipboard.js.map +1 -1
- package/dist/collection/components/header/headerCellRenderer.d.ts +2 -1
- package/dist/collection/components/header/headerCellRenderer.js +1 -1
- package/dist/collection/components/header/headerCellRenderer.js.map +1 -1
- package/dist/collection/components/header/headerRenderer.d.ts +2 -2
- package/dist/collection/components/header/headerRenderer.js +1 -1
- package/dist/collection/components/header/headerRenderer.js.map +1 -1
- package/dist/collection/components/header/revogr-header.d.ts +15 -1
- package/dist/collection/components/header/revogr-header.js +34 -8
- package/dist/collection/components/header/revogr-header.js.map +1 -1
- package/dist/collection/components/overlay/autofill.service.d.ts +7 -3
- package/dist/collection/components/overlay/autofill.service.js +32 -12
- package/dist/collection/components/overlay/autofill.service.js.map +1 -1
- package/dist/collection/components/overlay/clipboard.service.d.ts +1 -1
- package/dist/collection/components/overlay/clipboard.service.js +2 -2
- package/dist/collection/components/overlay/clipboard.service.js.map +1 -1
- package/dist/collection/components/overlay/keyboard.service.js +2 -6
- package/dist/collection/components/overlay/keyboard.service.js.map +1 -1
- package/dist/collection/components/overlay/revogr-edit.d.ts +8 -0
- package/dist/collection/components/overlay/revogr-edit.js +34 -9
- package/dist/collection/components/overlay/revogr-edit.js.map +1 -1
- package/dist/collection/components/overlay/revogr-overlay-selection.d.ts +32 -10
- package/dist/collection/components/overlay/revogr-overlay-selection.js +80 -12
- package/dist/collection/components/overlay/revogr-overlay-selection.js.map +1 -1
- package/dist/collection/components/overlay/revogr-overlay-style.css +71 -4
- package/dist/collection/components/revoGrid/revo-grid.d.ts +15 -4
- package/dist/collection/components/revoGrid/revo-grid.js +60 -19
- package/dist/collection/components/revoGrid/revo-grid.js.map +1 -1
- package/dist/collection/components/revoGrid/viewport.scrolling.service.d.ts +6 -2
- package/dist/collection/components/revoGrid/viewport.scrolling.service.js +26 -4
- package/dist/collection/components/revoGrid/viewport.scrolling.service.js.map +1 -1
- package/dist/collection/components/revoGrid/viewport.section.d.ts +3 -2
- package/dist/collection/components/revoGrid/viewport.section.js +8 -4
- package/dist/collection/components/revoGrid/viewport.section.js.map +1 -1
- package/dist/collection/components/revoGrid/viewport.service.d.ts +4 -0
- package/dist/collection/components/revoGrid/viewport.service.js +15 -3
- package/dist/collection/components/revoGrid/viewport.service.js.map +1 -1
- package/dist/collection/components/rowHeaders/revogr-row-headers.js.map +1 -1
- package/dist/collection/components/scroll/revogr-viewport-scroll-style.css +3 -0
- package/dist/collection/components/scroll/revogr-viewport-scroll.d.ts +16 -5
- package/dist/collection/components/scroll/revogr-viewport-scroll.js +64 -9
- package/dist/collection/components/scroll/revogr-viewport-scroll.js.map +1 -1
- package/dist/collection/components/selectionFocus/revogr-focus-style.css +1 -1
- package/dist/collection/components.d.ts +110 -6
- package/dist/collection/interfaces.d.ts +4 -1
- package/dist/collection/plugins/groupingColumn/columnGroupsRenderer.d.ts +3 -2
- package/dist/collection/plugins/groupingColumn/columnGroupsRenderer.js +2 -2
- package/dist/collection/plugins/groupingColumn/columnGroupsRenderer.js.map +1 -1
- package/dist/collection/plugins/groupingColumn/headerGroupRenderer.d.ts +2 -2
- package/dist/collection/plugins/groupingColumn/headerGroupRenderer.js +1 -1
- package/dist/collection/plugins/groupingColumn/headerGroupRenderer.js.map +1 -1
- package/dist/collection/plugins/sorting/sorting.plugin.d.ts +21 -13
- package/dist/collection/plugins/sorting/sorting.plugin.js +77 -70
- package/dist/collection/plugins/sorting/sorting.plugin.js.map +1 -1
- package/dist/collection/serve/controller.js +183 -0
- package/dist/collection/services/localScrollService.js +1 -1
- package/dist/collection/services/localScrollService.js.map +1 -1
- package/dist/collection/services/resizable.directive.d.ts +8 -7
- package/dist/collection/services/resizable.directive.js +13 -36
- package/dist/collection/services/resizable.directive.js.map +1 -1
- package/dist/collection/services/resizable.element.d.ts +4 -0
- package/dist/collection/services/resizable.element.js +39 -0
- package/dist/collection/services/resizable.element.js.map +1 -0
- package/dist/collection/stencil-public-runtime.d.ts +1 -0
- package/dist/collection/store/viewPort/viewport.store.js +0 -1
- package/dist/collection/store/viewPort/viewport.store.js.map +1 -1
- package/dist/collection/utils/consts.d.ts +1 -0
- package/dist/collection/utils/consts.js +1 -0
- package/dist/collection/utils/consts.js.map +1 -1
- package/dist/collection/utils/events.d.ts +2 -1
- package/dist/collection/utils/events.js +18 -2
- package/dist/collection/utils/events.js.map +1 -1
- package/dist/collection/utils/mobile.d.ts +1 -0
- package/dist/collection/utils/mobile.js +7 -0
- package/dist/collection/utils/mobile.js.map +1 -0
- package/dist/esm/{debounce-301fd4d2.js → debounce-820b5a8b.js} +2 -34
- package/dist/esm/debounce-820b5a8b.js.map +1 -0
- package/dist/esm/dispatcher-9e9c0233.js +19 -0
- package/dist/esm/dispatcher-9e9c0233.js.map +1 -0
- package/dist/esm/events-31272e5e.js +454 -0
- package/dist/esm/events-31272e5e.js.map +1 -0
- package/dist/esm/filter.button-21ce90ef.js +38 -0
- package/dist/esm/filter.button-21ce90ef.js.map +1 -0
- package/dist/esm/{index-5e90b19b.js → index-05947c5f.js} +97 -37
- package/dist/esm/index-05947c5f.js.map +1 -0
- package/dist/esm/index-728bf6e3.js +3889 -0
- package/dist/esm/index-728bf6e3.js.map +1 -0
- package/dist/esm/isString-d539060a.js +36 -0
- package/dist/esm/isString-d539060a.js.map +1 -0
- package/dist/esm/keyCodes.utils-c0064460.js +265 -0
- package/dist/esm/keyCodes.utils-c0064460.js.map +1 -0
- package/dist/esm/loader.js +4 -4
- package/dist/esm/loader.js.map +1 -1
- package/dist/esm/localScrollService-884d8952.js +400 -0
- package/dist/esm/localScrollService-884d8952.js.map +1 -0
- package/dist/esm/revo-grid.entry.js +3854 -0
- package/dist/esm/revo-grid.entry.js.map +1 -0
- package/dist/esm/revo-grid.js +4 -4
- package/dist/esm/revo-grid.js.map +1 -1
- package/dist/esm/revogr-clipboard.entry.js +24 -6
- package/dist/esm/revogr-clipboard.entry.js.map +1 -1
- package/dist/esm/revogr-data_3.entry.js +1132 -0
- package/dist/esm/revogr-data_3.entry.js.map +1 -0
- package/dist/esm/revogr-edit_2.entry.js +320 -0
- package/dist/esm/revogr-edit_2.entry.js.map +1 -0
- package/dist/esm/revogr-filter-panel.entry.js +3 -2
- package/dist/esm/revogr-filter-panel.entry.js.map +1 -1
- package/dist/esm/revogr-focus_5.entry.js +1223 -0
- package/dist/esm/revogr-focus_5.entry.js.map +1 -0
- package/dist/esm/{revo-grid_11.entry.js → viewport.helpers-c08e729e.js} +13790 -25093
- package/dist/esm/viewport.helpers-c08e729e.js.map +1 -0
- package/dist/revo-grid/debounce-820b5a8b.js +5 -0
- package/dist/revo-grid/debounce-820b5a8b.js.map +1 -0
- package/dist/revo-grid/dispatcher-9e9c0233.js +5 -0
- package/dist/revo-grid/dispatcher-9e9c0233.js.map +1 -0
- package/dist/revo-grid/events-31272e5e.js +5 -0
- package/dist/revo-grid/events-31272e5e.js.map +1 -0
- package/dist/revo-grid/filter.button-21ce90ef.js +5 -0
- package/dist/revo-grid/filter.button-21ce90ef.js.map +1 -0
- package/dist/revo-grid/index-05947c5f.js +6 -0
- package/dist/revo-grid/index-05947c5f.js.map +1 -0
- package/dist/revo-grid/index-728bf6e3.js +5 -0
- package/dist/revo-grid/index-728bf6e3.js.map +1 -0
- package/dist/revo-grid/isString-d539060a.js +5 -0
- package/dist/revo-grid/isString-d539060a.js.map +1 -0
- package/dist/revo-grid/keyCodes.utils-c0064460.js +5 -0
- package/dist/revo-grid/keyCodes.utils-c0064460.js.map +1 -0
- package/dist/revo-grid/localScrollService-884d8952.js +5 -0
- package/dist/revo-grid/localScrollService-884d8952.js.map +1 -0
- package/dist/revo-grid/revo-grid.entry.js +5 -0
- package/dist/revo-grid/revo-grid.entry.js.map +1 -0
- package/dist/revo-grid/revo-grid.esm.js +1 -1
- package/dist/revo-grid/revo-grid.esm.js.map +1 -1
- package/dist/revo-grid/revogr-clipboard.entry.js +1 -1
- package/dist/revo-grid/revogr-clipboard.entry.js.map +1 -1
- package/dist/revo-grid/revogr-data_3.entry.js +5 -0
- package/dist/revo-grid/revogr-data_3.entry.js.map +1 -0
- package/dist/revo-grid/revogr-edit_2.entry.js +5 -0
- package/dist/revo-grid/revogr-edit_2.entry.js.map +1 -0
- package/dist/revo-grid/revogr-filter-panel.entry.js +1 -1
- package/dist/revo-grid/revogr-filter-panel.entry.js.map +1 -1
- package/dist/revo-grid/revogr-focus_5.entry.js +5 -0
- package/dist/revo-grid/revogr-focus_5.entry.js.map +1 -0
- package/dist/revo-grid/viewport.helpers-c08e729e.js +5 -0
- package/dist/revo-grid/viewport.helpers-c08e729e.js.map +1 -0
- package/dist/types/components/clipboard/revogr-clipboard.d.ts +6 -2
- package/dist/types/components/header/headerCellRenderer.d.ts +2 -1
- package/dist/types/components/header/headerRenderer.d.ts +2 -2
- package/dist/types/components/header/revogr-header.d.ts +15 -1
- package/dist/types/components/overlay/autofill.service.d.ts +7 -3
- package/dist/types/components/overlay/clipboard.service.d.ts +1 -1
- package/dist/types/components/overlay/revogr-edit.d.ts +8 -0
- package/dist/types/components/overlay/revogr-overlay-selection.d.ts +32 -10
- package/dist/types/components/revoGrid/revo-grid.d.ts +15 -4
- package/dist/types/components/revoGrid/viewport.scrolling.service.d.ts +6 -2
- package/dist/types/components/revoGrid/viewport.section.d.ts +3 -2
- package/dist/types/components/revoGrid/viewport.service.d.ts +4 -0
- package/dist/types/components/scroll/revogr-viewport-scroll.d.ts +16 -5
- package/dist/types/components.d.ts +110 -6
- package/dist/types/interfaces.d.ts +4 -1
- package/dist/types/plugins/groupingColumn/columnGroupsRenderer.d.ts +3 -2
- package/dist/types/plugins/groupingColumn/headerGroupRenderer.d.ts +2 -2
- package/dist/types/plugins/sorting/sorting.plugin.d.ts +21 -13
- package/dist/types/services/resizable.directive.d.ts +8 -7
- package/dist/types/services/resizable.element.d.ts +4 -0
- package/dist/types/stencil-public-runtime.d.ts +1 -0
- package/dist/types/utils/consts.d.ts +1 -0
- package/dist/types/utils/events.d.ts +2 -1
- package/dist/types/utils/mobile.d.ts +1 -0
- package/package.json +4 -3
- package/dist/cjs/debounce-525dd66c.js.map +0 -1
- package/dist/cjs/index-aad39b7b.js.map +0 -1
- package/dist/cjs/revo-grid_11.cjs.entry.js.map +0 -1
- package/dist/esm/debounce-301fd4d2.js.map +0 -1
- package/dist/esm/index-5e90b19b.js.map +0 -1
- package/dist/esm/revo-grid_11.entry.js.map +0 -1
- package/dist/revo-grid/debounce-301fd4d2.js +0 -5
- package/dist/revo-grid/debounce-301fd4d2.js.map +0 -1
- package/dist/revo-grid/index-5e90b19b.js +0 -6
- package/dist/revo-grid/index-5e90b19b.js.map +0 -1
- package/dist/revo-grid/revo-grid_11.entry.js +0 -5
- package/dist/revo-grid/revo-grid_11.entry.js.map +0 -1
- /package/dist/collection/{utilsExternal/generate-data.js → serve/data.js} +0 -0
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
|
|
6
6
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
7
7
|
|
|
8
|
-
const index = require('./index-
|
|
8
|
+
const index = require('./index-ee2ef5ae.js');
|
|
9
9
|
|
|
10
10
|
/*
|
|
11
|
-
Stencil Client Patch Browser v3.2.
|
|
11
|
+
Stencil Client Patch Browser v3.2.2 | MIT Licensed | https://stenciljs.com
|
|
12
12
|
*/
|
|
13
13
|
const patchBrowser = () => {
|
|
14
14
|
const importMeta = (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('revo-grid.cjs.js', document.baseURI).href));
|
|
@@ -23,7 +23,7 @@ const patchBrowser = () => {
|
|
|
23
23
|
};
|
|
24
24
|
|
|
25
25
|
patchBrowser().then(options => {
|
|
26
|
-
return index.bootstrapLazy([["
|
|
26
|
+
return index.bootstrapLazy([["revo-grid.cjs",[[0,"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"],"extraElements":[32],"refresh":[64],"scrollToRow":[64],"scrollToColumnIndex":[64],"scrollToColumnProp":[64],"updateColumns":[64],"addTrimmed":[64],"scrollToCoordinate":[64],"setCellEdit":[64],"setCellsFocus":[64],"registerVNode":[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,"internalRowDragStart","onRowDragStarted"],[0,"internalRowDragEnd","onRowDragEnd"],[0,"internalRowDrag","onRowDrag"],[0,"internalRowMouseMove","onRowMouseMove"],[0,"internalCellEdit","onBeforeEdit"],[0,"internalRangeDataApply","onBeforeRangeEdit"],[0,"internalSelectionChanged","onRangeChanged"],[0,"initialRowDropped","onRowDropped"],[0,"initialHeaderClick","onHeaderClick"],[0,"beforeFocusCell","onCellFocus"]]]]],["revogr-clipboard.cjs",[[0,"revogr-clipboard",{"readonly":[4],"doCopy":[64]},[[4,"paste","onPaste"],[4,"copy","copyStarted"],[4,"cut","cutStarted"]]]]],["revogr-filter-panel.cjs",[[0,"revogr-filter-panel",{"uuid":[1537],"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-edit_2.cjs",[[0,"revogr-edit",{"editCell":[16],"column":[16],"editor":[16],"saveOnClose":[4,"save-on-close"],"additionalData":[8,"additional-data"],"cancel":[64]}],[0,"revogr-order-editor",{"parent":[16],"dimensionRow":[16],"dimensionCol":[16],"dataStore":[16],"dragStart":[64],"endOrder":[64],"clearOrder":[64]},[[5,"mouseleave","onMouseOut"],[5,"mouseup","onMouseUp"]]]]],["revogr-data_3.cjs",[[0,"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":[1]}],[0,"revogr-header",{"viewportCol":[16],"dimensionCol":[16],"selectionStore":[16],"parent":[1],"groups":[16],"groupingDepth":[2,"grouping-depth"],"canResize":[4,"can-resize"],"resizeHandler":[16],"colData":[16],"columnFilter":[4,"column-filter"],"type":[1],"additionalData":[8,"additional-data"]}],[4,"revogr-viewport-scroll",{"contentWidth":[2,"content-width"],"contentHeight":[2,"content-height"],"setScroll":[64],"changeScroll":[64]},[[0,"mousewheel-vertical","mousewheelVertical"],[0,"mousewheel-horizontal","mousewheelHorizontal"],[0,"scroll-coordinate","scrollApply"]]]]],["revogr-focus_5.cjs",[[0,"revogr-row-headers",{"height":[2],"dataPorts":[16],"headerProp":[16],"uiid":[1],"rowClass":[1,"row-class"],"resize":[4],"rowHeaderColumn":[16],"additionalData":[8,"additional-data"]}],[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"]]],[0,"revogr-focus",{"selectionStore":[16],"dimensionRow":[16],"dimensionCol":[16],"dataStore":[16],"colData":[16],"colType":[1,"col-type"],"rowType":[1,"row-type"],"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);
|
|
27
27
|
});
|
|
28
28
|
|
|
29
29
|
exports.setNonce = index.setNonce;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"revo-grid.cjs.js","mappings":";;;;;;;;;AAAA;AACA;AACA;AAiBA,MAAM,YAAY,GAAG,MAAM;AAkC3B,IAAI,MAAM,UAAU,GAAG,2MAAe,CAAC;AACvC,IAAI,MAAM,IAAI,GAAiE,EAAE,CAAC;AAgBlF;AACA,IAAI,IAAuB,UAAU,KAAK,EAAE,EAAE;AAC9C,QAAQ,IAAI,CAAC,YAAY,GAAG,IAAI,GAAG,CAAC,GAAG,EAAE,UAAU,CAAC,CAAC,IAAI,CAAC;AAC1D;AACA;AACA,KAaK;AACL,IAAI,OAAOA,oBAAc,CAAC,IAAI,CAAC,CAAC;AAChC,CAAC;;ACtFD,YAAY,EAAE,CAAC,IAAI,CAAC,OAAO,IAAI;AAE/B,EAAE,OAAOC,mBAAa,CAAC,4BAA4B,EAAE,OAAO,CAAC,CAAC;AAC9D,CAAC,CAAC;;;;","names":["promiseResolve","bootstrapLazy"],"sources":["./node_modules/@stencil/core/internal/client/patch-browser.js","@lazy-browser-entrypoint?app-data=conditional"],"sourcesContent":["/*\n Stencil Client Patch Browser v3.2.
|
|
1
|
+
{"file":"revo-grid.cjs.js","mappings":";;;;;;;;;AAAA;AACA;AACA;AAiBA,MAAM,YAAY,GAAG,MAAM;AAkC3B,IAAI,MAAM,UAAU,GAAG,2MAAe,CAAC;AACvC,IAAI,MAAM,IAAI,GAAiE,EAAE,CAAC;AAgBlF;AACA,IAAI,IAAuB,UAAU,KAAK,EAAE,EAAE;AAC9C,QAAQ,IAAI,CAAC,YAAY,GAAG,IAAI,GAAG,CAAC,GAAG,EAAE,UAAU,CAAC,CAAC,IAAI,CAAC;AAC1D;AACA;AACA,KAaK;AACL,IAAI,OAAOA,oBAAc,CAAC,IAAI,CAAC,CAAC;AAChC,CAAC;;ACtFD,YAAY,EAAE,CAAC,IAAI,CAAC,OAAO,IAAI;AAE/B,EAAE,OAAOC,mBAAa,CAAC,4BAA4B,EAAE,OAAO,CAAC,CAAC;AAC9D,CAAC,CAAC;;;;","names":["promiseResolve","bootstrapLazy"],"sources":["./node_modules/@stencil/core/internal/client/patch-browser.js","@lazy-browser-entrypoint?app-data=conditional"],"sourcesContent":["/*\n Stencil Client Patch Browser v3.2.2 | MIT Licensed | https://stenciljs.com\n */\nimport { BUILD, NAMESPACE } from '@stencil/core/internal/app-data';\nimport { consoleDevInfo, plt, win, doc, promiseResolve, H } from '@stencil/core';\n/**\n * Helper method for querying a `meta` tag that contains a nonce value\n * out of a DOM's head.\n *\n * @param doc The DOM containing the `head` to query against\n * @returns The content of the meta tag representing the nonce value, or `undefined` if no tag\n * exists or the tag has no content.\n */\nfunction queryNonceMetaTagContent(doc) {\n var _a, _b, _c;\n return (_c = (_b = (_a = doc.head) === null || _a === void 0 ? void 0 : _a.querySelector('meta[name=\"csp-nonce\"]')) === null || _b === void 0 ? void 0 : _b.getAttribute('content')) !== null && _c !== void 0 ? _c : undefined;\n}\n// TODO(STENCIL-661): Remove code related to the dynamic import shim\nconst getDynamicImportFunction = (namespace) => `__sc_import_${namespace.replace(/\\s|-/g, '_')}`;\nconst patchBrowser = () => {\n // NOTE!! This fn cannot use async/await!\n if (BUILD.isDev && !BUILD.isTesting) {\n consoleDevInfo('Running in development mode.');\n }\n // TODO(STENCIL-659): Remove code implementing the CSS variable shim\n if (BUILD.cssVarShim) {\n // shim css vars\n // TODO(STENCIL-659): Remove code implementing the CSS variable shim\n plt.$cssShim$ = win.__cssshim;\n }\n if (BUILD.cloneNodeFix) {\n // opted-in to polyfill cloneNode() for slot polyfilled components\n patchCloneNodeFix(H.prototype);\n }\n if (BUILD.profile && !performance.mark) {\n // not all browsers support performance.mark/measure (Safari 10)\n // because the mark/measure APIs are designed to write entries to a buffer in the browser that does not exist,\n // simply stub the implementations out.\n // TODO(STENCIL-323): Remove this patch when support for older browsers is removed (breaking)\n // @ts-ignore\n performance.mark = performance.measure = () => {\n /*noop*/\n };\n performance.getEntriesByName = () => [];\n }\n // @ts-ignore\n const scriptElm = \n // TODO(STENCIL-661): Remove code related to the dynamic import shim\n // TODO(STENCIL-663): Remove code related to deprecated `safari10` field.\n BUILD.scriptDataOpts || BUILD.safari10 || BUILD.dynamicImportShim\n ? Array.from(doc.querySelectorAll('script')).find((s) => new RegExp(`\\/${NAMESPACE}(\\\\.esm)?\\\\.js($|\\\\?|#)`).test(s.src) ||\n s.getAttribute('data-stencil-namespace') === NAMESPACE)\n : null;\n const importMeta = import.meta.url;\n const opts = BUILD.scriptDataOpts ? (scriptElm || {})['data-opts'] || {} : {};\n // TODO(STENCIL-663): Remove code related to deprecated `safari10` field.\n if (BUILD.safari10 && 'onbeforeload' in scriptElm && !history.scrollRestoration /* IS_ESM_BUILD */) {\n // Safari < v11 support: This IF is true if it's Safari below v11.\n // This fn cannot use async/await since Safari didn't support it until v11,\n // however, Safari 10 did support modules. Safari 10 also didn't support \"nomodule\",\n // so both the ESM file and nomodule file would get downloaded. Only Safari\n // has 'onbeforeload' in the script, and \"history.scrollRestoration\" was added\n // to Safari in v11. Return a noop then() so the async/await ESM code doesn't continue.\n // IS_ESM_BUILD is replaced at build time so this check doesn't happen in systemjs builds.\n return {\n then() {\n /* promise noop */\n },\n };\n }\n // TODO(STENCIL-663): Remove code related to deprecated `safari10` field.\n if (!BUILD.safari10 && importMeta !== '') {\n opts.resourcesUrl = new URL('.', importMeta).href;\n // TODO(STENCIL-661): Remove code related to the dynamic import shim\n // TODO(STENCIL-663): Remove code related to deprecated `safari10` field.\n }\n else if (BUILD.dynamicImportShim || BUILD.safari10) {\n opts.resourcesUrl = new URL('.', new URL(scriptElm.getAttribute('data-resources-url') || scriptElm.src, win.location.href)).href;\n // TODO(STENCIL-661): Remove code related to the dynamic import shim\n if (BUILD.dynamicImportShim) {\n patchDynamicImport(opts.resourcesUrl, scriptElm);\n }\n // TODO(STENCIL-661): Remove code related to the dynamic import shim\n if (BUILD.dynamicImportShim && !win.customElements) {\n // module support, but no custom elements support (Old Edge)\n // @ts-ignore\n return import(/* webpackChunkName: \"polyfills-dom\" */ './dom.js').then(() => opts);\n }\n }\n return promiseResolve(opts);\n};\n// TODO(STENCIL-661): Remove code related to the dynamic import shim\nconst patchDynamicImport = (base, orgScriptElm) => {\n const importFunctionName = getDynamicImportFunction(NAMESPACE);\n try {\n // test if this browser supports dynamic imports\n // There is a caching issue in V8, that breaks using import() in Function\n // By generating a random string, we can workaround it\n // Check https://bugs.chromium.org/p/chromium/issues/detail?id=990810 for more info\n win[importFunctionName] = new Function('w', `return import(w);//${Math.random()}`);\n }\n catch (e) {\n // this shim is specifically for browsers that do support \"esm\" imports\n // however, they do NOT support \"dynamic\" imports\n // basically this code is for old Edge, v18 and below\n const moduleMap = new Map();\n win[importFunctionName] = (src) => {\n var _a;\n const url = new URL(src, base).href;\n let mod = moduleMap.get(url);\n if (!mod) {\n const script = doc.createElement('script');\n script.type = 'module';\n script.crossOrigin = orgScriptElm.crossOrigin;\n script.src = URL.createObjectURL(new Blob([`import * as m from '${url}'; window.${importFunctionName}.m = m;`], {\n type: 'application/javascript',\n }));\n // Apply CSP nonce to the script tag if it exists\n const nonce = (_a = plt.$nonce$) !== null && _a !== void 0 ? _a : queryNonceMetaTagContent(doc);\n if (nonce != null) {\n script.setAttribute('nonce', nonce);\n }\n mod = new Promise((resolve) => {\n script.onload = () => {\n resolve(win[importFunctionName].m);\n script.remove();\n };\n });\n moduleMap.set(url, mod);\n doc.head.appendChild(script);\n }\n return mod;\n };\n }\n};\nconst patchCloneNodeFix = (HTMLElementPrototype) => {\n const nativeCloneNodeFn = HTMLElementPrototype.cloneNode;\n HTMLElementPrototype.cloneNode = function (deep) {\n if (this.nodeName === 'TEMPLATE') {\n return nativeCloneNodeFn.call(this, deep);\n }\n const clonedNode = nativeCloneNodeFn.call(this, false);\n const srcChildNodes = this.childNodes;\n if (deep) {\n for (let i = 0; i < srcChildNodes.length; i++) {\n // Node.ATTRIBUTE_NODE === 2, and checking because IE11\n if (srcChildNodes[i].nodeType !== 2) {\n clonedNode.appendChild(srcChildNodes[i].cloneNode(true));\n }\n }\n }\n return clonedNode;\n };\n};\nexport { patchBrowser };\n","export { setNonce } from '@stencil/core';\nimport { bootstrapLazy } from '@stencil/core';\nimport { patchBrowser } from '@stencil/core/internal/client/patch-browser';\nimport { globalScripts } from '@stencil/core/internal/app-globals';\npatchBrowser().then(options => {\n globalScripts();\n return bootstrapLazy([/*!__STENCIL_LAZY_DATA__*/], options);\n});\n"],"version":3}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
7
7
|
|
|
8
|
-
const index = require('./index-
|
|
8
|
+
const index = require('./index-ee2ef5ae.js');
|
|
9
9
|
|
|
10
10
|
const Clipboard = class {
|
|
11
11
|
constructor(hostRef) {
|
|
@@ -19,21 +19,35 @@ const Clipboard = class {
|
|
|
19
19
|
this.beforeCopy = index.createEvent(this, "beforecopy", 7);
|
|
20
20
|
this.beforeCopyApply = index.createEvent(this, "beforecopyapply", 7);
|
|
21
21
|
this.copyRegion = index.createEvent(this, "copyRegion", 3);
|
|
22
|
+
this.readonly = undefined;
|
|
22
23
|
}
|
|
23
24
|
onPaste(e) {
|
|
25
|
+
// if readonly do nothing
|
|
26
|
+
if (this.readonly) {
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
24
29
|
const clipboardData = this.getData(e);
|
|
25
30
|
const isHTML = clipboardData.types.indexOf('text/html') > -1;
|
|
26
31
|
const data = isHTML ? clipboardData.getData('text/html') : clipboardData.getData('text');
|
|
32
|
+
const dataText = clipboardData.getData('text');
|
|
27
33
|
const beforePaste = this.beforePaste.emit({
|
|
28
34
|
raw: data,
|
|
35
|
+
dataText,
|
|
29
36
|
isHTML,
|
|
30
37
|
event: e,
|
|
31
38
|
});
|
|
32
39
|
if (beforePaste.defaultPrevented) {
|
|
33
40
|
return;
|
|
34
41
|
}
|
|
35
|
-
|
|
36
|
-
|
|
42
|
+
let parsedData;
|
|
43
|
+
// if html, then search for table if no table fallback to regular text parsing
|
|
44
|
+
if (beforePaste.detail.isHTML) {
|
|
45
|
+
const table = this.htmlParse(beforePaste.detail.raw);
|
|
46
|
+
parsedData = table || this.textParse(dataText);
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
parsedData = this.textParse(beforePaste.detail.raw);
|
|
50
|
+
}
|
|
37
51
|
const beforePasteApply = this.beforePasteApply.emit({
|
|
38
52
|
raw: data,
|
|
39
53
|
parsed: parsedData,
|
|
@@ -70,8 +84,8 @@ const Clipboard = class {
|
|
|
70
84
|
e.preventDefault();
|
|
71
85
|
}
|
|
72
86
|
/**
|
|
73
|
-
|
|
74
|
-
|
|
87
|
+
* Listen to copy event and emit copy region event
|
|
88
|
+
*/
|
|
75
89
|
cutStarted(e) {
|
|
76
90
|
const beforeCut = this.beforeCut.emit({
|
|
77
91
|
event: e,
|
|
@@ -81,6 +95,10 @@ const Clipboard = class {
|
|
|
81
95
|
}
|
|
82
96
|
const data = this.getData(beforeCut.detail.event);
|
|
83
97
|
this.copyStarted(e);
|
|
98
|
+
// if readonly do nothing
|
|
99
|
+
if (this.readonly) {
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
84
102
|
this.clearRegion.emit(data);
|
|
85
103
|
e.preventDefault();
|
|
86
104
|
}
|
|
@@ -111,7 +129,7 @@ const Clipboard = class {
|
|
|
111
129
|
const fragment = document.createRange().createContextualFragment(data);
|
|
112
130
|
const table = fragment.querySelector('table');
|
|
113
131
|
if (!table) {
|
|
114
|
-
return
|
|
132
|
+
return null;
|
|
115
133
|
}
|
|
116
134
|
for (const rgRow of Array.from(table.rows)) {
|
|
117
135
|
result.push(Array.from(rg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","names":[],"sources":["./src/components/clipboard/revogr-clipboard.tsx"],"sourcesContent":["import { Component, Listen, Method, Event, EventEmitter } from '@stencil/core';\nimport { RevoGrid } from '../../interfaces';\n\n@Component({ tag: 'revogr-clipboard' })\nexport class Clipboard {\n /**\n * Fired when region pasted\n * @event pasteregion\n * @property {string[][]} data - data to paste\n * @property {boolean} defaultPrevented - if true, paste will be canceled\n */\n @Event({ bubbles: false }) pasteRegion: EventEmitter<string[][]>;\n\n /**\n * Fired before paste applied to the grid\n * @event beforepaste\n * @property {string} raw - raw data from clipboard\n * @property {ClipboardEvent} event - original event\n * @property {boolean} defaultPrevented - if true, paste will be canceled\n */\n @Event({ eventName: 'beforepaste' }) beforePaste: EventEmitter;\n\n /**\n * Fired before paste applied to the grid and after data parsed\n * @event beforepasteapply\n * @property {string} raw - raw data from clipboard\n * @property {string[][]} parsed - parsed data\n */\n @Event({ eventName: 'beforepasteapply' }) beforePasteApply: EventEmitter;\n\n /**\n * Fired after paste applied to the grid\n * @event afterpasteapply\n * @property {string} raw - raw data from clipboard\n * @property {string[][]} parsed - parsed data\n * @property {ClipboardEvent} event - original event\n * @property {boolean} defaultPrevented - if true, paste will be canceled\n */\n @Event({ eventName: 'afterpasteapply' }) afterPasteApply: EventEmitter;\n\n /**\n * Fired before cut triggered\n * @event beforecopy\n * @property {ClipboardEvent} event - original event\n * @property {boolean} defaultPrevented - if true, cut will be canceled\n */\n @Event({ eventName: 'beforecut' }) beforeCut: EventEmitter;\n\n /**\n * Clears region when cut is done\n */\n @Event() clearRegion: EventEmitter<DataTransfer>;\n\n /**\n * Fired before copy triggered\n * @event beforecopy\n * @property {ClipboardEvent} event - original event\n * @property {boolean} defaultPrevented - if true, copy will be canceled\n */\n @Event({ eventName: 'beforecopy' }) beforeCopy: EventEmitter;\n\n /**\n * Fired before copy applied to the clipboard\n * @event beforecopyapply\n * @property {DataTransfer} event - original event\n * @property {string} data - data to copy\n * @property {boolean} defaultPrevented - if true, copy will be canceled\n */\n @Event({ eventName: 'beforecopyapply' }) beforeCopyApply: EventEmitter;\n\n /**\n * Fired when region copied\n * @event copyregion\n * @property {DataTransfer} data - data to copy\n * @property {boolean} defaultPrevented - if true, copy will be canceled\n */\n @Event({ bubbles: false }) copyRegion: EventEmitter<DataTransfer>;\n @Listen('paste', { target: 'document' }) onPaste(e: ClipboardEvent) {\n const clipboardData = this.getData(e);\n const isHTML = clipboardData.types.indexOf('text/html') > -1;\n const data = isHTML ? clipboardData.getData('text/html') : clipboardData.getData('text');\n const beforePaste = this.beforePaste.emit({\n raw: data,\n isHTML,\n event: e,\n });\n\n if (beforePaste.defaultPrevented) {\n return;\n }\n\n const parsedData = beforePaste.detail.isHTML ?\n this.htmlParse(beforePaste.detail.raw) : this.textParse(beforePaste.detail.raw);\n const beforePasteApply = this.beforePasteApply.emit({\n raw: data,\n parsed: parsedData,\n event: e,\n });\n if (beforePasteApply.defaultPrevented) {\n return;\n }\n this.pasteRegion.emit(beforePasteApply.detail.parsed);\n // post paste action\n const afterPasteApply = this.afterPasteApply.emit({\n raw: data,\n parsed: parsedData,\n event: e,\n });\n // keep default behavior if needed\n if (afterPasteApply.defaultPrevented) {\n return;\n }\n e.preventDefault();\n }\n\n /**\n * Listen to copy event and emit copy region event\n */\n @Listen('copy', { target: 'document' }) copyStarted(e: ClipboardEvent) {\n const beforeCopy = this.beforeCopy.emit({\n event: e,\n });\n if (beforeCopy.defaultPrevented) {\n return;\n }\n const data = this.getData(beforeCopy.detail.event);\n this.copyRegion.emit(data);\n e.preventDefault();\n }\n\n /**\n * Listen to copy event and emit copy region event\n */\n @Listen('cut', { target: 'document' }) cutStarted(e: ClipboardEvent) {\n const beforeCut = this.beforeCut.emit({\n event: e,\n });\n if (beforeCut.defaultPrevented) {\n return;\n }\n const data = this.getData(beforeCut.detail.event);\n this.copyStarted(e);\n this.clearRegion.emit(data);\n e.preventDefault();\n }\n\n @Method() async doCopy(e: DataTransfer, data?: RevoGrid.DataFormat[][]) {\n const beforeCopyApply = this.beforeCopyApply.emit({\n event: e,\n data,\n });\n if (beforeCopyApply.defaultPrevented) {\n return;\n }\n const parsed = data ? this.parserCopy(data) : '';\n e.setData('text/plain', parsed);\n }\n\n parserCopy(data: RevoGrid.DataFormat[][]) {\n return data.map(rgRow => rgRow.join('\\t')).join('\\n');\n }\n\n private textParse(data: string) {\n const result: string[][] = [];\n const rows = data.split(/\\r\\n|\\n|\\r/);\n for (let y in rows) {\n result.push(rows[y].split('\\t'));\n }\n return result;\n }\n\n private htmlParse(data: string) {\n const result: string[][] = [];\n const fragment = document.createRange().createContextualFragment(data);\n const table = fragment.querySelector('table');\n if (!table) {\n return this.textParse(data);\n }\n for (const rgRow of Array.from(table.rows)) {\n result.push(Array.from(rgRow.cells).map(cell => cell.innerText));\n }\n return result;\n }\n\n private getData(e: ClipboardEvent) {\n return e.clipboardData || ((window as unknown) as { clipboardData: DataTransfer | null })?.clipboardData;\n }\n}\n"],"version":3}
|
|
1
|
+
{"file":"revogr-clipboard.entry.cjs.js","mappings":";;;;;;;;;MAIa,SAAS;;;;;;;;;;;;;;EA+EqB,OAAO,CAAC,CAAiB;;IAEhE,IAAI,IAAI,CAAC,QAAQ,EAAE;MACjB,OAAO;KACR;IACD,MAAM,aAAa,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IACtC,MAAM,MAAM,GAAG,aAAa,CAAC,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC;IAC7D,MAAM,IAAI,GAAG,MAAM,GAAG,aAAa,CAAC,OAAO,CAAC,WAAW,CAAC,GAAG,aAAa,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IACzF,MAAM,QAAQ,GAAG,aAAa,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAE/C,MAAM,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC;MACxC,GAAG,EAAE,IAAI;MACT,QAAQ;MACR,MAAM;MACN,KAAK,EAAE,CAAC;K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ACtC,KAAK,IAAI,CAAC,IAAI,IAAI,EAAE;MAClB,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;KAClC;IACD,OAAO,MAAM,CAAC;GACf;EAEO,SAAS,CAAC,IAAY;IAC5B,MAAM,MAAM,GAAe,EAAE,CAAC;IAC9B,MAAM,QAAQ,GAAG,QAAQ,CAAC,WAAW,EAAE,CAAC,wBAAwB,CAAC,IAAI,CAAC,CAAC;IACvE,MAAM,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;IAC9C,IAAI,CAAC,KAAK,EAAE;MACV,OAAO,IAAI,CAAC;KACb;IACD,KAAK,MAAM,KAAK,IAAI,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE;MAC1C,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,IAAI,IAAI,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC;KAClE;IACD,OAAO,MAAM,CAAC;GACf;EAEO,OAAO,CAAC,CAAiB;IAC/B,OAAO,CAAC,CAAC,aAAa,KAAK,MAA4D,aAA5D,MAAM,uBAAN,MAAM,CAAwD,aAAa,CAAA,CAAC;GACxG;;;;;","names":[],"sources":["./src/components/clipboard/revogr-clipboard.tsx"],"sourcesContent":["import { Component, Listen, Method, Event, EventEmitter, Prop } from '@stencil/core';\nimport { RevoGrid } from '../../interfaces';\n\n@Component({ tag: 'revogr-clipboard' })\nexport class Clipboard {\n /**\n * If readonly mode enables no need for Paste event\n */\n @Prop() readonly: boolean;\n\n /**\n * Fired when region pasted\n * @event pasteregion\n * @property {string[][]} data - data to paste\n * @property {boolean} defaultPrevented - if true, paste will be canceled\n */\n @Event({ bubbles: false }) pasteRegion: EventEmitter<string[][]>;\n\n /**\n * Fired before paste applied to the grid\n * @event beforepaste\n * @property {string} raw - raw data from clipboard\n * @property {ClipboardEvent} event - original event\n * @property {boolean} defaultPrevented - if true, paste will be canceled\n */\n @Event({ eventName: 'beforepaste' }) beforePaste: EventEmitter;\n\n /**\n * Fired before paste applied to the grid and after data parsed\n * @event beforepasteapply\n * @property {string} raw - raw data from clipboard\n * @property {string[][]} parsed - parsed data\n */\n @Event({ eventName: 'beforepasteapply' }) beforePasteApply: EventEmitter;\n\n /**\n * Fired after paste applied to the grid\n * @event afterpasteapply\n * @property {string} raw - raw data from clipboard\n * @property {string[][]} parsed - parsed data\n * @property {ClipboardEvent} event - original event\n * @property {boolean} defaultPrevented - if true, paste will be canceled\n */\n @Event({ eventName: 'afterpasteapply' }) afterPasteApply: EventEmitter;\n\n /**\n * Fired before cut triggered\n * @event beforecopy\n * @property {ClipboardEvent} event - original event\n * @property {boolean} defaultPrevented - if true, cut will be canceled\n */\n @Event({ eventName: 'beforecut' }) beforeCut: EventEmitter;\n\n /**\n * Clears region when cut is done\n */\n @Event() clearRegion: EventEmitter<DataTransfer>;\n\n /**\n * Fired before copy triggered\n * @event beforecopy\n * @property {ClipboardEvent} event - original event\n * @property {boolean} defaultPrevented - if true, copy will be canceled\n */\n @Event({ eventName: 'beforecopy' }) beforeCopy: EventEmitter;\n\n /**\n * Fired before copy applied to the clipboard\n * @event beforecopyapply\n * @property {DataTransfer} event - original event\n * @property {string} data - data to copy\n * @property {boolean} defaultPrevented - if true, copy will be canceled\n */\n @Event({ eventName: 'beforecopyapply' }) beforeCopyApply: EventEmitter;\n\n /**\n * Fired when region copied\n * @event copyregion\n * @property {DataTransfer} data - data to copy\n * @property {boolean} defaultPrevented - if true, copy will be canceled\n */\n @Event({ bubbles: false }) copyRegion: EventEmitter<DataTransfer>;\n\n @Listen('paste', { target: 'document' }) onPaste(e: ClipboardEvent) {\n // if readonly do nothing\n if (this.readonly) {\n return;\n }\n const clipboardData = this.getData(e);\n const isHTML = clipboardData.types.indexOf('text/html') > -1;\n const data = isHTML ? clipboardData.getData('text/html') : clipboardData.getData('text');\n const dataText = clipboardData.getData('text');\n\n const beforePaste = this.beforePaste.emit({\n raw: data,\n dataText,\n isHTML,\n event: e,\n });\n\n if (beforePaste.defaultPrevented) {\n return;\n }\n\n let parsedData: string[][];\n // if html, then search for table if no table fallback to regular text parsing\n if (beforePaste.detail.isHTML) {\n const table = this.htmlParse(beforePaste.detail.raw);\n parsedData = table || this.textParse(dataText);\n } else {\n parsedData = this.textParse(beforePaste.detail.raw);\n }\n const beforePasteApply = this.beforePasteApply.emit({\n raw: data,\n parsed: parsedData,\n event: e,\n });\n if (beforePasteApply.defaultPrevented) {\n return;\n }\n this.pasteRegion.emit(beforePasteApply.detail.parsed);\n // post paste action\n const afterPasteApply = this.afterPasteApply.emit({\n raw: data,\n parsed: parsedData,\n event: e,\n });\n // keep default behavior if needed\n if (afterPasteApply.defaultPrevented) {\n return;\n }\n e.preventDefault();\n }\n\n /**\n * Listen to copy event and emit copy region event\n */\n @Listen('copy', { target: 'document' }) copyStarted(e: ClipboardEvent) {\n const beforeCopy = this.beforeCopy.emit({\n event: e,\n });\n if (beforeCopy.defaultPrevented) {\n return;\n }\n const data = this.getData(beforeCopy.detail.event);\n this.copyRegion.emit(data);\n e.preventDefault();\n }\n\n /**\n * Listen to copy event and emit copy region event\n */\n @Listen('cut', { target: 'document' }) cutStarted(e: ClipboardEvent) {\n const beforeCut = this.beforeCut.emit({\n event: e,\n });\n if (beforeCut.defaultPrevented) {\n return;\n }\n const data = this.getData(beforeCut.detail.event);\n this.copyStarted(e);\n\n // if readonly do nothing\n if (this.readonly) {\n return;\n }\n\n this.clearRegion.emit(data);\n e.preventDefault();\n }\n\n @Method() async doCopy(e: DataTransfer, data?: RevoGrid.DataFormat[][]) {\n const beforeCopyApply = this.beforeCopyApply.emit({\n event: e,\n data,\n });\n if (beforeCopyApply.defaultPrevented) {\n return;\n }\n const parsed = data ? this.parserCopy(data) : '';\n e.setData('text/plain', parsed);\n }\n\n parserCopy(data: RevoGrid.DataFormat[][]) {\n return data.map(rgRow => rgRow.join('\\t')).join('\\n');\n }\n\n private textParse(data: string) {\n const result: string[][] = [];\n const rows = data.split(/\\r\\n|\\n|\\r/);\n for (let y in rows) {\n result.push(rows[y].split('\\t'));\n }\n return result;\n }\n\n private htmlParse(data: string) {\n const result: string[][] = [];\n const fragment = document.createRange().createContextualFragment(data);\n const table = fragment.querySelector('table');\n if (!table) {\n return null;\n }\n for (const rgRow of Array.from(table.rows)) {\n result.push(Array.from(rgRow.cells).map(cell => cell.innerText));\n }\n return result;\n }\n\n private getData(e: ClipboardEvent) {\n return e.clipboardData || (window as unknown as { clipboardData: DataTransfer | null })?.clipboardData;\n }\n}\n"],"version":3}
|