yuyeon 0.0.28 → 0.0.30
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/style.css +1 -1
- package/dist/yuyeon.js +1593 -1500
- package/dist/yuyeon.umd.cjs +3 -3
- package/lib/components/field-input/YFieldInput.mjs +2 -0
- package/lib/components/field-input/YFieldInput.mjs.map +1 -1
- package/lib/components/tab/YTab.scss +70 -62
- package/lib/components/table/YDataTable.mjs +116 -28
- package/lib/components/table/YDataTable.mjs.map +1 -1
- package/lib/components/table/YDataTableControl.mjs +18 -12
- package/lib/components/table/YDataTableControl.mjs.map +1 -1
- package/lib/components/table/composibles/pagination.mjs +16 -1
- package/lib/components/table/composibles/pagination.mjs.map +1 -1
- package/lib/components/tree-view/YTreeView.mjs +5 -3
- package/lib/components/tree-view/YTreeView.mjs.map +1 -1
- package/lib/components/tree-view/YTreeViewNode.mjs +4 -3
- package/lib/components/tree-view/YTreeViewNode.mjs.map +1 -1
- package/lib/components/tree-view/util.mjs +1 -1
- package/lib/components/tree-view/util.mjs.map +1 -1
- package/package.json +1 -1
- package/types/components/table/YDataTable.d.ts +18 -10
- package/types/components/table/YDataTableControl.d.ts +69 -1
- package/types/components/table/composibles/pagination.d.ts +8 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"YTreeView.mjs","names":["computed","defineComponent","onMounted","provide","ref","shallowRef","watch","watchEffect","useModelDuplex","useRender","differenceBetween","isColorValue","deepEqual","getObjectValueByPath","hasOwnProperty","debounce","chooseProps","YProgressBar","YTreeViewNode","pressYTreeViewNodeProps","filterTreeItem","filterTreeItems","getKeys","treeViewNodeProps","YTreeView","name","props","expanded","type","Array","default","active","multipleActive","Boolean","activeStrategy","String","selected","selectStrategy","returnItem","defaultExpand","Number","filter","Function","searchDebounceWait","emits","setup","_ref","slots","emit","expose","nodes","expandedSet","Set","selectedSet","activeSet","excludedSet","filterItemsFn","excludeItem","expandedCache","searchLoading","items","search","arguments","length","undefined","excluded","value","diff","forEach","key","updateExpanded","item","itemKey","itemText","itemChildren","expand","getDescendants","descendants","childKeys","push","childKey","getNodeKey","itemOrKey","updateNodes","parentKey","level","children","exist","existNode","vnode","indeterminate","node","map","child","add","issueVnodeState","to","isArray","delete","neo","deep","until","Object","entries","_ref2","emitExpanded","updateActive","event","inactiveKey","keys","activeSingleModifier","getModifierState","descendant","updateSelected","arr","emitActive","emitSelected","stateWatcher","stateSet","updater","emitter","valuesOfKey","v","old","oldKeys","nodeKey","neoKeys","k","oldSelected","clear","isExcluded","has","register","activeValue","selectedValue","renderLeaves","leaf","classes","styles","color","activeColor","_createVNode","_Fragment","_createTextVNode"],"sources":["../../../src/components/tree-view/YTreeView.tsx"],"sourcesContent":["import {\r\n PropType,\r\n Ref,\r\n VNode,\r\n computed,\r\n defineComponent,\r\n onMounted,\r\n provide,\r\n ref,\r\n shallowRef,\r\n watch,\r\n watchEffect,\r\n} from 'vue';\r\n\r\nimport { useModelDuplex } from '../../composables/communication';\r\nimport { useRender } from '../../composables/component';\r\nimport { CandidateKey } from '../../types';\r\nimport { differenceBetween } from '../../util/array';\r\nimport { isColorValue } from '../../util/color';\r\nimport {\r\n deepEqual,\r\n getObjectValueByPath,\r\n hasOwnProperty,\r\n} from '../../util/common';\r\nimport { debounce } from '../../util/debounce';\r\nimport { chooseProps } from '../../util/vue-component';\r\nimport { YProgressBar } from '../progress-bar';\r\nimport { YTreeViewNode, pressYTreeViewNodeProps } from './YTreeViewNode';\r\nimport { NodeState, TreeviewFilterFn } from './types';\r\nimport { filterTreeItem, filterTreeItems, getKeys } from './util';\r\n\r\nimport './YTreeView.scss';\r\n\r\nconst treeViewNodeProps = pressYTreeViewNodeProps();\r\n\r\nexport const YTreeView = defineComponent({\r\n name: 'YTreeView',\r\n props: {\r\n expanded: {\r\n type: [Array] as PropType<CandidateKey[]>,\r\n default: () => [],\r\n },\r\n active: {\r\n type: [Array] as PropType<CandidateKey[]>,\r\n default: () => [],\r\n },\r\n multipleActive: Boolean,\r\n activeStrategy: {\r\n type: String as PropType<'independent' | 'cascade'>, // TODO: 'leaf'\r\n default: 'independent',\r\n },\r\n selected: {\r\n type: [Array] as PropType<CandidateKey[]>,\r\n default: () => [],\r\n },\r\n selectStrategy: {\r\n type: String as PropType<'independent' | 'cascade'>, // TODO: 'leaf'\r\n default: 'leaf',\r\n },\r\n returnItem: Boolean,\r\n defaultExpand: [Boolean, String, Number],\r\n filter: Function as PropType<TreeviewFilterFn>,\r\n searchDebounceWait: {\r\n type: Number as PropType<number>,\r\n default: 700,\r\n },\r\n ...treeViewNodeProps,\r\n },\r\n emits: ['update:expanded', 'update:active', 'update:selected'],\r\n setup(props, { slots, emit, expose }) {\r\n const nodes = ref<Record<CandidateKey, any>>({});\r\n\r\n const expanded = useModelDuplex(props, 'expanded');\r\n const active = useModelDuplex(props, 'active');\r\n const selected = useModelDuplex(props, 'selected');\r\n\r\n const expandedSet = ref(new Set<CandidateKey>());\r\n const selectedSet = ref(new Set<CandidateKey>());\r\n const activeSet = ref(new Set<CandidateKey>());\r\n const excludedSet = ref(new Set<CandidateKey>());\r\n const filterItemsFn = shallowRef(\r\n debounce(excludeItem, props.searchDebounceWait),\r\n );\r\n const expandedCache = ref<CandidateKey[]>([]);\r\n const searchLoading = shallowRef(false);\r\n\r\n function excludeItem(items: any[], search = '', filter = filterTreeItem) {\r\n const excluded = new Set<CandidateKey>();\r\n if (!search) {\r\n searchLoading.value = false;\r\n excludedSet.value = excluded;\r\n const diff = differenceBetween(expandedCache.value, [\r\n ...expandedSet.value,\r\n ]);\r\n diff.forEach((key) => {\r\n updateExpanded(key, false);\r\n });\r\n expandedCache.value.forEach((key) => {\r\n updateExpanded(key, true);\r\n });\r\n return;\r\n }\r\n for (const item of items) {\r\n filterTreeItems(\r\n filter,\r\n item,\r\n search ?? '',\r\n props.itemKey,\r\n props.itemText,\r\n props.itemChildren as string,\r\n excluded,\r\n );\r\n }\r\n excludedSet.value = excluded;\r\n searchLoading.value = false;\r\n expand();\r\n }\r\n\r\n watchEffect(() => {\r\n searchLoading.value = true;\r\n filterItemsFn.value(props.items, props.search, props.filter);\r\n });\r\n\r\n // Util Methods\r\n function getDescendants(\r\n key: CandidateKey,\r\n descendants: CandidateKey[] = [],\r\n ) {\r\n const { childKeys } = nodes.value[key];\r\n descendants.push(...childKeys);\r\n for (const childKey of childKeys) {\r\n descendants = getDescendants(childKey, descendants);\r\n }\r\n return descendants;\r\n }\r\n\r\n function getNodeKey(itemOrKey: any) {\r\n return props.returnItem\r\n ? getObjectValueByPath(itemOrKey, props.itemKey)\r\n : itemOrKey;\r\n }\r\n\r\n // State Methods\r\n function updateNodes(\r\n items: any[],\r\n parentKey: CandidateKey | null = null,\r\n level = 0,\r\n ) {\r\n for (const item of items) {\r\n const key = getObjectValueByPath(item, props.itemKey);\r\n const children =\r\n getObjectValueByPath(item, props.itemChildren as string) ?? [];\r\n const exist = hasOwnProperty(nodes.value, key);\r\n const existNode = exist\r\n ? nodes.value[key]\r\n : {\r\n vnode: null,\r\n selected: false,\r\n indeterminate: false,\r\n active: false,\r\n expanded: false,\r\n };\r\n const node: NodeState = {\r\n vnode: existNode.vnode,\r\n item,\r\n level,\r\n parentKey,\r\n childKeys: children.map((child: any) =>\r\n getObjectValueByPath(child, props.itemKey),\r\n ),\r\n expanded: children.length > 0 && existNode.expanded,\r\n active: existNode.active,\r\n indeterminate: existNode.indeterminate,\r\n selected: existNode.selected,\r\n };\r\n\r\n updateNodes(children, key, level + 1);\r\n\r\n nodes.value[key] = node;\r\n if (nodes.value[key].expanded) {\r\n expandedSet.value.add(key);\r\n }\r\n if (nodes.value[key].selected) {\r\n expandedSet.value.add(key);\r\n }\r\n if (nodes.value[key].active) {\r\n activeSet.value.add(key);\r\n }\r\n\r\n issueVnodeState(key);\r\n }\r\n }\r\n\r\n function updateExpanded(key: CandidateKey, to: boolean) {\r\n if (!(key in nodes.value)) return;\r\n const node = nodes.value[key];\r\n const children = getObjectValueByPath(\r\n node.item,\r\n props.itemChildren as string,\r\n );\r\n if (Array.isArray(children) && children.length > 0) {\r\n to ? expandedSet.value.add(key) : expandedSet.value.delete(key);\r\n node.expanded = to;\r\n issueVnodeState(key);\r\n }\r\n }\r\n\r\n watch(\r\n expandedSet,\r\n (neo) => {\r\n if (!props.search) {\r\n expandedCache.value = [...neo];\r\n }\r\n },\r\n { deep: true },\r\n );\r\n\r\n function expand(until: boolean | string | number = true) {\r\n Object.entries(nodes.value).forEach(([key, node]) => {\r\n if (until === true || until >= node.level) {\r\n updateExpanded(key, true);\r\n }\r\n });\r\n emitExpanded();\r\n return expandedSet.value;\r\n }\r\n\r\n function updateActive(key: CandidateKey, to: boolean, event?: MouseEvent) {\r\n if (!(key in nodes.value)) return;\r\n const node = nodes.value[key];\r\n let inactiveKey = !to ? key : '';\r\n if (!props.multipleActive) {\r\n [inactiveKey] = activeSet.value.keys();\r\n }\r\n if (to) {\r\n activeSet.value.add(key);\r\n node.active = true;\r\n }\r\n if (inactiveKey && inactiveKey in nodes.value) {\r\n activeSet.value.delete(inactiveKey);\r\n nodes.value[inactiveKey].active = false;\r\n issueVnodeState(inactiveKey);\r\n }\r\n\r\n if (\r\n props.activeSingleModifier &&\r\n event?.getModifierState(props.activeSingleModifier)\r\n ) {\r\n return;\r\n }\r\n\r\n if (props.multipleActive && props.activeStrategy === 'cascade') {\r\n for (const descendant of getDescendants(key)) {\r\n if (descendant in nodes.value) {\r\n to\r\n ? activeSet.value.add(descendant)\r\n : activeSet.value.delete(descendant);\r\n nodes.value[descendant].active = to;\r\n issueVnodeState(descendant);\r\n }\r\n }\r\n }\r\n }\r\n\r\n function updateSelected(key: CandidateKey, to: boolean) {\r\n if (!(key in nodes.value)) return;\r\n const node = nodes.value[key];\r\n\r\n if (to) {\r\n selectedSet.value.add(key);\r\n node.selected = true;\r\n }\r\n\r\n if (!to && key in nodes.value) {\r\n selectedSet.value.delete(key);\r\n nodes.value[key].selected = false;\r\n issueVnodeState(key);\r\n }\r\n\r\n if (props.selectStrategy === 'cascade') {\r\n for (const descendant of getDescendants(key)) {\r\n if (descendant in nodes.value) {\r\n to\r\n ? selectedSet.value.add(descendant)\r\n : selectedSet.value.delete(descendant);\r\n nodes.value[descendant].selected = to;\r\n issueVnodeState(descendant);\r\n }\r\n }\r\n }\r\n }\r\n\r\n function emitExpanded() {\r\n const arr = [...expandedSet.value];\r\n expanded.value = props.returnItem\r\n ? arr.map((key) => nodes.value[key].item)\r\n : arr;\r\n }\r\n\r\n function emitActive() {\r\n const arr = [...activeSet.value];\r\n active.value = props.returnItem\r\n ? arr.map((key) => nodes.value[key].item)\r\n : arr;\r\n }\r\n\r\n function emitSelected() {\r\n const arr = [...selectedSet.value];\r\n selected.value = props.returnItem\r\n ? arr.map((key) => nodes.value[key].item)\r\n : arr;\r\n }\r\n\r\n function stateWatcher(\r\n value: any[],\r\n stateSet: Ref<Set<CandidateKey>>,\r\n updater: (key: CandidateKey, to: boolean) => void,\r\n emitter: () => void,\r\n ) {\r\n const valuesOfKey = props.returnItem\r\n ? value.map((v) => getObjectValueByPath(v, props.itemKey))\r\n : value;\r\n const old = [...stateSet.value];\r\n if (deepEqual(old, valuesOfKey)) {\r\n return;\r\n }\r\n old.forEach((key) => updater(key, false));\r\n valuesOfKey.forEach((key) => updater(key, true));\r\n emitter();\r\n }\r\n\r\n watch(expanded, (neo) => {\r\n stateWatcher(neo, expandedSet, updateExpanded, emitExpanded);\r\n });\r\n\r\n watch(active, (neo) => {\r\n stateWatcher(neo, activeSet, updateActive, emitActive);\r\n });\r\n\r\n watch(selected, (neo) => {\r\n stateWatcher(neo, selectedSet, updateSelected, emitSelected);\r\n });\r\n\r\n watch(\r\n () => props.items,\r\n (neo: any[]) => {\r\n const oldKeys = Object.keys(nodes.value).map((nodeKey) =>\r\n getObjectValueByPath(nodes.value[nodeKey].item, props.itemKey),\r\n );\r\n const neoKeys = getKeys(\r\n neo,\r\n props.itemKey,\r\n props.itemChildren as string,\r\n );\r\n const diff = differenceBetween(oldKeys, neoKeys);\r\n if (diff.length < 1 && neoKeys.length < oldKeys.length) {\r\n return;\r\n }\r\n diff.forEach((k) => delete nodes.value[k]);\r\n\r\n // init\r\n const oldSelected = [...selectedSet.value];\r\n selectedSet.value.clear();\r\n expandedSet.value.clear();\r\n activeSet.value.clear();\r\n updateNodes(neo);\r\n if (!deepEqual(oldSelected, [...selectedSet.value])) {\r\n emitSelected();\r\n }\r\n },\r\n { deep: true },\r\n );\r\n\r\n // Search\r\n function isExcluded(key: CandidateKey) {\r\n return !!props.search && excludedSet.value.has(key);\r\n }\r\n\r\n // Provide & Issue\r\n function issueVnodeState(key: CandidateKey) {\r\n const node = nodes.value[key];\r\n if (node && node.vnode) {\r\n node.vnode.active = node.active;\r\n node.vnode.selected = node.selected;\r\n node.vnode.indeterminate = node.indeterminate;\r\n node.vnode.expanded = node.expanded;\r\n }\r\n }\r\n\r\n function register(key: CandidateKey, vnode: VNode) {\r\n if (nodes.value[key]) {\r\n nodes.value[key].vnode = vnode;\r\n }\r\n\r\n issueVnodeState(key);\r\n }\r\n\r\n updateNodes(props.items);\r\n\r\n for (const activeValue of props.active.map(getNodeKey)) {\r\n updateActive(activeValue, true);\r\n }\r\n\r\n for (const selectedValue of props.selected.map(getNodeKey)) {\r\n updateSelected(selectedValue, true);\r\n }\r\n\r\n provide('tree-view', {\r\n register,\r\n updateExpanded,\r\n updateActive,\r\n updateSelected,\r\n emitExpanded,\r\n emitActive,\r\n emitSelected,\r\n isExcluded,\r\n searchLoading,\r\n });\r\n\r\n const renderLeaves = computed(() => {\r\n return props.items.filter((leaf) => {\r\n return !isExcluded(getObjectValueByPath(leaf, props.itemKey));\r\n });\r\n });\r\n\r\n const classes = computed(() => {\r\n return {\r\n 'y-tree-view': true,\r\n };\r\n });\r\n\r\n const styles = computed(() => {\r\n let color = props.activeColor;\r\n if (props.activeColor && !isColorValue(props.activeColor)) {\r\n color = `var(--y-theme-${props.activeColor})`;\r\n }\r\n return {\r\n [`--y-tree-view__active-color`]: color,\r\n };\r\n });\r\n\r\n onMounted(() => {\r\n if (props.defaultExpand !== undefined) {\r\n expandedCache.value = [...expand(props.defaultExpand)];\r\n } else {\r\n expanded.value.forEach((v: any) => updateExpanded(getNodeKey(v), true));\r\n emitExpanded();\r\n }\r\n });\r\n\r\n expose({\r\n expand,\r\n });\r\n\r\n useRender(() => {\r\n return (\r\n <>\r\n <div class={classes.value} style={styles.value} role=\"tree\">\r\n {searchLoading.value && <YProgressBar indeterminate />}\r\n {renderLeaves.value.length > 0 ? (\r\n renderLeaves.value.map((leaf) => {\r\n return (\r\n <YTreeViewNode\r\n v-slots={slots}\r\n {...{\r\n ...chooseProps(props, treeViewNodeProps),\r\n item: leaf,\r\n level: 0,\r\n }}\r\n ></YTreeViewNode>\r\n );\r\n })\r\n ) : (\r\n <div class=\"y-tree-view__no-data\">\r\n {slots['no-data'] ? slots['no-data']() : <span>No Data</span>}\r\n </div>\r\n )}\r\n </div>\r\n </>\r\n );\r\n });\r\n\r\n return {\r\n nodes,\r\n expandedSet,\r\n selectedSet,\r\n activeSet,\r\n excludedSet,\r\n searchLoading,\r\n expandedCache,\r\n };\r\n },\r\n});\r\n\r\nexport type YTreeView = InstanceType<typeof YTreeView>;\r\n"],"mappings":";AAAA,SAIEA,QAAQ,EACRC,eAAe,EACfC,SAAS,EACTC,OAAO,EACPC,GAAG,EACHC,UAAU,EACVC,KAAK,EACLC,WAAW,QACN,KAAK;AAAC,SAEJC,cAAc;AAAA,SACdC,SAAS;AAAA,SAETC,iBAAiB;AAAA,SACjBC,YAAY;AAAA,SAEnBC,SAAS,EACTC,oBAAoB,EACpBC,cAAc;AAAA,SAEPC,QAAQ;AAAA,SACRC,WAAW;AAAA,SACXC,YAAY;AAAA,SACZC,aAAa,EAAEC,uBAAuB;AAAA,SAEtCC,cAAc,EAAEC,eAAe,EAAEC,OAAO;AAEjD;AAEA,MAAMC,iBAAiB,GAAGJ,uBAAuB,CAAC,CAAC;AAEnD,OAAO,MAAMK,SAAS,G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AAK;QAC/B,OAAAK,YAAA,CAAA3H,aAAA;UAIM,GAAGF,WAAW,CAACU,KAAK,EAAEH,iBAAiB,CAAC;UACxCgD,IAAI,EAAEiE,IAAI;UACVnD,KAAK,EAAE;QAAC,GAJDtC,KAAK;MAQpB,CAAC,CAAC,GAAA8F,YAAA;QAAA,SAES;MAAsB,IAC9B9F,KAAK,CAAC,SAAS,CAAC,GAAGA,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,GAAA8F,YAAA,gBAAAE,gBAAA,aAAuB,EAEhE;IAIT,CAAC,CAAC;IAEF,OAAO;MACL7F,KAAK;MACLC,WAAW;MACXE,WAAW;MACXC,SAAS;MACTC,WAAW;MACXI,aAAa;MACbD;IACF,CAAC;EACH;AACF,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"YTreeView.mjs","names":["computed","defineComponent","onMounted","provide","ref","shallowRef","watch","watchEffect","useModelDuplex","useRender","differenceBetween","isColorValue","deepEqual","getObjectValueByPath","hasOwnProperty","debounce","chooseProps","YProgressBar","YTreeViewNode","pressYTreeViewNodeProps","filterTreeItem","filterTreeItems","getKeys","treeViewNodeProps","YTreeView","name","props","expanded","type","Array","default","active","multipleActive","Boolean","activeStrategy","String","selected","selectStrategy","returnItem","defaultExpand","Number","filter","Function","searchDebounceWait","emits","setup","_ref","slots","emit","expose","nodes","expandedSet","Set","selectedSet","activeSet","excludedSet","filterItemsFn","excludeItem","expandedCache","searchLoading","items","search","arguments","length","undefined","excluded","value","diff","forEach","key","updateExpanded","item","itemKey","itemText","itemChildren","expand","getDescendants","descendants","childKeys","push","childKey","getNodeKey","itemOrKey","updateNodes","parentKey","level","children","exist","existNode","vnode","indeterminate","node","map","child","add","issueVnodeState","to","isArray","delete","neo","deep","until","Object","entries","_ref2","emitExpanded","updateActive","event","inactiveKey","keys","activeSingleModifier","getModifierState","descendant","updateSelected","arr","emitActive","emitSelected","stateWatcher","stateSet","updater","emitter","valuesOfKey","v","old","oldKeys","nodeKey","neoKeys","k","oldSelected","clear","isExcluded","has","register","activeValue","selectedValue","renderLeaves","leaf","classes","styles","color","activeColor","_createVNode","_Fragment","_mergeProps","_createTextVNode"],"sources":["../../../src/components/tree-view/YTreeView.tsx"],"sourcesContent":["import {\r\n PropType,\r\n Ref,\r\n VNode,\r\n computed,\r\n defineComponent,\r\n onMounted,\r\n provide,\r\n ref,\r\n shallowRef,\r\n watch,\r\n watchEffect,\r\n} from 'vue';\r\n\r\nimport { useModelDuplex } from '../../composables/communication';\r\nimport { useRender } from '../../composables/component';\r\nimport { CandidateKey } from '../../types';\r\nimport { differenceBetween } from '../../util/array';\r\nimport { isColorValue } from '../../util/color';\r\nimport {\r\n deepEqual,\r\n getObjectValueByPath,\r\n hasOwnProperty,\r\n} from '../../util/common';\r\nimport { debounce } from '../../util/debounce';\r\nimport { chooseProps } from '../../util/vue-component';\r\nimport { YProgressBar } from '../progress-bar';\r\nimport { YTreeViewNode, pressYTreeViewNodeProps } from './YTreeViewNode';\r\nimport { NodeState, TreeviewFilterFn } from './types';\r\nimport { filterTreeItem, filterTreeItems, getKeys } from './util';\r\n\r\nimport './YTreeView.scss';\r\n\r\nconst treeViewNodeProps = pressYTreeViewNodeProps();\r\n\r\nexport const YTreeView = defineComponent({\r\n name: 'YTreeView',\r\n props: {\r\n expanded: {\r\n type: [Array] as PropType<CandidateKey[]>,\r\n default: () => [],\r\n },\r\n active: {\r\n type: [Array] as PropType<CandidateKey[]>,\r\n default: () => [],\r\n },\r\n multipleActive: Boolean,\r\n activeStrategy: {\r\n type: String as PropType<'independent' | 'cascade'>, // TODO: 'leaf'\r\n default: 'independent',\r\n },\r\n selected: {\r\n type: [Array] as PropType<CandidateKey[]>,\r\n default: () => [],\r\n },\r\n selectStrategy: {\r\n type: String as PropType<'independent' | 'cascade'>, // TODO: 'leaf'\r\n default: 'leaf',\r\n },\r\n returnItem: Boolean,\r\n defaultExpand: [Boolean, String, Number],\r\n filter: Function as PropType<TreeviewFilterFn>,\r\n searchDebounceWait: {\r\n type: Number as PropType<number>,\r\n default: 700,\r\n },\r\n ...treeViewNodeProps,\r\n },\r\n emits: ['update:expanded', 'update:active', 'update:selected'],\r\n setup(props, { slots, emit, expose }) {\r\n const nodes = ref<Record<CandidateKey, any>>({});\r\n\r\n const expanded = useModelDuplex(props, 'expanded');\r\n const active = useModelDuplex(props, 'active');\r\n const selected = useModelDuplex(props, 'selected');\r\n\r\n const expandedSet = ref(new Set<CandidateKey>());\r\n const selectedSet = ref(new Set<CandidateKey>());\r\n const activeSet = ref(new Set<CandidateKey>());\r\n const excludedSet = ref(new Set<CandidateKey>());\r\n const filterItemsFn = shallowRef(\r\n debounce(excludeItem, props.searchDebounceWait),\r\n );\r\n const expandedCache = ref<CandidateKey[]>([]);\r\n const searchLoading = shallowRef(false);\r\n\r\n function excludeItem(items: any[], search = '', filter = filterTreeItem) {\r\n const excluded = new Set<CandidateKey>();\r\n if (!search) {\r\n searchLoading.value = false;\r\n excludedSet.value = excluded;\r\n const diff = differenceBetween(expandedCache.value, [\r\n ...expandedSet.value,\r\n ]);\r\n diff.forEach((key) => {\r\n updateExpanded(key, false);\r\n });\r\n expandedCache.value.forEach((key) => {\r\n updateExpanded(key, true);\r\n });\r\n return;\r\n }\r\n for (const item of items) {\r\n filterTreeItems(\r\n filter,\r\n item,\r\n search ?? '',\r\n props.itemKey,\r\n props.itemText,\r\n props.itemChildren as string,\r\n excluded,\r\n );\r\n }\r\n excludedSet.value = excluded;\r\n searchLoading.value = false;\r\n expand();\r\n }\r\n\r\n watchEffect(() => {\r\n searchLoading.value = true;\r\n filterItemsFn.value(props.items, props.search, props.filter);\r\n });\r\n\r\n // Util Methods\r\n function getDescendants(\r\n key: CandidateKey,\r\n descendants: CandidateKey[] = [],\r\n ) {\r\n const { childKeys } = nodes.value[key];\r\n descendants.push(...childKeys);\r\n for (const childKey of childKeys) {\r\n descendants = getDescendants(childKey, descendants);\r\n }\r\n return descendants;\r\n }\r\n\r\n function getNodeKey(itemOrKey: any) {\r\n return props.returnItem\r\n ? getObjectValueByPath(itemOrKey, props.itemKey)\r\n : itemOrKey;\r\n }\r\n\r\n // State Methods\r\n function updateNodes(\r\n items: any[],\r\n parentKey: CandidateKey | null = null,\r\n level = 0,\r\n ) {\r\n for (const item of items) {\r\n const key = getObjectValueByPath(item, props.itemKey);\r\n const children =\r\n getObjectValueByPath(item, props.itemChildren as string) ?? [];\r\n const exist = hasOwnProperty(nodes.value, key);\r\n const existNode = exist\r\n ? nodes.value[key]\r\n : {\r\n vnode: null,\r\n selected: false,\r\n indeterminate: false,\r\n active: false,\r\n expanded: false,\r\n };\r\n const node: NodeState = {\r\n vnode: existNode.vnode,\r\n item,\r\n level,\r\n parentKey,\r\n childKeys: children.map((child: any) =>\r\n getObjectValueByPath(child, props.itemKey),\r\n ),\r\n expanded: children.length > 0 && existNode.expanded,\r\n active: existNode.active,\r\n indeterminate: existNode.indeterminate,\r\n selected: existNode.selected,\r\n };\r\n\r\n updateNodes(children, key, level + 1);\r\n\r\n nodes.value[key] = node;\r\n if (nodes.value[key].expanded) {\r\n expandedSet.value.add(key);\r\n }\r\n if (nodes.value[key].selected) {\r\n expandedSet.value.add(key);\r\n }\r\n if (nodes.value[key].active) {\r\n activeSet.value.add(key);\r\n }\r\n\r\n issueVnodeState(key);\r\n }\r\n }\r\n\r\n function updateExpanded(key: CandidateKey, to: boolean) {\r\n if (!(key in nodes.value)) return;\r\n const node = nodes.value[key];\r\n const children = getObjectValueByPath(\r\n node.item,\r\n props.itemChildren as string,\r\n );\r\n if (Array.isArray(children) && children.length > 0) {\r\n to ? expandedSet.value.add(key) : expandedSet.value.delete(key);\r\n node.expanded = to;\r\n issueVnodeState(key);\r\n }\r\n }\r\n\r\n watch(\r\n expandedSet,\r\n (neo) => {\r\n if (!props.search) {\r\n expandedCache.value = [...neo];\r\n }\r\n },\r\n { deep: true },\r\n );\r\n\r\n function expand(until: boolean | string | number = true) {\r\n Object.entries(nodes.value).forEach(([key, node]) => {\r\n if (until === true || until >= node.level) {\r\n updateExpanded(key, true);\r\n }\r\n });\r\n emitExpanded();\r\n return expandedSet.value;\r\n }\r\n\r\n function updateActive(key: CandidateKey, to: boolean, event?: MouseEvent) {\r\n if (!(key in nodes.value)) return;\r\n const node = nodes.value[key];\r\n let inactiveKey = !to ? key : '';\r\n if (!props.multipleActive) {\r\n [inactiveKey] = activeSet.value.keys();\r\n }\r\n if (to) {\r\n activeSet.value.add(key);\r\n node.active = true;\r\n }\r\n if (inactiveKey && inactiveKey in nodes.value) {\r\n activeSet.value.delete(inactiveKey);\r\n nodes.value[inactiveKey].active = false;\r\n issueVnodeState(inactiveKey);\r\n }\r\n\r\n if (\r\n props.activeSingleModifier &&\r\n event?.getModifierState(props.activeSingleModifier)\r\n ) {\r\n return;\r\n }\r\n\r\n if (props.multipleActive && props.activeStrategy === 'cascade') {\r\n for (const descendant of getDescendants(key)) {\r\n if (descendant in nodes.value) {\r\n to\r\n ? activeSet.value.add(descendant)\r\n : activeSet.value.delete(descendant);\r\n nodes.value[descendant].active = to;\r\n issueVnodeState(descendant);\r\n }\r\n }\r\n }\r\n }\r\n\r\n function updateSelected(key: CandidateKey, to: boolean) {\r\n if (!(key in nodes.value)) return;\r\n const node = nodes.value[key];\r\n\r\n if (to) {\r\n selectedSet.value.add(key);\r\n node.selected = true;\r\n }\r\n\r\n if (!to && key in nodes.value) {\r\n selectedSet.value.delete(key);\r\n nodes.value[key].selected = false;\r\n issueVnodeState(key);\r\n }\r\n\r\n if (props.selectStrategy === 'cascade') {\r\n for (const descendant of getDescendants(key)) {\r\n if (descendant in nodes.value) {\r\n to\r\n ? selectedSet.value.add(descendant)\r\n : selectedSet.value.delete(descendant);\r\n nodes.value[descendant].selected = to;\r\n issueVnodeState(descendant);\r\n }\r\n }\r\n }\r\n }\r\n\r\n function emitExpanded() {\r\n const arr = [...expandedSet.value];\r\n expanded.value = props.returnItem\r\n ? arr.map((key) => nodes.value[key].item)\r\n : arr;\r\n }\r\n\r\n function emitActive() {\r\n const arr = [...activeSet.value];\r\n active.value = props.returnItem\r\n ? arr.map((key) => nodes.value[key].item)\r\n : arr;\r\n }\r\n\r\n function emitSelected() {\r\n const arr = [...selectedSet.value];\r\n selected.value = props.returnItem\r\n ? arr.map((key) => nodes.value[key].item)\r\n : arr;\r\n }\r\n\r\n function stateWatcher(\r\n value: any[],\r\n stateSet: Ref<Set<CandidateKey>>,\r\n updater: (key: CandidateKey, to: boolean) => void,\r\n emitter: () => void,\r\n ) {\r\n const valuesOfKey = props.returnItem\r\n ? value.map((v) => getObjectValueByPath(v, props.itemKey))\r\n : value;\r\n const old = [...stateSet.value];\r\n if (deepEqual(old, valuesOfKey)) {\r\n return;\r\n }\r\n old.forEach((key) => updater(key, false));\r\n valuesOfKey.forEach((key) => updater(key, true));\r\n emitter();\r\n }\r\n\r\n watch(expanded, (neo) => {\r\n stateWatcher(neo, expandedSet, updateExpanded, emitExpanded);\r\n });\r\n\r\n watch(active, (neo) => {\r\n stateWatcher(neo, activeSet, updateActive, emitActive);\r\n });\r\n\r\n watch(selected, (neo) => {\r\n stateWatcher(neo, selectedSet, updateSelected, emitSelected);\r\n });\r\n\r\n watch(\r\n () => props.items,\r\n (neo: any[]) => {\r\n const oldKeys = Object.keys(nodes.value).map((nodeKey) =>\r\n getObjectValueByPath(nodes.value[nodeKey].item, props.itemKey),\r\n );\r\n const neoKeys = getKeys(\r\n neo,\r\n props.itemKey,\r\n props.itemChildren as string,\r\n );\r\n const diff = differenceBetween(oldKeys, neoKeys);\r\n if (diff.length < 1 && neoKeys.length < oldKeys.length) {\r\n return;\r\n }\r\n diff.forEach((k) => delete nodes.value[k]);\r\n\r\n // init\r\n const oldSelected = [...selectedSet.value];\r\n selectedSet.value.clear();\r\n expandedSet.value.clear();\r\n activeSet.value.clear();\r\n updateNodes(neo);\r\n if (!deepEqual(oldSelected, [...selectedSet.value])) {\r\n emitSelected();\r\n }\r\n },\r\n { deep: true },\r\n );\r\n\r\n // Search\r\n function isExcluded(key: CandidateKey) {\r\n return !!props.search && excludedSet.value.has(key);\r\n }\r\n\r\n // Provide & Issue\r\n function issueVnodeState(key: CandidateKey) {\r\n const node = nodes.value[key];\r\n if (node && node.vnode) {\r\n node.vnode.active = node.active;\r\n node.vnode.selected = node.selected;\r\n node.vnode.indeterminate = node.indeterminate;\r\n node.vnode.expanded = node.expanded;\r\n }\r\n }\r\n\r\n function register(key: CandidateKey, vnode: VNode) {\r\n if (nodes.value[key]) {\r\n nodes.value[key].vnode = vnode;\r\n }\r\n\r\n issueVnodeState(key);\r\n }\r\n\r\n updateNodes(props.items);\r\n\r\n for (const activeValue of props.active.map(getNodeKey)) {\r\n updateActive(activeValue, true);\r\n }\r\n\r\n for (const selectedValue of props.selected.map(getNodeKey)) {\r\n updateSelected(selectedValue, true);\r\n }\r\n\r\n provide('tree-view', {\r\n register,\r\n updateExpanded,\r\n updateActive,\r\n updateSelected,\r\n emitExpanded,\r\n emitActive,\r\n emitSelected,\r\n isExcluded,\r\n searchLoading,\r\n });\r\n\r\n const renderLeaves = computed(() => {\r\n return props.items.filter((leaf) => {\r\n return !isExcluded(getObjectValueByPath(leaf, props.itemKey));\r\n });\r\n });\r\n\r\n const classes = computed(() => {\r\n return {\r\n 'y-tree-view': true,\r\n };\r\n });\r\n\r\n const styles = computed(() => {\r\n let color = props.activeColor;\r\n if (props.activeColor && !isColorValue(props.activeColor)) {\r\n color = `var(--y-theme-${props.activeColor})`;\r\n }\r\n return {\r\n [`--y-tree-view__active-color`]: color,\r\n };\r\n });\r\n\r\n onMounted(() => {\r\n if (props.defaultExpand !== undefined) {\r\n expandedCache.value = [...expand(props.defaultExpand)];\r\n } else {\r\n expanded.value.forEach((v: any) => updateExpanded(getNodeKey(v), true));\r\n emitExpanded();\r\n }\r\n });\r\n\r\n expose({\r\n expand,\r\n });\r\n\r\n useRender(() => {\r\n return (\r\n <>\r\n <div class={classes.value} style={styles.value} role=\"tree\">\r\n {searchLoading.value && <YProgressBar indeterminate />}\r\n {renderLeaves.value.length > 0 ? (\r\n renderLeaves.value.map((leaf) => {\r\n return (\r\n <YTreeViewNode\r\n v-slots={slots}\r\n key={getObjectValueByPath(leaf, props.itemKey)}\r\n {...{\r\n ...chooseProps(props, treeViewNodeProps),\r\n item: leaf,\r\n level: 0,\r\n }}\r\n ></YTreeViewNode>\r\n );\r\n })\r\n ) : (\r\n <div class=\"y-tree-view__no-data\">\r\n {slots['no-data'] ? slots['no-data']() : <span>No Data</span>}\r\n </div>\r\n )}\r\n </div>\r\n </>\r\n );\r\n });\r\n\r\n return {\r\n nodes,\r\n expandedSet,\r\n selectedSet,\r\n activeSet,\r\n excludedSet,\r\n searchLoading,\r\n expandedCache,\r\n };\r\n },\r\n});\r\n\r\nexport type YTreeView = InstanceType<typeof YTreeView>;\r\n"],"mappings":";AAAA,SAIEA,QAAQ,EACRC,eAAe,EACfC,SAAS,EACTC,OAAO,EACPC,GAAG,EACHC,UAAU,EACVC,KAAK,EACLC,WAAW,QACN,KAAK;AAAC,SAEJC,cAAc;AAAA,SACdC,SAAS;AAAA,SAETC,iBAAiB;AAAA,SACjBC,YAAY;AAAA,SAEnBC,SAAS,EACTC,oBAAoB,EACpBC,cAAc;AAAA,SAEPC,QAAQ;AAAA,SACRC,WAAW;AAAA,SACXC,YAAY;AAAA,SACZC,aAAa,EAAEC,uBAAuB;AAAA,SAEtCC,cAAc,EAAEC,eAAe,EAAEC,OAAO;AAEjD;AAEA,MAAMC,iBAAiB,GAAGJ,uBAAuB,CAAC,CAAC;AAEnD,OAAO,MAAMK,SAAS,GAAGvB,eAAe,CAAC;EACvCwB,IAAI,EAAE,WAAW;EACjBC,KAAK,EAAE;IACLC,QAAQ,EAAE;MACRC,IAAI,EAAE,CAACC,KAAK,CAA6B;MACzCC,OAAO,EAAEA,CAAA,KAAM;IACjB,CAAC;IACDC,MAAM,EAAE;MACNH,IAAI,EAAE,CAACC,KAAK,CAA6B;MACzCC,OAAO,EAAEA,CAAA,KAAM;IACjB,CAAC;IACDE,cAAc,EAAEC,OAA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AES;MAAsB,IAC9B9F,KAAK,CAAC,SAAS,CAAC,GAAGA,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,GAAA8F,YAAA,gBAAAG,gBAAA,aAAuB,EAEhE;IAIT,CAAC,CAAC;IAEF,OAAO;MACL9F,KAAK;MACLC,WAAW;MACXE,WAAW;MACXC,SAAS;MACTC,WAAW;MACXI,aAAa;MACbD;IACF,CAAC;EACH;AACF,CAAC,CAAC"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { computed, defineComponent, h, inject, ref } from 'vue';
|
|
2
|
+
import { pressItemsPropsOptions } from "../../abstract/items.mjs";
|
|
2
3
|
import { useRender } from "../../composables/component.mjs";
|
|
3
4
|
import { getObjectValueByPath } from "../../util/common.mjs";
|
|
4
5
|
import { propsFactory } from "../../util/vue-component.mjs";
|
|
5
6
|
import { YButton } from "../button/index.mjs";
|
|
7
|
+
import { YIconCheckbox, YIconExpand } from "../icons/index.mjs";
|
|
6
8
|
import { YPlate } from "../plate/index.mjs";
|
|
7
9
|
import YTextHighlighter from "../text-highlighter/YTextHighlighter.mjs";
|
|
8
|
-
import { YIconCheckbox, YIconExpand } from "../icons/index.mjs";
|
|
9
10
|
import { YExpandVTransition } from "../transitions/index.mjs";
|
|
10
|
-
import { pressItemsPropsOptions } from "../../abstract/items.mjs";
|
|
11
11
|
export const pressYTreeViewNodeProps = propsFactory({
|
|
12
12
|
search: String,
|
|
13
13
|
disableTransition: Boolean,
|
|
@@ -107,7 +107,8 @@ export const YTreeViewNode = defineComponent({
|
|
|
107
107
|
return h(YTreeViewNode, {
|
|
108
108
|
...props,
|
|
109
109
|
level: (props.level ?? 0) + 1,
|
|
110
|
-
item
|
|
110
|
+
item,
|
|
111
|
+
key: getObjectValueByPath(item, props.itemKey)
|
|
111
112
|
}, slots);
|
|
112
113
|
});
|
|
113
114
|
const indentSpacer = [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"YTreeViewNode.mjs","names":["computed","defineComponent","h","inject","ref","useRender","getObjectValueByPath","propsFactory","YButton","YPlate","YTextHighlighter","YIconCheckbox","YIconExpand","YExpandVTransition","pressItemsPropsOptions","pressYTreeViewNodeProps","search","String","disableTransition","Boolean","enableActive","activeClass","Array","activeSingleModifier","activeColor","type","default","enableSelect","itemKey","YTreeViewNode","name","components","props","item","Object","level","Number","setup","_ref","slots","expose","treeView","expanded","active","selected","immediate","onClick","e","to","value","updateActive","myKey","emitActive","onClickExpand","stopPropagation","updateExpanded","emitExpanded","onClickSelect","updateSelected","emitSelected","children","itemChildren","imLeaf","length","classes","styles","contentText","itemText","slotProps","searchLoading","leaves","filter","leaf","isExcluded","map","indentSpacer","i","push","class","style","variation","checked","leading","text","keyword","trailing","disabled","role","undefined","created","register"],"sources":["../../../src/components/tree-view/YTreeViewNode.ts"],"sourcesContent":["import {\r\n PropType,\r\n VNodeArrayChildren,\r\n computed,\r\n defineComponent,\r\n h,\r\n inject,\r\n ref,\r\n} from 'vue';\r\n\r\nimport { useRender } from '../../composables/component';\r\nimport { getObjectValueByPath } from '../../util/common';\r\nimport { propsFactory } from '../../util/vue-component';\r\nimport { YButton } from '../button';\r\nimport { YPlate } from '../plate';\r\nimport YTextHighlighter from '../text-highlighter/YTextHighlighter';\r\n\r\nimport { YIconCheckbox, YIconExpand } from '../icons';\r\nimport { YExpandVTransition } from '../transitions';\r\nimport { pressItemsPropsOptions } from \"../../abstract/items\";\r\n\r\nexport const pressYTreeViewNodeProps = propsFactory(\r\n {\r\n search: String,\r\n disableTransition: Boolean,\r\n enableActive: Boolean,\r\n activeClass: [String, Array],\r\n activeSingleModifier: String,\r\n activeColor: {\r\n type: String,\r\n default: 'primary',\r\n },\r\n enableSelect: Boolean,\r\n ...pressItemsPropsOptions({\r\n itemKey: 'id',\r\n }),\r\n },\r\n 'YTreeViewNode',\r\n);\r\n\r\nexport const YTreeViewNode = defineComponent({\r\n name: 'YTreeNode',\r\n components: {\r\n YButton,\r\n YIconExpand,\r\n YPlate,\r\n YIconCheckbox,\r\n },\r\n props: {\r\n item: {\r\n type: Object as PropType<any>,\r\n },\r\n level: {\r\n type: Number as PropType<number>,\r\n default: 0,\r\n },\r\n ...pressYTreeViewNodeProps(),\r\n },\r\n setup(props, { slots, expose }) {\r\n const treeView = inject<any>('tree-view');\r\n\r\n const expanded = ref(false);\r\n const active = ref(false);\r\n const selected = ref(false);\r\n const immediate = ref(false);\r\n\r\n function onClick(e: MouseEvent) {\r\n const to = !active.value;\r\n active.value = to;\r\n treeView.updateActive(myKey.value, to, e);\r\n treeView.emitActive();\r\n }\r\n\r\n function onClickExpand(e: MouseEvent) {\r\n e.stopPropagation();\r\n const to = !expanded.value;\r\n expanded.value = to;\r\n treeView.updateExpanded(myKey.value, to);\r\n treeView.emitExpanded();\r\n }\r\n\r\n function onClickSelect(e: MouseEvent) {\r\n e.stopPropagation();\r\n const to = !selected.value;\r\n selected.value = to;\r\n treeView.updateSelected(myKey.value, to);\r\n treeView.emitSelected();\r\n }\r\n\r\n const children = computed(() => {\r\n return props.item?.[props.itemChildren as string] ?? [];\r\n });\r\n\r\n const imLeaf = computed(() => children.value.length < 1);\r\n\r\n const classes = computed(() => {\r\n return {\r\n 'y-tree-view-node': true,\r\n 'y-tree-view-node--leaf': imLeaf.value,\r\n 'y-tree-view-node--expanded': expanded.value,\r\n 'y-tree-view-node--active': active.value,\r\n };\r\n });\r\n\r\n const styles = computed(() => {\r\n return {\r\n '--tree-view-node--level': props.level,\r\n };\r\n });\r\n\r\n const contentText = computed(() => {\r\n return getObjectValueByPath(props.item, props.itemText) ?? '';\r\n });\r\n\r\n const slotProps = computed(() => {\r\n return {\r\n level: props.level,\r\n imLeaf: imLeaf.value,\r\n };\r\n });\r\n\r\n const searchLoading = computed(() => {\r\n return treeView.searchLoading.value;\r\n });\r\n\r\n useRender(() => {\r\n const leaves = children.value\r\n .filter((leaf: any) => {\r\n return !treeView.isExcluded(\r\n getObjectValueByPath(leaf, props.itemKey),\r\n );\r\n })\r\n .map((item: any) => {\r\n return h(\r\n YTreeViewNode,\r\n { ...props, level: (props.level ?? 0) + 1, item },\r\n slots,\r\n );\r\n });\r\n const indentSpacer: VNodeArrayChildren = [];\r\n for (let i = 0; i < props.level; i += 1) {\r\n indentSpacer.push(\r\n h('div', { class: 'y-tree-view-node__indent-spacer' }),\r\n );\r\n }\r\n return h(\r\n 'div',\r\n {\r\n class: classes.value,\r\n style: styles.value,\r\n '.role': 'treeitem',\r\n 'data-level': props.level,\r\n },\r\n [\r\n h(\r\n 'div',\r\n {\r\n class: 'y-tree-view-node__container',\r\n onClick: (e: MouseEvent) =>\r\n props.enableActive ? onClick(e) : void 0,\r\n },\r\n [\r\n h(YPlate),\r\n h('div', { class: 'y-tree-view-node__indents' }, indentSpacer),\r\n /* EXPAND */\r\n !imLeaf.value && leaves.length > 0\r\n ? h(\r\n YButton,\r\n {\r\n class: 'y-tree-view-node__expand-icon',\r\n variation: 'icon',\r\n onClick: (e: MouseEvent) => onClickExpand(e),\r\n },\r\n () => [\r\n slots['expand-icon']\r\n ? slots['expand-icon']()\r\n : h(YIconExpand),\r\n ],\r\n )\r\n : h('i', { class: 'y-tree-view-node__no-expand-icon' }),\r\n props.enableSelect &&\r\n h(\r\n 'div',\r\n {\r\n class: ['y-tree-view-node__select'],\r\n onClick: (e: MouseEvent) => onClickSelect(e),\r\n },\r\n [h(YIconCheckbox, { checked: selected.value })],\r\n ),\r\n /* CONTENT */\r\n h('div', { class: 'y-tree-view-node__content' }, [\r\n slots.leading &&\r\n h(\r\n 'div',\r\n { class: 'y-tree-view-node__leading' },\r\n slots.leading(slotProps.value),\r\n ),\r\n h(\r\n 'div',\r\n { class: 'y-tree-view-node__text' },\r\n slots.default\r\n ? slots.default?.({\r\n text: contentText.value,\r\n item: props.item,\r\n ...slotProps.value\r\n })\r\n : props.search && !searchLoading.value\r\n ? h(YTextHighlighter, {\r\n text: contentText.value,\r\n keyword: props.search,\r\n })\r\n : contentText.value,\r\n ),\r\n slots.trailing &&\r\n h(\r\n 'div',\r\n { class: 'y-tree-view-node__trailing' },\r\n slots.trailing(),\r\n ),\r\n ]),\r\n ],\r\n ),\r\n /* CHILDREN */\r\n children.value.length > 0\r\n ? h(\r\n YExpandVTransition,\r\n { disabled: props.disableTransition },\r\n expanded.value\r\n ? () =>\r\n h(\r\n 'div',\r\n {\r\n class: { 'y-tree-view-node__leaves': true },\r\n role: 'tree',\r\n },\r\n leaves,\r\n )\r\n : undefined,\r\n )\r\n : undefined,\r\n ],\r\n );\r\n });\r\n\r\n const myKey = computed(() => {\r\n return getObjectValueByPath(props.item, props.itemKey);\r\n });\r\n\r\n expose({\r\n myKey,\r\n expanded,\r\n active,\r\n selected,\r\n immediate,\r\n });\r\n\r\n return {\r\n treeView,\r\n myKey,\r\n expanded,\r\n active,\r\n selected,\r\n immediate,\r\n };\r\n },\r\n created() {\r\n this.treeView?.register?.(this.myKey, this);\r\n },\r\n});\r\n\r\nexport type YTreeNode = InstanceType<typeof YTreeViewNode>;\r\n"],"mappings":"AAAA,SAGEA,QAAQ,EACRC,eAAe,EACfC,CAAC,EACDC,MAAM,EACNC,GAAG,QACE,KAAK;AAAC,SAEJC,SAAS;AAAA,SACTC,oBAAoB;AAAA,SACpBC,YAAY;AAAA,SACZC,OAAO;AAAA,SACPC,MAAM;AAAA,OACRC,gBAAgB;AAAA,SAEdC,aAAa,EAAEC,WAAW;AAAA,SAC1BC,kBAAkB;AAAA,SAClBC,sBAAsB;AAE/B,OAAO,MAAMC,uBAAuB,GAAGR,YAAY,CACjD;EACES,MAAM,EAAEC,MAAM;EACdC,iBAAiB,EAAEC,OAAO;EAC1BC,YAAY,EAAED,OAAO;EACrBE,WAAW,EAAE,CAACJ,MAAM,EAAEK,KAAK,CAAC;EAC5BC,oBAAoB,EAAEN,MAAM;EAC5BO,WAAW,EAAE;IACXC,IAAI,EAAER,MAAM;IACZS,OAAO,EAAE;EACX,CAAC;EACDC,YAAY,EAAER,OAAO;EACrB,GAAGL,sBAAsB,CAAC;IACxB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AACF,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"YTreeViewNode.mjs","names":["computed","defineComponent","h","inject","ref","pressItemsPropsOptions","useRender","getObjectValueByPath","propsFactory","YButton","YIconCheckbox","YIconExpand","YPlate","YTextHighlighter","YExpandVTransition","pressYTreeViewNodeProps","search","String","disableTransition","Boolean","enableActive","activeClass","Array","activeSingleModifier","activeColor","type","default","enableSelect","itemKey","YTreeViewNode","name","components","props","item","Object","level","Number","setup","_ref","slots","expose","treeView","expanded","active","selected","immediate","onClick","e","to","value","updateActive","myKey","emitActive","onClickExpand","stopPropagation","updateExpanded","emitExpanded","onClickSelect","updateSelected","emitSelected","children","itemChildren","imLeaf","length","classes","styles","contentText","itemText","slotProps","searchLoading","leaves","filter","leaf","isExcluded","map","key","indentSpacer","i","push","class","style","variation","checked","leading","text","keyword","trailing","disabled","role","undefined","created","register"],"sources":["../../../src/components/tree-view/YTreeViewNode.ts"],"sourcesContent":["import {\n PropType,\n VNodeArrayChildren,\n computed,\n defineComponent,\n h,\n inject,\n ref,\n} from 'vue';\n\nimport { pressItemsPropsOptions } from '../../abstract/items';\nimport { useRender } from '../../composables/component';\nimport { getObjectValueByPath } from '../../util/common';\nimport { propsFactory } from '../../util/vue-component';\nimport { YButton } from '../button';\nimport { YIconCheckbox, YIconExpand } from '../icons';\nimport { YPlate } from '../plate';\nimport YTextHighlighter from '../text-highlighter/YTextHighlighter';\nimport { YExpandVTransition } from '../transitions';\n\nexport const pressYTreeViewNodeProps = propsFactory(\n {\n search: String,\n disableTransition: Boolean,\n enableActive: Boolean,\n activeClass: [String, Array],\n activeSingleModifier: String,\n activeColor: {\n type: String,\n default: 'primary',\n },\n enableSelect: Boolean,\n ...pressItemsPropsOptions({\n itemKey: 'id',\n }),\n },\n 'YTreeViewNode',\n);\n\nexport const YTreeViewNode = defineComponent({\n name: 'YTreeNode',\n components: {\n YButton,\n YIconExpand,\n YPlate,\n YIconCheckbox,\n },\n props: {\n item: {\n type: Object as PropType<any>,\n },\n level: {\n type: Number as PropType<number>,\n default: 0,\n },\n ...pressYTreeViewNodeProps(),\n },\n setup(props, { slots, expose }) {\n const treeView = inject<any>('tree-view');\n\n const expanded = ref(false);\n const active = ref(false);\n const selected = ref(false);\n const immediate = ref(false);\n\n function onClick(e: MouseEvent) {\n const to = !active.value;\n active.value = to;\n treeView.updateActive(myKey.value, to, e);\n treeView.emitActive();\n }\n\n function onClickExpand(e: MouseEvent) {\n e.stopPropagation();\n const to = !expanded.value;\n expanded.value = to;\n treeView.updateExpanded(myKey.value, to);\n treeView.emitExpanded();\n }\n\n function onClickSelect(e: MouseEvent) {\n e.stopPropagation();\n const to = !selected.value;\n selected.value = to;\n treeView.updateSelected(myKey.value, to);\n treeView.emitSelected();\n }\n\n const children = computed(() => {\n return props.item?.[props.itemChildren as string] ?? [];\n });\n\n const imLeaf = computed(() => children.value.length < 1);\n\n const classes = computed(() => {\n return {\n 'y-tree-view-node': true,\n 'y-tree-view-node--leaf': imLeaf.value,\n 'y-tree-view-node--expanded': expanded.value,\n 'y-tree-view-node--active': active.value,\n };\n });\n\n const styles = computed(() => {\n return {\n '--tree-view-node--level': props.level,\n };\n });\n\n const contentText = computed(() => {\n return getObjectValueByPath(props.item, props.itemText) ?? '';\n });\n\n const slotProps = computed(() => {\n return {\n level: props.level,\n imLeaf: imLeaf.value,\n };\n });\n\n const searchLoading = computed(() => {\n return treeView.searchLoading.value;\n });\n\n useRender(() => {\n const leaves = children.value\n .filter((leaf: any) => {\n return !treeView.isExcluded(\n getObjectValueByPath(leaf, props.itemKey),\n );\n })\n .map((item: any) => {\n return h(\n YTreeViewNode,\n {\n ...props,\n level: (props.level ?? 0) + 1,\n item,\n key: getObjectValueByPath(item, props.itemKey),\n },\n slots,\n );\n });\n const indentSpacer: VNodeArrayChildren = [];\n for (let i = 0; i < props.level; i += 1) {\n indentSpacer.push(\n h('div', { class: 'y-tree-view-node__indent-spacer' }),\n );\n }\n return h(\n 'div',\n {\n class: classes.value,\n style: styles.value,\n '.role': 'treeitem',\n 'data-level': props.level,\n },\n [\n h(\n 'div',\n {\n class: 'y-tree-view-node__container',\n onClick: (e: MouseEvent) =>\n props.enableActive ? onClick(e) : void 0,\n },\n [\n h(YPlate),\n h('div', { class: 'y-tree-view-node__indents' }, indentSpacer),\n /* EXPAND */\n !imLeaf.value && leaves.length > 0\n ? h(\n YButton,\n {\n class: 'y-tree-view-node__expand-icon',\n variation: 'icon',\n onClick: (e: MouseEvent) => onClickExpand(e),\n },\n () => [\n slots['expand-icon']\n ? slots['expand-icon']()\n : h(YIconExpand),\n ],\n )\n : h('i', { class: 'y-tree-view-node__no-expand-icon' }),\n props.enableSelect &&\n h(\n 'div',\n {\n class: ['y-tree-view-node__select'],\n onClick: (e: MouseEvent) => onClickSelect(e),\n },\n [h(YIconCheckbox, { checked: selected.value })],\n ),\n /* CONTENT */\n h('div', { class: 'y-tree-view-node__content' }, [\n slots.leading &&\n h(\n 'div',\n { class: 'y-tree-view-node__leading' },\n slots.leading(slotProps.value),\n ),\n h(\n 'div',\n { class: 'y-tree-view-node__text' },\n slots.default\n ? slots.default?.({\n text: contentText.value,\n item: props.item,\n ...slotProps.value,\n })\n : props.search && !searchLoading.value\n ? h(YTextHighlighter, {\n text: contentText.value,\n keyword: props.search,\n })\n : contentText.value,\n ),\n slots.trailing &&\n h(\n 'div',\n { class: 'y-tree-view-node__trailing' },\n slots.trailing(),\n ),\n ]),\n ],\n ),\n /* CHILDREN */\n children.value.length > 0\n ? h(\n YExpandVTransition,\n { disabled: props.disableTransition },\n expanded.value\n ? () =>\n h(\n 'div',\n {\n class: { 'y-tree-view-node__leaves': true },\n role: 'tree',\n },\n leaves,\n )\n : undefined,\n )\n : undefined,\n ],\n );\n });\n\n const myKey = computed(() => {\n return getObjectValueByPath(props.item, props.itemKey);\n });\n\n expose({\n myKey,\n expanded,\n active,\n selected,\n immediate,\n });\n\n return {\n treeView,\n myKey,\n expanded,\n active,\n selected,\n immediate,\n };\n },\n created() {\n this.treeView?.register?.(this.myKey, this);\n },\n});\n\nexport type YTreeNode = InstanceType<typeof YTreeViewNode>;\n"],"mappings":"AAAA,SAGEA,QAAQ,EACRC,eAAe,EACfC,CAAC,EACDC,MAAM,EACNC,GAAG,QACE,KAAK;AAAC,SAEJC,sBAAsB;AAAA,SACtBC,SAAS;AAAA,SACTC,oBAAoB;AAAA,SACpBC,YAAY;AAAA,SACZC,OAAO;AAAA,SACPC,aAAa,EAAEC,WAAW;AAAA,SAC1BC,MAAM;AAAA,OACRC,gBAAgB;AAAA,SACdC,kBAAkB;AAE3B,OAAO,MAAMC,uBAAuB,GAAGP,YAAY,CACjD;EACEQ,MAAM,EAAEC,MAAM;EACdC,iBAAiB,EAAEC,OAAO;EAC1BC,YAAY,EAAED,OAAO;EACrBE,WAAW,EAAE,CAACJ,MAAM,EAAEK,KAAK,CAAC;EAC5BC,oBAAoB,EAAEN,MAAM;EAC5BO,WAAW,EAAE;IACXC,IAAI,EAAER,MAAM;IACZS,OAAO,EAAE;EACX,CAAC;EACDC,YAAY,EAAER,OAAO;EACrB,GAAGd,sBAAsB,CAAC;IACxBuB,OAAO,EAAE;EACX,CAAC;AACH,CAAC,EACD,eACF,CAAC;AAED,OAAO,MAAMC,aAAa,GAAG5B,eAAe,CAAC;EAC3C6B,IAAI,EAAE,WAAW;EACjBC,UAAU,EAAE;IACVtB,OAAO;IACPE,WAAW;IACXC,MAAM;IACNF;EACF,CAAC;EACDsB,KAAK,EAAE;IACLC,IAAI,EAAE;MACJR,IAAI,EAAES;IACR,CAAC;IACDC,KAAK,EAAE;MACLV,IAAI,EAAEW,MAA0B;MAChCV,OAAO,EAAE;IACX,CAAC;IACD,GAAGX,uBAAuB,CAAC;EAC7B,CAAC;EACDsB,KAAKA,CAACL,KAAK,EAAAM,IAAA,EAAqB;IAAA,IAAnB;MAAEC,KAAK;MAAEC;IAAO,CAAC,GAAAF,IAAA;IAC5B,MAAMG,QAAQ,GAAGtC,MAAM,CAAM,WAAW,CAAC;IAEz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B7D,CAAC,CACCY,kBAAkB,EAClB;QAAEyE,QAAQ,EAAEvD,KAAK,CAACd;MAAkB,CAAC,EACrCwB,QAAQ,CAACO,KAAK,GACV,MACE/C,CAAC,CACC,KAAK,EACL;QACE6E,KAAK,EAAE;UAAE,0BAA0B,EAAE;QAAK,CAAC;QAC3CS,IAAI,EAAE;MACR,CAAC,EACDlB,MACF,CAAC,GACHmB,SACN,CAAC,GACDA,SAAS,CAEjB,CAAC;IACH,CAAC,CAAC;IAEF,MAAMtC,KAAK,GAAGnD,QAAQ,CAAC,MAAM;MAC3B,OAAOO,oBAAoB,CAACyB,KAAK,CAACC,IAAI,EAAED,KAAK,CAACJ,OAAO,CAAC;IACxD,CAAC,CAAC;IAEFY,MAAM,CAAC;MACLW,KAAK;MACLT,QAAQ;MACRC,MAAM;MACNC,QAAQ;MACRC;IACF,CAAC,CAAC;IAEF,OAAO;MACLJ,QAAQ;MACRU,KAAK;MACLT,QAAQ;MACRC,MAAM;MACNC,QAAQ;MACRC;IACF,CAAC;EACH,CAAC;EACD6C,OAAOA,CAAA,EAAG;IACR,IAAI,CAACjD,QAAQ,EAAEkD,QAAQ,GAAG,IAAI,CAACxC,KAAK,EAAE,IAAI,CAAC;EAC7C;AACF,CAAC,CAAC"}
|
|
@@ -13,7 +13,7 @@ export function getKeys(items, itemKey, childrenKey) {
|
|
|
13
13
|
}
|
|
14
14
|
export function filterTreeItem(item, search, textKey) {
|
|
15
15
|
const text = getObjectValueByPath(item, textKey);
|
|
16
|
-
return text
|
|
16
|
+
return text?.toLocaleLowerCase().indexOf(search.toLocaleLowerCase()) > -1;
|
|
17
17
|
}
|
|
18
18
|
export function filterTreeItems(filter, item, search, idKey, textKey, childrenKey, excluded) {
|
|
19
19
|
const children = getObjectValueByPath(item, childrenKey);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"util.mjs","names":["getObjectValueByPath","getKeys","items","itemKey","childrenKey","keys","item","key","push","children","Array","isArray","filterTreeItem","search","textKey","text","toLocaleLowerCase","indexOf","filterTreeItems","filter","idKey","excluded","match","i","length","add"],"sources":["../../../src/components/tree-view/util.ts"],"sourcesContent":["import { getObjectValueByPath } from '../../util/common';\n\nimport { CandidateKey } from '../../types';\nimport { TreeviewFilterFn } from './types';\n\nexport function getKeys(items: any[], itemKey: string, childrenKey: string) {\n const keys: CandidateKey[] = [];\n for (const item of items) {\n const key = getObjectValueByPath(item, itemKey);\n keys.push(key);\n const children = getObjectValueByPath(item, childrenKey);\n if (Array.isArray(children)) {\n keys.push(...getKeys(children, itemKey, childrenKey));\n }\n }\n return keys;\n}\n\nexport function filterTreeItem(\n item: object,\n search: string,\n textKey: string,\n): boolean {\n const text = getObjectValueByPath(item, textKey);\n\n return text
|
|
1
|
+
{"version":3,"file":"util.mjs","names":["getObjectValueByPath","getKeys","items","itemKey","childrenKey","keys","item","key","push","children","Array","isArray","filterTreeItem","search","textKey","text","toLocaleLowerCase","indexOf","filterTreeItems","filter","idKey","excluded","match","i","length","add"],"sources":["../../../src/components/tree-view/util.ts"],"sourcesContent":["import { getObjectValueByPath } from '../../util/common';\n\nimport { CandidateKey } from '../../types';\nimport { TreeviewFilterFn } from './types';\n\nexport function getKeys(items: any[], itemKey: string, childrenKey: string) {\n const keys: CandidateKey[] = [];\n for (const item of items) {\n const key = getObjectValueByPath(item, itemKey);\n keys.push(key);\n const children = getObjectValueByPath(item, childrenKey);\n if (Array.isArray(children)) {\n keys.push(...getKeys(children, itemKey, childrenKey));\n }\n }\n return keys;\n}\n\nexport function filterTreeItem(\n item: object,\n search: string,\n textKey: string,\n): boolean {\n const text = getObjectValueByPath(item, textKey);\n\n return text?.toLocaleLowerCase().indexOf(search.toLocaleLowerCase()) > -1;\n}\n\nexport function filterTreeItems(\n filter: TreeviewFilterFn,\n item: any,\n search: string,\n idKey: string,\n textKey: string,\n childrenKey: string,\n excluded: Set<CandidateKey>,\n): boolean {\n const children = getObjectValueByPath(item, childrenKey);\n\n if (children) {\n let match = false;\n for (let i = 0; i < children.length; i++) {\n if (\n filterTreeItems(\n filter,\n children[i],\n search,\n idKey,\n textKey,\n childrenKey,\n excluded,\n )\n ) {\n match = true;\n }\n }\n\n if (match) {\n return true;\n } else if (filter(item, search, textKey)) {\n return true;\n }\n } else if (filter(item, search, textKey)) {\n return true;\n }\n\n excluded.add(getObjectValueByPath(item, idKey));\n\n return false;\n}\n"],"mappings":"SAASA,oBAAoB;AAK7B,OAAO,SAASC,OAAOA,CAACC,KAAY,EAAEC,OAAe,EAAEC,WAAmB,EAAE;EAC1E,MAAMC,IAAoB,GAAG,EAAE;EAC/B,KAAK,MAAMC,IAAI,IAAIJ,KAAK,EAAE;IACxB,MAAMK,GAAG,GAAGP,oBAAoB,CAACM,IAAI,EAAEH,OAAO,CAAC;IAC/CE,IAAI,CAACG,IAAI,CAACD,GAAG,CAAC;IACd,MAAME,QAAQ,GAAGT,oBAAoB,CAACM,IAAI,EAAEF,WAAW,CAAC;IACxD,IAAIM,KAAK,CAACC,OAAO,CAACF,QAAQ,CAAC,EAAE;MAC3BJ,IAAI,CAACG,IAAI,CAAC,GAAGP,OAAO,CAACQ,QAAQ,EAAEN,OAAO,EAAEC,WAAW,CAAC,CAAC;IACvD;EACF;EACA,OAAOC,IAAI;AACb;AAEA,OAAO,SAASO,cAAcA,CAC5BN,IAAY,EACZO,MAAc,EACdC,OAAe,EACN;EACT,MAAMC,IAAI,GAAGf,oBAAoB,CAACM,IAAI,EAAEQ,OAAO,CAAC;EAEhD,OAAOC,IAAI,EAAEC,iBAAiB,CAAC,CAAC,CAACC,OAAO,CAACJ,MAAM,CAACG,iBAAiB,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;AAC3E;AAEA,OAAO,SAASE,eAAeA,CAC7BC,MAAwB,EACxBb,IAAS,EACTO,MAAc,EACdO,KAAa,EACbN,OAAe,EACfV,WAAmB,EACnBiB,QAA2B,EAClB;EACT,MAAMZ,QAAQ,GAAGT,oBAAoB,CAACM,IAAI,EAAEF,WAAW,CAAC;EAExD,IAAIK,QAAQ,EAAE;IACZ,IAAIa,KAAK,GAAG,KAAK;IACjB,KAAK,IAAIC,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGd,QAAQ,CAACe,MAAM,EAAED,CAAC,EAAE,EAAE;MACxC,IACEL,eAAe,CACbC,MAAM,EACNV,QAAQ,CAACc,CAAC,CAAC,EACXV,MAAM,EACNO,KAAK,EACLN,OAAO,EACPV,WAAW,EACXiB,QACF,CAAC,EACD;QACAC,KAAK,GAAG,IAAI;MACd;IACF;IAEA,IAAIA,KAAK,EAAE;MACT,OAAO,IAAI;IACb,CAAC,MAAM,IAAIH,MAAM,CAACb,IAAI,EAAEO,MAAM,EAAEC,OAAO,CAAC,EAAE;MACxC,OAAO,IAAI;IACb;EACF,CAAC,MAAM,IAAIK,MAAM,CAACb,IAAI,EAAEO,MAAM,EAAEC,OAAO,CAAC,EAAE;IACxC,OAAO,IAAI;EACb;EAEAO,QAAQ,CAACI,GAAG,CAACzB,oBAAoB,CAACM,IAAI,EAAEc,KAAK,CAAC,CAAC;EAE/C,OAAO,KAAK;AACd"}
|
package/package.json
CHANGED
|
@@ -239,12 +239,17 @@ export declare const YDataTable: import("vue").DefineComponent<{
|
|
|
239
239
|
type: PropType<string | number>;
|
|
240
240
|
default: number;
|
|
241
241
|
};
|
|
242
|
-
},
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
'update:
|
|
246
|
-
'update:
|
|
247
|
-
'update:
|
|
242
|
+
}, {
|
|
243
|
+
paginatedItems: import("vue").ComputedRef<readonly import("./types").DataTableItem<any>[]>;
|
|
244
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
245
|
+
'update:modelValue': (value: any[]) => true;
|
|
246
|
+
'update:page': (page: number) => true;
|
|
247
|
+
'update:pageSize': (pageSize: number) => true;
|
|
248
|
+
'update:sortBy': (sortBy: any) => true;
|
|
249
|
+
'update:options': (options: any) => true;
|
|
250
|
+
'click:row': (e: Event, value: {
|
|
251
|
+
row: any;
|
|
252
|
+
}) => true;
|
|
248
253
|
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
249
254
|
tag: {
|
|
250
255
|
type: PropType<string>;
|
|
@@ -312,10 +317,13 @@ export declare const YDataTable: import("vue").DefineComponent<{
|
|
|
312
317
|
};
|
|
313
318
|
}>> & {
|
|
314
319
|
"onUpdate:modelValue"?: ((value: any[]) => any) | undefined;
|
|
315
|
-
"onUpdate:page"?: ((
|
|
316
|
-
"onUpdate:pageSize"?: ((
|
|
317
|
-
"onUpdate:sortBy"?: ((
|
|
318
|
-
"onUpdate:options"?: ((
|
|
320
|
+
"onUpdate:page"?: ((page: number) => any) | undefined;
|
|
321
|
+
"onUpdate:pageSize"?: ((pageSize: number) => any) | undefined;
|
|
322
|
+
"onUpdate:sortBy"?: ((sortBy: any) => any) | undefined;
|
|
323
|
+
"onUpdate:options"?: ((options: any) => any) | undefined;
|
|
324
|
+
"onClick:row"?: ((e: Event, value: {
|
|
325
|
+
row: any;
|
|
326
|
+
}) => any) | undefined;
|
|
319
327
|
}, {
|
|
320
328
|
modelValue: readonly any[];
|
|
321
329
|
tag: string;
|
|
@@ -1,2 +1,70 @@
|
|
|
1
|
-
|
|
1
|
+
import { PropType } from 'vue';
|
|
2
|
+
export declare const pressYDataTableControlPropsOptions: <Defaults extends {
|
|
3
|
+
page?: unknown;
|
|
4
|
+
pageSize?: unknown;
|
|
5
|
+
pageLength?: unknown;
|
|
6
|
+
setPageSize?: unknown;
|
|
7
|
+
setPage?: unknown;
|
|
8
|
+
} = {}>(defaults?: Defaults | undefined) => {
|
|
9
|
+
page: unknown extends Defaults["page"] ? {
|
|
10
|
+
type: PropType<string | number>;
|
|
11
|
+
default: number;
|
|
12
|
+
} : Omit<{
|
|
13
|
+
type: PropType<string | number>;
|
|
14
|
+
default: number;
|
|
15
|
+
}, "default" | "type"> & {
|
|
16
|
+
type: PropType<unknown extends Defaults["page"] ? string | number : NonNullable<string | number> | Defaults["page"]>;
|
|
17
|
+
default: unknown extends Defaults["page"] ? string | number : NonNullable<string | number> | Defaults["page"];
|
|
18
|
+
};
|
|
19
|
+
pageSize: unknown extends Defaults["pageSize"] ? {
|
|
20
|
+
type: PropType<string | number>;
|
|
21
|
+
default: number;
|
|
22
|
+
} : Omit<{
|
|
23
|
+
type: PropType<string | number>;
|
|
24
|
+
default: number;
|
|
25
|
+
}, "default" | "type"> & {
|
|
26
|
+
type: PropType<unknown extends Defaults["pageSize"] ? string | number : NonNullable<string | number> | Defaults["pageSize"]>;
|
|
27
|
+
default: unknown extends Defaults["pageSize"] ? string | number : NonNullable<string | number> | Defaults["pageSize"];
|
|
28
|
+
};
|
|
29
|
+
pageLength: unknown extends Defaults["pageLength"] ? PropType<number> : {
|
|
30
|
+
type: PropType<unknown extends Defaults["pageLength"] ? number : number | Defaults["pageLength"]>;
|
|
31
|
+
default: unknown extends Defaults["pageLength"] ? number : number | Defaults["pageLength"];
|
|
32
|
+
};
|
|
33
|
+
setPageSize: unknown extends Defaults["setPageSize"] ? PropType<(pageSize: number) => void> : {
|
|
34
|
+
type: PropType<unknown extends Defaults["setPageSize"] ? (pageSize: number) => void : ((pageSize: number) => void) | Defaults["setPageSize"]>;
|
|
35
|
+
default: unknown extends Defaults["setPageSize"] ? (pageSize: number) => void : ((pageSize: number) => void) | Defaults["setPageSize"];
|
|
36
|
+
};
|
|
37
|
+
setPage: unknown extends Defaults["setPage"] ? PropType<(page: number) => void> : {
|
|
38
|
+
type: PropType<unknown extends Defaults["setPage"] ? (page: number) => void : ((page: number) => void) | Defaults["setPage"]>;
|
|
39
|
+
default: unknown extends Defaults["setPage"] ? (page: number) => void : ((page: number) => void) | Defaults["setPage"];
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
export declare const YDataTableControl: import("vue").DefineComponent<{
|
|
43
|
+
page: {
|
|
44
|
+
type: PropType<string | number>;
|
|
45
|
+
default: number;
|
|
46
|
+
};
|
|
47
|
+
pageSize: {
|
|
48
|
+
type: PropType<string | number>;
|
|
49
|
+
default: number;
|
|
50
|
+
};
|
|
51
|
+
pageLength: PropType<number>;
|
|
52
|
+
setPageSize: PropType<(pageSize: number) => void>;
|
|
53
|
+
setPage: PropType<(page: number) => void>;
|
|
54
|
+
}, void, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
55
|
+
page: {
|
|
56
|
+
type: PropType<string | number>;
|
|
57
|
+
default: number;
|
|
58
|
+
};
|
|
59
|
+
pageSize: {
|
|
60
|
+
type: PropType<string | number>;
|
|
61
|
+
default: number;
|
|
62
|
+
};
|
|
63
|
+
pageLength: PropType<number>;
|
|
64
|
+
setPageSize: PropType<(pageSize: number) => void>;
|
|
65
|
+
setPage: PropType<(page: number) => void>;
|
|
66
|
+
}>>, {
|
|
67
|
+
page: string | number;
|
|
68
|
+
pageSize: string | number;
|
|
69
|
+
}, {}>;
|
|
2
70
|
export type YDataTableControl = InstanceType<typeof YDataTableControl>;
|
|
@@ -65,4 +65,12 @@ export declare function usePagination(): {
|
|
|
65
65
|
setPage: (page: number) => void;
|
|
66
66
|
setPageSize: (size: number) => void;
|
|
67
67
|
};
|
|
68
|
+
export declare function usePaginatedItems<T>(options: {
|
|
69
|
+
items: Ref<readonly (T)[]>;
|
|
70
|
+
startIndex: Ref<number>;
|
|
71
|
+
endIndex: Ref<number>;
|
|
72
|
+
pageSize: Ref<number>;
|
|
73
|
+
}): {
|
|
74
|
+
paginatedItems: import("vue").ComputedRef<readonly T[]>;
|
|
75
|
+
};
|
|
68
76
|
export {};
|