@revolist/revogrid 4.9.0 → 4.9.2
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/revogr-attribution_6.cjs.entry.js +14 -8
- package/dist/cjs/revogr-attribution_6.cjs.entry.js.map +1 -1
- package/dist/cjs/revogr-clipboard_3.cjs.entry.js +5 -2
- package/dist/cjs/revogr-clipboard_3.cjs.entry.js.map +1 -1
- package/dist/cjs/revogr-data_4.cjs.entry.js +17 -4
- package/dist/cjs/revogr-data_4.cjs.entry.js.map +1 -1
- package/dist/collection/components/clipboard/revogr-clipboard.js +66 -87
- package/dist/collection/components/clipboard/revogr-clipboard.js.map +1 -1
- package/dist/collection/components/header/header-renderer.js +18 -5
- package/dist/collection/components/header/header-renderer.js.map +1 -1
- package/dist/collection/components/header/revogr-header.js +2 -2
- package/dist/collection/components/overlay/autofill.service.js +6 -8
- package/dist/collection/components/overlay/autofill.service.js.map +1 -1
- package/dist/collection/components/overlay/revogr-overlay-selection.js +22 -10
- package/dist/collection/components/overlay/revogr-overlay-selection.js.map +1 -1
- package/dist/collection/components/overlay/selection.utils.js +9 -1
- package/dist/collection/components/overlay/selection.utils.js.map +1 -1
- package/dist/collection/types/interfaces.js.map +1 -1
- package/dist/esm/revogr-attribution_6.entry.js +15 -9
- package/dist/esm/revogr-attribution_6.entry.js.map +1 -1
- package/dist/esm/revogr-clipboard_3.entry.js +5 -2
- package/dist/esm/revogr-clipboard_3.entry.js.map +1 -1
- package/dist/esm/revogr-data_4.entry.js +17 -4
- package/dist/esm/revogr-data_4.entry.js.map +1 -1
- package/dist/revo-grid/revogr-attribution_6.entry.js +1 -1
- package/dist/revo-grid/revogr-attribution_6.entry.js.map +1 -1
- package/dist/revo-grid/revogr-clipboard_3.entry.js.map +1 -1
- package/dist/revo-grid/revogr-data_4.entry.js +1 -1
- package/dist/revo-grid/revogr-data_4.entry.js.map +1 -1
- package/dist/types/components/clipboard/revogr-clipboard.d.ts +32 -24
- package/dist/types/components/overlay/autofill.service.d.ts +3 -1
- package/dist/types/components/overlay/revogr-overlay-selection.d.ts +12 -3
- package/dist/types/components/overlay/selection.utils.d.ts +4 -1
- package/dist/types/components.d.ts +67 -42
- package/dist/types/types/interfaces.d.ts +16 -1
- package/hydrate/index.js +36 -14
- package/hydrate/index.mjs +36 -14
- package/package.json +1 -1
- package/readme.md +2 -0
- package/standalone/column.service.js +1 -2
- package/standalone/column.service.js.map +1 -1
- package/standalone/data.store.js +2950 -3
- package/standalone/data.store.js.map +1 -1
- package/standalone/debounce.js +1 -1
- package/standalone/dimension.helpers.js +2 -2
- package/standalone/revo-grid.js +1 -2
- package/standalone/revo-grid.js.map +1 -1
- package/standalone/revogr-clipboard2.js +5 -2
- package/standalone/revogr-clipboard2.js.map +1 -1
- package/standalone/revogr-data2.js +0 -1
- package/standalone/revogr-data2.js.map +1 -1
- package/standalone/revogr-focus2.js +0 -1
- package/standalone/revogr-focus2.js.map +1 -1
- package/standalone/revogr-header2.js +18 -6
- package/standalone/revogr-header2.js.map +1 -1
- package/standalone/revogr-order-editor2.js +0 -1
- package/standalone/revogr-order-editor2.js.map +1 -1
- package/standalone/revogr-overlay-selection2.js +8 -11
- package/standalone/revogr-overlay-selection2.js.map +1 -1
- package/standalone/revogr-row-headers2.js +0 -1
- package/standalone/revogr-row-headers2.js.map +1 -1
- package/standalone/selection.utils.js +10 -2
- package/standalone/selection.utils.js.map +1 -1
- package/standalone/toNumber.js +1 -1
- package/standalone/_baseIteratee.js +0 -2956
- package/standalone/_baseIteratee.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"revogr-overlay-selection.js","sourceRoot":"","sources":["../../../src/components/overlay/revogr-overlay-selection.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,KAAK,EAEL,CAAC,EACD,IAAI,EACJ,MAAM,EACN,IAAI,EAEJ,OAAO,EACP,KAAK,GACN,MAAM,eAAe,CAAC;AACvB,O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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {\n Component,\n Event,\n EventEmitter,\n h,\n Host,\n Listen,\n Prop,\n VNode,\n Element,\n Watch,\n} from '@stencil/core';\nimport ColumnService from '../data/column.service';\nimport { codesLetter } from '../../utils/key.codes';\nimport { MOBILE_CLASS, SELECTION_BORDER_CLASS } from '../../utils/consts';\nimport { DSourceState } from '@store';\nimport {\n getRange,\n isRangeSingleCell,\n} from '@store';\nimport {\n EventData,\n getElStyle,\n getFocusCellBasedOnEvent,\n} from './selection.utils';\nimport { isEditInput } from '../editors/edit.utils';\nimport { KeyboardService } from './keyboard.service';\nimport { AutoFillService } from './autofill.service';\nimport { verifyTouchTarget } from '../../utils/events';\nimport {\n Observable,\n SelectionStoreState,\n DimensionSettingsState,\n DataType,\n DimensionRows,\n ColumnRegular,\n DimensionCols,\n Cell,\n DragStartEvent,\n} from '../../components';\nimport { EditCellStore, MultiDimensionType } from '@type';\nimport {\n FocusRenderEvent,\n ApplyFocusEvent,\n AllDimensionType,\n DataFormat,\n} from '@type';\nimport {\n Editors,\n BeforeSaveDataDetails,\n BeforeEdit,\n RangeArea,\n TempRange,\n ChangedRange,\n BeforeRangeSaveDataDetails,\n SaveDataDetails,\n} from '@type';\n\n/**\n * Component for overlaying the grid with the selection.\n */\n@Component({\n tag: 'revogr-overlay-selection',\n styleUrl: 'revogr-overlay-style.scss',\n})\nexport class OverlaySelection {\n // #region Properties\n /**\n * Readonly mode.\n */\n @Prop() readonly: boolean;\n /**\n * Range selection allowed.\n */\n @Prop() range: boolean;\n /**\n * Enable revogr-order-editor component (read more in revogr-order-editor component).\n * Allows D&D.\n */\n @Prop() canDrag: boolean;\n\n /**\n * Enable revogr-clipboard component (read more in revogr-clipboard component).\n * Allows copy/paste.\n */\n @Prop() useClipboard: boolean;\n\n /** Stores */\n /** Selection, range, focus. */\n @Prop() selectionStore: Observable<SelectionStoreState>;\n /** Dimension settings Y. */\n @Prop() dimensionRow: Observable<DimensionSettingsState>;\n /** Dimension settings X. */\n @Prop() dimensionCol: Observable<DimensionSettingsState>;\n\n // --------------------------------------------------------------------------\n //\n // Static stores, not expected to change during component lifetime\n //\n // --------------------------------------------------------------------------\n\n /**\n * Row data store.\n */\n @Prop() dataStore: Observable<DSourceState<DataType, DimensionRows>>;\n\n /**\n * Column data store.\n */\n @Prop() colData: Observable<DSourceState<ColumnRegular, DimensionCols>>;\n /**\n * Last real coordinates positions + 1.\n */\n @Prop() lastCell: Cell;\n /**\n * Custom editors register.\n */\n @Prop() editors: Editors;\n /**\n * If true applys changes when cell closes if not Escape.\n */\n @Prop() applyChangesOnClose = false;\n /**\n * Additional data to pass to renderer.\n */\n @Prop() additionalData: any;\n\n /**\n * Is mobile view mode.\n */\n @Prop() isMobileDevice: boolean;\n\n // #endregion\n\n // #region Events\n /**\n * Before clipboard copy happened. Validate data before copy.\n * To prevent the default behavior of editing data and use your own implementation, call `e.preventDefault()`.\n */\n @Event({ eventName: 'beforecopyregion', cancelable: true })\n beforeCopyRegion: EventEmitter;\n /**\n * Before region paste happened.\n */\n @Event({ eventName: 'beforepasteregion', cancelable: true })\n beforeRegionPaste: EventEmitter;\n\n /**\n * Cell edit apply to the data source.\n * Triggers datasource edit on the root level.\n */\n @Event({ eventName: 'celleditapply', cancelable: true })\n cellEditApply: EventEmitter<BeforeSaveDataDetails>;\n\n /**\n * Before cell focus.\n */\n @Event({ eventName: 'beforecellfocusinit', cancelable: true })\n beforeFocusCell: EventEmitter<BeforeSaveDataDetails>;\n\n\n /**\n * Fired when change of viewport happens.\n * Usually when we switch between pinned regions.\n */\n @Event({ eventName: 'beforenextvpfocus', cancelable: true })\n beforeNextViewportFocus: EventEmitter<Cell>;\n\n /**\n * Set edit cell.\n */\n @Event({ eventName: 'setedit' }) setEdit: EventEmitter<BeforeEdit>;\n\n /**\n * Before range applied.\n */\n @Event({ eventName: 'beforeapplyrange' })\n beforeApplyRange: EventEmitter<FocusRenderEvent>;\n /**\n * Before range selection applied.\n */\n @Event({ eventName: 'beforesetrange' }) beforeSetRange: EventEmitter;\n\n /**\n * Before editor render.\n */\n @Event({ eventName: 'beforeeditrender' })\n beforeEditRender: EventEmitter<FocusRenderEvent>;\n\n /**\n * Set range.\n */\n @Event({ eventName: 'setrange' }) setRange: EventEmitter<\n RangeArea & { type: MultiDimensionType }\n >;\n\n /** Select all. */\n @Event({ eventName: 'selectall' }) selectAll: EventEmitter;\n /**\n * Used for editors support when editor close requested.\n */\n @Event({ eventName: 'canceledit' }) cancelEdit: EventEmitter;\n\n /**\n * Set temp range area during autofill.\n */\n @Event({ eventName: 'settemprange' })\n setTempRange: EventEmitter<TempRange | null>;\n\n /**\n * Before cell get focused.\n * To prevent the default behavior of applying the edit data, you can call `e.preventDefault()`.\n */\n @Event({ eventName: 'applyfocus' })\n applyFocus: EventEmitter<FocusRenderEvent>;\n\n /**\n * Cell get focused.\n * To prevent the default behavior of applying the edit data, you can call `e.preventDefault()`.\n */\n @Event({ eventName: 'focuscell' }) focusCell: EventEmitter<ApplyFocusEvent>;\n /** Range data apply. */\n @Event({ eventName: 'beforerangedataapply' })\n beforeRangeDataApply: EventEmitter<FocusRenderEvent>;\n /** Selection range changed. */\n @Event({ eventName: 'selectionchangeinit', cancelable: true })\n selectionChange: EventEmitter<ChangedRange>;\n /** Before range copy. */\n @Event({ eventName: 'beforerangecopyapply', cancelable: true, bubbles: true })\n beforeRangeCopyApply: EventEmitter<ChangedRange>;\n\n /** Range data apply.\n * Triggers datasource edit on the root level.\n */\n @Event({ eventName: 'rangeeditapply', cancelable: true })\n rangeEditApply: EventEmitter<BeforeRangeSaveDataDetails>;\n /** Range copy. */\n @Event({ eventName: 'clipboardrangecopy', cancelable: true })\n rangeClipboardCopy: EventEmitter;\n @Event({ eventName: 'clipboardrangepaste', cancelable: true })\n rangeClipboardPaste: EventEmitter;\n\n /**\n * Before key up event proxy, used to prevent key up trigger.\n * If you have some custom behaviour event, use this event to check if it wasn't processed by internal logic.\n * Call preventDefault().\n */\n @Event({ eventName: 'beforekeydown' })\n beforeKeyDown: EventEmitter<KeyboardEvent>;\n /**\n * Before key down event proxy, used to prevent key down trigger.\n * If you have some custom behaviour event, use this event to check if it wasn't processed by internal logic.\n * Call preventDefault().\n */\n @Event({ eventName: 'beforekeyup' }) beforeKeyUp: EventEmitter<KeyboardEvent>;\n /**\n * Runs before cell save.\n * Can be used to override or cancel original save.\n */\n @Event({ eventName: 'beforecellsave', cancelable: true })\n beforeCellSave: EventEmitter;\n\n // #endregion\n\n // #region Private Properties\n @Element() element: HTMLElement;\n private clipboard: HTMLRevogrClipboardElement;\n\n protected columnService: ColumnService;\n private keyboardService: KeyboardService | null = null;\n private autoFillService: AutoFillService | null = null;\n private orderEditor: HTMLRevogrOrderEditorElement;\n private revogrEdit: HTMLRevogrEditElement | null = null;\n private unsubscribeSelectionStore: { (): void }[] = [];\n // #endregion\n\n // #region Listeners\n @Listen('touchmove', { target: 'document' })\n @Listen('mousemove', { target: 'document' })\n onMouseMove(e: MouseEvent | TouchEvent) {\n if (this.selectionStore.get('focus')) {\n this.autoFillService.selectionMouseMove(e);\n }\n }\n\n /**\n * Action finished inside of the document.\n * Pointer left document, clear any active operation.\n */\n @Listen('touchend', { target: 'document' })\n @Listen('mouseup', { target: 'document' })\n @Listen('mouseleave', { target: 'document' })\n onMouseUp() {\n // Clear auto fill selection\n // when pointer left document,\n // clear any active operation.\n this.autoFillService.clearAutoFillSelection(\n this.selectionStore.get('focus'),\n this.selectionStore.get('range'),\n );\n }\n\n /**\n * Row drag started.\n * This event is fired when drag action started on cell.\n */\n @Listen('dragstartcell') onCellDrag(e: CustomEvent<DragStartEvent>) {\n // Invoke drag start on order editor.\n this.orderEditor?.dragStart(e.detail);\n }\n\n /**\n * Get keyboard down from element.\n * This event is fired when keyboard key is released.\n */\n @Listen('keyup', { target: 'document' }) onKeyUp(e: KeyboardEvent) {\n // Emit before key up event.\n this.beforeKeyUp.emit(e);\n }\n\n /**\n * Get keyboard down from element.\n * This event is fired when keyboard key is pressed.\n */\n @Listen('keydown', { target: 'document' }) onKeyDown(e: KeyboardEvent) {\n // Emit before key down event and check if default prevention is set.\n const proxy = this.beforeKeyDown.emit(e);\n if (e.defaultPrevented || proxy.defaultPrevented) {\n return;\n }\n // Invoke key down on keyboard service.\n this.keyboardService?.keyDown(\n e,\n this.range,\n !!this.selectionStore.get('edit'),\n {\n focus: this.selectionStore.get('focus'),\n range: this.selectionStore.get('range'),\n },\n );\n }\n // #endregion\n\n /**\n * Selection & Keyboard\n */\n @Watch('selectionStore') selectionServiceSet(\n s: Observable<SelectionStoreState>,\n ) {\n // clear subscriptions\n this.unsubscribeSelectionStore.forEach(v => v());\n this.unsubscribeSelectionStore.length = 0;\n this.unsubscribeSelectionStore.push(s.onChange('nextFocus', (v) => this.doFocus(v, v)));\n\n this.keyboardService = new KeyboardService({\n selectionStore: s,\n range: r => this.triggerRangeEvent(r),\n focus: (f, changes, focusNextViewport) => {\n if (focusNextViewport) {\n this.beforeNextViewportFocus.emit(f);\n return false;\n } else {\n return this.doFocus(f, f, changes);\n }\n },\n change: val => {\n if (this.readonly) {\n return;\n }\n this.doEdit(val);\n },\n cancel: async () => {\n await this.revogrEdit.cancelChanges();\n this.closeEdit();\n },\n clearCell: () => !this.readonly && this.clearCell(),\n internalPaste: () => !this.readonly && this.beforeRegionPaste.emit(),\n getData: () => this.getData(),\n selectAll: () => this.selectAll.emit(),\n });\n this.createAutoFillService();\n }\n /** Autofill */\n @Watch('dimensionRow')\n @Watch('dimensionCol')\n createAutoFillService() {\n this.autoFillService = new AutoFillService({\n dimensionRow: this.dimensionRow,\n dimensionCol: this.dimensionCol,\n columnService: this.columnService,\n dataStore: this.dataStore,\n\n clearRangeDataApply: e =>\n this.beforeRangeDataApply.emit({\n ...e,\n ...this.types,\n }),\n setTempRange: e => this.setTempRange.emit(e),\n selectionChanged: e => this.selectionChange.emit(e),\n\n rangeCopy: e => this.beforeRangeCopyApply.emit(e),\n rangeDataApply: e => this.rangeEditApply.emit(e),\n\n setRange: e => this.triggerRangeEvent(e),\n getData: () => this.getData(),\n });\n }\n\n /** Columns */\n @Watch('dataStore')\n @Watch('colData')\n columnServiceSet() {\n this.columnService?.destroy();\n this.columnService = new ColumnService(this.dataStore, this.colData);\n this.createAutoFillService();\n }\n\n connectedCallback() {\n this.columnServiceSet();\n this.selectionServiceSet(this.selectionStore);\n }\n\n disconnectedCallback() {\n // clear subscriptions\n this.unsubscribeSelectionStore.forEach(v => v());\n this.unsubscribeSelectionStore.length = 0;\n this.columnService?.destroy();\n }\n\n async componentWillRender() {\n const editCell = this.selectionStore.get('edit');\n if (!editCell) {\n await this.revogrEdit?.beforeDisconnect?.();\n }\n }\n\n private renderRange(range: RangeArea) {\n const style = getElStyle(\n range,\n this.dimensionRow.state,\n this.dimensionCol.state,\n );\n return [\n <div class={SELECTION_BORDER_CLASS} style={style}>\n {this.isMobileDevice && (\n <div class=\"range-handlers\">\n <span class={MOBILE_CLASS}></span>\n <span class={MOBILE_CLASS}></span>\n </div>\n )}\n </div>,\n ];\n }\n\n private renderEditor() {\n // Check if edit access\n const editCell = this.selectionStore.get('edit');\n // Readonly or Editor closed\n if (this.readonly || !editCell) {\n return null;\n }\n const val =\n editCell.val || this.columnService.getCellData(editCell.y, editCell.x);\n const editable = {\n ...editCell,\n ...this.columnService.getSaveData(editCell.y, editCell.x, val),\n };\n const renderEvent = this.beforeEditRender.emit({\n range: {\n ...editCell,\n x1: editCell.x,\n y1: editCell.y,\n },\n ...this.types,\n });\n\n // Render prevented\n if (renderEvent.defaultPrevented) {\n return null;\n }\n\n const style = getElStyle(\n renderEvent.detail.range,\n this.dimensionRow.state,\n this.dimensionCol.state,\n );\n return (\n <revogr-edit\n style={style}\n ref={el => (this.revogrEdit = el)}\n additionalData={this.additionalData}\n editCell={editable}\n saveOnClose={this.applyChangesOnClose}\n column={this.columnService.rowDataModel(editCell.y, editCell.x)}\n editor={this.columnService.getCellEditor(\n editCell.y,\n editCell.x,\n this.editors,\n )}\n onCloseedit={e => this.closeEdit(e)}\n onCelledit={e => {\n const saveEv = this.beforeCellSave.emit(e.detail);\n if (!saveEv.defaultPrevented) {\n this.cellEdit(saveEv.detail);\n }\n\n // if not clear navigate to next cell after edit\n if (!saveEv.detail.preventFocus) {\n this.focusNext();\n }\n }}\n />\n );\n }\n\n render() {\n const nodes: VNode[] = [];\n const editCell = this.renderEditor();\n\n // Editor\n if (editCell) {\n nodes.push(editCell);\n } else {\n const range = this.selectionStore.get('range');\n const focus = this.selectionStore.get('focus');\n\n // Clipboard\n if ((range || focus) && this.useClipboard) {\n nodes.push(\n <revogr-clipboard\n readonly={this.readonly}\n onCopyregion={e => this.onCopy(e.detail)}\n onClearregion={() => !this.readonly && this.clearCell()}\n ref={e => (this.clipboard = e)}\n onPasteregion={e => this.onPaste(e.detail)}\n />,\n );\n }\n\n // Range\n if (range) {\n nodes.push(...this.renderRange(range));\n }\n // Autofill\n if (focus && !this.readonly && this.range) {\n nodes.push(this.autoFillService.renderAutofill(range, focus));\n }\n\n // Order\n if (this.canDrag) {\n nodes.push(\n <revogr-order-editor\n ref={e => (this.orderEditor = e)}\n dataStore={this.dataStore}\n dimensionRow={this.dimensionRow}\n dimensionCol={this.dimensionCol}\n parent={this.element}\n onRowdragstartinit={e => this.rowDragStart(e)}\n />,\n );\n }\n }\n return (\n <Host\n class={{ mobile: this.isMobileDevice }}\n onDblClick={(e: MouseEvent) => this.onElementDblClick(e)}\n onMouseDown={(e: MouseEvent) => this.onElementMouseDown(e)}\n onTouchStart={(e: TouchEvent) => this.onElementMouseDown(e, true)}\n >\n {nodes}\n <slot name=\"data\" />\n </Host>\n );\n }\n\n /**\n * Executes the focus operation on the specified range of cells.\n */\n private doFocus(focus: Cell, end: Cell, changes?: Partial<Cell>) {\n const { defaultPrevented } = this.beforeFocusCell.emit(\n this.columnService.getSaveData(focus.y, focus.x),\n );\n if (defaultPrevented) {\n return false;\n }\n const evData: FocusRenderEvent = {\n range: {\n ...focus,\n x1: end.x,\n y1: end.y,\n },\n next: changes,\n ...this.types,\n };\n const applyEvent = this.applyFocus.emit(evData);\n if (applyEvent.defaultPrevented) {\n return false;\n }\n const { range } = applyEvent.detail;\n return !this.focusCell.emit({\n focus: {\n x: range.x,\n y: range.y,\n },\n end: {\n x: range.x1,\n y: range.y1,\n },\n ...applyEvent.detail,\n }).defaultPrevented;\n }\n\n private triggerRangeEvent(range: RangeArea) {\n const type = this.types.rowType;\n const applyEvent = this.beforeApplyRange.emit({\n range: { ...range },\n ...this.types,\n });\n if (applyEvent.defaultPrevented) {\n return false;\n }\n const data = this.columnService.getRangeTransformedToProps(\n applyEvent.detail.range,\n this.dataStore,\n );\n let e = this.beforeSetRange.emit(data);\n e = this.setRange.emit({ ...applyEvent.detail.range, type });\n if (e.defaultPrevented) {\n return false;\n }\n return !e.defaultPrevented;\n }\n\n /**\n * Open Editor on DblClick\n */\n private onElementDblClick(e: MouseEvent) {\n // DblClick prevented outside - Editor will not open\n \n // Get data from the component\n const data = this.getData();\n const focusCell = getFocusCellBasedOnEvent(e, data);\n if (!focusCell) {\n return;\n }\n this.doEdit();\n }\n\n /**\n * Handle mouse down event on Host element\n */\n private onElementMouseDown(e: MouseEvent | TouchEvent, touch = false) {\n // Get the target element from the event object\n const targetElement = e.target as HTMLElement | undefined;\n // Ignore focus if clicked input\n if (isEditInput(targetElement)) {\n return;\n }\n\n // Get data from the component\n const data = this.getData();\n const focusCell = getFocusCellBasedOnEvent(e, data);\n if (!focusCell) {\n return;\n }\n\n // Set focus on the current cell\n this.focus(focusCell, this.range && e.shiftKey);\n\n // Initiate autofill selection\n if (this.range) {\n this.autoFillService.selectionStart(targetElement, this.getData());\n\n // Prevent default behavior for mouse events,\n // but only if target element is not a mobile input\n if (!touch) {\n e.preventDefault();\n } else if (\n verifyTouchTarget((e as TouchEvent).touches[0], MOBILE_CLASS)\n ) {\n // Prevent default behavior for touch events\n // if target element is a mobile input\n e.preventDefault();\n }\n }\n }\n\n /**\n * Start cell editing\n */\n protected doEdit(val = '') {\n if (this.canEdit()) {\n const focus = this.selectionStore.get('focus');\n\n const data = this.columnService.getSaveData(focus.y, focus.x);\n this.setEdit?.emit({\n ...data,\n val,\n });\n }\n }\n\n /**\n * Close editor event triggered\n * @param details - if requires focus next\n */\n private closeEdit(e?: CustomEvent<boolean>) {\n this.cancelEdit.emit();\n if (e?.detail) {\n this.focusNext();\n }\n }\n\n /**\n * Edit finished.\n * Close Editor and save.\n */\n protected cellEdit(e: SaveDataDetails) {\n const dataToSave = this.columnService.getSaveData(e.rgRow, e.rgCol, e.val);\n this.cellEditApply.emit(dataToSave);\n }\n\n private getRegion() {\n const focus = this.selectionStore.get('focus');\n let range = this.selectionStore.get('range');\n if (!range) {\n range = getRange(focus, focus);\n }\n return range;\n }\n private onCopy(e: DataTransfer) {\n const range = this.getRegion();\n const canCopyEvent = this.beforeCopyRegion.emit(range);\n if (canCopyEvent.defaultPrevented) {\n return false;\n }\n let rangeData: DataFormat[][] | undefined;\n\n if (range) {\n const { data, mapping } = this.columnService.copyRangeArray(\n range,\n this.dataStore,\n );\n const event = this.rangeClipboardCopy.emit({\n range,\n data,\n mapping,\n ...this.types,\n });\n if (!event.defaultPrevented) {\n rangeData = event.detail.data;\n }\n }\n\n this.clipboard.doCopy(e, rangeData);\n return true;\n }\n\n private onPaste(data: string[][]) {\n const focus = this.selectionStore.get('focus');\n const isEditing = this.selectionStore.get('edit') !== null;\n if (!focus || isEditing) {\n return;\n }\n let { changed, range } = this.columnService.getTransformedDataToApply(\n focus,\n data,\n );\n const { defaultPrevented: canPaste } = this.rangeClipboardPaste.emit({\n data: changed,\n range,\n ...this.types,\n });\n if (canPaste) {\n return;\n }\n this.autoFillService.onRangeApply(changed, range);\n }\n\n private async focusNext() {\n const canFocus = await this.keyboardService.keyChangeSelection(\n new KeyboardEvent('keydown', {\n code: codesLetter.ARROW_DOWN,\n }),\n this.range,\n );\n if (!canFocus) {\n this.closeEdit();\n }\n }\n\n protected clearCell() {\n if (\n this.selectionStore.get('range') &&\n !isRangeSingleCell(this.selectionStore.get('range'))\n ) {\n const data = this.columnService.getRangeStaticData(\n this.selectionStore.get('range'),\n '',\n );\n this.autoFillService.onRangeApply(data, this.selectionStore.get('range'));\n } else if (this.canEdit()) {\n const focused = this.selectionStore.get('focus');\n const cell = this.columnService.getSaveData(focused.y, focused.x);\n this.cellEdit({\n rgRow: focused.y,\n rgCol: focused.x,\n val: '',\n type: cell.type,\n prop: cell.prop,\n });\n }\n }\n\n private rowDragStart({ detail }: CustomEvent<{ cell: Cell; text: string }>) {\n detail.text = this.columnService.getCellData(detail.cell.y, detail.cell.x);\n }\n\n /**\n * Verify if edit allowed.\n */\n protected canEdit() {\n if (this.readonly) {\n return false;\n }\n const focus = this.selectionStore.get('focus');\n return focus && !this.columnService?.isReadOnly(focus.y, focus.x);\n }\n\n get edited(): EditCellStore {\n return this.selectionStore.get('edit');\n }\n\n /**\n * Sets the focus on a cell and optionally edits a range.\n */\n focus(cell?: Cell, isRangeEdit = false) {\n if (!cell) return false;\n\n const end = cell;\n const start = this.selectionStore.get('focus');\n\n if (isRangeEdit && start) {\n return this.triggerRangeEvent(getRange(start, end));\n }\n\n return this.doFocus(cell, end);\n }\n\n get types(): AllDimensionType {\n return {\n rowType: this.dataStore.get('type'),\n colType: this.columnService.type,\n };\n }\n\n /**\n * Collect data\n */\n protected getData(): EventData {\n return {\n el: this.element,\n rows: this.dimensionRow.state,\n cols: this.dimensionCol.state,\n lastCell: this.lastCell,\n focus: this.selectionStore.get('focus'),\n range: this.selectionStore.get('range'),\n };\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"revogr-overlay-selection.js","sourceRoot":"","sources":["../../../src/components/overlay/revogr-overlay-selection.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,KAAK,EAEL,CAAC,EACD,IAAI,EACJ,MAAM,EACN,IAAI,EAEJ,OAAO,EACP,KAAK,GACN,MAAM,eAAe,CAAC;AACvB,OAAO,aAAa,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAE1E,OAAO,EACL,QAAQ,EACR,iBAAiB,GAClB,MAAM,QAAQ,CAAC;AAChB,OAAO,EACL,oBAAoB,EAEpB,UAAU,EACV,wBAAwB,GACzB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AA8BvD;;GAEG;AAKH,MAAM,OAAO,gBAAgB;;QAsNnB,oBAAe,GAA2B,IAAI,CAAC;QAC/C,oBAAe,GAA2B,IAAI,CAAC;QAE/C,eAAU,GAAiC,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {\n Component,\n Event,\n EventEmitter,\n h,\n Host,\n Listen,\n Prop,\n VNode,\n Element,\n Watch,\n} from '@stencil/core';\nimport ColumnService from '../data/column.service';\nimport { codesLetter } from '../../utils/key.codes';\nimport { MOBILE_CLASS, SELECTION_BORDER_CLASS } from '../../utils/consts';\nimport { DSourceState } from '@store';\nimport {\n getRange,\n isRangeSingleCell,\n} from '@store';\nimport {\n collectModelsOfRange,\n EventData,\n getElStyle,\n getFocusCellBasedOnEvent,\n} from './selection.utils';\nimport { isEditInput } from '../editors/edit.utils';\nimport { KeyboardService } from './keyboard.service';\nimport { AutoFillService } from './autofill.service';\nimport { verifyTouchTarget } from '../../utils/events';\nimport {\n Observable,\n SelectionStoreState,\n DimensionSettingsState,\n DataType,\n DimensionRows,\n ColumnRegular,\n DimensionCols,\n Cell,\n DragStartEvent,\n} from '../../components';\nimport { EditCellStore, MultiDimensionType, RangeClipboardCopyEventProps, RangeClipboardPasteEvent } from '@type';\nimport {\n FocusRenderEvent,\n ApplyFocusEvent,\n AllDimensionType,\n DataFormat,\n} from '@type';\nimport {\n Editors,\n BeforeSaveDataDetails,\n BeforeEdit,\n RangeArea,\n TempRange,\n ChangedRange,\n BeforeRangeSaveDataDetails,\n SaveDataDetails,\n} from '@type';\n\n/**\n * Component for overlaying the grid with the selection.\n */\n@Component({\n tag: 'revogr-overlay-selection',\n styleUrl: 'revogr-overlay-style.scss',\n})\nexport class OverlaySelection {\n // #region Properties\n /**\n * Readonly mode.\n */\n @Prop() readonly: boolean;\n /**\n * Range selection allowed.\n */\n @Prop() range: boolean;\n /**\n * Enable revogr-order-editor component (read more in revogr-order-editor component).\n * Allows D&D.\n */\n @Prop() canDrag: boolean;\n\n /**\n * Enable revogr-clipboard component (read more in revogr-clipboard component).\n * Allows copy/paste.\n */\n @Prop() useClipboard: boolean;\n\n /** Stores */\n /** Selection, range, focus. */\n @Prop() selectionStore: Observable<SelectionStoreState>;\n /** Dimension settings Y. */\n @Prop() dimensionRow: Observable<DimensionSettingsState>;\n /** Dimension settings X. */\n @Prop() dimensionCol: Observable<DimensionSettingsState>;\n\n // --------------------------------------------------------------------------\n //\n // Static stores, not expected to change during component lifetime\n //\n // --------------------------------------------------------------------------\n\n /**\n * Row data store.\n */\n @Prop() dataStore: Observable<DSourceState<DataType, DimensionRows>>;\n\n /**\n * Column data store.\n */\n @Prop() colData: Observable<DSourceState<ColumnRegular, DimensionCols>>;\n /**\n * Last real coordinates positions + 1.\n */\n @Prop() lastCell: Cell;\n /**\n * Custom editors register.\n */\n @Prop() editors: Editors;\n /**\n * If true applys changes when cell closes if not Escape.\n */\n @Prop() applyChangesOnClose = false;\n /**\n * Additional data to pass to renderer.\n */\n @Prop() additionalData: any;\n\n /**\n * Is mobile view mode.\n */\n @Prop() isMobileDevice: boolean;\n\n // #endregion\n\n // #region Events\n /**\n * Before clipboard copy happened. Validate data before copy.\n * To prevent the default behavior of editing data and use your own implementation, call `e.preventDefault()`.\n */\n @Event({ eventName: 'beforecopyregion', cancelable: true })\n beforeCopyRegion: EventEmitter;\n /**\n * Before region paste happened.\n */\n @Event({ eventName: 'beforepasteregion', cancelable: true })\n beforeRegionPaste: EventEmitter;\n\n /**\n * Cell edit apply to the data source.\n * Triggers datasource edit on the root level.\n */\n @Event({ eventName: 'celleditapply', cancelable: true })\n cellEditApply: EventEmitter<BeforeSaveDataDetails>;\n\n /**\n * Before cell focus.\n */\n @Event({ eventName: 'beforecellfocusinit', cancelable: true })\n beforeFocusCell: EventEmitter<BeforeSaveDataDetails>;\n\n\n /**\n * Fired when change of viewport happens.\n * Usually when we switch between pinned regions.\n */\n @Event({ eventName: 'beforenextvpfocus', cancelable: true })\n beforeNextViewportFocus: EventEmitter<Cell>;\n\n /**\n * Set edit cell.\n */\n @Event({ eventName: 'setedit' }) setEdit: EventEmitter<BeforeEdit>;\n\n /**\n * Before range applied.\n */\n @Event({ eventName: 'beforeapplyrange' })\n beforeApplyRange: EventEmitter<FocusRenderEvent>;\n /**\n * Before range selection applied.\n */\n @Event({ eventName: 'beforesetrange' }) beforeSetRange: EventEmitter;\n\n /**\n * Before editor render.\n */\n @Event({ eventName: 'beforeeditrender' })\n beforeEditRender: EventEmitter<FocusRenderEvent>;\n\n /**\n * Set range.\n */\n @Event({ eventName: 'setrange' }) setRange: EventEmitter<\n RangeArea & { type: MultiDimensionType }\n >;\n\n /** Select all. */\n @Event({ eventName: 'selectall' }) selectAll: EventEmitter;\n /**\n * Used for editors support when editor close requested.\n */\n @Event({ eventName: 'canceledit' }) cancelEdit: EventEmitter;\n\n /**\n * Set temp range area during autofill.\n */\n @Event({ eventName: 'settemprange' })\n setTempRange: EventEmitter<TempRange | null>;\n\n /**\n * Before cell get focused.\n * To prevent the default behavior of applying the edit data, you can call `e.preventDefault()`.\n */\n @Event({ eventName: 'applyfocus' })\n applyFocus: EventEmitter<FocusRenderEvent>;\n\n /**\n * Cell get focused.\n * To prevent the default behavior of applying the edit data, you can call `e.preventDefault()`.\n */\n @Event({ eventName: 'focuscell' }) focusCell: EventEmitter<ApplyFocusEvent>;\n /** Range data apply. */\n @Event({ eventName: 'beforerangedataapply' })\n beforeRangeDataApply: EventEmitter<FocusRenderEvent>;\n /** Selection range changed. */\n @Event({ eventName: 'selectionchangeinit', cancelable: true })\n selectionChange: EventEmitter<ChangedRange>;\n /** Before range copy. */\n @Event({ eventName: 'beforerangecopyapply', cancelable: true, bubbles: true })\n beforeRangeCopyApply: EventEmitter<ChangedRange>;\n\n /** Range data apply.\n * Triggers datasource edit on the root level.\n */\n @Event({ eventName: 'rangeeditapply', cancelable: true })\n rangeEditApply: EventEmitter<BeforeRangeSaveDataDetails>;\n /** Range copy. */\n @Event({ eventName: 'clipboardrangecopy', cancelable: true })\n /**\n * Range copy event.\n * This event is triggered when data is ready to be copied to the clipboard.\n * If you want to prevent the default behavior of copying data, you can call `e.preventDefault()`.\n * If you want to modify the data that will be copied to the clipboard, modify the `data` property of the event object.\n */\n rangeClipboardCopy: EventEmitter<RangeClipboardCopyEventProps>;\n\n /**\n * Range paste event.\n */\n @Event({ eventName: 'clipboardrangepaste', cancelable: true })\n rangeClipboardPaste: EventEmitter<RangeClipboardPasteEvent>;\n\n /**\n * Before key up event proxy, used to prevent key up trigger.\n * If you have some custom behaviour event, use this event to check if it wasn't processed by internal logic.\n * Call preventDefault().\n */\n @Event({ eventName: 'beforekeydown' })\n beforeKeyDown: EventEmitter<KeyboardEvent>;\n /**\n * Before key down event proxy, used to prevent key down trigger.\n * If you have some custom behaviour event, use this event to check if it wasn't processed by internal logic.\n * Call preventDefault().\n */\n @Event({ eventName: 'beforekeyup' }) beforeKeyUp: EventEmitter<KeyboardEvent>;\n /**\n * Runs before cell save.\n * Can be used to override or cancel original save.\n */\n @Event({ eventName: 'beforecellsave', cancelable: true })\n beforeCellSave: EventEmitter;\n\n // #endregion\n\n // #region Private Properties\n @Element() element: HTMLElement;\n private clipboard: HTMLRevogrClipboardElement;\n\n protected columnService: ColumnService;\n private keyboardService: KeyboardService | null = null;\n private autoFillService: AutoFillService | null = null;\n private orderEditor: HTMLRevogrOrderEditorElement;\n private revogrEdit: HTMLRevogrEditElement | null = null;\n private unsubscribeSelectionStore: { (): void }[] = [];\n // #endregion\n\n // #region Listeners\n @Listen('touchmove', { target: 'document' })\n @Listen('mousemove', { target: 'document' })\n onMouseMove(e: MouseEvent | TouchEvent) {\n if (this.selectionStore.get('focus')) {\n this.autoFillService.selectionMouseMove(e);\n }\n }\n\n /**\n * Action finished inside of the document.\n * Pointer left document, clear any active operation.\n */\n @Listen('touchend', { target: 'document' })\n @Listen('mouseup', { target: 'document' })\n @Listen('mouseleave', { target: 'document' })\n onMouseUp() {\n // Clear auto fill selection\n // when pointer left document,\n // clear any active operation.\n this.autoFillService.clearAutoFillSelection(\n this.selectionStore.get('focus'),\n this.selectionStore.get('range'),\n );\n }\n\n /**\n * Row drag started.\n * This event is fired when drag action started on cell.\n */\n @Listen('dragstartcell') onCellDrag(e: CustomEvent<DragStartEvent>) {\n // Invoke drag start on order editor.\n this.orderEditor?.dragStart(e.detail);\n }\n\n /**\n * Get keyboard down from element.\n * This event is fired when keyboard key is released.\n */\n @Listen('keyup', { target: 'document' }) onKeyUp(e: KeyboardEvent) {\n // Emit before key up event.\n this.beforeKeyUp.emit(e);\n }\n\n /**\n * Get keyboard down from element.\n * This event is fired when keyboard key is pressed.\n */\n @Listen('keydown', { target: 'document' }) onKeyDown(e: KeyboardEvent) {\n // Emit before key down event and check if default prevention is set.\n const proxy = this.beforeKeyDown.emit(e);\n if (e.defaultPrevented || proxy.defaultPrevented) {\n return;\n }\n // Invoke key down on keyboard service.\n this.keyboardService?.keyDown(\n e,\n this.range,\n !!this.selectionStore.get('edit'),\n {\n focus: this.selectionStore.get('focus'),\n range: this.selectionStore.get('range'),\n },\n );\n }\n // #endregion\n\n /**\n * Selection & Keyboard\n */\n @Watch('selectionStore') selectionServiceSet(\n s: Observable<SelectionStoreState>,\n ) {\n // clear subscriptions\n this.unsubscribeSelectionStore.forEach(v => v());\n this.unsubscribeSelectionStore.length = 0;\n this.unsubscribeSelectionStore.push(s.onChange('nextFocus', (v) => this.doFocus(v, v)));\n\n this.keyboardService = new KeyboardService({\n selectionStore: s,\n range: r => this.triggerRangeEvent(r),\n focus: (f, changes, focusNextViewport) => {\n if (focusNextViewport) {\n this.beforeNextViewportFocus.emit(f);\n return false;\n } else {\n return this.doFocus(f, f, changes);\n }\n },\n change: val => {\n if (this.readonly) {\n return;\n }\n this.doEdit(val);\n },\n cancel: async () => {\n await this.revogrEdit.cancelChanges();\n this.closeEdit();\n },\n clearCell: () => !this.readonly && this.clearCell(),\n internalPaste: () => !this.readonly && this.beforeRegionPaste.emit(),\n getData: () => this.getData(),\n selectAll: () => this.selectAll.emit(),\n });\n this.createAutoFillService();\n }\n /** Autofill */\n @Watch('dimensionRow')\n @Watch('dimensionCol')\n createAutoFillService() {\n this.autoFillService = new AutoFillService({\n dimensionRow: this.dimensionRow,\n dimensionCol: this.dimensionCol,\n columnService: this.columnService,\n dataStore: this.dataStore,\n\n clearRangeDataApply: e =>\n this.beforeRangeDataApply.emit({\n ...e,\n ...this.types,\n }),\n setTempRange: e => this.setTempRange.emit(e),\n selectionChanged: e => this.selectionChange.emit(e),\n\n rangeCopy: e => this.beforeRangeCopyApply.emit(e),\n rangeDataApply: e => this.rangeEditApply.emit(e),\n\n setRange: e => this.triggerRangeEvent(e),\n getData: () => this.getData(),\n });\n }\n\n /** Columns */\n @Watch('dataStore')\n @Watch('colData')\n columnServiceSet() {\n this.columnService?.destroy();\n this.columnService = new ColumnService(this.dataStore, this.colData);\n this.createAutoFillService();\n }\n\n connectedCallback() {\n this.columnServiceSet();\n this.selectionServiceSet(this.selectionStore);\n }\n\n disconnectedCallback() {\n // clear subscriptions\n this.unsubscribeSelectionStore.forEach(v => v());\n this.unsubscribeSelectionStore.length = 0;\n this.columnService?.destroy();\n }\n\n async componentWillRender() {\n const editCell = this.selectionStore.get('edit');\n if (!editCell) {\n await this.revogrEdit?.beforeDisconnect?.();\n }\n }\n\n private renderRange(range: RangeArea) {\n const style = getElStyle(\n range,\n this.dimensionRow.state,\n this.dimensionCol.state,\n );\n return [\n <div class={SELECTION_BORDER_CLASS} style={style}>\n {this.isMobileDevice && (\n <div class=\"range-handlers\">\n <span class={MOBILE_CLASS}></span>\n <span class={MOBILE_CLASS}></span>\n </div>\n )}\n </div>,\n ];\n }\n\n private renderEditor() {\n // Check if edit access\n const editCell = this.selectionStore.get('edit');\n // Readonly or Editor closed\n if (this.readonly || !editCell) {\n return null;\n }\n const val =\n editCell.val || this.columnService.getCellData(editCell.y, editCell.x);\n const editable = {\n ...editCell,\n ...this.columnService.getSaveData(editCell.y, editCell.x, val),\n };\n const renderEvent = this.beforeEditRender.emit({\n range: {\n ...editCell,\n x1: editCell.x,\n y1: editCell.y,\n },\n ...this.types,\n });\n\n // Render prevented\n if (renderEvent.defaultPrevented) {\n return null;\n }\n\n const style = getElStyle(\n renderEvent.detail.range,\n this.dimensionRow.state,\n this.dimensionCol.state,\n );\n return (\n <revogr-edit\n style={style}\n ref={el => (this.revogrEdit = el)}\n additionalData={this.additionalData}\n editCell={editable}\n saveOnClose={this.applyChangesOnClose}\n column={this.columnService.rowDataModel(editCell.y, editCell.x)}\n editor={this.columnService.getCellEditor(\n editCell.y,\n editCell.x,\n this.editors,\n )}\n onCloseedit={e => this.closeEdit(e)}\n onCelledit={e => {\n const saveEv = this.beforeCellSave.emit(e.detail);\n if (!saveEv.defaultPrevented) {\n this.cellEdit(saveEv.detail);\n }\n\n // if not clear navigate to next cell after edit\n if (!saveEv.detail.preventFocus) {\n this.focusNext();\n }\n }}\n />\n );\n }\n\n render() {\n const nodes: VNode[] = [];\n const editCell = this.renderEditor();\n\n // Editor\n if (editCell) {\n nodes.push(editCell);\n } else {\n const range = this.selectionStore.get('range');\n const focus = this.selectionStore.get('focus');\n\n // Clipboard\n if ((range || focus) && this.useClipboard) {\n nodes.push(\n <revogr-clipboard\n readonly={this.readonly}\n onCopyregion={e => this.onCopy(e.detail)}\n onClearregion={() => !this.readonly && this.clearCell()}\n ref={e => (this.clipboard = e)}\n onPasteregion={e => this.onPaste(e.detail)}\n />,\n );\n }\n\n // Range\n if (range) {\n nodes.push(...this.renderRange(range));\n }\n // Autofill\n if (focus && !this.readonly && this.range) {\n nodes.push(this.autoFillService.renderAutofill(range, focus));\n }\n\n // Order\n if (this.canDrag) {\n nodes.push(\n <revogr-order-editor\n ref={e => (this.orderEditor = e)}\n dataStore={this.dataStore}\n dimensionRow={this.dimensionRow}\n dimensionCol={this.dimensionCol}\n parent={this.element}\n onRowdragstartinit={e => this.rowDragStart(e)}\n />,\n );\n }\n }\n return (\n <Host\n class={{ mobile: this.isMobileDevice }}\n onDblClick={(e: MouseEvent) => this.onElementDblClick(e)}\n onMouseDown={(e: MouseEvent) => this.onElementMouseDown(e)}\n onTouchStart={(e: TouchEvent) => this.onElementMouseDown(e, true)}\n >\n {nodes}\n <slot name=\"data\" />\n </Host>\n );\n }\n\n /**\n * Executes the focus operation on the specified range of cells.\n */\n private doFocus(focus: Cell, end: Cell, changes?: Partial<Cell>) {\n const { defaultPrevented } = this.beforeFocusCell.emit(\n this.columnService.getSaveData(focus.y, focus.x),\n );\n if (defaultPrevented) {\n return false;\n }\n const evData: FocusRenderEvent = {\n range: {\n ...focus,\n x1: end.x,\n y1: end.y,\n },\n next: changes,\n ...this.types,\n };\n const applyEvent = this.applyFocus.emit(evData);\n if (applyEvent.defaultPrevented) {\n return false;\n }\n const { range } = applyEvent.detail;\n return !this.focusCell.emit({\n focus: {\n x: range.x,\n y: range.y,\n },\n end: {\n x: range.x1,\n y: range.y1,\n },\n ...applyEvent.detail,\n }).defaultPrevented;\n }\n\n private triggerRangeEvent(range: RangeArea) {\n const type = this.types.rowType;\n const applyEvent = this.beforeApplyRange.emit({\n range: { ...range },\n ...this.types,\n });\n if (applyEvent.defaultPrevented) {\n return false;\n }\n const data = this.columnService.getRangeTransformedToProps(\n applyEvent.detail.range,\n this.dataStore,\n );\n let e = this.beforeSetRange.emit(data);\n e = this.setRange.emit({ ...applyEvent.detail.range, type });\n if (e.defaultPrevented) {\n return false;\n }\n return !e.defaultPrevented;\n }\n\n /**\n * Open Editor on DblClick\n */\n private onElementDblClick(e: MouseEvent) {\n // DblClick prevented outside - Editor will not open\n \n // Get data from the component\n const data = this.getData();\n const focusCell = getFocusCellBasedOnEvent(e, data);\n if (!focusCell) {\n return;\n }\n this.doEdit();\n }\n\n /**\n * Handle mouse down event on Host element\n */\n private onElementMouseDown(e: MouseEvent | TouchEvent, touch = false) {\n // Get the target element from the event object\n const targetElement = e.target as HTMLElement | undefined;\n // Ignore focus if clicked input\n if (isEditInput(targetElement)) {\n return;\n }\n\n // Get data from the component\n const data = this.getData();\n const focusCell = getFocusCellBasedOnEvent(e, data);\n if (!focusCell) {\n return;\n }\n\n // Set focus on the current cell\n this.focus(focusCell, this.range && e.shiftKey);\n\n // Initiate autofill selection\n if (this.range) {\n this.autoFillService.selectionStart(targetElement, this.getData());\n\n // Prevent default behavior for mouse events,\n // but only if target element is not a mobile input\n if (!touch) {\n e.preventDefault();\n } else if (\n verifyTouchTarget((e as TouchEvent).touches[0], MOBILE_CLASS)\n ) {\n // Prevent default behavior for touch events\n // if target element is a mobile input\n e.preventDefault();\n }\n }\n }\n\n /**\n * Start cell editing\n */\n protected doEdit(val = '') {\n if (this.canEdit()) {\n const focus = this.selectionStore.get('focus');\n\n const data = this.columnService.getSaveData(focus.y, focus.x);\n this.setEdit?.emit({\n ...data,\n val,\n });\n }\n }\n\n /**\n * Close editor event triggered\n * @param details - if requires focus next\n */\n private closeEdit(e?: CustomEvent<boolean>) {\n this.cancelEdit.emit();\n if (e?.detail) {\n this.focusNext();\n }\n }\n\n /**\n * Edit finished.\n * Close Editor and save.\n */\n protected cellEdit(e: SaveDataDetails) {\n const dataToSave = this.columnService.getSaveData(e.rgRow, e.rgCol, e.val);\n this.cellEditApply.emit(dataToSave);\n }\n\n private getRegion() {\n const focus = this.selectionStore.get('focus');\n let range = this.selectionStore.get('range');\n if (!range) {\n range = getRange(focus, focus);\n }\n return range;\n }\n private onCopy(e: DataTransfer) {\n const range = this.getRegion();\n const canCopyEvent = this.beforeCopyRegion.emit(range);\n if (canCopyEvent.defaultPrevented) {\n return false;\n }\n let rangeData: DataFormat[][] | undefined;\n\n if (range) {\n const { data, mapping } = this.columnService.copyRangeArray(\n range,\n this.dataStore,\n );\n const event = this.rangeClipboardCopy.emit({\n range,\n data,\n mapping,\n ...this.types,\n });\n if (!event.defaultPrevented) {\n rangeData = event.detail.data;\n }\n }\n\n this.clipboard.doCopy(e, rangeData);\n return true;\n }\n\n private onPaste(data: string[][]) {\n const focus = this.selectionStore.get('focus');\n const isEditing = this.selectionStore.get('edit') !== null;\n if (!focus || isEditing) {\n return;\n }\n let { changed, range } = this.columnService.getTransformedDataToApply(\n focus,\n data,\n );\n const { defaultPrevented: canPaste } = this.rangeClipboardPaste.emit({\n data: changed,\n models: collectModelsOfRange(changed, this.dataStore),\n range,\n ...this.types,\n });\n if (canPaste) {\n return;\n }\n this.autoFillService.onRangeApply(changed, range);\n }\n\n private async focusNext() {\n const canFocus = await this.keyboardService.keyChangeSelection(\n new KeyboardEvent('keydown', {\n code: codesLetter.ARROW_DOWN,\n }),\n this.range,\n );\n if (!canFocus) {\n this.closeEdit();\n }\n }\n\n protected clearCell() {\n if (\n this.selectionStore.get('range') &&\n !isRangeSingleCell(this.selectionStore.get('range'))\n ) {\n const data = this.columnService.getRangeStaticData(\n this.selectionStore.get('range'),\n '',\n );\n this.autoFillService.onRangeApply(data, this.selectionStore.get('range'));\n } else if (this.canEdit()) {\n const focused = this.selectionStore.get('focus');\n const cell = this.columnService.getSaveData(focused.y, focused.x);\n this.cellEdit({\n rgRow: focused.y,\n rgCol: focused.x,\n val: '',\n type: cell.type,\n prop: cell.prop,\n });\n }\n }\n\n private rowDragStart({ detail }: CustomEvent<{ cell: Cell; text: string }>) {\n detail.text = this.columnService.getCellData(detail.cell.y, detail.cell.x);\n }\n\n /**\n * Verify if edit allowed.\n */\n protected canEdit() {\n if (this.readonly) {\n return false;\n }\n const focus = this.selectionStore.get('focus');\n return focus && !this.columnService?.isReadOnly(focus.y, focus.x);\n }\n\n get edited(): EditCellStore {\n return this.selectionStore.get('edit');\n }\n\n /**\n * Sets the focus on a cell and optionally edits a range.\n */\n focus(cell?: Cell, isRangeEdit = false) {\n if (!cell) return false;\n\n const end = cell;\n const start = this.selectionStore.get('focus');\n\n if (isRangeEdit && start) {\n return this.triggerRangeEvent(getRange(start, end));\n }\n\n return this.doFocus(cell, end);\n }\n\n get types(): AllDimensionType {\n return {\n rowType: this.dataStore.get('type'),\n colType: this.columnService.type,\n };\n }\n\n /**\n * Collect data\n */\n protected getData(): EventData {\n return {\n el: this.element,\n rows: this.dimensionRow.state,\n cols: this.dimensionCol.state,\n lastCell: this.lastCell,\n focus: this.selectionStore.get('focus'),\n range: this.selectionStore.get('range'),\n };\n }\n}\n"]}
|
|
@@ -1,8 +1,16 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Built by Revolist OU ❤️
|
|
3
3
|
*/
|
|
4
|
-
import { getItemByIndex, getItemByPosition, } from "../../store/index";
|
|
4
|
+
import { getItemByIndex, getItemByPosition, getSourceItem, } from "../../store/index";
|
|
5
5
|
import { getPropertyFromEvent } from "../../utils/events";
|
|
6
|
+
export function collectModelsOfRange(data, store) {
|
|
7
|
+
const models = {};
|
|
8
|
+
for (let i in data) {
|
|
9
|
+
const rowIndex = parseInt(i, 10);
|
|
10
|
+
models[rowIndex] = getSourceItem(store, rowIndex);
|
|
11
|
+
}
|
|
12
|
+
return models;
|
|
13
|
+
}
|
|
6
14
|
export function getFocusCellBasedOnEvent(e, data) {
|
|
7
15
|
// If event default is prevented, return
|
|
8
16
|
if (e.defaultPrevented) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"selection.utils.js","sourceRoot":"","sources":["../../../src/components/overlay/selection.utils.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"selection.utils.js","sourceRoot":"","sources":["../../../src/components/overlay/selection.utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,cAAc,EACd,iBAAiB,EACjB,aAAa,GACd,MAAM,QAAQ,CAAC;AAEhB,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAY1D,MAAM,UAAU,oBAAoB,CAAC,IAAgB,EAAE,KAAwD;IAC7G,MAAM,MAAM,GAAe,EAAE,CAAC;IAC9B,KAAK,IAAI,CAAC,IAAI,IAAI,EAAE,CAAC;QACnB,MAAM,QAAQ,GAAG,QAAQ,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QACjC,MAAM,CAAC,QAAQ,CAAC,GAAG,aAAa,CAC9B,KAA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CAAC,EAAE,EAAE,EAAE,EAAE,EAAa,EAC3B,YAAoC,EACpC,YAAoC;IAEpC,MAAM,GAAG,GAAG,cAAc,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC;IAClD,MAAM,IAAI,GAAG,cAAc,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC;IACnD,MAAM,MAAM,GAAG,cAAc,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC;IACpD,MAAM,KAAK,GAAG,cAAc,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC;IAEnD,OAAO;QACL,IAAI;QACJ,KAAK;QACL,GAAG;QACH,MAAM;QACN,KAAK,EAAE,KAAK,GAAG,IAAI;QACnB,MAAM,EAAE,MAAM,GAAG,GAAG;KACrB,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,UAAU,CACxB,KAAgB,EAChB,YAAoC,EACpC,YAAoC;IAEpC,MAAM,MAAM,GAAG,OAAO,CAAC,KAAK,EAAE,YAAY,EAAE,YAAY,CAAC,CAAC;IAC1D,OAAO,gBAAgB,CAAC,MAAM,CAAC,CAAC;AAClC,CAAC","sourcesContent":["import {\n DSourceState,\n getItemByIndex,\n getItemByPosition,\n getSourceItem,\n} from '@store';\nimport { DimensionSettingsState, Cell, RangeArea, RangeAreaCss, DataLookup, DimensionRows, DataType } from '@type';\nimport { getPropertyFromEvent } from '../../utils/events';\nimport { Observable } from '../../utils/store.utils';\n\nexport type EventData = {\n el: HTMLElement;\n rows: DimensionSettingsState;\n cols: DimensionSettingsState;\n lastCell: Cell;\n focus: Cell;\n range: RangeArea;\n};\n\nexport function collectModelsOfRange(data: DataLookup, store: Observable<DSourceState<DataType, DimensionRows>>) {\n const models: DataLookup = {};\n for (let i in data) {\n const rowIndex = parseInt(i, 10);\n models[rowIndex] = getSourceItem(\n store,\n rowIndex,\n );\n }\n\n return models;\n}\n\nexport function getFocusCellBasedOnEvent(\n e: MouseEvent | TouchEvent,\n data: EventData,\n): Cell | null {\n // If event default is prevented, return\n if (e.defaultPrevented) {\n return null;\n }\n\n // Get coordinates from event object\n const x = getPropertyFromEvent(e, 'clientX');\n const y = getPropertyFromEvent(e, 'clientY');\n\n // If coordinates are not available, return\n if (x === null || y === null) {\n return null;\n }\n\n // Get current cell based on coordinates and data\n const focusCell = getCurrentCell({ x, y }, data);\n // If current cell is not available, return\n if (isAfterLast(focusCell, data.lastCell)) {\n return null;\n }\n\n return focusCell;\n}\n\n/**\n * Calculate cell based on x, y position\n */\nexport function getCurrentCell(\n { x, y }: Cell,\n { el, rows, cols }: Pick<EventData, 'el' | 'rows' | 'cols'>,\n): Cell {\n // Get the bounding rectangle of the element\n const { top, left, height, width } = el.getBoundingClientRect();\n\n // Calculate the cell position relative to the element\n let cellY = y - top;\n let cellX = x - left;\n\n // Limit the cell position to the element height\n if (cellY >= height) {\n cellY = height - 1;\n }\n\n // Limit the cell position to the element width\n if (cellX >= width) {\n cellX = width - 1;\n }\n\n // Get the row and column items based on the cell position\n const rgRow = getItemByPosition(rows, cellY);\n const rgCol = getItemByPosition(cols, cellX);\n\n // Set the row and column index to 0 if they are before the first item\n if (rgCol.itemIndex < 0) {\n rgCol.itemIndex = 0;\n }\n\n if (rgRow.itemIndex < 0) {\n rgRow.itemIndex = 0;\n }\n\n return { x: rgCol.itemIndex, y: rgRow.itemIndex };\n}\n\nexport function getCoordinate(\n range: RangeArea,\n focus: Cell,\n changes: Partial<Cell>,\n isMulti = false,\n) {\n const updateCoordinate = (c: keyof Cell) => {\n const start = { x: range.x, y: range.y };\n const end = isMulti ? { x: range.x1, y: range.y1 } : start;\n const point = end[c] > focus[c] ? end : start;\n point[c] += changes[c];\n return { start, end };\n };\n\n if (changes.x) {\n return updateCoordinate('x');\n }\n if (changes.y) {\n return updateCoordinate('y');\n }\n return null;\n}\n\n/**\n * Check if the x coordinate of the cell position is after or equal to the x coordinate of the last cell position\n * or if the y coordinate of the cell position is after or equal to the y coordinate of the last cell position\n */\nexport function isAfterLast({ x, y }: Cell, lastCell: Cell) {\n return x >= lastCell.x || y >= lastCell.y;\n}\n\n/** check if out of range */\nexport function isBeforeFirst({ x, y }: Cell) {\n return x < 0 || y < 0;\n}\n\n/** Compare cells, only 1 coordinate difference is possible */\n// export function getDirectionCoordinate(initial: Cell, last: Cell): Partial<Cell> | null {\n// const c: (keyof Cell)[] = ['x', 'y'];\n// for (let k of c) {\n// if (initial[k] !== last[k]) {\n// return { [k]: 1 };\n// }\n// }\n// return null;\n// }\n\n// export function getLargestAxis(initial: Cell, last: Cell): Partial<Cell> | null {\n// const cell: Partial<Cell> = {};\n// const c: (keyof Cell)[] = ['x', 'y'];\n// for (let k of c) {\n// cell[k] = Math.abs(initial[k] - last[k]);\n// }\n// if (cell.x > cell.y) {\n// return { x: 1 };\n// }\n// if (cell.y > cell.x) {\n// return { y: 1 };\n// }\n// return null;\n// }\n\nfunction styleByCellProps(styles: { [key: string]: number }): RangeAreaCss {\n return {\n left: `${styles.left}px`,\n top: `${styles.top}px`,\n width: `${styles.width}px`,\n height: `${styles.height}px`,\n };\n}\n\nexport function getCell(\n { x, y, x1, y1 }: RangeArea,\n dimensionRow: DimensionSettingsState,\n dimensionCol: DimensionSettingsState,\n) {\n const top = getItemByIndex(dimensionRow, y).start;\n const left = getItemByIndex(dimensionCol, x).start;\n const bottom = getItemByIndex(dimensionRow, y1).end;\n const right = getItemByIndex(dimensionCol, x1).end;\n\n return {\n left,\n right,\n top,\n bottom,\n width: right - left,\n height: bottom - top,\n };\n}\n\nexport function getElStyle(\n range: RangeArea,\n dimensionRow: DimensionSettingsState,\n dimensionCol: DimensionSettingsState,\n): RangeAreaCss {\n const styles = getCell(range, dimensionRow, dimensionCol);\n return styleByCellProps(styles);\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../src/types/interfaces.ts"],"names":[],"mappings":"AA0PC,CAAC","sourcesContent":["import type { VNode } from '@stencil/core';\n\nimport {\n DimensionCols,\n DimensionRows,\n DimensionColPin,\n DimensionType,\n MultiDimensionType,\n} from './dimension';\nimport {\n Cell,\n EditorCtr,\n FocusedCells,\n RangeArea,\n SelectionStoreState,\n} from './selection';\nimport type { Observable } from '../utils/store.utils';\n\n/**\n * Advanced column data schema model.\n * Used for transpassing data to cell renderer and editor.\n */\nexport type ColumnDataSchemaModel = {\n /**\n * Column prop used for mapping value to cell from data source model/row\n */\n prop: ColumnProp;\n /**\n * Row data object\n */\n model: DataType;\n /**\n * Column data object\n */\n column: ColumnRegular;\n /**\n * Index of the row in the viewport\n */\n rowIndex: number;\n /**\n * Index of the column in the viewport\n */\n colIndex: number;\n /**\n * Column type based on viewport\n */\n colType: DimensionCols;\n /**\n * Row type based on viewport\n */\n type: DimensionRows;\n /**\n * Row models based on viewport\n */\n data: DataType[];\n /**\n * Current cell data\n */\n value: any;\n};\n/**\n * Template property for each cell, extends the column data schema model.\n * Additionally, it provides access to the providers injected into the template.\n */\nexport interface CellTemplateProp extends ColumnDataSchemaModel {\n /**\n * Providers injected into the template\n */\n providers: Providers;\n}\n/**\n * The ReadOnlyFormat type is a boolean value or a function that takes ColumnDataSchemaModel\n * as a parameter and returns a boolean value.\n *\n * If it is a boolean value, it represents whether the cell in question is read-only.\n * If it is a function, it returns whether the cell in question is read-only based on the provided\n * ColumnDataSchemaModel.\n */\nexport type ReadOnlyFormat =\n | boolean\n | ((params: ColumnDataSchemaModel) => boolean);\nexport type RowDrag =\n | boolean\n | {\n (params: ColumnDataSchemaModel): boolean;\n };\n/**\n * `ColumnGrouping` type is used to define a grouping in a column.\n */\nexport type ColumnGrouping = {\n /**\n * An array of objects that represent the children of the grouping.\n */\n children: (ColumnGrouping | ColumnRegular)[];\n /**\n * A `DataFormat` object that represents the name of the grouping.\n */\n name: DataFormat;\n};\n/**\n * Configuration for header inner template properties\n */\nexport interface ColumnProperties {\n /**\n * Header inner template\n * Function/component to render custom header content\n */\n columnTemplate?: ColumnTemplateFunc;\n /**\n * Header Cell properties\n * Custom function/component to render header properties\n */\n columnProperties?: ColPropertiesFunc;\n}\n/**\n * Type that represents a collection of column types.\n * The keys are the names of the column types and the values are the corresponding column type objects.\n */\nexport type ColumnTypes = {\n /**\n * The name of the column type.\n */\n [name: string]: ColumnType;\n};\n\n/**\n * Interface for custom cell renderer.\n */\nexport interface CellTemplate {\n // TODO: Add Promise support for template and all custom function so user will be able to use async render on the light speed\n (\n createElement: HyperFunc<VNode>,\n props: CellTemplateProp,\n additionalData?: any,\n ): any;\n}\n/**\n * Interface for regular column definition.\n * Regular column can be any column that is not a grouping column.\n */\nexport interface ColumnType extends ColumnProperties {\n /**\n * Represents whether the column or cell is read-only.\n * Can be a boolean or a function that returns a boolean.\n * The function receives column data as a parameter.\n */\n readonly?: ReadOnlyFormat;\n /**\n * Represents the default column size.\n */\n size?: number;\n /**\n * Represents the minimal column size.\n * This property cannot be less than cell padding\n * in order to keep performance on top and minimize DOM elements number.\n */\n minSize?: number;\n /**\n * Represents the maximum column size.\n */\n maxSize?: number;\n /**\n * Represents a custom editor defined in @editors property.\n * Can be a string or an editor constructor function.\n */\n editor?: string | EditorCtr;\n /**\n * Represents cell properties for custom styling, classes, and events.\n */\n cellProperties?: PropertiesFunc;\n /**\n * Represents the cell template for custom rendering.\n */\n cellTemplate?: CellTemplate;\n /**\n * Represents the cell compare function for custom sorting.\n */\n cellCompare?: CellCompareFunc;\n}\nexport type Order = 'asc' | 'desc' | undefined;\n/**\n * Interface for regular column definition.\n * Regular column can be any column that is not a grouping column.\n * \n */\n/**\n * ColumnRegular interface represents regular column definition.\n * Regular column can be any column that is not a grouping column.\n */\nexport interface ColumnRegular extends ColumnType {\n /**\n * Column prop used for mapping value to cell from data source model/row, used for indexing.\n */\n prop: ColumnProp;\n /**\n * Column pin 'colPinStart'|'colPinEnd'.\n */\n pin?: DimensionColPin;\n /**\n * Column header text.\n */\n name?: DataFormat;\n /**\n * Column size would be changed based on space left.\n */\n autoSize?: boolean;\n /**\n * Filter. Require filter plugin to be installed and activated through grid config @filter.\n */\n filter?: boolean | string | string[];\n /**\n * Is column can be sorted, check @cellCompare function for custom sorting.\n */\n sortable?: boolean;\n /**\n * Sort order.\n */\n order?: Order;\n /**\n * Is cell in column or individual can be dragged.\n */\n rowDrag?: RowDrag;\n /**\n * Represents type defined in @columnTypes property through grid config.\n */\n columnType?: string;\n /**\n * Function called before column applied to the store.\n */\n beforeSetup?(rgCol: ColumnRegular): void;\n /**\n * Additional properties can be added to the column definition.\n */\n [key: string]: any;\n}\n\nexport type ColumnData = (ColumnGrouping | ColumnRegular)[];\n/**\n * Column template property.\n * Contains extended properties for column.\n */\nexport interface ColumnTemplateProp extends ColumnRegular {\n /**\n * Providers injected into the template.\n */\n providers: Providers<DimensionCols | 'rowHeaders'>;\n /**\n * Index of the column, used for mapping value to cell from data source model/row.\n */\n index: number;\n};\n\nexport type ColumnPropProp = ColumnGrouping | ColumnTemplateProp;\n// Column prop used for mapping value to cell from data source model/row, used for indexing.\nexport type ColumnProp = string | number;\n\nexport type DataFormat = any;\n\nexport type CellProp = string | number | object | boolean | undefined;\n\n/**\n * Additional properties applied to the cell.\n * Contains style object where key is CSS property and value is CSS property value.\n * Contains class object where key is CSS class and value is boolean flag indicating if class should be applied.\n * Contains additional properties for custom cell rendering.\n */\nexport type CellProps = {\n // CSS styles applied to the cell\n style?: {\n [key: string]: string | undefined;\n };\n // CSS classes applied to the cell\n class?:\n | {\n // CSS class name\n [key: string]: boolean;\n }\n | string;\n // Additional properties for custom cell rendering\n [attr: string]: CellProp;\n};\n\n/**\n * Providers for grid which are going to be injected into each cell template\n */\nexport type Providers<T = DimensionRows> = {\n /**\n * Dimension type (e.g. row or column)\n */\n type: T;\n /**\n * Flag indicating if grid is in readonly mode\n */\n readonly: boolean;\n /**\n * Data source store\n */\n data: Observable<DataSourceState<any, any>> | ColumnRegular[];\n /**\n * Viewport store\n */\n viewport: Observable<ViewportState>;\n /**\n * Dimension store\n */\n dimension: Observable<DimensionSettingsState>;\n /**\n * Selection store\n */\n selection: Observable<SelectionStoreState>;\n};\n/**\n * `HyperFunc` is a function that takes an HTML tag or component, and returns a\n * JSX element. This function is used to create JSX elements in a context where\n * JSX is not valid.\n */\nexport interface HyperFunc<T> {\n // (tag: any): T;\n (tag: any): T;\n}\n/**\n * `HyperFunc` is a function that takes an HTML tag or component, and returns a\n * JSX element. This function is used to create JSX elements in a context where\n * JSX is not valid.\n */\nexport interface HyperFunc<T> {\n (tag: any, data: any): T;\n}\n/**\n * `HyperFunc` is a function that takes an HTML tag or component, and returns a\n * JSX element. This function is used to create JSX elements in a context where\n * JSX is not valid.\n */\nexport interface HyperFunc<T> {\n (tag: any, text: string): T;\n}\n\n/**\n * `HyperFunc` is a function that takes an HTML tag or component, and returns a\n * JSX element. This function is used to create JSX elements in a context where\n * JSX is not valid.\n */\nexport interface HyperFunc<T> {\n (sel: any, children: Array<T | undefined | null>): T;\n}\n\n/**\n * `HyperFunc` is a function that takes an HTML tag or component, and returns a\n * JSX element. This function is used to create JSX elements in a context where\n * JSX is not valid.\n */\nexport interface HyperFunc<T> {\n (sel: any, data: any, text: string): T;\n}\n\n/**\n * `HyperFunc` is a function that takes an HTML tag or component, and returns a\n * JSX element. This function is used to create JSX elements in a context where\n * JSX is not valid.\n */\nexport interface HyperFunc<T> {\n (sel: any, data: any, children: Array<T | undefined | null>): T;\n}\n\n/**\n * `HyperFunc` is a function that takes an HTML tag or component, and returns a\n * JSX element. This function is used to create JSX elements in a context where\n * JSX is not valid.\n */\nexport interface HyperFunc<T> {\n (sel: any, data: any, children: T): T;\n}\n/**\n * `FocusTemplateFunc` is a function that takes an HTML tag or component, and\n * returns a JSX element. This function is used to create JSX elements in a\n * context where JSX is not valid.\n */\nexport type FocusTemplateFunc = (\n createElement: HyperFunc<VNode>,\n detail: FocusRenderEvent,\n) => any;\n\n\n/**\n * `CellCompareFunc` is a function that takes the column property to compare,\n * the data of the first cell, and the data of the second cell. It returns a\n * number indicating the relative order of the two cells.\n */\nexport type CellCompareFunc = (\n // The column property to compare.\n prop: ColumnProp,\n // The data of the first cell.\n a: DataType,\n // The data of the second cell.\n b: DataType,\n) => number;\nexport type ColumnTemplateFunc = (\n createElement: HyperFunc<VNode>,\n props: ColumnTemplateProp,\n additionalData?: any,\n) => any;\nexport type PropertiesFunc = (\n props: ColumnDataSchemaModel,\n) => CellProps | void | undefined;\nexport type ColPropertiesFunc = (\n props: ColumnPropProp,\n) => CellProps | void | undefined;\nexport type DataType = {\n [T in ColumnProp]: DataFormat;\n};\n\nexport type DataLookup = {\n [rowIndex: number]: DataType;\n};\n/**\n * `RowDefinition` is a type that represents a row definition in the\n * viewport.\n */\nexport type RowDefinition = {\n /**\n * The type of the row.\n */\n type: DimensionRows;\n /**\n * The size of the row.\n */\n size: number;\n /**\n * The index of the row.\n */\n index: number;\n};\nexport interface RowHeaders extends ColumnRegular {}\n/**\n * `ViewPortResizeEvent` is an object that contains information about a resize\n * event in the viewport.\n */\nexport type ViewPortResizeEvent = {\n /* The dimension of the viewport being resized. */\n dimension: DimensionType;\n /* The new size of the viewport. */\n size: number;\n /* Indicates whether the resize event is for a row header. */\n rowHeader?: boolean;\n};\n\n/**\n * `ViewPortScrollEvent` is an object that contains information about a scroll\n * event in the viewport.\n */\nexport type ViewPortScrollEvent = {\n /**\n * The dimension of the viewport being scrolled.\n */\n dimension: DimensionType;\n /**\n * The coordinate of the scroll event.\n */\n coordinate: number;\n /**\n * The change in coordinate between scroll events.\n */\n delta?: number;\n /**\n * Indicates whether the scroll event occurred outside the viewport.\n */\n outside?: boolean;\n};\n\n/**\n * `InitialHeaderClick` represents the information needed to handle a click\n * event on the initial column header.\n */\nexport type InitialHeaderClick = {\n /**\n * The index of the column header that was clicked.\n */\n index: number;\n /**\n * The original mouse event that triggered the click.\n */\n originalEvent: MouseEvent;\n /**\n * The column that was clicked.\n */\n column: ColumnRegular;\n};\n\n/**\n * `Range` is an object that represents a range of values.\n */\nexport type Range = {\n /**\n * The start of the range.\n */\n start: number;\n /**\n * The end of the range.\n */\n end: number;\n};\n\n/**\n * `ViewportStateItems` is an object that represents the items in a viewport\n * along with their corresponding range.\n */\nexport type ViewportStateItems = {\n /**\n * The items in the viewport.\n */\n items: VirtualPositionItem[];\n} & Range;\n\n/**\n * `ViewportState` is an object that represents the state of a viewport.\n */\nexport interface ViewportState extends ViewportStateItems {\n /**\n * The number of real items in the viewport.\n */\n realCount: number;\n /**\n * The virtual size of the viewport.\n */\n virtualSize: number;\n}\n\n/**\n * `ViewSettingSizeProp` is a record that maps column or row indexes to their\n * corresponding sizes.\n */\nexport type ViewSettingSizeProp = Record<string, number>;\n\n/**\n * `VirtualPositionItem` is an object that represents a virtual position item\n * in the viewport.\n */\nexport interface VirtualPositionItem extends PositionItem {\n /**\n * The size of the virtual position item.\n */\n size: number;\n}\nexport type DataSourceState<\n T extends DataType | ColumnRegular,\n ST extends DimensionRows | DimensionCols,\n> = {\n // items - index based array for mapping to source tree\n items: number[];\n // all items, used as proxy for sorting, trimming and others manipulations\n proxyItems: number[];\n // original data source\n source: T[];\n // grouping\n groupingDepth: number;\n groups: Record<any, any>;\n // data source type\n type: ST;\n // trim data, to hide entities from visible data source\n trimmed: Record<any, any>;\n};\nexport interface PositionItem {\n itemIndex: number;\n start: number;\n end: number;\n}\n/**\n * Object containing information about calculated dimensions.\n * Used for both columns and rows.\n */\nexport interface DimensionCalc {\n /**\n * Array of indexes of visible items.\n */\n indexes: number[];\n\n /**\n * Count of visible items.\n */\n count: number;\n\n /**\n * Array of indexes of visible items.\n * Used for mapping items to their position in DOM.\n */\n positionIndexes: number[];\n\n /**\n * Mapping of position to item.\n * Used for mapping position in DOM to item.\n */\n positionIndexToItem: {\n /**\n * Position in DOM.\n */\n [position: number]: PositionItem;\n };\n\n /**\n * Mapping of index to item.\n * Used for mapping index in data source to item.\n */\n indexToItem: {\n /**\n * Index in data source.\n */\n [index: number]: PositionItem;\n };\n\n /**\n * Object containing information about trimmed data.\n * Used for hiding entities from visible data source.\n */\n trimmed: Record<any, any>;\n\n /**\n * Object containing size for each visible item.\n */\n sizes: ViewSettingSizeProp;\n}\n/**\n * Represents the settings state of a dimension.\n * It extends the calculation properties of a dimension.\n * It also includes the real size and origin item size of the dimension.\n */\nexport interface DimensionSettingsState extends DimensionCalc {\n /**\n * Represents the real size of the dimension.\n */\n realSize: number;\n\n /**\n * Represents the origin item size of the dimension.\n */\n originItemSize: number;\n}\n\n/**\n * Represents the mapping of dimension types to their corresponding observable stores.\n */\nexport type DimensionStores = {\n [T in MultiDimensionType]: Observable<DimensionSettingsState>;\n};\n\n/**\n * Represents the mapping of dimension types to their corresponding observable stores for the viewport.\n */\nexport type ViewportStores = {\n [T in MultiDimensionType]: Observable<ViewportState>;\n};\n\n/**\n * Represents the event object that is emitted when the drag operation starts.\n */\nexport interface DragStartEvent {\n /**\n * Represents the original mouse event that triggered the drag operation.\n */\n originalEvent: MouseEvent;\n\n /**\n * Represents the model of the column being dragged.\n */\n model: ColumnDataSchemaModel;\n}\n\n/**\n * Represents the event object that is emitted before cell rendering.\n * It includes information about the dimension type, column, row, and model.\n */\nexport interface BeforeCellRenderEvent<T = any> extends AllDimensionType {\n /**\n * Represents the column being rendered.\n */\n column: VirtualPositionItem;\n\n /**\n * Represents the row being rendered.\n */\n row: VirtualPositionItem;\n\n /**\n * Represents the model being rendered.\n */\n model: T;\n}\n\n/**\n * Represents the event object that is emitted before row rendering.\n * It includes information about the dimension type, data item, item, and node.\n */\nexport interface BeforeRowRenderEvent<T = any> extends AllDimensionType {\n /**\n * Represents the data item being rendered.\n */\n model: T;\n\n /**\n * Represents the item being rendered.\n */\n item: VirtualPositionItem;\n\n /**\n * Represents the node being rendered.\n */\n node: VNode;\n}\n\n/**\n * Represents the event object that is emitted after rendering.\n * It includes information about the dimension type.\n */\nexport type AfterRendererEvent = {\n /**\n * Represents the type of dimension being rendered.\n */\n type: DimensionType;\n};\n\n/**\n * Represents the mapping of dimension types to their corresponding dimension types.\n */\nexport interface AllDimensionType {\n /**\n * Represents the dimension type for rows.\n */\n rowType: DimensionRows;\n\n /**\n * Represents the dimension type for columns.\n */\n colType: DimensionCols;\n}\n\n/**\n * Represents the event object that is emitted when applying focus.\n * It includes information about the dimension type and focused cells.\n */\nexport interface ApplyFocusEvent extends AllDimensionType, FocusedCells {}\n\n/**\n * Represents the event object that is emitted before focus rendering.\n * It includes information about the dimension type and range area.\n */\nexport interface FocusRenderEvent extends AllDimensionType {\n /**\n * Represents the range area of the focus.\n */\n range: RangeArea;\n\n /**\n * Changes for the next cell to focus. @example { y: -1 }\n */\n next?: Partial<Cell>;\n}\n/**\n * Represents the event object that is emitted when scrolling occurs.\n * The `type` property indicates the type of dimension (row or column) being scrolled.\n * The `coordinate` property represents the current scroll position in that dimension.\n */\nexport type ScrollCoordinateEvent = {\n /**\n * Represents the type of dimension being scrolled.\n * Possible values are 'rgRow' and 'rgCol'.\n */\n type: DimensionType;\n\n /**\n * Represents the current scroll position in the specified dimension.\n * The value is a number representing the coordinate in pixels.\n */\n coordinate: number;\n};\n"]}
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../src/types/interfaces.ts"],"names":[],"mappings":"AA2PC,CAAC","sourcesContent":["import type { VNode } from '@stencil/core';\n\nimport {\n DimensionCols,\n DimensionRows,\n DimensionColPin,\n DimensionType,\n MultiDimensionType,\n} from './dimension';\nimport {\n Cell,\n EditorCtr,\n FocusedCells,\n OldNewRangeMapping,\n RangeArea,\n SelectionStoreState,\n} from './selection';\nimport type { Observable } from '../utils/store.utils';\n\n/**\n * Advanced column data schema model.\n * Used for transpassing data to cell renderer and editor.\n */\nexport type ColumnDataSchemaModel = {\n /**\n * Column prop used for mapping value to cell from data source model/row\n */\n prop: ColumnProp;\n /**\n * Row data object\n */\n model: DataType;\n /**\n * Column data object\n */\n column: ColumnRegular;\n /**\n * Index of the row in the viewport\n */\n rowIndex: number;\n /**\n * Index of the column in the viewport\n */\n colIndex: number;\n /**\n * Column type based on viewport\n */\n colType: DimensionCols;\n /**\n * Row type based on viewport\n */\n type: DimensionRows;\n /**\n * Row models based on viewport\n */\n data: DataType[];\n /**\n * Current cell data\n */\n value: any;\n};\n/**\n * Template property for each cell, extends the column data schema model.\n * Additionally, it provides access to the providers injected into the template.\n */\nexport interface CellTemplateProp extends ColumnDataSchemaModel {\n /**\n * Providers injected into the template\n */\n providers: Providers;\n}\n/**\n * The ReadOnlyFormat type is a boolean value or a function that takes ColumnDataSchemaModel\n * as a parameter and returns a boolean value.\n *\n * If it is a boolean value, it represents whether the cell in question is read-only.\n * If it is a function, it returns whether the cell in question is read-only based on the provided\n * ColumnDataSchemaModel.\n */\nexport type ReadOnlyFormat =\n | boolean\n | ((params: ColumnDataSchemaModel) => boolean);\nexport type RowDrag =\n | boolean\n | {\n (params: ColumnDataSchemaModel): boolean;\n };\n/**\n * `ColumnGrouping` type is used to define a grouping in a column.\n */\nexport type ColumnGrouping = {\n /**\n * An array of objects that represent the children of the grouping.\n */\n children: (ColumnGrouping | ColumnRegular)[];\n /**\n * A `DataFormat` object that represents the name of the grouping.\n */\n name: DataFormat;\n};\n/**\n * Configuration for header inner template properties\n */\nexport interface ColumnProperties {\n /**\n * Header inner template\n * Function/component to render custom header content\n */\n columnTemplate?: ColumnTemplateFunc;\n /**\n * Header Cell properties\n * Custom function/component to render header properties\n */\n columnProperties?: ColPropertiesFunc;\n}\n/**\n * Type that represents a collection of column types.\n * The keys are the names of the column types and the values are the corresponding column type objects.\n */\nexport type ColumnTypes = {\n /**\n * The name of the column type.\n */\n [name: string]: ColumnType;\n};\n\n/**\n * Interface for custom cell renderer.\n */\nexport interface CellTemplate {\n // TODO: Add Promise support for template and all custom function so user will be able to use async render on the light speed\n (\n createElement: HyperFunc<VNode>,\n props: CellTemplateProp,\n additionalData?: any,\n ): any;\n}\n/**\n * Interface for regular column definition.\n * Regular column can be any column that is not a grouping column.\n */\nexport interface ColumnType extends ColumnProperties {\n /**\n * Represents whether the column or cell is read-only.\n * Can be a boolean or a function that returns a boolean.\n * The function receives column data as a parameter.\n */\n readonly?: ReadOnlyFormat;\n /**\n * Represents the default column size.\n */\n size?: number;\n /**\n * Represents the minimal column size.\n * This property cannot be less than cell padding\n * in order to keep performance on top and minimize DOM elements number.\n */\n minSize?: number;\n /**\n * Represents the maximum column size.\n */\n maxSize?: number;\n /**\n * Represents a custom editor defined in @editors property.\n * Can be a string or an editor constructor function.\n */\n editor?: string | EditorCtr;\n /**\n * Represents cell properties for custom styling, classes, and events.\n */\n cellProperties?: PropertiesFunc;\n /**\n * Represents the cell template for custom rendering.\n */\n cellTemplate?: CellTemplate;\n /**\n * Represents the cell compare function for custom sorting.\n */\n cellCompare?: CellCompareFunc;\n}\nexport type Order = 'asc' | 'desc' | undefined;\n/**\n * Interface for regular column definition.\n * Regular column can be any column that is not a grouping column.\n * \n */\n/**\n * ColumnRegular interface represents regular column definition.\n * Regular column can be any column that is not a grouping column.\n */\nexport interface ColumnRegular extends ColumnType {\n /**\n * Column prop used for mapping value to cell from data source model/row, used for indexing.\n */\n prop: ColumnProp;\n /**\n * Column pin 'colPinStart'|'colPinEnd'.\n */\n pin?: DimensionColPin;\n /**\n * Column header text.\n */\n name?: DataFormat;\n /**\n * Column size would be changed based on space left.\n */\n autoSize?: boolean;\n /**\n * Filter. Require filter plugin to be installed and activated through grid config @filter.\n */\n filter?: boolean | string | string[];\n /**\n * Is column can be sorted, check @cellCompare function for custom sorting.\n */\n sortable?: boolean;\n /**\n * Sort order.\n */\n order?: Order;\n /**\n * Is cell in column or individual can be dragged.\n */\n rowDrag?: RowDrag;\n /**\n * Represents type defined in @columnTypes property through grid config.\n */\n columnType?: string;\n /**\n * Function called before column applied to the store.\n */\n beforeSetup?(rgCol: ColumnRegular): void;\n /**\n * Additional properties can be added to the column definition.\n */\n [key: string]: any;\n}\n\nexport type ColumnData = (ColumnGrouping | ColumnRegular)[];\n/**\n * Column template property.\n * Contains extended properties for column.\n */\nexport interface ColumnTemplateProp extends ColumnRegular {\n /**\n * Providers injected into the template.\n */\n providers: Providers<DimensionCols | 'rowHeaders'>;\n /**\n * Index of the column, used for mapping value to cell from data source model/row.\n */\n index: number;\n};\n\nexport type ColumnPropProp = ColumnGrouping | ColumnTemplateProp;\n// Column prop used for mapping value to cell from data source model/row, used for indexing.\nexport type ColumnProp = string | number;\n\nexport type DataFormat = any;\n\nexport type CellProp = string | number | object | boolean | undefined;\n\n/**\n * Additional properties applied to the cell.\n * Contains style object where key is CSS property and value is CSS property value.\n * Contains class object where key is CSS class and value is boolean flag indicating if class should be applied.\n * Contains additional properties for custom cell rendering.\n */\nexport type CellProps = {\n // CSS styles applied to the cell\n style?: {\n [key: string]: string | undefined;\n };\n // CSS classes applied to the cell\n class?:\n | {\n // CSS class name\n [key: string]: boolean;\n }\n | string;\n // Additional properties for custom cell rendering\n [attr: string]: CellProp;\n};\n\n/**\n * Providers for grid which are going to be injected into each cell template\n */\nexport type Providers<T = DimensionRows> = {\n /**\n * Dimension type (e.g. row or column)\n */\n type: T;\n /**\n * Flag indicating if grid is in readonly mode\n */\n readonly: boolean;\n /**\n * Data source store\n */\n data: Observable<DataSourceState<any, any>> | ColumnRegular[];\n /**\n * Viewport store\n */\n viewport: Observable<ViewportState>;\n /**\n * Dimension store\n */\n dimension: Observable<DimensionSettingsState>;\n /**\n * Selection store\n */\n selection: Observable<SelectionStoreState>;\n};\n/**\n * `HyperFunc` is a function that takes an HTML tag or component, and returns a\n * JSX element. This function is used to create JSX elements in a context where\n * JSX is not valid.\n */\nexport interface HyperFunc<T> {\n // (tag: any): T;\n (tag: any): T;\n}\n/**\n * `HyperFunc` is a function that takes an HTML tag or component, and returns a\n * JSX element. This function is used to create JSX elements in a context where\n * JSX is not valid.\n */\nexport interface HyperFunc<T> {\n (tag: any, data: any): T;\n}\n/**\n * `HyperFunc` is a function that takes an HTML tag or component, and returns a\n * JSX element. This function is used to create JSX elements in a context where\n * JSX is not valid.\n */\nexport interface HyperFunc<T> {\n (tag: any, text: string): T;\n}\n\n/**\n * `HyperFunc` is a function that takes an HTML tag or component, and returns a\n * JSX element. This function is used to create JSX elements in a context where\n * JSX is not valid.\n */\nexport interface HyperFunc<T> {\n (sel: any, children: Array<T | undefined | null>): T;\n}\n\n/**\n * `HyperFunc` is a function that takes an HTML tag or component, and returns a\n * JSX element. This function is used to create JSX elements in a context where\n * JSX is not valid.\n */\nexport interface HyperFunc<T> {\n (sel: any, data: any, text: string): T;\n}\n\n/**\n * `HyperFunc` is a function that takes an HTML tag or component, and returns a\n * JSX element. This function is used to create JSX elements in a context where\n * JSX is not valid.\n */\nexport interface HyperFunc<T> {\n (sel: any, data: any, children: Array<T | undefined | null>): T;\n}\n\n/**\n * `HyperFunc` is a function that takes an HTML tag or component, and returns a\n * JSX element. This function is used to create JSX elements in a context where\n * JSX is not valid.\n */\nexport interface HyperFunc<T> {\n (sel: any, data: any, children: T): T;\n}\n/**\n * `FocusTemplateFunc` is a function that takes an HTML tag or component, and\n * returns a JSX element. This function is used to create JSX elements in a\n * context where JSX is not valid.\n */\nexport type FocusTemplateFunc = (\n createElement: HyperFunc<VNode>,\n detail: FocusRenderEvent,\n) => any;\n\n\n/**\n * `CellCompareFunc` is a function that takes the column property to compare,\n * the data of the first cell, and the data of the second cell. It returns a\n * number indicating the relative order of the two cells.\n */\nexport type CellCompareFunc = (\n // The column property to compare.\n prop: ColumnProp,\n // The data of the first cell.\n a: DataType,\n // The data of the second cell.\n b: DataType,\n) => number;\nexport type ColumnTemplateFunc = (\n createElement: HyperFunc<VNode>,\n props: ColumnTemplateProp,\n additionalData?: any,\n) => any;\nexport type PropertiesFunc = (\n props: ColumnDataSchemaModel,\n) => CellProps | void | undefined;\nexport type ColPropertiesFunc = (\n props: ColumnPropProp,\n) => CellProps | void | undefined;\nexport type DataType = {\n [T in ColumnProp]: DataFormat;\n};\n\nexport type DataLookup = {\n [rowIndex: number]: DataType;\n};\n/**\n * `RowDefinition` is a type that represents a row definition in the\n * viewport.\n */\nexport type RowDefinition = {\n /**\n * The type of the row.\n */\n type: DimensionRows;\n /**\n * The size of the row.\n */\n size: number;\n /**\n * The index of the row.\n */\n index: number;\n};\nexport interface RowHeaders extends ColumnRegular {}\n/**\n * `ViewPortResizeEvent` is an object that contains information about a resize\n * event in the viewport.\n */\nexport type ViewPortResizeEvent = {\n /* The dimension of the viewport being resized. */\n dimension: DimensionType;\n /* The new size of the viewport. */\n size: number;\n /* Indicates whether the resize event is for a row header. */\n rowHeader?: boolean;\n};\n\n/**\n * `ViewPortScrollEvent` is an object that contains information about a scroll\n * event in the viewport.\n */\nexport type ViewPortScrollEvent = {\n /**\n * The dimension of the viewport being scrolled.\n */\n dimension: DimensionType;\n /**\n * The coordinate of the scroll event.\n */\n coordinate: number;\n /**\n * The change in coordinate between scroll events.\n */\n delta?: number;\n /**\n * Indicates whether the scroll event occurred outside the viewport.\n */\n outside?: boolean;\n};\n\n/**\n * `InitialHeaderClick` represents the information needed to handle a click\n * event on the initial column header.\n */\nexport type InitialHeaderClick = {\n /**\n * The index of the column header that was clicked.\n */\n index: number;\n /**\n * The original mouse event that triggered the click.\n */\n originalEvent: MouseEvent;\n /**\n * The column that was clicked.\n */\n column: ColumnRegular;\n providers: Providers<DimensionCols | 'rowHeaders'>;\n};\n\n/**\n * `Range` is an object that represents a range of values.\n */\nexport type Range = {\n /**\n * The start of the range.\n */\n start: number;\n /**\n * The end of the range.\n */\n end: number;\n};\n\n/**\n * `ViewportStateItems` is an object that represents the items in a viewport\n * along with their corresponding range.\n */\nexport type ViewportStateItems = {\n /**\n * The items in the viewport.\n */\n items: VirtualPositionItem[];\n} & Range;\n\n/**\n * `ViewportState` is an object that represents the state of a viewport.\n */\nexport interface ViewportState extends ViewportStateItems {\n /**\n * The number of real items in the viewport.\n */\n realCount: number;\n /**\n * The virtual size of the viewport.\n */\n virtualSize: number;\n}\n\n/**\n * `ViewSettingSizeProp` is a record that maps column or row indexes to their\n * corresponding sizes.\n */\nexport type ViewSettingSizeProp = Record<string, number>;\n\n/**\n * `VirtualPositionItem` is an object that represents a virtual position item\n * in the viewport.\n */\nexport interface VirtualPositionItem extends PositionItem {\n /**\n * The size of the virtual position item.\n */\n size: number;\n}\nexport type DataSourceState<\n T extends DataType | ColumnRegular,\n ST extends DimensionRows | DimensionCols,\n> = {\n // items - index based array for mapping to source tree\n items: number[];\n // all items, used as proxy for sorting, trimming and others manipulations\n proxyItems: number[];\n // original data source\n source: T[];\n // grouping\n groupingDepth: number;\n groups: Record<any, any>;\n // data source type\n type: ST;\n // trim data, to hide entities from visible data source\n trimmed: Record<any, any>;\n};\nexport interface PositionItem {\n itemIndex: number;\n start: number;\n end: number;\n}\n/**\n * Object containing information about calculated dimensions.\n * Used for both columns and rows.\n */\nexport interface DimensionCalc {\n /**\n * Array of indexes of visible items.\n */\n indexes: number[];\n\n /**\n * Count of visible items.\n */\n count: number;\n\n /**\n * Array of indexes of visible items.\n * Used for mapping items to their position in DOM.\n */\n positionIndexes: number[];\n\n /**\n * Mapping of position to item.\n * Used for mapping position in DOM to item.\n */\n positionIndexToItem: {\n /**\n * Position in DOM.\n */\n [position: number]: PositionItem;\n };\n\n /**\n * Mapping of index to item.\n * Used for mapping index in data source to item.\n */\n indexToItem: {\n /**\n * Index in data source.\n */\n [index: number]: PositionItem;\n };\n\n /**\n * Object containing information about trimmed data.\n * Used for hiding entities from visible data source.\n */\n trimmed: Record<any, any>;\n\n /**\n * Object containing size for each visible item.\n */\n sizes: ViewSettingSizeProp;\n}\n/**\n * Represents the settings state of a dimension.\n * It extends the calculation properties of a dimension.\n * It also includes the real size and origin item size of the dimension.\n */\nexport interface DimensionSettingsState extends DimensionCalc {\n /**\n * Represents the real size of the dimension.\n */\n realSize: number;\n\n /**\n * Represents the origin item size of the dimension.\n */\n originItemSize: number;\n}\n\n/**\n * Represents the mapping of dimension types to their corresponding observable stores.\n */\nexport type DimensionStores = {\n [T in MultiDimensionType]: Observable<DimensionSettingsState>;\n};\n\n/**\n * Represents the mapping of dimension types to their corresponding observable stores for the viewport.\n */\nexport type ViewportStores = {\n [T in MultiDimensionType]: Observable<ViewportState>;\n};\n\n/**\n * Represents the event object that is emitted when the drag operation starts.\n */\nexport interface DragStartEvent {\n /**\n * Represents the original mouse event that triggered the drag operation.\n */\n originalEvent: MouseEvent;\n\n /**\n * Represents the model of the column being dragged.\n */\n model: ColumnDataSchemaModel;\n}\n\n/**\n * Represents the event object that is emitted before cell rendering.\n * It includes information about the dimension type, column, row, and model.\n */\nexport interface BeforeCellRenderEvent<T = any> extends AllDimensionType {\n /**\n * Represents the column being rendered.\n */\n column: VirtualPositionItem;\n\n /**\n * Represents the row being rendered.\n */\n row: VirtualPositionItem;\n\n /**\n * Represents the model being rendered.\n */\n model: T;\n}\n\n/**\n * Represents the event object that is emitted before row rendering.\n * It includes information about the dimension type, data item, item, and node.\n */\nexport interface BeforeRowRenderEvent<T = any> extends AllDimensionType {\n /**\n * Represents the data item being rendered.\n */\n model: T;\n\n /**\n * Represents the item being rendered.\n */\n item: VirtualPositionItem;\n\n /**\n * Represents the node being rendered.\n */\n node: VNode;\n}\n\n/**\n * Represents the event object that is emitted after rendering.\n * It includes information about the dimension type.\n */\nexport type AfterRendererEvent = {\n /**\n * Represents the type of dimension being rendered.\n */\n type: DimensionType;\n};\n\n/**\n * Represents the mapping of dimension types to their corresponding dimension types.\n */\nexport interface AllDimensionType {\n /**\n * Represents the dimension type for rows.\n */\n rowType: DimensionRows;\n\n /**\n * Represents the dimension type for columns.\n */\n colType: DimensionCols;\n}\n\n/**\n * Represents the event object that is emitted when applying focus.\n * It includes information about the dimension type and focused cells.\n */\nexport interface ApplyFocusEvent extends AllDimensionType, FocusedCells {}\n\n/**\n * Represents the event object that is emitted before focus rendering.\n * It includes information about the dimension type and range area.\n */\nexport interface FocusRenderEvent extends AllDimensionType {\n /**\n * Represents the range area of the focus.\n */\n range: RangeArea;\n\n /**\n * Changes for the next cell to focus. @example { y: -1 }\n */\n next?: Partial<Cell>;\n}\n/**\n * Represents the event object that is emitted when scrolling occurs.\n * The `type` property indicates the type of dimension (row or column) being scrolled.\n * The `coordinate` property represents the current scroll position in that dimension.\n */\nexport type ScrollCoordinateEvent = {\n /**\n * Represents the type of dimension being scrolled.\n * Possible values are 'rgRow' and 'rgCol'.\n */\n type: DimensionType;\n\n /**\n * Represents the current scroll position in the specified dimension.\n * The value is a number representing the coordinate in pixels.\n */\n coordinate: number;\n};\n\n\n/** Range paste. */\nexport type RangeClipboardPasteEvent = {\n data: DataLookup;\n models: {\n [rowIndex: number]: DataType;\n };\n range: RangeArea;\n} & AllDimensionType;\n\n/** Range copy. */\nexport type RangeClipboardCopyEventProps = {\n data: DataFormat[][];\n range: RangeArea;\n mapping: OldNewRangeMapping;\n} & AllDimensionType;"]}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { r as registerInstance, h, H as Host, c as createEvent, a as getElement } from './index-a61f225b.js';
|
|
5
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
|
-
import {
|
|
6
|
+
import { b as getSourceItem, i as getItemByPosition, j as getItemByIndex, 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
9
|
import { n as ColumnService, H as HEADER_SLOT } from './column.service-0e41057a.js';
|
|
@@ -22,6 +22,14 @@ const Attribution = class {
|
|
|
22
22
|
}
|
|
23
23
|
};
|
|
24
24
|
|
|
25
|
+
function collectModelsOfRange(data, store) {
|
|
26
|
+
const models = {};
|
|
27
|
+
for (let i in data) {
|
|
28
|
+
const rowIndex = parseInt(i, 10);
|
|
29
|
+
models[rowIndex] = getSourceItem(store, rowIndex);
|
|
30
|
+
}
|
|
31
|
+
return models;
|
|
32
|
+
}
|
|
25
33
|
function getFocusCellBasedOnEvent(e, data) {
|
|
26
34
|
// If event default is prevented, return
|
|
27
35
|
if (e.defaultPrevented) {
|
|
@@ -525,15 +533,13 @@ class AutoFillService {
|
|
|
525
533
|
this.autoFillLast = null;
|
|
526
534
|
this.autoFillStart = null;
|
|
527
535
|
}
|
|
528
|
-
/**
|
|
536
|
+
/**
|
|
537
|
+
* Trigger range apply events and handle responses
|
|
538
|
+
*/
|
|
529
539
|
onRangeApply(data, range) {
|
|
530
|
-
const models = {};
|
|
531
|
-
for (let rowIndex in data) {
|
|
532
|
-
models[rowIndex] = getSourceItem(this.sv.dataStore, parseInt(rowIndex, 10));
|
|
533
|
-
}
|
|
534
540
|
this.sv.rangeDataApply({
|
|
535
541
|
data,
|
|
536
|
-
models,
|
|
542
|
+
models: collectModelsOfRange(data, this.sv.dataStore),
|
|
537
543
|
type: this.sv.dataStore.get('type'),
|
|
538
544
|
});
|
|
539
545
|
this.sv.setRange(range);
|
|
@@ -816,7 +822,7 @@ const OverlaySelection = class {
|
|
|
816
822
|
nodes.push(h("revogr-order-editor", { ref: e => (this.orderEditor = e), dataStore: this.dataStore, dimensionRow: this.dimensionRow, dimensionCol: this.dimensionCol, parent: this.element, onRowdragstartinit: e => this.rowDragStart(e) }));
|
|
817
823
|
}
|
|
818
824
|
}
|
|
819
|
-
return (h(Host, { key: '
|
|
825
|
+
return (h(Host, { key: '98f6ca4606540478588614eaf7ee69a5eaf48b99', class: { mobile: this.isMobileDevice }, onDblClick: (e) => this.onElementDblClick(e), onMouseDown: (e) => this.onElementMouseDown(e), onTouchStart: (e) => this.onElementMouseDown(e, true) }, nodes, h("slot", { key: '65d69b6562e14e1cf99c3780ac2ba3fa3e37e801', name: "data" })));
|
|
820
826
|
}
|
|
821
827
|
/**
|
|
822
828
|
* Executes the focus operation on the specified range of cells.
|
|
@@ -963,7 +969,7 @@ const OverlaySelection = class {
|
|
|
963
969
|
return;
|
|
964
970
|
}
|
|
965
971
|
let { changed, range } = this.columnService.getTransformedDataToApply(focus, data);
|
|
966
|
-
const { defaultPrevented: canPaste } = this.rangeClipboardPaste.emit(Object.assign({ data: changed, range }, this.types));
|
|
972
|
+
const { defaultPrevented: canPaste } = this.rangeClipboardPaste.emit(Object.assign({ data: changed, models: collectModelsOfRange(changed, this.dataStore), range }, this.types));
|
|
967
973
|
if (canPaste) {
|
|
968
974
|
return;
|
|
969
975
|
}
|