@revolist/revogrid 4.9.25 → 4.9.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{column.drag.plugin-d971a91a.js → column.drag.plugin-f3019314.js} +10 -10
- package/dist/cjs/column.drag.plugin-f3019314.js.map +1 -0
- package/dist/cjs/{column.service-6089b047.js → column.service-9d63ff18.js} +4 -2
- package/dist/cjs/column.service-9d63ff18.js.map +1 -0
- package/dist/cjs/{header-cell-renderer-2d56e8f5.js → header-cell-renderer-e4258dfd.js} +2 -2
- package/dist/cjs/{header-cell-renderer-2d56e8f5.js.map → header-cell-renderer-e4258dfd.js.map} +1 -1
- package/dist/cjs/index.cjs.js +3 -3
- package/dist/cjs/revo-grid.cjs.entry.js +3 -3
- package/dist/cjs/revogr-attribution_6.cjs.entry.js +1 -1
- package/dist/cjs/revogr-data_4.cjs.entry.js +2 -2
- package/dist/collection/plugins/filter/filter.plugin.js +7 -7
- package/dist/collection/plugins/filter/filter.plugin.js.map +1 -1
- package/dist/collection/utils/column.utils.js +3 -1
- package/dist/collection/utils/column.utils.js.map +1 -1
- package/dist/esm/{column.drag.plugin-170c12a3.js → column.drag.plugin-41640959.js} +10 -10
- package/dist/esm/column.drag.plugin-41640959.js.map +1 -0
- package/dist/esm/{column.service-407956dd.js → column.service-9e1f693c.js} +4 -2
- package/dist/esm/column.service-9e1f693c.js.map +1 -0
- package/dist/esm/{header-cell-renderer-da468bd2.js → header-cell-renderer-2ef5f8a1.js} +2 -2
- package/dist/esm/{header-cell-renderer-da468bd2.js.map → header-cell-renderer-2ef5f8a1.js.map} +1 -1
- package/dist/esm/index.js +3 -3
- package/dist/esm/revo-grid.entry.js +3 -3
- package/dist/esm/revogr-attribution_6.entry.js +1 -1
- package/dist/esm/revogr-data_4.entry.js +2 -2
- package/dist/revo-grid/{column.drag.plugin-170c12a3.js → column.drag.plugin-41640959.js} +2 -2
- package/dist/revo-grid/{column.drag.plugin-170c12a3.js.map → column.drag.plugin-41640959.js.map} +1 -1
- package/dist/revo-grid/column.service-9e1f693c.js +5 -0
- package/dist/revo-grid/column.service-9e1f693c.js.map +1 -0
- package/dist/revo-grid/{header-cell-renderer-da468bd2.js → header-cell-renderer-2ef5f8a1.js} +2 -2
- package/dist/revo-grid/index.esm.js +1 -1
- package/dist/revo-grid/revo-grid.entry.js +1 -1
- package/dist/revo-grid/revogr-attribution_6.entry.js +1 -1
- package/dist/revo-grid/revogr-data_4.entry.js +1 -1
- package/dist/types/plugins/filter/filter.plugin.d.ts +2 -2
- package/hydrate/index.js +10 -8
- package/hydrate/index.mjs +10 -8
- package/package.json +1 -1
- package/standalone/column.service.js +3 -1
- package/standalone/column.service.js.map +1 -1
- package/standalone/revo-grid.js +7 -7
- package/standalone/revo-grid.js.map +1 -1
- package/dist/cjs/column.drag.plugin-d971a91a.js.map +0 -1
- package/dist/cjs/column.service-6089b047.js.map +0 -1
- package/dist/esm/column.drag.plugin-170c12a3.js.map +0 -1
- package/dist/esm/column.service-407956dd.js.map +0 -1
- package/dist/revo-grid/column.service-407956dd.js +0 -5
- package/dist/revo-grid/column.service-407956dd.js.map +0 -1
- /package/dist/revo-grid/{header-cell-renderer-da468bd2.js.map → header-cell-renderer-2ef5f8a1.js.map} +0 -0
package/dist/esm/{header-cell-renderer-da468bd2.js.map → header-cell-renderer-2ef5f8a1.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"header-cell-renderer-da468bd2.js","mappings":";;;;;;AAAA;;;;;;;;SAQgB,QAAQ,CACtB,MAA4B,EAC5B,SAAiB,EACjB,MAAuB;;IAGvB,MAAM,KAAK,GAAG,IAAI,WAAW,CAAiB,SAAS,EAAE;QACvD,MAAM;QACN,UAAU,EAAE,IAAI;QAChB,OAAO,EAAE,IAAI;KACd,CAAC,CAAC;;IAGH,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,aAAa,CAAC,KAAK,CAAC,CAAC;;IAG7B,OAAO,KAAK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AAc;MAEhC,kBAAkB,GAI1B,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,cAAc,EAAE,EAAE,QAAQ;IAC7C,IAAI,WAAW,GAA6B,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,IAAI,KAAI,EAAE,CAAC;IAC7D,IAAI,SAAS,GAAG,KAAK,CAAC;IACtB,IAAI,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,cAAc,EAAE;QACxB,WAAW,GAAG,IAAI,CAAC,cAAc,CAAC,CAAC,EAAE,IAAI,EAAE,cAAc,CAAC,CAAC;KAC5D;IACD,IAAI,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,gBAAgB,EAAE;QAC1B,MAAM,KAAK,GAAG,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC;QAC1C,IAAI,KAAK,EAAE;YACT,SAAS,GAAG,WAAW,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;SACvC;KACF;IACD,MAAM,WAAW,mCACZ,SAAS,KACZ,WAAW,CAAC,CAAa;YACvB,QAAQ,CAAC,CAAC,CAAC,aAAa,EAAE,eAAe,EAAE;gBACzC,IAAI;gBACJ,KAAK,EAAE,CAAC;aACT,CAAC,CAAC;SACJ,GACF,CAAC;IACF,QACE,EAAC,gBAAgB,oBAAK,WAAW;QAC/B,WAAK,KAAK,EAAC,gBAAgB,IAAE,WAAW,CAAO;QAC9C,QAAQ,CACQ,EACnB;AACJ;;;;","names":[],"sources":["src/plugins/dispatcher.ts","src/components/header/resizable.directive.tsx","src/components/header/resizable.element.tsx","src/components/header/header-cell-renderer.tsx"],"sourcesContent":["/**\n * Dispatches a custom event to a specified target element.\n *\n * @param target - The target element to dispatch the event to.\n * @param eventName - The name of the custom event.\n * @param detail - Optional. The detail of the custom event.\n * @returns The custom event that was dispatched.\n */\nexport function dispatch<DispatchDetail = any>(\n target: MouseEvent['target'],\n eventName: string,\n detail?: DispatchDetail,\n) {\n // Create a new CustomEvent with the specified event name and detail.\n const event = new CustomEvent<DispatchDetail>(eventName, {\n detail,\n cancelable: true, // Indicates whether the event can be canceled.\n bubbles: true, // Indicates whether the event bubbles up through the DOM.\n });\n\n // Dispatch the event on the target element.\n target?.dispatchEvent(event);\n\n // Return the custom event that was dispatched.\n return event;\n}\n\n/**\n * Dispatches a custom event based on an existing event object and prevents the default behavior of the original event.\n *\n * @param e - The original event object containing the target and preventDefault method.\n * @param eventName - The name of the custom event.\n * @param detail - Optional. The detail of the custom event.\n * @returns The custom event that was dispatched.\n */\nexport function dispatchByEvent<DispatchDetail = any>(\n e: Pick<MouseEvent, 'target' | 'preventDefault'>, // The original event object containing the target and preventDefault method.\n eventName: string, // The name of the custom event.\n detail?: DispatchDetail, // Optional. The detail of the custom event.\n): CustomEvent {\n // Prevent the default behavior of the original event.\n e.preventDefault();\n\n // Dispatch the custom event to the target element specified in the original event object.\n return dispatch<DispatchDetail>(e.target, eventName, detail);\n}\n","export type ResizeProps = {\n active: ('r' | 'rb' | 'b' | 'lb' | 'l' | 'lt' | 't' | 'rt')[]; // all\n fitParent: boolean; // false\n minWidth: number; // 0\n minHeight: number; // 0\n\n disableAttributes: ('l' | 't' | 'w' | 'h')[]; // []\n maxWidth?: number;\n maxHeight?: number;\n\n onResize?(e: ResizeEvent): void;\n};\n\nexport type ResizeEvent = {\n eventName: string;\n changedX?: number;\n changedY?: number;\n width?: number;\n height?: number;\n};\n\nexport enum ResizeEvents {\n start = 'resize:start',\n move = 'resize:move',\n end = 'resize:end',\n}\n\nconst RESIZE_MASK: { [key: string]: any } = {\n 'resizable-r': { bit: 0b0001, cursor: 'ew-resize' },\n 'resizable-rb': { bit: 0b0011, cursor: 'se-resize' },\n 'resizable-b': { bit: 0b0010, cursor: 's-resize' },\n 'resizable-lb': { bit: 0b0110, cursor: 'sw-resize' },\n 'resizable-l': { bit: 0b0100, cursor: 'w-resize' },\n 'resizable-lt': { bit: 0b1100, cursor: 'nw-resize' },\n 'resizable-t': { bit: 0b1000, cursor: 'n-resize' },\n 'resizable-rt': { bit: 0b1001, cursor: 'ne-resize' },\n};\n\nconst DISABLE_MASK = {\n l: 0b0001,\n t: 0b0010,\n w: 0b0100,\n h: 0b1000,\n};\n\nconst defaultProps = (props: Partial<ResizeProps>): ResizeProps => {\n return {\n ...props,\n fitParent: props.fitParent || false,\n active: props.active || [],\n disableAttributes: props.disableAttributes || [],\n minWidth: props.minWidth || 0,\n minHeight: props.minHeight || 0,\n };\n};\n\nexport class ResizeDirective {\n private $el: HTMLElement;\n private props: ResizeProps;\n private minW: number;\n private minH: number;\n private maxW: number;\n private maxH: number;\n\n private mouseX = 0;\n private mouseY = 0;\n\n private width = 0;\n private height = 0;\n\n private changeX = 0;\n private changeY = 0;\n\n private parent: { width: number; height: number };\n private resizeState: number;\n private activeResizer?: HTMLElement;\n private disableCalcMap = 0b1111;\n\n private mouseMoveFunc: () => void;\n private mouseUpFunc: () => void;\n\n constructor(\n private initialProps: Partial<ResizeProps>,\n private $event?: (e: ResizeEvent) => void,\n ) {\n this.props = defaultProps(initialProps);\n this.mouseMoveFunc = this.handleMove.bind(this);\n this.mouseUpFunc = this.handleUp.bind(this);\n\n this.minW = this.props.minWidth;\n this.minH = this.props.minHeight;\n this.maxW = this.props.maxWidth ?? 0;\n this.maxH = this.props.maxHeight ?? 0;\n this.parent = { width: 0, height: 0 };\n this.resizeState = 0;\n }\n\n set($el: HTMLElement) {\n this.$el = $el;\n this.props.disableAttributes.forEach(attr => {\n switch (attr) {\n case 'l':\n this.disableCalcMap &= ~DISABLE_MASK.l;\n break;\n case 't':\n this.disableCalcMap &= ~DISABLE_MASK.t;\n break;\n case 'w':\n this.disableCalcMap &= ~DISABLE_MASK.w;\n break;\n case 'h':\n this.disableCalcMap &= ~DISABLE_MASK.h;\n }\n });\n }\n emitEvent(eventName: string, additionalOptions?: any) {\n if (!this.$event) {\n return;\n }\n const isLeft = this.activeResizer?.classList.contains('resizable-l');\n this.$event({\n eventName,\n width: this.width + this.changeX * (isLeft ? -1 : 1),\n height: this.height + this.changeY,\n changedX: this.changeX,\n changedY: this.changeY,\n ...additionalOptions,\n });\n }\n\n private static isTouchEvent(e: MouseEvent | TouchEvent): e is TouchEvent {\n const event = e as TouchEvent;\n return event.touches?.length >= 0;\n }\n\n handleMove(event: MouseEvent | TouchEvent) {\n if (!this.resizeState) {\n return;\n }\n let eventY, eventX;\n if (ResizeDirective.isTouchEvent(event)) {\n eventY = event.touches[0].clientY;\n eventX = event.touches[0].clientX;\n } else {\n eventY = event.clientY;\n eventX = event.clientX;\n }\n let isX =\n this.resizeState & RESIZE_MASK['resizable-r'].bit ||\n this.resizeState & RESIZE_MASK['resizable-l'].bit;\n\n let isY =\n this.resizeState & RESIZE_MASK['resizable-t'].bit ||\n this.resizeState & RESIZE_MASK['resizable-b'].bit;\n\n if (isY && this.disableCalcMap & DISABLE_MASK.h) {\n let diffY = eventY - this.mouseY;\n let changedY = this.changeY + diffY;\n const newHeight = this.height + changedY;\n // if overcrossed min height\n if (newHeight < this.minH) {\n changedY = -(this.height - this.minH);\n }\n // if overcrossed max heiht\n if (this.maxH && newHeight > this.maxH) {\n changedY = this.maxH - this.height;\n }\n\n this.changeY = changedY;\n this.mouseY = eventY;\n\n if (this.activeResizer) {\n this.activeResizer.style.bottom = `${-this.changeY}px`;\n }\n }\n if (isX && this.disableCalcMap & DISABLE_MASK.w) {\n const isLeft = this.activeResizer?.classList.contains('resizable-l');\n let diffX = eventX - this.mouseX;\n let changedX = this.changeX + diffX;\n const newWidth = this.width + changedX * (isLeft ? -1 : 1);\n\n // if overcrossed min width\n if (newWidth < this.minW) {\n changedX = -(this.width - this.minW);\n }\n // if overcrossed max width\n if (this.maxW && newWidth > this.maxW) {\n changedX = this.maxW - this.width;\n }\n\n this.changeX = changedX;\n this.mouseX = eventX;\n\n if (this.activeResizer) {\n if (!isLeft) {\n this.activeResizer.style.right = `${-this.changeX}px`;\n } else {\n this.activeResizer.style.left = `${this.changeX}px`;\n }\n }\n }\n this.emitEvent(ResizeEvents.move);\n }\n\n handleDown(event: MouseEvent | TouchEvent) {\n if (event.defaultPrevented) {\n return;\n }\n // stop other events if resize in progress\n event.preventDefault();\n\n this.dropInitial();\n for (let elClass in RESIZE_MASK) {\n const target = event.target as HTMLElement | null;\n if (this.$el.contains(target) && target?.classList.contains(elClass)) {\n document.body.style.cursor = RESIZE_MASK[elClass].cursor;\n if (ResizeDirective.isTouchEvent(event)) {\n this.setInitials(event.touches[0], target);\n } else {\n event.preventDefault && event.preventDefault();\n this.setInitials(event, target);\n }\n this.resizeState = RESIZE_MASK[elClass].bit;\n const eventName = ResizeEvents.start;\n this.emitEvent(eventName);\n break;\n }\n }\n this.bindMove();\n }\n\n handleUp(e: MouseEvent) {\n e.preventDefault();\n if (this.resizeState !== 0) {\n this.resizeState = 0;\n document.body.style.cursor = '';\n const eventName = ResizeEvents.end;\n this.emitEvent(eventName);\n }\n this.dropInitial();\n this.unbindMove();\n }\n\n private setInitials(\n { clientX, clientY }: { clientX: number; clientY: number },\n target?: HTMLElement,\n ) {\n const computedStyle = getComputedStyle(this.$el);\n this.$el.classList.add('active');\n this.activeResizer = target;\n\n if (this.disableCalcMap & DISABLE_MASK.w) {\n this.mouseX = clientX;\n this.width = this.$el.clientWidth;\n this.parent.width = this.$el.parentElement?.clientWidth ?? 0;\n\n // min width\n const minPaddingX =\n parseFloat(computedStyle.paddingLeft) +\n parseFloat(computedStyle.paddingRight);\n this.minW = Math.max(minPaddingX, this.initialProps.minWidth || 0);\n\n // max width\n if (this.initialProps.maxWidth) {\n this.maxW = Math.max(this.width, this.initialProps.maxWidth);\n }\n }\n\n if (this.disableCalcMap & DISABLE_MASK.h) {\n this.mouseY = clientY;\n this.height = this.$el.clientHeight;\n this.parent.height = this.$el.parentElement?.clientHeight ?? 0;\n\n // min height\n const minPaddingY =\n parseFloat(computedStyle.paddingTop) +\n parseFloat(computedStyle.paddingBottom);\n this.minH = Math.max(minPaddingY, this.initialProps.minHeight || 0);\n // max height\n if (this.initialProps.maxHeight) {\n this.maxH = Math.max(this.height, this.initialProps.maxHeight);\n }\n }\n }\n\n private dropInitial() {\n this.changeX = this.changeY = this.minW = this.minH;\n this.width = this.height = 0;\n if (this.activeResizer) {\n this.activeResizer.removeAttribute('style');\n }\n this.$el.classList.remove('active');\n this.activeResizer = undefined;\n }\n\n private bindMove() {\n document.documentElement.addEventListener(\n 'mouseup',\n this.mouseUpFunc,\n true,\n );\n document.documentElement.addEventListener(\n 'touchend',\n this.mouseUpFunc,\n true,\n );\n document.documentElement.addEventListener(\n 'mousemove',\n this.mouseMoveFunc,\n true,\n );\n document.documentElement.addEventListener(\n 'touchmove',\n this.mouseMoveFunc,\n true,\n );\n document.documentElement.addEventListener('mouseleave', this.mouseUpFunc);\n }\n\n private unbindMove() {\n document.documentElement.removeEventListener(\n 'mouseup',\n this.mouseUpFunc,\n true,\n );\n document.documentElement.removeEventListener(\n 'touchend',\n this.mouseUpFunc,\n true,\n );\n document.documentElement.removeEventListener(\n 'mousemove',\n this.mouseMoveFunc,\n true,\n );\n document.documentElement.removeEventListener(\n 'touchmove',\n this.mouseMoveFunc,\n true,\n );\n document.documentElement.removeEventListener(\n 'mouseleave',\n this.mouseUpFunc,\n );\n }\n}\n","import { FunctionalComponent, h, VNode } from '@stencil/core';\nimport {\n ResizeProps,\n ResizeDirective,\n ResizeEvents,\n} from './resizable.directive';\nimport type { CellProps } from '@type';\n\nexport type ResizableElementHTMLAttributes = Partial<ResizeProps> & CellProps;\n\nexport const ResizableElement: FunctionalComponent = (\n props: ResizableElementHTMLAttributes,\n children: VNode[],\n) => {\n const resizeEls: VNode[] = [];\n const directive =\n (props.canResize &&\n new ResizeDirective(props, e => {\n if (e.eventName === ResizeEvents.end) {\n props.onResize?.(e);\n }\n })) ||\n null;\n\n if (props.active) {\n if (props.canResize) {\n for (let p in props.active) {\n resizeEls.push(\n <div\n onClick={e => e.preventDefault()}\n onDblClick={e => {\n e.preventDefault();\n props.onDblClick?.(e);\n }}\n onMouseDown={(e: MouseEvent) => directive?.handleDown(e)}\n onTouchStart={(e: TouchEvent) => directive?.handleDown(e)}\n class={`resizable resizable-${props.active[p]}`}\n />,\n );\n }\n } else {\n for (let p in props.active) {\n resizeEls.push(\n <div\n onClick={e => e.preventDefault()}\n onTouchStart={(e: TouchEvent) => e.preventDefault()}\n onDblClick={e => {\n e.preventDefault();\n props.onDblClick?.(e);\n }}\n class={`no-resize resizable resizable-${props.active[p]}`}\n />,\n );\n }\n }\n }\n return (\n <div {...props} ref={e => e && directive?.set(e)}>\n {children}\n {resizeEls}\n </div>\n );\n};\n","import { FunctionalComponent, h, VNode } from '@stencil/core';\nimport { dispatch } from '../../plugins/dispatcher';\nimport { doPropMerge } from '../data/column.service';\nimport {\n ResizableElement,\n ResizableElementHTMLAttributes,\n} from './resizable.element';\nimport { ColumnTemplateProp } from '@type';\n\nexport const ON_COLUMN_CLICK = 'columnclick';\n\nexport const HeaderCellRenderer: FunctionalComponent<{\n props: ResizableElementHTMLAttributes;\n additionalData: any;\n data?: ColumnTemplateProp;\n}> = ({ data, props, additionalData }, children) => {\n let colTemplate: VNode | VNode[] | string = data?.name || '';\n let cellProps = props;\n if (data?.columnTemplate) {\n colTemplate = data.columnTemplate(h, data, additionalData);\n }\n if (data?.columnProperties) {\n const extra = data.columnProperties(data);\n if (extra) {\n cellProps = doPropMerge(props, extra);\n }\n }\n const resizeProps = {\n ...cellProps,\n onMouseDown(e: MouseEvent) {\n dispatch(e.currentTarget, ON_COLUMN_CLICK, {\n data,\n event: e,\n });\n },\n };\n return (\n <ResizableElement {...resizeProps}>\n <div class=\"header-content\">{colTemplate}</div>\n {children}\n </ResizableElement>\n );\n};\n"],"version":3}
|
|
1
|
+
{"file":"header-cell-renderer-2ef5f8a1.js","mappings":";;;;;;AAAA;;;;;;;;SAQgB,QAAQ,CACtB,MAA4B,EAC5B,SAAiB,EACjB,MAAuB;;IAGvB,MAAM,KAAK,GAAG,IAAI,WAAW,CAAiB,SAAS,EAAE;QACvD,M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E,CAAC,IAAI,CAAC,KAAI,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,GAAG,CAAC,CAAC,CAAC,CAAA;QAC7C,QAAQ;QACR,SAAS,CACN,EACN;AACJ,CAAC;;MCrDY,eAAe,GAAG,cAAc;MAEhC,kBAAkB,GAI1B,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,cAAc,EAAE,EAAE,QAAQ;IAC7C,IAAI,WAAW,GAA6B,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,IAAI,KAAI,EAAE,CAAC;IAC7D,IAAI,SAAS,GAAG,KAAK,CAAC;IACtB,IAAI,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,cAAc,EAAE;QACxB,WAAW,GAAG,IAAI,CAAC,cAAc,CAAC,CAAC,EAAE,IAAI,EAAE,cAAc,CAAC,CAAC;KAC5D;IACD,IAAI,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,gBAAgB,EAAE;QAC1B,MAAM,KAAK,GAAG,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC;QAC1C,IAAI,KAAK,EAAE;YACT,SAAS,GAAG,WAAW,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;SACvC;KACF;IACD,MAAM,WAAW,mCACZ,SAAS,KACZ,WAAW,CAAC,CAAa;YACvB,QAAQ,CAAC,CAAC,CAAC,aAAa,EAAE,eAAe,EAAE;gBACzC,IAAI;gBACJ,KAAK,EAAE,CAAC;aACT,CAAC,CAAC;SACJ,GACF,CAAC;IACF,QACE,EAAC,gBAAgB,oBAAK,WAAW;QAC/B,WAAK,KAAK,EAAC,gBAAgB,IAAE,WAAW,CAAO;QAC9C,QAAQ,CACQ,EACnB;AACJ;;;;","names":[],"sources":["src/plugins/dispatcher.ts","src/components/header/resizable.directive.tsx","src/components/header/resizable.element.tsx","src/components/header/header-cell-renderer.tsx"],"sourcesContent":["/**\n * Dispatches a custom event to a specified target element.\n *\n * @param target - The target element to dispatch the event to.\n * @param eventName - The name of the custom event.\n * @param detail - Optional. The detail of the custom event.\n * @returns The custom event that was dispatched.\n */\nexport function dispatch<DispatchDetail = any>(\n target: MouseEvent['target'],\n eventName: string,\n detail?: DispatchDetail,\n) {\n // Create a new CustomEvent with the specified event name and detail.\n const event = new CustomEvent<DispatchDetail>(eventName, {\n detail,\n cancelable: true, // Indicates whether the event can be canceled.\n bubbles: true, // Indicates whether the event bubbles up through the DOM.\n });\n\n // Dispatch the event on the target element.\n target?.dispatchEvent(event);\n\n // Return the custom event that was dispatched.\n return event;\n}\n\n/**\n * Dispatches a custom event based on an existing event object and prevents the default behavior of the original event.\n *\n * @param e - The original event object containing the target and preventDefault method.\n * @param eventName - The name of the custom event.\n * @param detail - Optional. The detail of the custom event.\n * @returns The custom event that was dispatched.\n */\nexport function dispatchByEvent<DispatchDetail = any>(\n e: Pick<MouseEvent, 'target' | 'preventDefault'>, // The original event object containing the target and preventDefault method.\n eventName: string, // The name of the custom event.\n detail?: DispatchDetail, // Optional. The detail of the custom event.\n): CustomEvent {\n // Prevent the default behavior of the original event.\n e.preventDefault();\n\n // Dispatch the custom event to the target element specified in the original event object.\n return dispatch<DispatchDetail>(e.target, eventName, detail);\n}\n","export type ResizeProps = {\n active: ('r' | 'rb' | 'b' | 'lb' | 'l' | 'lt' | 't' | 'rt')[]; // all\n fitParent: boolean; // false\n minWidth: number; // 0\n minHeight: number; // 0\n\n disableAttributes: ('l' | 't' | 'w' | 'h')[]; // []\n maxWidth?: number;\n maxHeight?: number;\n\n onResize?(e: ResizeEvent): void;\n};\n\nexport type ResizeEvent = {\n eventName: string;\n changedX?: number;\n changedY?: number;\n width?: number;\n height?: number;\n};\n\nexport enum ResizeEvents {\n start = 'resize:start',\n move = 'resize:move',\n end = 'resize:end',\n}\n\nconst RESIZE_MASK: { [key: string]: any } = {\n 'resizable-r': { bit: 0b0001, cursor: 'ew-resize' },\n 'resizable-rb': { bit: 0b0011, cursor: 'se-resize' },\n 'resizable-b': { bit: 0b0010, cursor: 's-resize' },\n 'resizable-lb': { bit: 0b0110, cursor: 'sw-resize' },\n 'resizable-l': { bit: 0b0100, cursor: 'w-resize' },\n 'resizable-lt': { bit: 0b1100, cursor: 'nw-resize' },\n 'resizable-t': { bit: 0b1000, cursor: 'n-resize' },\n 'resizable-rt': { bit: 0b1001, cursor: 'ne-resize' },\n};\n\nconst DISABLE_MASK = {\n l: 0b0001,\n t: 0b0010,\n w: 0b0100,\n h: 0b1000,\n};\n\nconst defaultProps = (props: Partial<ResizeProps>): ResizeProps => {\n return {\n ...props,\n fitParent: props.fitParent || false,\n active: props.active || [],\n disableAttributes: props.disableAttributes || [],\n minWidth: props.minWidth || 0,\n minHeight: props.minHeight || 0,\n };\n};\n\nexport class ResizeDirective {\n private $el: HTMLElement;\n private props: ResizeProps;\n private minW: number;\n private minH: number;\n private maxW: number;\n private maxH: number;\n\n private mouseX = 0;\n private mouseY = 0;\n\n private width = 0;\n private height = 0;\n\n private changeX = 0;\n private changeY = 0;\n\n private parent: { width: number; height: number };\n private resizeState: number;\n private activeResizer?: HTMLElement;\n private disableCalcMap = 0b1111;\n\n private mouseMoveFunc: () => void;\n private mouseUpFunc: () => void;\n\n constructor(\n private initialProps: Partial<ResizeProps>,\n private $event?: (e: ResizeEvent) => void,\n ) {\n this.props = defaultProps(initialProps);\n this.mouseMoveFunc = this.handleMove.bind(this);\n this.mouseUpFunc = this.handleUp.bind(this);\n\n this.minW = this.props.minWidth;\n this.minH = this.props.minHeight;\n this.maxW = this.props.maxWidth ?? 0;\n this.maxH = this.props.maxHeight ?? 0;\n this.parent = { width: 0, height: 0 };\n this.resizeState = 0;\n }\n\n set($el: HTMLElement) {\n this.$el = $el;\n this.props.disableAttributes.forEach(attr => {\n switch (attr) {\n case 'l':\n this.disableCalcMap &= ~DISABLE_MASK.l;\n break;\n case 't':\n this.disableCalcMap &= ~DISABLE_MASK.t;\n break;\n case 'w':\n this.disableCalcMap &= ~DISABLE_MASK.w;\n break;\n case 'h':\n this.disableCalcMap &= ~DISABLE_MASK.h;\n }\n });\n }\n emitEvent(eventName: string, additionalOptions?: any) {\n if (!this.$event) {\n return;\n }\n const isLeft = this.activeResizer?.classList.contains('resizable-l');\n this.$event({\n eventName,\n width: this.width + this.changeX * (isLeft ? -1 : 1),\n height: this.height + this.changeY,\n changedX: this.changeX,\n changedY: this.changeY,\n ...additionalOptions,\n });\n }\n\n private static isTouchEvent(e: MouseEvent | TouchEvent): e is TouchEvent {\n const event = e as TouchEvent;\n return event.touches?.length >= 0;\n }\n\n handleMove(event: MouseEvent | TouchEvent) {\n if (!this.resizeState) {\n return;\n }\n let eventY, eventX;\n if (ResizeDirective.isTouchEvent(event)) {\n eventY = event.touches[0].clientY;\n eventX = event.touches[0].clientX;\n } else {\n eventY = event.clientY;\n eventX = event.clientX;\n }\n let isX =\n this.resizeState & RESIZE_MASK['resizable-r'].bit ||\n this.resizeState & RESIZE_MASK['resizable-l'].bit;\n\n let isY =\n this.resizeState & RESIZE_MASK['resizable-t'].bit ||\n this.resizeState & RESIZE_MASK['resizable-b'].bit;\n\n if (isY && this.disableCalcMap & DISABLE_MASK.h) {\n let diffY = eventY - this.mouseY;\n let changedY = this.changeY + diffY;\n const newHeight = this.height + changedY;\n // if overcrossed min height\n if (newHeight < this.minH) {\n changedY = -(this.height - this.minH);\n }\n // if overcrossed max heiht\n if (this.maxH && newHeight > this.maxH) {\n changedY = this.maxH - this.height;\n }\n\n this.changeY = changedY;\n this.mouseY = eventY;\n\n if (this.activeResizer) {\n this.activeResizer.style.bottom = `${-this.changeY}px`;\n }\n }\n if (isX && this.disableCalcMap & DISABLE_MASK.w) {\n const isLeft = this.activeResizer?.classList.contains('resizable-l');\n let diffX = eventX - this.mouseX;\n let changedX = this.changeX + diffX;\n const newWidth = this.width + changedX * (isLeft ? -1 : 1);\n\n // if overcrossed min width\n if (newWidth < this.minW) {\n changedX = -(this.width - this.minW);\n }\n // if overcrossed max width\n if (this.maxW && newWidth > this.maxW) {\n changedX = this.maxW - this.width;\n }\n\n this.changeX = changedX;\n this.mouseX = eventX;\n\n if (this.activeResizer) {\n if (!isLeft) {\n this.activeResizer.style.right = `${-this.changeX}px`;\n } else {\n this.activeResizer.style.left = `${this.changeX}px`;\n }\n }\n }\n this.emitEvent(ResizeEvents.move);\n }\n\n handleDown(event: MouseEvent | TouchEvent) {\n if (event.defaultPrevented) {\n return;\n }\n // stop other events if resize in progress\n event.preventDefault();\n\n this.dropInitial();\n for (let elClass in RESIZE_MASK) {\n const target = event.target as HTMLElement | null;\n if (this.$el.contains(target) && target?.classList.contains(elClass)) {\n document.body.style.cursor = RESIZE_MASK[elClass].cursor;\n if (ResizeDirective.isTouchEvent(event)) {\n this.setInitials(event.touches[0], target);\n } else {\n event.preventDefault && event.preventDefault();\n this.setInitials(event, target);\n }\n this.resizeState = RESIZE_MASK[elClass].bit;\n const eventName = ResizeEvents.start;\n this.emitEvent(eventName);\n break;\n }\n }\n this.bindMove();\n }\n\n handleUp(e: MouseEvent) {\n e.preventDefault();\n if (this.resizeState !== 0) {\n this.resizeState = 0;\n document.body.style.cursor = '';\n const eventName = ResizeEvents.end;\n this.emitEvent(eventName);\n }\n this.dropInitial();\n this.unbindMove();\n }\n\n private setInitials(\n { clientX, clientY }: { clientX: number; clientY: number },\n target?: HTMLElement,\n ) {\n const computedStyle = getComputedStyle(this.$el);\n this.$el.classList.add('active');\n this.activeResizer = target;\n\n if (this.disableCalcMap & DISABLE_MASK.w) {\n this.mouseX = clientX;\n this.width = this.$el.clientWidth;\n this.parent.width = this.$el.parentElement?.clientWidth ?? 0;\n\n // min width\n const minPaddingX =\n parseFloat(computedStyle.paddingLeft) +\n parseFloat(computedStyle.paddingRight);\n this.minW = Math.max(minPaddingX, this.initialProps.minWidth || 0);\n\n // max width\n if (this.initialProps.maxWidth) {\n this.maxW = Math.max(this.width, this.initialProps.maxWidth);\n }\n }\n\n if (this.disableCalcMap & DISABLE_MASK.h) {\n this.mouseY = clientY;\n this.height = this.$el.clientHeight;\n this.parent.height = this.$el.parentElement?.clientHeight ?? 0;\n\n // min height\n const minPaddingY =\n parseFloat(computedStyle.paddingTop) +\n parseFloat(computedStyle.paddingBottom);\n this.minH = Math.max(minPaddingY, this.initialProps.minHeight || 0);\n // max height\n if (this.initialProps.maxHeight) {\n this.maxH = Math.max(this.height, this.initialProps.maxHeight);\n }\n }\n }\n\n private dropInitial() {\n this.changeX = this.changeY = this.minW = this.minH;\n this.width = this.height = 0;\n if (this.activeResizer) {\n this.activeResizer.removeAttribute('style');\n }\n this.$el.classList.remove('active');\n this.activeResizer = undefined;\n }\n\n private bindMove() {\n document.documentElement.addEventListener(\n 'mouseup',\n this.mouseUpFunc,\n true,\n );\n document.documentElement.addEventListener(\n 'touchend',\n this.mouseUpFunc,\n true,\n );\n document.documentElement.addEventListener(\n 'mousemove',\n this.mouseMoveFunc,\n true,\n );\n document.documentElement.addEventListener(\n 'touchmove',\n this.mouseMoveFunc,\n true,\n );\n document.documentElement.addEventListener('mouseleave', this.mouseUpFunc);\n }\n\n private unbindMove() {\n document.documentElement.removeEventListener(\n 'mouseup',\n this.mouseUpFunc,\n true,\n );\n document.documentElement.removeEventListener(\n 'touchend',\n this.mouseUpFunc,\n true,\n );\n document.documentElement.removeEventListener(\n 'mousemove',\n this.mouseMoveFunc,\n true,\n );\n document.documentElement.removeEventListener(\n 'touchmove',\n this.mouseMoveFunc,\n true,\n );\n document.documentElement.removeEventListener(\n 'mouseleave',\n this.mouseUpFunc,\n );\n }\n}\n","import { FunctionalComponent, h, VNode } from '@stencil/core';\nimport {\n ResizeProps,\n ResizeDirective,\n ResizeEvents,\n} from './resizable.directive';\nimport type { CellProps } from '@type';\n\nexport type ResizableElementHTMLAttributes = Partial<ResizeProps> & CellProps;\n\nexport const ResizableElement: FunctionalComponent = (\n props: ResizableElementHTMLAttributes,\n children: VNode[],\n) => {\n const resizeEls: VNode[] = [];\n const directive =\n (props.canResize &&\n new ResizeDirective(props, e => {\n if (e.eventName === ResizeEvents.end) {\n props.onResize?.(e);\n }\n })) ||\n null;\n\n if (props.active) {\n if (props.canResize) {\n for (let p in props.active) {\n resizeEls.push(\n <div\n onClick={e => e.preventDefault()}\n onDblClick={e => {\n e.preventDefault();\n props.onDblClick?.(e);\n }}\n onMouseDown={(e: MouseEvent) => directive?.handleDown(e)}\n onTouchStart={(e: TouchEvent) => directive?.handleDown(e)}\n class={`resizable resizable-${props.active[p]}`}\n />,\n );\n }\n } else {\n for (let p in props.active) {\n resizeEls.push(\n <div\n onClick={e => e.preventDefault()}\n onTouchStart={(e: TouchEvent) => e.preventDefault()}\n onDblClick={e => {\n e.preventDefault();\n props.onDblClick?.(e);\n }}\n class={`no-resize resizable resizable-${props.active[p]}`}\n />,\n );\n }\n }\n }\n return (\n <div {...props} ref={e => e && directive?.set(e)}>\n {children}\n {resizeEls}\n </div>\n );\n};\n","import { FunctionalComponent, h, VNode } from '@stencil/core';\nimport { dispatch } from '../../plugins/dispatcher';\nimport { doPropMerge } from '../data/column.service';\nimport {\n ResizableElement,\n ResizableElementHTMLAttributes,\n} from './resizable.element';\nimport { ColumnTemplateProp } from '@type';\n\nexport const ON_COLUMN_CLICK = 'columnclick';\n\nexport const HeaderCellRenderer: FunctionalComponent<{\n props: ResizableElementHTMLAttributes;\n additionalData: any;\n data?: ColumnTemplateProp;\n}> = ({ data, props, additionalData }, children) => {\n let colTemplate: VNode | VNode[] | string = data?.name || '';\n let cellProps = props;\n if (data?.columnTemplate) {\n colTemplate = data.columnTemplate(h, data, additionalData);\n }\n if (data?.columnProperties) {\n const extra = data.columnProperties(data);\n if (extra) {\n cellProps = doPropMerge(props, extra);\n }\n }\n const resizeProps = {\n ...cellProps,\n onMouseDown(e: MouseEvent) {\n dispatch(e.currentTarget, ON_COLUMN_CLICK, {\n data,\n event: e,\n });\n },\n };\n return (\n <ResizableElement {...resizeProps}>\n <div class=\"header-content\">{colTemplate}</div>\n {children}\n </ResizableElement>\n );\n};\n"],"version":3}
|
package/dist/esm/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Built by Revolist OU ❤️
|
|
3
3
|
*/
|
|
4
|
-
export { B as BasePlugin, D as DimensionStore, b as FILTER_CONFIG_CHANGED_EVENT, F as FILTER_TRIMMED_TYPE, d as FilterPlugin, c as columnTypes, f as filterCoreFunctionsIndexedByType, g as filterNames, e as filterTypes, h as getLeftRelative, i as isRowType, a as isStretchPlugin, r as rowTypes } from './column.drag.plugin-
|
|
5
|
-
export { d as dispatch, a as dispatchByEvent } from './header-cell-renderer-
|
|
4
|
+
export { B as BasePlugin, D as DimensionStore, b as FILTER_CONFIG_CHANGED_EVENT, F as FILTER_TRIMMED_TYPE, d as FilterPlugin, c as columnTypes, f as filterCoreFunctionsIndexedByType, g as filterNames, e as filterTypes, h as getLeftRelative, i as isRowType, a as isStretchPlugin, r as rowTypes } from './column.drag.plugin-41640959.js';
|
|
5
|
+
export { d as dispatch, a as dispatchByEvent } from './header-cell-renderer-2ef5f8a1.js';
|
|
6
6
|
export { h } from './index-a61f225b.js';
|
|
7
7
|
export { C as CELL_CLASS, K as CELL_HANDLER_CLASS, w as DATA_COL, x as DATA_ROW, y as DISABLED_CLASS, G as DRAGGABLE_CLASS, N as DRAGG_TEXT, F as DRAG_ICON_CLASS, D as DataStore, L as EDIT_INPUT_WR, I as FOCUS_CLASS, O as GRID_INTERNALS, E as HEADER_ACTUAL_ROW_CLASS, H as HEADER_CLASS, B as HEADER_ROW_CLASS, A as HEADER_SORTABLE_CLASS, M as MIN_COL_SIZE, J as MOBILE_CLASS, R as RESIZE_INTERVAL, P as ROW_FOCUSED_CLASS, z as ROW_HEADER_TYPE, S as SELECTION_BORDER_CLASS, T as TMP_SELECTION_BG_CLASS, u as applyMixins, h as calculateDimensionData, Q as codesLetter, k as findPositionInArray, f as gatherTrimmedItems, j as getItemByIndex, i as getItemByPosition, g as getPhysical, n as getScrollbarSize, b as getSourceItem, e as getSourceItemVirtualIndexByProp, a as getVisibleSourceItem, U as keyValues, m as mergeSortedArray, p as proxyPlugin, l as pushSorted, r as range, o as scaleValue, d as setItems, c as setSourceByPhysicalIndex, s as setSourceByVirtualIndex, v as setStore, q as timeout, t as trimmedPlugin } from './index-b6586f9b.js';
|
|
8
|
-
export { S as SelectionStore, c as cropCellToMax, k as gatherGroup, b as getCellData, d as getCellDataParsed, l as getColumnByProp, f as getColumnSizes, e as getColumnType, j as getColumns, g as getRange, h as isColGrouping, i as isHiddenStore, a as isRangeSingleCell, n as nextCell } from './column.service-
|
|
8
|
+
export { S as SelectionStore, c as cropCellToMax, k as gatherGroup, b as getCellData, d as getCellDataParsed, l as getColumnByProp, f as getColumnSizes, e as getColumnType, j as getColumns, g as getRange, h as isColGrouping, i as isHiddenStore, a as isRangeSingleCell, n as nextCell } from './column.service-9e1f693c.js';
|
|
9
9
|
export { S as SortingSign } from './sorting.sign-1a675bf7.js';
|
|
10
10
|
export { T as TextEditor } from './text-editor-654f5d53.js';
|
|
11
11
|
export { V as ViewportStore, a as addMissingItems, f as calculateRowHeaderSize, d as getFirstItem, b as getItems, e as getLastItem, g as getUpdatedItemsByPosition, i as isActiveRange, c as isActiveRangeOutsideLastItem, r as recombineByOffset, s as setItemSizes, u as updateMissingAndRange } from './row-header-utils-e043f744.js';
|
|
@@ -3,14 +3,14 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { h, r as registerInstance, c as createEvent, H as Host, a as getElement } from './index-a61f225b.js';
|
|
5
5
|
import { g as getPhysical, d as setItems, _ as isArray, a1 as baseProperty, a2 as isArrayLike, a3 as getTag, a4 as baseKeys, a5 as range, v as setStore, D as DataStore, b as getSourceItem, W as reduce, e as getSourceItemVirtualIndexByProp, s as setSourceByVirtualIndex, X as forEach, a as getVisibleSourceItem, f as gatherTrimmedItems, j as getItemByIndex, R as RESIZE_INTERVAL, q as timeout } from './index-b6586f9b.js';
|
|
6
|
-
import { B as BasePlugin, c as columnTypes, F as FILTER_TRIMMED_TYPE, r as rowTypes, i as isRowType, D as DimensionStore, a as isStretchPlugin, S as StretchColumn, A as AutoSizeColumnPlugin, d as FilterPlugin, E as ExportFilePlugin, C as ColumnPlugin } from './column.drag.plugin-
|
|
7
|
-
import { m as isGrouping, G as GROUP_EXPANDED, q as getParsedGroup, r as isSameGroup, s as GROUP_DEPTH, P as PSEUDO_GROUP_ITEM_VALUE, t as PSEUDO_GROUP_ITEM_ID, u as GROUPING_ROW_TYPE, v as PSEUDO_GROUP_COLUMN, w as GROUP_EXPAND_EVENT, x as gatherGrouping, y as isGroupingColumn, l as getColumnByProp, e as getColumnType, f as getColumnSizes, E as EMPTY_INDEX, j as getColumns, z as SelectionStoreConnector } from './column.service-
|
|
6
|
+
import { B as BasePlugin, c as columnTypes, F as FILTER_TRIMMED_TYPE, r as rowTypes, i as isRowType, D as DimensionStore, a as isStretchPlugin, S as StretchColumn, A as AutoSizeColumnPlugin, d as FilterPlugin, E as ExportFilePlugin, C as ColumnPlugin } from './column.drag.plugin-41640959.js';
|
|
7
|
+
import { m as isGrouping, G as GROUP_EXPANDED, q as getParsedGroup, r as isSameGroup, s as GROUP_DEPTH, P as PSEUDO_GROUP_ITEM_VALUE, t as PSEUDO_GROUP_ITEM_ID, u as GROUPING_ROW_TYPE, v as PSEUDO_GROUP_COLUMN, w as GROUP_EXPAND_EVENT, x as gatherGrouping, y as isGroupingColumn, l as getColumnByProp, e as getColumnType, f as getColumnSizes, E as EMPTY_INDEX, j as getColumns, z as SelectionStoreConnector } from './column.service-9e1f693c.js';
|
|
8
8
|
import { a as isObjectLike, b as baseGetTag, d as debounce } from './debounce-7b511afc.js';
|
|
9
9
|
import { V as ViewportStore } from './row-header-utils-e043f744.js';
|
|
10
10
|
import { v as viewportDataPartition, H as HEADER_SLOT, C as CONTENT_SLOT, F as FOOTER_SLOT, D as DATA_SLOT } from './viewport.helpers-7e7f9dad.js';
|
|
11
11
|
import { g as getPropertyFromEvent } from './events-cf0893a3.js';
|
|
12
12
|
import './filter.button-d40ab17b.js';
|
|
13
|
-
import './header-cell-renderer-
|
|
13
|
+
import './header-cell-renderer-2ef5f8a1.js';
|
|
14
14
|
|
|
15
15
|
class ThemeCompact {
|
|
16
16
|
constructor() {
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import { r as registerInstance, h, H as Host, c as createEvent, a as getElement } from './index-a61f225b.js';
|
|
5
5
|
import { b as getSourceItem, i as getItemByPosition, j as getItemByIndex, I as FOCUS_CLASS, Q as codesLetter, q as timeout, R as RESIZE_INTERVAL, K as CELL_HANDLER_CLASS, J as MOBILE_CLASS, S as SELECTION_BORDER_CLASS, D as DataStore, z as ROW_HEADER_TYPE, n as getScrollbarSize, T as TMP_SELECTION_BG_CLASS } from './index-b6586f9b.js';
|
|
6
6
|
import { g as getPropertyFromEvent, v as verifyTouchTarget } from './events-cf0893a3.js';
|
|
7
|
-
import { g as getRange, C as ColumnService, a as isRangeSingleCell } from './column.service-
|
|
7
|
+
import { g as getRange, C as ColumnService, a as isRangeSingleCell } from './column.service-9e1f693c.js';
|
|
8
8
|
import { i as isEditInput } from './edit.utils-1eeabeab.js';
|
|
9
9
|
import { c as isClear, d as isTab, f as isEnterKeyValue, h as isCopy, g as isCut, j as isPaste, k as isAll } from './key.utils-562c749e.js';
|
|
10
10
|
import { d as debounce } from './debounce-7b511afc.js';
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
* Built by Revolist OU ❤️
|
|
3
3
|
*/
|
|
4
4
|
import { h, r as registerInstance, c as createEvent, H as Host, a as getElement } from './index-a61f225b.js';
|
|
5
|
-
import { A as GROUP_EXPAND_BTN, w as GROUP_EXPAND_EVENT, B as PSEUDO_GROUP_ITEM, G as GROUP_EXPANDED, s as GROUP_DEPTH, D as isRowDragService, b as getCellData, C as ColumnService, m as isGrouping } from './column.service-
|
|
5
|
+
import { A as GROUP_EXPAND_BTN, w as GROUP_EXPAND_EVENT, B as PSEUDO_GROUP_ITEM, G as GROUP_EXPANDED, s as GROUP_DEPTH, D as isRowDragService, b as getCellData, C as ColumnService, m as isGrouping } from './column.service-9e1f693c.js';
|
|
6
6
|
import { M as MIN_COL_SIZE, H as HEADER_CLASS, a6 as findIndex, j as getItemByIndex, B as HEADER_ROW_CLASS, x as DATA_ROW, P as ROW_FOCUSED_CLASS, F as DRAG_ICON_CLASS, G as DRAGGABLE_CLASS, b as getSourceItem, w as DATA_COL, a7 as getNative, a8 as baseEach, _ as isArray, a9 as baseIteratee, I as FOCUS_CLASS, A as HEADER_SORTABLE_CLASS, E as HEADER_ACTUAL_ROW_CLASS } from './index-b6586f9b.js';
|
|
7
7
|
import { c as FilterButton } from './filter.button-d40ab17b.js';
|
|
8
8
|
import { S as SortingSign } from './sorting.sign-1a675bf7.js';
|
|
9
|
-
import { H as HeaderCellRenderer } from './header-cell-renderer-
|
|
9
|
+
import { H as HeaderCellRenderer } from './header-cell-renderer-2ef5f8a1.js';
|
|
10
10
|
import { t as throttle, L as LocalScrollTimer, a as LocalScrollService } from './throttle-bb3169c7.js';
|
|
11
11
|
import { H as HEADER_SLOT, C as CONTENT_SLOT, F as FOOTER_SLOT } from './viewport.helpers-7e7f9dad.js';
|
|
12
12
|
import './debounce-7b511afc.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Built by Revolist OU ❤️
|
|
3
3
|
*/
|
|
4
|
-
import{V as t,W as i,v as s,h as e,X as n,b as o,n as r,Y as c,Z as h,q as l,i as a}from"./index-b6586f9b.js";import{e as u,m as f,o as d,d as p,h as m}from"./column.service-407956dd.js";import{f as v}from"./row-header-utils-e043f744.js";import{h as g}from"./index-a61f225b.js";import{b,i as y}from"./filter.button-d40ab17b.js";import{d as w}from"./debounce-7b511afc.js";import{d as O,O as j}from"./header-cell-renderer-da468bd2.js";const S=t=>{let i={};const s=(s,e)=>{const n=Object.assign({},s);i={};for(const[t,s]of Object.entries(e)){const e=t;if(s&&n[e]){i[e]=n[e];delete n[e]}}t.setDimensionSize(n)};return{set(e,n){switch(e){case"trimmed":const e=n;const o=t.store.get("sizes");s(Object.assign(Object.assign({},o),i),e);break}}}};const E=t=>({set(i){switch(i){case"count":case"sizes":case"originItemSize":let i=0;const s=t.store.get("count");for(let e=0;e<s;e++){i+=t.store.get("sizes")[e]||t.store.get("originItemSize")}t.setStore({realSize:i});break}}});function x(){return{indexes:[],count:0,trimmed:{},sizes:{},positionIndexToItem:{},indexToItem:{},positionIndexes:[]}}function C(){return Object.assign(Object.assign({},x()),{realSize:0,originItemSize:0})}class z{constructor(i){this.type=i;this.store=t(C());this.store.use(S(this));this.store.use(E(this))}getCurrentState(){const t=C();const s=Object.keys(t);return i(s,((t,i)=>{const s=this.store.get(i);t[i]=s;return t}),t)}dispose(){s(this.store,C())}setStore(t){s(this.store,t)}drop(){s(this.store,x())}setDimensionSize(t){const i=e(this.store.get("originItemSize"),t);s(this.store,i)}}const P=["rowPinStart","rgRow","rowPinEnd"];const k=["colPinStart","rgCol","colPinEnd"];function q(t){return P.indexOf(t)>-1}class I{constructor(t,i){this.revogrid=t;this.providers=i;this.h=g;this.subscriptions={}}addEventListener(t,i){this.revogrid.addEventListener(t,i);this.subscriptions[t]=i}watch(t,i,{immediate:s}={immediate:false}){const e=Object.getOwnPropertyDescriptor(this.revogrid,t)||Object.getOwnPropertyDescriptor(this.revogrid.constructor.prototype,t);Object.defineProperty(this.revogrid,t,{set(t){var s;const n=i(t);if(n===false){return}return(s=e===null||e===void 0?void 0:e.set)===null||s===void 0?void 0:s.call(this,t)},get(){var t;return(t=e===null||e===void 0?void 0:e.get)===null||t===void 0?void 0:t.call(this)}});if(s){i(e===null||e===void 0?void 0:e.value)}}removeEventListener(t){this.revogrid.removeEventListener(t,this.subscriptions[t]);delete this.subscriptions[t]}emit(t,i){const s=new CustomEvent(t,{detail:i,cancelable:true});this.revogrid.dispatchEvent(s);return s}clearSubscriptions(){for(let t in this.subscriptions){this.removeEventListener(t)}}destroy(){this.clearSubscriptions()}}const N=7;var F;(function(t){t["headerClickAutosize"]="headerClickAutoSize";t["autoSizeOnTextOverlap"]="autoSizeOnTextOverlap";t["autoSizeAll"]="autoSizeAll"})(F||(F={}));class M extends I{constructor(t,i,s){super(t,i);this.providers=i;this.config=s;this.autoSizeColumns=null;this.dataResolve=null;this.dataReject=null;this.letterBlockSize=(s===null||s===void 0?void 0:s.letterBlockSize)||N;if(s===null||s===void 0?void 0:s.preciseSize){this.precsizeCalculationArea=this.initiatePresizeElement();t.appendChild(this.precsizeCalculationArea)}const e=({detail:{source:t}})=>{this.setSource(t)};const n=({detail:t})=>{this.afteredit(t)};const o=({detail:t})=>{this.afterEditAll(t)};const r=({detail:{columns:t}})=>{this.columnSet(t)};const c=({detail:t})=>{const i=u(t.column);const s=this.getColumnSize(t.index,i);if(s){this.providers.dimension.setCustomSizes(i,{[t.index]:s},true)}};this.addEventListener("beforecolumnsset",r);switch(s===null||s===void 0?void 0:s.mode){case F.autoSizeOnTextOverlap:this.addEventListener("aftersourceset",e);this.addEventListener("afteredit",n);break;case F.autoSizeAll:this.addEventListener("aftersourceset",e);this.addEventListener("afteredit",o);break;default:this.addEventListener("headerdblclick",c);break}}async setSource(t){let i=this.autoSizeColumns;if(this.dataReject){this.dataReject();this.clearPromise()}if(!i){const t=new Promise(((t,i)=>{this.dataResolve=t;this.dataReject=i}));try{i=await t}catch(t){return}}n(i,((s,e)=>{const o={};n(i[e],(i=>{i.size=o[i.index]=t.reduce(((t,s)=>Math.max(t,this.getLength(s[i.prop]))),this.getLength(i.name||""))}));this.providers.dimension.setCustomSizes(e,o,true)}))}getLength(t){var i;const s=15;if(!t){return 0}try{const e=t.toString();if((i=this.config)===null||i===void 0?void 0:i.preciseSize){this.precsizeCalculationArea.innerText=e;return this.precsizeCalculationArea.scrollWidth+s*2}return e.length*this.letterBlockSize+s*2}catch(t){return 0}}afteredit(t){let s;if(this.isRangeEdit(t)){s=t.data}else{s={0:{[t.prop]:t.val}}}n(this.autoSizeColumns,((t,e)=>{const o={};n(t,(t=>{var e;const n=i(s,((i,s)=>{if(typeof s[t.prop]==="undefined"){return i}return Math.max(i||0,this.getLength(s[t.prop]))}),undefined);if(n&&((e=t.size)!==null&&e!==void 0?e:0)<n){t.size=o[t.index]=n}}));this.providers.dimension.setCustomSizes(e,o,true)}))}afterEditAll(t){const i={};if(this.isRangeEdit(t)){n(t.data,(t=>n(t,((t,s)=>i[s]=true))))}else{i[t.prop]=true}n(this.autoSizeColumns,((t,s)=>{const e={};n(t,(t=>{if(i[t.prop]){const i=this.getColumnSize(t.index,s);if(i){e[t.index]=i}}}));this.providers.dimension.setCustomSizes(s,e,true)}))}getColumnSize(t,s){var e,n;const r=(n=(e=this.autoSizeColumns)===null||e===void 0?void 0:e[s])===null||n===void 0?void 0:n[t];if(!r){return 0}return i(this.providers.data.stores,((t,s)=>{const e=i(s.store.get("items"),((t,i,e)=>{const n=o(s.store,e);return Math.max(t||0,this.getLength(n===null||n===void 0?void 0:n[r.prop]))}),0);return Math.max(t,e)}),r.size||0)}columnSet(t){var i;for(let s of k){const e=s;const n=t[e];for(let t in n){if(n[t].autoSize||((i=this.config)===null||i===void 0?void 0:i.allColumns)){if(!this.autoSizeColumns){this.autoSizeColumns={}}if(!this.autoSizeColumns[e]){this.autoSizeColumns[e]={}}this.autoSizeColumns[e][t]=Object.assign(Object.assign({},n[t]),{index:parseInt(t,10)})}}}if(this.dataResolve){this.dataResolve(this.autoSizeColumns||{});this.clearPromise()}}clearPromise(){this.dataResolve=null;this.dataReject=null}isRangeEdit(t){return!!t.data}initiatePresizeElement(){var t;const i={position:"absolute",fontSize:"14px",height:"0",width:"0",whiteSpace:"nowrap",top:"0",overflowX:"scroll"};const s=document.createElement("div");for(let e in i){s.style[e]=(t=i[e])!==null&&t!==void 0?t:""}s.classList.add("revo-test-container");return s}destroy(){var t;super.destroy();(t=this.precsizeCalculationArea)===null||t===void 0?void 0:t.remove()}}class D extends I{constructor(t,i){super(t,i);this.providers=i;this.stretchedColumn=null;this.scrollSize=r(document);const s=({detail:{columns:t}})=>this.applyStretch(t);this.addEventListener("beforecolumnapplied",s)}setScroll({type:t,hasScroll:i}){var s;if(t==="rgRow"&&this.stretchedColumn&&((s=this.stretchedColumn)===null||s===void 0?void 0:s.initialSize)===this.stretchedColumn.size){if(i){this.stretchedColumn.size-=this.scrollSize;this.apply();this.dropChanges()}}}activateChanges(){const t=({detail:t})=>this.setScroll(t);this.addEventListener("scrollchange",t)}dropChanges(){this.stretchedColumn=null;this.removeEventListener("scrollchange")}apply(){if(!this.stretchedColumn){return}const t="rgCol";const i=this.providers.dimension.stores[t].store.get("sizes");this.providers.dimension.setCustomSizes(t,Object.assign(Object.assign({},i),{[this.stretchedColumn.index]:this.stretchedColumn.size}),true)}applyStretch(t){this.dropChanges();let i=this.revogrid.clientWidth-1;n(t,((t,s)=>{const e=this.providers.dimension.stores[s].store.get("realSize");i-=e}));if(this.revogrid.rowHeaders){const t=this.providers.data.stores.rgRow.store.get("source").length;const s=this.revogrid.rowHeaders;const e=v(t,typeof s==="object"?s:undefined);if(e){i-=e}}if(i>0){const s=t.rgCol.length-1;const e=t.rgCol[s];const n=(e===null||e===void 0?void 0:e.size)||this.revogrid.colSize||0;const o=i+n-1;if(e&&!e.autoSize&&n<o){this.stretchedColumn={initialSize:o,index:s,size:o};this.apply();this.activateChanges()}}}}function $(t){return!!t.applyStretch}function R(t,i,s){if(t===t){if(s!==undefined){t=t<=s?t:s}if(i!==undefined){t=t>=i?t:i}}return t}var A=4294967295;function B(t){return t?R(c(t),0,A):0}function T(t,i,s,e){var n=t.length;s=c(s);if(s<0){s=-s>n?0:n+s}e=e===undefined||e>n?n:c(e);if(e<0){e+=n}e=s>e?0:B(e);while(s<e){t[s++]=i}return t}function J(t,i,s,e){var n=t==null?0:t.length;if(!n){return[]}if(s&&typeof s!="number"&&h(t,i,s)){s=0;e=n}return T(t,i,s,e)}const H={mime:"text/csv",fileKind:"csv",bom:true,columnDelimiter:",",rowDelimiter:"\r\n",encoding:""};const L=String.fromCharCode(13);const X=String.fromCharCode(10);const G=String.fromCharCode(34);const K=String.fromCharCode(65279);const U=new RegExp('"',"g");class V{constructor(t={}){this.options=Object.assign(Object.assign({},H),t)}doExport({data:t,headers:i,props:s}){let e=this.options.bom?K:"";if((i===null||i===void 0?void 0:i.length)>0){i.forEach((t=>{if(!t.length){return}e+=this.prepareHeader(t,this.options.columnDelimiter);e+=this.options.rowDelimiter}))}t.forEach(((t,i)=>{if(i>0){e+=this.options.rowDelimiter}if(f(t)){e+=this.parseCell(d(t),this.options.columnDelimiter);return}e+=s.map((i=>this.parseCell(t[i],this.options.columnDelimiter))).join(this.options.columnDelimiter)}));return e}prepareHeader(t,i){let s="";const e=t.map((t=>this.parseCell(t,i,true)));s+=e.join(i);return s}parseCell(t,i,s=false){let e=t;if(typeof t!=="string"){e=JSON.stringify(t)}const n=[L,G,X,i];if(typeof e==="undefined"){return""}if(e!==""&&(s||n.some((t=>e.indexOf(t)>=0)))){return`"${e.replace(U,'""')}"`}return e}}var W;(function(t){t["csv"]="csv"})(W||(W={}));class Y extends I{async exportString(t={},i=W.csv){const s=await this.beforeexport();if(!s){return null}return this.formatter(i,t).doExport(s)}async exportBlob(t={},i=W.csv){return await this.getBlob(this.formatter(i,t))}async exportFile(t={},i=W.csv){const s=this.formatter(i,t);const e=window.URL||window.webkitURL;const n=document.createElement("a");const{filename:o,fileKind:r}=s.options;const c=`${o}.${r}`;const h=await this.getBlob(s);const a=h?e.createObjectURL(h):"";n.style.display="none";n.setAttribute("href",a);n.setAttribute("download",c);this.revogrid.appendChild(n);n.dispatchEvent(new MouseEvent("click"));this.revogrid.removeChild(n);await l(120);e.revokeObjectURL(a)}async getBlob(t){const i=`${t.options.mime};charset=${t.options.encoding}`;if(typeof Blob!=="undefined"){const s=await this.beforeexport();if(!s){return null}return new Blob([t.doExport(s)],{type:i})}return null}async beforeexport(){let t=await this.getData();const i=this.emit("beforeexport",{data:t});if(i.defaultPrevented){return null}return i.detail.data}async getData(){const t=await this.getSource();const i=[];const s=[];k.forEach(((t,e)=>{s.push(this.getColPerSource(t).then((t=>i[e]=t)))}));await Promise.all(s);const e={headers:[],props:[]};for(let t of i){t.headers.forEach(((t,i)=>{if(!e.headers[i]){e.headers[i]=[]}e.headers[i].push(...t)}));e.props.push(...t.props)}return Object.assign({data:t},e)}async getColPerSource(t){const i=await this.revogrid.getColumnStore(t);const s=i.get("source");const e=i.get("items");const n=i.get("groupingDepth");const o=i.get("groups");const r=[];const c=[];const h=e.reduce(((t,i,e)=>{const n=s[i].prop;r.push(s[i].name||"");c.push(n);t[n]=e;return t}),{});const l=this.getGroupHeaders(n,o,e,h);l.push(r);return{headers:l,props:c}}getGroupHeaders(t,i,s,e){const n=[];const o=J(new Array(s.length),"");for(let s=0;s<t;s++){const t=[...o];n.push(t);if(!i[s]){continue}const r=i[s];r.forEach((i=>{const s=this.findGroupStartIndex(i.ids,e);if(typeof s==="number"){t[s]=i.name}}))}return n}findGroupStartIndex(t,i){let s;t.forEach((t=>{const e=i[t];if(typeof e==="number"){if(typeof s!=="number"||s>e){s=e}}}));return s}async getSource(){const t=[];const i=[];P.forEach((s=>{const e=[];t.push(e);const n=this.revogrid.getVisibleSource(s).then((t=>e.push(...t)));i.push(n)}));await Promise.all(i);return t.reduce(((t,i)=>{t.push(...i);return t}),[])}formatter(t,i={}){switch(t){case W.csv:return new V(i);default:throw new Error("Unknown format")}}}const Z=(t,i)=>{if(typeof t==="undefined"||t===null&&!i){return true}if(typeof t!=="string"){t=JSON.stringify(t)}const s=i===null||i===void 0?void 0:i.toString().toLocaleLowerCase();if((s===null||s===void 0?void 0:s.length)===0){return true}return t.toLocaleLowerCase()===s};const Q=(t,i)=>!Z(t,i);Q.extra="input";Z.extra="input";const _=function(t,i){let s;if(typeof t==="number"&&typeof i!=="undefined"&&i!==null){s=parseFloat(i===null||i===void 0?void 0:i.toString());return t>s}return false};_.extra="input";const tt=function(t,i){return Z(t,i)||_(t,i)};tt.extra="input";const it=function(t,i){let s;if(typeof t==="number"&&typeof i!=="undefined"&&i!==null){s=parseFloat(i.toString());return t<s}else{return false}};it.extra="input";const st=function(t,i){return Z(t,i)||it(t,i)};st.extra="input";const et=t=>!(t===""||t===null||t===void 0);const nt=t=>!et(t);const ot=(t,i)=>{if(!t){return false}if(!i){return true}if(typeof t!=="string"){t=JSON.stringify(t)}if(typeof i!=="string"){i=JSON.stringify(i)}return t.toLocaleLowerCase().indexOf(i.toLocaleLowerCase())===0};ot.extra="input";const rt=(t,i)=>{if(!i){return true}if(!t){return false}if(i){if(typeof t!=="string"){t=JSON.stringify(t)}return t.toLocaleLowerCase().indexOf(i.toString().toLowerCase())>-1}return true};const ct=(t,i)=>!rt(t,i);ct.extra="input";rt.extra="input";const ht={none:()=>true,empty:nt,notEmpty:et,eq:Z,notEq:Q,begins:ot,contains:rt,notContains:ct,eqN:Z,neqN:Q,gt:_,gte:tt,lt:it,lte:st};const lt={string:["notEmpty","empty","eq","notEq","begins","contains","notContains"],number:["notEmpty","empty","eqN","neqN","gt","gte","lt","lte"]};const at={none:"None",empty:"Not set",notEmpty:"Set",eq:"Equal",notEq:"Not equal",begins:"Begins with",contains:"Contains",notContains:"Does not contain",eqN:"=",neqN:"!=",gt:">",gte:">=",lt:"<",lte:"<="};const ut="filter";const ft="filterconfigchanged";class dt extends I{constructor(t,i,s){var e;super(t,i);this.revogrid=t;this.filterCollection={};this.multiFilterItems={};this.filterByType=Object.assign({},lt);this.filterNameIndexByType=Object.assign({},at);this.filterFunctionsIndexedByType=Object.assign({},ht);this.filterProp=b;if(s){this.initConfig(s)}const n=async()=>{const t=Object.keys(this.filterCollection);if(t.length>0){t.forEach(((t,i)=>{if(!this.multiFilterItems[t]){this.multiFilterItems[t]=[{id:i,type:this.filterCollection[t].type,value:this.filterCollection[t].value,relation:"and"}]}}))}await this.runFiltering()};this.addEventListener("headerclick",(t=>this.headerclick(t)));this.addEventListener(ft,(({detail:t})=>{if(!t){this.clearFiltering();return}if(typeof t==="object"){this.initConfig(t)}n()}));this.addEventListener("aftersourceset",n);this.addEventListener("filter",(({detail:t})=>this.onFilterChange(t)));const o=this.revogrid.registerVNode.filter((t=>t.t!=="revogr-filter-panel"));this.revogrid.registerVNode=[...o,g("revogr-filter-panel",{filterItems:this.multiFilterItems,filterNames:this.filterNameIndexByType,filterEntities:this.filterFunctionsIndexedByType,filterCaptions:(e=s===null||s===void 0?void 0:s.localization)===null||e===void 0?void 0:e.captions,onFilterChange:t=>this.onFilterChange(t.detail),disableDynamicFiltering:s===null||s===void 0?void 0:s.disableDynamicFiltering,ref:t=>this.pop=t}," ",this.extraContent())]}extraContent(){return null}initConfig(t){if(t.multiFilterItems){this.multiFilterItems=Object.assign({},t.multiFilterItems)}if(t.customFilters){for(let i in t.customFilters){const s=t.customFilters[i];if(!this.filterByType[s.columnFilterType]){this.filterByType[s.columnFilterType]=[]}this.filterByType[s.columnFilterType].push(i);this.filterFunctionsIndexedByType[i]=s.func;this.filterNameIndexByType[i]=s.name}}if(t.filterProp){this.filterProp=t.filterProp}const s=t.include;if(s){const t={};for(let i in this.filterByType){const e=this.filterByType[i].filter((t=>s.indexOf(t)>-1));if(e.length){t[i]=e}}if(Object.keys(t).length>0){this.filterByType=t}}if(t.collection){this.filterCollection=i(t.collection,((t,i,s)=>{if(this.filterFunctionsIndexedByType[i.type]){t[s]=i}else{console.warn(`${i.type} type is not found.`)}return t}),{})}if(t.localization){if(t.localization.filterNames){Object.entries(t.localization.filterNames).forEach((([t,i])=>{if(this.filterNameIndexByType[t]!=void 0){this.filterNameIndexByType[t]=i}}))}}}async headerclick(t){var i,s,e;const n=(i=t.detail.originalEvent)===null||i===void 0?void 0:i.target;if(!y(n)){return}t.preventDefault();const o=await((s=this.pop)===null||s===void 0?void 0:s.getChanges());if(o&&(o===null||o===void 0?void 0:o.prop)===t.detail.prop){(e=this.pop)===null||e===void 0?void 0:e.show();return}if(!this.pop){return}const r=this.revogrid.getBoundingClientRect();const c=n.getBoundingClientRect();const h=t.detail.prop;this.pop.show(Object.assign(Object.assign({},this.filterCollection[h]),{x:c.x-r.x,y:c.y-r.y+c.height,autoCorrect:true,prop:h,filterTypes:this.getColumnFilter(t.detail.filter)}))}getColumnFilter(t){let i="string";if(!t){return{[i]:this.filterByType[i]}}if(this.isValidType(t)){i=t}else if(typeof t==="object"&&t.length){return t.reduce(((t,i)=>{if(this.isValidType(i)){t[i]=this.filterByType[i]}return t}),{})}return{[i]:this.filterByType[i]}}isValidType(t){return!!(typeof t==="string"&&this.filterByType[t])}async onFilterChange(t){this.multiFilterItems=t;this.runFiltering()}async doFiltering(t,i,s,e){const n=[];const o={};s.forEach((t=>{const i=Object.assign({},t);const s=e[i.prop];o[i.prop]=i;if(i[this.filterProp]&&!s){delete i[this.filterProp];n.push(i)}if(!i[this.filterProp]&&s){n.push(i);i[this.filterProp]=true}}));const r=this.getRowFilter(i,e,o);const{defaultPrevented:c,detail:h}=this.emit("beforefiltertrimmed",{collection:t,itemsToFilter:r,source:i,filterItems:e});if(c){return}const l=await this.revogrid.addTrimmed(h.itemsToFilter,ut);if(l.defaultPrevented){return}this.providers.column.updateColumns(n);this.emit("afterfilterapply")}async clearFiltering(){this.multiFilterItems={};await this.runFiltering()}async runFiltering(){const t={};const i=Object.keys(this.multiFilterItems);for(const s of i){if(this.multiFilterItems[s].length>0){const i=this.multiFilterItems[s][0];t[s]={filter:this.filterFunctionsIndexedByType[i.type],type:i.type,value:i.value}}}this.filterCollection=t;const{source:s,columns:e}=await this.getData();const{defaultPrevented:n,detail:o}=this.emit("beforefilterapply",{collection:this.filterCollection,source:s,columns:e,filterItems:this.multiFilterItems});if(n){return}this.doFiltering(o.collection,o.source,o.columns,o.filterItems)}async getData(){return{source:await this.revogrid.getSource(),columns:await this.revogrid.getColumns()}}getRowFilter(t,i,s){const e=Object.keys(i);const n={};let o=0;let r=[];t.forEach(((t,c)=>{for(const h of e){const e=i[h];o=0;r=[];for(const[i,n]of e.entries()){const c=this.filterFunctionsIndexedByType[n.type];const l=s[h];const a=l?p(t,s[h]):t[h];if(n.relation==="or"){r=[];if(c(a,n.value)){continue}o++}else{r.push(!c(a,n.value));const t=e[i+1];if(!t||t.relation!=="and"){if(r.indexOf(true)===-1){r=[];continue}o+=r.length;r=[]}}}if(o===e.length){n[c]=true}}}));return n}}const pt="column-drag-start";class mt{constructor(){this.offset=0}renderAutoscroll(t,i){if(!i){return}this.autoscrollEl=document.createElement("div");this.autoscrollEl.classList.add("drag-auto-scroll-y");i.appendChild(this.autoscrollEl)}autoscroll(t,i,s="translateX"){if(!this.autoscrollEl){return}const e=10;const n=Math.min(t+e,i-3);this.autoscrollEl.style.transform=`${s}(${n}px)`;this.autoscrollEl.scrollIntoView({block:"nearest",inline:"nearest"})}start(t,{dataEl:i,gridRect:s,scrollEl:e,gridEl:n},o="left"){n.classList.add(pt);const r=e.getBoundingClientRect();if(r){this.offset=r[o]-s[o]}this.renderAutoscroll(t,i)}stop(t){var i;t.classList.remove(pt);if(this.element){this.element.hidden=true}this.offset=0;(i=this.autoscrollEl)===null||i===void 0?void 0:i.remove();this.autoscrollEl=undefined}showHandler(t,i,s="translateX"){if(!this.element){return}if(this.offset){t=Math.max(t,this.offset)}t=Math.min(t,i);this.element.style.transform=`${s}(${t}px)`;this.element.hidden=false}render(){const t=this.element=document.createElement("div");t.classList.add("drag-position-y");t.hidden=true;return t}}const vt=j;const gt="columndragmousemove";const bt="columndragend";const yt="beforecolumndragend";const wt="columndragstart";class Ot extends I{constructor(t,i){super(t,i);this.revogrid=t;this.providers=i;this.moveFunc=w((t=>this.doMove(t)),5);this.staticDragData=null;this.dragData=null;this.localSubscriptions={};this.orderUi=new mt;t.appendChild(this.orderUi.render());t.classList.add("column-draggable");this.localSubscriptions["mouseleave"]={target:document,callback:t=>this.onMouseOut(t)};this.localSubscriptions["mouseup"]={target:document,callback:t=>this.onMouseUp(t)};this.localSubscriptions["mousemove"]={target:document,callback:t=>this.move(t)};this.addEventListener(vt,(({detail:t})=>this.dragStart(t)))}dragStart({event:t,data:i}){if(t.defaultPrevented){return}const{defaultPrevented:s}=O(this.revogrid,wt,i);if(s){return}this.clearOrder();const{mouseleave:e,mouseup:n,mousemove:o}=this.localSubscriptions;e.target.addEventListener("mouseleave",e.callback);n.target.addEventListener("mouseup",n.callback);const r=t.target.closest("revogr-header");const c=t.target.closest("revogr-viewport-scroll");if(!r||!c){return}if(m(i)||i.providers.type==="rowHeaders"){return}const h=this.getDimension(i.pin||"rgCol");const l=this.revogrid.getBoundingClientRect();const u=r.getBoundingClientRect();const f=a(h,jt(t.x,l.left,u.left-l.left));this.staticDragData={startPos:t.x,startItem:f,data:i,dataEl:r,scrollEl:c,gridEl:this.revogrid,cols:h};this.dragData=this.getData(this.staticDragData);o.target.addEventListener("mousemove",o.callback);this.orderUi.start(t,Object.assign(Object.assign({},this.dragData),this.staticDragData))}doMove(t){if(!this.staticDragData){return}const i=this.dragData=this.getData(this.staticDragData);if(!i){return}const s=this.staticDragData.startPos;if(Math.abs(s-t.x)>10){const s=jt(t.x,this.dragData.gridRect.left,this.dragData.scrollOffset);const e=a(this.staticDragData.cols,s);this.orderUi.autoscroll(s,i.elRect.width);this.orderUi.showHandler(e.end+i.scrollOffset,i.gridRect.width)}}move(t){O(this.revogrid,gt,t);this.moveFunc(t)}onMouseOut(t){this.clearOrder()}onMouseUp(t){if(this.dragData&&this.staticDragData){let i=jt(t.x,this.dragData.gridRect.left,this.dragData.scrollOffset);if(i<0){i=0}const s=a(this.staticDragData.cols,i);const e=this.providers.column.stores[this.dragData.type].store;const n=[...e.get("items")];const{defaultPrevented:o}=O(this.revogrid,yt,Object.assign(Object.assign({},this.staticDragData),{startPosition:this.staticDragData.startItem,newPosition:s,newItem:e.get("source")[n[this.staticDragData.startItem.itemIndex]]}));if(!o){const t=n.splice(this.staticDragData.startItem.itemIndex,1);n.splice(s.itemIndex,0,...t);e.set("items",n)}O(this.revogrid,bt,this.dragData)}this.clearOrder()}clearLocalSubscriptions(){n(this.localSubscriptions,(({target:t,callback:i},s)=>t.removeEventListener(s,i)))}clearOrder(){this.staticDragData=null;this.dragData=null;this.clearLocalSubscriptions();this.orderUi.stop(this.revogrid)}clearSubscriptions(){super.clearSubscriptions();this.clearLocalSubscriptions()}getData({gridEl:t,dataEl:i,data:s}){const e=t.getBoundingClientRect();const n=i.getBoundingClientRect();const o=n.left-e.left;return{elRect:n,gridRect:e,type:s.pin||"rgCol",scrollOffset:o}}getDimension(t){return this.providers.dimension.stores[t].getCurrentState()}}function jt(t,i,s){return t-i-s}export{M as A,I as B,Ot as C,z as D,Y as E,ut as F,D as S,$ as a,ft as b,k as c,dt as d,lt as e,ht as f,at as g,jt as h,q as i,P as r};
|
|
5
|
-
//# sourceMappingURL=column.drag.plugin-
|
|
4
|
+
import{V as t,W as i,v as s,h as e,X as n,b as o,n as r,Y as c,Z as h,q as l,i as a}from"./index-b6586f9b.js";import{e as u,m as f,o as d,d as p,h as m}from"./column.service-9e1f693c.js";import{f as v}from"./row-header-utils-e043f744.js";import{h as g}from"./index-a61f225b.js";import{b,i as y}from"./filter.button-d40ab17b.js";import{d as w}from"./debounce-7b511afc.js";import{d as O,O as j}from"./header-cell-renderer-2ef5f8a1.js";const S=t=>{let i={};const s=(s,e)=>{const n=Object.assign({},s);i={};for(const[t,s]of Object.entries(e)){const e=t;if(s&&n[e]){i[e]=n[e];delete n[e]}}t.setDimensionSize(n)};return{set(e,n){switch(e){case"trimmed":const e=n;const o=t.store.get("sizes");s(Object.assign(Object.assign({},o),i),e);break}}}};const E=t=>({set(i){switch(i){case"count":case"sizes":case"originItemSize":let i=0;const s=t.store.get("count");for(let e=0;e<s;e++){i+=t.store.get("sizes")[e]||t.store.get("originItemSize")}t.setStore({realSize:i});break}}});function x(){return{indexes:[],count:0,trimmed:{},sizes:{},positionIndexToItem:{},indexToItem:{},positionIndexes:[]}}function C(){return Object.assign(Object.assign({},x()),{realSize:0,originItemSize:0})}class z{constructor(i){this.type=i;this.store=t(C());this.store.use(S(this));this.store.use(E(this))}getCurrentState(){const t=C();const s=Object.keys(t);return i(s,((t,i)=>{const s=this.store.get(i);t[i]=s;return t}),t)}dispose(){s(this.store,C())}setStore(t){s(this.store,t)}drop(){s(this.store,x())}setDimensionSize(t){const i=e(this.store.get("originItemSize"),t);s(this.store,i)}}const P=["rowPinStart","rgRow","rowPinEnd"];const k=["colPinStart","rgCol","colPinEnd"];function q(t){return P.indexOf(t)>-1}class I{constructor(t,i){this.revogrid=t;this.providers=i;this.h=g;this.subscriptions={}}addEventListener(t,i){this.revogrid.addEventListener(t,i);this.subscriptions[t]=i}watch(t,i,{immediate:s}={immediate:false}){const e=Object.getOwnPropertyDescriptor(this.revogrid,t)||Object.getOwnPropertyDescriptor(this.revogrid.constructor.prototype,t);Object.defineProperty(this.revogrid,t,{set(t){var s;const n=i(t);if(n===false){return}return(s=e===null||e===void 0?void 0:e.set)===null||s===void 0?void 0:s.call(this,t)},get(){var t;return(t=e===null||e===void 0?void 0:e.get)===null||t===void 0?void 0:t.call(this)}});if(s){i(e===null||e===void 0?void 0:e.value)}}removeEventListener(t){this.revogrid.removeEventListener(t,this.subscriptions[t]);delete this.subscriptions[t]}emit(t,i){const s=new CustomEvent(t,{detail:i,cancelable:true});this.revogrid.dispatchEvent(s);return s}clearSubscriptions(){for(let t in this.subscriptions){this.removeEventListener(t)}}destroy(){this.clearSubscriptions()}}const N=7;var F;(function(t){t["headerClickAutosize"]="headerClickAutoSize";t["autoSizeOnTextOverlap"]="autoSizeOnTextOverlap";t["autoSizeAll"]="autoSizeAll"})(F||(F={}));class M extends I{constructor(t,i,s){super(t,i);this.providers=i;this.config=s;this.autoSizeColumns=null;this.dataResolve=null;this.dataReject=null;this.letterBlockSize=(s===null||s===void 0?void 0:s.letterBlockSize)||N;if(s===null||s===void 0?void 0:s.preciseSize){this.precsizeCalculationArea=this.initiatePresizeElement();t.appendChild(this.precsizeCalculationArea)}const e=({detail:{source:t}})=>{this.setSource(t)};const n=({detail:t})=>{this.afteredit(t)};const o=({detail:t})=>{this.afterEditAll(t)};const r=({detail:{columns:t}})=>{this.columnSet(t)};const c=({detail:t})=>{const i=u(t.column);const s=this.getColumnSize(t.index,i);if(s){this.providers.dimension.setCustomSizes(i,{[t.index]:s},true)}};this.addEventListener("beforecolumnsset",r);switch(s===null||s===void 0?void 0:s.mode){case F.autoSizeOnTextOverlap:this.addEventListener("aftersourceset",e);this.addEventListener("afteredit",n);break;case F.autoSizeAll:this.addEventListener("aftersourceset",e);this.addEventListener("afteredit",o);break;default:this.addEventListener("headerdblclick",c);break}}async setSource(t){let i=this.autoSizeColumns;if(this.dataReject){this.dataReject();this.clearPromise()}if(!i){const t=new Promise(((t,i)=>{this.dataResolve=t;this.dataReject=i}));try{i=await t}catch(t){return}}n(i,((s,e)=>{const o={};n(i[e],(i=>{i.size=o[i.index]=t.reduce(((t,s)=>Math.max(t,this.getLength(s[i.prop]))),this.getLength(i.name||""))}));this.providers.dimension.setCustomSizes(e,o,true)}))}getLength(t){var i;const s=15;if(!t){return 0}try{const e=t.toString();if((i=this.config)===null||i===void 0?void 0:i.preciseSize){this.precsizeCalculationArea.innerText=e;return this.precsizeCalculationArea.scrollWidth+s*2}return e.length*this.letterBlockSize+s*2}catch(t){return 0}}afteredit(t){let s;if(this.isRangeEdit(t)){s=t.data}else{s={0:{[t.prop]:t.val}}}n(this.autoSizeColumns,((t,e)=>{const o={};n(t,(t=>{var e;const n=i(s,((i,s)=>{if(typeof s[t.prop]==="undefined"){return i}return Math.max(i||0,this.getLength(s[t.prop]))}),undefined);if(n&&((e=t.size)!==null&&e!==void 0?e:0)<n){t.size=o[t.index]=n}}));this.providers.dimension.setCustomSizes(e,o,true)}))}afterEditAll(t){const i={};if(this.isRangeEdit(t)){n(t.data,(t=>n(t,((t,s)=>i[s]=true))))}else{i[t.prop]=true}n(this.autoSizeColumns,((t,s)=>{const e={};n(t,(t=>{if(i[t.prop]){const i=this.getColumnSize(t.index,s);if(i){e[t.index]=i}}}));this.providers.dimension.setCustomSizes(s,e,true)}))}getColumnSize(t,s){var e,n;const r=(n=(e=this.autoSizeColumns)===null||e===void 0?void 0:e[s])===null||n===void 0?void 0:n[t];if(!r){return 0}return i(this.providers.data.stores,((t,s)=>{const e=i(s.store.get("items"),((t,i,e)=>{const n=o(s.store,e);return Math.max(t||0,this.getLength(n===null||n===void 0?void 0:n[r.prop]))}),0);return Math.max(t,e)}),r.size||0)}columnSet(t){var i;for(let s of k){const e=s;const n=t[e];for(let t in n){if(n[t].autoSize||((i=this.config)===null||i===void 0?void 0:i.allColumns)){if(!this.autoSizeColumns){this.autoSizeColumns={}}if(!this.autoSizeColumns[e]){this.autoSizeColumns[e]={}}this.autoSizeColumns[e][t]=Object.assign(Object.assign({},n[t]),{index:parseInt(t,10)})}}}if(this.dataResolve){this.dataResolve(this.autoSizeColumns||{});this.clearPromise()}}clearPromise(){this.dataResolve=null;this.dataReject=null}isRangeEdit(t){return!!t.data}initiatePresizeElement(){var t;const i={position:"absolute",fontSize:"14px",height:"0",width:"0",whiteSpace:"nowrap",top:"0",overflowX:"scroll"};const s=document.createElement("div");for(let e in i){s.style[e]=(t=i[e])!==null&&t!==void 0?t:""}s.classList.add("revo-test-container");return s}destroy(){var t;super.destroy();(t=this.precsizeCalculationArea)===null||t===void 0?void 0:t.remove()}}class D extends I{constructor(t,i){super(t,i);this.providers=i;this.stretchedColumn=null;this.scrollSize=r(document);const s=({detail:{columns:t}})=>this.applyStretch(t);this.addEventListener("beforecolumnapplied",s)}setScroll({type:t,hasScroll:i}){var s;if(t==="rgRow"&&this.stretchedColumn&&((s=this.stretchedColumn)===null||s===void 0?void 0:s.initialSize)===this.stretchedColumn.size){if(i){this.stretchedColumn.size-=this.scrollSize;this.apply();this.dropChanges()}}}activateChanges(){const t=({detail:t})=>this.setScroll(t);this.addEventListener("scrollchange",t)}dropChanges(){this.stretchedColumn=null;this.removeEventListener("scrollchange")}apply(){if(!this.stretchedColumn){return}const t="rgCol";const i=this.providers.dimension.stores[t].store.get("sizes");this.providers.dimension.setCustomSizes(t,Object.assign(Object.assign({},i),{[this.stretchedColumn.index]:this.stretchedColumn.size}),true)}applyStretch(t){this.dropChanges();let i=this.revogrid.clientWidth-1;n(t,((t,s)=>{const e=this.providers.dimension.stores[s].store.get("realSize");i-=e}));if(this.revogrid.rowHeaders){const t=this.providers.data.stores.rgRow.store.get("source").length;const s=this.revogrid.rowHeaders;const e=v(t,typeof s==="object"?s:undefined);if(e){i-=e}}if(i>0){const s=t.rgCol.length-1;const e=t.rgCol[s];const n=(e===null||e===void 0?void 0:e.size)||this.revogrid.colSize||0;const o=i+n-1;if(e&&!e.autoSize&&n<o){this.stretchedColumn={initialSize:o,index:s,size:o};this.apply();this.activateChanges()}}}}function $(t){return!!t.applyStretch}function R(t,i,s){if(t===t){if(s!==undefined){t=t<=s?t:s}if(i!==undefined){t=t>=i?t:i}}return t}var A=4294967295;function B(t){return t?R(c(t),0,A):0}function T(t,i,s,e){var n=t.length;s=c(s);if(s<0){s=-s>n?0:n+s}e=e===undefined||e>n?n:c(e);if(e<0){e+=n}e=s>e?0:B(e);while(s<e){t[s++]=i}return t}function J(t,i,s,e){var n=t==null?0:t.length;if(!n){return[]}if(s&&typeof s!="number"&&h(t,i,s)){s=0;e=n}return T(t,i,s,e)}const H={mime:"text/csv",fileKind:"csv",bom:true,columnDelimiter:",",rowDelimiter:"\r\n",encoding:""};const L=String.fromCharCode(13);const X=String.fromCharCode(10);const G=String.fromCharCode(34);const K=String.fromCharCode(65279);const U=new RegExp('"',"g");class V{constructor(t={}){this.options=Object.assign(Object.assign({},H),t)}doExport({data:t,headers:i,props:s}){let e=this.options.bom?K:"";if((i===null||i===void 0?void 0:i.length)>0){i.forEach((t=>{if(!t.length){return}e+=this.prepareHeader(t,this.options.columnDelimiter);e+=this.options.rowDelimiter}))}t.forEach(((t,i)=>{if(i>0){e+=this.options.rowDelimiter}if(f(t)){e+=this.parseCell(d(t),this.options.columnDelimiter);return}e+=s.map((i=>this.parseCell(t[i],this.options.columnDelimiter))).join(this.options.columnDelimiter)}));return e}prepareHeader(t,i){let s="";const e=t.map((t=>this.parseCell(t,i,true)));s+=e.join(i);return s}parseCell(t,i,s=false){let e=t;if(typeof t!=="string"){e=JSON.stringify(t)}const n=[L,G,X,i];if(typeof e==="undefined"){return""}if(e!==""&&(s||n.some((t=>e.indexOf(t)>=0)))){return`"${e.replace(U,'""')}"`}return e}}var W;(function(t){t["csv"]="csv"})(W||(W={}));class Y extends I{async exportString(t={},i=W.csv){const s=await this.beforeexport();if(!s){return null}return this.formatter(i,t).doExport(s)}async exportBlob(t={},i=W.csv){return await this.getBlob(this.formatter(i,t))}async exportFile(t={},i=W.csv){const s=this.formatter(i,t);const e=window.URL||window.webkitURL;const n=document.createElement("a");const{filename:o,fileKind:r}=s.options;const c=`${o}.${r}`;const h=await this.getBlob(s);const a=h?e.createObjectURL(h):"";n.style.display="none";n.setAttribute("href",a);n.setAttribute("download",c);this.revogrid.appendChild(n);n.dispatchEvent(new MouseEvent("click"));this.revogrid.removeChild(n);await l(120);e.revokeObjectURL(a)}async getBlob(t){const i=`${t.options.mime};charset=${t.options.encoding}`;if(typeof Blob!=="undefined"){const s=await this.beforeexport();if(!s){return null}return new Blob([t.doExport(s)],{type:i})}return null}async beforeexport(){let t=await this.getData();const i=this.emit("beforeexport",{data:t});if(i.defaultPrevented){return null}return i.detail.data}async getData(){const t=await this.getSource();const i=[];const s=[];k.forEach(((t,e)=>{s.push(this.getColPerSource(t).then((t=>i[e]=t)))}));await Promise.all(s);const e={headers:[],props:[]};for(let t of i){t.headers.forEach(((t,i)=>{if(!e.headers[i]){e.headers[i]=[]}e.headers[i].push(...t)}));e.props.push(...t.props)}return Object.assign({data:t},e)}async getColPerSource(t){const i=await this.revogrid.getColumnStore(t);const s=i.get("source");const e=i.get("items");const n=i.get("groupingDepth");const o=i.get("groups");const r=[];const c=[];const h=e.reduce(((t,i,e)=>{const n=s[i].prop;r.push(s[i].name||"");c.push(n);t[n]=e;return t}),{});const l=this.getGroupHeaders(n,o,e,h);l.push(r);return{headers:l,props:c}}getGroupHeaders(t,i,s,e){const n=[];const o=J(new Array(s.length),"");for(let s=0;s<t;s++){const t=[...o];n.push(t);if(!i[s]){continue}const r=i[s];r.forEach((i=>{const s=this.findGroupStartIndex(i.ids,e);if(typeof s==="number"){t[s]=i.name}}))}return n}findGroupStartIndex(t,i){let s;t.forEach((t=>{const e=i[t];if(typeof e==="number"){if(typeof s!=="number"||s>e){s=e}}}));return s}async getSource(){const t=[];const i=[];P.forEach((s=>{const e=[];t.push(e);const n=this.revogrid.getVisibleSource(s).then((t=>e.push(...t)));i.push(n)}));await Promise.all(i);return t.reduce(((t,i)=>{t.push(...i);return t}),[])}formatter(t,i={}){switch(t){case W.csv:return new V(i);default:throw new Error("Unknown format")}}}const Z=(t,i)=>{if(typeof t==="undefined"||t===null&&!i){return true}if(typeof t!=="string"){t=JSON.stringify(t)}const s=i===null||i===void 0?void 0:i.toString().toLocaleLowerCase();if((s===null||s===void 0?void 0:s.length)===0){return true}return t.toLocaleLowerCase()===s};const Q=(t,i)=>!Z(t,i);Q.extra="input";Z.extra="input";const _=function(t,i){let s;if(typeof t==="number"&&typeof i!=="undefined"&&i!==null){s=parseFloat(i===null||i===void 0?void 0:i.toString());return t>s}return false};_.extra="input";const tt=function(t,i){return Z(t,i)||_(t,i)};tt.extra="input";const it=function(t,i){let s;if(typeof t==="number"&&typeof i!=="undefined"&&i!==null){s=parseFloat(i.toString());return t<s}else{return false}};it.extra="input";const st=function(t,i){return Z(t,i)||it(t,i)};st.extra="input";const et=t=>!(t===""||t===null||t===void 0);const nt=t=>!et(t);const ot=(t,i)=>{if(!t){return false}if(!i){return true}if(typeof t!=="string"){t=JSON.stringify(t)}if(typeof i!=="string"){i=JSON.stringify(i)}return t.toLocaleLowerCase().indexOf(i.toLocaleLowerCase())===0};ot.extra="input";const rt=(t,i)=>{if(!i){return true}if(!t){return false}if(i){if(typeof t!=="string"){t=JSON.stringify(t)}return t.toLocaleLowerCase().indexOf(i.toString().toLowerCase())>-1}return true};const ct=(t,i)=>!rt(t,i);ct.extra="input";rt.extra="input";const ht={none:()=>true,empty:nt,notEmpty:et,eq:Z,notEq:Q,begins:ot,contains:rt,notContains:ct,eqN:Z,neqN:Q,gt:_,gte:tt,lt:it,lte:st};const lt={string:["notEmpty","empty","eq","notEq","begins","contains","notContains"],number:["notEmpty","empty","eqN","neqN","gt","gte","lt","lte"]};const at={none:"None",empty:"Not set",notEmpty:"Set",eq:"Equal",notEq:"Not equal",begins:"Begins with",contains:"Contains",notContains:"Does not contain",eqN:"=",neqN:"!=",gt:">",gte:">=",lt:"<",lte:"<="};const ut="filter";const ft="filterconfigchanged";class dt extends I{constructor(t,i,s){var e;super(t,i);this.revogrid=t;this.filterCollection={};this.multiFilterItems={};this.filterByType=Object.assign({},lt);this.filterNameIndexByType=Object.assign({},at);this.filterFunctionsIndexedByType=Object.assign({},ht);this.filterProp=b;if(s){this.initConfig(s)}const n=async()=>{const t=Object.keys(this.filterCollection);if(t.length>0){t.forEach(((t,i)=>{if(!this.multiFilterItems[t]){this.multiFilterItems[t]=[{id:i,type:this.filterCollection[t].type,value:this.filterCollection[t].value,relation:"and"}]}}))}await this.runFiltering(this.multiFilterItems)};this.addEventListener("headerclick",(t=>this.headerclick(t)));this.addEventListener(ft,(({detail:t})=>{if(!t){this.clearFiltering();return}if(typeof t==="object"){this.initConfig(t)}n()}));this.addEventListener("aftersourceset",n);this.addEventListener("filter",(({detail:t})=>this.onFilterChange(t)));const o=this.revogrid.registerVNode.filter((t=>t.t!=="revogr-filter-panel"));this.revogrid.registerVNode=[...o,g("revogr-filter-panel",{filterItems:this.multiFilterItems,filterNames:this.filterNameIndexByType,filterEntities:this.filterFunctionsIndexedByType,filterCaptions:(e=s===null||s===void 0?void 0:s.localization)===null||e===void 0?void 0:e.captions,onFilterChange:t=>this.onFilterChange(t.detail),disableDynamicFiltering:s===null||s===void 0?void 0:s.disableDynamicFiltering,ref:t=>this.pop=t}," ",this.extraContent())]}extraContent(){return null}initConfig(t){if(t.multiFilterItems){this.multiFilterItems=Object.assign({},t.multiFilterItems)}if(t.customFilters){for(let i in t.customFilters){const s=t.customFilters[i];if(!this.filterByType[s.columnFilterType]){this.filterByType[s.columnFilterType]=[]}this.filterByType[s.columnFilterType].push(i);this.filterFunctionsIndexedByType[i]=s.func;this.filterNameIndexByType[i]=s.name}}if(t.filterProp){this.filterProp=t.filterProp}const s=t.include;if(s){const t={};for(let i in this.filterByType){const e=this.filterByType[i].filter((t=>s.indexOf(t)>-1));if(e.length){t[i]=e}}if(Object.keys(t).length>0){this.filterByType=t}}if(t.collection){this.filterCollection=i(t.collection,((t,i,s)=>{if(this.filterFunctionsIndexedByType[i.type]){t[s]=i}else{console.warn(`${i.type} type is not found.`)}return t}),{})}if(t.localization){if(t.localization.filterNames){Object.entries(t.localization.filterNames).forEach((([t,i])=>{if(this.filterNameIndexByType[t]!=void 0){this.filterNameIndexByType[t]=i}}))}}}async headerclick(t){var i,s,e;const n=(i=t.detail.originalEvent)===null||i===void 0?void 0:i.target;if(!y(n)){return}t.preventDefault();const o=await((s=this.pop)===null||s===void 0?void 0:s.getChanges());if(o&&(o===null||o===void 0?void 0:o.prop)===t.detail.prop){(e=this.pop)===null||e===void 0?void 0:e.show();return}if(!this.pop){return}const r=this.revogrid.getBoundingClientRect();const c=n.getBoundingClientRect();const h=t.detail.prop;this.pop.show(Object.assign(Object.assign({},this.filterCollection[h]),{x:c.x-r.x,y:c.y-r.y+c.height,autoCorrect:true,prop:h,filterTypes:this.getColumnFilter(t.detail.filter)}))}getColumnFilter(t){let i="string";if(!t){return{[i]:this.filterByType[i]}}if(this.isValidType(t)){i=t}else if(typeof t==="object"&&t.length){return t.reduce(((t,i)=>{if(this.isValidType(i)){t[i]=this.filterByType[i]}return t}),{})}return{[i]:this.filterByType[i]}}isValidType(t){return!!(typeof t==="string"&&this.filterByType[t])}async onFilterChange(t){this.multiFilterItems=t;this.runFiltering(this.multiFilterItems)}async doFiltering(t,i,s,e){const n=[];const o={};s.forEach((t=>{const i=Object.assign({},t);const s=e[i.prop];o[i.prop]=i;if(i[this.filterProp]&&!s){delete i[this.filterProp];n.push(i)}if(!i[this.filterProp]&&s){n.push(i);i[this.filterProp]=true}}));const r=this.getRowFilter(i,e,o);const{defaultPrevented:c,detail:h}=this.emit("beforefiltertrimmed",{collection:t,itemsToFilter:r,source:i,filterItems:e});if(c){return}const l=await this.revogrid.addTrimmed(h.itemsToFilter,ut);if(l.defaultPrevented){return}this.providers.column.updateColumns(n);this.emit("afterfilterapply")}async clearFiltering(){this.multiFilterItems={};await this.runFiltering(this.multiFilterItems)}async runFiltering(t){const i={};const s=Object.keys(t);for(const e of s){if(t[e].length>0){const s=t[e][0];i[e]={filter:this.filterFunctionsIndexedByType[s.type],type:s.type,value:s.value}}}this.filterCollection=i;const{source:e,columns:n}=await this.getData();const{defaultPrevented:o,detail:r}=this.emit("beforefilterapply",{collection:this.filterCollection,source:e,columns:n,filterItems:this.multiFilterItems});if(o){return}this.doFiltering(r.collection,r.source,r.columns,r.filterItems)}async getData(){return{source:await this.revogrid.getSource(),columns:await this.revogrid.getColumns()}}getRowFilter(t,i,s){const e=Object.keys(i);const n={};let o=0;let r=[];t.forEach(((t,c)=>{for(const h of e){const e=i[h];o=0;r=[];for(const[i,n]of e.entries()){const c=this.filterFunctionsIndexedByType[n.type];const l=s[h];const a=l?p(t,s[h]):t[h];if(n.relation==="or"){r=[];if(c(a,n.value)){continue}o++}else{r.push(!c(a,n.value));const t=e[i+1];if(!t||t.relation!=="and"){if(r.indexOf(true)===-1){r=[];continue}o+=r.length;r=[]}}}if(o===e.length){n[c]=true}}}));return n}}const pt="column-drag-start";class mt{constructor(){this.offset=0}renderAutoscroll(t,i){if(!i){return}this.autoscrollEl=document.createElement("div");this.autoscrollEl.classList.add("drag-auto-scroll-y");i.appendChild(this.autoscrollEl)}autoscroll(t,i,s="translateX"){if(!this.autoscrollEl){return}const e=10;const n=Math.min(t+e,i-3);this.autoscrollEl.style.transform=`${s}(${n}px)`;this.autoscrollEl.scrollIntoView({block:"nearest",inline:"nearest"})}start(t,{dataEl:i,gridRect:s,scrollEl:e,gridEl:n},o="left"){n.classList.add(pt);const r=e.getBoundingClientRect();if(r){this.offset=r[o]-s[o]}this.renderAutoscroll(t,i)}stop(t){var i;t.classList.remove(pt);if(this.element){this.element.hidden=true}this.offset=0;(i=this.autoscrollEl)===null||i===void 0?void 0:i.remove();this.autoscrollEl=undefined}showHandler(t,i,s="translateX"){if(!this.element){return}if(this.offset){t=Math.max(t,this.offset)}t=Math.min(t,i);this.element.style.transform=`${s}(${t}px)`;this.element.hidden=false}render(){const t=this.element=document.createElement("div");t.classList.add("drag-position-y");t.hidden=true;return t}}const vt=j;const gt="columndragmousemove";const bt="columndragend";const yt="beforecolumndragend";const wt="columndragstart";class Ot extends I{constructor(t,i){super(t,i);this.revogrid=t;this.providers=i;this.moveFunc=w((t=>this.doMove(t)),5);this.staticDragData=null;this.dragData=null;this.localSubscriptions={};this.orderUi=new mt;t.appendChild(this.orderUi.render());t.classList.add("column-draggable");this.localSubscriptions["mouseleave"]={target:document,callback:t=>this.onMouseOut(t)};this.localSubscriptions["mouseup"]={target:document,callback:t=>this.onMouseUp(t)};this.localSubscriptions["mousemove"]={target:document,callback:t=>this.move(t)};this.addEventListener(vt,(({detail:t})=>this.dragStart(t)))}dragStart({event:t,data:i}){if(t.defaultPrevented){return}const{defaultPrevented:s}=O(this.revogrid,wt,i);if(s){return}this.clearOrder();const{mouseleave:e,mouseup:n,mousemove:o}=this.localSubscriptions;e.target.addEventListener("mouseleave",e.callback);n.target.addEventListener("mouseup",n.callback);const r=t.target.closest("revogr-header");const c=t.target.closest("revogr-viewport-scroll");if(!r||!c){return}if(m(i)||i.providers.type==="rowHeaders"){return}const h=this.getDimension(i.pin||"rgCol");const l=this.revogrid.getBoundingClientRect();const u=r.getBoundingClientRect();const f=a(h,jt(t.x,l.left,u.left-l.left));this.staticDragData={startPos:t.x,startItem:f,data:i,dataEl:r,scrollEl:c,gridEl:this.revogrid,cols:h};this.dragData=this.getData(this.staticDragData);o.target.addEventListener("mousemove",o.callback);this.orderUi.start(t,Object.assign(Object.assign({},this.dragData),this.staticDragData))}doMove(t){if(!this.staticDragData){return}const i=this.dragData=this.getData(this.staticDragData);if(!i){return}const s=this.staticDragData.startPos;if(Math.abs(s-t.x)>10){const s=jt(t.x,this.dragData.gridRect.left,this.dragData.scrollOffset);const e=a(this.staticDragData.cols,s);this.orderUi.autoscroll(s,i.elRect.width);this.orderUi.showHandler(e.end+i.scrollOffset,i.gridRect.width)}}move(t){O(this.revogrid,gt,t);this.moveFunc(t)}onMouseOut(t){this.clearOrder()}onMouseUp(t){if(this.dragData&&this.staticDragData){let i=jt(t.x,this.dragData.gridRect.left,this.dragData.scrollOffset);if(i<0){i=0}const s=a(this.staticDragData.cols,i);const e=this.providers.column.stores[this.dragData.type].store;const n=[...e.get("items")];const{defaultPrevented:o}=O(this.revogrid,yt,Object.assign(Object.assign({},this.staticDragData),{startPosition:this.staticDragData.startItem,newPosition:s,newItem:e.get("source")[n[this.staticDragData.startItem.itemIndex]]}));if(!o){const t=n.splice(this.staticDragData.startItem.itemIndex,1);n.splice(s.itemIndex,0,...t);e.set("items",n)}O(this.revogrid,bt,this.dragData)}this.clearOrder()}clearLocalSubscriptions(){n(this.localSubscriptions,(({target:t,callback:i},s)=>t.removeEventListener(s,i)))}clearOrder(){this.staticDragData=null;this.dragData=null;this.clearLocalSubscriptions();this.orderUi.stop(this.revogrid)}clearSubscriptions(){super.clearSubscriptions();this.clearLocalSubscriptions()}getData({gridEl:t,dataEl:i,data:s}){const e=t.getBoundingClientRect();const n=i.getBoundingClientRect();const o=n.left-e.left;return{elRect:n,gridRect:e,type:s.pin||"rgCol",scrollOffset:o}}getDimension(t){return this.providers.dimension.stores[t].getCurrentState()}}function jt(t,i,s){return t-i-s}export{M as A,I as B,Ot as C,z as D,Y as E,ut as F,D as S,$ as a,ft as b,k as c,dt as d,lt as e,ht as f,at as g,jt as h,q as i,P as r};
|
|
5
|
+
//# sourceMappingURL=column.drag.plugin-41640959.js.map
|