@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/cjs/{header-cell-renderer-2d56e8f5.js.map → header-cell-renderer-e4258dfd.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"header-cell-renderer-2d56e8f5.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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e,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,CAACA,OAAC,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,GAAGC,0BAAW,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,QACED,QAAC,gBAAgB,oBAAK,WAAW;QAC/BA,iBAAK,KAAK,EAAC,gBAAgB,IAAE,WAAW,CAAO;QAC9C,QAAQ,CACQ,EACnB;AACJ;;;;;;;","names":["h","doPropMerge"],"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-e4258dfd.js","mappings":";;;;;;;;AAAA;;;;;;;;SAQgB,QAAQ,CACtB,MAA4B,EAC5B,SAAiB,EACjB,MAAuB;;IAGvB,MAAM,KAAK,GAAG,IAAI,WAA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EA,iCAAS,KAAK,IAAE,GAAG,EAAE,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,CAACA,OAAC,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,GAAGC,0BAAW,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,QACED,QAAC,gBAAgB,oBAAK,WAAW;QAC/BA,iBAAK,KAAK,EAAC,gBAAgB,IAAE,WAAW,CAAO;QAC9C,QAAQ,CACQ,EACnB;AACJ;;;;;;;","names":["h","doPropMerge"],"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/cjs/index.cjs.js
CHANGED
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
|
|
6
6
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
7
7
|
|
|
8
|
-
const column_drag_plugin = require('./column.drag.plugin-
|
|
9
|
-
const headerCellRenderer = require('./header-cell-renderer-
|
|
8
|
+
const column_drag_plugin = require('./column.drag.plugin-f3019314.js');
|
|
9
|
+
const headerCellRenderer = require('./header-cell-renderer-e4258dfd.js');
|
|
10
10
|
const index = require('./index-10d10c55.js');
|
|
11
11
|
const index$1 = require('./index-a9ee8eef.js');
|
|
12
|
-
const column_service = require('./column.service-
|
|
12
|
+
const column_service = require('./column.service-9d63ff18.js');
|
|
13
13
|
const sorting_sign = require('./sorting.sign-ca5a1045.js');
|
|
14
14
|
const textEditor = require('./text-editor-ea3badef.js');
|
|
15
15
|
const rowHeaderUtils = require('./row-header-utils-eb5949b3.js');
|
|
@@ -7,14 +7,14 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
7
7
|
|
|
8
8
|
const index$1 = require('./index-10d10c55.js');
|
|
9
9
|
const index = require('./index-a9ee8eef.js');
|
|
10
|
-
const column_drag_plugin = require('./column.drag.plugin-
|
|
11
|
-
const column_service = require('./column.service-
|
|
10
|
+
const column_drag_plugin = require('./column.drag.plugin-f3019314.js');
|
|
11
|
+
const column_service = require('./column.service-9d63ff18.js');
|
|
12
12
|
const debounce = require('./debounce-ec7a04b4.js');
|
|
13
13
|
const rowHeaderUtils = require('./row-header-utils-eb5949b3.js');
|
|
14
14
|
const viewport_helpers = require('./viewport.helpers-e59a544e.js');
|
|
15
15
|
const events = require('./events-af8f6914.js');
|
|
16
16
|
require('./filter.button-b8debe72.js');
|
|
17
|
-
require('./header-cell-renderer-
|
|
17
|
+
require('./header-cell-renderer-e4258dfd.js');
|
|
18
18
|
|
|
19
19
|
class ThemeCompact {
|
|
20
20
|
constructor() {
|
|
@@ -8,7 +8,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
8
8
|
const index = require('./index-10d10c55.js');
|
|
9
9
|
const index$1 = require('./index-a9ee8eef.js');
|
|
10
10
|
const events = require('./events-af8f6914.js');
|
|
11
|
-
const column_service = require('./column.service-
|
|
11
|
+
const column_service = require('./column.service-9d63ff18.js');
|
|
12
12
|
const edit_utils = require('./edit.utils-093fe9cd.js');
|
|
13
13
|
const key_utils = require('./key.utils-1438f2ac.js');
|
|
14
14
|
const debounce = require('./debounce-ec7a04b4.js');
|
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
7
7
|
|
|
8
8
|
const index = require('./index-10d10c55.js');
|
|
9
|
-
const column_service = require('./column.service-
|
|
9
|
+
const column_service = require('./column.service-9d63ff18.js');
|
|
10
10
|
const index$1 = require('./index-a9ee8eef.js');
|
|
11
11
|
const filter_button = require('./filter.button-b8debe72.js');
|
|
12
12
|
const sorting_sign = require('./sorting.sign-ca5a1045.js');
|
|
13
|
-
const headerCellRenderer = require('./header-cell-renderer-
|
|
13
|
+
const headerCellRenderer = require('./header-cell-renderer-e4258dfd.js');
|
|
14
14
|
const throttle = require('./throttle-6fecba1e.js');
|
|
15
15
|
const viewport_helpers = require('./viewport.helpers-e59a544e.js');
|
|
16
16
|
require('./debounce-ec7a04b4.js');
|
|
@@ -57,7 +57,7 @@ export class FilterPlugin extends BasePlugin {
|
|
|
57
57
|
}
|
|
58
58
|
});
|
|
59
59
|
}
|
|
60
|
-
await this.runFiltering();
|
|
60
|
+
await this.runFiltering(this.multiFilterItems);
|
|
61
61
|
};
|
|
62
62
|
this.addEventListener('headerclick', (e) => this.headerclick(e));
|
|
63
63
|
this.addEventListener(FILTER_CONFIG_CHANGED_EVENT, ({ detail }) => {
|
|
@@ -193,7 +193,7 @@ export class FilterPlugin extends BasePlugin {
|
|
|
193
193
|
// store the filter items
|
|
194
194
|
this.multiFilterItems = filterItems;
|
|
195
195
|
// run the filtering when the items change
|
|
196
|
-
this.runFiltering();
|
|
196
|
+
this.runFiltering(this.multiFilterItems);
|
|
197
197
|
}
|
|
198
198
|
/**
|
|
199
199
|
* Triggers grid filtering
|
|
@@ -245,16 +245,16 @@ export class FilterPlugin extends BasePlugin {
|
|
|
245
245
|
}
|
|
246
246
|
async clearFiltering() {
|
|
247
247
|
this.multiFilterItems = {};
|
|
248
|
-
await this.runFiltering();
|
|
248
|
+
await this.runFiltering(this.multiFilterItems);
|
|
249
249
|
}
|
|
250
|
-
async runFiltering() {
|
|
250
|
+
async runFiltering(multiFilterItems) {
|
|
251
251
|
const collection = {};
|
|
252
252
|
// handle old filterCollection to return the first filter only (if any) from multiFilterItems
|
|
253
|
-
const filterProps = Object.keys(
|
|
253
|
+
const filterProps = Object.keys(multiFilterItems);
|
|
254
254
|
for (const prop of filterProps) {
|
|
255
255
|
// check if we have any filter for a column
|
|
256
|
-
if (
|
|
257
|
-
const firstFilterItem =
|
|
256
|
+
if (multiFilterItems[prop].length > 0) {
|
|
257
|
+
const firstFilterItem = multiFilterItems[prop][0];
|
|
258
258
|
collection[prop] = {
|
|
259
259
|
filter: this.filterFunctionsIndexedByType[firstFilterItem.type],
|
|
260
260
|
type: firstFilterItem.type,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filter.plugin.js","sourceRoot":"","sources":["../../../src/plugins/filter/filter.plugin.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAClC,OAAO,MAAM,MAAM,eAAe,CAAC;AAGnC,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EACL,gCAAgC,EAChC,WAAW,EACX,WAAW,GACZ,MAAM,kBAAkB,CAAC;AAS1B,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEhD,cAAc,gBAAgB,CAAC;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;4BACX,CAAC;4BAED,2EAA2E;4BAC3E,wBAAwB,IAAI,iBAAiB,CAAC,MAAM,CAAC;4BACrD,yCAAyC;4BACzC,iBAAiB,GAAG,EAAE,CAAC;wBACzB,CAAC;oBACH,CAAC;gBACH,CAAC,CAAC,6BAA6B;gBAE/B,2EAA2E;gBAC3E,IAAI,wBAAwB,KAAK,WAAW,CAAC,MAAM,EAAE,CAAC;oBACpD,OAAO,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC;gBAC3B,CAAC;YACH,CAAC,CAAC,yBAAyB;QAC7B,CAAC,CAAC,CAAC;QACH,OAAO,OAAO,CAAC;IACjB,CAAC;CACF","sourcesContent":["import { h } from '@stencil/core';\nimport reduce from 'lodash/reduce';\n\nimport type { ColumnRegular, DataType, PluginProviders } from '@type';\nimport { BasePlugin } from '../base.plugin';\nimport { FILTER_PROP, isFilterBtn } from './filter.button';\nimport {\n filterCoreFunctionsIndexedByType,\n filterNames,\n filterTypes,\n} from './filter.indexed';\n\nimport type {\n ColumnFilterConfig,\n FilterCollection,\n LogicFunction,\n MultiFilterItem,\n} from './filter.types';\n\nimport { getCellDataParsed } from '../../utils';\n\nexport * from './filter.types';\nexport * from './filter.indexed';\nexport * from './filter.button';\n\nexport const FILTER_TRIMMED_TYPE = 'filter';\nexport const FILTER_CONFIG_CHANGED_EVENT = 'filterconfigchanged';\n\n/**\n * @typedef ColumnFilterConfig\n * @type {object}\n * @property {FilterCollection|undefined} collection - preserved filter data\n * @property {string[]|undefined} include - filters to be included, if defined everything else out of scope will be ignored\n * @property {Record<string, CustomFilter>|undefined} customFilters - hash map of {FilterType:CustomFilter}.\n * @property {FilterLocalization|undefined} localization - translation for filter popup captions.\n * @property {MultiFilterItem|undefined} multiFilterItems - data for multi filtering.\n * @property {boolean|undefined} disableDynamicFiltering - disables dynamic filtering.\n * A way to define your own filter types per column\n */\n/**\n * @internal\n */\n\nexport class FilterPlugin extends BasePlugin {\n pop?: HTMLRevogrFilterPanelElement;\n filterCollection: FilterCollection = {};\n multiFilterItems: MultiFilterItem = {};\n\n filterByType: Record<string, string[]> =\n { ...filterTypes };\n filterNameIndexByType: Record<string, string> = {\n ...filterNames,\n };\n filterFunctionsIndexedByType: Record<string, LogicFunction> = {\n ...filterCoreFunctionsIndexedByType,\n };\n\n filterProp = FILTER_PROP;\n\n constructor(\n public revogrid: HTMLRevoGridElement,\n providers: PluginProviders,\n config?: ColumnFilterConfig,\n ) {\n super(revogrid, providers);\n if (config) {\n this.initConfig(config);\n }\n\n const aftersourceset = async () => {\n const filterCollectionProps = Object.keys(this.filterCollection);\n if (filterCollectionProps.length > 0) {\n // handle old way of filtering by reworking FilterCollection to new MultiFilterItem\n filterCollectionProps.forEach((prop, index) => {\n if (!this.multiFilterItems[prop]) {\n this.multiFilterItems[prop] = [\n {\n id: index,\n type: this.filterCollection[prop].type,\n value: this.filterCollection[prop].value,\n relation: 'and',\n },\n ];\n }\n });\n }\n await this.runFiltering();\n };\n this.addEventListener(\n 'headerclick',\n (e: CustomEvent<HTMLRevoGridElementEventMap['headerclick']>) =>\n this.headerclick(e),\n );\n this.addEventListener(\n FILTER_CONFIG_CHANGED_EVENT,\n ({ detail }: CustomEvent<ColumnFilterConfig | boolean>) => {\n if (!detail) {\n this.clearFiltering();\n return;\n }\n if (typeof detail === 'object') {\n this.initConfig(detail);\n }\n aftersourceset();\n },\n );\n this.addEventListener('aftersourceset', aftersourceset);\n this.addEventListener('filter', ({ detail }: CustomEvent) =>\n this.onFilterChange(detail),\n );\n\n const existingNodes = this.revogrid.registerVNode.filter(\n n => n.$tag$ !== 'revogr-filter-panel',\n );\n this.revogrid.registerVNode = [\n ...existingNodes,\n <revogr-filter-panel\n filterItems={this.multiFilterItems}\n filterNames={this.filterNameIndexByType}\n filterEntities={this.filterFunctionsIndexedByType}\n filterCaptions={config?.localization?.captions}\n onFilterChange={e => this.onFilterChange(e.detail)}\n disableDynamicFiltering={config?.disableDynamicFiltering}\n ref={e => (this.pop = e)}\n > { this.extraContent() }</revogr-filter-panel>,\n ];\n }\n\n extraContent() {\n return null;\n }\n\n initConfig(config: ColumnFilterConfig) {\n if (config.multiFilterItems) {\n this.multiFilterItems = { ...config.multiFilterItems };\n }\n // Add custom filters\n if (config.customFilters) {\n for (let customFilterType in config.customFilters) {\n const cFilter = config.customFilters[customFilterType];\n if (!this.filterByType[cFilter.columnFilterType]) {\n this.filterByType[cFilter.columnFilterType] = [];\n }\n this.filterByType[cFilter.columnFilterType].push(customFilterType);\n this.filterFunctionsIndexedByType[customFilterType] = cFilter.func;\n this.filterNameIndexByType[customFilterType] = cFilter.name;\n }\n }\n\n // Add filterProp if provided in config\n if (config.filterProp) {\n this.filterProp = config.filterProp;\n }\n\n /**\n * which filters has to be included/excluded\n * convinient way to exclude system filters\n */\n const cfgInlcude = config.include;\n if (cfgInlcude) {\n const filters: Record<string, string[]> = {};\n\n for (let t in this.filterByType) {\n // validate filters, if appropriate function present\n const newTypes = this.filterByType[t].filter(\n f => cfgInlcude.indexOf(f) > -1,\n );\n if (newTypes.length) {\n filters[t] = newTypes;\n }\n }\n // if any valid filters provided show them\n if (Object.keys(filters).length > 0) {\n this.filterByType = filters;\n }\n }\n\n if (config.collection) {\n this.filterCollection = reduce(\n config.collection,\n (result: FilterCollection, item, prop) => {\n if (this.filterFunctionsIndexedByType[item.type]) {\n result[prop] = item;\n } else {\n console.warn(`${item.type} type is not found.`);\n }\n return result;\n },\n {},\n );\n }\n\n if (config.localization) {\n if (config.localization.filterNames) {\n Object.entries(config.localization.filterNames).forEach(([k, v]) => {\n if (this.filterNameIndexByType[k] != void 0) {\n this.filterNameIndexByType[k] = v;\n }\n });\n }\n }\n }\n\n async headerclick(e: CustomEvent<ColumnRegular>) {\n const el = e.detail.originalEvent?.target as HTMLElement;\n if (!isFilterBtn(el)) {\n return;\n }\n e.preventDefault();\n\n // close if same\n const changes = await this.pop?.getChanges();\n if (changes && changes?.prop === e.detail.prop) {\n this.pop?.show();\n return;\n }\n\n if (!this.pop) {\n return;\n }\n\n // filter button clicked, open filter dialog\n const gridPos = this.revogrid.getBoundingClientRect();\n const buttonPos = el.getBoundingClientRect();\n const prop = e.detail.prop;\n\n this.pop.show({\n ...this.filterCollection[prop],\n x: buttonPos.x - gridPos.x,\n y: buttonPos.y - gridPos.y + buttonPos.height,\n autoCorrect: true,\n prop,\n filterTypes: this.getColumnFilter(e.detail.filter),\n });\n }\n\n getColumnFilter(\n type?: boolean | string | string[],\n ): Record<string, string[]> {\n let filterType = 'string';\n if (!type) {\n return { [filterType]: this.filterByType[filterType] };\n }\n\n // if custom column filter\n if (this.isValidType(type)) {\n filterType = type;\n\n // if multiple filters applied\n } else if (typeof type === 'object' && type.length) {\n return type.reduce((r: Record<string, string[]>, multiType) => {\n if (this.isValidType(multiType)) {\n r[multiType] = this.filterByType[multiType];\n }\n return r;\n }, {});\n }\n return { [filterType]: this.filterByType[filterType] };\n }\n\n isValidType(type: any): type is string {\n return !!(typeof type === 'string' && this.filterByType[type]);\n }\n\n /**\n * Called on internal component change\n */\n async onFilterChange(filterItems: MultiFilterItem) {\n // store the filter items\n this.multiFilterItems = filterItems;\n\n // run the filtering when the items change\n this.runFiltering();\n }\n\n /**\n * Triggers grid filtering\n */\n async doFiltering(\n collection: FilterCollection,\n source: DataType[],\n columns: ColumnRegular[],\n filterItems: MultiFilterItem,\n ) {\n const columnsToUpdate: ColumnRegular[] = [];\n\n /**\n * Loop through the columns and update the columns that need to be updated with the `hasFilter` property.\n */\n const columnByProp: Record<string, ColumnRegular> = {};\n columns.forEach(rgCol => {\n const column = { ...rgCol };\n const hasFilter = filterItems[column.prop];\n columnByProp[column.prop] = column;\n\n /**\n * If the column has a filter and it's not already marked as filtered, update the column.\n */\n if (column[this.filterProp] && !hasFilter) {\n delete column[this.filterProp];\n columnsToUpdate.push(column);\n }\n\n /**\n * If the column does not have a filter and it's marked as filtered, update the column.\n */\n\n if (!column[this.filterProp] && hasFilter) {\n columnsToUpdate.push(column);\n column[this.filterProp] = true;\n }\n });\n const itemsToTrim = this.getRowFilter(source, filterItems, columnByProp);\n // check is filter event prevented\n const { defaultPrevented, detail } = this.emit('beforefiltertrimmed', {\n collection,\n itemsToFilter: itemsToTrim,\n source,\n filterItems,\n });\n if (defaultPrevented) {\n return;\n }\n\n // check is trimmed event prevented\n const isAddedEvent = await this.revogrid.addTrimmed(\n detail.itemsToFilter,\n FILTER_TRIMMED_TYPE,\n );\n if (isAddedEvent.defaultPrevented) {\n return;\n }\n\n // applies the hasFilter to the columns to show filter icon\n this.providers.column.updateColumns(columnsToUpdate);\n this.emit('afterfilterapply');\n }\n\n async clearFiltering() {\n this.multiFilterItems = {};\n await this.runFiltering();\n }\n\n async runFiltering() {\n const collection: FilterCollection = {};\n\n // handle old filterCollection to return the first filter only (if any) from multiFilterItems\n const filterProps = Object.keys(this.multiFilterItems);\n\n for (const prop of filterProps) {\n // check if we have any filter for a column\n if (this.multiFilterItems[prop].length > 0) {\n const firstFilterItem = this.multiFilterItems[prop][0];\n collection[prop] = {\n filter: this.filterFunctionsIndexedByType[firstFilterItem.type],\n type: firstFilterItem.type,\n value: firstFilterItem.value,\n };\n }\n }\n\n this.filterCollection = collection;\n\n const { source, columns } = await this.getData();\n const { defaultPrevented, detail } = this.emit('beforefilterapply', {\n collection: this.filterCollection,\n source,\n columns,\n filterItems: this.multiFilterItems,\n });\n if (defaultPrevented) {\n return;\n }\n this.doFiltering(\n detail.collection,\n detail.source,\n detail.columns,\n detail.filterItems,\n );\n }\n\n async getData() {\n return {\n source: await this.revogrid.getSource(),\n columns: await this.revogrid.getColumns(),\n };\n }\n\n /**\n * Get trimmed rows based on filter\n */\n getRowFilter(\n rows: DataType[],\n filterItems: MultiFilterItem,\n columnByProp: Record<string, ColumnRegular>\n ): Record<number, boolean> {\n const propKeys = Object.keys(filterItems);\n\n const trimmed: Record<number, boolean> = {};\n let propFilterSatisfiedCount = 0;\n let lastFilterResults: boolean[] = [];\n\n // each rows\n rows.forEach((model, rowIndex) => {\n // check filter by column properties\n for (const prop of propKeys) {\n const propFilters = filterItems[prop];\n\n // reset the count of satisfied filters\n propFilterSatisfiedCount = 0;\n // reset the array of last filter results\n lastFilterResults = [];\n\n // testing each filter for a prop\n for (const [filterIndex, filterData] of propFilters.entries()) {\n // the filter LogicFunction based on the type\n const filterFunc = this.filterFunctionsIndexedByType[filterData.type];\n\n // THE MAGIC OF FILTERING IS HERE\n const column = columnByProp[prop];\n // If there is no column but user wants to filter by a property\n const value = column ? getCellDataParsed(model, columnByProp[prop]) : model[prop];\n // OR relation\n if (filterData.relation === 'or') {\n // reset the array of last filter results\n lastFilterResults = [];\n // if the filter is satisfied, continue to the next filter\n if (filterFunc(value, filterData.value)) {\n continue;\n }\n // if the filter is not satisfied, count it\n propFilterSatisfiedCount++;\n\n // AND relation\n } else {\n // 'and' relation will need to know the next filter\n // so we save this current filter to include it in the next filter\n lastFilterResults.push(!filterFunc(value, filterData.value));\n\n // check first if we have a filter on the next index to pair it with this current filter\n const nextFilterData = propFilters[filterIndex + 1];\n // stop the sequence if there is no next filter or if the next filter is not an 'and' relation\n if (!nextFilterData || nextFilterData.relation !== 'and') {\n // let's just continue since for sure propFilterSatisfiedCount cannot be satisfied\n if (lastFilterResults.indexOf(true) === -1) {\n // reset the array of last filter results\n lastFilterResults = [];\n continue;\n }\n\n // we need to add all of the lastFilterResults since we need to satisfy all\n propFilterSatisfiedCount += lastFilterResults.length;\n // reset the array of last filter results\n lastFilterResults = [];\n }\n }\n } // end of propFilters forEach\n\n // add to the list of removed/trimmed rows of filter condition is satisfied\n if (propFilterSatisfiedCount === propFilters.length) {\n trimmed[rowIndex] = true;\n }\n } // end of for-of propKeys\n });\n return trimmed;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"filter.plugin.js","sourceRoot":"","sources":["../../../src/plugins/filter/filter.plugin.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAClC,OAAO,MAAM,MAAM,eAAe,CAAC;AAGnC,O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ACxF,MAAM,cAAc,GAAG,WAAW,CAAC,WAAW,GAAG,CAAC,CAAC,CAAC;wBACpD,8FAA8F;wBAC9F,IAAI,CAAC,cAAc,IAAI,cAAc,CAAC,QAAQ,KAAK,KAAK,EAAE,CAAC;4BACzD,kFAAkF;4BAClF,IAAI,iBAAiB,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC;gCAC3C,yCAAyC;gCACzC,iBAAiB,GAAG,EAAE,CAAC;gCACvB,SAAS;4BACX,CAAC;4BAED,2EAA2E;4BAC3E,wBAAwB,IAAI,iBAAiB,CAAC,MAAM,CAAC;4BACrD,yCAAyC;4BACzC,iBAAiB,GAAG,EAAE,CAAC;wBACzB,CAAC;oBACH,CAAC;gBACH,CAAC,CAAC,6BAA6B;gBAE/B,2EAA2E;gBAC3E,IAAI,wBAAwB,KAAK,WAAW,CAAC,MAAM,EAAE,CAAC;oBACpD,OAAO,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC;gBAC3B,CAAC;YACH,CAAC,CAAC,yBAAyB;QAC7B,CAAC,CAAC,CAAC;QACH,OAAO,OAAO,CAAC;IACjB,CAAC;CACF","sourcesContent":["import { h } from '@stencil/core';\nimport reduce from 'lodash/reduce';\n\nimport type { ColumnRegular, DataType, PluginProviders } from '@type';\nimport { BasePlugin } from '../base.plugin';\nimport { FILTER_PROP, isFilterBtn } from './filter.button';\nimport {\n filterCoreFunctionsIndexedByType,\n filterNames,\n filterTypes,\n} from './filter.indexed';\n\nimport type {\n ColumnFilterConfig,\n FilterCollection,\n LogicFunction,\n MultiFilterItem,\n} from './filter.types';\n\nimport { getCellDataParsed } from '../../utils';\n\nexport * from './filter.types';\nexport * from './filter.indexed';\nexport * from './filter.button';\n\nexport const FILTER_TRIMMED_TYPE = 'filter';\nexport const FILTER_CONFIG_CHANGED_EVENT = 'filterconfigchanged';\n\n/**\n * @typedef ColumnFilterConfig\n * @type {object}\n * @property {FilterCollection|undefined} collection - preserved filter data\n * @property {string[]|undefined} include - filters to be included, if defined everything else out of scope will be ignored\n * @property {Record<string, CustomFilter>|undefined} customFilters - hash map of {FilterType:CustomFilter}.\n * @property {FilterLocalization|undefined} localization - translation for filter popup captions.\n * @property {MultiFilterItem|undefined} multiFilterItems - data for multi filtering.\n * @property {boolean|undefined} disableDynamicFiltering - disables dynamic filtering.\n * A way to define your own filter types per column\n */\n/**\n * @internal\n */\n\nexport class FilterPlugin extends BasePlugin {\n pop?: HTMLRevogrFilterPanelElement;\n filterCollection: FilterCollection = {};\n multiFilterItems: MultiFilterItem = {};\n\n filterByType: Record<string, string[]> =\n { ...filterTypes };\n filterNameIndexByType: Record<string, string> = {\n ...filterNames,\n };\n filterFunctionsIndexedByType: Record<string, LogicFunction> = {\n ...filterCoreFunctionsIndexedByType,\n };\n\n filterProp = FILTER_PROP;\n\n constructor(\n public revogrid: HTMLRevoGridElement,\n providers: PluginProviders,\n config?: ColumnFilterConfig,\n ) {\n super(revogrid, providers);\n if (config) {\n this.initConfig(config);\n }\n\n const aftersourceset = async () => {\n const filterCollectionProps = Object.keys(this.filterCollection);\n if (filterCollectionProps.length > 0) {\n // handle old way of filtering by reworking FilterCollection to new MultiFilterItem\n filterCollectionProps.forEach((prop, index) => {\n if (!this.multiFilterItems[prop]) {\n this.multiFilterItems[prop] = [\n {\n id: index,\n type: this.filterCollection[prop].type,\n value: this.filterCollection[prop].value,\n relation: 'and',\n },\n ];\n }\n });\n }\n await this.runFiltering(this.multiFilterItems);\n };\n this.addEventListener(\n 'headerclick',\n (e: CustomEvent<HTMLRevoGridElementEventMap['headerclick']>) =>\n this.headerclick(e),\n );\n this.addEventListener(\n FILTER_CONFIG_CHANGED_EVENT,\n ({ detail }: CustomEvent<ColumnFilterConfig | boolean>) => {\n if (!detail) {\n this.clearFiltering();\n return;\n }\n if (typeof detail === 'object') {\n this.initConfig(detail);\n }\n aftersourceset();\n },\n );\n this.addEventListener('aftersourceset', aftersourceset);\n this.addEventListener('filter', ({ detail }: CustomEvent) =>\n this.onFilterChange(detail),\n );\n\n const existingNodes = this.revogrid.registerVNode.filter(\n n => n.$tag$ !== 'revogr-filter-panel',\n );\n this.revogrid.registerVNode = [\n ...existingNodes,\n <revogr-filter-panel\n filterItems={this.multiFilterItems}\n filterNames={this.filterNameIndexByType}\n filterEntities={this.filterFunctionsIndexedByType}\n filterCaptions={config?.localization?.captions}\n onFilterChange={e => this.onFilterChange(e.detail)}\n disableDynamicFiltering={config?.disableDynamicFiltering}\n ref={e => (this.pop = e)}\n > { this.extraContent() }</revogr-filter-panel>,\n ];\n }\n\n extraContent(): any {\n return null;\n }\n\n initConfig(config: ColumnFilterConfig) {\n if (config.multiFilterItems) {\n this.multiFilterItems = { ...config.multiFilterItems };\n }\n // Add custom filters\n if (config.customFilters) {\n for (let customFilterType in config.customFilters) {\n const cFilter = config.customFilters[customFilterType];\n if (!this.filterByType[cFilter.columnFilterType]) {\n this.filterByType[cFilter.columnFilterType] = [];\n }\n this.filterByType[cFilter.columnFilterType].push(customFilterType);\n this.filterFunctionsIndexedByType[customFilterType] = cFilter.func;\n this.filterNameIndexByType[customFilterType] = cFilter.name;\n }\n }\n\n // Add filterProp if provided in config\n if (config.filterProp) {\n this.filterProp = config.filterProp;\n }\n\n /**\n * which filters has to be included/excluded\n * convinient way to exclude system filters\n */\n const cfgInlcude = config.include;\n if (cfgInlcude) {\n const filters: Record<string, string[]> = {};\n\n for (let t in this.filterByType) {\n // validate filters, if appropriate function present\n const newTypes = this.filterByType[t].filter(\n f => cfgInlcude.indexOf(f) > -1,\n );\n if (newTypes.length) {\n filters[t] = newTypes;\n }\n }\n // if any valid filters provided show them\n if (Object.keys(filters).length > 0) {\n this.filterByType = filters;\n }\n }\n\n if (config.collection) {\n this.filterCollection = reduce(\n config.collection,\n (result: FilterCollection, item, prop) => {\n if (this.filterFunctionsIndexedByType[item.type]) {\n result[prop] = item;\n } else {\n console.warn(`${item.type} type is not found.`);\n }\n return result;\n },\n {},\n );\n }\n\n if (config.localization) {\n if (config.localization.filterNames) {\n Object.entries(config.localization.filterNames).forEach(([k, v]) => {\n if (this.filterNameIndexByType[k] != void 0) {\n this.filterNameIndexByType[k] = v;\n }\n });\n }\n }\n }\n\n async headerclick(e: CustomEvent<ColumnRegular>) {\n const el = e.detail.originalEvent?.target as HTMLElement;\n if (!isFilterBtn(el)) {\n return;\n }\n e.preventDefault();\n\n // close if same\n const changes = await this.pop?.getChanges();\n if (changes && changes?.prop === e.detail.prop) {\n this.pop?.show();\n return;\n }\n\n if (!this.pop) {\n return;\n }\n\n // filter button clicked, open filter dialog\n const gridPos = this.revogrid.getBoundingClientRect();\n const buttonPos = el.getBoundingClientRect();\n const prop = e.detail.prop;\n\n this.pop.show({\n ...this.filterCollection[prop],\n x: buttonPos.x - gridPos.x,\n y: buttonPos.y - gridPos.y + buttonPos.height,\n autoCorrect: true,\n prop,\n filterTypes: this.getColumnFilter(e.detail.filter),\n });\n }\n\n getColumnFilter(\n type?: boolean | string | string[],\n ): Record<string, string[]> {\n let filterType = 'string';\n if (!type) {\n return { [filterType]: this.filterByType[filterType] };\n }\n\n // if custom column filter\n if (this.isValidType(type)) {\n filterType = type;\n\n // if multiple filters applied\n } else if (typeof type === 'object' && type.length) {\n return type.reduce((r: Record<string, string[]>, multiType) => {\n if (this.isValidType(multiType)) {\n r[multiType] = this.filterByType[multiType];\n }\n return r;\n }, {});\n }\n return { [filterType]: this.filterByType[filterType] };\n }\n\n isValidType(type: any): type is string {\n return !!(typeof type === 'string' && this.filterByType[type]);\n }\n\n /**\n * Called on internal component change\n */\n async onFilterChange(filterItems: MultiFilterItem) {\n // store the filter items\n this.multiFilterItems = filterItems;\n\n // run the filtering when the items change\n this.runFiltering(this.multiFilterItems);\n }\n\n /**\n * Triggers grid filtering\n */\n async doFiltering(\n collection: FilterCollection,\n source: DataType[],\n columns: ColumnRegular[],\n filterItems: MultiFilterItem,\n ) {\n const columnsToUpdate: ColumnRegular[] = [];\n\n /**\n * Loop through the columns and update the columns that need to be updated with the `hasFilter` property.\n */\n const columnByProp: Record<string, ColumnRegular> = {};\n columns.forEach(rgCol => {\n const column = { ...rgCol };\n const hasFilter = filterItems[column.prop];\n columnByProp[column.prop] = column;\n\n /**\n * If the column has a filter and it's not already marked as filtered, update the column.\n */\n if (column[this.filterProp] && !hasFilter) {\n delete column[this.filterProp];\n columnsToUpdate.push(column);\n }\n\n /**\n * If the column does not have a filter and it's marked as filtered, update the column.\n */\n\n if (!column[this.filterProp] && hasFilter) {\n columnsToUpdate.push(column);\n column[this.filterProp] = true;\n }\n });\n const itemsToTrim = this.getRowFilter(source, filterItems, columnByProp);\n // check is filter event prevented\n const { defaultPrevented, detail } = this.emit('beforefiltertrimmed', {\n collection,\n itemsToFilter: itemsToTrim,\n source,\n filterItems,\n });\n if (defaultPrevented) {\n return;\n }\n\n // check is trimmed event prevented\n const isAddedEvent = await this.revogrid.addTrimmed(\n detail.itemsToFilter,\n FILTER_TRIMMED_TYPE,\n );\n if (isAddedEvent.defaultPrevented) {\n return;\n }\n\n // applies the hasFilter to the columns to show filter icon\n this.providers.column.updateColumns(columnsToUpdate);\n this.emit('afterfilterapply');\n }\n\n async clearFiltering() {\n this.multiFilterItems = {};\n await this.runFiltering(this.multiFilterItems);\n }\n\n async runFiltering(multiFilterItems: MultiFilterItem) {\n const collection: FilterCollection = {};\n\n // handle old filterCollection to return the first filter only (if any) from multiFilterItems\n const filterProps = Object.keys(multiFilterItems);\n\n for (const prop of filterProps) {\n // check if we have any filter for a column\n if (multiFilterItems[prop].length > 0) {\n const firstFilterItem = multiFilterItems[prop][0];\n collection[prop] = {\n filter: this.filterFunctionsIndexedByType[firstFilterItem.type],\n type: firstFilterItem.type,\n value: firstFilterItem.value,\n };\n }\n }\n\n this.filterCollection = collection;\n\n const { source, columns } = await this.getData();\n const { defaultPrevented, detail } = this.emit('beforefilterapply', {\n collection: this.filterCollection,\n source,\n columns,\n filterItems: this.multiFilterItems,\n });\n if (defaultPrevented) {\n return;\n }\n this.doFiltering(\n detail.collection,\n detail.source,\n detail.columns,\n detail.filterItems,\n );\n }\n\n async getData() {\n return {\n source: await this.revogrid.getSource(),\n columns: await this.revogrid.getColumns(),\n };\n }\n\n /**\n * Get trimmed rows based on filter\n */\n getRowFilter(\n rows: DataType[],\n filterItems: MultiFilterItem,\n columnByProp: Record<string, ColumnRegular>\n ): Record<number, boolean> {\n const propKeys = Object.keys(filterItems);\n\n const trimmed: Record<number, boolean> = {};\n let propFilterSatisfiedCount = 0;\n let lastFilterResults: boolean[] = [];\n\n // each rows\n rows.forEach((model, rowIndex) => {\n // check filter by column properties\n for (const prop of propKeys) {\n const propFilters = filterItems[prop];\n\n // reset the count of satisfied filters\n propFilterSatisfiedCount = 0;\n // reset the array of last filter results\n lastFilterResults = [];\n\n // testing each filter for a prop\n for (const [filterIndex, filterData] of propFilters.entries()) {\n // the filter LogicFunction based on the type\n const filterFunc = this.filterFunctionsIndexedByType[filterData.type];\n\n // THE MAGIC OF FILTERING IS HERE\n const column = columnByProp[prop];\n // If there is no column but user wants to filter by a property\n const value = column ? getCellDataParsed(model, columnByProp[prop]) : model[prop];\n // OR relation\n if (filterData.relation === 'or') {\n // reset the array of last filter results\n lastFilterResults = [];\n // if the filter is satisfied, continue to the next filter\n if (filterFunc(value, filterData.value)) {\n continue;\n }\n // if the filter is not satisfied, count it\n propFilterSatisfiedCount++;\n\n // AND relation\n } else {\n // 'and' relation will need to know the next filter\n // so we save this current filter to include it in the next filter\n lastFilterResults.push(!filterFunc(value, filterData.value));\n\n // check first if we have a filter on the next index to pair it with this current filter\n const nextFilterData = propFilters[filterIndex + 1];\n // stop the sequence if there is no next filter or if the next filter is not an 'and' relation\n if (!nextFilterData || nextFilterData.relation !== 'and') {\n // let's just continue since for sure propFilterSatisfiedCount cannot be satisfied\n if (lastFilterResults.indexOf(true) === -1) {\n // reset the array of last filter results\n lastFilterResults = [];\n continue;\n }\n\n // we need to add all of the lastFilterResults since we need to satisfy all\n propFilterSatisfiedCount += lastFilterResults.length;\n // reset the array of last filter results\n lastFilterResults = [];\n }\n }\n } // end of propFilters forEach\n\n // add to the list of removed/trimmed rows of filter condition is satisfied\n if (propFilterSatisfiedCount === propFilters.length) {\n trimmed[rowIndex] = true;\n }\n } // end of for-of propKeys\n });\n return trimmed;\n }\n}\n"]}
|
|
@@ -63,8 +63,10 @@ export function getColumns(columns, level = 0, types) {
|
|
|
63
63
|
if (isColGrouping(colData)) {
|
|
64
64
|
return gatherGroup(res, colData, getColumns(colData.children, level + 1, types), level);
|
|
65
65
|
}
|
|
66
|
+
// Column type
|
|
67
|
+
const columnDefinitionFromType = colData.columnType && (types === null || types === void 0 ? void 0 : types[colData.columnType]);
|
|
66
68
|
// Regular column
|
|
67
|
-
const regularColumn = Object.assign(Object.assign({},
|
|
69
|
+
const regularColumn = Object.assign(Object.assign({}, columnDefinitionFromType), colData);
|
|
68
70
|
// Regular column, no Pin
|
|
69
71
|
if (!regularColumn.pin) {
|
|
70
72
|
res.columns.rgCol.push(regularColumn);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"column.utils.js","sourceRoot":"","sources":["../../src/utils/column.utils.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,gBAAgB,CAAC;AACrC,OAAO,MAAM,MAAM,eAAe,CAAC;AAoBnC,MAAM,UAAU,WAAW,CAAC,GAAS;IACnC,IAAI,OAAO,GAAG,KAAK,WAAW,IAAI,GAAG,KAAK,IAAI,EAAE,CAAC;QAC/C,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,KAAe,EAAE,MAAqB;IACtE,MAAM,GAAG,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IACtF,OAAO,WAAW,CAAC,GAAG,CAAC,C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,IAAgB;IAEhB,KAAK,MAAM,CAAC,IAAI,OAAO,EAAE,CAAC;QACxB,IAAI,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC;YACrB,MAAM,KAAK,GAAG,UAAU,CAAC,CAAC,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;YAC3C,IAAI,KAAK,EAAE,CAAC;gBACV,OAAO,KAAK,CAAC;YACf,CAAC;QACH,CAAC;aAAM,IAAI,CAAC,CAAC,IAAI,KAAK,IAAI,EAAE,CAAC;YAC3B,OAAO,CAAC,CAAC;QACX,CAAC;IACH,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,MAAM,UAAU,eAAe,CAC7B,OAAmB,EACnB,IAAgB;IAEhB,OAAO,UAAU,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;AACnC,CAAC","sourcesContent":["import isArray from 'lodash/isArray';\nimport reduce from 'lodash/reduce';\n\nimport {\n ColumnData,\n ColumnGrouping,\n ColumnProp,\n ColumnRegular,\n ColumnTypes,\n DataType,\n DimensionCols,\n ViewSettingSizeProp,\n} from '@type';\nimport { Group as StoreGroup } from '@store';\n\nexport type ColumnItems = Record<DimensionCols, ColumnRegular[]>;\nexport interface ColumnGroup extends StoreGroup {\n level: number;\n}\nexport type ColumnGroupingCollection = Record<DimensionCols, ColumnGroup[]>;\n\nexport function getCellData(val?: any) {\n if (typeof val === 'undefined' || val === null) {\n return '';\n }\n return val;\n}\n\nexport function getCellDataParsed(model: DataType, column: ColumnRegular) {\n const val = column.cellParser ? column.cellParser(model, column) : model[column.prop];\n return getCellData(val);\n}\n\n/**\n * Column collection definition.\n * Used to access indexed data for columns.\n * Can be accessed via different events.\n */\nexport type ColumnCollection = {\n /**\n * Columns as they are in stores\n */\n columns: Record<DimensionCols, ColumnRegular[]>;\n /**\n * Columns indexed by prop for quick access, it's possible to have multiple columns with same prop but not recommended\n */\n columnByProp: Record<ColumnProp, ColumnRegular[]>;\n /**\n * Grouped columns\n */\n columnGrouping: ColumnGroupingCollection;\n /**\n * Max level of grouping\n */\n maxLevel: number;\n /**\n * Sorting\n */\n sort: Record<ColumnProp, ColumnRegular>;\n};\n\nexport function getColumnType(rgCol: ColumnRegular): DimensionCols {\n if (rgCol.pin) {\n return rgCol.pin;\n }\n return 'rgCol';\n}\n\nexport function getColumnSizes(cols: ColumnRegular[]): ViewSettingSizeProp {\n const res: ViewSettingSizeProp = {};\n for (const [i, c] of cols.entries()) {\n if (c.size) {\n res[i] = c.size;\n }\n }\n return res;\n}\n\n\n/**\n * Check if column is grouping column\n */\nexport function isColGrouping(\n colData: ColumnGrouping | ColumnRegular,\n): colData is ColumnGrouping {\n return !!(colData as ColumnGrouping).children;\n}\n\n/**\n * This function is used to create a collection of columns.\n */\nexport function getColumns(\n columns: ColumnData,\n level = 0,\n types?: ColumnTypes,\n): ColumnCollection {\n const collection: ColumnCollection = {\n // columns as they are in stores per type\n columns: {\n rgCol: [],\n colPinStart: [],\n colPinEnd: [],\n },\n // columns indexed by prop for quick access\n columnByProp: {},\n // column grouping\n columnGrouping: {\n rgCol: [],\n colPinStart: [],\n colPinEnd: [],\n },\n // max depth level for column grouping\n maxLevel: level,\n // sorting\n sort: {},\n };\n\n return reduce(\n columns,\n (res: ColumnCollection, colData: ColumnGrouping | ColumnRegular) => {\n // Grouped column\n if (isColGrouping(colData)) {\n return gatherGroup(\n res,\n colData,\n getColumns(colData.children, level + 1, types),\n level,\n );\n }\n // Regular column\n const regularColumn = {\n ...(colData.columnType && types && types[colData.columnType]),\n ...colData,\n };\n // Regular column, no Pin\n if (!regularColumn.pin) {\n res.columns.rgCol.push(regularColumn);\n // Pin\n } else {\n res.columns[regularColumn.pin].push(regularColumn);\n }\n if (regularColumn.order) {\n res.sort[regularColumn.prop] = regularColumn;\n }\n // it's possible that some columns have same prop, but better to avoid it\n if (!res.columnByProp[regularColumn.prop]) {\n res.columnByProp[regularColumn.prop] = [];\n }\n res.columnByProp[regularColumn.prop].push(regularColumn);\n\n // trigger setup hook if present\n regularColumn.beforeSetup && regularColumn.beforeSetup(regularColumn);\n return res;\n },\n collection,\n );\n}\n\nexport function gatherGroup<T extends ColumnCollection>(\n res: T,\n colData: ColumnGrouping,\n collection: T,\n level = 0,\n): T {\n // group template\n const group: ColumnGroup = {\n ...colData,\n level,\n ids: [],\n };\n\n // check columns for update\n for (let k in collection.columns) {\n const key = k as keyof ColumnCollection['columns'];\n const resultItem = res.columns[key];\n const collectionItem = collection.columns[key];\n\n // if column data\n if (isArray(resultItem) && isArray(collectionItem)) {\n // fill columns\n resultItem.push(...collectionItem);\n\n // fill grouping\n if (collectionItem.length) {\n res.columnGrouping[key].push({\n ...group,\n ids: collectionItem.map(item => item.prop),\n });\n }\n }\n }\n // merge column groupings\n for (let k in collection.columnGrouping) {\n const key = k as DimensionCols;\n const collectionItem = collection.columnGrouping[key];\n res.columnGrouping[key].push(...collectionItem);\n }\n res.maxLevel = Math.max(res.maxLevel, collection.maxLevel);\n res.sort = { ...res.sort, ...collection.sort };\n return res;\n}\n\nfunction findColumn(\n columns: ColumnData,\n prop: ColumnProp,\n): ColumnRegular | undefined {\n for (const c of columns) {\n if (isColGrouping(c)) {\n const found = findColumn(c.children, prop);\n if (found) {\n return found;\n }\n } else if (c.prop === prop) {\n return c;\n }\n }\n return undefined;\n}\n\nexport function getColumnByProp(\n columns: ColumnData,\n prop: ColumnProp,\n): ColumnRegular | undefined {\n return findColumn(columns, prop);\n}\n"]}
|
|
1
|
+
{"version":3,"file":"column.utils.js","sourceRoot":"","sources":["../../src/utils/column.utils.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,gBAAgB,CAAC;AACrC,OAAO,MAAM,MAAM,eAAe,CAAC;AAoBnC,MAAM,UAAU,WAAW,CAAC,GAAS;IACnC,IAAI,OAAO,GAAG,KAAK,WAAW,IAAI,GAAG,KAAK,IAAI,EAAE,CAAC;QAC/C,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAED,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AC,GAAG,cAAc,CAAC,CAAC;IAClD,CAAC;IACD,GAAG,CAAC,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,QAAQ,EAAE,UAAU,CAAC,QAAQ,CAAC,CAAC;IAC3D,GAAG,CAAC,IAAI,mCAAQ,GAAG,CAAC,IAAI,GAAK,UAAU,CAAC,IAAI,CAAE,CAAC;IAC/C,OAAO,GAAG,CAAC;AACb,CAAC;AAED,SAAS,UAAU,CACjB,OAAmB,EACnB,IAAgB;IAEhB,KAAK,MAAM,CAAC,IAAI,OAAO,EAAE,CAAC;QACxB,IAAI,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC;YACrB,MAAM,KAAK,GAAG,UAAU,CAAC,CAAC,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;YAC3C,IAAI,KAAK,EAAE,CAAC;gBACV,OAAO,KAAK,CAAC;YACf,CAAC;QACH,CAAC;aAAM,IAAI,CAAC,CAAC,IAAI,KAAK,IAAI,EAAE,CAAC;YAC3B,OAAO,CAAC,CAAC;QACX,CAAC;IACH,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,MAAM,UAAU,eAAe,CAC7B,OAAmB,EACnB,IAAgB;IAEhB,OAAO,UAAU,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;AACnC,CAAC","sourcesContent":["import isArray from 'lodash/isArray';\nimport reduce from 'lodash/reduce';\n\nimport {\n ColumnData,\n ColumnGrouping,\n ColumnProp,\n ColumnRegular,\n ColumnTypes,\n DataType,\n DimensionCols,\n ViewSettingSizeProp,\n} from '@type';\nimport { Group as StoreGroup } from '@store';\n\nexport type ColumnItems = Record<DimensionCols, ColumnRegular[]>;\nexport interface ColumnGroup extends StoreGroup {\n level: number;\n}\nexport type ColumnGroupingCollection = Record<DimensionCols, ColumnGroup[]>;\n\nexport function getCellData(val?: any) {\n if (typeof val === 'undefined' || val === null) {\n return '';\n }\n return val;\n}\n\nexport function getCellDataParsed(model: DataType, column: ColumnRegular) {\n const val = column.cellParser ? column.cellParser(model, column) : model[column.prop];\n return getCellData(val);\n}\n\n/**\n * Column collection definition.\n * Used to access indexed data for columns.\n * Can be accessed via different events.\n */\nexport type ColumnCollection = {\n /**\n * Columns as they are in stores\n */\n columns: Record<DimensionCols, ColumnRegular[]>;\n /**\n * Columns indexed by prop for quick access, it's possible to have multiple columns with same prop but not recommended\n */\n columnByProp: Record<ColumnProp, ColumnRegular[]>;\n /**\n * Grouped columns\n */\n columnGrouping: ColumnGroupingCollection;\n /**\n * Max level of grouping\n */\n maxLevel: number;\n /**\n * Sorting\n */\n sort: Record<ColumnProp, ColumnRegular>;\n};\n\nexport function getColumnType(rgCol: ColumnRegular): DimensionCols {\n if (rgCol.pin) {\n return rgCol.pin;\n }\n return 'rgCol';\n}\n\nexport function getColumnSizes(cols: ColumnRegular[]): ViewSettingSizeProp {\n const res: ViewSettingSizeProp = {};\n for (const [i, c] of cols.entries()) {\n if (c.size) {\n res[i] = c.size;\n }\n }\n return res;\n}\n\n\n/**\n * Check if column is grouping column\n */\nexport function isColGrouping(\n colData: ColumnGrouping | ColumnRegular,\n): colData is ColumnGrouping {\n return !!(colData as ColumnGrouping).children;\n}\n\n/**\n * This function is used to create a collection of columns.\n */\nexport function getColumns(\n columns: ColumnData,\n level = 0,\n types?: ColumnTypes,\n): ColumnCollection {\n const collection: ColumnCollection = {\n // columns as they are in stores per type\n columns: {\n rgCol: [],\n colPinStart: [],\n colPinEnd: [],\n },\n // columns indexed by prop for quick access\n columnByProp: {},\n // column grouping\n columnGrouping: {\n rgCol: [],\n colPinStart: [],\n colPinEnd: [],\n },\n // max depth level for column grouping\n maxLevel: level,\n // sorting\n sort: {},\n };\n\n return reduce(\n columns,\n (res: ColumnCollection, colData: ColumnGrouping | ColumnRegular) => {\n // Grouped column\n if (isColGrouping(colData)) {\n return gatherGroup(\n res,\n colData,\n getColumns(colData.children, level + 1, types),\n level,\n );\n }\n // Column type\n const columnDefinitionFromType = colData.columnType && types?.[colData.columnType];\n // Regular column\n const regularColumn = {\n ...columnDefinitionFromType,\n ...colData,\n };\n // Regular column, no Pin\n if (!regularColumn.pin) {\n res.columns.rgCol.push(regularColumn);\n // Pin\n } else {\n res.columns[regularColumn.pin].push(regularColumn);\n }\n if (regularColumn.order) {\n res.sort[regularColumn.prop] = regularColumn;\n }\n // it's possible that some columns have same prop, but better to avoid it\n if (!res.columnByProp[regularColumn.prop]) {\n res.columnByProp[regularColumn.prop] = [];\n }\n res.columnByProp[regularColumn.prop].push(regularColumn);\n\n // trigger setup hook if present\n regularColumn.beforeSetup && regularColumn.beforeSetup(regularColumn);\n return res;\n },\n collection,\n );\n}\n\nexport function gatherGroup<T extends ColumnCollection>(\n res: T,\n colData: ColumnGrouping,\n collection: T,\n level = 0,\n): T {\n // group template\n const group: ColumnGroup = {\n ...colData,\n level,\n ids: [],\n };\n\n // check columns for update\n for (let k in collection.columns) {\n const key = k as keyof ColumnCollection['columns'];\n const resultItem = res.columns[key];\n const collectionItem = collection.columns[key];\n\n // if column data\n if (isArray(resultItem) && isArray(collectionItem)) {\n // fill columns\n resultItem.push(...collectionItem);\n\n // fill grouping\n if (collectionItem.length) {\n res.columnGrouping[key].push({\n ...group,\n ids: collectionItem.map(item => item.prop),\n });\n }\n }\n }\n // merge column groupings\n for (let k in collection.columnGrouping) {\n const key = k as DimensionCols;\n const collectionItem = collection.columnGrouping[key];\n res.columnGrouping[key].push(...collectionItem);\n }\n res.maxLevel = Math.max(res.maxLevel, collection.maxLevel);\n res.sort = { ...res.sort, ...collection.sort };\n return res;\n}\n\nfunction findColumn(\n columns: ColumnData,\n prop: ColumnProp,\n): ColumnRegular | undefined {\n for (const c of columns) {\n if (isColGrouping(c)) {\n const found = findColumn(c.children, prop);\n if (found) {\n return found;\n }\n } else if (c.prop === prop) {\n return c;\n }\n }\n return undefined;\n}\n\nexport function getColumnByProp(\n columns: ColumnData,\n prop: ColumnProp,\n): ColumnRegular | undefined {\n return findColumn(columns, prop);\n}\n"]}
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
* Built by Revolist OU ❤️
|
|
3
3
|
*/
|
|
4
4
|
import { V as createStore, W as reduce, v as setStore, h as calculateDimensionData, X as forEach, b as getSourceItem, n as getScrollbarSize, Y as toInteger, Z as isIterateeCall, q as timeout, i as getItemByPosition } from './index-b6586f9b.js';
|
|
5
|
-
import { e as getColumnType, m as isGrouping, o as getGroupingName, d as getCellDataParsed, h as isColGrouping } from './column.service-
|
|
5
|
+
import { e as getColumnType, m as isGrouping, o as getGroupingName, d as getCellDataParsed, h as isColGrouping } from './column.service-9e1f693c.js';
|
|
6
6
|
import { f as calculateRowHeaderSize } from './row-header-utils-e043f744.js';
|
|
7
7
|
import { h } from './index-a61f225b.js';
|
|
8
8
|
import { b as FILTER_PROP, i as isFilterBtn } from './filter.button-d40ab17b.js';
|
|
9
9
|
import { d as debounce } from './debounce-7b511afc.js';
|
|
10
|
-
import { d as dispatch, O as ON_COLUMN_CLICK } from './header-cell-renderer-
|
|
10
|
+
import { d as dispatch, O as ON_COLUMN_CLICK } from './header-cell-renderer-2ef5f8a1.js';
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* Storing pre-calculated
|
|
@@ -1070,7 +1070,7 @@ class FilterPlugin extends BasePlugin {
|
|
|
1070
1070
|
}
|
|
1071
1071
|
});
|
|
1072
1072
|
}
|
|
1073
|
-
await this.runFiltering();
|
|
1073
|
+
await this.runFiltering(this.multiFilterItems);
|
|
1074
1074
|
};
|
|
1075
1075
|
this.addEventListener('headerclick', (e) => this.headerclick(e));
|
|
1076
1076
|
this.addEventListener(FILTER_CONFIG_CHANGED_EVENT, ({ detail }) => {
|
|
@@ -1208,7 +1208,7 @@ class FilterPlugin extends BasePlugin {
|
|
|
1208
1208
|
// store the filter items
|
|
1209
1209
|
this.multiFilterItems = filterItems;
|
|
1210
1210
|
// run the filtering when the items change
|
|
1211
|
-
this.runFiltering();
|
|
1211
|
+
this.runFiltering(this.multiFilterItems);
|
|
1212
1212
|
}
|
|
1213
1213
|
/**
|
|
1214
1214
|
* Triggers grid filtering
|
|
@@ -1260,16 +1260,16 @@ class FilterPlugin extends BasePlugin {
|
|
|
1260
1260
|
}
|
|
1261
1261
|
async clearFiltering() {
|
|
1262
1262
|
this.multiFilterItems = {};
|
|
1263
|
-
await this.runFiltering();
|
|
1263
|
+
await this.runFiltering(this.multiFilterItems);
|
|
1264
1264
|
}
|
|
1265
|
-
async runFiltering() {
|
|
1265
|
+
async runFiltering(multiFilterItems) {
|
|
1266
1266
|
const collection = {};
|
|
1267
1267
|
// handle old filterCollection to return the first filter only (if any) from multiFilterItems
|
|
1268
|
-
const filterProps = Object.keys(
|
|
1268
|
+
const filterProps = Object.keys(multiFilterItems);
|
|
1269
1269
|
for (const prop of filterProps) {
|
|
1270
1270
|
// check if we have any filter for a column
|
|
1271
|
-
if (
|
|
1272
|
-
const firstFilterItem =
|
|
1271
|
+
if (multiFilterItems[prop].length > 0) {
|
|
1272
|
+
const firstFilterItem = multiFilterItems[prop][0];
|
|
1273
1273
|
collection[prop] = {
|
|
1274
1274
|
filter: this.filterFunctionsIndexedByType[firstFilterItem.type],
|
|
1275
1275
|
type: firstFilterItem.type,
|
|
@@ -1588,4 +1588,4 @@ function getLeftRelative(absoluteX, gridPos, offset) {
|
|
|
1588
1588
|
|
|
1589
1589
|
export { AutoSizeColumnPlugin as A, BasePlugin as B, ColumnPlugin as C, DimensionStore as D, ExportFilePlugin as E, FILTER_TRIMMED_TYPE as F, StretchColumn as S, isStretchPlugin as a, FILTER_CONFIG_CHANGED_EVENT as b, columnTypes as c, FilterPlugin as d, filterTypes as e, filterCoreFunctionsIndexedByType as f, filterNames as g, getLeftRelative as h, isRowType as i, rowTypes as r };
|
|
1590
1590
|
|
|
1591
|
-
//# sourceMappingURL=column.drag.plugin-
|
|
1591
|
+
//# sourceMappingURL=column.drag.plugin-41640959.js.map
|