@visactor/vtable-plugins 1.22.7-alpha.3 → 1.22.7-alpha.4
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/cjs/filter/condition-filter.d.ts +2 -12
- package/cjs/filter/condition-filter.js +144 -38
- package/cjs/filter/condition-filter.js.map +1 -1
- package/cjs/filter/filter-toolbar.d.ts +4 -8
- package/cjs/filter/filter-toolbar.js +30 -45
- package/cjs/filter/filter-toolbar.js.map +1 -1
- package/cjs/filter/filter.d.ts +0 -2
- package/cjs/filter/filter.js +15 -31
- package/cjs/filter/filter.js.map +1 -1
- package/cjs/filter/types.d.ts +0 -34
- package/cjs/filter/types.js.map +1 -1
- package/cjs/filter/value-filter.d.ts +2 -12
- package/cjs/filter/value-filter.js +39 -91
- package/cjs/filter/value-filter.js.map +1 -1
- package/cjs/focus-highlight.js +1 -1
- package/cjs/focus-highlight.js.map +1 -1
- package/cjs/master-detail-plugin/checkbox.js +1 -0
- package/cjs/master-detail-plugin/config.js +1 -2
- package/cjs/master-detail-plugin/utils.js +1 -1
- package/dist/vtable-plugins.js +138 -9772
- package/dist/vtable-plugins.min.js +3 -3
- package/es/filter/condition-filter.d.ts +2 -12
- package/es/filter/condition-filter.js +140 -36
- package/es/filter/condition-filter.js.map +1 -1
- package/es/filter/filter-toolbar.d.ts +4 -8
- package/es/filter/filter-toolbar.js +27 -46
- package/es/filter/filter-toolbar.js.map +1 -1
- package/es/filter/filter.d.ts +0 -2
- package/es/filter/filter.js +16 -38
- package/es/filter/filter.js.map +1 -1
- package/es/filter/types.d.ts +0 -34
- package/es/filter/types.js.map +1 -1
- package/es/filter/value-filter.d.ts +2 -12
- package/es/filter/value-filter.js +36 -89
- package/es/filter/value-filter.js.map +1 -1
- package/es/focus-highlight.js +1 -1
- package/es/focus-highlight.js.map +1 -1
- package/es/master-detail-plugin/checkbox.js +2 -1
- package/es/master-detail-plugin/config.js +1 -2
- package/es/master-detail-plugin/utils.js +1 -1
- package/package.json +9 -9
- package/cjs/filter/constant.d.ts +0 -7
- package/cjs/filter/constant.js +0 -124
- package/cjs/filter/constant.js.map +0 -1
- package/es/filter/constant.d.ts +0 -7
- package/es/filter/constant.js +0 -120
- package/es/filter/constant.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/filter/value-filter.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAEvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAE3C,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAEvC,MAAM,OAAO,WAAW;IA0BtB,YAAY,KAA6B,EAAE,kBAAsC,EAAE,aAA4B;QApBvG,iBAAY,GAAG,IAAI,GAAG,EAAyC,CAAC;QAChE,kBAAa,GAAG,IAAI,GAAG,EAAiD,CAAC;QACzE,kBAAa,GAAG,IAAI,GAAG,EAAqD,CAAC;QAC7E,uBAAkB,GAAG,IAAI,GAAG,EAAuC,CAAC;QAEpE,0BAAqB,GAAiD,IAAI,GAAG,EAAE,CAAC;QAgBtF,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,kBAAkB,GAAG,kBAAkB,CAAC;QAC7C,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;QACnC,IAAI,CAAC,MAAM,GAAG,aAAa,CAAC,MAAM,IAAI,EAAE,CAAC;IAC3C,CAAC;IAED,gBAAgB,CAAC,OAAwB;QACvC,IAAI,CAAC,aAAa,GAAG,OAAO,CAAC;IAC/B,CAAC;IAEO,gBAAgB,CAAC,OAAwB;QAC/C,IAAI,QAAQ,GAAG,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QAC/C,IAAI,QAAQ,KAAK,IAAI,IAAI,QAAQ,KAAK,SAAS,EAAE;YAC/C,OAAO,QAAQ,CAAC;SACjB;QAED,MAAM,aAAa,GAAG,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,IAAI,CAAC,cAAsB,GAAG,SAAS,CAAC;QACxC,IAAI,CAAC,oBAA4B,GAAG,SAAS,CAAC;IACjD,CAAC;CACF","file":"value-filter.js","sourcesContent":["import type { ListTable, PivotTable } from '@visactor/vtable';\nimport { arrayEqual, isValid } from '@visactor/vutils';\nimport type { ValueFilterOptionDom, FilterState, FilterOptions, FilterStyles } from './types';\nimport { FilterActionType } from './types';\nimport type { FilterStateManager } from './filter-state-manager';\nimport { applyStyles } from './styles';\n\nexport class ValueFilter {\n private table: ListTable | PivotTable;\n private filterStateManager: FilterStateManager;\n private pluginOptions: FilterOptions;\n private styles: Record<any, any>;\n private selectedField: string | number;\n private selectedKeys = new Map<string | number, Set<string | number>>(); // 存储 format 之前的原始数据\n private candidateKeys = new Map<string | number, Map<string | number, number>>(); // 存储 format 后的数据\n private formatFnCache = new Map<string | number, (record: any) => string | number>();\n private toUnformattedCache = new Map<string | number, Map<any, Set<any>>>();\n\n private valueFilterOptionList: Map<string | number, ValueFilterOptionDom[]> = new Map();\n\n private filterByValuePanel: HTMLElement;\n private searchContainer: HTMLElement;\n private optionsContainer: HTMLElement;\n private selectAllItemDiv: HTMLElement;\n private selectAllLabel: HTMLElement;\n private filterByValueSearchInput: HTMLInputElement;\n private selectAllCheckbox: HTMLInputElement;\n private totalCountSpan: HTMLSpanElement;\n private filterItemsContainer: HTMLElement;\n\n private _onInputKeyUpHandler: (event: KeyboardEvent) => void;\n private _onCheckboxChangeHandler: (event: Event) => void;\n\n constructor(table: ListTable | PivotTable, filterStateManager: FilterStateManager, pluginOptions: FilterOptions) {\n this.table = table;\n this.filterStateManager = filterStateManager;\n this.pluginOptions = pluginOptions;\n this.styles = pluginOptions.styles || {};\n }\n\n setSelectedField(fieldId: string | number): void {\n this.selectedField = fieldId;\n }\n\n private getFormatFnCache(fieldId: string | number) {\n let formatFn = this.formatFnCache.get(fieldId);\n if (formatFn !== null && formatFn !== undefined) {\n return formatFn;\n }\n\n const headerAddress = this.table.internalProps.layoutMap.getHeaderCellAddressByField(String(fieldId));\n const bodyInfo = this.table.internalProps.layoutMap.getBody(headerAddress?.col, headerAddress?.row);\n if (bodyInfo && 'fieldFormat' in bodyInfo && typeof bodyInfo.fieldFormat === 'function') {\n formatFn = bodyInfo.fieldFormat;\n } else if (bodyInfo && 'format' in bodyInfo && typeof bodyInfo.format === 'function') {\n formatFn = bodyInfo.format;\n } else {\n formatFn = (record: any) => record[fieldId];\n }\n\n this.formatFnCache.set(fieldId, formatFn);\n return formatFn;\n }\n\n /**\n * 为未应用筛选的列,收集候选值集合\n */\n private collectCandidateKeysForUnfilteredColumn(fieldId: string | number): void {\n const syncCheckboxCheckedState = this.pluginOptions?.syncCheckboxCheckedState ?? true;\n const countMap = new Map<any, number>(); // 计算每个候选值的计数\n let records = [];\n // 如果各个筛选器之间不联动, 则永远从原数据中获取候选值\n if (!syncCheckboxCheckedState) {\n records = this.table.internalProps.records;\n } else {\n records = this.table.internalProps.dataSource.records; // 未筛选:使用当前表格数据\n }\n const formatFn = this.getFormatFnCache(fieldId);\n const toUnformatted = new Map();\n\n records.forEach(record => {\n // 空行不做处理\n if (isValid(record)) {\n const originalValue = record[fieldId];\n const formattedValue = formatFn(record);\n if (formattedValue !== undefined && formattedValue !== null) {\n countMap.set(formattedValue, (countMap.get(formattedValue) || 0) + 1);\n\n const unformattedSet = toUnformatted.get(formattedValue);\n if (unformattedSet !== undefined && unformattedSet !== null) {\n unformattedSet.add(originalValue);\n } else {\n toUnformatted.set(formattedValue, new Set([originalValue]));\n }\n }\n }\n });\n\n this.candidateKeys.set(fieldId, countMap);\n this.toUnformattedCache.set(fieldId, toUnformatted);\n }\n\n updateBeforeFilter() {\n // 处于值筛选状态, 表格更新时:\n // 可能会插入新数据, 此时需要更新筛选结果和候选值:\n // 1. 更新筛选结果\n // - 出现了之前没有出现过的选项\n // - 筛选器出于被筛选状态(有值)\n // - 则将该选项添加到筛选器中\n // 2. 更新候选值\n const currentRecords = this.table.internalProps.dataSource.records; // 此时还没做筛选, 当前数据 = 原始表格数据\n const filteredFields = this.filterStateManager.getActiveFilterFields();\n currentRecords.forEach(record => {\n filteredFields.forEach(candidateField => {\n const formatFn = this.getFormatFnCache(candidateField);\n\n // 空行不做处理\n if (isValid(record)) {\n const originalValue = record[candidateField];\n const formattedValue = formatFn(record);\n const lastToUnformatted = this.toUnformattedCache.get(candidateField) || new Map();\n if (\n !lastToUnformatted.has(formattedValue) &&\n this.filterStateManager.getFilterState(candidateField)?.values?.length > 0\n ) {\n this.filterStateManager.getFilterState(candidateField).values.push(originalValue);\n this.selectedKeys.get(candidateField).add(originalValue);\n }\n }\n });\n });\n }\n\n updateAfterFilter() {\n // 处于条件筛选状态, 表格更新时:\n // 值筛选面板需要同步筛选结果\n const currentRecords = this.table.internalProps.dataSource.records; // 此时还没做筛选, 当前数据 = 原始表格数据\n const filteredFields = this.filterStateManager.getActiveFilterFields();\n currentRecords.forEach(record => {\n filteredFields.forEach(candidateField => {\n // 空行不做处理\n if (isValid(record)) {\n const originalValue = record[candidateField];\n if (this.filterStateManager.getFilterState(candidateField)?.type === 'byCondition') {\n if (!this.selectedKeys.get(candidateField)) {\n this.selectedKeys.set(candidateField, new Set());\n }\n this.selectedKeys.get(candidateField).add(originalValue);\n }\n }\n });\n });\n }\n\n /**\n * 为已应用筛选的列,收集候选值集合\n */\n private collectCandidateKeysForFilteredColumn(candidateField: string | number): void {\n const syncCheckboxCheckedState = this.pluginOptions?.syncCheckboxCheckedState ?? true;\n const filteredFields = this.filterStateManager.getActiveFilterFields().filter(field => field !== candidateField);\n const toUnformatted = new Map();\n const formatFn = this.getFormatFnCache(candidateField);\n\n const countMap = new Map<any, number>(); // 计算每个候选值的计数\n let records = [];\n // 如果各个筛选器之间不联动, 则永远从原数据中获取候选值\n if (!syncCheckboxCheckedState) {\n records = this.table.internalProps.records;\n } else {\n const recordsList = this.table.internalProps.records; // 已筛选:使用原始表格数据\n records = recordsList.filter(record =>\n filteredFields.every(field => {\n const set = this.selectedKeys.get(field);\n return set.has(record[field]);\n })\n );\n }\n\n records.forEach(record => {\n // 空行不做处理\n if (isValid(record)) {\n const originalValue = record[candidateField];\n const formattedValue = formatFn(record);\n countMap.set(formattedValue, (countMap.get(formattedValue) || 0) + 1);\n if (formattedValue !== undefined && formattedValue !== null) {\n const unformattedSet = toUnformatted.get(formattedValue);\n if (unformattedSet !== undefined && unformattedSet !== null) {\n unformattedSet.add(originalValue);\n } else {\n toUnformatted.set(formattedValue, new Set([originalValue]));\n }\n }\n }\n });\n\n this.candidateKeys.set(candidateField, countMap);\n this.toUnformattedCache.set(candidateField, toUnformatted);\n }\n\n private toggleSelectAll(fieldId: string | number, selected: boolean): void {\n const options = this.valueFilterOptionList.get(fieldId);\n options.forEach(option => {\n option.checkbox.checked = selected;\n });\n }\n\n private syncSelectAllCheckbox(fieldId: string | number): void {\n const options = this.valueFilterOptionList.get(fieldId) || [];\n const allChecked = options.every(o => o.checkbox.checked);\n const noneChecked = options.every(o => !o.checkbox.checked);\n\n this.selectAllCheckbox.checked = allChecked;\n this.selectAllCheckbox.indeterminate = !allChecked && !noneChecked;\n }\n\n private onSearch(fieldId: string | number, value: string): void {\n // 更新UI显示\n const items = this.valueFilterOptionList.get(fieldId);\n const filterKeywords = value\n .toUpperCase()\n .split(' ')\n .filter(s => s);\n\n for (const item of items) {\n const txtValue = item.id.toUpperCase() || '';\n const match = filterKeywords.some(keyword => txtValue.includes(keyword));\n const isVisible = filterKeywords.length === 0 || match;\n\n item.itemContainer.style.display = isVisible ? 'flex' : 'none';\n }\n }\n\n /**\n * 根据当前表格中的数据,更新 filter 的被选状态\n */\n private initFilterStateFromTableData(fieldId: string | number): void {\n const isHasFilteredState = this.filterStateManager.getActiveFilterFields();\n if (isHasFilteredState) {\n return;\n }\n\n const selectedValues = new Set<any>();\n const originalValues = new Set<any>();\n\n const currentRecords = this.table.internalProps.dataSource.records; // 当前数据\n currentRecords.forEach(record => {\n // 空行不做处理\n if (isValid(record)) {\n selectedValues.add(record[fieldId]);\n }\n });\n\n const originalRecords = this.table.internalProps.records; // 原始数据\n originalRecords.forEach(record => {\n // 空行不做处理\n if (isValid(record)) {\n originalValues.add(record[fieldId]);\n }\n });\n\n const hasFiltered = !arrayEqual(Array.from(originalValues), Array.from(selectedValues));\n if (hasFiltered) {\n this.selectedKeys.set(fieldId, selectedValues);\n\n this.filterStateManager.dispatch({\n type: FilterActionType.ADD_FILTER,\n payload: {\n field: fieldId,\n type: 'byValue',\n values: Array.from(selectedValues),\n enable: true\n }\n });\n }\n }\n\n applyFilter(fieldId: string | number = this.selectedField): void {\n const options = this.valueFilterOptionList.get(fieldId);\n if (!options || options.length === 0) {\n return;\n }\n\n const selections = options\n .map(option => {\n if (option.checkbox.checked) {\n return option.originalValue;\n }\n return null;\n })\n .filter(key => key !== null)\n .flat();\n\n this.selectedKeys.set(fieldId, new Set(selections));\n\n if (selections.length >= 0 && selections.length < this.valueFilterOptionList.get(fieldId).length) {\n this.filterStateManager.dispatch({\n type: FilterActionType.APPLY_FILTERS,\n payload: {\n field: fieldId,\n type: 'byValue',\n values: selections,\n enable: true\n }\n });\n } else {\n this.filterStateManager.dispatch({\n type: FilterActionType.REMOVE_FILTER,\n payload: {\n field: fieldId\n }\n });\n }\n }\n\n clearFilter(fieldId: string | number): void {\n this.filterStateManager.dispatch({\n type: FilterActionType.REMOVE_FILTER,\n payload: {\n field: fieldId\n }\n });\n\n this.hide();\n }\n\n render(container: HTMLElement): void {\n const filterStyles = this.styles;\n // === 按值筛选的菜单内容 ===\n this.filterByValuePanel = document.createElement('div');\n applyStyles(this.filterByValuePanel, filterStyles.filterPanel);\n\n // -- 搜索栏 ---\n this.searchContainer = document.createElement('div');\n applyStyles(this.searchContainer, this.styles.searchContainer);\n\n this.filterByValueSearchInput = document.createElement('input');\n this.filterByValueSearchInput.type = 'text';\n this.filterByValueSearchInput.placeholder = filterStyles.searchInput?.placeholder || '可使用空格分隔多个关键词';\n applyStyles(this.filterByValueSearchInput, filterStyles.searchInput);\n\n this.searchContainer.appendChild(this.filterByValueSearchInput);\n\n // --- 筛选选项 ---\n this.optionsContainer = document.createElement('div');\n applyStyles(this.optionsContainer, this.styles.optionsContainer);\n\n this.selectAllItemDiv = document.createElement('div');\n applyStyles(this.selectAllItemDiv, this.styles.optionItem);\n\n this.selectAllLabel = document.createElement('label');\n applyStyles(this.selectAllLabel, this.styles.optionLabel);\n\n this.selectAllCheckbox = document.createElement('input');\n this.selectAllCheckbox.type = 'checkbox';\n this.selectAllCheckbox.checked = true; // 默认全选\n applyStyles(this.selectAllCheckbox, filterStyles.checkbox);\n\n this.totalCountSpan = document.createElement('span');\n this.totalCountSpan.textContent = '';\n applyStyles(this.totalCountSpan, filterStyles.countSpan);\n\n this.selectAllLabel.append(this.selectAllCheckbox, ' 全选');\n this.selectAllItemDiv.appendChild(this.selectAllLabel);\n\n this.filterItemsContainer = document.createElement('div'); // 筛选条目的容器,后续应动态 appendChild\n\n this.optionsContainer.append(this.selectAllItemDiv, this.filterItemsContainer);\n this.filterByValuePanel.append(this.searchContainer, this.optionsContainer);\n\n container.appendChild(this.filterByValuePanel);\n\n this.bindEventForFilterByValue();\n }\n\n updateStyles(styles: FilterStyles): void {\n applyStyles(this.filterByValuePanel, styles.filterPanel);\n applyStyles(this.searchContainer, styles.searchContainer);\n this.filterByValueSearchInput.placeholder = styles.searchInput?.placeholder || '可使用空格分隔多个关键词';\n applyStyles(this.filterByValueSearchInput, styles.searchInput);\n applyStyles(this.optionsContainer, styles.optionsContainer);\n applyStyles(this.selectAllItemDiv, styles.optionItem);\n applyStyles(this.selectAllLabel, styles.optionLabel);\n applyStyles(this.selectAllCheckbox, styles.checkbox);\n }\n\n private renderFilterOptions(field: string | number): void {\n const filterStyles = this.styles;\n this.filterItemsContainer.innerHTML = '';\n this.valueFilterOptionList.delete(field);\n this.valueFilterOptionList.set(field, []);\n\n let totalCount = 0;\n let allChecked = true;\n let noneChecked = true;\n const selectedKeysSet = this.selectedKeys.get(field);\n const itemDomList: ValueFilterOptionDom[] = [];\n const isFiltered = this.filterStateManager.getFilterState(field)?.enable;\n const toUnformatted = this.toUnformattedCache.get(field);\n\n const candidates = this.candidateKeys.get(field);\n if (!candidates || candidates.size === 0) {\n return;\n }\n const candidatesArr = [...candidates.entries()] as [string, number][] | [number, number][];\n const sortedCandidatesArr =\n typeof candidatesArr[0][0] === 'number'\n ? [...candidatesArr]?.sort(([a], [b]) => Number(a) - Number(b))\n : [...candidatesArr]?.sort(([a], [b]) => String(a).localeCompare(String(b)));\n\n sortedCandidatesArr?.forEach(([val, count]) => {\n totalCount += count;\n const unformattedArr = Array.from(toUnformatted.get(val) || new Set());\n const itemDiv = document.createElement('div');\n applyStyles(itemDiv, filterStyles.optionItem);\n itemDiv.style.display = 'flex';\n\n const label = document.createElement('label');\n applyStyles(label, filterStyles.optionLabel);\n\n const checkbox = document.createElement('input');\n checkbox.type = 'checkbox';\n checkbox.value = String(val); // 显示值作为checkbox的value\n checkbox.checked = isFiltered ? unformattedArr.some(v => selectedKeysSet?.has(v)) : true;\n applyStyles(checkbox, filterStyles.checkbox);\n\n if (checkbox.checked) {\n noneChecked = false;\n } else {\n allChecked = false;\n }\n\n const countSpan = document.createElement('span');\n countSpan.textContent = String(count);\n applyStyles(countSpan, filterStyles.countSpan);\n\n label.append(checkbox, ` ${this.pluginOptions.checkboxItemFormat?.(val, unformattedArr) || val}`); // UI显示格式化值 或 用户二次加工的值\n itemDiv.append(label, countSpan);\n this.filterItemsContainer.appendChild(itemDiv);\n\n const itemDom: ValueFilterOptionDom = {\n id: String(val), // 显示值作为id,用于UI交互\n originalValue: unformattedArr,\n itemContainer: itemDiv,\n checkbox: checkbox,\n countSpan: countSpan\n };\n\n itemDomList.push(itemDom);\n });\n\n this.valueFilterOptionList.set(field, itemDomList);\n this.selectAllCheckbox.checked = allChecked;\n this.selectAllCheckbox.indeterminate = !allChecked && !noneChecked;\n this.totalCountSpan.textContent = String(totalCount);\n }\n\n private bindEventForFilterByValue(): void {\n this._onInputKeyUpHandler = (event: KeyboardEvent) => {\n const target = event.target as EventTarget;\n if (target instanceof HTMLInputElement && target.type === 'text') {\n const value = target.value;\n this.onSearch(this.selectedField, value);\n }\n };\n\n this._onCheckboxChangeHandler = (event: Event) => {\n const target = event.target as EventTarget;\n if (target instanceof HTMLInputElement && target.type === 'checkbox') {\n if (target === this.selectAllCheckbox) {\n this.toggleSelectAll(this.selectedField, this.selectAllCheckbox.checked);\n } else {\n this.syncSelectAllCheckbox(this.selectedField);\n }\n }\n };\n\n this.filterByValuePanel.addEventListener('keyup', this._onInputKeyUpHandler);\n this.filterByValuePanel.addEventListener('change', this._onCheckboxChangeHandler);\n }\n\n show(): void {\n // 1. 收集候选值列表(根据筛选状态选择数据源)\n const isFiltered = this.filterStateManager.getFilterState(this.selectedField)?.enable;\n if (!isFiltered) {\n this.collectCandidateKeysForUnfilteredColumn(this.selectedField);\n } else {\n this.collectCandidateKeysForFilteredColumn(this.selectedField);\n }\n\n // 2. 初始化筛选状态(必须在 renderFilterOptions 之前执行)\n this.initFilterStateFromTableData(this.selectedField);\n\n // 3. 清空搜索框\n if (this.filterByValueSearchInput) {\n this.filterByValueSearchInput.value = '';\n }\n\n // 4. 渲染选项(此时状态已经初始化完成)\n this.renderFilterOptions(this.selectedField);\n this.filterByValuePanel.style.display = 'block';\n }\n\n hide(): void {\n this.filterByValuePanel.style.display = 'none';\n }\n\n clearSearchInputValue(): void {\n this.filterByValueSearchInput.value = '';\n }\n\n destroy(): void {\n if (this.filterByValuePanel) {\n if (this._onInputKeyUpHandler) {\n this.filterByValuePanel.removeEventListener('keyup', this._onInputKeyUpHandler);\n }\n if (this._onCheckboxChangeHandler) {\n this.filterByValuePanel.removeEventListener('change', this._onCheckboxChangeHandler);\n }\n }\n this._onInputKeyUpHandler = undefined as any;\n this._onCheckboxChangeHandler = undefined as any;\n\n if (this.filterByValuePanel) {\n const parent = this.filterByValuePanel.parentElement;\n if (parent) {\n parent.removeChild(this.filterByValuePanel);\n } else {\n // if not attached, ensure it's removed\n this.filterByValuePanel.remove();\n }\n }\n\n // clear DOM contents to release child references\n if (this.filterItemsContainer) {\n this.filterItemsContainer.innerHTML = '';\n }\n if (this.filterByValueSearchInput) {\n this.filterByValueSearchInput.value = '';\n }\n\n // Clear in-memory caches and collections to avoid unbounded growth\n this.selectedKeys && this.selectedKeys.clear();\n this.candidateKeys && this.candidateKeys.clear();\n this.formatFnCache && this.formatFnCache.clear();\n this.toUnformattedCache && this.toUnformattedCache.clear();\n this.valueFilterOptionList && this.valueFilterOptionList.clear();\n\n // Nullify references (use casts to avoid TS strict errors at assignment)\n (this.filterByValuePanel as any) = undefined;\n (this.filterByValueSearchInput as any) = undefined;\n (this.selectAllCheckbox as any) = undefined;\n (this.totalCountSpan as any) = undefined;\n (this.filterItemsContainer as any) = undefined;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/filter/value-filter.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAE3C,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAErD,MAAM,OAAO,WAAW;IAmBtB,YAAY,KAA6B,EAAE,kBAAsC;QAfzE,iBAAY,GAAG,IAAI,GAAG,EAAyC,CAAC;QAChE,kBAAa,GAAG,IAAI,GAAG,EAAiD,CAAC;QACzE,kBAAa,GAAG,IAAI,GAAG,EAAqD,CAAC;QAC7E,uBAAkB,GAAG,IAAI,GAAG,EAAuC,CAAC;QAEpE,0BAAqB,GAAiD,IAAI,GAAG,EAAE,CAAC;QAWtF,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,kBAAkB,GAAG,kBAAkB,CAAC;IAC/C,CAAC;IAED,gBAAgB,CAAC,OAAwB;QACvC,IAAI,CAAC,aAAa,GAAG,OAAO,CAAC;IAC/B,CAAC;IAEO,gBAAgB,CAAC,OAAw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,CAAC,kBAAkB,CAAC,KAAK,EAAE,CAAC;QAC3D,IAAI,CAAC,qBAAqB,IAAI,IAAI,CAAC,qBAAqB,CAAC,KAAK,EAAE,CAAC;QAGhE,IAAI,CAAC,kBAA0B,GAAG,SAAS,CAAC;QAC5C,IAAI,CAAC,wBAAgC,GAAG,SAAS,CAAC;QAClD,IAAI,CAAC,iBAAyB,GAAG,SAAS,CAAC;QAC3C,IAAI,CAAC,cAAsB,GAAG,SAAS,CAAC;QACxC,IAAI,CAAC,oBAA4B,GAAG,SAAS,CAAC;IACjD,CAAC;CACF","file":"value-filter.js","sourcesContent":["import { ListTable, PivotTable } from '@visactor/vtable';\nimport { arrayEqual } from '@visactor/vutils';\nimport type { FilterConfig, ValueFilterOptionDom, FilterState } from './types';\nimport { FilterActionType } from './types';\nimport type { FilterStateManager } from './filter-state-manager';\nimport { applyStyles, filterStyles } from './styles';\n\nexport class ValueFilter {\n private table: ListTable | PivotTable;\n private filterStateManager: FilterStateManager;\n private selectedField: string | number;\n private selectedKeys = new Map<string | number, Set<string | number>>(); // 存储 format 之前的原始数据\n private candidateKeys = new Map<string | number, Map<string | number, number>>(); // 存储 format 后的数据\n private formatFnCache = new Map<string | number, (record: any) => string | number>();\n private toUnformattedCache = new Map<string | number, Map<any, Set<any>>>();\n\n private valueFilterOptionList: Map<string | number, ValueFilterOptionDom[]> = new Map();\n private filterByValuePanel: HTMLElement;\n private filterByValueSearchInput: HTMLInputElement;\n private selectAllCheckbox: HTMLInputElement;\n private totalCountSpan: HTMLSpanElement;\n private filterItemsContainer: HTMLElement;\n\n private _onInputKeyUpHandler: (event: KeyboardEvent) => void;\n private _onCheckboxChangeHandler: (event: Event) => void;\n\n constructor(table: ListTable | PivotTable, filterStateManager: FilterStateManager) {\n this.table = table;\n this.filterStateManager = filterStateManager;\n }\n\n setSelectedField(fieldId: string | number): void {\n this.selectedField = fieldId;\n }\n\n private getFormatFnCache(fieldId: string | number) {\n let formatFn = this.formatFnCache.get(fieldId);\n if (formatFn !== null && formatFn !== undefined) {\n return formatFn;\n }\n\n const headerAddress = this.table.internalProps.layoutMap.getHeaderCellAddressByField(String(fieldId));\n const bodyInfo = this.table.internalProps.layoutMap.getBody(headerAddress?.col, headerAddress?.row);\n if (bodyInfo && 'fieldFormat' in bodyInfo && typeof bodyInfo.fieldFormat === 'function') {\n formatFn = bodyInfo.fieldFormat;\n } else if (bodyInfo && 'format' in bodyInfo && typeof bodyInfo.format === 'function') {\n formatFn = bodyInfo.format;\n } else {\n formatFn = (record: any) => record[fieldId];\n }\n\n this.formatFnCache.set(fieldId, formatFn);\n return formatFn;\n }\n\n /**\n * 为未应用筛选的列,收集候选值集合\n */\n private collectCandidateKeysForUnfilteredColumn(fieldId: string | number): void {\n const countMap = new Map<any, number>(); // 计算每个候选值的计数\n const records = this.table.internalProps.dataSource.records; // 未筛选:使用当前表格数据\n const formatFn = this.getFormatFnCache(fieldId);\n const toUnformatted = new Map();\n\n records.forEach(record => {\n const originalValue = record[fieldId];\n const formattedValue = formatFn(record);\n if (formattedValue !== undefined && formattedValue !== null) {\n countMap.set(formattedValue, (countMap.get(formattedValue) || 0) + 1);\n\n const unformattedSet = toUnformatted.get(formattedValue);\n if (unformattedSet !== undefined && unformattedSet !== null) {\n unformattedSet.add(originalValue);\n } else {\n toUnformatted.set(formattedValue, new Set([originalValue]));\n }\n }\n });\n\n this.candidateKeys.set(fieldId, countMap);\n this.toUnformattedCache.set(fieldId, toUnformatted);\n }\n\n /**\n * 为已应用筛选的列,收集候选值集合\n */\n private collectCandidateKeysForFilteredColumn(candidateField: string | number): void {\n const filteredFields = this.filterStateManager.getActiveFilterFields().filter(field => field !== candidateField);\n const toUnformatted = new Map();\n const formatFn = this.getFormatFnCache(candidateField);\n\n const countMap = new Map<any, number>(); // 计算每个候选值的计数\n const recordsList = this.table.internalProps.records; // 已筛选:使用原始表格数据\n const records = recordsList.filter(record =>\n filteredFields.every(field => {\n const set = this.selectedKeys.get(field);\n return set.has(record[field]);\n })\n );\n\n records.forEach(record => {\n const originalValue = record[candidateField];\n const formattedValue = formatFn(record);\n countMap.set(formattedValue, (countMap.get(formattedValue) || 0) + 1);\n if (formattedValue !== undefined && formattedValue !== null) {\n const unformattedSet = toUnformatted.get(formattedValue);\n if (unformattedSet !== undefined && unformattedSet !== null) {\n unformattedSet.add(originalValue);\n } else {\n toUnformatted.set(formattedValue, new Set([originalValue]));\n }\n }\n });\n\n this.candidateKeys.set(candidateField, countMap);\n this.toUnformattedCache.set(candidateField, toUnformatted);\n }\n\n private toggleSelectAll(fieldId: string | number, selected: boolean): void {\n const options = this.valueFilterOptionList.get(fieldId);\n options.forEach(option => {\n option.checkbox.checked = selected;\n });\n }\n\n private syncSelectAllCheckbox(fieldId: string | number): void {\n const options = this.valueFilterOptionList.get(fieldId) || [];\n const allChecked = options.every(o => o.checkbox.checked);\n const noneChecked = options.every(o => !o.checkbox.checked);\n\n this.selectAllCheckbox.checked = allChecked;\n this.selectAllCheckbox.indeterminate = !allChecked && !noneChecked;\n }\n\n private onSearch(fieldId: string | number, value: string): void {\n // 更新UI显示\n const items = this.valueFilterOptionList.get(fieldId);\n const filterKeywords = value\n .toUpperCase()\n .split(' ')\n .filter(s => s);\n\n for (const item of items) {\n const txtValue = item.id.toUpperCase() || '';\n const match = filterKeywords.some(keyword => txtValue.includes(keyword));\n const isVisible = filterKeywords.length === 0 || match;\n\n item.itemContainer.style.display = isVisible ? 'flex' : 'none';\n }\n }\n\n /**\n * 根据当前表格中的数据,更新 filter 的被选状态\n */\n private initFilterStateFromTableData(fieldId: string | number): void {\n const isHasFilteredState = this.filterStateManager.getActiveFilterFields();\n if (isHasFilteredState) {\n return;\n }\n\n const selectedValues = new Set<any>();\n const originalValues = new Set<any>();\n\n const currentRecords = this.table.internalProps.dataSource.records; // 当前数据\n currentRecords.forEach(record => {\n selectedValues.add(record[fieldId]);\n });\n\n const originalRecords = this.table.internalProps.records; // 原始数据\n originalRecords.forEach(record => {\n originalValues.add(record[fieldId]);\n });\n\n const hasFiltered = !arrayEqual(Array.from(originalValues), Array.from(selectedValues));\n if (hasFiltered) {\n this.selectedKeys.set(fieldId, selectedValues);\n\n this.filterStateManager.dispatch({\n type: FilterActionType.ADD_FILTER,\n payload: {\n field: fieldId,\n type: 'byValue',\n values: Array.from(selectedValues),\n enable: true\n }\n });\n }\n }\n\n applyFilter(fieldId: string | number = this.selectedField): void {\n const options = this.valueFilterOptionList.get(fieldId);\n if (!options || options.length === 0) {\n return;\n }\n\n const selections = options\n .map(option => {\n if (option.checkbox.checked) {\n return option.originalValue;\n }\n return null;\n })\n .filter(key => key !== null)\n .flat();\n\n this.selectedKeys.set(fieldId, new Set(selections));\n\n if (selections.length > 0 && selections.length < this.valueFilterOptionList.get(fieldId).length) {\n this.filterStateManager.dispatch({\n type: FilterActionType.APPLY_FILTERS,\n payload: {\n field: fieldId,\n type: 'byValue',\n values: selections,\n enable: true\n }\n });\n } else {\n this.filterStateManager.dispatch({\n type: FilterActionType.REMOVE_FILTER,\n payload: {\n field: fieldId\n }\n });\n }\n }\n\n clearFilter(fieldId: string | number): void {\n this.filterStateManager.dispatch({\n type: FilterActionType.REMOVE_FILTER,\n payload: {\n field: fieldId\n }\n });\n\n this.hide();\n }\n\n render(container: HTMLElement): void {\n // === 按值筛选的菜单内容 ===\n this.filterByValuePanel = document.createElement('div');\n applyStyles(this.filterByValuePanel, filterStyles.filterPanel);\n\n // -- 搜索栏 ---\n const searchContainer = document.createElement('div');\n applyStyles(searchContainer, filterStyles.searchContainer);\n\n this.filterByValueSearchInput = document.createElement('input');\n this.filterByValueSearchInput.type = 'text';\n this.filterByValueSearchInput.placeholder = '可使用空格分隔多个关键词';\n applyStyles(this.filterByValueSearchInput, filterStyles.searchInput);\n\n searchContainer.appendChild(this.filterByValueSearchInput);\n\n // --- 筛选选项 ---\n const optionsContainer = document.createElement('div');\n applyStyles(optionsContainer, filterStyles.optionsContainer);\n\n const selectAllItemDiv = document.createElement('div');\n applyStyles(selectAllItemDiv, filterStyles.optionItem);\n\n const selectAllLabel = document.createElement('label');\n applyStyles(selectAllLabel, filterStyles.optionLabel);\n\n this.selectAllCheckbox = document.createElement('input');\n this.selectAllCheckbox.type = 'checkbox';\n this.selectAllCheckbox.checked = true; // 默认全选\n applyStyles(this.selectAllCheckbox, filterStyles.checkbox);\n\n this.totalCountSpan = document.createElement('span');\n this.totalCountSpan.textContent = '';\n applyStyles(this.totalCountSpan, filterStyles.countSpan);\n\n selectAllLabel.append(this.selectAllCheckbox, ' 全选');\n selectAllItemDiv.append(selectAllLabel, this.totalCountSpan);\n\n this.filterItemsContainer = document.createElement('div'); // 筛选条目的容器,后续应动态 appendChild\n\n optionsContainer.append(selectAllItemDiv, this.filterItemsContainer);\n this.filterByValuePanel.append(searchContainer, optionsContainer);\n\n container.appendChild(this.filterByValuePanel);\n\n this.bindEventForFilterByValue();\n }\n\n private renderFilterOptions(field: string | number): void {\n this.filterItemsContainer.innerHTML = '';\n this.valueFilterOptionList.delete(field);\n this.valueFilterOptionList.set(field, []);\n\n let totalCount = 0;\n let allChecked = true;\n let noneChecked = true;\n const selectedKeysSet = this.selectedKeys.get(field);\n const itemDomList: ValueFilterOptionDom[] = [];\n const isFiltered = this.filterStateManager.getFilterState(field)?.enable;\n const toUnformatted = this.toUnformattedCache.get(field);\n\n const candidates = this.candidateKeys.get(field);\n if (!candidates || candidates.size === 0) {\n return;\n }\n const candidatesArr = [...candidates.entries()] as [string, number][] | [number, number][];\n const sortedCandidatesArr =\n typeof candidatesArr[0][0] === 'number'\n ? [...candidatesArr]?.sort(([a], [b]) => Number(a) - Number(b))\n : [...candidatesArr]?.sort(([a], [b]) => String(a).localeCompare(String(b)));\n\n sortedCandidatesArr?.forEach(([val, count]) => {\n totalCount += count;\n const unformattedArr = Array.from(toUnformatted.get(val) || new Set());\n const itemDiv = document.createElement('div');\n applyStyles(itemDiv, filterStyles.optionItem);\n itemDiv.style.display = 'flex';\n\n const label = document.createElement('label');\n applyStyles(label, filterStyles.optionLabel);\n\n const checkbox = document.createElement('input');\n checkbox.type = 'checkbox';\n checkbox.value = String(val); // 显示值作为checkbox的value\n checkbox.checked = isFiltered ? unformattedArr.some(v => selectedKeysSet?.has(v)) : true;\n applyStyles(checkbox, filterStyles.checkbox);\n\n if (checkbox.checked) {\n noneChecked = false;\n } else {\n allChecked = false;\n }\n\n const countSpan = document.createElement('span');\n countSpan.textContent = String(count);\n applyStyles(countSpan, filterStyles.countSpan);\n\n label.append(checkbox, ` ${val}`); // UI显示格式化值\n itemDiv.append(label, countSpan);\n this.filterItemsContainer.appendChild(itemDiv);\n\n const itemDom: ValueFilterOptionDom = {\n id: String(val), // 显示值作为id,用于UI交互\n originalValue: unformattedArr,\n itemContainer: itemDiv,\n checkbox: checkbox,\n countSpan: countSpan\n };\n\n itemDomList.push(itemDom);\n });\n\n this.valueFilterOptionList.set(field, itemDomList);\n this.selectAllCheckbox.checked = allChecked;\n this.selectAllCheckbox.indeterminate = !allChecked && !noneChecked;\n this.totalCountSpan.textContent = String(totalCount);\n }\n\n private bindEventForFilterByValue(): void {\n this._onInputKeyUpHandler = (event: KeyboardEvent) => {\n const target = event.target as EventTarget;\n if (target instanceof HTMLInputElement && target.type === 'text') {\n const value = target.value;\n this.onSearch(this.selectedField, value);\n }\n };\n\n this._onCheckboxChangeHandler = (event: Event) => {\n const target = event.target as EventTarget;\n if (target instanceof HTMLInputElement && target.type === 'checkbox') {\n if (target === this.selectAllCheckbox) {\n this.toggleSelectAll(this.selectedField, this.selectAllCheckbox.checked);\n } else {\n this.syncSelectAllCheckbox(this.selectedField);\n }\n }\n };\n\n this.filterByValuePanel.addEventListener('keyup', this._onInputKeyUpHandler);\n this.filterByValuePanel.addEventListener('change', this._onCheckboxChangeHandler);\n }\n\n show(): void {\n // 1. 收集候选值列表(根据筛选状态选择数据源)\n const isFiltered = this.filterStateManager.getFilterState(this.selectedField)?.enable;\n if (!isFiltered) {\n this.collectCandidateKeysForUnfilteredColumn(this.selectedField);\n } else {\n this.collectCandidateKeysForFilteredColumn(this.selectedField);\n }\n\n // 2. 初始化筛选状态(必须在 renderFilterOptions 之前执行)\n this.initFilterStateFromTableData(this.selectedField);\n\n // 3. 清空搜索框\n if (this.filterByValueSearchInput) {\n this.filterByValueSearchInput.value = '';\n }\n\n // 4. 渲染选项(此时状态已经初始化完成)\n this.renderFilterOptions(this.selectedField);\n this.filterByValuePanel.style.display = 'block';\n }\n\n hide(): void {\n this.filterByValuePanel.style.display = 'none';\n }\n\n clearSearchInputValue(): void {\n this.filterByValueSearchInput.value = '';\n }\n\n destroy(): void {\n if (this.filterByValuePanel) {\n if (this._onInputKeyUpHandler) {\n this.filterByValuePanel.removeEventListener('keyup', this._onInputKeyUpHandler);\n }\n if (this._onCheckboxChangeHandler) {\n this.filterByValuePanel.removeEventListener('change', this._onCheckboxChangeHandler);\n }\n }\n this._onInputKeyUpHandler = undefined as any;\n this._onCheckboxChangeHandler = undefined as any;\n\n if (this.filterByValuePanel) {\n const parent = this.filterByValuePanel.parentElement;\n if (parent) {\n parent.removeChild(this.filterByValuePanel);\n } else {\n // if not attached, ensure it's removed\n this.filterByValuePanel.remove();\n }\n }\n\n // clear DOM contents to release child references\n if (this.filterItemsContainer) {\n this.filterItemsContainer.innerHTML = '';\n }\n if (this.filterByValueSearchInput) {\n this.filterByValueSearchInput.value = '';\n }\n\n // Clear in-memory caches and collections to avoid unbounded growth\n this.selectedKeys && this.selectedKeys.clear();\n this.candidateKeys && this.candidateKeys.clear();\n this.formatFnCache && this.formatFnCache.clear();\n this.toUnformattedCache && this.toUnformattedCache.clear();\n this.valueFilterOptionList && this.valueFilterOptionList.clear();\n\n // Nullify references (use casts to avoid TS strict errors at assignment)\n (this.filterByValuePanel as any) = undefined;\n (this.filterByValueSearchInput as any) = undefined;\n (this.selectAllCheckbox as any) = undefined;\n (this.totalCountSpan as any) = undefined;\n (this.filterItemsContainer as any) = undefined;\n }\n}\n"]}
|
package/es/focus-highlight.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
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AAI,CAAC,YAAY,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;oBACnC,MAAM,WAAW,GAAG,IAAI,CAAC,UAAU,CAAC;oBACpC,IAAI,CAAC,SAAS,EAAE;wBAEd,WAAW,CAAC,cAAc,EAAE,CAAC;qBAC9B;yBAAM,IAAI,WAAW,CAAC,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,EAAE;wBAErD,WAAW,CAAC,cAAc,EAAE,CAAC;qBAC9B;yBAAM,IAAI,CAAC,WAAW,CAAC,UAAU,EAAE;wBAElC,MAAM,UAAU,GAAG,UAAU,CAAC;4BAC5B,CAAC,EAAE,CAAC;4BACJ,CAAC,EAAE,CAAC;4BACJ,KAAK,EAAE,IAAI,CAAC,SAAS,CAAC,KAAK;4BAC3B,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM;4BAC7B,IAAI,EAAE,IAAI,CAAC,aAAa,CAAC,IAAI;4BAC7B,OAAO,EAAE,IAAI,CAAC,aAAa,CAAC,OAAO;yBACpC,CAAC,CAAC;wBACH,UAAU,CAAC,IAAI,GAAG,aAAa,CAAC;wBAChC,WAAW,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;qBACrC;gBACH,CAAC,CAAC,CAAC;aACJ;QACH,CAAC,CAAC,CAAC;IACL,CAAC;IACD,MAAM;QACJ,IAAI,IAAI,CAAC,KAAK,EAAE;YACd,IAAI,CAAC,sBAAsB,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;SAC/C;IACH,CAAC;CACF","file":"focus-highlight.js","sourcesContent":["import type { INode } from '@visactor/vtable/es/vrender';\nimport { createRect } from '@visactor/vtable/es/vrender';\nimport type { Group } from '@visactor/vtable/es/scenegraph/graphic/group';\nimport { isSameRange } from '@visactor/vtable/es/tools/cell-range';\nimport type { CellAddress, CellRange } from '@visactor/vtable/es/ts-types';\nimport type { pluginsDefinition } from '@visactor/vtable';\nimport type { BaseTableAPI } from '@visactor/vtable/es/ts-types/base-table';\nimport { cellInRange } from '@visactor/vtable/es/tools/helper';\nimport { TABLE_EVENT_TYPE } from '@visactor/vtable';\nexport interface FocusHighlightPluginOptions {\n id?: string;\n fill?: string;\n opacity?: number;\n highlightRange?: CellAddress | CellRange; //初始化聚焦高亮范围\n}\n\nexport class FocusHighlightPlugin implements pluginsDefinition.IVTablePlugin {\n id = `focus-highlight`;\n name = 'Focus Highlight';\n runTime = [TABLE_EVENT_TYPE.INITIALIZED, TABLE_EVENT_TYPE.SELECTED_CELL, TABLE_EVENT_TYPE.SELECTED_CLEAR];\n table: BaseTableAPI;\n range?: CellRange;\n pluginOptions: FocusHighlightPluginOptions;\n\n constructor(\n options: FocusHighlightPluginOptions = {\n fill: '#000',\n opacity: 0.5,\n highlightRange: undefined\n }\n ) {\n this.id = options.id ?? this.id;\n this.pluginOptions = Object.assign(\n {\n fill: '#000',\n opacity: 0.5\n },\n options\n );\n }\n run(...args: any[]) {\n if (!this.table) {\n this.table = args[2] as BaseTableAPI;\n }\n if (args[1] === TABLE_EVENT_TYPE.INITIALIZED) {\n this.pluginOptions.highlightRange && this.setFocusHighlightRange(this.pluginOptions.highlightRange);\n } else if (args[1] === TABLE_EVENT_TYPE.SELECTED_CELL) {\n const posCell = this.table.stateManager.select.cellPos;\n if (this.table.isHeader(posCell.col, posCell.row)) {\n this.setFocusHighlightRange(undefined);\n } else {\n const ranges = this.table.stateManager.select.ranges;\n const min_col = 0;\n const max_col = this.table.colCount - 1;\n const min_row = Math.min(ranges[0].start.row, ranges[0].end.row);\n const max_row = Math.max(ranges[0].start.row, ranges[0].end.row);\n this.setFocusHighlightRange({\n start: { col: min_col, row: min_row },\n end: { col: max_col, row: max_row }\n });\n }\n } else if (args[1] === TABLE_EVENT_TYPE.SELECTED_CLEAR) {\n this.setFocusHighlightRange(undefined);\n }\n }\n\n setFocusHighlightRange(range?: CellAddress | CellRange, forceUpdate: boolean = false) {\n let cellRange: CellRange;\n if (range && 'start' in range && 'end' in range) {\n cellRange = range as CellRange;\n } else if (range) {\n cellRange = {\n start: range as CellAddress,\n end: range as CellAddress\n };\n }\n if (isSameRange(this.range, cellRange) && !forceUpdate) {\n return;\n }\n\n this.range = cellRange;\n if (!range) {\n // reset highlight\n this.deleteAllCellGroupShadow();\n } else {\n // update highlight\n this.updateCellGroupShadow();\n }\n\n this.table.scenegraph.updateNextFrame();\n }\n\n deleteAllCellGroupShadow() {\n if (!this.table.isPivotTable()) {\n this.updateCellGroupShadowInContainer(this.table.scenegraph.rowHeaderGroup);\n this.updateCellGroupShadowInContainer(this.table.scenegraph.leftBottomCornerGroup);\n }\n this.updateCellGroupShadowInContainer(this.table.scenegraph.bodyGroup);\n this.updateCellGroupShadowInContainer(this.table.scenegraph.rightFrozenGroup);\n this.updateCellGroupShadowInContainer(this.table.scenegraph.bottomFrozenGroup);\n this.updateCellGroupShadowInContainer(this.table.scenegraph.rightBottomCornerGroup);\n }\n\n updateCellGroupShadow() {\n if (!this.table.isPivotTable()) {\n this.updateCellGroupShadowInContainer(this.table.scenegraph.rowHeaderGroup, this.range);\n this.updateCellGroupShadowInContainer(this.table.scenegraph.leftBottomCornerGroup, this.range);\n }\n this.updateCellGroupShadowInContainer(this.table.scenegraph.bodyGroup, this.range);\n this.updateCellGroupShadowInContainer(this.table.scenegraph.rightFrozenGroup, this.range);\n this.updateCellGroupShadowInContainer(this.table.scenegraph.bottomFrozenGroup), this.range;\n this.updateCellGroupShadowInContainer(this.table.scenegraph.rightBottomCornerGroup, this.range);\n }\n updateCellGroupShadowInContainer(container: Group, range?: CellAddress | CellRange) {\n let cellRange: CellRange;\n if (range && 'start' in range && 'end' in range) {\n cellRange = range;\n } else if (range) {\n cellRange = {\n start: range as CellAddress,\n end: range as CellAddress\n };\n }\n container.forEachChildrenSkipChild((item: INode) => {\n const column = item as unknown as Group;\n if (column.role === 'column') {\n column.forEachChildrenSkipChild((item: INode) => {\n const cell = item as unknown as Group;\n if (cell.role !== 'cell') {\n return;\n }\n cell.attachShadow(cell.shadowRoot);\n const shadowGroup = cell.shadowRoot;\n if (!cellRange) {\n // no highlight\n shadowGroup.removeAllChild();\n } else if (cellInRange(cellRange, cell.col, cell.row)) {\n // inside highlight\n shadowGroup.removeAllChild();\n } else if (!shadowGroup.firstChild) {\n // outside highlight\n const shadowRect = createRect({\n x: 0,\n y: 0,\n width: cell.attribute.width,\n height: cell.attribute.height,\n fill: this.pluginOptions.fill,\n opacity: this.pluginOptions.opacity\n });\n shadowRect.name = 'shadow-rect';\n shadowGroup.appendChild(shadowRect);\n }\n });\n }\n });\n }\n update() {\n if (this.table) {\n this.setFocusHighlightRange(this.range, true);\n }\n }\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/focus-highlight.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAEzD,OAAO,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AAInE,OAAO,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAQpD,MAAM,OAAO,oBAAoB;IAQ/B,YACE,UAAuC;QACrC,IAAI,EAAE,MAAM;QACZ,OAAO,EAAE,GAAG;QACZ,cAAc,EAAE,SAAS;KAC1B;;QAZH,OAAE,GAAG,iBAAiB,CAAC;QACvB,SAAI,GAAG,iBAAiB,CAAC;QACzB,YAAO,GAAG,CAAC,gBAAgB,CAAC,WAAW,EAAE,gBAAgB,CAAC,aAAa,EAAE,gBAAgB,CAAC,cAAc,CAAC,CAAC;QAYxG,IAAI,CAAC,EAAE,GAAG,MAAA,OAAO,CAAC,EAAE,mCAAI,IAAI,CAAC,EAAE,CAAC;QAChC,IAAI,CAAC,aAAa,GAAG,MAAM,CAAC,MAAM,CAChC;YACE,IAAI,EAAE,MAAM;YACZ,OAAO,EAAE,GAAG;SACb,EACD,OAAO,CACR,CAAC;IACJ,CAAC;IACD,GAAG,CAAC,GAAG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AC,CAAC,CAAC;IACL,CAAC;IACD,MAAM;QACJ,IAAI,CAAC,sBAAsB,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IAChD,CAAC;CACF","file":"focus-highlight.js","sourcesContent":["import type { INode } from '@visactor/vtable/es/vrender';\nimport { createRect } from '@visactor/vtable/es/vrender';\nimport type { Group } from '@visactor/vtable/es/scenegraph/graphic/group';\nimport { isSameRange } from '@visactor/vtable/es/tools/cell-range';\nimport type { CellAddress, CellRange } from '@visactor/vtable/es/ts-types';\nimport type { pluginsDefinition } from '@visactor/vtable';\nimport type { BaseTableAPI } from '@visactor/vtable/es/ts-types/base-table';\nimport { cellInRange } from '@visactor/vtable/es/tools/helper';\nimport { TABLE_EVENT_TYPE } from '@visactor/vtable';\nexport interface FocusHighlightPluginOptions {\n id?: string;\n fill?: string;\n opacity?: number;\n highlightRange?: CellAddress | CellRange; //初始化聚焦高亮范围\n}\n\nexport class FocusHighlightPlugin implements pluginsDefinition.IVTablePlugin {\n id = `focus-highlight`;\n name = 'Focus Highlight';\n runTime = [TABLE_EVENT_TYPE.INITIALIZED, TABLE_EVENT_TYPE.SELECTED_CELL, TABLE_EVENT_TYPE.SELECTED_CLEAR];\n table: BaseTableAPI;\n range?: CellRange;\n pluginOptions: FocusHighlightPluginOptions;\n\n constructor(\n options: FocusHighlightPluginOptions = {\n fill: '#000',\n opacity: 0.5,\n highlightRange: undefined\n }\n ) {\n this.id = options.id ?? this.id;\n this.pluginOptions = Object.assign(\n {\n fill: '#000',\n opacity: 0.5\n },\n options\n );\n }\n run(...args: any[]) {\n if (!this.table) {\n this.table = args[2] as BaseTableAPI;\n }\n if (args[1] === TABLE_EVENT_TYPE.INITIALIZED) {\n this.pluginOptions.highlightRange && this.setFocusHighlightRange(this.pluginOptions.highlightRange);\n } else if (args[1] === TABLE_EVENT_TYPE.SELECTED_CELL) {\n const posCell = this.table.stateManager.select.cellPos;\n if (this.table.isHeader(posCell.col, posCell.row)) {\n this.setFocusHighlightRange(undefined);\n } else {\n const ranges = this.table.stateManager.select.ranges;\n const min_col = 0;\n const max_col = this.table.colCount - 1;\n const min_row = Math.min(ranges[0].start.row, ranges[0].end.row);\n const max_row = Math.max(ranges[0].start.row, ranges[0].end.row);\n this.setFocusHighlightRange({\n start: { col: min_col, row: min_row },\n end: { col: max_col, row: max_row }\n });\n }\n } else if (args[1] === TABLE_EVENT_TYPE.SELECTED_CLEAR) {\n this.setFocusHighlightRange(undefined);\n }\n }\n\n setFocusHighlightRange(range?: CellAddress | CellRange, forceUpdate: boolean = false) {\n let cellRange: CellRange;\n if (range && 'start' in range && 'end' in range) {\n cellRange = range as CellRange;\n } else if (range) {\n cellRange = {\n start: range as CellAddress,\n end: range as CellAddress\n };\n }\n if (isSameRange(this.range, cellRange) && !forceUpdate) {\n return;\n }\n\n this.range = cellRange;\n if (!range) {\n // reset highlight\n this.deleteAllCellGroupShadow();\n } else {\n // update highlight\n this.updateCellGroupShadow();\n }\n\n this.table.scenegraph.updateNextFrame();\n }\n\n deleteAllCellGroupShadow() {\n if (!this.table.isPivotTable()) {\n this.updateCellGroupShadowInContainer(this.table.scenegraph.rowHeaderGroup);\n this.updateCellGroupShadowInContainer(this.table.scenegraph.leftBottomCornerGroup);\n }\n this.updateCellGroupShadowInContainer(this.table.scenegraph.bodyGroup);\n this.updateCellGroupShadowInContainer(this.table.scenegraph.rightFrozenGroup);\n this.updateCellGroupShadowInContainer(this.table.scenegraph.bottomFrozenGroup);\n this.updateCellGroupShadowInContainer(this.table.scenegraph.rightBottomCornerGroup);\n }\n\n updateCellGroupShadow() {\n if (!this.table.isPivotTable()) {\n this.updateCellGroupShadowInContainer(this.table.scenegraph.rowHeaderGroup, this.range);\n this.updateCellGroupShadowInContainer(this.table.scenegraph.leftBottomCornerGroup, this.range);\n }\n this.updateCellGroupShadowInContainer(this.table.scenegraph.bodyGroup, this.range);\n this.updateCellGroupShadowInContainer(this.table.scenegraph.rightFrozenGroup, this.range);\n this.updateCellGroupShadowInContainer(this.table.scenegraph.bottomFrozenGroup), this.range;\n this.updateCellGroupShadowInContainer(this.table.scenegraph.rightBottomCornerGroup, this.range);\n }\n updateCellGroupShadowInContainer(container: Group, range?: CellAddress | CellRange) {\n let cellRange: CellRange;\n if (range && 'start' in range && 'end' in range) {\n cellRange = range;\n } else if (range) {\n cellRange = {\n start: range as CellAddress,\n end: range as CellAddress\n };\n }\n container.forEachChildrenSkipChild((item: INode) => {\n const column = item as unknown as Group;\n if (column.role === 'column') {\n column.forEachChildrenSkipChild((item: INode) => {\n const cell = item as unknown as Group;\n if (cell.role !== 'cell') {\n return;\n }\n cell.attachShadow(cell.shadowRoot);\n const shadowGroup = cell.shadowRoot;\n if (!cellRange) {\n // no highlight\n shadowGroup.removeAllChild();\n } else if (cellInRange(cellRange, cell.col, cell.row)) {\n // inside highlight\n shadowGroup.removeAllChild();\n } else if (!shadowGroup.firstChild) {\n // outside highlight\n const shadowRect = createRect({\n x: 0,\n y: 0,\n width: cell.attribute.width,\n height: cell.attribute.height,\n fill: this.pluginOptions.fill,\n opacity: this.pluginOptions.opacity\n });\n shadowRect.name = 'shadow-rect';\n shadowGroup.appendChild(shadowRect);\n }\n });\n }\n });\n }\n update() {\n this.setFocusHighlightRange(this.range, true);\n }\n}\n"]}
|
|
@@ -90,4 +90,5 @@ function updateAllSubTableCheckboxes(subTable, field, checked) {
|
|
|
90
90
|
subTable.scenegraph.updateHeaderCheckboxCellState(checkboxCol, 0, checked);
|
|
91
91
|
for (let row = subTable.columnHeaderLevelCount; row < subTable.rowCount; row++) setCellCheckboxStateByAttribute(checkboxCol, row, checked, subTable);
|
|
92
92
|
}
|
|
93
|
-
}
|
|
93
|
+
}
|
|
94
|
+
//# sourceMappingURL=checkbox.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@visactor/vtable-plugins",
|
|
3
|
-
"version": "1.22.7-alpha.
|
|
3
|
+
"version": "1.22.7-alpha.4",
|
|
4
4
|
"description": "The search util of VTable",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "VisActor",
|
|
@@ -42,8 +42,8 @@
|
|
|
42
42
|
"@types/file-saver": "2.0.7"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
|
-
"@visactor/vtable-gantt": "1.22.7-alpha.
|
|
46
|
-
"@visactor/vtable": "1.22.7-alpha.
|
|
45
|
+
"@visactor/vtable-gantt": "1.22.7-alpha.4",
|
|
46
|
+
"@visactor/vtable": "1.22.7-alpha.4"
|
|
47
47
|
},
|
|
48
48
|
"peerDependenciesMeta": {
|
|
49
49
|
"@visactor/vtable-gantt": {
|
|
@@ -53,10 +53,10 @@
|
|
|
53
53
|
"devDependencies": {
|
|
54
54
|
"cross-env": "^7.0.3",
|
|
55
55
|
"increase-memory-limit": "^1.0.7",
|
|
56
|
-
"@visactor/vtable": "1.22.7-alpha.
|
|
57
|
-
"@visactor/vtable-editors": "1.22.7-alpha.
|
|
58
|
-
"@visactor/vtable-gantt": "1.22.7-alpha.
|
|
59
|
-
"@visactor/vchart": "2.0.
|
|
56
|
+
"@visactor/vtable": "1.22.7-alpha.4",
|
|
57
|
+
"@visactor/vtable-editors": "1.22.7-alpha.4",
|
|
58
|
+
"@visactor/vtable-gantt": "1.22.7-alpha.4",
|
|
59
|
+
"@visactor/vchart": "2.0.11-alpha.2",
|
|
60
60
|
"@rushstack/eslint-patch": "~1.1.4",
|
|
61
61
|
"react": "^18.0.0",
|
|
62
62
|
"react-dom": "^18.0.0",
|
|
@@ -98,9 +98,9 @@
|
|
|
98
98
|
"@types/react-is": "^17.0.3",
|
|
99
99
|
"rollup-plugin-node-resolve": "5.2.0",
|
|
100
100
|
"@types/lodash": "4.14.182",
|
|
101
|
+
"@internal/ts-config": "0.0.1",
|
|
101
102
|
"@internal/bundler": "0.0.1",
|
|
102
|
-
"@internal/eslint-config": "0.0.1"
|
|
103
|
-
"@internal/ts-config": "0.0.1"
|
|
103
|
+
"@internal/eslint-config": "0.0.1"
|
|
104
104
|
},
|
|
105
105
|
"scripts": {
|
|
106
106
|
"demo": "vite ./demo",
|
package/cjs/filter/constant.d.ts
DELETED
package/cjs/filter/constant.js
DELETED
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: !0
|
|
5
|
-
}), exports.operators = exports.categories = void 0;
|
|
6
|
-
|
|
7
|
-
const types_1 = require("./types");
|
|
8
|
-
|
|
9
|
-
exports.categories = [ {
|
|
10
|
-
value: types_1.FilterOperatorCategory.ALL,
|
|
11
|
-
label: "全部"
|
|
12
|
-
}, {
|
|
13
|
-
value: types_1.FilterOperatorCategory.TEXT,
|
|
14
|
-
label: "文本"
|
|
15
|
-
}, {
|
|
16
|
-
value: types_1.FilterOperatorCategory.NUMBER,
|
|
17
|
-
label: "数值"
|
|
18
|
-
}, {
|
|
19
|
-
value: types_1.FilterOperatorCategory.COLOR,
|
|
20
|
-
label: "颜色"
|
|
21
|
-
}, {
|
|
22
|
-
value: types_1.FilterOperatorCategory.CHECKBOX,
|
|
23
|
-
label: "复选框"
|
|
24
|
-
}, {
|
|
25
|
-
value: types_1.FilterOperatorCategory.RADIO,
|
|
26
|
-
label: "单选框"
|
|
27
|
-
} ], exports.operators = [ {
|
|
28
|
-
value: "equals",
|
|
29
|
-
label: "等于",
|
|
30
|
-
category: types_1.FilterOperatorCategory.ALL
|
|
31
|
-
}, {
|
|
32
|
-
value: "notEquals",
|
|
33
|
-
label: "不等于",
|
|
34
|
-
category: types_1.FilterOperatorCategory.ALL
|
|
35
|
-
}, {
|
|
36
|
-
value: "equals",
|
|
37
|
-
label: "等于",
|
|
38
|
-
category: types_1.FilterOperatorCategory.NUMBER
|
|
39
|
-
}, {
|
|
40
|
-
value: "notEquals",
|
|
41
|
-
label: "不等于",
|
|
42
|
-
category: types_1.FilterOperatorCategory.NUMBER
|
|
43
|
-
}, {
|
|
44
|
-
value: "greaterThan",
|
|
45
|
-
label: "大于",
|
|
46
|
-
category: types_1.FilterOperatorCategory.NUMBER
|
|
47
|
-
}, {
|
|
48
|
-
value: "lessThan",
|
|
49
|
-
label: "小于",
|
|
50
|
-
category: types_1.FilterOperatorCategory.NUMBER
|
|
51
|
-
}, {
|
|
52
|
-
value: "greaterThanOrEqual",
|
|
53
|
-
label: "大于等于",
|
|
54
|
-
category: types_1.FilterOperatorCategory.NUMBER
|
|
55
|
-
}, {
|
|
56
|
-
value: "lessThanOrEqual",
|
|
57
|
-
label: "小于等于",
|
|
58
|
-
category: types_1.FilterOperatorCategory.NUMBER
|
|
59
|
-
}, {
|
|
60
|
-
value: "between",
|
|
61
|
-
label: "介于",
|
|
62
|
-
category: types_1.FilterOperatorCategory.NUMBER
|
|
63
|
-
}, {
|
|
64
|
-
value: "notBetween",
|
|
65
|
-
label: "不介于",
|
|
66
|
-
category: types_1.FilterOperatorCategory.NUMBER
|
|
67
|
-
}, {
|
|
68
|
-
value: "equals",
|
|
69
|
-
label: "等于",
|
|
70
|
-
category: types_1.FilterOperatorCategory.TEXT
|
|
71
|
-
}, {
|
|
72
|
-
value: "notEquals",
|
|
73
|
-
label: "不等于",
|
|
74
|
-
category: types_1.FilterOperatorCategory.TEXT
|
|
75
|
-
}, {
|
|
76
|
-
value: "contains",
|
|
77
|
-
label: "包含",
|
|
78
|
-
category: types_1.FilterOperatorCategory.TEXT
|
|
79
|
-
}, {
|
|
80
|
-
value: "notContains",
|
|
81
|
-
label: "不包含",
|
|
82
|
-
category: types_1.FilterOperatorCategory.TEXT
|
|
83
|
-
}, {
|
|
84
|
-
value: "startsWith",
|
|
85
|
-
label: "开头是",
|
|
86
|
-
category: types_1.FilterOperatorCategory.TEXT
|
|
87
|
-
}, {
|
|
88
|
-
value: "notStartsWith",
|
|
89
|
-
label: "开头不是",
|
|
90
|
-
category: types_1.FilterOperatorCategory.TEXT
|
|
91
|
-
}, {
|
|
92
|
-
value: "endsWith",
|
|
93
|
-
label: "结尾是",
|
|
94
|
-
category: types_1.FilterOperatorCategory.TEXT
|
|
95
|
-
}, {
|
|
96
|
-
value: "notEndsWith",
|
|
97
|
-
label: "结尾不是",
|
|
98
|
-
category: types_1.FilterOperatorCategory.TEXT
|
|
99
|
-
}, {
|
|
100
|
-
value: "equals",
|
|
101
|
-
label: "等于",
|
|
102
|
-
category: types_1.FilterOperatorCategory.COLOR
|
|
103
|
-
}, {
|
|
104
|
-
value: "notEquals",
|
|
105
|
-
label: "不等于",
|
|
106
|
-
category: types_1.FilterOperatorCategory.COLOR
|
|
107
|
-
}, {
|
|
108
|
-
value: "isChecked",
|
|
109
|
-
label: "已选中",
|
|
110
|
-
category: types_1.FilterOperatorCategory.CHECKBOX
|
|
111
|
-
}, {
|
|
112
|
-
value: "isUnchecked",
|
|
113
|
-
label: "未选中",
|
|
114
|
-
category: types_1.FilterOperatorCategory.CHECKBOX
|
|
115
|
-
}, {
|
|
116
|
-
value: "isChecked",
|
|
117
|
-
label: "已选中",
|
|
118
|
-
category: types_1.FilterOperatorCategory.RADIO
|
|
119
|
-
}, {
|
|
120
|
-
value: "isUnchecked",
|
|
121
|
-
label: "未选中",
|
|
122
|
-
category: types_1.FilterOperatorCategory.RADIO
|
|
123
|
-
} ];
|
|
124
|
-
//# sourceMappingURL=constant.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/filter/constant.ts"],"names":[],"mappings":";;;AACA,mCAAiD;AAGpC,QAAA,UAAU,GAAG;IACxB,EAAE,KAAK,EAAE,8BAAsB,CAAC,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE;IAClD,EAAE,KAAK,EAAE,8BAAsB,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE;IACnD,EAAE,KAAK,EAAE,8BAAsB,CAAC,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE;IACrD,EAAE,KAAK,EAAE,8BAAsB,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAA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,KAAK,EAAE,QAAQ,EAAE,8BAAsB,CAAC,KAAK,EAAE;IAC5E,EAAE,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,8BAAsB,CAAC,KAAK,EAAE;CAC/E,CAAC","file":"constant.js","sourcesContent":["import type { OperatorOption } from './types';\nimport { FilterOperatorCategory } from './types';\n\n// 分类下拉选项\nexport const categories = [\n { value: FilterOperatorCategory.ALL, label: '全部' },\n { value: FilterOperatorCategory.TEXT, label: '文本' },\n { value: FilterOperatorCategory.NUMBER, label: '数值' },\n { value: FilterOperatorCategory.COLOR, label: '颜色' },\n { value: FilterOperatorCategory.CHECKBOX, label: '复选框' },\n { value: FilterOperatorCategory.RADIO, label: '单选框' }\n];\n\n// 按分类组织的操作符选项\nexport const operators: OperatorOption[] = [\n // 通用操作符 (全部分类中显示)\n { value: 'equals', label: '等于', category: FilterOperatorCategory.ALL },\n { value: 'notEquals', label: '不等于', category: FilterOperatorCategory.ALL },\n\n // 数值操作符\n { value: 'equals', label: '等于', category: FilterOperatorCategory.NUMBER },\n { value: 'notEquals', label: '不等于', category: FilterOperatorCategory.NUMBER },\n { value: 'greaterThan', label: '大于', category: FilterOperatorCategory.NUMBER },\n { value: 'lessThan', label: '小于', category: FilterOperatorCategory.NUMBER },\n { value: 'greaterThanOrEqual', label: '大于等于', category: FilterOperatorCategory.NUMBER },\n { value: 'lessThanOrEqual', label: '小于等于', category: FilterOperatorCategory.NUMBER },\n { value: 'between', label: '介于', category: FilterOperatorCategory.NUMBER },\n { value: 'notBetween', label: '不介于', category: FilterOperatorCategory.NUMBER },\n\n // 文本操作符\n { value: 'equals', label: '等于', category: FilterOperatorCategory.TEXT },\n { value: 'notEquals', label: '不等于', category: FilterOperatorCategory.TEXT },\n { value: 'contains', label: '包含', category: FilterOperatorCategory.TEXT },\n { value: 'notContains', label: '不包含', category: FilterOperatorCategory.TEXT },\n { value: 'startsWith', label: '开头是', category: FilterOperatorCategory.TEXT },\n { value: 'notStartsWith', label: '开头不是', category: FilterOperatorCategory.TEXT },\n { value: 'endsWith', label: '结尾是', category: FilterOperatorCategory.TEXT },\n { value: 'notEndsWith', label: '结尾不是', category: FilterOperatorCategory.TEXT },\n\n // 颜色操作符\n { value: 'equals', label: '等于', category: FilterOperatorCategory.COLOR },\n { value: 'notEquals', label: '不等于', category: FilterOperatorCategory.COLOR },\n\n // 复选框操作符\n { value: 'isChecked', label: '已选中', category: FilterOperatorCategory.CHECKBOX },\n { value: 'isUnchecked', label: '未选中', category: FilterOperatorCategory.CHECKBOX },\n\n // 单选框操作符\n { value: 'isChecked', label: '已选中', category: FilterOperatorCategory.RADIO },\n { value: 'isUnchecked', label: '未选中', category: FilterOperatorCategory.RADIO }\n];\n"]}
|
package/es/filter/constant.d.ts
DELETED
package/es/filter/constant.js
DELETED
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
import { FilterOperatorCategory } from "./types";
|
|
2
|
-
|
|
3
|
-
export const categories = [ {
|
|
4
|
-
value: FilterOperatorCategory.ALL,
|
|
5
|
-
label: "全部"
|
|
6
|
-
}, {
|
|
7
|
-
value: FilterOperatorCategory.TEXT,
|
|
8
|
-
label: "文本"
|
|
9
|
-
}, {
|
|
10
|
-
value: FilterOperatorCategory.NUMBER,
|
|
11
|
-
label: "数值"
|
|
12
|
-
}, {
|
|
13
|
-
value: FilterOperatorCategory.COLOR,
|
|
14
|
-
label: "颜色"
|
|
15
|
-
}, {
|
|
16
|
-
value: FilterOperatorCategory.CHECKBOX,
|
|
17
|
-
label: "复选框"
|
|
18
|
-
}, {
|
|
19
|
-
value: FilterOperatorCategory.RADIO,
|
|
20
|
-
label: "单选框"
|
|
21
|
-
} ];
|
|
22
|
-
|
|
23
|
-
export const operators = [ {
|
|
24
|
-
value: "equals",
|
|
25
|
-
label: "等于",
|
|
26
|
-
category: FilterOperatorCategory.ALL
|
|
27
|
-
}, {
|
|
28
|
-
value: "notEquals",
|
|
29
|
-
label: "不等于",
|
|
30
|
-
category: FilterOperatorCategory.ALL
|
|
31
|
-
}, {
|
|
32
|
-
value: "equals",
|
|
33
|
-
label: "等于",
|
|
34
|
-
category: FilterOperatorCategory.NUMBER
|
|
35
|
-
}, {
|
|
36
|
-
value: "notEquals",
|
|
37
|
-
label: "不等于",
|
|
38
|
-
category: FilterOperatorCategory.NUMBER
|
|
39
|
-
}, {
|
|
40
|
-
value: "greaterThan",
|
|
41
|
-
label: "大于",
|
|
42
|
-
category: FilterOperatorCategory.NUMBER
|
|
43
|
-
}, {
|
|
44
|
-
value: "lessThan",
|
|
45
|
-
label: "小于",
|
|
46
|
-
category: FilterOperatorCategory.NUMBER
|
|
47
|
-
}, {
|
|
48
|
-
value: "greaterThanOrEqual",
|
|
49
|
-
label: "大于等于",
|
|
50
|
-
category: FilterOperatorCategory.NUMBER
|
|
51
|
-
}, {
|
|
52
|
-
value: "lessThanOrEqual",
|
|
53
|
-
label: "小于等于",
|
|
54
|
-
category: FilterOperatorCategory.NUMBER
|
|
55
|
-
}, {
|
|
56
|
-
value: "between",
|
|
57
|
-
label: "介于",
|
|
58
|
-
category: FilterOperatorCategory.NUMBER
|
|
59
|
-
}, {
|
|
60
|
-
value: "notBetween",
|
|
61
|
-
label: "不介于",
|
|
62
|
-
category: FilterOperatorCategory.NUMBER
|
|
63
|
-
}, {
|
|
64
|
-
value: "equals",
|
|
65
|
-
label: "等于",
|
|
66
|
-
category: FilterOperatorCategory.TEXT
|
|
67
|
-
}, {
|
|
68
|
-
value: "notEquals",
|
|
69
|
-
label: "不等于",
|
|
70
|
-
category: FilterOperatorCategory.TEXT
|
|
71
|
-
}, {
|
|
72
|
-
value: "contains",
|
|
73
|
-
label: "包含",
|
|
74
|
-
category: FilterOperatorCategory.TEXT
|
|
75
|
-
}, {
|
|
76
|
-
value: "notContains",
|
|
77
|
-
label: "不包含",
|
|
78
|
-
category: FilterOperatorCategory.TEXT
|
|
79
|
-
}, {
|
|
80
|
-
value: "startsWith",
|
|
81
|
-
label: "开头是",
|
|
82
|
-
category: FilterOperatorCategory.TEXT
|
|
83
|
-
}, {
|
|
84
|
-
value: "notStartsWith",
|
|
85
|
-
label: "开头不是",
|
|
86
|
-
category: FilterOperatorCategory.TEXT
|
|
87
|
-
}, {
|
|
88
|
-
value: "endsWith",
|
|
89
|
-
label: "结尾是",
|
|
90
|
-
category: FilterOperatorCategory.TEXT
|
|
91
|
-
}, {
|
|
92
|
-
value: "notEndsWith",
|
|
93
|
-
label: "结尾不是",
|
|
94
|
-
category: FilterOperatorCategory.TEXT
|
|
95
|
-
}, {
|
|
96
|
-
value: "equals",
|
|
97
|
-
label: "等于",
|
|
98
|
-
category: FilterOperatorCategory.COLOR
|
|
99
|
-
}, {
|
|
100
|
-
value: "notEquals",
|
|
101
|
-
label: "不等于",
|
|
102
|
-
category: FilterOperatorCategory.COLOR
|
|
103
|
-
}, {
|
|
104
|
-
value: "isChecked",
|
|
105
|
-
label: "已选中",
|
|
106
|
-
category: FilterOperatorCategory.CHECKBOX
|
|
107
|
-
}, {
|
|
108
|
-
value: "isUnchecked",
|
|
109
|
-
label: "未选中",
|
|
110
|
-
category: FilterOperatorCategory.CHECKBOX
|
|
111
|
-
}, {
|
|
112
|
-
value: "isChecked",
|
|
113
|
-
label: "已选中",
|
|
114
|
-
category: FilterOperatorCategory.RADIO
|
|
115
|
-
}, {
|
|
116
|
-
value: "isUnchecked",
|
|
117
|
-
label: "未选中",
|
|
118
|
-
category: FilterOperatorCategory.RADIO
|
|
119
|
-
} ];
|
|
120
|
-
//# sourceMappingURL=constant.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/filter/constant.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAGjD,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,EAAE,KAAK,EAAE,sBAAsB,CAAC,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE;IAClD,EAAE,KAAK,EAAE,sBAAsB,CAAC,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AE,QAAQ,EAAE,sBAAsB,CAAC,QAAQ,EAAE;IAC/E,EAAE,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,sBAAsB,CAAC,QAAQ,EAAE;IAGjF,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,sBAAsB,CAAC,KAAK,EAAE;IAC5E,EAAE,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,sBAAsB,CAAC,KAAK,EAAE;CAC/E,CAAC","file":"constant.js","sourcesContent":["import type { OperatorOption } from './types';\nimport { FilterOperatorCategory } from './types';\n\n// 分类下拉选项\nexport const categories = [\n { value: FilterOperatorCategory.ALL, label: '全部' },\n { value: FilterOperatorCategory.TEXT, label: '文本' },\n { value: FilterOperatorCategory.NUMBER, label: '数值' },\n { value: FilterOperatorCategory.COLOR, label: '颜色' },\n { value: FilterOperatorCategory.CHECKBOX, label: '复选框' },\n { value: FilterOperatorCategory.RADIO, label: '单选框' }\n];\n\n// 按分类组织的操作符选项\nexport const operators: OperatorOption[] = [\n // 通用操作符 (全部分类中显示)\n { value: 'equals', label: '等于', category: FilterOperatorCategory.ALL },\n { value: 'notEquals', label: '不等于', category: FilterOperatorCategory.ALL },\n\n // 数值操作符\n { value: 'equals', label: '等于', category: FilterOperatorCategory.NUMBER },\n { value: 'notEquals', label: '不等于', category: FilterOperatorCategory.NUMBER },\n { value: 'greaterThan', label: '大于', category: FilterOperatorCategory.NUMBER },\n { value: 'lessThan', label: '小于', category: FilterOperatorCategory.NUMBER },\n { value: 'greaterThanOrEqual', label: '大于等于', category: FilterOperatorCategory.NUMBER },\n { value: 'lessThanOrEqual', label: '小于等于', category: FilterOperatorCategory.NUMBER },\n { value: 'between', label: '介于', category: FilterOperatorCategory.NUMBER },\n { value: 'notBetween', label: '不介于', category: FilterOperatorCategory.NUMBER },\n\n // 文本操作符\n { value: 'equals', label: '等于', category: FilterOperatorCategory.TEXT },\n { value: 'notEquals', label: '不等于', category: FilterOperatorCategory.TEXT },\n { value: 'contains', label: '包含', category: FilterOperatorCategory.TEXT },\n { value: 'notContains', label: '不包含', category: FilterOperatorCategory.TEXT },\n { value: 'startsWith', label: '开头是', category: FilterOperatorCategory.TEXT },\n { value: 'notStartsWith', label: '开头不是', category: FilterOperatorCategory.TEXT },\n { value: 'endsWith', label: '结尾是', category: FilterOperatorCategory.TEXT },\n { value: 'notEndsWith', label: '结尾不是', category: FilterOperatorCategory.TEXT },\n\n // 颜色操作符\n { value: 'equals', label: '等于', category: FilterOperatorCategory.COLOR },\n { value: 'notEquals', label: '不等于', category: FilterOperatorCategory.COLOR },\n\n // 复选框操作符\n { value: 'isChecked', label: '已选中', category: FilterOperatorCategory.CHECKBOX },\n { value: 'isUnchecked', label: '未选中', category: FilterOperatorCategory.CHECKBOX },\n\n // 单选框操作符\n { value: 'isChecked', label: '已选中', category: FilterOperatorCategory.RADIO },\n { value: 'isUnchecked', label: '未选中', category: FilterOperatorCategory.RADIO }\n];\n"]}
|