fast-element-plus 2.0.7 → 2.0.8

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.
Files changed (37) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/components/inputDialogPage/src/inputDialogPage.d.ts +3 -3
  3. package/dist/components/inputDialogPage/src/inputDialogPage.mjs +5 -2
  4. package/dist/components/inputDialogPage/src/inputDialogPage.mjs.map +1 -1
  5. package/dist/components/select/src/select.d.ts +4 -4
  6. package/dist/components/select/src/select.mjs +53 -47
  7. package/dist/components/select/src/select.mjs.map +1 -1
  8. package/dist/components/selectPage/src/selectPage.d.ts +4 -4
  9. package/dist/components/selectPage/src/selectPage.mjs +65 -51
  10. package/dist/components/selectPage/src/selectPage.mjs.map +1 -1
  11. package/dist/components/selectV2/src/selectV2.d.ts +4 -4
  12. package/dist/components/selectV2/src/selectV2.mjs +80 -48
  13. package/dist/components/selectV2/src/selectV2.mjs.map +1 -1
  14. package/dist/components/tree/src/tree.d.ts +5 -5
  15. package/dist/components/tree/src/tree.mjs +11 -7
  16. package/dist/components/tree/src/tree.mjs.map +1 -1
  17. package/dist/components/treeSelect/src/treeSelect.d.ts +10 -10
  18. package/dist/components/treeSelect/src/treeSelect.mjs +58 -53
  19. package/dist/components/treeSelect/src/treeSelect.mjs.map +1 -1
  20. package/dist/components/upload/src/upload.d.ts +0 -5
  21. package/dist/components/upload/src/upload.mjs +6 -6
  22. package/dist/components/upload/src/upload.mjs.map +1 -1
  23. package/dist/components/upload/src/useUpload.d.ts +1 -1
  24. package/dist/components/upload/src/useUpload.mjs +4 -17
  25. package/dist/components/upload/src/useUpload.mjs.map +1 -1
  26. package/dist/components/uploadImage/src/uploadImage.d.ts +0 -5
  27. package/dist/components/uploadImage/src/uploadImage.mjs +1 -3
  28. package/dist/components/uploadImage/src/uploadImage.mjs.map +1 -1
  29. package/dist/components/uploadImages/src/uploadImages.d.ts +0 -5
  30. package/dist/components/uploadImages/src/uploadImages.mjs +3 -3
  31. package/dist/components/uploadImages/src/uploadImages.mjs.map +1 -1
  32. package/dist/index.global.min.js +4 -4
  33. package/dist/index.global.min.js.map +1 -1
  34. package/dist/version.d.ts +1 -1
  35. package/dist/version.mjs +1 -1
  36. package/dist/version.mjs.map +1 -1
  37. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"selectV2.mjs","names":["update:modelValue","end-reached","remove-tag","visible-change","update:label"],"sources":["../../../../src/components/selectV2/src/selectV2.tsx"],"sourcesContent":["import { useVModel } from \"@vueuse/core\";\nimport { computed, defineComponent, onMounted, reactive, ref, watch } from \"vue\";\nimport { ArrowDown, CircleClose } from \"@element-plus/icons-vue\";\nimport { ElSelectV2, tagProps, useAriaProps, useEmptyValuesProps, useGlobalSize, useSizeProp, useTooltipContentProps } from \"element-plus\";\nimport { isArray, isBoolean, isEqual, isNil, isNull, isNumber, isObject, isString } from \"lodash-unified\";\nimport { addCssUnit, definePropType, makeSlots, useEmits, useExpose, useProps, useRender, withDefineType } from \"../../../utils\";\nimport type { SelectV2Props as ElementPlusSelectV2Props, Options, Placement, ScrollbarDirection } from \"element-plus\";\nimport type { Component, PropType, VNode } from \"vue\";\nimport type { ElSelectorModelValue, ElSelectorOutput, ElSelectorValue } from \"../../select/src/select.type\";\nimport type { PagedInput, PagedResult } from \"../../table\";\n\n/** 传递给底层 Element Plus 虚拟化选择器的扩展 Props。 */\nexport interface Props {\n\tlabel?: string;\n\tvalue?: string;\n\tdisabled?: string;\n\toptions?: string;\n}\n\n/** FaSelectV2 支持的业务选择器 Props 定义。 */\nexport const SelectV2Props = {\n\t/**\n\t * @description whether creating new items is allowed. To use this, `filterable` must be true\n\t */\n\tallowCreate: Boolean,\n\t/**\n\t * @description autocomplete of select input\n\t */\n\tautocomplete: {\n\t\ttype: definePropType<\"none\" | \"both\" | \"list\" | \"inline\">(String),\n\t\tdefault: \"none\",\n\t},\n\t/**\n\t * @description for non-filterable Select, this prop decides if the option menu pops up when the input is focused\n\t */\n\tautomaticDropdown: Boolean,\n\t/**\n\t * @description whether select can be cleared\n\t */\n\tclearable: Boolean,\n\t/**\n\t * @description custom clear icon\n\t */\n\tclearIcon: {\n\t\ttype: definePropType<string | Component>([String, Object, Function]),\n\t\tdefault: CircleClose,\n\t},\n\t/**\n\t * @description tooltip theme, built-in theme: `dark` / `light`\n\t */\n\teffect: {\n\t\ttype: definePropType<string>(String),\n\t\tdefault: \"light\",\n\t},\n\t/**\n\t * @description whether to collapse tags to a text when multiple selecting\n\t */\n\tcollapseTags: Boolean,\n\t/**\n\t * @description whether show all selected tags when mouse hover text of collapse-tags. To use this, `collapse-tags` must be true\n\t */\n\tcollapseTagsTooltip: Boolean,\n\t/** @description collapse-tags tooltip configuration */\n\ttagTooltip: {\n\t\ttype: definePropType<ElementPlusSelectV2Props[\"tagTooltip\"]>(Object),\n\t\tdefault: (): NonNullable<ElementPlusSelectV2Props[\"tagTooltip\"]> => ({}),\n\t},\n\t/**\n\t * @description The max tags number to be shown. To use this, `collapse-tags` must be true\n\t */\n\tmaxCollapseTags: {\n\t\ttype: Number,\n\t\tdefault: 1,\n\t},\n\t/**\n\t * @description\n\t */\n\tdefaultFirstOption: Boolean,\n\t/**\n\t * @description is disabled\n\t */\n\tdisabled: Boolean,\n\t/**\n\t * @description\n\t */\n\testimatedOptionHeight: {\n\t\ttype: Number,\n\t\tdefault: undefined,\n\t},\n\t/**\n\t * @description is filterable\n\t */\n\tfilterable: Boolean,\n\t/**\n\t * @description\n\t */\n\tfilterMethod: Function as PropType<ElementPlusSelectV2Props[\"filterMethod\"]>,\n\t/**\n\t * @description The height of the dropdown panel, 34px for each item\n\t */\n\theight: {\n\t\ttype: Number,\n\t\tdefault: 274, // same as select dropdown menu\n\t},\n\t/**\n\t * @description The height of the dropdown item\n\t */\n\titemHeight: {\n\t\ttype: Number,\n\t\tdefault: 34,\n\t},\n\t/**\n\t * @description\n\t */\n\tid: String,\n\t/**\n\t * @description whether Select is loading data from server\n\t */\n\tloading: Boolean,\n\t/**\n\t * @description displayed text while loading data from server, default is 'Loading'\n\t */\n\tloadingText: String,\n\t/**\n\t * @description biding value\n\t */\n\tmodelValue: {\n\t\ttype: definePropType<ElSelectorModelValue>([Array, String, Number, Boolean, Object]),\n\t},\n\t/**\n\t * @description is multiple\n\t */\n\tmultiple: Boolean,\n\t/**\n\t * @description maximum number of options user can select when multiple is true. No limit when set to 0\n\t */\n\tmultipleLimit: {\n\t\ttype: Number,\n\t\tdefault: 0,\n\t},\n\t/**\n\t * @description the name attribute of select input\n\t */\n\tname: String,\n\t/**\n\t * @description displayed text when there is no options, you can also use slot empty, the default is 'No Data'\n\t */\n\tnoDataText: String,\n\t/**\n\t * @description displayed text when no data matches the filtering query, you can also use slot `empty`, default is 'No matching data'\n\t */\n\tnoMatchText: String,\n\t/**\n\t * @description function that gets called when the input value changes. Its parameter is the current input value. To use this, `filterable` must be true\n\t */\n\tremoteMethod: Function as PropType<ElementPlusSelectV2Props[\"remoteMethod\"]>,\n\t/**\n\t * @description whether reserve the keyword after select filtered option.\n\t */\n\treserveKeyword: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/**\n\t * @description data of the options, the key of `value` and `label` can be customize by `props`\n\t */\n\toptions: {\n\t\ttype: definePropType<ElementPlusSelectV2Props[\"options\"]>(Array),\n\t\t// required: true,\n\t},\n\t/**\n\t * @description placeholder, the default is 'Please select'\n\t */\n\tplaceholder: {\n\t\ttype: String,\n\t},\n\t/**\n\t * @description whether select dropdown is teleported to the body\n\t */\n\tteleported: useTooltipContentProps.teleported,\n\t/**\n\t * @description when select dropdown is inactive and `persistent` is `false`, select dropdown will be destroyed\n\t */\n\tpersistent: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/**\n\t * @description custom class name for Select's dropdown\n\t */\n\tpopperClass: {\n\t\ttype: String,\n\t\tdefault: \"\",\n\t},\n\t/** @description custom style for Select's dropdown */\n\tpopperStyle: useTooltipContentProps.popperStyle,\n\t/**\n\t * @description [popper.js](https://popper.js.org/docs/v2/) parameters\n\t */\n\tpopperOptions: {\n\t\ttype: definePropType<Partial<Options>>(Object),\n\t\tdefault: (): Partial<Options> => ({}),\n\t},\n\t/**\n\t * @description whether search data from server\n\t */\n\tremote: Boolean,\n\t/** @description debounce delay during remote search, in milliseconds */\n\tdebounce: {\n\t\ttype: Number,\n\t\tdefault: 300,\n\t},\n\t/**\n\t * @description size of component\n\t */\n\tsize: useSizeProp,\n\t/**\n\t * @description configuration options, see the following table\n\t */\n\tprops: {\n\t\ttype: definePropType<Props>(Object),\n\t\tdefault: (): Required<Props> => ({\n\t\t\tlabel: \"label\",\n\t\t\tvalue: \"value\",\n\t\t\tdisabled: \"disabled\",\n\t\t\toptions: \"options\",\n\t\t}),\n\t},\n\t/**\n\t * @description unique identity key name for value, required when value is an object\n\t */\n\tvalueKey: {\n\t\ttype: String,\n\t\tdefault: \"value\",\n\t},\n\t/**\n\t * @description Controls whether the scrollbar is always displayed\n\t */\n\tscrollbarAlwaysOn: Boolean,\n\t/**\n\t * @description whether to trigger form validation\n\t */\n\tvalidateEvent: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/**\n\t * @description offset of the dropdown\n\t */\n\toffset: {\n\t\ttype: Number,\n\t\tdefault: 12,\n\t},\n\t/** @description whether to show the suffix icon during remote search */\n\tremoteShowSuffix: Boolean,\n\t/**\n\t * @description Determines whether the arrow is displayed\n\t */\n\tshowArrow: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/**\n\t * @description position of dropdown\n\t */\n\tplacement: {\n\t\ttype: definePropType<Placement>(String),\n\t\tdefault: \"bottom-start\",\n\t},\n\t/**\n\t * @description list of possible positions for dropdown\n\t */\n\tfallbackPlacements: {\n\t\ttype: definePropType<Placement[]>(Array),\n\t\tdefault: [\"bottom-start\", \"top-start\", \"right\", \"left\"],\n\t},\n\t/**\n\t * @description tag type\n\t */\n\ttagType: { ...tagProps.type, default: \"info\" },\n\t/**\n\t * @description tag effect\n\t */\n\ttagEffect: { ...tagProps.effect, default: \"light\" },\n\t/**\n\t * @description tabindex for input\n\t */\n\ttabindex: {\n\t\ttype: [String, Number],\n\t\tdefault: 0,\n\t},\n\t/**\n\t * @description which element the select dropdown appends to\n\t */\n\tappendTo: String,\n\t/** @description whether the dropdown width follows the input width, or a fixed width */\n\tfitInputWidth: {\n\t\ttype: [Boolean, Number],\n\t\tdefault: true,\n\t\tvalidator: (value: boolean | number): boolean => isBoolean(value) || isNumber(value),\n\t},\n\t/** @description select suffix icon */\n\tsuffixIcon: {\n\t\ttype: definePropType<string | Component>([String, Object, Function]),\n\t\tdefault: ArrowDown,\n\t},\n\t...useEmptyValuesProps,\n\t...useAriaProps([\"ariaLabel\"]),\n};\n\n/** 底层虚拟化选择器的运行时 Emits 定义。 */\nexport const selectV2Emits = {\n\t\"update:modelValue\": (_value: ElSelectorModelValue): boolean => true,\n\tchange: (_value: ElSelectorModelValue): boolean => true,\n\t\"end-reached\": (_direction: ScrollbarDirection): boolean => true,\n\t\"remove-tag\": (_value: ElSelectorValue): boolean => true,\n\t\"visible-change\": (_visible: boolean): boolean => true,\n\tfocus: (_event: FocusEvent): boolean => true,\n\tblur: (_event: FocusEvent): boolean => true,\n\tclear: (): boolean => true,\n} as const;\n\n/** FaSelectV2 的运行时 Props 定义。 */\nexport const faSelectV2Props = {\n\t...SelectV2Props,\n\t/** @description whether Select is disabled 重载使其支持 ElForm*/\n\tdisabled: {\n\t\ttype: Boolean,\n\t\tdefault: undefined,\n\t},\n\t/** @description displayed text while loading data from server, default is 'Loading' */\n\tloadingText: {\n\t\ttype: String,\n\t\tdefault: \"加载中...\",\n\t},\n\t/** @description displayed text when no data matches the filtering query, you can also use slot `empty`, default is 'No matching data' */\n\tnoMatchText: {\n\t\ttype: String,\n\t\tdefault: \"暂无匹配的数据\",\n\t},\n\t/** @description displayed text when there is no options, you can also use slot `empty`, default is 'No data' */\n\tnoDataText: {\n\t\ttype: String,\n\t\tdefault: \"暂无数据\",\n\t},\n\t/** @description whether to collapse tags to a text when multiple selecting */\n\tcollapseTags: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** @description whether show all selected tags when mouse hover text of collapse-tags. To use this, `collapse-tags` must be true */\n\tcollapseTagsTooltip: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** @description v-model绑定值 */\n\tmodelValue: {\n\t\ttype: definePropType<ElSelectorModelValue>([String, Number, Boolean, Object, Array]),\n\t\tdefault: undefined,\n\t},\n\t/** @description v-model:label绑定值 */\n\tlabel: definePropType<string | string[] | null>([String, Array]),\n\t/** @description 宽度 */\n\twidth: {\n\t\ttype: [String, Number],\n\t\tdefault: \"100%\",\n\t},\n\t/** @description 更多细节,只有使用slot的时候有用 */\n\tmoreDetail: Boolean,\n\t/** @description 懒加载远程数据,默认 true。当下拉框第一次显示的时候才会加载远程数据*/\n\tlazy: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** @description 默认选中。不能和懒加载一起使用 */\n\tdefaultSelected: Boolean,\n\t/** @description 下拉框数据 */\n\tdata: {\n\t\ttype: definePropType<ElSelectorOutput[]>(Array),\n\t\tdefault: (): ElSelectorOutput[] => [],\n\t},\n\t/** 分页返回 */\n\tpageResult: Boolean,\n\t/** @description 请求api */\n\trequestApi: {\n\t\ttype: definePropType<(params?: string | number | PagedInput) => Promise<ElSelectorOutput[] | PagedResult<ElSelectorOutput>>>(Function),\n\t},\n\t/** 初始化参数 */\n\tinitParam: definePropType<string | number | PagedInput>([String, Number, Object]),\n};\n\n/** FaSelectV2 的运行时 Emits 定义。 */\nexport const faSelectV2Emits = {\n\t...selectV2Emits,\n\t/** @description v-model 回调 */\n\t\"update:modelValue\": (value: ElSelectorModelValue): boolean =>\n\t\tisString(value) || isNumber(value) || isBoolean(value) || isObject(value) || isArray(value) || isNull(value),\n\t/** @description v-model:label 回调 */\n\t\"update:label\": (value: string | string[] | null): boolean => isString(value) || isArray(value) || isNull(value),\n\t/** @description 数据改变 */\n\tdataChangeCallBack: (data: ElSelectorOutput[]): boolean => isArray(data),\n\t/** @description 改变 */\n\tchange: (_data: ElSelectorOutput | ElSelectorOutput[] | null, _value?: ElSelectorModelValue): boolean => true,\n};\n\n/** FaSelectV2 的插槽参数。 */\nexport interface FaSelectV2Slots extends Record<string, unknown> {\n\t/** @description FaSelectOption 默认内容插槽 */\n\tdefault: { item: ElSelectorOutput; index: number; disabled: boolean };\n\t/** @description 下拉列表顶部的内容 */\n\theader: never;\n\t/** @description 下拉列表底部的内容 */\n\tfooter: never;\n\t/** @description Select 组件头部内容 */\n\tprefix: never;\n\t/** @description 无选项时的列表 */\n\tempty: never;\n\t/** @description select 组件自定义标签内容 */\n\ttag: never;\n\t/** @description select 组件自定义 loading内容 */\n\tloading: never;\n\t/** @description select 组件自定义标签内容 */\n\tlabel: { label: string; value: string | number | boolean | object };\n}\n\nexport default defineComponent({\n\tname: \"FaSelectV2\",\n\tprops: faSelectV2Props,\n\temits: faSelectV2Emits,\n\tslots: makeSlots<FaSelectV2Slots>(),\n\tsetup(props, { slots, emit, expose }) {\n\t\tconst selectedLabel = useVModel(props, \"label\", emit, { passive: true });\n\t\tconst _globalSize = useGlobalSize();\n\n\t\tconst state = reactive({\n\t\t\tvalue: withDefineType<ElSelectorModelValue>(),\n\t\t\tloading: false,\n\t\t\tselectorData: withDefineType<ElSelectorOutput[]>([]),\n\t\t\t/** 首次出现 */\n\t\t\tdebut: true,\n\t\t\t/** 回显 */\n\t\t\techo: props.data?.length > 0 ? false : true,\n\t\t\t/** 下次刷新 */\n\t\t\tnextRefresh: false,\n\t\t});\n\n\t\tconst selectV2Ref = ref<InstanceType<typeof ElSelectV2>>();\n\t\tlet requestVersion = 0;\n\n\t\tconst loadData = async (): Promise<void> => {\n\t\t\tconst currentRequestVersion = ++requestVersion;\n\t\t\t// 判断是否需要自动请求\n\t\t\tif (props.requestApi) {\n\t\t\t\tstate.loading = true;\n\t\t\t\tconst params = props.initParam ?? {};\n\t\t\t\ttry {\n\t\t\t\t\tconst resData = await props.requestApi(params);\n\t\t\t\t\tif (currentRequestVersion !== requestVersion) return;\n\t\t\t\t\t// 这里不允许回显了\n\t\t\t\t\tstate.echo = false;\n\t\t\t\t\t// 判断是否为分页返回\n\t\t\t\t\tif (props.pageResult) {\n\t\t\t\t\t\tstate.selectorData = (resData as PagedResult<ElSelectorOutput>).rows ?? [];\n\t\t\t\t\t} else {\n\t\t\t\t\t\tstate.selectorData = resData as ElSelectorOutput[];\n\t\t\t\t\t}\n\t\t\t\t\temit(\"dataChangeCallBack\", state.selectorData);\n\t\t\t\t} catch (error) {\n\t\t\t\t\tif (currentRequestVersion !== requestVersion) return;\n\t\t\t\t\tstate.selectorData = [];\n\t\t\t\t\tthrow error;\n\t\t\t\t} finally {\n\t\t\t\t\tif (currentRequestVersion === requestVersion) state.loading = false;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (currentRequestVersion !== requestVersion) return;\n\t\t\t\t// 这里不允许回显了\n\t\t\t\tstate.echo = false;\n\t\t\t\tstate.selectorData = props.data ?? [];\n\t\t\t}\n\t\t};\n\n\t\tconst handleChange = (value?: ElSelectorModelValue): void => {\n\t\t\t// 判断是否为多选\n\t\t\tif (props.multiple) {\n\t\t\t\t// value 必然是数组\n\t\t\t\tconst valueArr = Array.isArray(value) ? value : [];\n\t\t\t\tif (valueArr?.length === 0) {\n\t\t\t\t\tstate.value = null;\n\t\t\t\t\tselectedLabel.value = null;\n\t\t\t\t\temit(\"update:modelValue\", null);\n\t\t\t\t\temit(\"change\", null, null);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst dataList = state.selectorData.filter((item) => item.value !== undefined && valueArr.includes(item.value));\n\t\t\t\tstate.value = value;\n\t\t\t\tselectedLabel.value = dataList.map((item) => item.label ?? \"\");\n\t\t\t\temit(\"update:modelValue\", value);\n\t\t\t\temit(\"change\", dataList, value);\n\t\t\t} else {\n\t\t\t\t// value 必然不是数组\n\t\t\t\tif (isNil(value)) {\n\t\t\t\t\tstate.value = null;\n\t\t\t\t\tselectedLabel.value = null;\n\t\t\t\t\temit(\"update:modelValue\", null);\n\t\t\t\t\temit(\"change\", null, null);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst data = state.selectorData.find((f) => f.value === value);\n\t\t\t\tstate.value = value;\n\t\t\t\tselectedLabel.value = data?.label ?? null;\n\t\t\t\temit(\"update:modelValue\", value);\n\t\t\t\temit(\"change\", data ?? null, value);\n\t\t\t}\n\t\t};\n\n\t\tconst handleClear = (): void => {\n\t\t\tstate.value = null;\n\t\t\tselectedLabel.value = null;\n\t\t\temit(\"update:modelValue\", null);\n\t\t\temit(\"clear\");\n\t\t};\n\n\t\tconst handleVisibleChange = async (visible: boolean): Promise<void> => {\n\t\t\tif (visible) {\n\t\t\t\tif (state.debut) {\n\t\t\t\t\t// 首次出现\n\t\t\t\t\tstate.debut = false;\n\t\t\t\t\t// 懒加载\n\t\t\t\t\t!props.defaultSelected && props.lazy && (await loadData());\n\t\t\t\t} else {\n\t\t\t\t\t// 判断再次出现是否需要刷新数据\n\t\t\t\t\tif (state.nextRefresh) {\n\t\t\t\t\t\tstate.nextRefresh = false;\n\t\t\t\t\t\tawait loadData();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\temit(\"visible-change\", visible);\n\t\t};\n\n\t\twatch(\n\t\t\t() => props.modelValue,\n\t\t\t(newValue) => {\n\t\t\t\tif (state.echo && !isNil(newValue)) {\n\t\t\t\t\tconst hasLabel = !isNil(props.label);\n\t\t\t\t\t// 判断是否为多选\n\t\t\t\t\tif (props.multiple) {\n\t\t\t\t\t\t// 判断是否为数组\n\t\t\t\t\t\tif (!Array.isArray(newValue)) {\n\t\t\t\t\t\t\tconsole.error(\"[Fast:FaSelectV2]\", \"当启用 multiple 时,传入的 modelValue 必须是 Array。\");\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (hasLabel && !isArray(props.label)) {\n\t\t\t\t\t\t\tconsole.error(\"[Fast:FaSelectV2]\", \"当启用 multiple 时,传入的 modelValue:label 必须是 Array。\");\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tstate.selectorData = newValue\n\t\t\t\t\t\t\t// 最大选项截取\n\t\t\t\t\t\t\t.slice(0, props.multipleLimit > 0 ? props.multipleLimit : newValue.length)\n\t\t\t\t\t\t\t.map((item, index) => {\n\t\t\t\t\t\t\t\tconst value: unknown = item;\n\t\t\t\t\t\t\t\tconst label: unknown = Array.isArray(props.label) ? props.label[index] : undefined;\n\t\t\t\t\t\t\t\tconst selectorValue: ElSelectorValue | undefined =\n\t\t\t\t\t\t\t\t\tvalue !== null &&\n\t\t\t\t\t\t\t\t\t(typeof value === \"string\" ||\n\t\t\t\t\t\t\t\t\t\ttypeof value === \"number\" ||\n\t\t\t\t\t\t\t\t\t\ttypeof value === \"boolean\" ||\n\t\t\t\t\t\t\t\t\t\ttypeof value === \"object\")\n\t\t\t\t\t\t\t\t\t\t? value\n\t\t\t\t\t\t\t\t\t\t: undefined;\n\t\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t\tvalue: selectorValue,\n\t\t\t\t\t\t\t\t\tlabel: hasLabel && typeof label === \"string\" ? label : undefined,\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t});\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (Array.isArray(newValue)) {\n\t\t\t\t\t\t\tconsole.error(\"[Fast:FaSelectV2]\", \"当禁用 multiple 时,传入的 modelValue 不能是 Array。\");\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (hasLabel && isArray(props.label)) {\n\t\t\t\t\t\t\tconsole.error(\"[Fast:FaSelectV2]\", \"当禁用 multiple 时,传入的 modelValue:label 不能是 Array。\");\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tstate.selectorData = [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tvalue: newValue,\n\t\t\t\t\t\t\t\tlabel: typeof props.label === \"string\" ? props.label : undefined,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tstate.value = newValue;\n\t\t\t},\n\t\t\t{\n\t\t\t\timmediate: true,\n\t\t\t}\n\t\t);\n\n\t\tonMounted(async () => {\n\t\t\tif (props.defaultSelected) {\n\t\t\t\tawait loadData();\n\t\t\t\tconst firstItem = state.selectorData[0];\n\t\t\t\tif (firstItem?.value !== undefined) {\n\t\t\t\t\thandleChange(props.multiple ? [firstItem.value] : firstItem.value);\n\t\t\t\t}\n\t\t\t}\n\t\t\t// 判断是否为本地数据\n\t\t\telse if (!props.requestApi && props.data?.length > 0) {\n\t\t\t\tstate.debut = false;\n\t\t\t\tawait loadData();\n\t\t\t}\n\t\t\t// 判断是否非默认选中,且未启用懒加载\n\t\t\telse if (!props.lazy) {\n\t\t\t\tawait loadData();\n\t\t\t}\n\t\t\twatch(\n\t\t\t\t() => props.initParam,\n\t\t\t\t(newValue, oldValue) => {\n\t\t\t\t\tif (!isEqual(newValue, oldValue)) {\n\t\t\t\t\t\tstate.nextRefresh = true;\n\t\t\t\t\t\tif (!isNil(state.value)) {\n\t\t\t\t\t\t\thandleChange();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\t\t\twatch(\n\t\t\t\t() => props.data,\n\t\t\t\t() => {\n\t\t\t\t\tif (!props.requestApi) {\n\t\t\t\t\t\treturn loadData();\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t{ deep: true }\n\t\t\t);\n\t\t});\n\n\t\tconst elSelectV2Props = useProps(props, SelectV2Props, [\"modelValue\", \"popperClass\", \"loading\", \"options\", \"itemHeight\"]);\n\t\tconst elSelectV2Emits = useEmits(faSelectV2Emits, emit, [\"update:modelValue\", \"change\", \"clear\", \"visible-change\"]);\n\t\tconst elPopperClass = computed(() => {\n\t\t\tlet localClass = `fa-select-v2-dropdown ${props.popperClass}`;\n\t\t\tif (props.moreDetail) {\n\t\t\t\tlocalClass += ` fa-select-v2-dropdown__more-detail fa-select-v2-dropdown__more-detail-${_globalSize.value}`;\n\t\t\t}\n\t\t\treturn localClass;\n\t\t});\n\n\t\tuseRender(() => (\n\t\t\t<ElSelectV2\n\t\t\t\t{...elSelectV2Props.value}\n\t\t\t\t{...elSelectV2Emits.value}\n\t\t\t\tref={selectV2Ref}\n\t\t\t\tclass=\"fa-select-v2\"\n\t\t\t\tpopperClass={elPopperClass.value}\n\t\t\t\tstyle={{ width: addCssUnit(props.width) }}\n\t\t\t\tvModel={state.value}\n\t\t\t\tloading={state.loading}\n\t\t\t\toptions={state.selectorData}\n\t\t\t\titemHeight={props.itemHeight + (_globalSize.value === \"small\" ? 0 : 8)}\n\t\t\t\tonChange={handleChange}\n\t\t\t\tonClear={handleClear}\n\t\t\t\tonVisible-change={handleVisibleChange}\n\t\t\t>\n\t\t\t\t{{\n\t\t\t\t\t...(slots.default && {\n\t\t\t\t\t\tdefault: ({ item, index, disabled }: { item: ElSelectorOutput; index: number; disabled: boolean }): VNode[] =>\n\t\t\t\t\t\t\tslots.default?.({ item, index, disabled }) ?? [],\n\t\t\t\t\t}),\n\t\t\t\t\t...(slots.header && { header: (): VNode[] => slots.header?.() ?? [] }),\n\t\t\t\t\t...(slots.footer && { footer: (): VNode[] => slots.footer?.() ?? [] }),\n\t\t\t\t\t...(slots.prefix && { prefix: (): VNode[] => slots.prefix?.() ?? [] }),\n\t\t\t\t\t...(slots.empty && { empty: (): VNode[] => slots.empty?.() ?? [] }),\n\t\t\t\t\t...(slots.tag && { tag: (): VNode[] => slots.tag?.() ?? [] }),\n\t\t\t\t\t...(slots.loading && { loading: (): VNode[] => slots.loading?.() ?? [] }),\n\t\t\t\t\t...(slots.label && {\n\t\t\t\t\t\tlabel: ({ label, value }: { label: string; value: string | number | boolean | object }): VNode[] =>\n\t\t\t\t\t\t\tslots.label?.({ label, value }) ?? [],\n\t\t\t\t\t}),\n\t\t\t\t}}\n\t\t\t</ElSelectV2>\n\t\t));\n\n\t\treturn useExpose(expose, {\n\t\t\t/** @description 使选择器的输入框获取焦点 */\n\t\t\tfocus: computed(() => selectV2Ref.value?.focus),\n\t\t\t/** @description 使选择器的输入框失去焦点,并隐藏下拉框 */\n\t\t\tblur: computed(() => selectV2Ref.value?.blur),\n\t\t\t/** @description 获取当前选中的标签 */\n\t\t\tselectedLabel: computed(() => selectV2Ref.value?.selectedLabel),\n\t\t\t/** @description 滚动到指定选项索引。 */\n\t\t\tscrollTo: computed(() => selectV2Ref.value?.scrollTo),\n\t\t\t/** @description 加载状态 */\n\t\t\tloading: computed(() => state.loading),\n\t\t\t/** @description 刷新 */\n\t\t\trefresh: loadData,\n\t\t\t/** @description 设置选择 */\n\t\t\tsetSelection: (value: Exclude<ElSelectorModelValue, null | undefined>) => handleChange(value),\n\t\t\t/** @description 清除选择 */\n\t\t\tclearSelection: () => handleChange(null),\n\t\t});\n\t},\n});\n"],"mappings":";;;;;;;;;;;;;;AAoBA,MAAa,gBAAgB;;;;CAI5B,aAAa;;;;CAIb,cAAc;EACb,MAAM,eAAoD,MAAM;EAChE,SAAS;CACV;;;;CAIA,mBAAmB;;;;CAInB,WAAW;;;;CAIX,WAAW;EACV,MAAM,eAAmC;GAAC;GAAQ;GAAQ;EAAQ,CAAC;EACnE,SAAS;CACV;;;;CAIA,QAAQ;EACP,MAAM,eAAuB,MAAM;EACnC,SAAS;CACV;;;;CAIA,cAAc;;;;CAId,qBAAqB;;CAErB,YAAY;EACX,MAAM,eAAuD,MAAM;EACnE,gBAAqE,CAAC;CACvE;;;;CAIA,iBAAiB;EAChB,MAAM;EACN,SAAS;CACV;;;;CAIA,oBAAoB;;;;CAIpB,UAAU;;;;CAIV,uBAAuB;EACtB,MAAM;EACN,SAAS,KAAA;CACV;;;;CAIA,YAAY;;;;CAIZ,cAAc;;;;CAId,QAAQ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AAM,UAAU;IAAE;IAAM;IAAO;GAAS,CAAC,KAAK,CAAA,EAChD;GACA,GAAI,MAAM,UAAU,EAAE,cAAuB,MAAM,SAAS,KAAK,CAAA,EAAG;GACpE,GAAI,MAAM,UAAU,EAAE,cAAuB,MAAM,SAAS,KAAK,CAAA,EAAG;GACpE,GAAI,MAAM,UAAU,EAAE,cAAuB,MAAM,SAAS,KAAK,CAAA,EAAG;GACpE,GAAI,MAAM,SAAS,EAAE,aAAsB,MAAM,QAAQ,KAAK,CAAA,EAAG;GACjE,GAAI,MAAM,OAAO,EAAE,WAAoB,MAAM,MAAM,KAAK,CAAA,EAAG;GAC3D,GAAI,MAAM,WAAW,EAAE,eAAwB,MAAM,UAAU,KAAK,CAAA,EAAG;GACvE,GAAI,MAAM,SAAS,EAClB,QAAQ,EAAE,OAAO,YAChB,MAAM,QAAQ;IAAE;IAAO;GAAM,CAAC,KAAK,CAAA,EACrC;EAAE,CAAA,CAGJ;EAED,OAAO,UAAU,QAAQ;;GAExB,OAAO,eAAe,YAAY,OAAO,KAAK;;GAE9C,MAAM,eAAe,YAAY,OAAO,IAAI;;GAE5C,eAAe,eAAe,YAAY,OAAO,aAAa;;GAE9D,UAAU,eAAe,YAAY,OAAO,QAAQ;;GAEpD,SAAS,eAAe,MAAM,OAAO;;GAErC,SAAS;;GAET,eAAe,UAA2D,aAAa,KAAK;;GAE5F,sBAAsB,aAAa,IAAI;EACxC,CAAC;CACF;AACD,CAAC"}
