{"version":3,"file":"util.js","sources":["../../../../../../packages/components/table/src/util.ts"],"sourcesContent":["// @ts-nocheck\nimport { createVNode, render } from 'vue'\nimport { flatMap, get } from 'lodash-unified'\nimport {\n hasOwn,\n isArray,\n isBoolean,\n isObject,\n throwError,\n} from '@element-plus/utils'\nimport ElTooltip, {\n type ElTooltipProps,\n} from '@element-plus/components/tooltip'\nimport type { Table, TreeProps } from './table/defaults'\nimport type { TableColumnCtx } from './table-column/defaults'\n\nexport type TableOverflowTooltipOptions = Partial<\n Pick<\n ElTooltipProps,\n | 'appendTo'\n | 'effect'\n | 'enterable'\n | 'hideAfter'\n | 'offset'\n | 'placement'\n | 'popperClass'\n | 'popperOptions'\n | 'showAfter'\n | 'showArrow'\n | 'transition'\n >\n>\n\ntype RemovePopperFn = (() => void) & {\n trigger?: HTMLElement\n}\n\nexport const getCell = function (event: Event) {\n return (event.target as HTMLElement)?.closest('td')\n}\n\nexport const orderBy = function (\n array: T[],\n sortKey: string,\n reverse: string | number,\n sortMethod,\n sortBy: string | (string | ((a: T, b: T, array?: T[]) => number))[]\n) {\n if (\n !sortKey &&\n !sortMethod &&\n (!sortBy || (Array.isArray(sortBy) && !sortBy.length))\n ) {\n return array\n }\n if (typeof reverse === 'string') {\n reverse = reverse === 'descending' ? -1 : 1\n } else {\n reverse = reverse && reverse < 0 ? -1 : 1\n }\n const getKey = sortMethod\n ? null\n : function (value, index) {\n if (sortBy) {\n if (!Array.isArray(sortBy)) {\n sortBy = [sortBy]\n }\n return sortBy.map((by) => {\n if (typeof by === 'string') {\n return get(value, by)\n } else {\n return by(value, index, array)\n }\n })\n }\n if (sortKey !== '$key') {\n if (isObject(value) && '$value' in value) value = value.$value\n }\n return [isObject(value) ? get(value, sortKey) : value]\n }\n const compare = function (a, b) {\n if (sortMethod) {\n return sortMethod(a.value, b.value)\n }\n for (let i = 0, len = a.key.length; i < len; i++) {\n if (a.key[i] < b.key[i]) {\n return -1\n }\n if (a.key[i] > b.key[i]) {\n return 1\n }\n }\n return 0\n }\n return array\n .map((value, index) => {\n return {\n value,\n index,\n key: getKey ? getKey(value, index) : null,\n }\n })\n .sort((a, b) => {\n let order = compare(a, b)\n if (!order) {\n // make stable https://en.wikipedia.org/wiki/Sorting_algorithm#Stability\n order = a.index - b.index\n }\n return order * +reverse\n })\n .map((item) => item.value)\n}\n\nexport const getColumnById = function (\n table: {\n columns: TableColumnCtx[]\n },\n columnId: string\n): null | TableColumnCtx {\n let column = null\n table.columns.forEach((item) => {\n if (item.id === columnId) {\n column = item\n }\n })\n return column\n}\n\nexport const getColumnByKey = function (\n table: {\n columns: TableColumnCtx[]\n },\n columnKey: string\n): TableColumnCtx {\n let column = null\n for (let i = 0; i < table.columns.length; i++) {\n const item = table.columns[i]\n if (item.columnKey === columnKey) {\n column = item\n break\n }\n }\n if (!column)\n throwError('ElTable', `No column matching with column-key: ${columnKey}`)\n return column\n}\n\nexport const getColumnByCell = function (\n table: {\n columns: TableColumnCtx[]\n },\n cell: HTMLElement,\n namespace: string\n): null | TableColumnCtx {\n const matches = (cell.className || '').match(\n new RegExp(`${namespace}-table_[^\\\\s]+`, 'gm')\n )\n if (matches) {\n return getColumnById(table, matches[0])\n }\n return null\n}\n\nexport const getRowIdentity = (\n row: T,\n rowKey: string | ((row: T) => any)\n): string => {\n if (!row) throw new Error('Row is required when get row identity')\n if (typeof rowKey === 'string') {\n if (!rowKey.includes('.')) {\n return `${row[rowKey]}`\n }\n const key = rowKey.split('.')\n let current = row\n for (const element of key) {\n current = current[element]\n }\n return `${current}`\n } else if (typeof rowKey === 'function') {\n return rowKey.call(null, row)\n }\n}\n\nexport const getKeysMap = function (\n array: T[],\n rowKey: string\n): Record {\n const arrayMap = {}\n ;(array || []).forEach((row, index) => {\n arrayMap[getRowIdentity(row, rowKey)] = { row, index }\n })\n return arrayMap\n}\n\nexport function mergeOptions(defaults: T, config: K): T & K {\n const options = {} as T & K\n let key\n for (key in defaults) {\n options[key] = defaults[key]\n }\n for (key in config) {\n if (hasOwn(config as unknown as Record, key)) {\n const value = config[key]\n if (typeof value !== 'undefined') {\n options[key] = value\n }\n }\n }\n return options\n}\n\nexport function parseWidth(width: number | string): number | string {\n if (width === '') return width\n if (width !== undefined) {\n width = Number.parseInt(width as string, 10)\n if (Number.isNaN(width)) {\n width = ''\n }\n }\n return width\n}\n\nexport function parseMinWidth(minWidth: number | string): number | string {\n if (minWidth === '') return minWidth\n if (minWidth !== undefined) {\n minWidth = parseWidth(minWidth)\n if (Number.isNaN(minWidth)) {\n minWidth = 80\n }\n }\n return minWidth\n}\n\nexport function parseHeight(height: number | string) {\n if (typeof height === 'number') {\n return height\n }\n if (typeof height === 'string') {\n if (/^\\d+(?:px)?$/.test(height)) {\n return Number.parseInt(height, 10)\n } else {\n return height\n }\n }\n return null\n}\n\n// https://github.com/reduxjs/redux/blob/master/src/compose.js\nexport function compose(...funcs) {\n if (funcs.length === 0) {\n return (arg) => arg\n }\n if (funcs.length === 1) {\n return funcs[0]\n }\n return funcs.reduce(\n (a, b) =>\n (...args) =>\n a(b(...args))\n )\n}\n\nexport function toggleRowStatus(\n statusArr: T[],\n row: T,\n newVal?: boolean,\n tableTreeProps?: TreeProps,\n selectable?: (row: T, index?: number) => boolean,\n rowIndex?: number\n): boolean {\n let _rowIndex = rowIndex ?? 0\n let changed = false\n const index = statusArr.indexOf(row)\n const included = index !== -1\n const isRowSelectable = selectable?.call(null, row, rowIndex)\n\n const toggleStatus = (type: 'add' | 'remove') => {\n if (type === 'add') {\n statusArr.push(row)\n } else {\n statusArr.splice(index, 1)\n }\n changed = true\n }\n const getChildrenCount = (row: T) => {\n let count = 0\n const children = tableTreeProps?.children && row[tableTreeProps.children]\n if (children && isArray(children)) {\n count += children.length\n children.forEach((item) => {\n count += getChildrenCount(item)\n })\n }\n return count\n }\n\n if (!selectable || isRowSelectable) {\n if (isBoolean(newVal)) {\n if (newVal && !included) {\n toggleStatus('add')\n } else if (!newVal && included) {\n toggleStatus('remove')\n }\n } else {\n included ? toggleStatus('remove') : toggleStatus('add')\n }\n }\n\n if (\n !tableTreeProps?.checkStrictly &&\n tableTreeProps?.children &&\n isArray(row[tableTreeProps.children])\n ) {\n row[tableTreeProps.children].forEach((item) => {\n toggleRowStatus(\n statusArr,\n item,\n newVal ?? !included,\n tableTreeProps,\n selectable,\n _rowIndex + 1\n )\n _rowIndex += getChildrenCount(item) + 1\n })\n }\n return changed\n}\n\nexport function walkTreeNode(\n root,\n cb,\n childrenKey = 'children',\n lazyKey = 'hasChildren'\n) {\n const isNil = (array) => !(Array.isArray(array) && array.length)\n\n function _walker(parent, children, level) {\n cb(parent, children, level)\n children.forEach((item) => {\n if (item[lazyKey]) {\n cb(item, null, level + 1)\n return\n }\n const children = item[childrenKey]\n if (!isNil(children)) {\n _walker(item, children, level + 1)\n }\n })\n }\n\n root.forEach((item) => {\n if (item[lazyKey]) {\n cb(item, null, 0)\n return\n }\n const children = item[childrenKey]\n if (!isNil(children)) {\n _walker(item, children, 0)\n }\n })\n}\n\nexport let removePopper: RemovePopperFn | null = null\n\nexport function createTablePopper(\n props: TableOverflowTooltipOptions,\n popperContent: string,\n trigger: HTMLElement,\n table: Table<[]>\n) {\n if (removePopper?.trigger === trigger) {\n return\n }\n removePopper?.()\n const parentNode = table?.refs.tableWrapper\n const ns = parentNode?.dataset.prefix\n const popperOptions = {\n strategy: 'fixed',\n ...props.popperOptions,\n }\n const vm = createVNode(ElTooltip, {\n content: popperContent,\n virtualTriggering: true,\n virtualRef: trigger,\n appendTo: parentNode,\n placement: 'top',\n transition: 'none', // Default does not require transition\n offset: 0,\n hideAfter: 0,\n ...props,\n popperOptions,\n onHide: () => {\n removePopper?.()\n },\n })\n vm.appContext = { ...table.appContext, ...table }\n const container = document.createElement('div')\n render(vm, container)\n vm.component!.exposed!.onOpen()\n const scrollContainer = parentNode?.querySelector(`.${ns}-scrollbar__wrap`)\n removePopper = () => {\n render(null, container)\n scrollContainer?.removeEventListener('scroll', removePopper!)\n removePopper = null\n }\n removePopper.trigger = trigger\n scrollContainer?.addEventListener('scroll', removePopper)\n}\n\nfunction getCurrentColumns(column: TableColumnCtx): TableColumnCtx[] {\n if (column.children) {\n return flatMap(column.children, getCurrentColumns)\n } else {\n return [column]\n }\n}\n\nfunction getColSpan(colSpan: number, column: TableColumnCtx) {\n return colSpan + column.colSpan\n}\n\nexport const isFixedColumn = (\n index: number,\n fixed: string | boolean,\n store: any,\n realColumns?: TableColumnCtx[]\n) => {\n let start = 0\n let after = index\n const columns = store.states.columns.value\n if (realColumns) {\n // fixed column supported in grouped header\n const curColumns = getCurrentColumns(realColumns[index])\n const preColumns = columns.slice(0, columns.indexOf(curColumns[0]))\n\n start = preColumns.reduce(getColSpan, 0)\n after = start + curColumns.reduce(getColSpan, 0) - 1\n } else {\n start = index\n }\n let fixedLayout\n switch (fixed) {\n case 'left':\n if (after < store.states.fixedLeafColumnsLength.value) {\n fixedLayout = 'left'\n }\n break\n case 'right':\n if (\n start >=\n columns.length - store.states.rightFixedLeafColumnsLength.value\n ) {\n fixedLayout = 'right'\n }\n break\n default:\n if (after < store.states.fixedLeafColumnsLength.value) {\n fixedLayout = 'left'\n } else if (\n start >=\n columns.length - store.states.rightFixedLeafColumnsLength.value\n ) {\n fixedLayout = 'right'\n }\n }\n return fixedLayout\n ? {\n direction: fixedLayout,\n start,\n after,\n }\n : {}\n}\n\nexport const getFixedColumnsClass = (\n namespace: string,\n index: number,\n fixed: string | boolean,\n store: any,\n realColumns?: TableColumnCtx[],\n offset = 0\n) => {\n const classes: string[] = []\n const { direction, start, after } = isFixedColumn(\n index,\n fixed,\n store,\n realColumns\n )\n if (direction) {\n const isLeft = direction === 'left'\n classes.push(`${namespace}-fixed-column--${direction}`)\n if (\n isLeft &&\n after + offset === store.states.fixedLeafColumnsLength.value - 1\n ) {\n classes.push('is-last-column')\n } else if (\n !isLeft &&\n start - offset ===\n store.states.columns.value.length -\n store.states.rightFixedLeafColumnsLength.value\n ) {\n classes.push('is-first-column')\n }\n }\n return classes\n}\n\nfunction getOffset(offset: number, column: TableColumnCtx) {\n return (\n offset +\n (column.realWidth === null || Number.isNaN(column.realWidth)\n ? Number(column.width)\n : column.realWidth)\n )\n}\n\nexport const getFixedColumnOffset = (\n index: number,\n fixed: string | boolean,\n store: any,\n realColumns?: TableColumnCtx[]\n) => {\n const {\n direction,\n start = 0,\n after = 0,\n } = isFixedColumn(index, fixed, store, realColumns)\n if (!direction) {\n return\n }\n const styles: any = {}\n const isLeft = direction === 'left'\n const columns = store.states.columns.value\n if (isLeft) {\n styles.left = columns.slice(0, start).reduce(getOffset, 0)\n } else {\n styles.right = columns\n .slice(after + 1)\n .reverse()\n .reduce(getOffset, 0)\n }\n return styles\n}\n\nexport const ensurePosition = (style, key: string) => {\n if (!style) return\n if (!Number.isNaN(style[key])) {\n style[key] = `${style[key]}px`\n }\n}\n"],"names":["get","isObject","throwError","hasOwn","isArray","isBoolean","removePopper","createVNode","ElTooltip","render","flatMap"],"mappings":";;;;;;;;;;;;AAUY,MAAC,OAAO,GAAG,SAAS,KAAK,EAAE;AACvC,EAAE,IAAI,EAAE,CAAC;AACT,EAAE,OAAO,CAAC,EAAE,GAAG,KAAK,CAAC,MAAM,KAAK,IAAI,GAAG,KAAK,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AACjE,EAAE;AACU,MAAC,OAAO,GAAG,SAAS,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE;AAC7E,EAAE,IAAI,CAAC,OAAO,IAAI,CAAC,UAAU,KAAK,CAAC,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE;AACvF,IAAI,OAAO,KAAK,CAAC;AACjB,GAAG;AACH,EAAE,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE;AACnC,IAAI,OAAO,GAAG,OAAO,KAAK,YAAY,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;AAChD,GA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