@revolist/revogrid 4.8.19 → 4.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{column.service-ad5ffa3c.js → column.service-6f691f50.js} +2 -2
- package/dist/cjs/{column.service-ad5ffa3c.js.map → column.service-6f691f50.js.map} +1 -1
- package/dist/cjs/{header-cell-renderer-d92249e4.js → header-cell-renderer-81a22b00.js} +2 -2
- package/dist/cjs/{header-cell-renderer-d92249e4.js.map → header-cell-renderer-81a22b00.js.map} +1 -1
- package/dist/cjs/{index-a9f1b728.js → index-2410bbd9.js} +1 -3
- package/dist/cjs/index-2410bbd9.js.map +1 -0
- package/dist/cjs/{key.utils-e6c8a895.js → key.utils-1e48ab8f.js} +2 -2
- package/dist/cjs/{key.utils-e6c8a895.js.map → key.utils-1e48ab8f.js.map} +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/revo-grid.cjs.entry.js +15 -19
- package/dist/cjs/revo-grid.cjs.entry.js.map +1 -1
- package/dist/cjs/revo-grid.cjs.js +1 -1
- package/dist/cjs/revogr-attribution_6.cjs.entry.js +4 -4
- package/dist/cjs/revogr-clipboard_3.cjs.entry.js +2 -2
- package/dist/cjs/revogr-data_4.cjs.entry.js +21 -8
- package/dist/cjs/revogr-data_4.cjs.entry.js.map +1 -1
- package/dist/cjs/revogr-filter-panel.cjs.entry.js +14 -17
- package/dist/cjs/revogr-filter-panel.cjs.entry.js.map +1 -1
- package/dist/cjs/{throttle-46478b04.js → throttle-bcc4740d.js} +2 -2
- package/dist/cjs/{throttle-46478b04.js.map → throttle-bcc4740d.js.map} +1 -1
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/header/header-renderer.js +18 -5
- package/dist/collection/components/header/header-renderer.js.map +1 -1
- package/dist/collection/components/header/revogr-header.js +2 -2
- package/dist/collection/components/revoGrid/revo-grid.js +10 -15
- package/dist/collection/components/revoGrid/revo-grid.js.map +1 -1
- package/dist/collection/plugins/filter/{filter.pop.js → filter.panel.js} +23 -43
- package/dist/collection/plugins/filter/filter.panel.js.map +1 -0
- package/dist/collection/plugins/filter/filter.plugin.js +2 -2
- package/dist/collection/plugins/filter/filter.plugin.js.map +1 -1
- package/dist/collection/types/interfaces.js.map +1 -1
- package/dist/collection/types/viewport.interfaces.js.map +1 -1
- package/dist/collection/utils/consts.js +0 -1
- package/dist/collection/utils/consts.js.map +1 -1
- package/dist/esm/{column.service-dce8aabc.js → column.service-0e41057a.js} +2 -2
- package/dist/esm/{column.service-dce8aabc.js.map → column.service-0e41057a.js.map} +1 -1
- package/dist/esm/{header-cell-renderer-171a011c.js → header-cell-renderer-6d8ac25d.js} +2 -2
- package/dist/esm/{header-cell-renderer-171a011c.js.map → header-cell-renderer-6d8ac25d.js.map} +1 -1
- package/dist/esm/{index-5a722722.js → index-4e881436.js} +2 -3
- package/dist/esm/index-4e881436.js.map +1 -0
- package/dist/esm/{key.utils-f82409ff.js → key.utils-425c987d.js} +2 -2
- package/dist/esm/{key.utils-f82409ff.js.map → key.utils-425c987d.js.map} +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/revo-grid.entry.js +15 -19
- package/dist/esm/revo-grid.entry.js.map +1 -1
- package/dist/esm/revo-grid.js +1 -1
- package/dist/esm/revogr-attribution_6.entry.js +4 -4
- package/dist/esm/revogr-clipboard_3.entry.js +2 -2
- package/dist/esm/revogr-data_4.entry.js +21 -8
- package/dist/esm/revogr-data_4.entry.js.map +1 -1
- package/dist/esm/revogr-filter-panel.entry.js +15 -18
- package/dist/esm/revogr-filter-panel.entry.js.map +1 -1
- package/dist/esm/{throttle-eeca0062.js → throttle-1b1dd9d2.js} +2 -2
- package/dist/esm/{throttle-eeca0062.js.map → throttle-1b1dd9d2.js.map} +1 -1
- package/dist/revo-grid/{column.service-dce8aabc.js → column.service-0e41057a.js} +2 -2
- package/dist/revo-grid/{header-cell-renderer-171a011c.js → header-cell-renderer-6d8ac25d.js} +2 -2
- package/dist/revo-grid/index-4e881436.js +5 -0
- package/dist/revo-grid/index-4e881436.js.map +1 -0
- package/dist/revo-grid/{key.utils-f82409ff.js → key.utils-425c987d.js} +2 -2
- package/dist/revo-grid/revo-grid.entry.js +1 -1
- package/dist/revo-grid/revo-grid.entry.js.map +1 -1
- package/dist/revo-grid/revo-grid.esm.js +1 -1
- package/dist/revo-grid/revo-grid.esm.js.map +1 -1
- package/dist/revo-grid/revogr-attribution_6.entry.js +1 -1
- package/dist/revo-grid/revogr-clipboard_3.entry.js +1 -1
- package/dist/revo-grid/revogr-data_4.entry.js +1 -1
- package/dist/revo-grid/revogr-data_4.entry.js.map +1 -1
- package/dist/revo-grid/revogr-filter-panel.entry.js +1 -1
- package/dist/revo-grid/revogr-filter-panel.entry.js.map +1 -1
- package/dist/revo-grid/{throttle-eeca0062.js → throttle-1b1dd9d2.js} +2 -2
- package/dist/types/components/revoGrid/revo-grid.d.ts +0 -1
- package/dist/types/components.d.ts +2 -4
- package/dist/types/plugins/filter/{filter.pop.d.ts → filter.panel.d.ts} +1 -2
- package/dist/types/plugins/filter/filter.plugin.d.ts +2 -2
- package/dist/types/types/interfaces.d.ts +1 -0
- package/dist/types/types/viewport.interfaces.d.ts +0 -2
- package/dist/types/utils/consts.d.ts +0 -1
- package/hydrate/index.js +44 -40
- package/hydrate/index.mjs +44 -40
- package/package.json +1 -1
- package/readme.md +2 -0
- package/standalone/consts.js +1 -2
- package/standalone/consts.js.map +1 -1
- package/standalone/index.d.ts +1 -1
- package/standalone/revo-grid.js +13 -17
- package/standalone/revo-grid.js.map +1 -1
- package/standalone/revogr-filter-panel.js +14 -18
- package/standalone/revogr-filter-panel.js.map +1 -1
- package/standalone/revogr-header2.js +17 -4
- package/standalone/revogr-header2.js.map +1 -1
- package/dist/cjs/index-a9f1b728.js.map +0 -1
- package/dist/collection/plugins/filter/filter.pop.js.map +0 -1
- package/dist/esm/index-5a722722.js.map +0 -1
- package/dist/revo-grid/index-5a722722.js +0 -5
- package/dist/revo-grid/index-5a722722.js.map +0 -1
- /package/dist/revo-grid/{column.service-dce8aabc.js.map → column.service-0e41057a.js.map} +0 -0
- /package/dist/revo-grid/{header-cell-renderer-171a011c.js.map → header-cell-renderer-6d8ac25d.js.map} +0 -0
- /package/dist/revo-grid/{key.utils-f82409ff.js.map → key.utils-425c987d.js.map} +0 -0
- /package/dist/revo-grid/{throttle-eeca0062.js.map → throttle-1b1dd9d2.js.map} +0 -0
|
@@ -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;AAEnC,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE3D,OAAO,EACL,cAAc,EACd,WAAW,EAEX,WAAW,GACZ,MAAM,kBAAkB,CAAC;AA2D1B,MAAM,CAAC,MAAM,mBAAmB,GAAG,QAAQ,CAAC;AAC5C,MAAM,CAAC,MAAM,2BAA2B,GAAG,qBAAqB,CAAC;AAEjE,MAAM,OAAO,YAAa,SAAQ,UAAU;IAW1C,YACS,QAA6B,EACpC,SAA0B,EAC1B,IAAY,EACZ,MAA2B;;QAE3B,KAAK,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;QALpB,aAAQ,GAAR,QAAQ,CAAqB;QAVtC,qBAAgB,GAAqB,EAAE,CAAC;QACxC,qBAAgB,GAAoB,EAAE,CAAC;QACvC,oBAAe,qBAAkC,WAAW,EAAG;QAC/D,wBAAmB,qBAAgC,WAAW,EAAG;QACjE,2BAAsB,qBACjB,cAAc,EACjB;QACF,eAAU,GAAG,WAAW,CAAC;QASvB,IAAI,MAAM,EAAE,CAAC;YACX,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,CAA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AC;gCAC3C,iBAAiB,GAAG,EAAE,CAAC;gCACvB,SAAS;4BACX,CAAC;4BAED,2EAA2E;4BAC3E,wBAAwB,IAAI,iBAAiB,CAAC,MAAM,CAAC;4BACrD,iBAAiB,GAAG,EAAE,CAAC;wBACzB,CAAC;oBACH,CAAC;gBACH,CAAC,CAAC,6BAA6B;gBAE/B,2EAA2E;gBAC3E,IAAI,wBAAwB,KAAK,WAAW,CAAC,MAAM;oBACjD,OAAO,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC;YAC7B,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 { BasePlugin } from '../base.plugin';\nimport { FILTER_PROP, isFilterBtn } from './filter.button';\nimport { MultiFilterItem } from './filter.pop';\nimport {\n filterEntities,\n filterNames,\n FilterType,\n filterTypes,\n} from './filter.service';\nimport { LogicFunction } from './filter.types';\nimport { ColumnProp, ColumnRegular, DataType } from '@type';\nimport { PluginProviders } from '@type';\n\ntype CustomFilter = {\n columnFilterType: string; // property defined in column filter: string/number/abstract/enum...etc\n name: string;\n func: LogicFunction;\n};\n\nexport type FilterCaptions = {\n title: string;\n save: string;\n reset: string;\n cancel: string;\n add: string,\n placeholder: string,\n and: string,\n or: string,\n};\n\nexport type FilterLocalization = {\n captions: FilterCaptions;\n filterNames: Record<FilterType, string>;\n};\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 */\nexport type ColumnFilterConfig = {\n collection?: FilterCollection;\n include?: string[];\n customFilters?: Record<string, CustomFilter>;\n filterProp?: string;\n localization?: FilterLocalization;\n multiFilterItems?: MultiFilterItem;\n disableDynamicFiltering?: boolean;\n};\ntype HeaderEvent = CustomEvent<ColumnRegular>;\ntype FilterCollectionItem = {\n filter: LogicFunction;\n type: FilterType;\n value?: any;\n};\n\nexport type FilterCollection = Record<ColumnProp, FilterCollectionItem>;\n\nexport const FILTER_TRIMMED_TYPE = 'filter';\nexport const FILTER_CONFIG_CHANGED_EVENT = 'filterconfigchanged';\n\nexport class FilterPlugin extends BasePlugin {\n pop?: HTMLRevogrFilterPanelElement;\n filterCollection: FilterCollection = {};\n multiFilterItems: MultiFilterItem = {};\n possibleFilters: Record<string, string[]> = { ...filterTypes };\n possibleFilterNames: Record<string, string> = { ...filterNames };\n possibleFilterEntities: Record<string, LogicFunction> = {\n ...filterEntities,\n };\n filterProp = FILTER_PROP;\n\n constructor(\n public revogrid: HTMLRevoGridElement,\n providers: PluginProviders,\n uiid: string,\n config?: ColumnFilterConfig,\n ) {\n super(revogrid, providers);\n if (config) {\n this.initConfig(config);\n }\n\n const headerclick = (e: HeaderEvent) => this.headerclick(e);\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('headerclick', headerclick);\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.$tag$ !== 'revogr-filter-panel');\n this.revogrid.registerVNode = [\n ...existingNodes,\n <revogr-filter-panel\n uuid={`filter-${uiid}`}\n filterItems={this.multiFilterItems}\n filterNames={this.possibleFilterNames}\n filterEntities={this.possibleFilterEntities}\n filterCaptions={config?.localization?.captions}\n onFilterChange={e => this.onFilterChange(e.detail)}\n disableDynamicFiltering={config?.disableDynamicFiltering}\n ref={e => (this.pop = e)}\n />,\n ];\n }\n\n initConfig(config: ColumnFilterConfig) {\n if (config.multiFilterItems) {\n this.multiFilterItems = { ...config.multiFilterItems };\n }\n if (config.customFilters) {\n for (let cType in config.customFilters) {\n const cFilter = config.customFilters[cType];\n if (!this.possibleFilters[cFilter.columnFilterType]) {\n this.possibleFilters[cFilter.columnFilterType] = [];\n }\n this.possibleFilters[cFilter.columnFilterType].push(cType);\n this.possibleFilterEntities[cType] = cFilter.func;\n this.possibleFilterNames[cType] = cFilter.name;\n }\n }\n\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.possibleFilters) {\n // validate filters, if appropriate function present\n const newTypes = this.possibleFilters[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.possibleFilters = filters;\n }\n }\n if (config.collection) {\n this.filterCollection = reduce(\n config.collection,\n (result: FilterCollection, item, prop) => {\n if (this.possibleFilterEntities[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.possibleFilterNames[k] != void 0) {\n this.possibleFilterNames[k] = v;\n }\n });\n }\n }\n }\n\n async headerclick(e: HeaderEvent) {\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 this.pop.filterTypes = this.getColumnFilter(e.detail.filter);\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 });\n }\n\n getColumnFilter(\n type?: boolean | string | string[],\n ): Record<string, string[]> {\n let filterType = 'string';\n if (!type) {\n return { [filterType]: this.possibleFilters[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.possibleFilters[multiType];\n }\n return r;\n }, {});\n }\n return { [filterType]: this.possibleFilters[filterType] };\n }\n\n isValidType(type: any): type is string {\n return !!(typeof type === 'string' && this.possibleFilters[type]);\n }\n\n // called on internal component change\n async onFilterChange(filterItems: MultiFilterItem) {\n this.multiFilterItems = filterItems;\n this.runFiltering();\n }\n\n /**\n * Triggers grid filtering\n */\n async doFiltering(\n collection: FilterCollection,\n items: DataType[],\n columns: ColumnRegular[],\n filterItems: MultiFilterItem,\n ) {\n const columnsToUpdate: ColumnRegular[] = [];\n\n columns.forEach(rgCol => {\n const column = { ...rgCol };\n const hasFilter = filterItems[column.prop];\n if (column[this.filterProp] && !hasFilter) {\n delete column[this.filterProp];\n columnsToUpdate.push(column);\n }\n if (!column[this.filterProp] && hasFilter) {\n columnsToUpdate.push(column);\n column[this.filterProp] = true;\n }\n });\n const itemsToFilter = this.getRowFilter(items, filterItems);\n // check is filter event prevented\n const { defaultPrevented, detail } = this.emit('beforefiltertrimmed', {\n collection,\n itemsToFilter,\n source: items,\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 await this.revogrid.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: filterEntities[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 getRowFilter(rows: DataType[], filterItems: MultiFilterItem) {\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 // working on all props\n for (const prop of propKeys) {\n const propFilters = filterItems[prop];\n\n propFilterSatisfiedCount = 0;\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 filter = this.possibleFilterEntities[filterData.type];\n\n // THE MAGIC OF FILTERING IS HERE\n if (filterData.relation === 'or') {\n lastFilterResults = [];\n if (filter(model[prop], filterData.value)) {\n continue;\n }\n propFilterSatisfiedCount++;\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(!filter(model[prop], 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 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 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 } // 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;AAEnC,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE3D,OAAO,EACL,cAAc,EACd,WAAW,EAEX,WAAW,GACZ,MAAM,kBAAkB,CAAC;AA2D1B,MAAM,CAAC,MAAM,mBAAmB,GAAG,QAAQ,CAAC;AAC5C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wB,EAAE,CAAC;oBAC7B,CAAC;yBAAM,CAAC;wBACN,mDAAmD;wBACnD,kEAAkE;wBAClE,iBAAiB,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC;wBAE/D,wFAAwF;wBACxF,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,iBAAiB,GAAG,EAAE,CAAC;gCACvB,SAAS;4BACX,CAAC;4BAED,2EAA2E;4BAC3E,wBAAwB,IAAI,iBAAiB,CAAC,MAAM,CAAC;4BACrD,iBAAiB,GAAG,EAAE,CAAC;wBACzB,CAAC;oBACH,CAAC;gBACH,CAAC,CAAC,6BAA6B;gBAE/B,2EAA2E;gBAC3E,IAAI,wBAAwB,KAAK,WAAW,CAAC,MAAM;oBACjD,OAAO,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC;YAC7B,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 { BasePlugin } from '../base.plugin';\nimport { FILTER_PROP, isFilterBtn } from './filter.button';\nimport { MultiFilterItem } from './filter.panel';\nimport {\n filterEntities,\n filterNames,\n FilterType,\n filterTypes,\n} from './filter.service';\nimport { LogicFunction } from './filter.types';\nimport { ColumnProp, ColumnRegular, DataType } from '@type';\nimport { PluginProviders } from '@type';\n\ntype CustomFilter = {\n columnFilterType: string; // property defined in column filter: string/number/abstract/enum...etc\n name: string;\n func: LogicFunction;\n};\n\nexport type FilterCaptions = {\n title: string;\n save: string;\n reset: string;\n cancel: string;\n add: string,\n placeholder: string,\n and: string,\n or: string,\n};\n\nexport type FilterLocalization = {\n captions: FilterCaptions;\n filterNames: Record<FilterType, string>;\n};\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 */\nexport type ColumnFilterConfig = {\n collection?: FilterCollection;\n include?: string[];\n customFilters?: Record<string, CustomFilter>;\n filterProp?: string;\n localization?: FilterLocalization;\n multiFilterItems?: MultiFilterItem;\n disableDynamicFiltering?: boolean;\n};\ntype HeaderEvent = CustomEvent<ColumnRegular>;\ntype FilterCollectionItem = {\n filter: LogicFunction;\n type: FilterType;\n value?: any;\n};\n\nexport type FilterCollection = Record<ColumnProp, FilterCollectionItem>;\n\nexport const FILTER_TRIMMED_TYPE = 'filter';\nexport const FILTER_CONFIG_CHANGED_EVENT = 'filterconfigchanged';\n\nexport class FilterPlugin extends BasePlugin {\n pop?: HTMLRevogrFilterPanelElement;\n filterCollection: FilterCollection = {};\n multiFilterItems: MultiFilterItem = {};\n possibleFilters: Record<string, string[]> = { ...filterTypes };\n possibleFilterNames: Record<string, string> = { ...filterNames };\n possibleFilterEntities: Record<string, LogicFunction> = {\n ...filterEntities,\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 headerclick = (e: HeaderEvent) => this.headerclick(e);\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('headerclick', headerclick);\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.$tag$ !== 'revogr-filter-panel');\n this.revogrid.registerVNode = [\n ...existingNodes,\n <revogr-filter-panel\n filterItems={this.multiFilterItems}\n filterNames={this.possibleFilterNames}\n filterEntities={this.possibleFilterEntities}\n filterCaptions={config?.localization?.captions}\n onFilterChange={e => this.onFilterChange(e.detail)}\n disableDynamicFiltering={config?.disableDynamicFiltering}\n ref={e => (this.pop = e)}\n />,\n ];\n }\n\n initConfig(config: ColumnFilterConfig) {\n if (config.multiFilterItems) {\n this.multiFilterItems = { ...config.multiFilterItems };\n }\n if (config.customFilters) {\n for (let cType in config.customFilters) {\n const cFilter = config.customFilters[cType];\n if (!this.possibleFilters[cFilter.columnFilterType]) {\n this.possibleFilters[cFilter.columnFilterType] = [];\n }\n this.possibleFilters[cFilter.columnFilterType].push(cType);\n this.possibleFilterEntities[cType] = cFilter.func;\n this.possibleFilterNames[cType] = cFilter.name;\n }\n }\n\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.possibleFilters) {\n // validate filters, if appropriate function present\n const newTypes = this.possibleFilters[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.possibleFilters = filters;\n }\n }\n if (config.collection) {\n this.filterCollection = reduce(\n config.collection,\n (result: FilterCollection, item, prop) => {\n if (this.possibleFilterEntities[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.possibleFilterNames[k] != void 0) {\n this.possibleFilterNames[k] = v;\n }\n });\n }\n }\n }\n\n async headerclick(e: HeaderEvent) {\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 this.pop.filterTypes = this.getColumnFilter(e.detail.filter);\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 });\n }\n\n getColumnFilter(\n type?: boolean | string | string[],\n ): Record<string, string[]> {\n let filterType = 'string';\n if (!type) {\n return { [filterType]: this.possibleFilters[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.possibleFilters[multiType];\n }\n return r;\n }, {});\n }\n return { [filterType]: this.possibleFilters[filterType] };\n }\n\n isValidType(type: any): type is string {\n return !!(typeof type === 'string' && this.possibleFilters[type]);\n }\n\n // called on internal component change\n async onFilterChange(filterItems: MultiFilterItem) {\n this.multiFilterItems = filterItems;\n this.runFiltering();\n }\n\n /**\n * Triggers grid filtering\n */\n async doFiltering(\n collection: FilterCollection,\n items: DataType[],\n columns: ColumnRegular[],\n filterItems: MultiFilterItem,\n ) {\n const columnsToUpdate: ColumnRegular[] = [];\n\n columns.forEach(rgCol => {\n const column = { ...rgCol };\n const hasFilter = filterItems[column.prop];\n if (column[this.filterProp] && !hasFilter) {\n delete column[this.filterProp];\n columnsToUpdate.push(column);\n }\n if (!column[this.filterProp] && hasFilter) {\n columnsToUpdate.push(column);\n column[this.filterProp] = true;\n }\n });\n const itemsToFilter = this.getRowFilter(items, filterItems);\n // check is filter event prevented\n const { defaultPrevented, detail } = this.emit('beforefiltertrimmed', {\n collection,\n itemsToFilter,\n source: items,\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 await this.revogrid.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: filterEntities[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 getRowFilter(rows: DataType[], filterItems: MultiFilterItem) {\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 // working on all props\n for (const prop of propKeys) {\n const propFilters = filterItems[prop];\n\n propFilterSatisfiedCount = 0;\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 filter = this.possibleFilterEntities[filterData.type];\n\n // THE MAGIC OF FILTERING IS HERE\n if (filterData.relation === 'or') {\n lastFilterResults = [];\n if (filter(model[prop], filterData.value)) {\n continue;\n }\n propFilterSatisfiedCount++;\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(!filter(model[prop], 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 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 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 } // end of for-of propKeys\n });\n return trimmed;\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../src/types/interfaces.ts"],"names":[],"mappings":"AA0PC,CAAC","sourcesContent":["import type { VNode } from '@stencil/core';\n\nimport {\n DimensionCols,\n DimensionRows,\n DimensionColPin,\n DimensionType,\n MultiDimensionType,\n} from './dimension';\nimport {\n Cell,\n EditorCtr,\n FocusedCells,\n RangeArea,\n SelectionStoreState,\n} from './selection';\nimport type { Observable } from '../utils/store.utils';\n\n/**\n * Advanced column data schema model.\n * Used for transpassing data to cell renderer and editor.\n */\nexport type ColumnDataSchemaModel = {\n /**\n * Column prop used for mapping value to cell from data source model/row\n */\n prop: ColumnProp;\n /**\n * Row data object\n */\n model: DataType;\n /**\n * Column data object\n */\n column: ColumnRegular;\n /**\n * Index of the row in the viewport\n */\n rowIndex: number;\n /**\n * Index of the column in the viewport\n */\n colIndex: number;\n /**\n * Column type based on viewport\n */\n colType: DimensionCols;\n /**\n * Row type based on viewport\n */\n type: DimensionRows;\n /**\n * Row models based on viewport\n */\n data: DataType[];\n /**\n * Current cell data\n */\n value: any;\n};\n/**\n * Template property for each cell, extends the column data schema model.\n * Additionally, it provides access to the providers injected into the template.\n */\nexport interface CellTemplateProp extends ColumnDataSchemaModel {\n /**\n * Providers injected into the template\n */\n providers: Providers;\n}\n/**\n * The ReadOnlyFormat type is a boolean value or a function that takes ColumnDataSchemaModel\n * as a parameter and returns a boolean value.\n *\n * If it is a boolean value, it represents whether the cell in question is read-only.\n * If it is a function, it returns whether the cell in question is read-only based on the provided\n * ColumnDataSchemaModel.\n */\nexport type ReadOnlyFormat =\n | boolean\n | ((params: ColumnDataSchemaModel) => boolean);\nexport type RowDrag =\n | boolean\n | {\n (params: ColumnDataSchemaModel): boolean;\n };\n/**\n * `ColumnGrouping` type is used to define a grouping in a column.\n */\nexport type ColumnGrouping = {\n /**\n * An array of objects that represent the children of the grouping.\n */\n children: (ColumnGrouping | ColumnRegular)[];\n /**\n * A `DataFormat` object that represents the name of the grouping.\n */\n name: DataFormat;\n};\n/**\n * Configuration for header inner template properties\n */\nexport interface ColumnProperties {\n /**\n * Header inner template\n * Function/component to render custom header content\n */\n columnTemplate?: ColumnTemplateFunc;\n /**\n * Header Cell properties\n * Custom function/component to render header properties\n */\n columnProperties?: ColPropertiesFunc;\n}\n/**\n * Type that represents a collection of column types.\n * The keys are the names of the column types and the values are the corresponding column type objects.\n */\nexport type ColumnTypes = {\n /**\n * The name of the column type.\n */\n [name: string]: ColumnType;\n};\n\n/**\n * Interface for custom cell renderer.\n */\nexport interface CellTemplate {\n // TODO: Add Promise support for template and all custom function so user will be able to use async render on the light speed\n (\n createElement: HyperFunc<VNode>,\n props: CellTemplateProp,\n additionalData?: any,\n ): any;\n}\n/**\n * Interface for regular column definition.\n * Regular column can be any column that is not a grouping column.\n */\nexport interface ColumnType extends ColumnProperties {\n /**\n * Represents whether the column or cell is read-only.\n * Can be a boolean or a function that returns a boolean.\n * The function receives column data as a parameter.\n */\n readonly?: ReadOnlyFormat;\n /**\n * Represents the default column size.\n */\n size?: number;\n /**\n * Represents the minimal column size.\n * This property cannot be less than cell padding\n * in order to keep performance on top and minimize DOM elements number.\n */\n minSize?: number;\n /**\n * Represents the maximum column size.\n */\n maxSize?: number;\n /**\n * Represents a custom editor defined in @editors property.\n * Can be a string or an editor constructor function.\n */\n editor?: string | EditorCtr;\n /**\n * Represents cell properties for custom styling, classes, and events.\n */\n cellProperties?: PropertiesFunc;\n /**\n * Represents the cell template for custom rendering.\n */\n cellTemplate?: CellTemplate;\n /**\n * Represents the cell compare function for custom sorting.\n */\n cellCompare?: CellCompareFunc;\n}\nexport type Order = 'asc' | 'desc' | undefined;\n/**\n * Interface for regular column definition.\n * Regular column can be any column that is not a grouping column.\n * \n */\n/**\n * ColumnRegular interface represents regular column definition.\n * Regular column can be any column that is not a grouping column.\n */\nexport interface ColumnRegular extends ColumnType {\n /**\n * Column prop used for mapping value to cell from data source model/row, used for indexing.\n */\n prop: ColumnProp;\n /**\n * Column pin 'colPinStart'|'colPinEnd'.\n */\n pin?: DimensionColPin;\n /**\n * Column header text.\n */\n name?: DataFormat;\n /**\n * Column size would be changed based on space left.\n */\n autoSize?: boolean;\n /**\n * Filter. Require filter plugin to be installed and activated through grid config @filter.\n */\n filter?: boolean | string | string[];\n /**\n * Is column can be sorted, check @cellCompare function for custom sorting.\n */\n sortable?: boolean;\n /**\n * Sort order.\n */\n order?: Order;\n /**\n * Is cell in column or individual can be dragged.\n */\n rowDrag?: RowDrag;\n /**\n * Represents type defined in @columnTypes property through grid config.\n */\n columnType?: string;\n /**\n * Function called before column applied to the store.\n */\n beforeSetup?(rgCol: ColumnRegular): void;\n /**\n * Additional properties can be added to the column definition.\n */\n [key: string]: any;\n}\n\nexport type ColumnData = (ColumnGrouping | ColumnRegular)[];\n/**\n * Column template property.\n * Contains extended properties for column.\n */\nexport interface ColumnTemplateProp extends ColumnRegular {\n /**\n * Providers injected into the template.\n */\n providers: Providers<DimensionCols | 'rowHeaders'>;\n /**\n * Index of the column, used for mapping value to cell from data source model/row.\n */\n index: number;\n};\n\nexport type ColumnPropProp = ColumnGrouping | ColumnTemplateProp;\n// Column prop used for mapping value to cell from data source model/row, used for indexing.\nexport type ColumnProp = string | number;\n\nexport type DataFormat = any;\n\nexport type CellProp = string | number | object | boolean | undefined;\n\n/**\n * Additional properties applied to the cell.\n * Contains style object where key is CSS property and value is CSS property value.\n * Contains class object where key is CSS class and value is boolean flag indicating if class should be applied.\n * Contains additional properties for custom cell rendering.\n */\nexport type CellProps = {\n // CSS styles applied to the cell\n style?: {\n [key: string]: string | undefined;\n };\n // CSS classes applied to the cell\n class?:\n | {\n // CSS class name\n [key: string]: boolean;\n }\n | string;\n // Additional properties for custom cell rendering\n [attr: string]: CellProp;\n};\n\n/**\n * Providers for grid which are going to be injected into each cell template\n */\nexport type Providers<T = DimensionRows> = {\n /**\n * Dimension type (e.g. row or column)\n */\n type: T;\n /**\n * Flag indicating if grid is in readonly mode\n */\n readonly: boolean;\n /**\n * Data source store\n */\n data: Observable<DataSourceState<any, any>> | ColumnRegular[];\n /**\n * Viewport store\n */\n viewport: Observable<ViewportState>;\n /**\n * Dimension store\n */\n dimension: Observable<DimensionSettingsState>;\n /**\n * Selection store\n */\n selection: Observable<SelectionStoreState>;\n};\n/**\n * `HyperFunc` is a function that takes an HTML tag or component, and returns a\n * JSX element. This function is used to create JSX elements in a context where\n * JSX is not valid.\n */\nexport interface HyperFunc<T> {\n // (tag: any): T;\n (tag: any): T;\n}\n/**\n * `HyperFunc` is a function that takes an HTML tag or component, and returns a\n * JSX element. This function is used to create JSX elements in a context where\n * JSX is not valid.\n */\nexport interface HyperFunc<T> {\n (tag: any, data: any): T;\n}\n/**\n * `HyperFunc` is a function that takes an HTML tag or component, and returns a\n * JSX element. This function is used to create JSX elements in a context where\n * JSX is not valid.\n */\nexport interface HyperFunc<T> {\n (tag: any, text: string): T;\n}\n\n/**\n * `HyperFunc` is a function that takes an HTML tag or component, and returns a\n * JSX element. This function is used to create JSX elements in a context where\n * JSX is not valid.\n */\nexport interface HyperFunc<T> {\n (sel: any, children: Array<T | undefined | null>): T;\n}\n\n/**\n * `HyperFunc` is a function that takes an HTML tag or component, and returns a\n * JSX element. This function is used to create JSX elements in a context where\n * JSX is not valid.\n */\nexport interface HyperFunc<T> {\n (sel: any, data: any, text: string): T;\n}\n\n/**\n * `HyperFunc` is a function that takes an HTML tag or component, and returns a\n * JSX element. This function is used to create JSX elements in a context where\n * JSX is not valid.\n */\nexport interface HyperFunc<T> {\n (sel: any, data: any, children: Array<T | undefined | null>): T;\n}\n\n/**\n * `HyperFunc` is a function that takes an HTML tag or component, and returns a\n * JSX element. This function is used to create JSX elements in a context where\n * JSX is not valid.\n */\nexport interface HyperFunc<T> {\n (sel: any, data: any, children: T): T;\n}\n/**\n * `FocusTemplateFunc` is a function that takes an HTML tag or component, and\n * returns a JSX element. This function is used to create JSX elements in a\n * context where JSX is not valid.\n */\nexport type FocusTemplateFunc = (\n createElement: HyperFunc<VNode>,\n detail: FocusRenderEvent,\n) => any;\n\n\n/**\n * `CellCompareFunc` is a function that takes the column property to compare,\n * the data of the first cell, and the data of the second cell. It returns a\n * number indicating the relative order of the two cells.\n */\nexport type CellCompareFunc = (\n // The column property to compare.\n prop: ColumnProp,\n // The data of the first cell.\n a: DataType,\n // The data of the second cell.\n b: DataType,\n) => number;\nexport type ColumnTemplateFunc = (\n createElement: HyperFunc<VNode>,\n props: ColumnTemplateProp,\n additionalData?: any,\n) => any;\nexport type PropertiesFunc = (\n props: ColumnDataSchemaModel,\n) => CellProps | void | undefined;\nexport type ColPropertiesFunc = (\n props: ColumnPropProp,\n) => CellProps | void | undefined;\nexport type DataType = {\n [T in ColumnProp]: DataFormat;\n};\n\nexport type DataLookup = {\n [rowIndex: number]: DataType;\n};\n/**\n * `RowDefinition` is a type that represents a row definition in the\n * viewport.\n */\nexport type RowDefinition = {\n /**\n * The type of the row.\n */\n type: DimensionRows;\n /**\n * The size of the row.\n */\n size: number;\n /**\n * The index of the row.\n */\n index: number;\n};\nexport interface RowHeaders extends ColumnRegular {}\n/**\n * `ViewPortResizeEvent` is an object that contains information about a resize\n * event in the viewport.\n */\nexport type ViewPortResizeEvent = {\n /* The dimension of the viewport being resized. */\n dimension: DimensionType;\n /* The new size of the viewport. */\n size: number;\n /* Indicates whether the resize event is for a row header. */\n rowHeader?: boolean;\n};\n\n/**\n * `ViewPortScrollEvent` is an object that contains information about a scroll\n * event in the viewport.\n */\nexport type ViewPortScrollEvent = {\n /**\n * The dimension of the viewport being scrolled.\n */\n dimension: DimensionType;\n /**\n * The coordinate of the scroll event.\n */\n coordinate: number;\n /**\n * The change in coordinate between scroll events.\n */\n delta?: number;\n /**\n * Indicates whether the scroll event occurred outside the viewport.\n */\n outside?: boolean;\n};\n\n/**\n * `InitialHeaderClick` represents the information needed to handle a click\n * event on the initial column header.\n */\nexport type InitialHeaderClick = {\n /**\n * The index of the column header that was clicked.\n */\n index: number;\n /**\n * The original mouse event that triggered the click.\n */\n originalEvent: MouseEvent;\n /**\n * The column that was clicked.\n */\n column: ColumnRegular;\n};\n\n/**\n * `Range` is an object that represents a range of values.\n */\nexport type Range = {\n /**\n * The start of the range.\n */\n start: number;\n /**\n * The end of the range.\n */\n end: number;\n};\n\n/**\n * `ViewportStateItems` is an object that represents the items in a viewport\n * along with their corresponding range.\n */\nexport type ViewportStateItems = {\n /**\n * The items in the viewport.\n */\n items: VirtualPositionItem[];\n} & Range;\n\n/**\n * `ViewportState` is an object that represents the state of a viewport.\n */\nexport interface ViewportState extends ViewportStateItems {\n /**\n * The number of real items in the viewport.\n */\n realCount: number;\n /**\n * The virtual size of the viewport.\n */\n virtualSize: number;\n}\n\n/**\n * `ViewSettingSizeProp` is a record that maps column or row indexes to their\n * corresponding sizes.\n */\nexport type ViewSettingSizeProp = Record<string, number>;\n\n/**\n * `VirtualPositionItem` is an object that represents a virtual position item\n * in the viewport.\n */\nexport interface VirtualPositionItem extends PositionItem {\n /**\n * The size of the virtual position item.\n */\n size: number;\n}\nexport type DataSourceState<\n T extends DataType | ColumnRegular,\n ST extends DimensionRows | DimensionCols,\n> = {\n // items - index based array for mapping to source tree\n items: number[];\n // all items, used as proxy for sorting, trimming and others manipulations\n proxyItems: number[];\n // original data source\n source: T[];\n // grouping\n groupingDepth: number;\n groups: Record<any, any>;\n // data source type\n type: ST;\n // trim data, to hide entities from visible data source\n trimmed: Record<any, any>;\n};\nexport interface PositionItem {\n itemIndex: number;\n start: number;\n end: number;\n}\n/**\n * Object containing information about calculated dimensions.\n * Used for both columns and rows.\n */\nexport interface DimensionCalc {\n /**\n * Array of indexes of visible items.\n */\n indexes: number[];\n\n /**\n * Count of visible items.\n */\n count: number;\n\n /**\n * Array of indexes of visible items.\n * Used for mapping items to their position in DOM.\n */\n positionIndexes: number[];\n\n /**\n * Mapping of position to item.\n * Used for mapping position in DOM to item.\n */\n positionIndexToItem: {\n /**\n * Position in DOM.\n */\n [position: number]: PositionItem;\n };\n\n /**\n * Mapping of index to item.\n * Used for mapping index in data source to item.\n */\n indexToItem: {\n /**\n * Index in data source.\n */\n [index: number]: PositionItem;\n };\n\n /**\n * Object containing information about trimmed data.\n * Used for hiding entities from visible data source.\n */\n trimmed: Record<any, any>;\n\n /**\n * Object containing size for each visible item.\n */\n sizes: ViewSettingSizeProp;\n}\n/**\n * Represents the settings state of a dimension.\n * It extends the calculation properties of a dimension.\n * It also includes the real size and origin item size of the dimension.\n */\nexport interface DimensionSettingsState extends DimensionCalc {\n /**\n * Represents the real size of the dimension.\n */\n realSize: number;\n\n /**\n * Represents the origin item size of the dimension.\n */\n originItemSize: number;\n}\n\n/**\n * Represents the mapping of dimension types to their corresponding observable stores.\n */\nexport type DimensionStores = {\n [T in MultiDimensionType]: Observable<DimensionSettingsState>;\n};\n\n/**\n * Represents the mapping of dimension types to their corresponding observable stores for the viewport.\n */\nexport type ViewportStores = {\n [T in MultiDimensionType]: Observable<ViewportState>;\n};\n\n/**\n * Represents the event object that is emitted when the drag operation starts.\n */\nexport interface DragStartEvent {\n /**\n * Represents the original mouse event that triggered the drag operation.\n */\n originalEvent: MouseEvent;\n\n /**\n * Represents the model of the column being dragged.\n */\n model: ColumnDataSchemaModel;\n}\n\n/**\n * Represents the event object that is emitted before cell rendering.\n * It includes information about the dimension type, column, row, and model.\n */\nexport interface BeforeCellRenderEvent<T = any> extends AllDimensionType {\n /**\n * Represents the column being rendered.\n */\n column: VirtualPositionItem;\n\n /**\n * Represents the row being rendered.\n */\n row: VirtualPositionItem;\n\n /**\n * Represents the model being rendered.\n */\n model: T;\n}\n\n/**\n * Represents the event object that is emitted before row rendering.\n * It includes information about the dimension type, data item, item, and node.\n */\nexport interface BeforeRowRenderEvent<T = any> extends AllDimensionType {\n /**\n * Represents the data item being rendered.\n */\n model: T;\n\n /**\n * Represents the item being rendered.\n */\n item: VirtualPositionItem;\n\n /**\n * Represents the node being rendered.\n */\n node: VNode;\n}\n\n/**\n * Represents the event object that is emitted after rendering.\n * It includes information about the dimension type.\n */\nexport type AfterRendererEvent = {\n /**\n * Represents the type of dimension being rendered.\n */\n type: DimensionType;\n};\n\n/**\n * Represents the mapping of dimension types to their corresponding dimension types.\n */\nexport interface AllDimensionType {\n /**\n * Represents the dimension type for rows.\n */\n rowType: DimensionRows;\n\n /**\n * Represents the dimension type for columns.\n */\n colType: DimensionCols;\n}\n\n/**\n * Represents the event object that is emitted when applying focus.\n * It includes information about the dimension type and focused cells.\n */\nexport interface ApplyFocusEvent extends AllDimensionType, FocusedCells {}\n\n/**\n * Represents the event object that is emitted before focus rendering.\n * It includes information about the dimension type and range area.\n */\nexport interface FocusRenderEvent extends AllDimensionType {\n /**\n * Represents the range area of the focus.\n */\n range: RangeArea;\n\n /**\n * Changes for the next cell to focus. @example { y: -1 }\n */\n next?: Partial<Cell>;\n}\n/**\n * Represents the event object that is emitted when scrolling occurs.\n * The `type` property indicates the type of dimension (row or column) being scrolled.\n * The `coordinate` property represents the current scroll position in that dimension.\n */\nexport type ScrollCoordinateEvent = {\n /**\n * Represents the type of dimension being scrolled.\n * Possible values are 'rgRow' and 'rgCol'.\n */\n type: DimensionType;\n\n /**\n * Represents the current scroll position in the specified dimension.\n * The value is a number representing the coordinate in pixels.\n */\n coordinate: number;\n};\n"]}
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../src/types/interfaces.ts"],"names":[],"mappings":"AA0PC,CAAC","sourcesContent":["import type { VNode } from '@stencil/core';\n\nimport {\n DimensionCols,\n DimensionRows,\n DimensionColPin,\n DimensionType,\n MultiDimensionType,\n} from './dimension';\nimport {\n Cell,\n EditorCtr,\n FocusedCells,\n RangeArea,\n SelectionStoreState,\n} from './selection';\nimport type { Observable } from '../utils/store.utils';\n\n/**\n * Advanced column data schema model.\n * Used for transpassing data to cell renderer and editor.\n */\nexport type ColumnDataSchemaModel = {\n /**\n * Column prop used for mapping value to cell from data source model/row\n */\n prop: ColumnProp;\n /**\n * Row data object\n */\n model: DataType;\n /**\n * Column data object\n */\n column: ColumnRegular;\n /**\n * Index of the row in the viewport\n */\n rowIndex: number;\n /**\n * Index of the column in the viewport\n */\n colIndex: number;\n /**\n * Column type based on viewport\n */\n colType: DimensionCols;\n /**\n * Row type based on viewport\n */\n type: DimensionRows;\n /**\n * Row models based on viewport\n */\n data: DataType[];\n /**\n * Current cell data\n */\n value: any;\n};\n/**\n * Template property for each cell, extends the column data schema model.\n * Additionally, it provides access to the providers injected into the template.\n */\nexport interface CellTemplateProp extends ColumnDataSchemaModel {\n /**\n * Providers injected into the template\n */\n providers: Providers;\n}\n/**\n * The ReadOnlyFormat type is a boolean value or a function that takes ColumnDataSchemaModel\n * as a parameter and returns a boolean value.\n *\n * If it is a boolean value, it represents whether the cell in question is read-only.\n * If it is a function, it returns whether the cell in question is read-only based on the provided\n * ColumnDataSchemaModel.\n */\nexport type ReadOnlyFormat =\n | boolean\n | ((params: ColumnDataSchemaModel) => boolean);\nexport type RowDrag =\n | boolean\n | {\n (params: ColumnDataSchemaModel): boolean;\n };\n/**\n * `ColumnGrouping` type is used to define a grouping in a column.\n */\nexport type ColumnGrouping = {\n /**\n * An array of objects that represent the children of the grouping.\n */\n children: (ColumnGrouping | ColumnRegular)[];\n /**\n * A `DataFormat` object that represents the name of the grouping.\n */\n name: DataFormat;\n};\n/**\n * Configuration for header inner template properties\n */\nexport interface ColumnProperties {\n /**\n * Header inner template\n * Function/component to render custom header content\n */\n columnTemplate?: ColumnTemplateFunc;\n /**\n * Header Cell properties\n * Custom function/component to render header properties\n */\n columnProperties?: ColPropertiesFunc;\n}\n/**\n * Type that represents a collection of column types.\n * The keys are the names of the column types and the values are the corresponding column type objects.\n */\nexport type ColumnTypes = {\n /**\n * The name of the column type.\n */\n [name: string]: ColumnType;\n};\n\n/**\n * Interface for custom cell renderer.\n */\nexport interface CellTemplate {\n // TODO: Add Promise support for template and all custom function so user will be able to use async render on the light speed\n (\n createElement: HyperFunc<VNode>,\n props: CellTemplateProp,\n additionalData?: any,\n ): any;\n}\n/**\n * Interface for regular column definition.\n * Regular column can be any column that is not a grouping column.\n */\nexport interface ColumnType extends ColumnProperties {\n /**\n * Represents whether the column or cell is read-only.\n * Can be a boolean or a function that returns a boolean.\n * The function receives column data as a parameter.\n */\n readonly?: ReadOnlyFormat;\n /**\n * Represents the default column size.\n */\n size?: number;\n /**\n * Represents the minimal column size.\n * This property cannot be less than cell padding\n * in order to keep performance on top and minimize DOM elements number.\n */\n minSize?: number;\n /**\n * Represents the maximum column size.\n */\n maxSize?: number;\n /**\n * Represents a custom editor defined in @editors property.\n * Can be a string or an editor constructor function.\n */\n editor?: string | EditorCtr;\n /**\n * Represents cell properties for custom styling, classes, and events.\n */\n cellProperties?: PropertiesFunc;\n /**\n * Represents the cell template for custom rendering.\n */\n cellTemplate?: CellTemplate;\n /**\n * Represents the cell compare function for custom sorting.\n */\n cellCompare?: CellCompareFunc;\n}\nexport type Order = 'asc' | 'desc' | undefined;\n/**\n * Interface for regular column definition.\n * Regular column can be any column that is not a grouping column.\n * \n */\n/**\n * ColumnRegular interface represents regular column definition.\n * Regular column can be any column that is not a grouping column.\n */\nexport interface ColumnRegular extends ColumnType {\n /**\n * Column prop used for mapping value to cell from data source model/row, used for indexing.\n */\n prop: ColumnProp;\n /**\n * Column pin 'colPinStart'|'colPinEnd'.\n */\n pin?: DimensionColPin;\n /**\n * Column header text.\n */\n name?: DataFormat;\n /**\n * Column size would be changed based on space left.\n */\n autoSize?: boolean;\n /**\n * Filter. Require filter plugin to be installed and activated through grid config @filter.\n */\n filter?: boolean | string | string[];\n /**\n * Is column can be sorted, check @cellCompare function for custom sorting.\n */\n sortable?: boolean;\n /**\n * Sort order.\n */\n order?: Order;\n /**\n * Is cell in column or individual can be dragged.\n */\n rowDrag?: RowDrag;\n /**\n * Represents type defined in @columnTypes property through grid config.\n */\n columnType?: string;\n /**\n * Function called before column applied to the store.\n */\n beforeSetup?(rgCol: ColumnRegular): void;\n /**\n * Additional properties can be added to the column definition.\n */\n [key: string]: any;\n}\n\nexport type ColumnData = (ColumnGrouping | ColumnRegular)[];\n/**\n * Column template property.\n * Contains extended properties for column.\n */\nexport interface ColumnTemplateProp extends ColumnRegular {\n /**\n * Providers injected into the template.\n */\n providers: Providers<DimensionCols | 'rowHeaders'>;\n /**\n * Index of the column, used for mapping value to cell from data source model/row.\n */\n index: number;\n};\n\nexport type ColumnPropProp = ColumnGrouping | ColumnTemplateProp;\n// Column prop used for mapping value to cell from data source model/row, used for indexing.\nexport type ColumnProp = string | number;\n\nexport type DataFormat = any;\n\nexport type CellProp = string | number | object | boolean | undefined;\n\n/**\n * Additional properties applied to the cell.\n * Contains style object where key is CSS property and value is CSS property value.\n * Contains class object where key is CSS class and value is boolean flag indicating if class should be applied.\n * Contains additional properties for custom cell rendering.\n */\nexport type CellProps = {\n // CSS styles applied to the cell\n style?: {\n [key: string]: string | undefined;\n };\n // CSS classes applied to the cell\n class?:\n | {\n // CSS class name\n [key: string]: boolean;\n }\n | string;\n // Additional properties for custom cell rendering\n [attr: string]: CellProp;\n};\n\n/**\n * Providers for grid which are going to be injected into each cell template\n */\nexport type Providers<T = DimensionRows> = {\n /**\n * Dimension type (e.g. row or column)\n */\n type: T;\n /**\n * Flag indicating if grid is in readonly mode\n */\n readonly: boolean;\n /**\n * Data source store\n */\n data: Observable<DataSourceState<any, any>> | ColumnRegular[];\n /**\n * Viewport store\n */\n viewport: Observable<ViewportState>;\n /**\n * Dimension store\n */\n dimension: Observable<DimensionSettingsState>;\n /**\n * Selection store\n */\n selection: Observable<SelectionStoreState>;\n};\n/**\n * `HyperFunc` is a function that takes an HTML tag or component, and returns a\n * JSX element. This function is used to create JSX elements in a context where\n * JSX is not valid.\n */\nexport interface HyperFunc<T> {\n // (tag: any): T;\n (tag: any): T;\n}\n/**\n * `HyperFunc` is a function that takes an HTML tag or component, and returns a\n * JSX element. This function is used to create JSX elements in a context where\n * JSX is not valid.\n */\nexport interface HyperFunc<T> {\n (tag: any, data: any): T;\n}\n/**\n * `HyperFunc` is a function that takes an HTML tag or component, and returns a\n * JSX element. This function is used to create JSX elements in a context where\n * JSX is not valid.\n */\nexport interface HyperFunc<T> {\n (tag: any, text: string): T;\n}\n\n/**\n * `HyperFunc` is a function that takes an HTML tag or component, and returns a\n * JSX element. This function is used to create JSX elements in a context where\n * JSX is not valid.\n */\nexport interface HyperFunc<T> {\n (sel: any, children: Array<T | undefined | null>): T;\n}\n\n/**\n * `HyperFunc` is a function that takes an HTML tag or component, and returns a\n * JSX element. This function is used to create JSX elements in a context where\n * JSX is not valid.\n */\nexport interface HyperFunc<T> {\n (sel: any, data: any, text: string): T;\n}\n\n/**\n * `HyperFunc` is a function that takes an HTML tag or component, and returns a\n * JSX element. This function is used to create JSX elements in a context where\n * JSX is not valid.\n */\nexport interface HyperFunc<T> {\n (sel: any, data: any, children: Array<T | undefined | null>): T;\n}\n\n/**\n * `HyperFunc` is a function that takes an HTML tag or component, and returns a\n * JSX element. This function is used to create JSX elements in a context where\n * JSX is not valid.\n */\nexport interface HyperFunc<T> {\n (sel: any, data: any, children: T): T;\n}\n/**\n * `FocusTemplateFunc` is a function that takes an HTML tag or component, and\n * returns a JSX element. This function is used to create JSX elements in a\n * context where JSX is not valid.\n */\nexport type FocusTemplateFunc = (\n createElement: HyperFunc<VNode>,\n detail: FocusRenderEvent,\n) => any;\n\n\n/**\n * `CellCompareFunc` is a function that takes the column property to compare,\n * the data of the first cell, and the data of the second cell. It returns a\n * number indicating the relative order of the two cells.\n */\nexport type CellCompareFunc = (\n // The column property to compare.\n prop: ColumnProp,\n // The data of the first cell.\n a: DataType,\n // The data of the second cell.\n b: DataType,\n) => number;\nexport type ColumnTemplateFunc = (\n createElement: HyperFunc<VNode>,\n props: ColumnTemplateProp,\n additionalData?: any,\n) => any;\nexport type PropertiesFunc = (\n props: ColumnDataSchemaModel,\n) => CellProps | void | undefined;\nexport type ColPropertiesFunc = (\n props: ColumnPropProp,\n) => CellProps | void | undefined;\nexport type DataType = {\n [T in ColumnProp]: DataFormat;\n};\n\nexport type DataLookup = {\n [rowIndex: number]: DataType;\n};\n/**\n * `RowDefinition` is a type that represents a row definition in the\n * viewport.\n */\nexport type RowDefinition = {\n /**\n * The type of the row.\n */\n type: DimensionRows;\n /**\n * The size of the row.\n */\n size: number;\n /**\n * The index of the row.\n */\n index: number;\n};\nexport interface RowHeaders extends ColumnRegular {}\n/**\n * `ViewPortResizeEvent` is an object that contains information about a resize\n * event in the viewport.\n */\nexport type ViewPortResizeEvent = {\n /* The dimension of the viewport being resized. */\n dimension: DimensionType;\n /* The new size of the viewport. */\n size: number;\n /* Indicates whether the resize event is for a row header. */\n rowHeader?: boolean;\n};\n\n/**\n * `ViewPortScrollEvent` is an object that contains information about a scroll\n * event in the viewport.\n */\nexport type ViewPortScrollEvent = {\n /**\n * The dimension of the viewport being scrolled.\n */\n dimension: DimensionType;\n /**\n * The coordinate of the scroll event.\n */\n coordinate: number;\n /**\n * The change in coordinate between scroll events.\n */\n delta?: number;\n /**\n * Indicates whether the scroll event occurred outside the viewport.\n */\n outside?: boolean;\n};\n\n/**\n * `InitialHeaderClick` represents the information needed to handle a click\n * event on the initial column header.\n */\nexport type InitialHeaderClick = {\n /**\n * The index of the column header that was clicked.\n */\n index: number;\n /**\n * The original mouse event that triggered the click.\n */\n originalEvent: MouseEvent;\n /**\n * The column that was clicked.\n */\n column: ColumnRegular;\n providers: Providers<DimensionCols | 'rowHeaders'>;\n};\n\n/**\n * `Range` is an object that represents a range of values.\n */\nexport type Range = {\n /**\n * The start of the range.\n */\n start: number;\n /**\n * The end of the range.\n */\n end: number;\n};\n\n/**\n * `ViewportStateItems` is an object that represents the items in a viewport\n * along with their corresponding range.\n */\nexport type ViewportStateItems = {\n /**\n * The items in the viewport.\n */\n items: VirtualPositionItem[];\n} & Range;\n\n/**\n * `ViewportState` is an object that represents the state of a viewport.\n */\nexport interface ViewportState extends ViewportStateItems {\n /**\n * The number of real items in the viewport.\n */\n realCount: number;\n /**\n * The virtual size of the viewport.\n */\n virtualSize: number;\n}\n\n/**\n * `ViewSettingSizeProp` is a record that maps column or row indexes to their\n * corresponding sizes.\n */\nexport type ViewSettingSizeProp = Record<string, number>;\n\n/**\n * `VirtualPositionItem` is an object that represents a virtual position item\n * in the viewport.\n */\nexport interface VirtualPositionItem extends PositionItem {\n /**\n * The size of the virtual position item.\n */\n size: number;\n}\nexport type DataSourceState<\n T extends DataType | ColumnRegular,\n ST extends DimensionRows | DimensionCols,\n> = {\n // items - index based array for mapping to source tree\n items: number[];\n // all items, used as proxy for sorting, trimming and others manipulations\n proxyItems: number[];\n // original data source\n source: T[];\n // grouping\n groupingDepth: number;\n groups: Record<any, any>;\n // data source type\n type: ST;\n // trim data, to hide entities from visible data source\n trimmed: Record<any, any>;\n};\nexport interface PositionItem {\n itemIndex: number;\n start: number;\n end: number;\n}\n/**\n * Object containing information about calculated dimensions.\n * Used for both columns and rows.\n */\nexport interface DimensionCalc {\n /**\n * Array of indexes of visible items.\n */\n indexes: number[];\n\n /**\n * Count of visible items.\n */\n count: number;\n\n /**\n * Array of indexes of visible items.\n * Used for mapping items to their position in DOM.\n */\n positionIndexes: number[];\n\n /**\n * Mapping of position to item.\n * Used for mapping position in DOM to item.\n */\n positionIndexToItem: {\n /**\n * Position in DOM.\n */\n [position: number]: PositionItem;\n };\n\n /**\n * Mapping of index to item.\n * Used for mapping index in data source to item.\n */\n indexToItem: {\n /**\n * Index in data source.\n */\n [index: number]: PositionItem;\n };\n\n /**\n * Object containing information about trimmed data.\n * Used for hiding entities from visible data source.\n */\n trimmed: Record<any, any>;\n\n /**\n * Object containing size for each visible item.\n */\n sizes: ViewSettingSizeProp;\n}\n/**\n * Represents the settings state of a dimension.\n * It extends the calculation properties of a dimension.\n * It also includes the real size and origin item size of the dimension.\n */\nexport interface DimensionSettingsState extends DimensionCalc {\n /**\n * Represents the real size of the dimension.\n */\n realSize: number;\n\n /**\n * Represents the origin item size of the dimension.\n */\n originItemSize: number;\n}\n\n/**\n * Represents the mapping of dimension types to their corresponding observable stores.\n */\nexport type DimensionStores = {\n [T in MultiDimensionType]: Observable<DimensionSettingsState>;\n};\n\n/**\n * Represents the mapping of dimension types to their corresponding observable stores for the viewport.\n */\nexport type ViewportStores = {\n [T in MultiDimensionType]: Observable<ViewportState>;\n};\n\n/**\n * Represents the event object that is emitted when the drag operation starts.\n */\nexport interface DragStartEvent {\n /**\n * Represents the original mouse event that triggered the drag operation.\n */\n originalEvent: MouseEvent;\n\n /**\n * Represents the model of the column being dragged.\n */\n model: ColumnDataSchemaModel;\n}\n\n/**\n * Represents the event object that is emitted before cell rendering.\n * It includes information about the dimension type, column, row, and model.\n */\nexport interface BeforeCellRenderEvent<T = any> extends AllDimensionType {\n /**\n * Represents the column being rendered.\n */\n column: VirtualPositionItem;\n\n /**\n * Represents the row being rendered.\n */\n row: VirtualPositionItem;\n\n /**\n * Represents the model being rendered.\n */\n model: T;\n}\n\n/**\n * Represents the event object that is emitted before row rendering.\n * It includes information about the dimension type, data item, item, and node.\n */\nexport interface BeforeRowRenderEvent<T = any> extends AllDimensionType {\n /**\n * Represents the data item being rendered.\n */\n model: T;\n\n /**\n * Represents the item being rendered.\n */\n item: VirtualPositionItem;\n\n /**\n * Represents the node being rendered.\n */\n node: VNode;\n}\n\n/**\n * Represents the event object that is emitted after rendering.\n * It includes information about the dimension type.\n */\nexport type AfterRendererEvent = {\n /**\n * Represents the type of dimension being rendered.\n */\n type: DimensionType;\n};\n\n/**\n * Represents the mapping of dimension types to their corresponding dimension types.\n */\nexport interface AllDimensionType {\n /**\n * Represents the dimension type for rows.\n */\n rowType: DimensionRows;\n\n /**\n * Represents the dimension type for columns.\n */\n colType: DimensionCols;\n}\n\n/**\n * Represents the event object that is emitted when applying focus.\n * It includes information about the dimension type and focused cells.\n */\nexport interface ApplyFocusEvent extends AllDimensionType, FocusedCells {}\n\n/**\n * Represents the event object that is emitted before focus rendering.\n * It includes information about the dimension type and range area.\n */\nexport interface FocusRenderEvent extends AllDimensionType {\n /**\n * Represents the range area of the focus.\n */\n range: RangeArea;\n\n /**\n * Changes for the next cell to focus. @example { y: -1 }\n */\n next?: Partial<Cell>;\n}\n/**\n * Represents the event object that is emitted when scrolling occurs.\n * The `type` property indicates the type of dimension (row or column) being scrolled.\n * The `coordinate` property represents the current scroll position in that dimension.\n */\nexport type ScrollCoordinateEvent = {\n /**\n * Represents the type of dimension being scrolled.\n * Possible values are 'rgRow' and 'rgCol'.\n */\n type: DimensionType;\n\n /**\n * Represents the current scroll position in the specified dimension.\n * The value is a number representing the coordinate in pixels.\n */\n coordinate: number;\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"viewport.interfaces.js","sourceRoot":"","sources":["../../src/types/viewport.interfaces.ts"],"names":[],"mappings":"","sourcesContent":["import type { JSXBase } from '@stencil/core/internal';\nimport type {\n DimensionCols,\n ColumnRegular,\n ViewPortScrollEvent,\n ViewportState,\n Cell,\n SelectionStoreState,\n} from '@type';\nimport type {\n DimensionStoreCollection,\n ViewportStoreCollection,\n DSourceState,\n} from '@store';\nimport { Observable } from '../utils/store.utils';\nimport type { RowDataSources } from '../services/data.provider';\nimport type { JSX } from '..';\n\nexport type SlotType = 'content' | 'header' | 'footer';\n\nexport interface ElementScroll {\n changeScroll?(\n e: ViewPortScrollEvent,\n silent?: boolean,\n ): Promise<ViewPortScrollEvent>;\n setScroll?(e: ViewPortScrollEvent): Promise<void>;\n}\nexport type ElementsScroll = { [key: string]: ElementScroll[] };\n\nexport type HeaderProperties = JSX.RevogrHeader;\n\nexport type ViewportProperties = JSX.RevogrViewportScroll &\n JSXBase.HTMLAttributes<HTMLRevogrViewportScrollElement>;\n\nexport type ViewportColumn = {\n colType: DimensionCols;\n position: Cell;\n\n fixWidth?: boolean;\n\n viewports: ViewportStoreCollection;\n dimensions: DimensionStoreCollection;\n\n rowStores: RowDataSources;\n colStore: Observable<DSourceState<ColumnRegular, DimensionCols>>;\n} & Partial<JSX.RevogrViewportScroll> &\n Partial<JSX.RevogrHeader>;\n\nexport type ViewportData = {\n /** Selection connection */\n segmentSelectionStore: Observable<SelectionStoreState>;\n\n /** Slot to put data */\n slot: SlotType;\n
|
|
1
|
+
{"version":3,"file":"viewport.interfaces.js","sourceRoot":"","sources":["../../src/types/viewport.interfaces.ts"],"names":[],"mappings":"","sourcesContent":["import type { JSXBase } from '@stencil/core/internal';\nimport type {\n DimensionCols,\n ColumnRegular,\n ViewPortScrollEvent,\n ViewportState,\n Cell,\n SelectionStoreState,\n} from '@type';\nimport type {\n DimensionStoreCollection,\n ViewportStoreCollection,\n DSourceState,\n} from '@store';\nimport { Observable } from '../utils/store.utils';\nimport type { RowDataSources } from '../services/data.provider';\nimport type { JSX } from '..';\n\nexport type SlotType = 'content' | 'header' | 'footer';\n\nexport interface ElementScroll {\n changeScroll?(\n e: ViewPortScrollEvent,\n silent?: boolean,\n ): Promise<ViewPortScrollEvent>;\n setScroll?(e: ViewPortScrollEvent): Promise<void>;\n}\nexport type ElementsScroll = { [key: string]: ElementScroll[] };\n\nexport type HeaderProperties = JSX.RevogrHeader;\n\nexport type ViewportProperties = JSX.RevogrViewportScroll &\n JSXBase.HTMLAttributes<HTMLRevogrViewportScrollElement>;\n\nexport type ViewportColumn = {\n colType: DimensionCols;\n position: Cell;\n\n fixWidth?: boolean;\n\n viewports: ViewportStoreCollection;\n dimensions: DimensionStoreCollection;\n\n rowStores: RowDataSources;\n colStore: Observable<DSourceState<ColumnRegular, DimensionCols>>;\n} & Partial<JSX.RevogrViewportScroll> &\n Partial<JSX.RevogrHeader>;\n\nexport type ViewportData = {\n /** Selection connection */\n segmentSelectionStore: Observable<SelectionStoreState>;\n\n /** Slot to put data */\n slot: SlotType;\n style?: { [key: string]: string };\n} & JSX.RevogrOverlaySelection &\n JSX.RevogrData;\n\nexport type ViewportProps = {\n prop: JSX.RevogrViewportScroll &\n JSXBase.HTMLAttributes<HTMLRevogrViewportScrollElement>;\n position: Cell;\n type: DimensionCols;\n /** Cols dataset */\n viewportCol: Observable<ViewportState>;\n\n /** header container props */\n headerProp: HeaderProperties;\n\n /** parent selector link */\n // parent: string;\n\n /** viewport rows */\n dataPorts: ViewportData[];\n\n columnSelectionStore: Observable<SelectionStoreState>;\n};\n"]}
|
|
@@ -5,7 +5,6 @@ export const MIN_COL_SIZE = 30;
|
|
|
5
5
|
export const RESIZE_INTERVAL = 40;
|
|
6
6
|
export const DATA_COL = 'data-rgCol';
|
|
7
7
|
export const DATA_ROW = 'data-rgRow';
|
|
8
|
-
export const UUID = 'grid-uuid';
|
|
9
8
|
export const DISABLED_CLASS = 'disabled';
|
|
10
9
|
export const CELL_CLASS = 'rgCell';
|
|
11
10
|
export const ROW_HEADER_TYPE = 'rowHeaders';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"consts.js","sourceRoot":"","sources":["../../src/utils/consts.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,YAAY,GAAG,EAAE,CAAC;AAC/B,MAAM,CAAC,MAAM,eAAe,GAAG,EAAE,CAAC;AAElC,MAAM,CAAC,MAAM,QAAQ,GAAG,YAAY,CAAC;AACrC,MAAM,CAAC,MAAM,QAAQ,GAAG,YAAY,CAAC;AAErC,MAAM,CAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"consts.js","sourceRoot":"","sources":["../../src/utils/consts.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,YAAY,GAAG,EAAE,CAAC;AAC/B,MAAM,CAAC,MAAM,eAAe,GAAG,EAAE,CAAC;AAElC,MAAM,CAAC,MAAM,QAAQ,GAAG,YAAY,CAAC;AACrC,MAAM,CAAC,MAAM,QAAQ,GAAG,YAAY,CAAC;AAErC,MAAM,CAAC,MAAM,cAAc,GAAG,UAAU,CAAC;AACzC,MAAM,CAAC,MAAM,UAAU,GAAG,QAAQ,CAAC;AACnC,MAAM,CAAC,MAAM,eAAe,GAAG,YAAY,CAAC;AAC5C,MAAM,CAAC,MAAM,YAAY,GAAG,cAAc,CAAC;AAC3C,MAAM,CAAC,MAAM,qBAAqB,GAAG,UAAU,CAAC;AAChD,MAAM,CAAC,MAAM,gBAAgB,GAAG,cAAc,CAAC;AAC/C,MAAM,CAAC,MAAM,uBAAuB,GAAG,cAAc,CAAC;AAEtD,MAAM,CAAC,MAAM,eAAe,GAAG,gBAAgB,CAAC;AAChD,MAAM,CAAC,MAAM,eAAe,GAAG,gBAAgB,CAAC;AAEhD,MAAM,CAAC,MAAM,WAAW,GAAG,cAAc,CAAC;AAC1C,MAAM,CAAC,MAAM,sBAAsB,GAAG,wBAAwB,CAAC;AAC/D,MAAM,CAAC,MAAM,YAAY,GAAG,gBAAgB,CAAC;AAC7C,MAAM,CAAC,MAAM,sBAAsB,GAAG,eAAe,CAAC;AAEtD,MAAM,CAAC,MAAM,kBAAkB,GAAG,iBAAiB,CAAC;AAEpD,MAAM,CAAC,MAAM,aAAa,GAAG,oBAAoB,CAAC;AAElD,MAAM,CAAC,MAAM,UAAU,GAAG,gBAAgB,CAAC;AAC3C,MAAM,CAAC,MAAM,cAAc,GAAG,QAAQ,CAAC;AACvC,MAAM,CAAC,MAAM,iBAAiB,GAAG,eAAe,CAAC","sourcesContent":["export const MIN_COL_SIZE = 30;\nexport const RESIZE_INTERVAL = 40;\n\nexport const DATA_COL = 'data-rgCol';\nexport const DATA_ROW = 'data-rgRow';\n\nexport const DISABLED_CLASS = 'disabled';\nexport const CELL_CLASS = 'rgCell';\nexport const ROW_HEADER_TYPE = 'rowHeaders';\nexport const HEADER_CLASS = 'rgHeaderCell';\nexport const HEADER_SORTABLE_CLASS = 'sortable';\nexport const HEADER_ROW_CLASS = 'header-rgRow';\nexport const HEADER_ACTUAL_ROW_CLASS = 'actual-rgRow';\n\nexport const DRAG_ICON_CLASS = 'revo-drag-icon';\nexport const DRAGGABLE_CLASS = 'revo-draggable';\n\nexport const FOCUS_CLASS = 'focused-cell';\nexport const SELECTION_BORDER_CLASS = 'selection-border-range';\nexport const MOBILE_CLASS = 'mobile-handler';\nexport const TMP_SELECTION_BG_CLASS = 'temp-bg-range';\n\nexport const CELL_HANDLER_CLASS = 'autofill-handle';\n\nexport const EDIT_INPUT_WR = 'edit-input-wrapper';\n\nexport const DRAGG_TEXT = 'Draggable item';\nexport const GRID_INTERNALS = '__rvgr';\nexport const ROW_FOCUSED_CLASS = 'focused-rgRow';\n"]}
|
|
@@ -5,7 +5,7 @@ import { C as _isIterateeCall, B as toInteger_1, a as getVisibleSourceItem, b as
|
|
|
5
5
|
import './toNumber-8de324a7.js';
|
|
6
6
|
import './index-a61f225b.js';
|
|
7
7
|
import { g as getRange } from './selection.helpers-50e9f09d.js';
|
|
8
|
-
import { G as GRID_INTERNALS, C as CELL_CLASS, D as DISABLED_CLASS } from './index-
|
|
8
|
+
import { G as GRID_INTERNALS, C as CELL_CLASS, D as DISABLED_CLASS } from './index-4e881436.js';
|
|
9
9
|
|
|
10
10
|
const GROUP_DEPTH = `${GRID_INTERNALS}-depth`;
|
|
11
11
|
const PSEUDO_GROUP_ITEM = `${GRID_INTERNALS}-name`;
|
|
@@ -539,4 +539,4 @@ function doPropMerge(existing, extra) {
|
|
|
539
539
|
|
|
540
540
|
export { CONTENT_SLOT as C, DATA_SLOT as D, FOOTER_SLOT as F, GROUP_EXPANDED as G, HEADER_SLOT as H, PSEUDO_GROUP_ITEM_VALUE as P, getParsedGroup as a, isSameGroup as b, GROUP_DEPTH as c, PSEUDO_GROUP_ITEM_ID as d, GROUPING_ROW_TYPE as e, PSEUDO_GROUP_COLUMN as f, getGroupingName as g, GROUP_EXPAND_EVENT as h, isGrouping as i, gatherGrouping as j, isGroupingColumn as k, getLastCell as l, doPropMerge as m, ColumnService as n, GROUP_EXPAND_BTN as o, PSEUDO_GROUP_ITEM as p, isRowDragService as q, getCellData as r };
|
|
541
541
|
|
|
542
|
-
//# sourceMappingURL=column.service-
|
|
542
|
+
//# sourceMappingURL=column.service-0e41057a.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"column.service-dce8aabc.js","mapp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W,CAAC,QAAmB,EAAE,KAAgB;IAC/D,IAAI,KAAK,mCAAmB,KAAK,GAAK,QAAQ,CAAE,CAAC;;IAEjD,IAAI,KAAK,CAAC,KAAK,EAAE;QACf,IAAI,OAAO,KAAK,CAAC,KAAK,KAAK,QAAQ,IAAI,OAAO,KAAK,CAAC,KAAK,KAAK,QAAQ,EAAE;YACtE,KAAK,CAAC,KAAK,mCAAQ,KAAK,CAAC,KAAK,GAAK,KAAK,CAAC,KAAK,CAAE,CAAC;SAClD;aAAM,IACL,OAAO,KAAK,CAAC,KAAK,KAAK,QAAQ;YAC/B,OAAO,KAAK,CAAC,KAAK,KAAK,QAAQ,EAC/B;YACA,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC;SACjC;aAAM,IAAI,OAAO,KAAK,CAAC,KAAK,KAAK,QAAQ,EAAE;YAC1C,KAAK,CAAC,KAAK,IAAI,GAAG,GAAG,KAAK,CAAC,KAAK,CAAC;SAClC;KACF;IACD,IAAI,KAAK,CAAC,KAAK,EAAE;QACf,KAAK,CAAC,KAAK,mCAAQ,KAAK,CAAC,KAAK,GAAK,KAAK,CAAC,KAAK,CAAE,CAAC;KAClD;IACD,OAAO,KAAK,CAAC;AACf;;;;","names":["baseSlice","require$$0","require$$1","require$$2","slice"],"sources":["src/plugins/groupingRow/grouping.const.ts","src/plugins/groupingRow/grouping.service.ts","src/components/revoGrid/viewport.helpers.ts","node_modules/lodash/_baseSlice.js","node_modules/lodash/slice.js","src/components/data/column.service.ts"],"sourcesContent":["import { GRID_INTERNALS } from '../../utils/consts';\n\nexport const GROUP_DEPTH = `${GRID_INTERNALS}-depth`;\nexport const PSEUDO_GROUP_ITEM = `${GRID_INTERNALS}-name`;\nexport const PSEUDO_GROUP_ITEM_ID = `${GRID_INTERNALS}-id`;\nexport const PSEUDO_GROUP_ITEM_VALUE = `${GRID_INTERNALS}-value`;\nexport const PSEUDO_GROUP_COLUMN = `${GRID_INTERNALS}-column`;\nexport const GROUP_EXPANDED = `${GRID_INTERNALS}-expanded`;\nexport const GROUP_ORIGINAL_INDEX = `${GRID_INTERNALS}-original-index`;\nexport const GROUP_EXPAND_BTN = `group-expand`;\nexport const GROUP_EXPAND_EVENT = `groupexpandclick`;\nexport const GROUPING_ROW_TYPE = 'rgRow';\n","import { DataType, ColumnProp, ColumnRegular } from '@type';\nimport {\n GROUP_DEPTH,\n GROUP_EXPANDED,\n PSEUDO_GROUP_COLUMN,\n PSEUDO_GROUP_ITEM,\n PSEUDO_GROUP_ITEM_ID,\n PSEUDO_GROUP_ITEM_VALUE,\n GROUP_ORIGINAL_INDEX,\n} from './grouping.const';\nimport { GroupLabelTemplateFunc } from './grouping.row.types';\n\nexport type ExpandedOptions = {\n prevExpanded?: Record<string, boolean>;\n expandedAll?: boolean; // skip trim\n\n getGroupValue?(item: DataType, prop: string | number): any;\n groupLabelTemplate?: GroupLabelTemplateFunc;\n};\n\ntype GroupedData = Map<string, GroupedData | DataType[]>;\n\nfunction getGroupValueDefault(item: DataType, prop: string | number) {\n return item[prop] || null;\n}\n\n\n/**\n * Gather data for grouping\n * @param array - flat data array\n * @param groupIds - ids of groups\n * @param expanded - potentially expanded items if present\n */\nexport function gatherGrouping(\n array: DataType[],\n groupIds: ColumnProp[],\n { prevExpanded, expandedAll, getGroupValue = getGroupValueDefault }: ExpandedOptions,\n) {\n const groupedItems: GroupedData = new Map();\n array.forEach((item, originalIndex) => {\n const groupLevelValues = groupIds.map(groupId => getGroupValue(item, groupId));\n const lastLevelValue = groupLevelValues.pop();\n let currentGroupLevel = groupedItems;\n groupLevelValues.forEach(value => {\n if (!currentGroupLevel.has(value)) {\n currentGroupLevel.set(value, new Map());\n }\n currentGroupLevel = currentGroupLevel.get(value) as GroupedData;\n });\n if (!currentGroupLevel.has(lastLevelValue)) {\n currentGroupLevel.set(lastLevelValue, []);\n }\n const lastLevelItems = currentGroupLevel.get(\n lastLevelValue,\n ) as DataType[];\n lastLevelItems.push({\n ...item,\n [GROUP_ORIGINAL_INDEX]: originalIndex,\n });\n });\n\n let itemIndex = -1;\n const groupingDepth = groupIds.length;\n // collapse all groups in the beginning\n const trimmed: Record<number, boolean> = {};\n // index mapping\n const oldNewIndexMap: Record<number, number> = {};\n // check if group header exists\n const pseudoGroupTest: Record<string, number[]> = {};\n const sourceWithGroups: DataType[] = [];\n function flattenGroupMaps(\n groupedValues: GroupedData,\n parentIds: string[],\n isExpanded: boolean,\n ) {\n const depth = parentIds.length;\n groupedValues.forEach((innerGroupedValues, groupId) => {\n const levelIds = [...parentIds, groupId];\n const mergedIds = levelIds.join(',');\n const isGroupExpanded =\n isExpanded && (!!expandedAll || !!prevExpanded?.[mergedIds]);\n sourceWithGroups.push({\n [PSEUDO_GROUP_ITEM]: groupId,\n [GROUP_DEPTH]: depth,\n [PSEUDO_GROUP_ITEM_ID]: JSON.stringify(levelIds),\n [PSEUDO_GROUP_ITEM_VALUE]: mergedIds,\n [GROUP_EXPANDED]: isGroupExpanded,\n });\n itemIndex += 1;\n if (!isGroupExpanded && depth) {\n trimmed[itemIndex] = true;\n }\n if (Array.isArray(innerGroupedValues)) {\n innerGroupedValues.forEach(value => {\n itemIndex += 1;\n if (!isGroupExpanded) {\n trimmed[itemIndex] = true;\n }\n oldNewIndexMap[value[GROUP_ORIGINAL_INDEX]] = itemIndex;\n const pseudoGroupTestIds = levelIds.map((_value, index) =>\n levelIds.slice(0, index + 1).join(','),\n );\n pseudoGroupTestIds.forEach(pseudoGroupTestId => {\n if (!pseudoGroupTest[pseudoGroupTestId]) {\n pseudoGroupTest[pseudoGroupTestId] = [];\n }\n pseudoGroupTest[pseudoGroupTestId].push(itemIndex);\n });\n });\n sourceWithGroups.push(...innerGroupedValues);\n } else {\n flattenGroupMaps(innerGroupedValues, levelIds, isGroupExpanded);\n }\n });\n }\n flattenGroupMaps(groupedItems, [], true);\n\n return {\n sourceWithGroups, // updates source mirror\n depth: groupingDepth, // largest depth for grouping\n trimmed, // used for expand/collapse grouping values\n oldNewIndexMap, // used for mapping old values to new\n childrenByGroup: pseudoGroupTest, // used to get child items in group\n };\n}\n\nexport function getGroupingName(rgRow?: DataType) {\n return rgRow && rgRow[PSEUDO_GROUP_ITEM];\n}\n\nexport function isGrouping(rgRow?: DataType) {\n return rgRow && typeof rgRow[PSEUDO_GROUP_ITEM] !== 'undefined';\n}\n\nexport function isGroupingColumn(column?: ColumnRegular) {\n return column && typeof column[PSEUDO_GROUP_COLUMN] !== 'undefined';\n}\n\nexport function measureEqualDepth<T>(groupA: T[], groupB: T[]) {\n const ln = groupA.length;\n let i = 0;\n for (; i < ln; i++) {\n if (groupA[i] !== groupB[i]) {\n return i;\n }\n }\n return i;\n}\n\nexport function getParsedGroup(id: string): any[] {\n const parseGroup = JSON.parse(id);\n // extra precaution and type safe guard\n if (!Array.isArray(parseGroup)) {\n return null;\n }\n return parseGroup;\n}\n\n// check if items is child of current clicked group\nexport function isSameGroup(\n currentGroup: any[],\n currentModel: DataType,\n nextModel: DataType,\n) {\n const nextGroup = getParsedGroup(nextModel[PSEUDO_GROUP_ITEM_ID]);\n if (!nextGroup) {\n return false;\n }\n\n const depth = measureEqualDepth(currentGroup, nextGroup);\n return currentModel[GROUP_DEPTH] < depth;\n}\n","/**\n * Collects data for pinned columns in the required @ViewportProps format.\n */\n\nimport { MultiDimensionType } from '@type';\nimport { Cell } from '@type';\nimport { ViewportColumn } from '@type';\n\n/**\n * Represents the slot names for the viewport slots.\n */\nexport const HEADER_SLOT = 'header'; // Slot name for the header slot\nexport const FOOTER_SLOT = 'footer'; // Slot name for the footer slot\nexport const CONTENT_SLOT = 'content'; // Slot name for the content slot\nexport const DATA_SLOT = 'data'; // Slot name for the data slot\n\n/**\n * Returns the last visible cell in the viewport for a given row type.\n * Coordinates are not zero-based and are relative to the viewport.\n * If needed to be zero-based they can be adjusted by subtracting 1.\n */\nexport function getLastCell(\n data: ViewportColumn,\n rowType: MultiDimensionType,\n): Cell {\n // Get the last visible column count from the viewport column data.\n const lastVisibleColumnCount = data.viewports[data.colType].store.get('realCount');\n\n // Get the last visible row count for the given row type from the viewport column data.\n const lastVisibleRowCount = data.viewports[rowType].store.get('realCount');\n\n // Return the last visible cell with the last visible column count and row count.\n return {\n x: lastVisibleColumnCount,\n y: lastVisibleRowCount,\n };\n}\n\n","/**\n * The base implementation of `_.slice` without an iteratee call guard.\n *\n * @private\n * @param {Array} array The array to slice.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the slice of `array`.\n */\nfunction baseSlice(array, start, end) {\n var index = -1,\n length = array.length;\n\n if (start < 0) {\n start = -start > length ? 0 : (length + start);\n }\n end = end > length ? length : end;\n if (end < 0) {\n end += length;\n }\n length = start > end ? 0 : ((end - start) >>> 0);\n start >>>= 0;\n\n var result = Array(length);\n while (++index < length) {\n result[index] = array[index + start];\n }\n return result;\n}\n\nmodule.exports = baseSlice;\n","var baseSlice = require('./_baseSlice'),\n isIterateeCall = require('./_isIterateeCall'),\n toInteger = require('./toInteger');\n\n/**\n * Creates a slice of `array` from `start` up to, but not including, `end`.\n *\n * **Note:** This method is used instead of\n * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are\n * returned.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to slice.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the slice of `array`.\n */\nfunction slice(array, start, end) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {\n start = 0;\n end = length;\n }\n else {\n start = start == null ? 0 : toInteger(start);\n end = end === undefined ? length : toInteger(end);\n }\n return baseSlice(array, start, end);\n}\n\nmodule.exports = slice;\n","import { DSourceState, getSourceItem, getVisibleSourceItem } from '@store';\nimport { CELL_CLASS, DISABLED_CLASS } from '../../utils/consts';\nimport { getRange } from '@store';\n\nimport { isGroupingColumn } from '../../plugins/groupingRow/grouping.service';\nimport slice from 'lodash/slice';\nimport {\n DimensionCols,\n DimensionRows,\n RowDrag,\n ColumnRegular,\n DataType,\n ReadOnlyFormat,\n CellProps,\n ColumnDataSchemaModel,\n ColumnProp,\n DataLookup,\n DataFormat,\n ChangedRange,\n OldNewRangeMapping,\n Cell,\n RangeArea,\n BeforeSaveDataDetails,\n EditorCtr,\n Editors,\n} from '@type';\nimport { Observable } from '../../utils/store.utils';\n\nexport type ColumnStores = {\n [T in DimensionCols]: Observable<DSourceState<ColumnRegular, DimensionCols>>;\n};\nexport type RowStores = {\n [T in DimensionRows]: Observable<DSourceState<DataType, DimensionRows>>;\n};\n\nexport default class ColumnService {\n private unsubscribe: { (): void }[] = [];\n get columns(): ColumnRegular[] {\n return getVisibleSourceItem(this.source);\n }\n\n hasGrouping = false;\n type: DimensionCols;\n\n constructor(\n private dataStore: Observable<DSourceState<DataType, DimensionRows>>,\n private source: Observable<DSourceState<ColumnRegular, DimensionCols>>,\n ) {\n this.unsubscribe.push(\n source.onChange('source', s => this.checkGrouping(s)),\n );\n this.checkGrouping(source.get('source'));\n this.type = source.get('type');\n }\n\n private checkGrouping(cols: ColumnRegular[]) {\n for (let rgCol of cols) {\n if (isGroupingColumn(rgCol)) {\n this.hasGrouping = true;\n return;\n }\n this.hasGrouping = false;\n }\n }\n\n isReadOnly(r: number, c: number): boolean {\n const readOnly: ReadOnlyFormat = this.columns[c]?.readonly;\n if (typeof readOnly === 'function') {\n const data = this.rowDataModel(r, c);\n return readOnly(data);\n }\n return readOnly;\n }\n\n mergeProperties(\n r: number,\n c: number,\n defaultProps: CellProps,\n model: ColumnDataSchemaModel,\n extraPropsFunc: ColumnRegular['cellProperties'],\n ): CellProps {\n const cellClass: { [key: string]: boolean } = {\n [CELL_CLASS]: true,\n [DISABLED_CLASS]: this.isReadOnly(r, c),\n };\n let props: CellProps = {\n ...defaultProps,\n class: cellClass,\n };\n const extra = extraPropsFunc?.(model);\n if (!extra) {\n return props;\n }\n return doPropMerge(props, extra);\n }\n\n getRowClass(r: number, prop: string): string {\n const model = getSourceItem(this.dataStore, r) || {};\n return model[prop] || '';\n }\n\n getCellData(r: number, c: number): string {\n const data = this.rowDataModel(r, c);\n return getCellData(data.model[data.prop as number]);\n }\n\n getSaveData(\n rowIndex: number,\n colIndex: number,\n val?: string,\n ): BeforeSaveDataDetails {\n if (typeof val === 'undefined') {\n val = this.getCellData(rowIndex, colIndex);\n }\n const data = this.rowDataModel(rowIndex, colIndex);\n return {\n prop: data.prop,\n rowIndex,\n colIndex,\n val,\n model: data.model,\n colType: this.type,\n type: this.dataStore.get('type'),\n };\n }\n\n getCellEditor(\n _r: number,\n c: number,\n editors: Editors,\n ): EditorCtr | undefined {\n const editor = this.columns[c]?.editor;\n if (!editor) {\n return undefined;\n }\n // reference\n if (typeof editor === 'string') {\n return editors[editor];\n }\n return editor;\n }\n\n /**\n * Get cell data model for given rowIndex and colIndex\n * Used to pass data to editor/renderer\n */\n rowDataModel(rowIndex: number, colIndex: number): ColumnDataSchemaModel {\n const column = this.columns[colIndex];\n const prop: ColumnProp | undefined = column?.prop;\n const model = getSourceItem(this.dataStore, rowIndex) || {};\n const value = model[prop];\n const type = this.dataStore.get('type');\n return {\n prop,\n model,\n data: this.dataStore.get('source'),\n column,\n rowIndex,\n colIndex,\n colType: this.type,\n type,\n value,\n };\n }\n\n getRangeData(\n d: ChangedRange,\n columns: ColumnRegular[],\n ): {\n changed: DataLookup;\n mapping: OldNewRangeMapping;\n } {\n const changed: DataLookup = {};\n\n // get original length sizes\n const copyColLength = d.oldRange.x1 - d.oldRange.x + 1;\n const copyRowLength = d.oldRange.y1 - d.oldRange.y + 1;\n const mapping: OldNewRangeMapping = {};\n\n // rows\n for (\n let rowIndex = d.newRange.y, i = 0;\n rowIndex < d.newRange.y1 + 1;\n rowIndex++, i++\n ) {\n // copy original data link\n const oldRowIndex = d.oldRange.y + (i % copyRowLength);\n const copyRow = getSourceItem(this.dataStore, oldRowIndex) || {};\n\n // columns\n for (\n let colIndex = d.newRange.x, j = 0;\n colIndex < d.newRange.x1 + 1;\n colIndex++, j++\n ) {\n // check if old range area\n if (\n rowIndex >= d.oldRange.y &&\n rowIndex <= d.oldRange.y1 &&\n colIndex >= d.oldRange.x &&\n colIndex <= d.oldRange.x1\n ) {\n continue;\n }\n\n // requested column beyond range\n if (!this.columns[colIndex]) {\n continue;\n }\n const prop = this.columns[colIndex]?.prop;\n const copyColIndex = d.oldRange.x + (j % copyColLength);\n const copyColumnProp = columns[copyColIndex].prop;\n\n /** if can write */\n if (!this.isReadOnly(rowIndex, colIndex)) {\n /** to show before save */\n if (!changed[rowIndex]) {\n changed[rowIndex] = {};\n }\n changed[rowIndex][prop] = copyRow[copyColumnProp];\n /** Generate mapping object */\n if (!mapping[rowIndex]) {\n mapping[rowIndex] = {};\n }\n mapping[rowIndex][prop] = {\n colIndex: copyColIndex,\n colProp: copyColumnProp,\n rowIndex: oldRowIndex,\n };\n }\n }\n }\n return {\n changed,\n mapping,\n };\n }\n\n getTransformedDataToApply(\n start: Cell,\n data: DataFormat[][],\n ): {\n changed: DataLookup;\n range: RangeArea;\n } {\n const changed: DataLookup = {};\n const copyRowLength = data.length;\n const colLength = this.columns.length;\n const rowLength = this.dataStore.get('items').length;\n // rows\n let rowIndex = start.y;\n let maxCol = 0;\n for (\n let i = 0;\n rowIndex < rowLength && i < copyRowLength;\n rowIndex++, i++\n ) {\n // copy original data link\n const copyRow = data[i % copyRowLength];\n const copyColLength = copyRow?.length || 0;\n // columns\n let colIndex = start.x;\n for (\n let j = 0;\n colIndex < colLength && j < copyColLength;\n colIndex++, j++\n ) {\n const p = this.columns[colIndex].prop;\n const currentCol = j % colLength;\n\n /** if can write */\n if (!this.isReadOnly(rowIndex, colIndex)) {\n /** to show before save */\n if (!changed[rowIndex]) {\n changed[rowIndex] = {};\n }\n changed[rowIndex][p] = copyRow[currentCol];\n }\n }\n maxCol = Math.max(maxCol, colIndex - 1);\n }\n const range = getRange(start, {\n y: rowIndex - 1,\n x: maxCol,\n });\n return {\n changed,\n range,\n };\n }\n\n getRangeStaticData(d: RangeArea, value: DataFormat): DataLookup {\n const changed: DataLookup = {};\n\n // rows\n for (let rowIndex = d.y, i = 0; rowIndex < d.y1 + 1; rowIndex++, i++) {\n // columns\n for (let colIndex = d.x, j = 0; colIndex < d.x1 + 1; colIndex++, j++) {\n // requested column beyond range\n if (!this.columns[colIndex]) {\n continue;\n }\n const p = this.columns[colIndex].prop;\n\n /** if can write */\n if (!this.isReadOnly(rowIndex, colIndex)) {\n /** to show before save */\n if (!changed[rowIndex]) {\n changed[rowIndex] = {};\n }\n changed[rowIndex][p] = value;\n }\n }\n }\n return changed;\n }\n\n getRangeTransformedToProps(\n d: RangeArea,\n store: Observable<DSourceState<DataType, DimensionRows>>,\n ) {\n const area: {\n prop: ColumnProp;\n rowIndex: number;\n colIndex: number;\n model: DataType;\n colType: DimensionCols;\n type: DimensionRows;\n }[] = [];\n\n const type = this.dataStore.get('type');\n // rows\n for (let rowIndex = d.y, i = 0; rowIndex < d.y1 + 1; rowIndex++, i++) {\n // columns\n for (let colIndex = d.x, j = 0; colIndex < d.x1 + 1; colIndex++, j++) {\n const prop = this.columns[colIndex]?.prop;\n area.push({\n prop,\n rowIndex,\n colIndex,\n model: getSourceItem(store, rowIndex),\n type,\n colType: this.type,\n });\n }\n }\n return area;\n }\n\n copyRangeArray(\n range: RangeArea,\n store: Observable<DSourceState<DataType, DimensionRows>>,\n ) {\n const cols = [...this.columns];\n const props = slice(cols, range.x, range.x1 + 1).map(v => v.prop);\n const toCopy: DataFormat[][] = [];\n const mapping: { [rowIndex: number]: { [colProp: ColumnProp]: any } } = {};\n\n // rows indexes\n for (let i = range.y; i <= range.y1; i++) {\n const rgRow: DataFormat[] = [];\n mapping[i] = {};\n\n // columns indexes\n for (let prop of props) {\n const item = getSourceItem(store, i);\n\n // if no item - skip\n if (!item) {\n continue;\n }\n const val = item[prop];\n rgRow.push(val);\n mapping[i][prop] = val;\n }\n\n toCopy.push(rgRow);\n }\n return {\n data: toCopy,\n mapping,\n };\n }\n\n destroy() {\n this.unsubscribe.forEach(f => f());\n }\n}\n\nexport function getCellData(val?: any) {\n if (typeof val === 'undefined' || val === null) {\n return '';\n }\n return val;\n}\n\n/**\n * Checks if the given rowDrag is a service for dragging rows.\n */\nexport function isRowDragService(\n rowDrag: RowDrag,\n model: ColumnDataSchemaModel,\n): boolean {\n if (typeof rowDrag === 'function') {\n return rowDrag(model);\n }\n return !!rowDrag;\n}\nexport function doPropMerge(existing: CellProps, extra: CellProps) {\n let props: CellProps = { ...extra, ...existing };\n // extend existing props\n if (extra.class) {\n if (typeof extra.class === 'object' && typeof props.class === 'object') {\n props.class = { ...extra.class, ...props.class };\n } else if (\n typeof extra.class === 'string' &&\n typeof props.class === 'object'\n ) {\n props.class[extra.class] = true;\n } else if (typeof props.class === 'string') {\n props.class += ' ' + extra.class;\n }\n }\n if (extra.style) {\n props.style = { ...extra.style, ...props.style };\n }\n return props;\n}\n"],"version":3}
|
|
1
|
+
{"file":"column.service-0e41057a.js","mappings":";;;;;;;;;MAEa,WAAW,GAAG,GAAG,cAAc,SAAS;MACxC,iBAAiB,GAAG,GAAG,cAAc,QAAQ;MAC7C,oBAAoB,GAAG,GAAG,cAAc,MAAM;MAC9C,uBAAuB,GAAG,GAAG,cAAc,SAAS;MACpD,mBAAmB,GAAG,GAAG,cAAc,UAAU;MACjD,cAAc,GAAG,GAAG,cAAc,YAAY;AACpD,MAAM,oBAAoB,GAAG,GAAG,cAAc,iBAAiB,CAAC;MAC1D,gBAAgB,GAAG,eAAe;MAClC,kBAAkB,GAAG,mBAAmB;MACxC,iBAAiB,GAAG;;ACWjC,SAAS,oBAAoB,CAAC,IAAc,EAAE,IAAqB;IACjE,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC;AAC5B,CAAC;AAGD;;;;;;SAMgB,cAAc,CAC5B,KAAiB,EACjB,QAAsB,EACtB,EAAE,YAAY,EAAE,WAAW,EAAE,aAA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AAG,GAAG,KAAK,CAAC,KAAK,CAAC;SAClC;KACF;IACD,IAAI,KAAK,CAAC,KAAK,EAAE;QACf,KAAK,CAAC,KAAK,mCAAQ,KAAK,CAAC,KAAK,GAAK,KAAK,CAAC,KAAK,CAAE,CAAC;KAClD;IACD,OAAO,KAAK,CAAC;AACf;;;;","names":["baseSlice","require$$0","require$$1","require$$2","slice"],"sources":["src/plugins/groupingRow/grouping.const.ts","src/plugins/groupingRow/grouping.service.ts","src/components/revoGrid/viewport.helpers.ts","node_modules/lodash/_baseSlice.js","node_modules/lodash/slice.js","src/components/data/column.service.ts"],"sourcesContent":["import { GRID_INTERNALS } from '../../utils/consts';\n\nexport const GROUP_DEPTH = `${GRID_INTERNALS}-depth`;\nexport const PSEUDO_GROUP_ITEM = `${GRID_INTERNALS}-name`;\nexport const PSEUDO_GROUP_ITEM_ID = `${GRID_INTERNALS}-id`;\nexport const PSEUDO_GROUP_ITEM_VALUE = `${GRID_INTERNALS}-value`;\nexport const PSEUDO_GROUP_COLUMN = `${GRID_INTERNALS}-column`;\nexport const GROUP_EXPANDED = `${GRID_INTERNALS}-expanded`;\nexport const GROUP_ORIGINAL_INDEX = `${GRID_INTERNALS}-original-index`;\nexport const GROUP_EXPAND_BTN = `group-expand`;\nexport const GROUP_EXPAND_EVENT = `groupexpandclick`;\nexport const GROUPING_ROW_TYPE = 'rgRow';\n","import { DataType, ColumnProp, ColumnRegular } from '@type';\nimport {\n GROUP_DEPTH,\n GROUP_EXPANDED,\n PSEUDO_GROUP_COLUMN,\n PSEUDO_GROUP_ITEM,\n PSEUDO_GROUP_ITEM_ID,\n PSEUDO_GROUP_ITEM_VALUE,\n GROUP_ORIGINAL_INDEX,\n} from './grouping.const';\nimport { GroupLabelTemplateFunc } from './grouping.row.types';\n\nexport type ExpandedOptions = {\n prevExpanded?: Record<string, boolean>;\n expandedAll?: boolean; // skip trim\n\n getGroupValue?(item: DataType, prop: string | number): any;\n groupLabelTemplate?: GroupLabelTemplateFunc;\n};\n\ntype GroupedData = Map<string, GroupedData | DataType[]>;\n\nfunction getGroupValueDefault(item: DataType, prop: string | number) {\n return item[prop] || null;\n}\n\n\n/**\n * Gather data for grouping\n * @param array - flat data array\n * @param groupIds - ids of groups\n * @param expanded - potentially expanded items if present\n */\nexport function gatherGrouping(\n array: DataType[],\n groupIds: ColumnProp[],\n { prevExpanded, expandedAll, getGroupValue = getGroupValueDefault }: ExpandedOptions,\n) {\n const groupedItems: GroupedData = new Map();\n array.forEach((item, originalIndex) => {\n const groupLevelValues = groupIds.map(groupId => getGroupValue(item, groupId));\n const lastLevelValue = groupLevelValues.pop();\n let currentGroupLevel = groupedItems;\n groupLevelValues.forEach(value => {\n if (!currentGroupLevel.has(value)) {\n currentGroupLevel.set(value, new Map());\n }\n currentGroupLevel = currentGroupLevel.get(value) as GroupedData;\n });\n if (!currentGroupLevel.has(lastLevelValue)) {\n currentGroupLevel.set(lastLevelValue, []);\n }\n const lastLevelItems = currentGroupLevel.get(\n lastLevelValue,\n ) as DataType[];\n lastLevelItems.push({\n ...item,\n [GROUP_ORIGINAL_INDEX]: originalIndex,\n });\n });\n\n let itemIndex = -1;\n const groupingDepth = groupIds.length;\n // collapse all groups in the beginning\n const trimmed: Record<number, boolean> = {};\n // index mapping\n const oldNewIndexMap: Record<number, number> = {};\n // check if group header exists\n const pseudoGroupTest: Record<string, number[]> = {};\n const sourceWithGroups: DataType[] = [];\n function flattenGroupMaps(\n groupedValues: GroupedData,\n parentIds: string[],\n isExpanded: boolean,\n ) {\n const depth = parentIds.length;\n groupedValues.forEach((innerGroupedValues, groupId) => {\n const levelIds = [...parentIds, groupId];\n const mergedIds = levelIds.join(',');\n const isGroupExpanded =\n isExpanded && (!!expandedAll || !!prevExpanded?.[mergedIds]);\n sourceWithGroups.push({\n [PSEUDO_GROUP_ITEM]: groupId,\n [GROUP_DEPTH]: depth,\n [PSEUDO_GROUP_ITEM_ID]: JSON.stringify(levelIds),\n [PSEUDO_GROUP_ITEM_VALUE]: mergedIds,\n [GROUP_EXPANDED]: isGroupExpanded,\n });\n itemIndex += 1;\n if (!isGroupExpanded && depth) {\n trimmed[itemIndex] = true;\n }\n if (Array.isArray(innerGroupedValues)) {\n innerGroupedValues.forEach(value => {\n itemIndex += 1;\n if (!isGroupExpanded) {\n trimmed[itemIndex] = true;\n }\n oldNewIndexMap[value[GROUP_ORIGINAL_INDEX]] = itemIndex;\n const pseudoGroupTestIds = levelIds.map((_value, index) =>\n levelIds.slice(0, index + 1).join(','),\n );\n pseudoGroupTestIds.forEach(pseudoGroupTestId => {\n if (!pseudoGroupTest[pseudoGroupTestId]) {\n pseudoGroupTest[pseudoGroupTestId] = [];\n }\n pseudoGroupTest[pseudoGroupTestId].push(itemIndex);\n });\n });\n sourceWithGroups.push(...innerGroupedValues);\n } else {\n flattenGroupMaps(innerGroupedValues, levelIds, isGroupExpanded);\n }\n });\n }\n flattenGroupMaps(groupedItems, [], true);\n\n return {\n sourceWithGroups, // updates source mirror\n depth: groupingDepth, // largest depth for grouping\n trimmed, // used for expand/collapse grouping values\n oldNewIndexMap, // used for mapping old values to new\n childrenByGroup: pseudoGroupTest, // used to get child items in group\n };\n}\n\nexport function getGroupingName(rgRow?: DataType) {\n return rgRow && rgRow[PSEUDO_GROUP_ITEM];\n}\n\nexport function isGrouping(rgRow?: DataType) {\n return rgRow && typeof rgRow[PSEUDO_GROUP_ITEM] !== 'undefined';\n}\n\nexport function isGroupingColumn(column?: ColumnRegular) {\n return column && typeof column[PSEUDO_GROUP_COLUMN] !== 'undefined';\n}\n\nexport function measureEqualDepth<T>(groupA: T[], groupB: T[]) {\n const ln = groupA.length;\n let i = 0;\n for (; i < ln; i++) {\n if (groupA[i] !== groupB[i]) {\n return i;\n }\n }\n return i;\n}\n\nexport function getParsedGroup(id: string): any[] {\n const parseGroup = JSON.parse(id);\n // extra precaution and type safe guard\n if (!Array.isArray(parseGroup)) {\n return null;\n }\n return parseGroup;\n}\n\n// check if items is child of current clicked group\nexport function isSameGroup(\n currentGroup: any[],\n currentModel: DataType,\n nextModel: DataType,\n) {\n const nextGroup = getParsedGroup(nextModel[PSEUDO_GROUP_ITEM_ID]);\n if (!nextGroup) {\n return false;\n }\n\n const depth = measureEqualDepth(currentGroup, nextGroup);\n return currentModel[GROUP_DEPTH] < depth;\n}\n","/**\n * Collects data for pinned columns in the required @ViewportProps format.\n */\n\nimport { MultiDimensionType } from '@type';\nimport { Cell } from '@type';\nimport { ViewportColumn } from '@type';\n\n/**\n * Represents the slot names for the viewport slots.\n */\nexport const HEADER_SLOT = 'header'; // Slot name for the header slot\nexport const FOOTER_SLOT = 'footer'; // Slot name for the footer slot\nexport const CONTENT_SLOT = 'content'; // Slot name for the content slot\nexport const DATA_SLOT = 'data'; // Slot name for the data slot\n\n/**\n * Returns the last visible cell in the viewport for a given row type.\n * Coordinates are not zero-based and are relative to the viewport.\n * If needed to be zero-based they can be adjusted by subtracting 1.\n */\nexport function getLastCell(\n data: ViewportColumn,\n rowType: MultiDimensionType,\n): Cell {\n // Get the last visible column count from the viewport column data.\n const lastVisibleColumnCount = data.viewports[data.colType].store.get('realCount');\n\n // Get the last visible row count for the given row type from the viewport column data.\n const lastVisibleRowCount = data.viewports[rowType].store.get('realCount');\n\n // Return the last visible cell with the last visible column count and row count.\n return {\n x: lastVisibleColumnCount,\n y: lastVisibleRowCount,\n };\n}\n\n","/**\n * The base implementation of `_.slice` without an iteratee call guard.\n *\n * @private\n * @param {Array} array The array to slice.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the slice of `array`.\n */\nfunction baseSlice(array, start, end) {\n var index = -1,\n length = array.length;\n\n if (start < 0) {\n start = -start > length ? 0 : (length + start);\n }\n end = end > length ? length : end;\n if (end < 0) {\n end += length;\n }\n length = start > end ? 0 : ((end - start) >>> 0);\n start >>>= 0;\n\n var result = Array(length);\n while (++index < length) {\n result[index] = array[index + start];\n }\n return result;\n}\n\nmodule.exports = baseSlice;\n","var baseSlice = require('./_baseSlice'),\n isIterateeCall = require('./_isIterateeCall'),\n toInteger = require('./toInteger');\n\n/**\n * Creates a slice of `array` from `start` up to, but not including, `end`.\n *\n * **Note:** This method is used instead of\n * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are\n * returned.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to slice.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the slice of `array`.\n */\nfunction slice(array, start, end) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {\n start = 0;\n end = length;\n }\n else {\n start = start == null ? 0 : toInteger(start);\n end = end === undefined ? length : toInteger(end);\n }\n return baseSlice(array, start, end);\n}\n\nmodule.exports = slice;\n","import { DSourceState, getSourceItem, getVisibleSourceItem } from '@store';\nimport { CELL_CLASS, DISABLED_CLASS } from '../../utils/consts';\nimport { getRange } from '@store';\n\nimport { isGroupingColumn } from '../../plugins/groupingRow/grouping.service';\nimport slice from 'lodash/slice';\nimport {\n DimensionCols,\n DimensionRows,\n RowDrag,\n ColumnRegular,\n DataType,\n ReadOnlyFormat,\n CellProps,\n ColumnDataSchemaModel,\n ColumnProp,\n DataLookup,\n DataFormat,\n ChangedRange,\n OldNewRangeMapping,\n Cell,\n RangeArea,\n BeforeSaveDataDetails,\n EditorCtr,\n Editors,\n} from '@type';\nimport { Observable } from '../../utils/store.utils';\n\nexport type ColumnStores = {\n [T in DimensionCols]: Observable<DSourceState<ColumnRegular, DimensionCols>>;\n};\nexport type RowStores = {\n [T in DimensionRows]: Observable<DSourceState<DataType, DimensionRows>>;\n};\n\nexport default class ColumnService {\n private unsubscribe: { (): void }[] = [];\n get columns(): ColumnRegular[] {\n return getVisibleSourceItem(this.source);\n }\n\n hasGrouping = false;\n type: DimensionCols;\n\n constructor(\n private dataStore: Observable<DSourceState<DataType, DimensionRows>>,\n private source: Observable<DSourceState<ColumnRegular, DimensionCols>>,\n ) {\n this.unsubscribe.push(\n source.onChange('source', s => this.checkGrouping(s)),\n );\n this.checkGrouping(source.get('source'));\n this.type = source.get('type');\n }\n\n private checkGrouping(cols: ColumnRegular[]) {\n for (let rgCol of cols) {\n if (isGroupingColumn(rgCol)) {\n this.hasGrouping = true;\n return;\n }\n this.hasGrouping = false;\n }\n }\n\n isReadOnly(r: number, c: number): boolean {\n const readOnly: ReadOnlyFormat = this.columns[c]?.readonly;\n if (typeof readOnly === 'function') {\n const data = this.rowDataModel(r, c);\n return readOnly(data);\n }\n return readOnly;\n }\n\n mergeProperties(\n r: number,\n c: number,\n defaultProps: CellProps,\n model: ColumnDataSchemaModel,\n extraPropsFunc: ColumnRegular['cellProperties'],\n ): CellProps {\n const cellClass: { [key: string]: boolean } = {\n [CELL_CLASS]: true,\n [DISABLED_CLASS]: this.isReadOnly(r, c),\n };\n let props: CellProps = {\n ...defaultProps,\n class: cellClass,\n };\n const extra = extraPropsFunc?.(model);\n if (!extra) {\n return props;\n }\n return doPropMerge(props, extra);\n }\n\n getRowClass(r: number, prop: string): string {\n const model = getSourceItem(this.dataStore, r) || {};\n return model[prop] || '';\n }\n\n getCellData(r: number, c: number): string {\n const data = this.rowDataModel(r, c);\n return getCellData(data.model[data.prop as number]);\n }\n\n getSaveData(\n rowIndex: number,\n colIndex: number,\n val?: string,\n ): BeforeSaveDataDetails {\n if (typeof val === 'undefined') {\n val = this.getCellData(rowIndex, colIndex);\n }\n const data = this.rowDataModel(rowIndex, colIndex);\n return {\n prop: data.prop,\n rowIndex,\n colIndex,\n val,\n model: data.model,\n colType: this.type,\n type: this.dataStore.get('type'),\n };\n }\n\n getCellEditor(\n _r: number,\n c: number,\n editors: Editors,\n ): EditorCtr | undefined {\n const editor = this.columns[c]?.editor;\n if (!editor) {\n return undefined;\n }\n // reference\n if (typeof editor === 'string') {\n return editors[editor];\n }\n return editor;\n }\n\n /**\n * Get cell data model for given rowIndex and colIndex\n * Used to pass data to editor/renderer\n */\n rowDataModel(rowIndex: number, colIndex: number): ColumnDataSchemaModel {\n const column = this.columns[colIndex];\n const prop: ColumnProp | undefined = column?.prop;\n const model = getSourceItem(this.dataStore, rowIndex) || {};\n const value = model[prop];\n const type = this.dataStore.get('type');\n return {\n prop,\n model,\n data: this.dataStore.get('source'),\n column,\n rowIndex,\n colIndex,\n colType: this.type,\n type,\n value,\n };\n }\n\n getRangeData(\n d: ChangedRange,\n columns: ColumnRegular[],\n ): {\n changed: DataLookup;\n mapping: OldNewRangeMapping;\n } {\n const changed: DataLookup = {};\n\n // get original length sizes\n const copyColLength = d.oldRange.x1 - d.oldRange.x + 1;\n const copyRowLength = d.oldRange.y1 - d.oldRange.y + 1;\n const mapping: OldNewRangeMapping = {};\n\n // rows\n for (\n let rowIndex = d.newRange.y, i = 0;\n rowIndex < d.newRange.y1 + 1;\n rowIndex++, i++\n ) {\n // copy original data link\n const oldRowIndex = d.oldRange.y + (i % copyRowLength);\n const copyRow = getSourceItem(this.dataStore, oldRowIndex) || {};\n\n // columns\n for (\n let colIndex = d.newRange.x, j = 0;\n colIndex < d.newRange.x1 + 1;\n colIndex++, j++\n ) {\n // check if old range area\n if (\n rowIndex >= d.oldRange.y &&\n rowIndex <= d.oldRange.y1 &&\n colIndex >= d.oldRange.x &&\n colIndex <= d.oldRange.x1\n ) {\n continue;\n }\n\n // requested column beyond range\n if (!this.columns[colIndex]) {\n continue;\n }\n const prop = this.columns[colIndex]?.prop;\n const copyColIndex = d.oldRange.x + (j % copyColLength);\n const copyColumnProp = columns[copyColIndex].prop;\n\n /** if can write */\n if (!this.isReadOnly(rowIndex, colIndex)) {\n /** to show before save */\n if (!changed[rowIndex]) {\n changed[rowIndex] = {};\n }\n changed[rowIndex][prop] = copyRow[copyColumnProp];\n /** Generate mapping object */\n if (!mapping[rowIndex]) {\n mapping[rowIndex] = {};\n }\n mapping[rowIndex][prop] = {\n colIndex: copyColIndex,\n colProp: copyColumnProp,\n rowIndex: oldRowIndex,\n };\n }\n }\n }\n return {\n changed,\n mapping,\n };\n }\n\n getTransformedDataToApply(\n start: Cell,\n data: DataFormat[][],\n ): {\n changed: DataLookup;\n range: RangeArea;\n } {\n const changed: DataLookup = {};\n const copyRowLength = data.length;\n const colLength = this.columns.length;\n const rowLength = this.dataStore.get('items').length;\n // rows\n let rowIndex = start.y;\n let maxCol = 0;\n for (\n let i = 0;\n rowIndex < rowLength && i < copyRowLength;\n rowIndex++, i++\n ) {\n // copy original data link\n const copyRow = data[i % copyRowLength];\n const copyColLength = copyRow?.length || 0;\n // columns\n let colIndex = start.x;\n for (\n let j = 0;\n colIndex < colLength && j < copyColLength;\n colIndex++, j++\n ) {\n const p = this.columns[colIndex].prop;\n const currentCol = j % colLength;\n\n /** if can write */\n if (!this.isReadOnly(rowIndex, colIndex)) {\n /** to show before save */\n if (!changed[rowIndex]) {\n changed[rowIndex] = {};\n }\n changed[rowIndex][p] = copyRow[currentCol];\n }\n }\n maxCol = Math.max(maxCol, colIndex - 1);\n }\n const range = getRange(start, {\n y: rowIndex - 1,\n x: maxCol,\n });\n return {\n changed,\n range,\n };\n }\n\n getRangeStaticData(d: RangeArea, value: DataFormat): DataLookup {\n const changed: DataLookup = {};\n\n // rows\n for (let rowIndex = d.y, i = 0; rowIndex < d.y1 + 1; rowIndex++, i++) {\n // columns\n for (let colIndex = d.x, j = 0; colIndex < d.x1 + 1; colIndex++, j++) {\n // requested column beyond range\n if (!this.columns[colIndex]) {\n continue;\n }\n const p = this.columns[colIndex].prop;\n\n /** if can write */\n if (!this.isReadOnly(rowIndex, colIndex)) {\n /** to show before save */\n if (!changed[rowIndex]) {\n changed[rowIndex] = {};\n }\n changed[rowIndex][p] = value;\n }\n }\n }\n return changed;\n }\n\n getRangeTransformedToProps(\n d: RangeArea,\n store: Observable<DSourceState<DataType, DimensionRows>>,\n ) {\n const area: {\n prop: ColumnProp;\n rowIndex: number;\n colIndex: number;\n model: DataType;\n colType: DimensionCols;\n type: DimensionRows;\n }[] = [];\n\n const type = this.dataStore.get('type');\n // rows\n for (let rowIndex = d.y, i = 0; rowIndex < d.y1 + 1; rowIndex++, i++) {\n // columns\n for (let colIndex = d.x, j = 0; colIndex < d.x1 + 1; colIndex++, j++) {\n const prop = this.columns[colIndex]?.prop;\n area.push({\n prop,\n rowIndex,\n colIndex,\n model: getSourceItem(store, rowIndex),\n type,\n colType: this.type,\n });\n }\n }\n return area;\n }\n\n copyRangeArray(\n range: RangeArea,\n store: Observable<DSourceState<DataType, DimensionRows>>,\n ) {\n const cols = [...this.columns];\n const props = slice(cols, range.x, range.x1 + 1).map(v => v.prop);\n const toCopy: DataFormat[][] = [];\n const mapping: { [rowIndex: number]: { [colProp: ColumnProp]: any } } = {};\n\n // rows indexes\n for (let i = range.y; i <= range.y1; i++) {\n const rgRow: DataFormat[] = [];\n mapping[i] = {};\n\n // columns indexes\n for (let prop of props) {\n const item = getSourceItem(store, i);\n\n // if no item - skip\n if (!item) {\n continue;\n }\n const val = item[prop];\n rgRow.push(val);\n mapping[i][prop] = val;\n }\n\n toCopy.push(rgRow);\n }\n return {\n data: toCopy,\n mapping,\n };\n }\n\n destroy() {\n this.unsubscribe.forEach(f => f());\n }\n}\n\nexport function getCellData(val?: any) {\n if (typeof val === 'undefined' || val === null) {\n return '';\n }\n return val;\n}\n\n/**\n * Checks if the given rowDrag is a service for dragging rows.\n */\nexport function isRowDragService(\n rowDrag: RowDrag,\n model: ColumnDataSchemaModel,\n): boolean {\n if (typeof rowDrag === 'function') {\n return rowDrag(model);\n }\n return !!rowDrag;\n}\nexport function doPropMerge(existing: CellProps, extra: CellProps) {\n let props: CellProps = { ...extra, ...existing };\n // extend existing props\n if (extra.class) {\n if (typeof extra.class === 'object' && typeof props.class === 'object') {\n props.class = { ...extra.class, ...props.class };\n } else if (\n typeof extra.class === 'string' &&\n typeof props.class === 'object'\n ) {\n props.class[extra.class] = true;\n } else if (typeof props.class === 'string') {\n props.class += ' ' + extra.class;\n }\n }\n if (extra.style) {\n props.style = { ...extra.style, ...props.style };\n }\n return props;\n}\n"],"version":3}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { h } from './index-a61f225b.js';
|
|
5
5
|
import { d as dispatch } from './dispatcher-ea08404f.js';
|
|
6
|
-
import { m as doPropMerge } from './column.service-
|
|
6
|
+
import { m as doPropMerge } from './column.service-0e41057a.js';
|
|
7
7
|
|
|
8
8
|
var ResizeEvents;
|
|
9
9
|
(function (ResizeEvents) {
|
|
@@ -298,4 +298,4 @@ const HeaderCellRenderer = ({ data, props, additionalData }, children) => {
|
|
|
298
298
|
|
|
299
299
|
export { HeaderCellRenderer as H, ON_COLUMN_CLICK as O };
|
|
300
300
|
|
|
301
|
-
//# sourceMappingURL=header-cell-renderer-
|
|
301
|
+
//# sourceMappingURL=header-cell-renderer-6d8ac25d.js.map
|
package/dist/esm/{header-cell-renderer-171a011c.js.map → header-cell-renderer-6d8ac25d.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"header-cell-renderer-171a011c.js","mappings":";;;;;;;AAsBA,IAAY,YAIX;AAJD,WAAY,YAAY;IACtB,sCAAsB,CAAA;IACtB,oCAAoB,CAAA;IACpB,kCAAkB,CAAA;AACpB,CAAC,EAJW,YAAY,KAAZ,YAAY,QAIvB;AAED,MAAM,WAAW,GAA2B;IAC1C,aAAa,EAAE,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE;IACnD,cAAc,EAAE,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE;IACpD,aAAa,EAAE,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE;IAClD,cAAc,EAAE,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE;IACpD,aAAa,EAAE,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE;IAClD,cAAc,EAAE,EAAE,GAAG,EAAE,MAAM,EAA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,EAAC,gBAAgB,IAAE,WAAW,CAAO;QAC9C,QAAQ,CACQ,EACnB;AACJ;;;;","names":[],"sources":["src/components/header/resizable.directive.tsx","src/components/header/resizable.element.tsx","src/components/header/header-cell-renderer.tsx"],"sourcesContent":["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 onDoubleClick?(originalEvent: MouseEvent): 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 | null;\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;\n this.maxH = this.props.maxHeight;\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;\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;\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 = null;\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 { h, VNode } from '@stencil/core';\nimport { ResizeProps, ResizeDirective, ResizeEvents } from './resizable.directive';\nimport type { CellProps } from '@type';\n\nexport const ResizableElement = (props: Partial<ResizeProps> & CellProps, children: VNode[]) => {\n const resizeEls: VNode[] = [];\n const directive =\n (props.canResize &&\n new ResizeDirective(props, e => {\n if (e.eventName === ResizeEvents.end) {\n props.onResize && props.onResize(e);\n }\n })) ||\n null;\n if (props.canResize) {\n if (props.active) {\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.onDoubleClick?.(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 }\n } else {\n if (props.active) {\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.onDoubleClick?.(e);\n }}\n class={`no-resize resizable resizable-${props.active[p]}`}\n />,\n );\n }\n }\n }\n return (\n <div {...props} ref={(e: HTMLElement) => directive?.set(e)}>\n {children}\n {resizeEls}\n </div>\n );\n};\n","import { h, VNode } from '@stencil/core';\nimport { dispatch } from '../../plugins/dispatcher';\nimport { doPropMerge } from '../data/column.service';\nimport { ResizableElement } from './resizable.element';\nimport { ResizeProps } from './resizable.directive';\nimport { CellProps, ColumnTemplateProp } from '@type';\n\ntype Props = {\n props: CellProps & Partial<ResizeProps>;\n additionalData: any;\n data?: ColumnTemplateProp;\n};\n\nexport const ON_COLUMN_CLICK = 'columnclick';\n\nexport const HeaderCellRenderer = ({ data, props, additionalData }: Props, children: VNode[]): VNode => {\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 && typeof extra === 'object') {\n cellProps = doPropMerge(props, extra);\n }\n }\n return (\n <ResizableElement {...cellProps} onMouseDown={(e: MouseEvent) => {\n dispatch(e.currentTarget as HTMLElement, ON_COLUMN_CLICK, {\n data,\n event: e,\n });\n }}>\n <div class=\"header-content\">{colTemplate}</div>\n {children}\n </ResizableElement>\n );\n};\n"],"version":3}
|
|
1
|
+
{"file":"header-cell-renderer-6d8ac25d.js","mappings":";;;;;;;AAsBA,IAAY,YAIX;AAJD,WAAY,YAAY;IACtB,sCAAsB,CAAA;IACtB,oCAAoB,CAAA;IACpB,kCAAkB,CAAA;AACpB,CAAC,EAJW,YAAY,KAAZ,YAAY,QAIvB;AAED,MAAM,WAAW,GAA2B;IAC1C,aAAa,EAAE,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE;IACnD,cAAc,EAAE,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE;IACpD,aAAa,EAAE,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE;IAClD,cAAc,EAAE,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE;IACpD,aAAa,EAAE,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE;IAClD,cAAc,EAAE,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE;IACpD,aAAa,EAA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AAQ,CACQ,EACnB;AACJ;;;;","names":[],"sources":["src/components/header/resizable.directive.tsx","src/components/header/resizable.element.tsx","src/components/header/header-cell-renderer.tsx"],"sourcesContent":["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 onDoubleClick?(originalEvent: MouseEvent): 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 | null;\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;\n this.maxH = this.props.maxHeight;\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;\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;\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 = null;\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 { h, VNode } from '@stencil/core';\nimport { ResizeProps, ResizeDirective, ResizeEvents } from './resizable.directive';\nimport type { CellProps } from '@type';\n\nexport const ResizableElement = (props: Partial<ResizeProps> & CellProps, children: VNode[]) => {\n const resizeEls: VNode[] = [];\n const directive =\n (props.canResize &&\n new ResizeDirective(props, e => {\n if (e.eventName === ResizeEvents.end) {\n props.onResize && props.onResize(e);\n }\n })) ||\n null;\n if (props.canResize) {\n if (props.active) {\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.onDoubleClick?.(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 }\n } else {\n if (props.active) {\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.onDoubleClick?.(e);\n }}\n class={`no-resize resizable resizable-${props.active[p]}`}\n />,\n );\n }\n }\n }\n return (\n <div {...props} ref={(e: HTMLElement) => directive?.set(e)}>\n {children}\n {resizeEls}\n </div>\n );\n};\n","import { h, VNode } from '@stencil/core';\nimport { dispatch } from '../../plugins/dispatcher';\nimport { doPropMerge } from '../data/column.service';\nimport { ResizableElement } from './resizable.element';\nimport { ResizeProps } from './resizable.directive';\nimport { CellProps, ColumnTemplateProp } from '@type';\n\ntype Props = {\n props: CellProps & Partial<ResizeProps>;\n additionalData: any;\n data?: ColumnTemplateProp;\n};\n\nexport const ON_COLUMN_CLICK = 'columnclick';\n\nexport const HeaderCellRenderer = ({ data, props, additionalData }: Props, children: VNode[]): VNode => {\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 && typeof extra === 'object') {\n cellProps = doPropMerge(props, extra);\n }\n }\n return (\n <ResizableElement {...cellProps} onMouseDown={(e: MouseEvent) => {\n dispatch(e.currentTarget as HTMLElement, ON_COLUMN_CLICK, {\n data,\n event: e,\n });\n }}>\n <div class=\"header-content\">{colTemplate}</div>\n {children}\n </ResizableElement>\n );\n};\n"],"version":3}
|