1
+ {"version":3,"file":"selectV2.mjs","names":["update:modelValue","end-reached","remove-tag","visible-change","update:label"],"sources":["../../../../src/components/selectV2/src/selectV2.tsx"],"sourcesContent":["import { useVModel } from \"@vueuse/core\";\nimport { computed, defineComponent, onMounted, reactive, ref, watch } from \"vue\";\nimport { ArrowDown, CircleClose } from \"@element-plus/icons-vue\";\nimport { ElSelectV2, tagProps, useAriaProps, useEmptyValuesProps, useGlobalSize, useSizeProp, useTooltipContentProps } from \"element-plus\";\nimport { isArray, isBoolean, isEqual, isNil, isNull, isNumber, isObject, isString } from \"lodash-unified\";\nimport { addCssUnit, definePropType, makeSlots, useEmits, useExpose, useProps, useRender, withDefineType } from \"../../../utils\";\nimport type { SelectV2Props as ElementPlusSelectV2Props, Options, Placement, ScrollbarDirection } from \"element-plus\";\nimport type { Component, PropType, VNode } from \"vue\";\nimport type { ElSelectorModelValue, ElSelectorOutput, ElSelectorValue } from \"../../select/src/select.type\";\nimport type { PagedInput, PagedResult } from \"../../table\";\n\n/** 传递给底层 Element Plus 虚拟化选择器的扩展 Props。 */\nexport interface Props {\n\tlabel?: string;\n\tvalue?: string;\n\tdisabled?: string;\n\toptions?: string;\n}\n\n/** FaSelectV2 支持的业务选择器 Props 定义。 */\nexport const SelectV2Props = {\n\t/**\n\t * @description whether creating new items is allowed. To use this, `filterable` must be true\n\t */\n\tallowCreate: Boolean,\n\t/**\n\t * @description autocomplete of select input\n\t */\n\tautocomplete: {\n\t\ttype: definePropType<\"none\" | \"both\" | \"list\" | \"inline\">(String),\n\t\tdefault: \"none\",\n\t},\n\t/**\n\t * @description for non-filterable Select, this prop decides if the option menu pops up when the input is focused\n\t */\n\tautomaticDropdown: Boolean,\n\t/**\n\t * @description whether select can be cleared\n\t */\n\tclearable: Boolean,\n\t/**\n\t * @description custom clear icon\n\t */\n\tclearIcon: {\n\t\ttype: definePropType<string | Component>([String, Object, Function]),\n\t\tdefault: CircleClose,\n\t},\n\t/**\n\t * @description tooltip theme, built-in theme: `dark` / `light`\n\t */\n\teffect: {\n\t\ttype: definePropType<string>(String),\n\t\tdefault: \"light\",\n\t},\n\t/**\n\t * @description whether to collapse tags to a text when multiple selecting\n\t */\n\tcollapseTags: Boolean,\n\t/**\n\t * @description whether show all selected tags when mouse hover text of collapse-tags. To use this, `collapse-tags` must be true\n\t */\n\tcollapseTagsTooltip: Boolean,\n\t/** @description collapse-tags tooltip configuration */\n\ttagTooltip: {\n\t\ttype: definePropType<ElementPlusSelectV2Props[\"tagTooltip\"]>(Object),\n\t\tdefault: (): NonNullable<ElementPlusSelectV2Props[\"tagTooltip\"]> => ({}),\n\t},\n\t/**\n\t * @description The max tags number to be shown. To use this, `collapse-tags` must be true\n\t */\n\tmaxCollapseTags: {\n\t\ttype: Number,\n\t\tdefault: 1,\n\t},\n\t/**\n\t * @description\n\t */\n\tdefaultFirstOption: Boolean,\n\t/**\n\t * @description is disabled\n\t */\n\tdisabled: Boolean,\n\t/**\n\t * @description\n\t */\n\testimatedOptionHeight: {\n\t\ttype: Number,\n\t\tdefault: undefined,\n\t},\n\t/**\n\t * @description is filterable\n\t */\n\tfilterable: Boolean,\n\t/**\n\t * @description\n\t */\n\tfilterMethod: Function as PropType<ElementPlusSelectV2Props[\"filterMethod\"]>,\n\t/**\n\t * @description The height of the dropdown panel, 34px for each item\n\t */\n\theight: {\n\t\ttype: Number,\n\t\tdefault: 274, // same as select dropdown menu\n\t},\n\t/**\n\t * @description The height of the dropdown item\n\t */\n\titemHeight: {\n\t\ttype: Number,\n\t\tdefault: 34,\n\t},\n\t/**\n\t * @description\n\t */\n\tid: String,\n\t/**\n\t * @description whether Select is loading data from server\n\t */\n\tloading: Boolean,\n\t/**\n\t * @description displayed text while loading data from server, default is 'Loading'\n\t */\n\tloadingText: String,\n\t/**\n\t * @description biding value\n\t */\n\tmodelValue: {\n\t\ttype: definePropType<ElSelectorModelValue>([Array, String, Number, Boolean, Object]),\n\t},\n\t/**\n\t * @description is multiple\n\t */\n\tmultiple: Boolean,\n\t/**\n\t * @description maximum number of options user can select when multiple is true. No limit when set to 0\n\t */\n\tmultipleLimit: {\n\t\ttype: Number,\n\t\tdefault: 0,\n\t},\n\t/**\n\t * @description the name attribute of select input\n\t */\n\tname: String,\n\t/**\n\t * @description displayed text when there is no options, you can also use slot empty, the default is 'No Data'\n\t */\n\tnoDataText: String,\n\t/**\n\t * @description displayed text when no data matches the filtering query, you can also use slot `empty`, default is 'No matching data'\n\t */\n\tnoMatchText: String,\n\t/**\n\t * @description function that gets called when the input value changes. Its parameter is the current input value. To use this, `filterable` must be true\n\t */\n\tremoteMethod: Function as PropType<ElementPlusSelectV2Props[\"remoteMethod\"]>,\n\t/**\n\t * @description whether reserve the keyword after select filtered option.\n\t */\n\treserveKeyword: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/**\n\t * @description data of the options, the key of `value` and `label` can be customize by `props`\n\t */\n\toptions: {\n\t\ttype: definePropType<ElementPlusSelectV2Props[\"options\"]>(Array),\n\t\t// required: true,\n\t},\n\t/**\n\t * @description placeholder, the default is 'Please select'\n\t */\n\tplaceholder: {\n\t\ttype: String,\n\t},\n\t/**\n\t * @description whether select dropdown is teleported to the body\n\t */\n\tteleported: useTooltipContentProps.teleported,\n\t/**\n\t * @description when select dropdown is inactive and `persistent` is `false`, select dropdown will be destroyed\n\t */\n\tpersistent: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/**\n\t * @description custom class name for Select's dropdown\n\t */\n\tpopperClass: {\n\t\ttype: String,\n\t\tdefault: \"\",\n\t},\n\t/** @description custom style for Select's dropdown */\n\tpopperStyle: useTooltipContentProps.popperStyle,\n\t/**\n\t * @description [popper.js](https://popper.js.org/docs/v2/) parameters\n\t */\n\tpopperOptions: {\n\t\ttype: definePropType<Partial<Options>>(Object),\n\t\tdefault: (): Partial<Options> => ({}),\n\t},\n\t/**\n\t * @description whether search data from server\n\t */\n\tremote: Boolean,\n\t/** @description debounce delay during remote search, in milliseconds */\n\tdebounce: {\n\t\ttype: Number,\n\t\tdefault: 300,\n\t},\n\t/**\n\t * @description size of component\n\t */\n\tsize: useSizeProp,\n\t/**\n\t * @description configuration options, see the following table\n\t */\n\tprops: {\n\t\ttype: definePropType<Props>(Object),\n\t\tdefault: (): Required<Props> => ({\n\t\t\tlabel: \"label\",\n\t\t\tvalue: \"value\",\n\t\t\tdisabled: \"disabled\",\n\t\t\toptions: \"options\",\n\t\t}),\n\t},\n\t/**\n\t * @description unique identity key name for value, required when value is an object\n\t */\n\tvalueKey: {\n\t\ttype: String,\n\t\tdefault: \"value\",\n\t},\n\t/**\n\t * @description Controls whether the scrollbar is always displayed\n\t */\n\tscrollbarAlwaysOn: Boolean,\n\t/**\n\t * @description whether to trigger form validation\n\t */\n\tvalidateEvent: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/**\n\t * @description offset of the dropdown\n\t */\n\toffset: {\n\t\ttype: Number,\n\t\tdefault: 12,\n\t},\n\t/** @description whether to show the suffix icon during remote search */\n\tremoteShowSuffix: Boolean,\n\t/**\n\t * @description Determines whether the arrow is displayed\n\t */\n\tshowArrow: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/**\n\t * @description position of dropdown\n\t */\n\tplacement: {\n\t\ttype: definePropType<Placement>(String),\n\t\tdefault: \"bottom-start\",\n\t},\n\t/**\n\t * @description list of possible positions for dropdown\n\t */\n\tfallbackPlacements: {\n\t\ttype: definePropType<Placement[]>(Array),\n\t\tdefault: [\"bottom-start\", \"top-start\", \"right\", \"left\"],\n\t},\n\t/**\n\t * @description tag type\n\t */\n\ttagType: { ...tagProps.type, default: \"info\" },\n\t/**\n\t * @description tag effect\n\t */\n\ttagEffect: { ...tagProps.effect, default: \"light\" },\n\t/**\n\t * @description tabindex for input\n\t */\n\ttabindex: {\n\t\ttype: [String, Number],\n\t\tdefault: 0,\n\t},\n\t/**\n\t * @description which element the select dropdown appends to\n\t */\n\tappendTo: String,\n\t/** @description whether the dropdown width follows the input width, or a fixed width */\n\tfitInputWidth: {\n\t\ttype: [Boolean, Number],\n\t\tdefault: true,\n\t\tvalidator: (value: boolean | number): boolean => isBoolean(value) || isNumber(value),\n\t},\n\t/** @description select suffix icon */\n\tsuffixIcon: {\n\t\ttype: definePropType<string | Component>([String, Object, Function]),\n\t\tdefault: ArrowDown,\n\t},\n\t...useEmptyValuesProps,\n\t...useAriaProps([\"ariaLabel\"]),\n};\n\n/** 底层虚拟化选择器的运行时 Emits 定义。 */\nexport const selectV2Emits = {\n\t\"update:modelValue\": (_value: ElSelectorModelValue): boolean => true,\n\tchange: (_value: ElSelectorModelValue): boolean => true,\n\t\"end-reached\": (_direction: ScrollbarDirection): boolean => true,\n\t\"remove-tag\": (_value: ElSelectorValue): boolean => true,\n\t\"visible-change\": (_visible: boolean): boolean => true,\n\tfocus: (_event: FocusEvent): boolean => true,\n\tblur: (_event: FocusEvent): boolean => true,\n\tclear: (): boolean => true,\n} as const;\n\n/** FaSelectV2 的运行时 Props 定义。 */\nexport const faSelectV2Props = {\n\t...SelectV2Props,\n\t/** @description whether Select is disabled 重载使其支持 ElForm*/\n\tdisabled: {\n\t\ttype: Boolean,\n\t\tdefault: undefined,\n\t},\n\t/** @description displayed text while loading data from server, default is 'Loading' */\n\tloadingText: {\n\t\ttype: String,\n\t\tdefault: \"加载中...\",\n\t},\n\t/** @description displayed text when no data matches the filtering query, you can also use slot `empty`, default is 'No matching data' */\n\tnoMatchText: {\n\t\ttype: String,\n\t\tdefault: \"暂无匹配的数据\",\n\t},\n\t/** @description displayed text when there is no options, you can also use slot `empty`, default is 'No data' */\n\tnoDataText: {\n\t\ttype: String,\n\t\tdefault: \"暂无数据\",\n\t},\n\t/** @description whether to collapse tags to a text when multiple selecting */\n\tcollapseTags: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** @description whether show all selected tags when mouse hover text of collapse-tags. To use this, `collapse-tags` must be true */\n\tcollapseTagsTooltip: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** @description v-model绑定值 */\n\tmodelValue: {\n\t\ttype: definePropType<ElSelectorModelValue>([String, Number, Boolean, Object, Array]),\n\t\tdefault: undefined,\n\t},\n\t/** @description v-model:label绑定值 */\n\tlabel: definePropType<string | string[] | null>([String, Array]),\n\t/** @description 宽度 */\n\twidth: {\n\t\ttype: [String, Number],\n\t\tdefault: \"100%\",\n\t},\n\t/** @description 更多细节,只有使用slot的时候有用 */\n\tmoreDetail: Boolean,\n\t/** @description 懒加载远程数据,默认 true。当下拉框第一次显示的时候才会加载远程数据*/\n\tlazy: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** @description 默认选中。不能和懒加载一起使用 */\n\tdefaultSelected: Boolean,\n\t/** @description 下拉框数据 */\n\tdata: {\n\t\ttype: definePropType<ElSelectorOutput[]>(Array),\n\t\tdefault: (): ElSelectorOutput[] => [],\n\t},\n\t/** 分页返回 */\n\tpageResult: Boolean,\n\t/** @description 请求api */\n\trequestApi: {\n\t\ttype: definePropType<(params?: string | number | PagedInput) => Promise<ElSelectorOutput[] | PagedResult<ElSelectorOutput>>>(Function),\n\t},\n\t/** 初始化参数 */\n\tinitParam: definePropType<string | number | PagedInput>([String, Number, Object]),\n};\n\n/** FaSelectV2 的运行时 Emits 定义。 */\nexport const faSelectV2Emits = {\n\t...selectV2Emits,\n\t/** @description v-model 回调 */\n\t\"update:modelValue\": (value: ElSelectorModelValue): boolean =>\n\t\tisString(value) || isNumber(value) || isBoolean(value) || isObject(value) || isArray(value) || isNil(value),\n\t/** @description 选中数据改变 */\n\tchange: (_data: ElSelectorOutput | ElSelectorOutput[] | null, _value?: ElSelectorModelValue): boolean => true,\n\t/** @description v-model:label 回调 */\n\t\"update:label\": (value: string | string[] | null): boolean => isString(value) || isArray(value) || isNull(value),\n\t/** @description 数据改变 */\n\tdataChangeCallBack: (data: ElSelectorOutput[]): boolean => isArray(data),\n};\n\n/** FaSelectV2 的插槽参数。 */\nexport interface FaSelectV2Slots extends Record<string, unknown> {\n\t/** @description FaSelectOption 默认内容插槽 */\n\tdefault: { item: ElSelectorOutput; index: number; disabled: boolean };\n\t/** @description 下拉列表顶部的内容 */\n\theader: never;\n\t/** @description 下拉列表底部的内容 */\n\tfooter: never;\n\t/** @description Select 组件头部内容 */\n\tprefix: never;\n\t/** @description 无选项时的列表 */\n\tempty: never;\n\t/** @description select 组件自定义标签内容 */\n\ttag: never;\n\t/** @description select 组件自定义 loading内容 */\n\tloading: never;\n\t/** @description select 组件自定义标签内容 */\n\tlabel: { label: string; value: string | number | boolean | object };\n}\n\nexport default defineComponent({\n\tname: \"FaSelectV2\",\n\tprops: faSelectV2Props,\n\temits: faSelectV2Emits,\n\tslots: makeSlots<FaSelectV2Slots>(),\n\tsetup(props, { slots, emit, expose }) {\n\t\tconst selectedLabel = useVModel(props, \"label\", emit, { passive: true });\n\t\tconst _globalSize = useGlobalSize();\n\n\t\tconst state = reactive({\n\t\t\tvalue: withDefineType<ElSelectorModelValue>(),\n\t\t\tloading: false,\n\t\t\tselectorData: withDefineType<ElSelectorOutput[]>([]),\n\t\t\t/** 首次出现 */\n\t\t\tdebut: true,\n\t\t\t/** 回显 */\n\t\t\techo: props.data?.length > 0 ? false : true,\n\t\t\t/** 下次刷新 */\n\t\t\tnextRefresh: false,\n\t\t});\n\n\t\tconst selectV2Ref = ref<InstanceType<typeof ElSelectV2>>();\n\t\tlet requestVersion = 0;\n\n\t\tconst loadData = async (): Promise<void> => {\n\t\t\tconst currentRequestVersion = ++requestVersion;\n\t\t\t// 判断是否需要自动请求\n\t\t\tif (props.requestApi) {\n\t\t\t\tstate.loading = true;\n\t\t\t\tconst params = props.initParam ?? {};\n\t\t\t\ttry {\n\t\t\t\t\tconst resData = await props.requestApi(params);\n\t\t\t\t\tif (currentRequestVersion !== requestVersion) return;\n\t\t\t\t\t// 这里不允许回显了\n\t\t\t\t\tstate.echo = false;\n\t\t\t\t\t// 判断是否为分页返回\n\t\t\t\t\tif (props.pageResult) {\n\t\t\t\t\t\tstate.selectorData = (resData as PagedResult<ElSelectorOutput>).rows ?? [];\n\t\t\t\t\t} else {\n\t\t\t\t\t\tstate.selectorData = resData as ElSelectorOutput[];\n\t\t\t\t\t}\n\t\t\t\t\temit(\"dataChangeCallBack\", state.selectorData);\n\t\t\t\t} catch (error) {\n\t\t\t\t\tif (currentRequestVersion !== requestVersion) return;\n\t\t\t\t\tstate.selectorData = [];\n\t\t\t\t\tthrow error;\n\t\t\t\t} finally {\n\t\t\t\t\tif (currentRequestVersion === requestVersion) state.loading = false;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (currentRequestVersion !== requestVersion) return;\n\t\t\t\t// 这里不允许回显了\n\t\t\t\tstate.echo = false;\n\t\t\t\tstate.selectorData = props.data ?? [];\n\t\t\t}\n\t\t};\n\n\t\tconst handleModelValueUpdate = (value: ElSelectorModelValue): void => {\n\t\t\tstate.value = value;\n\t\t\temit(\"update:modelValue\", value);\n\t\t};\n\n\t\tconst handleVisibleChange = async (visible: boolean): Promise<void> => {\n\t\t\tif (visible) {\n\t\t\t\tif (state.debut) {\n\t\t\t\t\t// 首次出现\n\t\t\t\t\tstate.debut = false;\n\t\t\t\t\t// 懒加载\n\t\t\t\t\t!props.defaultSelected && props.lazy && (await loadData());\n\t\t\t\t} else {\n\t\t\t\t\t// 判断再次出现是否需要刷新数据\n\t\t\t\t\tif (state.nextRefresh) {\n\t\t\t\t\t\tstate.nextRefresh = false;\n\t\t\t\t\t\tawait loadData();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\temit(\"visible-change\", visible);\n\t\t};\n\n\t\twatch(\n\t\t\t() => props.modelValue,\n\t\t\t(newValue) => {\n\t\t\t\tif (state.echo && !isNil(newValue)) {\n\t\t\t\t\tconst hasLabel = !isNil(props.label);\n\t\t\t\t\t// 判断是否为多选\n\t\t\t\t\tif (props.multiple) {\n\t\t\t\t\t\t// 判断是否为数组\n\t\t\t\t\t\tif (!Array.isArray(newValue)) {\n\t\t\t\t\t\t\tconsole.error(\"[Fast:FaSelectV2]\", \"当启用 multiple 时,传入的 modelValue 必须是 Array。\");\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (hasLabel && !isArray(props.label)) {\n\t\t\t\t\t\t\tconsole.error(\"[Fast:FaSelectV2]\", \"当启用 multiple 时,传入的 modelValue:label 必须是 Array。\");\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tstate.selectorData = newValue\n\t\t\t\t\t\t\t// 最大选项截取\n\t\t\t\t\t\t\t.slice(0, props.multipleLimit > 0 ? props.multipleLimit : newValue.length)\n\t\t\t\t\t\t\t.map((item, index) => {\n\t\t\t\t\t\t\t\tconst value: unknown = item;\n\t\t\t\t\t\t\t\tconst label: unknown = Array.isArray(props.label) ? props.label[index] : undefined;\n\t\t\t\t\t\t\t\tconst selectorValue: ElSelectorValue | undefined =\n\t\t\t\t\t\t\t\t\tvalue !== null &&\n\t\t\t\t\t\t\t\t\t(typeof value === \"string\" ||\n\t\t\t\t\t\t\t\t\t\ttypeof value === \"number\" ||\n\t\t\t\t\t\t\t\t\t\ttypeof value === \"boolean\" ||\n\t\t\t\t\t\t\t\t\t\ttypeof value === \"object\")\n\t\t\t\t\t\t\t\t\t\t? value\n\t\t\t\t\t\t\t\t\t\t: undefined;\n\t\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t\tvalue: selectorValue,\n\t\t\t\t\t\t\t\t\tlabel: hasLabel && typeof label === \"string\" ? label : undefined,\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t});\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (Array.isArray(newValue)) {\n\t\t\t\t\t\t\tconsole.error(\"[Fast:FaSelectV2]\", \"当禁用 multiple 时,传入的 modelValue 不能是 Array。\");\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (hasLabel && isArray(props.label)) {\n\t\t\t\t\t\t\tconsole.error(\"[Fast:FaSelectV2]\", \"当禁用 multiple 时,传入的 modelValue:label 不能是 Array。\");\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tstate.selectorData = [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tvalue: newValue,\n\t\t\t\t\t\t\t\tlabel: typeof props.label === \"string\" ? props.label : undefined,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tstate.value = newValue;\n\t\t\t},\n\t\t\t{\n\t\t\t\timmediate: true,\n\t\t\t}\n\t\t);\n\n\t\tconst getOptionValue = (item: ElSelectorOutput): ElSelectorValue | undefined => {\n\t\t\tconst value: unknown = item[props.props.value ?? \"value\"];\n\t\t\treturn value !== null &&\n\t\t\t\t(typeof value === \"string\" || typeof value === \"number\" || typeof value === \"boolean\" || typeof value === \"object\")\n\t\t\t\t? value\n\t\t\t\t: undefined;\n\t\t};\n\n\t\tconst getOptionLabel = (item: ElSelectorOutput): string | undefined => {\n\t\t\tconst label: unknown = item[props.props.label ?? \"label\"];\n\t\t\treturn typeof label === \"string\" ? label : undefined;\n\t\t};\n\n\t\tconst flattenOptions = (data: ElSelectorOutput[]): ElSelectorOutput[] =>\n\t\t\tdata.flatMap((item) => {\n\t\t\t\tconst children: unknown = item[props.props.options ?? \"options\"];\n\t\t\t\treturn [item, ...(Array.isArray(children) ? flattenOptions(children as ElSelectorOutput[]) : [])];\n\t\t\t});\n\n\t\tconst handleChange = (value?: ElSelectorModelValue): void => {\n\t\t\tconst selectorData = flattenOptions(state.selectorData);\n\t\t\tif (props.multiple) {\n\t\t\t\tconst valueList = Array.isArray(value) ? value : [];\n\t\t\t\tif (valueList.length === 0) {\n\t\t\t\t\temit(\"change\", null, null);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst dataList = valueList\n\t\t\t\t\t.map((item) =>\n\t\t\t\t\t\tselectorData.find((option) => {\n\t\t\t\t\t\t\tconst optionValue = getOptionValue(option);\n\t\t\t\t\t\t\treturn optionValue !== undefined && isEqual(optionValue, item);\n\t\t\t\t\t\t})\n\t\t\t\t\t)\n\t\t\t\t\t.filter((item): item is ElSelectorOutput => item !== undefined);\n\t\t\t\temit(\"change\", dataList, value);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (isNil(value) || Array.isArray(value)) {\n\t\t\t\temit(\"change\", null, null);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst data = selectorData.find((option) => {\n\t\t\t\tconst optionValue = getOptionValue(option);\n\t\t\t\treturn optionValue !== undefined && isEqual(optionValue, value);\n\t\t\t});\n\t\t\temit(\"change\", data ?? null, value);\n\t\t};\n\n\t\twatch(\n\t\t\t[() => state.value, () => state.selectorData],\n\t\t\t([value]) => {\n\t\t\t\tconst selectorData = flattenOptions(state.selectorData);\n\t\t\t\tif (props.multiple) {\n\t\t\t\t\tif (!Array.isArray(value)) {\n\t\t\t\t\t\tselectedLabel.value = null;\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tselectedLabel.value = value.map((item, index) => {\n\t\t\t\t\t\tconst data = selectorData.find((option) => {\n\t\t\t\t\t\t\tconst optionValue = getOptionValue(option);\n\t\t\t\t\t\t\treturn optionValue !== undefined && isEqual(optionValue, item);\n\t\t\t\t\t\t});\n\t\t\t\t\t\treturn (data && getOptionLabel(data)) ?? (Array.isArray(props.label) ? (props.label[index] ?? \"\") : \"\");\n\t\t\t\t\t});\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (isNil(value) || Array.isArray(value)) {\n\t\t\t\t\tselectedLabel.value = null;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst data = selectorData.find((option) => {\n\t\t\t\t\tconst optionValue = getOptionValue(option);\n\t\t\t\t\treturn optionValue !== undefined && isEqual(optionValue, value);\n\t\t\t\t});\n\t\t\t\tselectedLabel.value = (data && getOptionLabel(data)) ?? (typeof props.label === \"string\" ? props.label : null);\n\t\t\t},\n\t\t\t{\n\t\t\t\tdeep: true,\n\t\t\t\tflush: \"sync\",\n\t\t\t\timmediate: true,\n\t\t\t}\n\t\t);\n\n\t\tonMounted(async () => {\n\t\t\tif (props.defaultSelected) {\n\t\t\t\tawait loadData();\n\t\t\t\tconst firstItem = state.selectorData[0];\n\t\t\t\tconst firstValue = firstItem && getOptionValue(firstItem);\n\t\t\t\tif (firstValue !== undefined) {\n\t\t\t\t\thandleModelValueUpdate(props.multiple ? [firstValue] : firstValue);\n\t\t\t\t}\n\t\t\t}\n\t\t\t// 判断是否为本地数据\n\t\t\telse if (!props.requestApi && props.data?.length > 0) {\n\t\t\t\tstate.debut = false;\n\t\t\t\tawait loadData();\n\t\t\t}\n\t\t\t// 判断是否非默认选中,且未启用懒加载\n\t\t\telse if (!props.lazy) {\n\t\t\t\tawait loadData();\n\t\t\t}\n\t\t\twatch(\n\t\t\t\t() => props.initParam,\n\t\t\t\t(newValue, oldValue) => {\n\t\t\t\t\tif (!isEqual(newValue, oldValue)) {\n\t\t\t\t\t\tstate.nextRefresh = true;\n\t\t\t\t\t\tif (!isNil(state.value)) {\n\t\t\t\t\t\t\thandleModelValueUpdate(props.multiple ? [] : undefined);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\t\t\twatch(\n\t\t\t\t() => props.data,\n\t\t\t\t() => {\n\t\t\t\t\tif (!props.requestApi) {\n\t\t\t\t\t\treturn loadData();\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t{ deep: true }\n\t\t\t);\n\t\t});\n\n\t\tconst elSelectV2Props = useProps(props, SelectV2Props, [\"modelValue\", \"popperClass\", \"loading\", \"options\", \"itemHeight\"]);\n\t\tconst elSelectV2Emits = useEmits(selectV2Emits, emit, [\"update:modelValue\", \"change\", \"visible-change\"]);\n\t\tconst elPopperClass = computed(() => {\n\t\t\tlet localClass = `fa-select-v2-dropdown ${props.popperClass}`;\n\t\t\tif (props.moreDetail) {\n\t\t\t\tlocalClass += ` fa-select-v2-dropdown__more-detail fa-select-v2-dropdown__more-detail-${_globalSize.value}`;\n\t\t\t}\n\t\t\treturn localClass;\n\t\t});\n\n\t\tuseRender(() => (\n\t\t\t<ElSelectV2\n\t\t\t\t{...elSelectV2Props.value}\n\t\t\t\t{...elSelectV2Emits.value}\n\t\t\t\tref={selectV2Ref}\n\t\t\t\tclass=\"fa-select-v2\"\n\t\t\t\tpopperClass={elPopperClass.value}\n\t\t\t\tstyle={{ width: addCssUnit(props.width) }}\n\t\t\t\tmodelValue={state.value}\n\t\t\t\tonUpdate:modelValue={handleModelValueUpdate}\n\t\t\t\tonChange={handleChange}\n\t\t\t\tloading={state.loading}\n\t\t\t\toptions={state.selectorData}\n\t\t\t\titemHeight={props.itemHeight + (_globalSize.value === \"small\" ? 0 : 8)}\n\t\t\t\tonVisible-change={handleVisibleChange}\n\t\t\t>\n\t\t\t\t{{\n\t\t\t\t\t...(slots.default && {\n\t\t\t\t\t\tdefault: ({ item, index, disabled }: { item: ElSelectorOutput; index: number; disabled: boolean }): VNode[] =>\n\t\t\t\t\t\t\tslots.default?.({ item, index, disabled }) ?? [],\n\t\t\t\t\t}),\n\t\t\t\t\t...(slots.header && { header: (): VNode[] => slots.header?.() ?? [] }),\n\t\t\t\t\t...(slots.footer && { footer: (): VNode[] => slots.footer?.() ?? [] }),\n\t\t\t\t\t...(slots.prefix && { prefix: (): VNode[] => slots.prefix?.() ?? [] }),\n\t\t\t\t\t...(slots.empty && { empty: (): VNode[] => slots.empty?.() ?? [] }),\n\t\t\t\t\t...(slots.tag && { tag: (): VNode[] => slots.tag?.() ?? [] }),\n\t\t\t\t\t...(slots.loading && { loading: (): VNode[] => slots.loading?.() ?? [] }),\n\t\t\t\t\t...(slots.label && {\n\t\t\t\t\t\tlabel: ({ label, value }: { label: string; value: string | number | boolean | object }): VNode[] =>\n\t\t\t\t\t\t\tslots.label?.({ label, value }) ?? [],\n\t\t\t\t\t}),\n\t\t\t\t}}\n\t\t\t</ElSelectV2>\n\t\t));\n\n\t\treturn useExpose(expose, {\n\t\t\t/** @description 使选择器的输入框获取焦点 */\n\t\t\tfocus: computed(() => selectV2Ref.value?.focus),\n\t\t\t/** @description 使选择器的输入框失去焦点,并隐藏下拉框 */\n\t\t\tblur: computed(() => selectV2Ref.value?.blur),\n\t\t\t/** @description 获取当前选中的标签 */\n\t\t\tselectedLabel: computed(() => selectV2Ref.value?.selectedLabel),\n\t\t\t/** @description 滚动到指定选项索引。 */\n\t\t\tscrollTo: computed(() => selectV2Ref.value?.scrollTo),\n\t\t\t/** @description 加载状态 */\n\t\t\tloading: computed(() => state.loading),\n\t\t\t/** @description 刷新 */\n\t\t\trefresh: loadData,\n\t\t\t/** @description 设置选择 */\n\t\t\tsetSelection: (value: Exclude<ElSelectorModelValue, null | undefined>) => handleModelValueUpdate(value),\n\t\t\t/** @description 清除选择 */\n\t\t\tclearSelection: () => handleModelValueUpdate(props.multiple ? [] : undefined),\n\t\t});\n\t},\n});\n"],"mappings":";;;;;;;;;;;;;;AAoBA,MAAa,gBAAgB;;;;CAI5B,aAAa;;;;CAIb,cAAc;EACb,MAAM,eAAoD,MAAM;EAChE,SAAS;CACV;;;;CAIA,mBAAmB;;;;CAInB,WAAW;;;;CAIX,WAAW;EACV,MAAM,eAAmC;GAAC;GAAQ;GAAQ;EAAQ,CAAC;EACnE,SAAS;CACV;;;;CAIA,QAAQ;EACP,MAAM,eAAuB,MAAM;EACnC,SAAS;CACV;;;;CAIA,cAAc;;;;CAId,qBAAqB;;CAErB,YAAY;EACX,MAAM,eAAuD,MAAM;EACnE,gBAAqE,CAAC;CACvE;;;;CAIA,iBAAiB;EAChB,MAAM;EACN,SAAS;CACV;;;;CAIA,oBAAoB;;;;CAIpB,UAAU;;;;CAIV,uBAAuB;EACtB,MAAM;EACN,SAAS,KAAA;CACV;;;;CAIA,YAAY;;;;CAIZ,cAAc;;;;CAId,QAAQ;EACP,MAAM;EACN,SAAS;CACV;;;;CAIA,YAAY;EACX,MAAM;EACN,SAAS;CACV;;;;CAIA,IAAI;;;;CAIJ,SAAS;;;;CAIT,aAAa;;;;CAIb,YAAY,EACX,MAAM,eAAqC;EAAC;EAAO;EAAQ;EAAQ;EAAS;CAAM,CAAC,EACpF;;;;CAIA,UAAU;;;;CAIV,eAAe;EACd,MAAM;EACN,SAAS;CACV;;;;CAIA,MAAM;;;;CAIN,YAAY;;;;CAIZ,aAAa;;;;CAIb,cAAc;;;;CAId,gBAAgB;EACf,MAAM;E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EAAG;GAC3D,GAAI,MAAM,WAAW,EAAE,eAAwB,MAAM,UAAU,KAAK,CAAA,EAAG;GACvE,GAAI,MAAM,SAAS,EAClB,QAAQ,EAAE,OAAO,YAChB,MAAM,QAAQ;IAAE;IAAO;GAAM,CAAC,KAAK,CAAA,EACrC;EAAE,CAAA,CAGJ;EAED,OAAO,UAAU,QAAQ;;GAExB,OAAO,eAAe,YAAY,OAAO,KAAK;;GAE9C,MAAM,eAAe,YAAY,OAAO,IAAI;;GAE5C,eAAe,eAAe,YAAY,OAAO,aAAa;;GAE9D,UAAU,eAAe,YAAY,OAAO,QAAQ;;GAEpD,SAAS,eAAe,MAAM,OAAO;;GAErC,SAAS;;GAET,eAAe,UAA2D,uBAAuB,KAAK;;GAEtG,sBAAsB,uBAAuB,MAAM,WAAW,CAAA,IAAK,KAAA,CAAS;EAC7E,CAAC;CACF;AACD,CAAC"}
@@ -153,10 +153,10 @@ export declare const faTreeEmits: {
153
153
  "update:label": (value: string) => boolean;
154
154
  /** @description 数据改变 */
155
155
  dataChangeCallBack: (data: ElTreeOutput[]) => boolean;
156
- /** @description 改变 */
156
+ /** @description 选中数据改变 */
157
157
  change: (_data: ElTreeOutput, _node: TreeNode, _instance: ComponentInternalInstance, _event: MouseEvent) => boolean;
158
158
  /** @description 节点点击 */
159
- "node-click": (_data: ElTreeOutput, _node: TreeNode, _instance: ComponentInternalInstance, _event: MouseEvent) => boolean;
159
+ "node-click": (_data: ElTreeOutput, _node: TreeNode, _instance: ComponentInternalInstance | null, _event: MouseEvent) => boolean;
160
160
  'check-change': (data: any, checked: boolean, indeterminate: boolean) => any;
161
161
  'current-change': (data: any | null, node: import("element-plus/es/components/tree/src/model/node.mjs").default | null) => boolean;
162
162
  'node-contextmenu': (evt: Event, data: any, node: import("element-plus/es/components/tree/src/model/node.mjs").default, nodeInstance: ComponentInternalInstance | null) => any;
@@ -377,10 +377,10 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
377
377
  "update:label": (value: string) => boolean;
378
378
  /** @description 数据改变 */
379
379
  dataChangeCallBack: (data: ElTreeOutput[]) => boolean;
380
- /** @description 改变 */
380
+ /** @description 选中数据改变 */
381
381
  change: (_data: ElTreeOutput, _node: TreeNode, _instance: ComponentInternalInstance, _event: MouseEvent) => boolean;
382
382
  /** @description 节点点击 */
383
- "node-click": (_data: ElTreeOutput, _node: TreeNode, _instance: ComponentInternalInstance, _event: MouseEvent) => boolean;
383
+ "node-click": (_data: ElTreeOutput, _node: TreeNode, _instance: ComponentInternalInstance | null, _event: MouseEvent) => boolean;
384
384
  'check-change': (data: any, checked: boolean, indeterminate: boolean) => any;
385
385
  'current-change': (data: any | null, node: import("element-plus/es/components/tree/src/model/node.mjs").default | null) => boolean;
386
386
  'node-contextmenu': (evt: Event, data: any, node: import("element-plus/es/components/tree/src/model/node.mjs").default, nodeInstance: ComponentInternalInstance | null) => any;
@@ -539,7 +539,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
539
539
  "onCurrent-change"?: ((data: any, node: import("element-plus/es/components/tree/src/model/node.mjs").default | null) => any) | undefined;
540
540
  "onUpdate:label"?: ((value: string) => any) | undefined;
541
541
  onDataChangeCallBack?: ((data: ElTreeOutput<import("./tree.type").ElTreeValue, any>[]) => any) | undefined;
542
- "onNode-click"?: ((_data: ElTreeOutput<import("./tree.type").ElTreeValue, any>, _node: TreeNode, _instance: ComponentInternalInstance, _event: MouseEvent) => any) | undefined;
542
+ "onNode-click"?: ((_data: ElTreeOutput<import("./tree.type").ElTreeValue, any>, _node: TreeNode, _instance: ComponentInternalInstance | null, _event: MouseEvent) => any) | undefined;
543
543
  "onCheck-change"?: ((data: any, checked: boolean, indeterminate: boolean) => any) | undefined;
544
544
  "onNode-contextmenu"?: ((evt: Event, data: any, node: import("element-plus/es/components/tree/src/model/node.mjs").default, nodeInstance: ComponentInternalInstance | null) => any) | undefined;
545
545
  "onNode-collapse"?: ((data: any, node: import("element-plus/es/components/tree/src/model/node.mjs").default, nodeInstance: ComponentInternalInstance | null) => any) | undefined;
@@ -8,7 +8,7 @@ import { withDefineType } from "../../../utils/vue/with.mjs";
8
8
  import { computed, createTextVNode, createVNode, defineComponent, mergeProps, nextTick, onMounted, reactive, ref, resolveDirective, watch, withDirectives } from "vue";
9
9
  import { Expand, Fold } from "@element-plus/icons-vue";
10
10
  import { ElIcon, ElInput, ElScrollbar, ElTree, treeEmits, treeProps, useGlobalSize } from "element-plus";
11
- import { isArray, isBoolean, isNull, isNumber, isObject, isString, isUndefined } from "lodash-unified";
11
+ import { isArray, isBoolean, isEqual, isNull, isNumber, isObject, isString, isUndefined } from "lodash-unified";
12
12
  import { useVModel } from "@vueuse/core";
13
13
  //#region src/components/tree/src/tree.tsx
14
14
  /** FaTree 的运行时 Props 定义。 */
@@ -103,7 +103,7 @@ const faTreeEmits = {
103
103
  "update:label": (value) => isString(value) || isNull(value),
104
104
  /** @description 数据改变 */
105
105
  dataChangeCallBack: (data) => isArray(data),
106
- /** @description 改变 */
106
+ /** @description 选中数据改变 */
107
107
  change: (_data, _node, _instance, _event) => true,
108
108
  /** @description 节点点击 */
109
109
  "node-click": (_data, _node, _instance, _event) => true
@@ -206,11 +206,15 @@ var tree_default = defineComponent({
206
206
  if (!node.expanded) node.expand();
207
207
  else if (node.expanded && props.collapseOnClickNode) node.collapse();
208
208
  }
209
- if (!data["all"] && (node.key === void 0 || node.key === null)) return;
210
- state.value = data["all"] ? props.allValue : node.key ?? null;
211
- selectedLabel.value = node.label;
212
- emit("update:modelValue", state.value);
213
- emit("change", data, node, instance, event);
209
+ if (data["all"] || node.key !== void 0 && node.key !== null) {
210
+ const value = data["all"] ? props.allValue : node.key;
211
+ if (!isEqual(state.value, value)) {
212
+ state.value = value;
213
+ selectedLabel.value = node.label;
214
+ emit("update:modelValue", value);
215
+ emit("change", data, node, instance, event);
216
+ }
217
+ }
214
218
  emit("node-click", data, node, instance, event);
215
219
  };
216
220
  onMounted(async () => {
@@ -1 +1 @@
1
- {"version":3,"file":"tree.mjs","names":["update:modelValue","update:label","node-click"],"sources":["../../../../src/components/tree/src/tree.tsx"],"sourcesContent":["import { useVModel } from \"@vueuse/core\";\nimport { computed, defineComponent, nextTick, onMounted, reactive, ref, watch } from \"vue\";\nimport { Expand, Fold } from \"@element-plus/icons-vue\";\nimport { ElIcon, ElInput, ElScrollbar, ElTree, treeEmits, treeProps, useGlobalSize } from \"element-plus\";\nimport { isArray, isBoolean, isNull, isNumber, isObject, isString, isUndefined } from \"lodash-unified\";\nimport { addCssUnit, definePropType, makeSlots, useEmits, useExpose, useProps, useRender, withDefineType } from \"../../../utils\";\nimport type { FilterValue, TreeNodeData } from \"element-plus\";\nimport type { ComponentInternalInstance, VNode } from \"vue\";\nimport type { PagedInput } from \"../../table\";\nimport type { FilterNodeMethodFunction, TreeNode } from \"./tree.props\";\nimport type { ElTreeOutput } from \"./tree.type\";\n\n/** FaTree 的运行时 Props 定义。 */\nexport const faTreeProps = {\n\t...treeProps,\n\t/** 树节点筛选方法。 */\n\tfilterNodeMethod: {\n\t\ttype: definePropType<FilterNodeMethodFunction>(Function),\n\t},\n\t/** @description whether Select is disabled 重载使其支持 ElForm*/\n\tdisabled: {\n\t\ttype: Boolean,\n\t\tdefault: undefined,\n\t},\n\t/** 每个树节点用来作为唯一标识的属性,整棵树应该是唯一的 */\n\tnodeKey: {\n\t\ttype: String,\n\t\tdefault: \"value\",\n\t},\n\t/** @description 是否默认展开所有节点 */\n\tdefaultExpandAll: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** @description 是否在点击节点的时候选中节点 */\n\tcheckOnClickNode: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** @description 是否高亮当前选中节点 */\n\thighlightCurrent: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** @description 点击折叠节点,需要开启 'expandOnClickNode' */\n\tcollapseOnClickNode: Boolean,\n\t/** @description v-model绑定值 */\n\tmodelValue: {\n\t\ttype: definePropType<string | number | boolean | object | null>([String, Number, Boolean, Object]),\n\t\tdefault: undefined,\n\t},\n\t/** @description v-model:label绑定值 */\n\tlabel: String,\n\t/** @description 宽度 */\n\twidth: {\n\t\ttype: [String, Number],\n\t\tdefault: 180,\n\t},\n\t/** @description 默认选择 */\n\tdefaultSelection: [String, Number],\n\t/** @description 标题 */\n\ttitle: String,\n\t/** @description 折叠 */\n\thamburger: Boolean,\n\t/** @description 隐藏全部 */\n\thideAll: Boolean,\n\t/** @description 隐藏过滤 */\n\thideFilter: Boolean,\n\t/** @description 全部值 */\n\tallValue: {\n\t\ttype: definePropType<string | number | boolean | object | null>([String, Number, Boolean, Object]),\n\t\tdefault: undefined,\n\t},\n\t/** @description 树形数据 */\n\tdata: {\n\t\ttype: definePropType<ElTreeOutput[]>(Array),\n\t\tdefault: (): ElTreeOutput[] => [],\n\t},\n\t/** @description 请求api */\n\trequestApi: {\n\t\ttype: definePropType<(params?: string | number | PagedInput) => Promise<ElTreeOutput[]>>(Function),\n\t},\n\t/** 初始化参数 */\n\tinitParam: definePropType<string | number | PagedInput>([String, Number, Object]),\n};\n\n/** FaTree 的运行时 Emits 定义。 */\nexport const faTreeEmits = {\n\t...treeEmits,\n\t/** @description v-model 回调 */\n\t\"update:modelValue\": (value: string | number | boolean | object | null | undefined): boolean =>\n\t\tisString(value) || isNumber(value) || isBoolean(value) || isObject(value) || isNull(value) || isUndefined(value),\n\t/** @description v-model:label 回调 */\n\t\"update:label\": (value: string): boolean => isString(value) || isNull(value),\n\t/** @description 数据改变 */\n\tdataChangeCallBack: (data: ElTreeOutput[]): boolean => isArray(data),\n\t/** @description 改变 */\n\tchange: (_data: ElTreeOutput, _node: TreeNode, _instance: ComponentInternalInstance, _event: MouseEvent): boolean => true,\n\t/** @description 节点点击 */\n\t\"node-click\": (_data: ElTreeOutput, _node: TreeNode, _instance: ComponentInternalInstance, _event: MouseEvent): boolean => true,\n};\n\n/** FaTree 的插槽参数。 */\nexport interface FaTreeSlots extends Record<string, unknown> {\n\t/** @description 默认内容插槽 */\n\tdefault: { node: TreeNode; data: ElTreeOutput };\n\t/** @description 当数据为空时自定义的内容 */\n\tempty: never;\n\t/** @description 显示内容插槽 */\n\tlabel: { node: TreeNode; data: ElTreeOutput };\n}\n\nexport default defineComponent({\n\tname: \"FaTree\",\n\tprops: faTreeProps,\n\temits: faTreeEmits,\n\tslots: makeSlots<FaTreeSlots>(),\n\tsetup(props, { slots, emit, expose }) {\n\t\tconst selectedLabel = useVModel(props, \"label\", emit, { passive: true });\n\t\tconst _globalSize = useGlobalSize();\n\n\t\tconst state = reactive({\n\t\t\tvalue: withDefineType<string | number | boolean | object | null | undefined>(props.modelValue),\n\t\t\tloading: false,\n\t\t\tsearchValue: withDefineType<string>(),\n\t\t\torgTreeData: withDefineType<ElTreeOutput[]>([]),\n\t\t\ttreeData: withDefineType<ElTreeOutput[]>([]),\n\t\t\thamburger: props.hamburger || false,\n\t\t\twidth: computed(() => {\n\t\t\t\tif (state.hamburger) {\n\t\t\t\t\treturn \"130px\";\n\t\t\t\t} else {\n\t\t\t\t\tconst width = addCssUnit(props.width);\n\t\t\t\t\tif (_globalSize.value === \"small\") {\n\t\t\t\t\t\treturn `calc(${width} * 0.9)`;\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn width;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}),\n\t\t});\n\n\t\t/** @description 只有一层节点 */\n\t\tconst fold = computed<boolean>(() => {\n\t\t\tconst childrenKey = props.props.children ?? \"children\";\n\t\t\treturn state.orgTreeData.every((item) => !Array.isArray(item[childrenKey]) || item[childrenKey].length === 0);\n\t\t});\n\n\t\tconst treeRef = ref<InstanceType<typeof ElTree>>();\n\t\tlet requestVersion = 0;\n\n\t\tconst loadData = async (): Promise<void> => {\n\t\t\tconst currentRequestVersion = ++requestVersion;\n\t\t\tlet curSelectedData: string | number | undefined;\n\t\t\tif (props.nodeKey) {\n\t\t\t\t// 记录原本选中的值\n\t\t\t\tconst currentKey = treeRef.value?.getCurrentKey();\n\t\t\t\tif (typeof currentKey === \"string\" || typeof currentKey === \"number\") curSelectedData = currentKey;\n\t\t\t}\n\t\t\tlet treeData: ElTreeOutput[];\n\t\t\t// 判断是否需要自动请求\n\t\t\tif (props.requestApi) {\n\t\t\t\tstate.loading = true;\n\t\t\t\tconst params = {\n\t\t\t\t\t...(typeof props.initParam === \"object\" && props.initParam !== null ? props.initParam : {}),\n\t\t\t\t\tsearchValue: state.searchValue,\n\t\t\t\t};\n\t\t\t\ttry {\n\t\t\t\t\tconst responseData = await props.requestApi(params);\n\t\t\t\t\ttreeData = responseData.map((item) => ({ ...item }));\n\t\t\t\t} catch (error) {\n\t\t\t\t\tif (currentRequestVersion !== requestVersion) return;\n\t\t\t\t\tthrow error;\n\t\t\t\t} finally {\n\t\t\t\t\tif (currentRequestVersion === requestVersion) state.loading = false;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\ttreeData = props.data.map((item) => ({ ...item }));\n\t\t\t}\n\t\t\tif (currentRequestVersion !== requestVersion) return;\n\t\t\tif (!props.hideAll) {\n\t\t\t\ttreeData.unshift({ [props.nodeKey]: props.allValue, label: \"全部\", value: null, all: true });\n\t\t\t}\n\t\t\tstate.orgTreeData = treeData;\n\t\t\tstate.treeData = treeData;\n\t\t\temit(\"dataChangeCallBack\", state.treeData);\n\t\t\tconst selectedKey = curSelectedData ?? props.modelValue ?? props.defaultSelection;\n\t\t\tif (props.nodeKey && (typeof selectedKey === \"string\" || typeof selectedKey === \"number\")) {\n\t\t\t\tvoid nextTick(() => {\n\t\t\t\t\t// 设置原本选中的值\n\t\t\t\t\ttreeRef.value?.setCurrentKey(selectedKey);\n\t\t\t\t});\n\t\t\t}\n\t\t};\n\n\t\tconst handleHamburgerClick = (): void => {\n\t\t\tif (state.hamburger) {\n\t\t\t\tstate.treeData = state.orgTreeData;\n\t\t\t} else {\n\t\t\t\t// 折叠只显示一级数据\n\t\t\t\tstate.treeData = state.orgTreeData.map((item) => ({ ...item, [props.props.children ?? \"children\"]: [] }));\n\t\t\t}\n\t\t\tstate.hamburger = !state.hamburger;\n\t\t};\n\n\t\tconst handleFilterNode = (value: FilterValue, data: TreeNodeData, child: TreeNode): boolean => {\n\t\t\tif (!value) return true;\n\t\t\tconst isAll: unknown = data[\"all\"];\n\t\t\tconst dataLabel: unknown = data[\"label\"];\n\t\t\tlet parentNode = child.parent,\n\t\t\t\tlabels: unknown[] = isAll ? [dataLabel] : [child.label],\n\t\t\t\tlevel = 1;\n\t\t\twhile (level < child.level && parentNode) {\n\t\t\t\tlabels = [...labels, parentNode.label];\n\t\t\t\tparentNode = parentNode.parent;\n\t\t\t\tlevel++;\n\t\t\t}\n\t\t\tconst filterText = typeof value === \"string\" || typeof value === \"number\" ? String(value) : \"\";\n\t\t\tconst result = labels.some((label) =>\n\t\t\t\ttypeof label === \"string\" || typeof label === \"number\" ? String(label).includes(filterText) : false\n\t\t\t);\n\t\t\tif (props.filterNodeMethod) {\n\t\t\t\treturn result && props.filterNodeMethod(value, data, child);\n\t\t\t}\n\t\t\treturn result;\n\t\t};\n\n\t\tconst handleNodeClick = (data: ElTreeOutput, node: TreeNode, instance: ComponentInternalInstance | null, event: MouseEvent): void => {\n\t\t\tif (!instance) return;\n\t\t\t// 判断是否开启点击展开节点,并且节点是折叠状态,则自动展开,否则需要点击箭头图标才能折叠或开启 'collapseOnClickNode'\n\t\t\tif (props.expandOnClickNode) {\n\t\t\t\tif (!node.expanded) {\n\t\t\t\t\tnode.expand();\n\t\t\t\t} else if (node.expanded && props.collapseOnClickNode) {\n\t\t\t\t\tnode.collapse();\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!data[\"all\"] && (node.key === undefined || node.key === null)) return;\n\t\t\tstate.value = data[\"all\"] ? props.allValue : (node.key ?? null);\n\t\t\tselectedLabel.value = node.label;\n\t\t\temit(\"update:modelValue\", state.value);\n\t\t\temit(\"change\", data, node, instance, event);\n\t\t\temit(\"node-click\", data, node, instance, event);\n\t\t};\n\n\t\tonMounted(async () => {\n\t\t\tawait loadData();\n\t\t\twatch(\n\t\t\t\t() => props.data,\n\t\t\t\t() => {\n\t\t\t\t\tif (!props.requestApi) {\n\t\t\t\t\t\treturn loadData();\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t{ deep: true }\n\t\t\t);\n\t\t});\n\n\t\twatch(\n\t\t\t() => props.modelValue,\n\t\t\t(newValue) => {\n\t\t\t\tstate.value = newValue;\n\t\t\t\tif (typeof newValue === \"string\" || typeof newValue === \"number\") treeRef.value?.setCurrentKey(newValue);\n\t\t\t}\n\t\t);\n\n\t\tconst elTreeProps = useProps(props, treeProps, [\"data\", \"expandOnClickNode\", \"filterNodeMethod\"]);\n\t\tconst elTreeEmits = useEmits(treeEmits, emit, [\"node-click\"]);\n\n\t\tuseRender(() => (\n\t\t\t<div\n\t\t\t\tclass={[\"el-card fa-tree\", `fa-tree-${_globalSize.value}`, { \"fa-tree__fold\": state.hamburger || fold.value }]}\n\t\t\t\tstyle={{ width: state.width }}\n\t\t\t\tvLoading={state.loading}\n\t\t\t>\n\t\t\t\t{(props.title !== undefined || props.hamburger) && (\n\t\t\t\t\t<div class=\"fa-tree__title\">\n\t\t\t\t\t\t{props.title && <h4>{props.title}</h4>}\n\t\t\t\t\t\t{props.hamburger &&\n\t\t\t\t\t\t\t(state.hamburger ? (\n\t\t\t\t\t\t\t\t<ElIcon onClick={handleHamburgerClick} title=\"展开\">\n\t\t\t\t\t\t\t\t\t<Expand />\n\t\t\t\t\t\t\t\t</ElIcon>\n\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t<ElIcon onClick={handleHamburgerClick} title=\"折叠\">\n\t\t\t\t\t\t\t\t\t<Fold />\n\t\t\t\t\t\t\t\t</ElIcon>\n\t\t\t\t\t\t\t))}\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t\t{!props.hideFilter && (\n\t\t\t\t\t<ElInput\n\t\t\t\t\t\tclass=\"fa-tree__search-input\"\n\t\t\t\t\t\tvModel_trim={state.searchValue}\n\t\t\t\t\t\tplaceholder={state.hamburger ? \"关键字过滤\" : \"输入关键字进行过滤\"}\n\t\t\t\t\t\tclearable={Boolean(state.searchValue)}\n\t\t\t\t\t\tonInput={(value) => treeRef.value?.filter(value)}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t\t<ElScrollbar class=\"fa-tree__scrollbar\">\n\t\t\t\t\t<ElTree\n\t\t\t\t\t\t{...elTreeProps.value}\n\t\t\t\t\t\t{...elTreeEmits.value}\n\t\t\t\t\t\tref={treeRef}\n\t\t\t\t\t\tdata={state.treeData}\n\t\t\t\t\t\texpandOnClickNode={props.checkOnClickNode ? false : props.expandOnClickNode}\n\t\t\t\t\t\tfilterNodeMethod={handleFilterNode}\n\t\t\t\t\t\tonNode-click={handleNodeClick}\n\t\t\t\t\t>\n\t\t\t\t\t\t{{\n\t\t\t\t\t\t\tdefault: ({ node, data }: { node: TreeNode; data: ElTreeOutput }) => (\n\t\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\t\tclass=\"el-tree-node__label\"\n\t\t\t\t\t\t\t\t\ttitle={data[\"all\"] ? data.label : node.label}\n\t\t\t\t\t\t\t\t\tstyle={{ paddingLeft: fold.value ? \"3px\" : \"\" }}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<div>{data[\"all\"] ? data.label : slots.label ? slots.label({ node, data }) : node.label}</div>\n\t\t\t\t\t\t\t\t\t{node.key && data.showQuantity ? <span>[{data.quantity}]</span> : null}\n\t\t\t\t\t\t\t\t\t{!data[\"all\"] && slots.default && <span>{slots.default({ node, data })}</span>}\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t...(slots.empty && { empty: (): VNode[] => slots.empty?.() ?? [] }),\n\t\t\t\t\t\t}}\n\t\t\t\t\t</ElTree>\n\t\t\t\t</ElScrollbar>\n\t\t\t</div>\n\t\t));\n\n\t\treturn useExpose(expose, {\n\t\t\t/** @description 过滤所有树节点,过滤后的节点将被隐藏 */\n\t\t\tfilter: computed(() => treeRef.value?.filter),\n\t\t\t/** @description 获取节点的唯一标识。 */\n\t\t\tgetNodeKey: computed(() => treeRef.value?.getNodeKey),\n\t\t\t/** @description 获取指定节点的路径数据。 */\n\t\t\tgetNodePath: computed(() => treeRef.value?.getNodePath),\n\t\t\t/** @description 为节点设置新数据,只有当设置 node-key 属性的时候才可用 */\n\t\t\tupdateKeyChildren: computed(() => treeRef.value?.updateKeyChildren),\n\t\t\t/** @description 如果节点可以被选中,(show-checkbox 为 true), 本方法将返回当前选中节点的数组 */\n\t\t\tgetCheckedNodes: computed(() => treeRef.value?.getCheckedNodes),\n\t\t\t/** @description 设置目前勾选的节点,使用此方法必须提前设置 node-key 属性 */\n\t\t\tsetCheckedNodes: computed(() => treeRef.value?.setCheckedNodes),\n\t\t\t/** @description \t若节点可用被选中 (show-checkbox 为 true), 它将返回当前选中节点 key 的数组 */\n\t\t\tgetCheckedKeys: computed(() => treeRef.value?.getCheckedKeys),\n\t\t\t/** @description 设置目前选中的节点,使用此方法必须设置 node-key 属性 */\n\t\t\tsetCheckedKeys: computed(() => treeRef.value?.setCheckedKeys),\n\t\t\t/** @description 设置节点是否被选中, 使用此方法必须设置 node-key 属性 */\n\t\t\tsetChecked: computed(() => treeRef.value?.setChecked),\n\t\t\t/** @description 如果节点可用被选中 (show-checkbox 为 true), 它将返回当前半选中的节点组成的数组 */\n\t\t\tgetHalfCheckedNodes: computed(() => treeRef.value?.getHalfCheckedNodes),\n\t\t\t/** @description 若节点可被选中(show-checkbox 为 true),则返回目前半选中的节点的 key 所组成的数组 */\n\t\t\tgetHalfCheckedKeys: computed(() => treeRef.value?.getHalfCheckedKeys),\n\t\t\t/** @description 返回当前被选中节点的数据 (如果没有则返回 null) */\n\t\t\tgetCurrentKey: computed(() => treeRef.value?.getCurrentKey),\n\t\t\t/** @description 返回当前被选中节点的数据 (如果没有则返回 null) */\n\t\t\tgetCurrentNode: computed(() => treeRef.value?.getCurrentNode),\n\t\t\t/** @description 通过 key 设置某个节点的当前选中状态,使用此方法必须设置 node-key 属性 */\n\t\t\tsetCurrentKey: computed(() => treeRef.value?.setCurrentKey),\n\t\t\t/** @description 设置节点为选中状态,使用此方法必须设置 node-key 属性 */\n\t\t\tsetCurrentNode: computed(() => treeRef.value?.setCurrentNode),\n\t\t\t/** @description 根据 data 或者 key 拿到 Tree 组件中的 node */\n\t\t\tgetNode: computed(() => treeRef.value?.getNode),\n\t\t\t/** @description 删除 Tree 中的一个节点,使用此方法必须设置 node-key 属性 */\n\t\t\tremove: computed(() => treeRef.value?.remove),\n\t\t\t/** @description 为 Tree 中的一个节点追加一个子节点 */\n\t\t\tappend: computed(() => treeRef.value?.append),\n\t\t\t/** @description 在 Tree 中给定节点前插入一个节点 */\n\t\t\tinsertBefore: computed(() => treeRef.value?.insertBefore),\n\t\t\t/** @description 在 Tree 中给定节点后插入一个节点 */\n\t\t\tinsertAfter: computed(() => treeRef.value?.insertAfter),\n\t\t\t/** @description 加载状态 */\n\t\t\tloading: computed(() => state.loading),\n\t\t\t/** @description 刷新 */\n\t\t\trefresh: loadData,\n\t\t});\n\t},\n});\n"],"mappings":";;;;;;;;;;;;;;AAaA,MAAa,cAAc;CAC1B,GAAG;;CAEH,kBAAkB,EACjB,MAAM,eAAyC,QAAQ,EACxD;;CAEA,UAAU;EACT,MAAM;EACN,SAAS,KAAA;CACV;;CAEA,SAAS;EACR,MAAM;EACN,SAAS;CACV;;CAEA,kBAAkB;EACjB,MAAM;EACN,SAAS;CACV;;CAEA,kBAAkB;EACjB,MAAM;EACN,SAAS;CACV;;CAEA,kBAAkB;EACjB,MAAM;EACN,SAAS;CACV;;CAEA,qBAAqB;;CAErB,YAAY;EACX,MAAM,eAA0D;GAAC;GAAQ;GAAQ;GAAS;EAAM,CAAC;EACjG,SAAS,KAAA;CACV;;CAEA,OAAO;;CAEP,OAAO;EACN,MAAM,CAAC,QAAQ,MAAM;EACrB,SAAS;CACV;;CAEA,k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AQ,OAAO,eAAe;;GAE9D,iBAAiB,eAAe,QAAQ,OAAO,eAAe;;GAE9D,gBAAgB,eAAe,QAAQ,OAAO,cAAc;;GAE5D,gBAAgB,eAAe,QAAQ,OAAO,cAAc;;GAE5D,YAAY,eAAe,QAAQ,OAAO,UAAU;;GAEpD,qBAAqB,eAAe,QAAQ,OAAO,mBAAmB;;GAEtE,oBAAoB,eAAe,QAAQ,OAAO,kBAAkB;;GAEpE,eAAe,eAAe,QAAQ,OAAO,aAAa;;GAE1D,gBAAgB,eAAe,QAAQ,OAAO,cAAc;;GAE5D,eAAe,eAAe,QAAQ,OAAO,aAAa;;GAE1D,gBAAgB,eAAe,QAAQ,OAAO,cAAc;;GAE5D,SAAS,eAAe,QAAQ,OAAO,OAAO;;GAE9C,QAAQ,eAAe,QAAQ,OAAO,MAAM;;GAE5C,QAAQ,eAAe,QAAQ,OAAO,MAAM;;GAE5C,cAAc,eAAe,QAAQ,OAAO,YAAY;;GAExD,aAAa,eAAe,QAAQ,OAAO,WAAW;;GAEtD,SAAS,eAAe,MAAM,OAAO;;GAErC,SAAS;EACV,CAAC;CACF;AACD,CAAC"}
1
+ {"version":3,"file":"tree.mjs","names":["update:modelValue","update:label","node-click"],"sources":["../../../../src/components/tree/src/tree.tsx"],"sourcesContent":["import { useVModel } from \"@vueuse/core\";\nimport { computed, defineComponent, nextTick, onMounted, reactive, ref, watch } from \"vue\";\nimport { Expand, Fold } from \"@element-plus/icons-vue\";\nimport { ElIcon, ElInput, ElScrollbar, ElTree, treeEmits, treeProps, useGlobalSize } from \"element-plus\";\nimport { isArray, isBoolean, isEqual, isNull, isNumber, isObject, isString, isUndefined } from \"lodash-unified\";\nimport { addCssUnit, definePropType, makeSlots, useEmits, useExpose, useProps, useRender, withDefineType } from \"../../../utils\";\nimport type { FilterValue, TreeNodeData } from \"element-plus\";\nimport type { ComponentInternalInstance, VNode } from \"vue\";\nimport type { PagedInput } from \"../../table\";\nimport type { FilterNodeMethodFunction, TreeNode } from \"./tree.props\";\nimport type { ElTreeOutput } from \"./tree.type\";\n\n/** FaTree 的运行时 Props 定义。 */\nexport const faTreeProps = {\n\t...treeProps,\n\t/** 树节点筛选方法。 */\n\tfilterNodeMethod: {\n\t\ttype: definePropType<FilterNodeMethodFunction>(Function),\n\t},\n\t/** @description whether Select is disabled 重载使其支持 ElForm*/\n\tdisabled: {\n\t\ttype: Boolean,\n\t\tdefault: undefined,\n\t},\n\t/** 每个树节点用来作为唯一标识的属性,整棵树应该是唯一的 */\n\tnodeKey: {\n\t\ttype: String,\n\t\tdefault: \"value\",\n\t},\n\t/** @description 是否默认展开所有节点 */\n\tdefaultExpandAll: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** @description 是否在点击节点的时候选中节点 */\n\tcheckOnClickNode: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** @description 是否高亮当前选中节点 */\n\thighlightCurrent: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** @description 点击折叠节点,需要开启 'expandOnClickNode' */\n\tcollapseOnClickNode: Boolean,\n\t/** @description v-model绑定值 */\n\tmodelValue: {\n\t\ttype: definePropType<string | number | boolean | object | null>([String, Number, Boolean, Object]),\n\t\tdefault: undefined,\n\t},\n\t/** @description v-model:label绑定值 */\n\tlabel: String,\n\t/** @description 宽度 */\n\twidth: {\n\t\ttype: [String, Number],\n\t\tdefault: 180,\n\t},\n\t/** @description 默认选择 */\n\tdefaultSelection: [String, Number],\n\t/** @description 标题 */\n\ttitle: String,\n\t/** @description 折叠 */\n\thamburger: Boolean,\n\t/** @description 隐藏全部 */\n\thideAll: Boolean,\n\t/** @description 隐藏过滤 */\n\thideFilter: Boolean,\n\t/** @description 全部值 */\n\tallValue: {\n\t\ttype: definePropType<string | number | boolean | object | null>([String, Number, Boolean, Object]),\n\t\tdefault: undefined,\n\t},\n\t/** @description 树形数据 */\n\tdata: {\n\t\ttype: definePropType<ElTreeOutput[]>(Array),\n\t\tdefault: (): ElTreeOutput[] => [],\n\t},\n\t/** @description 请求api */\n\trequestApi: {\n\t\ttype: definePropType<(params?: string | number | PagedInput) => Promise<ElTreeOutput[]>>(Function),\n\t},\n\t/** 初始化参数 */\n\tinitParam: definePropType<string | number | PagedInput>([String, Number, Object]),\n};\n\n/** FaTree 的运行时 Emits 定义。 */\nexport const faTreeEmits = {\n\t...treeEmits,\n\t/** @description v-model 回调 */\n\t\"update:modelValue\": (value: string | number | boolean | object | null | undefined): boolean =>\n\t\tisString(value) || isNumber(value) || isBoolean(value) || isObject(value) || isNull(value) || isUndefined(value),\n\t/** @description v-model:label 回调 */\n\t\"update:label\": (value: string): boolean => isString(value) || isNull(value),\n\t/** @description 数据改变 */\n\tdataChangeCallBack: (data: ElTreeOutput[]): boolean => isArray(data),\n\t/** @description 选中数据改变 */\n\tchange: (_data: ElTreeOutput, _node: TreeNode, _instance: ComponentInternalInstance, _event: MouseEvent): boolean => true,\n\t/** @description 节点点击 */\n\t\"node-click\": (_data: ElTreeOutput, _node: TreeNode, _instance: ComponentInternalInstance | null, _event: MouseEvent): boolean => true,\n};\n\n/** FaTree 的插槽参数。 */\nexport interface FaTreeSlots extends Record<string, unknown> {\n\t/** @description 默认内容插槽 */\n\tdefault: { node: TreeNode; data: ElTreeOutput };\n\t/** @description 当数据为空时自定义的内容 */\n\tempty: never;\n\t/** @description 显示内容插槽 */\n\tlabel: { node: TreeNode; data: ElTreeOutput };\n}\n\nexport default defineComponent({\n\tname: \"FaTree\",\n\tprops: faTreeProps,\n\temits: faTreeEmits,\n\tslots: makeSlots<FaTreeSlots>(),\n\tsetup(props, { slots, emit, expose }) {\n\t\tconst selectedLabel = useVModel(props, \"label\", emit, { passive: true });\n\t\tconst _globalSize = useGlobalSize();\n\n\t\tconst state = reactive({\n\t\t\tvalue: withDefineType<string | number | boolean | object | null | undefined>(props.modelValue),\n\t\t\tloading: false,\n\t\t\tsearchValue: withDefineType<string>(),\n\t\t\torgTreeData: withDefineType<ElTreeOutput[]>([]),\n\t\t\ttreeData: withDefineType<ElTreeOutput[]>([]),\n\t\t\thamburger: props.hamburger || false,\n\t\t\twidth: computed(() => {\n\t\t\t\tif (state.hamburger) {\n\t\t\t\t\treturn \"130px\";\n\t\t\t\t} else {\n\t\t\t\t\tconst width = addCssUnit(props.width);\n\t\t\t\t\tif (_globalSize.value === \"small\") {\n\t\t\t\t\t\treturn `calc(${width} * 0.9)`;\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn width;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}),\n\t\t});\n\n\t\t/** @description 只有一层节点 */\n\t\tconst fold = computed<boolean>(() => {\n\t\t\tconst childrenKey = props.props.children ?? \"children\";\n\t\t\treturn state.orgTreeData.every((item) => !Array.isArray(item[childrenKey]) || item[childrenKey].length === 0);\n\t\t});\n\n\t\tconst treeRef = ref<InstanceType<typeof ElTree>>();\n\t\tlet requestVersion = 0;\n\n\t\tconst loadData = async (): Promise<void> => {\n\t\t\tconst currentRequestVersion = ++requestVersion;\n\t\t\tlet curSelectedData: string | number | undefined;\n\t\t\tif (props.nodeKey) {\n\t\t\t\t// 记录原本选中的值\n\t\t\t\tconst currentKey = treeRef.value?.getCurrentKey();\n\t\t\t\tif (typeof currentKey === \"string\" || typeof currentKey === \"number\") curSelectedData = currentKey;\n\t\t\t}\n\t\t\tlet treeData: ElTreeOutput[];\n\t\t\t// 判断是否需要自动请求\n\t\t\tif (props.requestApi) {\n\t\t\t\tstate.loading = true;\n\t\t\t\tconst params = {\n\t\t\t\t\t...(typeof props.initParam === \"object\" && props.initParam !== null ? props.initParam : {}),\n\t\t\t\t\tsearchValue: state.searchValue,\n\t\t\t\t};\n\t\t\t\ttry {\n\t\t\t\t\tconst responseData = await props.requestApi(params);\n\t\t\t\t\ttreeData = responseData.map((item) => ({ ...item }));\n\t\t\t\t} catch (error) {\n\t\t\t\t\tif (currentRequestVersion !== requestVersion) return;\n\t\t\t\t\tthrow error;\n\t\t\t\t} finally {\n\t\t\t\t\tif (currentRequestVersion === requestVersion) state.loading = false;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\ttreeData = props.data.map((item) => ({ ...item }));\n\t\t\t}\n\t\t\tif (currentRequestVersion !== requestVersion) return;\n\t\t\tif (!props.hideAll) {\n\t\t\t\ttreeData.unshift({ [props.nodeKey]: props.allValue, label: \"全部\", value: null, all: true });\n\t\t\t}\n\t\t\tstate.orgTreeData = treeData;\n\t\t\tstate.treeData = treeData;\n\t\t\temit(\"dataChangeCallBack\", state.treeData);\n\t\t\tconst selectedKey = curSelectedData ?? props.modelValue ?? props.defaultSelection;\n\t\t\tif (props.nodeKey && (typeof selectedKey === \"string\" || typeof selectedKey === \"number\")) {\n\t\t\t\tvoid nextTick(() => {\n\t\t\t\t\t// 设置原本选中的值\n\t\t\t\t\ttreeRef.value?.setCurrentKey(selectedKey);\n\t\t\t\t});\n\t\t\t}\n\t\t};\n\n\t\tconst handleHamburgerClick = (): void => {\n\t\t\tif (state.hamburger) {\n\t\t\t\tstate.treeData = state.orgTreeData;\n\t\t\t} else {\n\t\t\t\t// 折叠只显示一级数据\n\t\t\t\tstate.treeData = state.orgTreeData.map((item) => ({ ...item, [props.props.children ?? \"children\"]: [] }));\n\t\t\t}\n\t\t\tstate.hamburger = !state.hamburger;\n\t\t};\n\n\t\tconst handleFilterNode = (value: FilterValue, data: TreeNodeData, child: TreeNode): boolean => {\n\t\t\tif (!value) return true;\n\t\t\tconst isAll: unknown = data[\"all\"];\n\t\t\tconst dataLabel: unknown = data[\"label\"];\n\t\t\tlet parentNode = child.parent,\n\t\t\t\tlabels: unknown[] = isAll ? [dataLabel] : [child.label],\n\t\t\t\tlevel = 1;\n\t\t\twhile (level < child.level && parentNode) {\n\t\t\t\tlabels = [...labels, parentNode.label];\n\t\t\t\tparentNode = parentNode.parent;\n\t\t\t\tlevel++;\n\t\t\t}\n\t\t\tconst filterText = typeof value === \"string\" || typeof value === \"number\" ? String(value) : \"\";\n\t\t\tconst result = labels.some((label) =>\n\t\t\t\ttypeof label === \"string\" || typeof label === \"number\" ? String(label).includes(filterText) : false\n\t\t\t);\n\t\t\tif (props.filterNodeMethod) {\n\t\t\t\treturn result && props.filterNodeMethod(value, data, child);\n\t\t\t}\n\t\t\treturn result;\n\t\t};\n\n\t\tconst handleNodeClick = (data: ElTreeOutput, node: TreeNode, instance: ComponentInternalInstance | null, event: MouseEvent): void => {\n\t\t\tif (!instance) return;\n\t\t\t// 判断是否开启点击展开节点,并且节点是折叠状态,则自动展开,否则需要点击箭头图标才能折叠或开启 'collapseOnClickNode'\n\t\t\tif (props.expandOnClickNode) {\n\t\t\t\tif (!node.expanded) {\n\t\t\t\t\tnode.expand();\n\t\t\t\t} else if (node.expanded && props.collapseOnClickNode) {\n\t\t\t\t\tnode.collapse();\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (data[\"all\"] || (node.key !== undefined && node.key !== null)) {\n\t\t\t\tconst value = data[\"all\"] ? props.allValue : node.key;\n\t\t\t\tif (!isEqual(state.value, value)) {\n\t\t\t\t\tstate.value = value;\n\t\t\t\t\tselectedLabel.value = node.label;\n\t\t\t\t\temit(\"update:modelValue\", value);\n\t\t\t\t\temit(\"change\", data, node, instance, event);\n\t\t\t\t}\n\t\t\t}\n\t\t\temit(\"node-click\", data, node, instance, event);\n\t\t};\n\n\t\tonMounted(async () => {\n\t\t\tawait loadData();\n\t\t\twatch(\n\t\t\t\t() => props.data,\n\t\t\t\t() => {\n\t\t\t\t\tif (!props.requestApi) {\n\t\t\t\t\t\treturn loadData();\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t{ deep: true }\n\t\t\t);\n\t\t});\n\n\t\twatch(\n\t\t\t() => props.modelValue,\n\t\t\t(newValue) => {\n\t\t\t\tstate.value = newValue;\n\t\t\t\tif (typeof newValue === \"string\" || typeof newValue === \"number\") treeRef.value?.setCurrentKey(newValue);\n\t\t\t}\n\t\t);\n\n\t\tconst elTreeProps = useProps(props, treeProps, [\"data\", \"expandOnClickNode\", \"filterNodeMethod\"]);\n\t\tconst elTreeEmits = useEmits(treeEmits, emit, [\"node-click\"]);\n\n\t\tuseRender(() => (\n\t\t\t<div\n\t\t\t\tclass={[\"el-card fa-tree\", `fa-tree-${_globalSize.value}`, { \"fa-tree__fold\": state.hamburger || fold.value }]}\n\t\t\t\tstyle={{ width: state.width }}\n\t\t\t\tvLoading={state.loading}\n\t\t\t>\n\t\t\t\t{(props.title !== undefined || props.hamburger) && (\n\t\t\t\t\t<div class=\"fa-tree__title\">\n\t\t\t\t\t\t{props.title && <h4>{props.title}</h4>}\n\t\t\t\t\t\t{props.hamburger &&\n\t\t\t\t\t\t\t(state.hamburger ? (\n\t\t\t\t\t\t\t\t<ElIcon onClick={handleHamburgerClick} title=\"展开\">\n\t\t\t\t\t\t\t\t\t<Expand />\n\t\t\t\t\t\t\t\t</ElIcon>\n\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t<ElIcon onClick={handleHamburgerClick} title=\"折叠\">\n\t\t\t\t\t\t\t\t\t<Fold />\n\t\t\t\t\t\t\t\t</ElIcon>\n\t\t\t\t\t\t\t))}\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t\t{!props.hideFilter && (\n\t\t\t\t\t<ElInput\n\t\t\t\t\t\tclass=\"fa-tree__search-input\"\n\t\t\t\t\t\tvModel_trim={state.searchValue}\n\t\t\t\t\t\tplaceholder={state.hamburger ? \"关键字过滤\" : \"输入关键字进行过滤\"}\n\t\t\t\t\t\tclearable={Boolean(state.searchValue)}\n\t\t\t\t\t\tonInput={(value) => treeRef.value?.filter(value)}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t\t<ElScrollbar class=\"fa-tree__scrollbar\">\n\t\t\t\t\t<ElTree\n\t\t\t\t\t\t{...elTreeProps.value}\n\t\t\t\t\t\t{...elTreeEmits.value}\n\t\t\t\t\t\tref={treeRef}\n\t\t\t\t\t\tdata={state.treeData}\n\t\t\t\t\t\texpandOnClickNode={props.checkOnClickNode ? false : props.expandOnClickNode}\n\t\t\t\t\t\tfilterNodeMethod={handleFilterNode}\n\t\t\t\t\t\tonNode-click={handleNodeClick}\n\t\t\t\t\t>\n\t\t\t\t\t\t{{\n\t\t\t\t\t\t\tdefault: ({ node, data }: { node: TreeNode; data: ElTreeOutput }) => (\n\t\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\t\tclass=\"el-tree-node__label\"\n\t\t\t\t\t\t\t\t\ttitle={data[\"all\"] ? data.label : node.label}\n\t\t\t\t\t\t\t\t\tstyle={{ paddingLeft: fold.value ? \"3px\" : \"\" }}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<div>{data[\"all\"] ? data.label : slots.label ? slots.label({ node, data }) : node.label}</div>\n\t\t\t\t\t\t\t\t\t{node.key && data.showQuantity ? <span>[{data.quantity}]</span> : null}\n\t\t\t\t\t\t\t\t\t{!data[\"all\"] && slots.default && <span>{slots.default({ node, data })}</span>}\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t...(slots.empty && { empty: (): VNode[] => slots.empty?.() ?? [] }),\n\t\t\t\t\t\t}}\n\t\t\t\t\t</ElTree>\n\t\t\t\t</ElScrollbar>\n\t\t\t</div>\n\t\t));\n\n\t\treturn useExpose(expose, {\n\t\t\t/** @description 过滤所有树节点,过滤后的节点将被隐藏 */\n\t\t\tfilter: computed(() => treeRef.value?.filter),\n\t\t\t/** @description 获取节点的唯一标识。 */\n\t\t\tgetNodeKey: computed(() => treeRef.value?.getNodeKey),\n\t\t\t/** @description 获取指定节点的路径数据。 */\n\t\t\tgetNodePath: computed(() => treeRef.value?.getNodePath),\n\t\t\t/** @description 为节点设置新数据,只有当设置 node-key 属性的时候才可用 */\n\t\t\tupdateKeyChildren: computed(() => treeRef.value?.updateKeyChildren),\n\t\t\t/** @description 如果节点可以被选中,(show-checkbox 为 true), 本方法将返回当前选中节点的数组 */\n\t\t\tgetCheckedNodes: computed(() => treeRef.value?.getCheckedNodes),\n\t\t\t/** @description 设置目前勾选的节点,使用此方法必须提前设置 node-key 属性 */\n\t\t\tsetCheckedNodes: computed(() => treeRef.value?.setCheckedNodes),\n\t\t\t/** @description \t若节点可用被选中 (show-checkbox 为 true), 它将返回当前选中节点 key 的数组 */\n\t\t\tgetCheckedKeys: computed(() => treeRef.value?.getCheckedKeys),\n\t\t\t/** @description 设置目前选中的节点,使用此方法必须设置 node-key 属性 */\n\t\t\tsetCheckedKeys: computed(() => treeRef.value?.setCheckedKeys),\n\t\t\t/** @description 设置节点是否被选中, 使用此方法必须设置 node-key 属性 */\n\t\t\tsetChecked: computed(() => treeRef.value?.setChecked),\n\t\t\t/** @description 如果节点可用被选中 (show-checkbox 为 true), 它将返回当前半选中的节点组成的数组 */\n\t\t\tgetHalfCheckedNodes: computed(() => treeRef.value?.getHalfCheckedNodes),\n\t\t\t/** @description 若节点可被选中(show-checkbox 为 true),则返回目前半选中的节点的 key 所组成的数组 */\n\t\t\tgetHalfCheckedKeys: computed(() => treeRef.value?.getHalfCheckedKeys),\n\t\t\t/** @description 返回当前被选中节点的数据 (如果没有则返回 null) */\n\t\t\tgetCurrentKey: computed(() => treeRef.value?.getCurrentKey),\n\t\t\t/** @description 返回当前被选中节点的数据 (如果没有则返回 null) */\n\t\t\tgetCurrentNode: computed(() => treeRef.value?.getCurrentNode),\n\t\t\t/** @description 通过 key 设置某个节点的当前选中状态,使用此方法必须设置 node-key 属性 */\n\t\t\tsetCurrentKey: computed(() => treeRef.value?.setCurrentKey),\n\t\t\t/** @description 设置节点为选中状态,使用此方法必须设置 node-key 属性 */\n\t\t\tsetCurrentNode: computed(() => treeRef.value?.setCurrentNode),\n\t\t\t/** @description 根据 data 或者 key 拿到 Tree 组件中的 node */\n\t\t\tgetNode: computed(() => treeRef.value?.getNode),\n\t\t\t/** @description 删除 Tree 中的一个节点,使用此方法必须设置 node-key 属性 */\n\t\t\tremove: computed(() => treeRef.value?.remove),\n\t\t\t/** @description 为 Tree 中的一个节点追加一个子节点 */\n\t\t\tappend: computed(() => treeRef.value?.append),\n\t\t\t/** @description 在 Tree 中给定节点前插入一个节点 */\n\t\t\tinsertBefore: computed(() => treeRef.value?.insertBefore),\n\t\t\t/** @description 在 Tree 中给定节点后插入一个节点 */\n\t\t\tinsertAfter: computed(() => treeRef.value?.insertAfter),\n\t\t\t/** @description 加载状态 */\n\t\t\tloading: computed(() => state.loading),\n\t\t\t/** @description 刷新 */\n\t\t\trefresh: loadData,\n\t\t});\n\t},\n});\n"],"mappings":";;;;;;;;;;;;;;AAaA,MAAa,cAAc;CAC1B,GAAG;;CAEH,kBAAkB,EACjB,MAAM,eAAyC,QAAQ,EACxD;;CAEA,UAAU;EACT,MAAM;EACN,SAAS,KAAA;CACV;;CAEA,SAAS;EACR,MAAM;EACN,SAAS;CACV;;CAEA,kBAAkB;EACjB,MAAM;EACN,SAAS;CACV;;CAEA,kBAAkB;EACjB,MAAM;EACN,SAAS;CACV;;CAEA,kBAAkB;EACjB,MAAM;EACN,SAAS;CACV;;CAEA,qBAAqB;;CAErB,YAAY;EACX,MAAM,eAA0D;GAAC;GAAQ;GAAQ;GAAS;EAAM,CAAC;EACjG,SAAS,KAAA;CACV;;CAEA,OAAO;;CAEP,OAAO;EACN,MAAM,CAAC,QAAQ,MAAM;EACrB,SAAS;CACV;;CAEA,kBAAkB,CAAC,QAAQ,MAAM;;CAEjC,OAAO;;CAEP,WAAW;;CAEX,SAAS;;CAET,YAAY;;CAEZ,UAAU;EACT,MAAM,eAA0D;GAAC;GAAQ;GAAQ;GAAS;EAAM,CAAC;EACjG,SAAS,KAAA;CACV;;CAEA,MAAM;EACL,MAAM,eAA+B,KAAK;EAC1C,eAA+B,CAAA;CAChC;;CAEA,YAAY,EACX,MAAM,eAAmF,QAAQ,EAClG;;CAEA,WAAW,eAA6C;EAAC;EAAQ;EAAQ;CAAM,CAAC;AACjF;;AAGA,MAAa,cAAc;CAC1B,GAAG;;CAEH,sBAAsB,UACrB,SAAS,KAAK,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AAc;;GAE5D,eAAe,eAAe,QAAQ,OAAO,aAAa;;GAE1D,gBAAgB,eAAe,QAAQ,OAAO,cAAc;;GAE5D,SAAS,eAAe,QAAQ,OAAO,OAAO;;GAE9C,QAAQ,eAAe,QAAQ,OAAO,MAAM;;GAE5C,QAAQ,eAAe,QAAQ,OAAO,MAAM;;GAE5C,cAAc,eAAe,QAAQ,OAAO,YAAY;;GAExD,aAAa,eAAe,QAAQ,OAAO,WAAW;;GAEtD,SAAS,eAAe,MAAM,OAAO;;GAErC,SAAS;EACV,CAAC;CACF;AACD,CAAC"}
@@ -230,7 +230,7 @@ export declare const faTreeSelectProps: {
230
230
  maxCollapseTags: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<NumberConstructor, unknown, unknown, number, boolean>;
231
231
  teleported: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
232
232
  persistent: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<BooleanConstructor, unknown, unknown, boolean, boolean>;
233
- clearIcon: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<(new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component) | (((new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component)) | null)[], unknown, unknown, import("vue").DefineComponent<{}, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>, boolean>;
233
+ clearIcon: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<(new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component) | (((new (... /** @description 数据改变 */args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component)) | null)[], unknown, unknown, import("vue").DefineComponent<{}, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>, boolean>;
234
234
  fitInputWidth: BooleanConstructor;
235
235
  suffixIcon: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<(new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component) | (((new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component)) | null)[], unknown, unknown, import("vue").DefineComponent<{}, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>, boolean>;
236
236
  tagType: {
@@ -271,14 +271,14 @@ export declare const faTreeSelectProps: {
271
271
  export declare const faTreeSelectEmits: {
272
272
  /** @description v-model 回调 */
273
273
  "update:modelValue": (value: ElSelectorModelValue) => boolean;
274
+ /** @description 选中数据改变 */
275
+ change: (_data: ElSelectorOutput | ElSelectorOutput[] | null, _value?: ElSelectorModelValue) => boolean;
274
276
  /** @description v-model:label 回调 */
275
277
  "update:label": (value: string | string[] | null) => boolean;
276
278
  /** @description 数据改变 */
277
279
  dataChangeCallBack: (data: ElSelectorOutput[]) => boolean;
278
- /** @description 改变 */
279
- change: (_data: ElSelectorOutput | ElSelectorOutput[] | null, _value?: ElSelectorModelValue) => boolean;
280
280
  /** @description 节点点击 */
281
- "node-click": (_data: ElSelectorOutput, _node: TreeNode, _instance: ComponentInternalInstance, _event: MouseEvent) => boolean;
281
+ "node-click": (_data: ElSelectorOutput, _node: TreeNode, _instance: ComponentInternalInstance | null) => boolean;
282
282
  'check-change': (data: any, checked: boolean, indeterminate: boolean) => any;
283
283
  'current-change': (data: any | null, node: import("element-plus/es/components/tree/src/model/node.mjs").default | null) => boolean;
284
284
  'node-contextmenu': (evt: Event, data: any, node: import("element-plus/es/components/tree/src/model/node.mjs").default, nodeInstance: ComponentInternalInstance | null) => any;
@@ -552,7 +552,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
552
552
  maxCollapseTags: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<NumberConstructor, unknown, unknown, number, boolean>;
553
553
  teleported: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
554
554
  persistent: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<BooleanConstructor, unknown, unknown, boolean, boolean>;
555
- clearIcon: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<(new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component) | (((new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component)) | null)[], unknown, unknown, import("vue").DefineComponent<{}, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>, boolean>;
555
+ clearIcon: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<(new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component) | (((new (... /** @description 数据改变 */args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component)) | null)[], unknown, unknown, import("vue").DefineComponent<{}, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>, boolean>;
556
556
  fitInputWidth: BooleanConstructor;
557
557
  suffixIcon: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<(new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component) | (((new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component)) | null)[], unknown, unknown, import("vue").DefineComponent<{}, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>, boolean>;
558
558
  tagType: {
@@ -646,14 +646,14 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
646
646
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
647
647
  /** @description v-model 回调 */
648
648
  "update:modelValue": (value: ElSelectorModelValue) => boolean;
649
+ /** @description 选中数据改变 */
650
+ change: (_data: ElSelectorOutput | ElSelectorOutput[] | null, _value?: ElSelectorModelValue) => boolean;
649
651
  /** @description v-model:label 回调 */
650
652
  "update:label": (value: string | string[] | null) => boolean;
651
653
  /** @description 数据改变 */
652
654
  dataChangeCallBack: (data: ElSelectorOutput[]) => boolean;
653
- /** @description 改变 */
654
- change: (_data: ElSelectorOutput | ElSelectorOutput[] | null, _value?: ElSelectorModelValue) => boolean;
655
655
  /** @description 节点点击 */
656
- "node-click": (_data: ElSelectorOutput, _node: TreeNode, _instance: ComponentInternalInstance, _event: MouseEvent) => boolean;
656
+ "node-click": (_data: ElSelectorOutput, _node: TreeNode, _instance: ComponentInternalInstance | null) => boolean;
657
657
  'check-change': (data: any, checked: boolean, indeterminate: boolean) => any;
658
658
  'current-change': (data: any | null, node: import("element-plus/es/components/tree/src/model/node.mjs").default | null) => boolean;
659
659
  'node-contextmenu': (evt: Event, data: any, node: import("element-plus/es/components/tree/src/model/node.mjs").default, nodeInstance: ComponentInternalInstance | null) => any;
@@ -901,7 +901,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
901
901
  maxCollapseTags: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<NumberConstructor, unknown, unknown, number, boolean>;
902
902
  teleported: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
903
903
  persistent: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<BooleanConstructor, unknown, unknown, boolean, boolean>;
904
- clearIcon: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<(new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component) | (((new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component)) | null)[], unknown, unknown, import("vue").DefineComponent<{}, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>, boolean>;
904
+ clearIcon: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<(new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component) | (((new (... /** @description 数据改变 */args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component)) | null)[], unknown, unknown, import("vue").DefineComponent<{}, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>, boolean>;
905
905
  fitInputWidth: BooleanConstructor;
906
906
  suffixIcon: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<(new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component) | (((new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component)) | null)[], unknown, unknown, import("vue").DefineComponent<{}, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>, boolean>;
907
907
  tagType: {
@@ -953,7 +953,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
953
953
  scrollLeft: number;
954
954
  }) => any) | undefined;
955
955
  "onRemove-tag"?: ((val: unknown) => any) | undefined;
956
- "onNode-click"?: ((_data: ElSelectorOutput<ElSelectorValue, any>, _node: TreeNode, _instance: ComponentInternalInstance, _event: MouseEvent) => any) | undefined;
956
+ "onNode-click"?: ((_data: ElSelectorOutput<ElSelectorValue, any>, _node: TreeNode, _instance: ComponentInternalInstance | null) => any) | undefined;
957
957
  "onCheck-change"?: ((data: any, checked: boolean, indeterminate: boolean) => any) | undefined;
958
958
  "onNode-contextmenu"?: ((evt: Event, data: any, node: import("element-plus/es/components/tree/src/model/node.mjs").default, nodeInstance: ComponentInternalInstance | null) => any) | undefined;
959
959
  "onNode-collapse"?: ((data: any, node: import("element-plus/es/components/tree/src/model/node.mjs").default, nodeInstance: ComponentInternalInstance | null) => any) | undefined;