fast-element-plus 2.0.26 → 2.0.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +35 -0
- package/README.md +6 -6
- package/README.zh.md +6 -6
- package/dist/component.d.ts +46 -35
- package/dist/components/avatar/src/avatar.d.ts +4 -4
- package/dist/components/button/src/button.d.ts +3 -3
- package/dist/components/carNumber/src/carNumber.d.ts +17 -6
- package/dist/components/carNumber/src/carNumber.mjs +16 -1
- package/dist/components/carNumber/src/carNumber.mjs.map +1 -1
- package/dist/components/drawer/src/drawer.d.ts +4 -4
- package/dist/components/form/src/formItem.d.ts +9 -3
- package/dist/components/form/src/formItem.mjs +5 -3
- package/dist/components/form/src/formItem.mjs.map +1 -1
- package/dist/components/image/src/image.d.ts +6 -1
- package/dist/components/image/src/image.mjs +7 -2
- package/dist/components/image/src/image.mjs.map +1 -1
- package/dist/components/select/src/select.d.ts +13 -7
- package/dist/components/select/src/select.mjs +4 -6
- package/dist/components/select/src/select.mjs.map +1 -1
- package/dist/components/select/src/selectOption.d.ts +5 -0
- package/dist/components/select/src/selectOption.mjs +3 -0
- package/dist/components/select/src/selectOption.mjs.map +1 -1
- package/dist/components/selectPage/src/selectPage.d.ts +16 -10
- package/dist/components/selectPage/src/selectPage.mjs +6 -8
- package/dist/components/selectPage/src/selectPage.mjs.map +1 -1
- package/dist/components/selectV2/src/selectV2.d.ts +7 -2
- package/dist/components/selectV2/src/selectV2.mjs +2 -5
- package/dist/components/selectV2/src/selectV2.mjs.map +1 -1
- package/dist/components/table/src/page.type.d.ts +4 -0
- package/dist/components/table/src/table.mjs +5 -4
- package/dist/components/table/src/table.mjs.map +1 -1
- package/dist/components/table/src/tableColumn.d.ts +1 -0
- package/dist/components/table/src/tableColumn.mjs +33 -19
- package/dist/components/table/src/tableColumn.mjs.map +1 -1
- package/dist/components/tree/src/tree.d.ts +4 -4
- package/dist/components/tree/src/tree.mjs +5 -4
- package/dist/components/tree/src/tree.mjs.map +1 -1
- package/dist/components/treeSelect/src/treeSelect.d.ts +33 -27
- package/dist/components/treeSelect/src/treeSelect.mjs +14 -12
- package/dist/components/treeSelect/src/treeSelect.mjs.map +1 -1
- package/dist/components/uploadImage/src/uploadImage.d.ts +9 -0
- package/dist/components/uploadImage/src/uploadImage.mjs +13 -6
- package/dist/components/uploadImage/src/uploadImage.mjs.map +1 -1
- package/dist/components/uploadImages/src/uploadImages.d.ts +9 -0
- package/dist/components/uploadImages/src/uploadImages.mjs +7 -5
- package/dist/components/uploadImages/src/uploadImages.mjs.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/index.global.min.js +3 -3
- package/dist/index.global.min.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.mjs +1 -1
- package/dist/version.mjs.map +1 -1
- package/package.json +4 -4
|
@@ -72,7 +72,7 @@ export declare const faTreeProps: {
|
|
|
72
72
|
requestApi: {
|
|
73
73
|
type: import("vue").PropType<(params?: string | number | PagedInput) => Promise<ElTreeOutput[]>>;
|
|
74
74
|
};
|
|
75
|
-
/**
|
|
75
|
+
/** 初始化参数。字符串和数字原样传入请求,对象参数会合并当前搜索值。 */
|
|
76
76
|
initParam: import("vue").PropType<string | number | PagedInput | null>;
|
|
77
77
|
emptyText: {
|
|
78
78
|
readonly type: import("vue").PropType<string>;
|
|
@@ -253,7 +253,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
253
253
|
requestApi: {
|
|
254
254
|
type: import("vue").PropType<(params?: string | number | PagedInput) => Promise<ElTreeOutput[]>>;
|
|
255
255
|
};
|
|
256
|
-
/**
|
|
256
|
+
/** 初始化参数。字符串和数字原样传入请求,对象参数会合并当前搜索值。 */
|
|
257
257
|
initParam: import("vue").PropType<string | number | PagedInput | null>;
|
|
258
258
|
emptyText: {
|
|
259
259
|
readonly type: import("vue").PropType<string>;
|
|
@@ -461,7 +461,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
461
461
|
requestApi: {
|
|
462
462
|
type: import("vue").PropType<(params?: string | number | PagedInput) => Promise<ElTreeOutput[]>>;
|
|
463
463
|
};
|
|
464
|
-
/**
|
|
464
|
+
/** 初始化参数。字符串和数字原样传入请求,对象参数会合并当前搜索值。 */
|
|
465
465
|
initParam: import("vue").PropType<string | number | PagedInput | null>;
|
|
466
466
|
emptyText: {
|
|
467
467
|
readonly type: import("vue").PropType<string>;
|
|
@@ -547,7 +547,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
547
547
|
onCheck?: ((data: any, checkedInfo: import("element-plus").CheckedInfo) => any) | undefined;
|
|
548
548
|
"onNode-drag-start"?: ((node: import("element-plus/es/components/tree/src/model/node.mjs").default, evt: DragEvent) => any) | undefined;
|
|
549
549
|
"onNode-drag-end"?: ((draggingNode: import("element-plus/es/components/tree/src/model/node.mjs").default, dropNode: import("element-plus/es/components/tree/src/model/node.mjs").default | null, dropType: import("element-plus").NodeDropType, evt: DragEvent) => any) | undefined;
|
|
550
|
-
"onNode-drop"?: ((draggingNode: import("element-plus/es/components/tree/src/model/node.mjs").default, dropNode: import("element-plus/es/components/tree/src/model/node.mjs").default, dropType: "
|
|
550
|
+
"onNode-drop"?: ((draggingNode: import("element-plus/es/components/tree/src/model/node.mjs").default, dropNode: import("element-plus/es/components/tree/src/model/node.mjs").default, dropType: "after" | "before" | "inner", evt: DragEvent) => any) | undefined;
|
|
551
551
|
"onNode-drag-leave"?: ((draggingNode: import("element-plus/es/components/tree/src/model/node.mjs").default, oldDropNode: import("element-plus/es/components/tree/src/model/node.mjs").default, evt: DragEvent) => any) | undefined;
|
|
552
552
|
"onNode-drag-enter"?: ((draggingNode: import("element-plus/es/components/tree/src/model/node.mjs").default, dropNode: import("element-plus/es/components/tree/src/model/node.mjs").default, evt: DragEvent) => any) | undefined;
|
|
553
553
|
"onNode-drag-over"?: ((draggingNode: import("element-plus/es/components/tree/src/model/node.mjs").default, dropNode: import("element-plus/es/components/tree/src/model/node.mjs").default, evt: DragEvent) => any) | undefined;
|
|
@@ -86,7 +86,7 @@ const faTreeProps = {
|
|
|
86
86
|
},
|
|
87
87
|
/** 请求数据的函数 */
|
|
88
88
|
requestApi: { type: definePropType(Function) },
|
|
89
|
-
/**
|
|
89
|
+
/** 初始化参数。字符串和数字原样传入请求,对象参数会合并当前搜索值。 */
|
|
90
90
|
initParam: definePropType([
|
|
91
91
|
String,
|
|
92
92
|
Number,
|
|
@@ -148,10 +148,11 @@ var tree_default = defineComponent({
|
|
|
148
148
|
let treeData;
|
|
149
149
|
if (props.requestApi) {
|
|
150
150
|
state.loading = true;
|
|
151
|
-
const
|
|
152
|
-
|
|
151
|
+
const initParam = props.initParam ?? {};
|
|
152
|
+
const params = typeof initParam === "object" ? {
|
|
153
|
+
...initParam,
|
|
153
154
|
searchValue: state.searchValue
|
|
154
|
-
};
|
|
155
|
+
} : initParam;
|
|
155
156
|
try {
|
|
156
157
|
treeData = (await props.requestApi(params)).map((item) => ({ ...item }));
|
|
157
158
|
} catch (error) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tree.mjs","names":["update:modelValue","update:label","node-click"],"sources":["../../../../src/components/tree/src/tree.tsx"],"sourcesContent":["import { computed, defineComponent, nextTick, onMounted, reactive, shallowRef, toRef, useModel, watch } from \"vue\";\nimport { Expand, Fold } from \"@element-plus/icons-vue\";\nimport { ElIcon, ElInput, ElScrollbar, ElTree, treeEmits, treeProps, useGlobalSize } from \"element-plus\";\nimport { addCssUnit, definePropType, isEqual, makeSlots, useEmits, useExpose, useProps, useRender, withDefineType } from \"../../../utils\";\nimport type { FilterValue, TreeNodeData } from \"element-plus\";\nimport type { ComponentInternalInstance } 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/** 是否禁用选择器;未指定时继承 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/** 是否默认展开所有节点 */\n\tdefaultExpandAll: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** 是否在点击节点的时候选中节点 */\n\tcheckOnClickNode: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** 是否高亮当前选中节点 */\n\thighlightCurrent: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** 点击折叠节点,需要开启 'expandOnClickNode' */\n\tcollapseOnClickNode: Boolean,\n\t/** 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/** v-model:label 绑定值 */\n\tlabel: String,\n\t/** 宽度 */\n\twidth: {\n\t\ttype: [String, Number],\n\t\tdefault: 180,\n\t},\n\t/** 默认选择 */\n\tdefaultSelection: [String, Number],\n\t/** 标题 */\n\ttitle: String,\n\t/** 折叠 */\n\thamburger: Boolean,\n\t/** 隐藏全部 */\n\thideAll: Boolean,\n\t/** 隐藏过滤 */\n\thideFilter: Boolean,\n\t/** 全部值 */\n\tallValue: {\n\t\ttype: definePropType<string | number | boolean | object | null>([String, Number, Boolean, Object]),\n\t\tdefault: undefined,\n\t},\n\t/** 树形数据 */\n\tdata: {\n\t\ttype: definePropType<ElTreeOutput[]>(Array),\n\t\tdefault: () => [],\n\t},\n\t/** 请求数据的函数 */\n\trequestApi: {\n\t\ttype: definePropType<(params?: string | number | PagedInput) => Promise<ElTreeOutput[]>>(Function),\n\t},\n\t/** 初始化参数 */\n\tinitParam: definePropType<string | number | PagedInput | null>([String, Number, Object]),\n};\n\n/** FaTree 的运行时 Emits 定义 */\nexport const faTreeEmits = {\n\t...treeEmits,\n\t/** v-model 回调 */\n\t\"update:modelValue\": (value: string | number | boolean | object | null | undefined) =>\n\t\ttypeof value === \"string\" ||\n\t\ttypeof value === \"number\" ||\n\t\ttypeof value === \"boolean\" ||\n\t\t(typeof value === \"object\" && value !== null) ||\n\t\tvalue == null,\n\t/** v-model:label 回调 */\n\t\"update:label\": (value: string) => typeof value === \"string\" || value === null,\n\t/** 数据改变 */\n\tdataChange: (data: ElTreeOutput[]) => Array.isArray(data),\n\t/** 选中数据改变 */\n\tchange: (_data: ElTreeOutput, _node: TreeNode, _instance: ComponentInternalInstance, _event: MouseEvent) => true,\n\t/** 节点点击 */\n\t\"node-click\": (_data: ElTreeOutput, _node: TreeNode, _instance: ComponentInternalInstance | null, _event: MouseEvent) => true,\n};\n\n/** FaTree 的插槽参数 */\nexport interface FaTreeSlots extends Record<string, unknown> {\n\t/** 默认内容插槽 */\n\tdefault: { node: TreeNode; data: ElTreeOutput };\n\t/** 当数据为空时自定义的内容 */\n\tempty: never;\n\t/** 显示内容插槽 */\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 = useModel(props, \"label\");\n\n\t\tconst globalSize = useGlobalSize();\n\t\tconst treeRef = shallowRef<InstanceType<typeof ElTree> | null>(null);\n\n\t\tconst state = reactive({\n\t\t\tvalue: withDefineType<string | number | boolean | object | null | undefined>(),\n\t\t\tloading: false,\n\t\t\tsearchValue: withDefineType<string>(),\n\t\t\toriginalTreeData: withDefineType<ElTreeOutput[]>([]),\n\t\t\ttreeData: withDefineType<ElTreeOutput[]>([]),\n\t\t\thamburger: 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\t\tlet requestVersion = 0;\n\n\t\t/** 只有一层节点 */\n\t\tconst fold = computed<boolean>(() => {\n\t\t\tconst childrenKey = props.props.children ?? \"children\";\n\t\t\treturn state.originalTreeData.every((item) => !Array.isArray(item[childrenKey]) || item[childrenKey].length === 0);\n\t\t});\n\n\t\tconst loadData = async () => {\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.originalTreeData = treeData;\n\t\t\tstate.treeData = treeData;\n\t\t\temit(\"dataChange\", 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\tnextTick(() => {\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 = () => {\n\t\t\tif (state.hamburger) {\n\t\t\t\tstate.treeData = state.originalTreeData;\n\t\t\t} else {\n\t\t\t\t// 折叠只显示一级数据\n\t\t\t\tstate.treeData = state.originalTreeData.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) => {\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) => {\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 (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\t// eslint-disable-next-line vue/custom-event-name-casing -- Element Plus 的公开事件名为 node-click,需要保持原始名称透传。\n\t\t\temit(\"node-click\", data, node, instance, event);\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\t{ immediate: true }\n\t\t);\n\n\t\twatch(\n\t\t\t() => props.hamburger,\n\t\t\t(newValue) => {\n\t\t\t\tstate.hamburger = newValue;\n\t\t\t},\n\t\t\t{ immediate: true }\n\t\t);\n\n\t\twatch(\n\t\t\t() => props.data,\n\t\t\t() => {\n\t\t\t\tif (!props.requestApi) {\n\t\t\t\t\treturn loadData();\n\t\t\t\t}\n\t\t\t},\n\t\t\t{ deep: true }\n\t\t);\n\n\t\tonMounted(async () => {\n\t\t\tawait loadData();\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\tclass=\"fa-tree__inner\"\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 fa-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: () => 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/** 过滤所有树节点,过滤后的节点将被隐藏 */\n\t\t\tfilter: computed(() => treeRef.value?.filter),\n\t\t\t/** 获取节点的唯一标识。 */\n\t\t\tgetNodeKey: computed(() => treeRef.value?.getNodeKey),\n\t\t\t/** 获取指定节点的路径数据。 */\n\t\t\tgetNodePath: computed(() => treeRef.value?.getNodePath),\n\t\t\t/** 为节点设置新数据,只有当设置 node-key 属性的时候才可用 */\n\t\t\tupdateKeyChildren: computed(() => treeRef.value?.updateKeyChildren),\n\t\t\t/** 如果节点可以被选中,(show-checkbox 为 true), 本方法将返回当前选中节点的数组 */\n\t\t\tgetCheckedNodes: computed(() => treeRef.value?.getCheckedNodes),\n\t\t\t/** 设置目前勾选的节点,使用此方法必须提前设置 node-key 属性 */\n\t\t\tsetCheckedNodes: computed(() => treeRef.value?.setCheckedNodes),\n\t\t\t/** 若节点可用被选中 (show-checkbox 为 true), 它将返回当前选中节点 key 的数组 */\n\t\t\tgetCheckedKeys: computed(() => treeRef.value?.getCheckedKeys),\n\t\t\t/** 设置目前选中的节点,使用此方法必须设置 node-key 属性 */\n\t\t\tsetCheckedKeys: computed(() => treeRef.value?.setCheckedKeys),\n\t\t\t/** 设置节点是否被选中, 使用此方法必须设置 node-key 属性 */\n\t\t\tsetChecked: computed(() => treeRef.value?.setChecked),\n\t\t\t/** 如果节点可用被选中 (show-checkbox 为 true), 它将返回当前半选中的节点组成的数组 */\n\t\t\tgetHalfCheckedNodes: computed(() => treeRef.value?.getHalfCheckedNodes),\n\t\t\t/** 若节点可被选中(show-checkbox 为 true),则返回目前半选中的节点的 key 所组成的数组 */\n\t\t\tgetHalfCheckedKeys: computed(() => treeRef.value?.getHalfCheckedKeys),\n\t\t\t/** 返回当前被选中节点的数据 (如果没有则返回 null) */\n\t\t\tgetCurrentKey: computed(() => treeRef.value?.getCurrentKey),\n\t\t\t/** 返回当前被选中节点的数据 (如果没有则返回 null) */\n\t\t\tgetCurrentNode: computed(() => treeRef.value?.getCurrentNode),\n\t\t\t/** 通过 key 设置某个节点的当前选中状态,使用此方法必须设置 node-key 属性 */\n\t\t\tsetCurrentKey: computed(() => treeRef.value?.setCurrentKey),\n\t\t\t/** 设置节点为选中状态,使用此方法必须设置 node-key 属性 */\n\t\t\tsetCurrentNode: computed(() => treeRef.value?.setCurrentNode),\n\t\t\t/** 根据 data 或者 key 拿到 Tree 组件中的 node */\n\t\t\tgetNode: computed(() => treeRef.value?.getNode),\n\t\t\t/** 删除 Tree 中的一个节点,使用此方法必须设置 node-key 属性 */\n\t\t\tremove: computed(() => treeRef.value?.remove),\n\t\t\t/** 为 Tree 中的一个节点追加一个子节点 */\n\t\t\tappend: computed(() => treeRef.value?.append),\n\t\t\t/** 在 Tree 中给定节点前插入一个节点 */\n\t\t\tinsertBefore: computed(() => treeRef.value?.insertBefore),\n\t\t\t/** 在 Tree 中给定节点后插入一个节点 */\n\t\t\tinsertAfter: computed(() => treeRef.value?.insertAfter),\n\t\t\t/** 加载状态 */\n\t\t\tloading: toRef(state, \"loading\"),\n\t\t\t/** 刷新 */\n\t\t\trefresh: loadData,\n\t\t});\n\t},\n});\n"],"mappings":";;;;;;;;;;;;;AAWA,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,eAAe,CAAA;CAChB;;CAEA,YAAY,EACX,MAAM,eAAmF,QAAQ,EAClG;;CAEA,WAAW,eAAoD;EAAC;EAAQ;EAAQ;CAAM,CAAC;AACxF;;AAGA,MAAa,cAAc;CAC1B,GAAG;;CAEH,sBAAsB,UAC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AEpE,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,MAAM,OAAO,SAAS;;GAE/B,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 { computed, defineComponent, nextTick, onMounted, reactive, shallowRef, toRef, useModel, watch } from \"vue\";\nimport { Expand, Fold } from \"@element-plus/icons-vue\";\nimport { ElIcon, ElInput, ElScrollbar, ElTree, treeEmits, treeProps, useGlobalSize } from \"element-plus\";\nimport { addCssUnit, definePropType, isEqual, makeSlots, useEmits, useExpose, useProps, useRender, withDefineType } from \"../../../utils\";\nimport type { FilterValue, TreeNodeData } from \"element-plus\";\nimport type { ComponentInternalInstance } 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/** 是否禁用选择器;未指定时继承 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/** 是否默认展开所有节点 */\n\tdefaultExpandAll: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** 是否在点击节点的时候选中节点 */\n\tcheckOnClickNode: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** 是否高亮当前选中节点 */\n\thighlightCurrent: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** 点击折叠节点,需要开启 'expandOnClickNode' */\n\tcollapseOnClickNode: Boolean,\n\t/** 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/** v-model:label 绑定值 */\n\tlabel: String,\n\t/** 宽度 */\n\twidth: {\n\t\ttype: [String, Number],\n\t\tdefault: 180,\n\t},\n\t/** 默认选择 */\n\tdefaultSelection: [String, Number],\n\t/** 标题 */\n\ttitle: String,\n\t/** 折叠 */\n\thamburger: Boolean,\n\t/** 隐藏全部 */\n\thideAll: Boolean,\n\t/** 隐藏过滤 */\n\thideFilter: Boolean,\n\t/** 全部值 */\n\tallValue: {\n\t\ttype: definePropType<string | number | boolean | object | null>([String, Number, Boolean, Object]),\n\t\tdefault: undefined,\n\t},\n\t/** 树形数据 */\n\tdata: {\n\t\ttype: definePropType<ElTreeOutput[]>(Array),\n\t\tdefault: () => [],\n\t},\n\t/** 请求数据的函数 */\n\trequestApi: {\n\t\ttype: definePropType<(params?: string | number | PagedInput) => Promise<ElTreeOutput[]>>(Function),\n\t},\n\t/** 初始化参数。字符串和数字原样传入请求,对象参数会合并当前搜索值。 */\n\tinitParam: definePropType<string | number | PagedInput | null>([String, Number, Object]),\n};\n\n/** FaTree 的运行时 Emits 定义 */\nexport const faTreeEmits = {\n\t...treeEmits,\n\t/** v-model 回调 */\n\t\"update:modelValue\": (value: string | number | boolean | object | null | undefined) =>\n\t\ttypeof value === \"string\" ||\n\t\ttypeof value === \"number\" ||\n\t\ttypeof value === \"boolean\" ||\n\t\t(typeof value === \"object\" && value !== null) ||\n\t\tvalue == null,\n\t/** v-model:label 回调 */\n\t\"update:label\": (value: string) => typeof value === \"string\" || value === null,\n\t/** 数据改变 */\n\tdataChange: (data: ElTreeOutput[]) => Array.isArray(data),\n\t/** 选中数据改变 */\n\tchange: (_data: ElTreeOutput, _node: TreeNode, _instance: ComponentInternalInstance, _event: MouseEvent) => true,\n\t/** 节点点击 */\n\t\"node-click\": (_data: ElTreeOutput, _node: TreeNode, _instance: ComponentInternalInstance | null, _event: MouseEvent) => true,\n};\n\n/** FaTree 的插槽参数 */\nexport interface FaTreeSlots extends Record<string, unknown> {\n\t/** 默认内容插槽 */\n\tdefault: { node: TreeNode; data: ElTreeOutput };\n\t/** 当数据为空时自定义的内容 */\n\tempty: never;\n\t/** 显示内容插槽 */\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 = useModel(props, \"label\");\n\n\t\tconst globalSize = useGlobalSize();\n\t\tconst treeRef = shallowRef<InstanceType<typeof ElTree> | null>(null);\n\n\t\tconst state = reactive({\n\t\t\tvalue: withDefineType<string | number | boolean | object | null | undefined>(),\n\t\t\tloading: false,\n\t\t\tsearchValue: withDefineType<string>(),\n\t\t\toriginalTreeData: withDefineType<ElTreeOutput[]>([]),\n\t\t\ttreeData: withDefineType<ElTreeOutput[]>([]),\n\t\t\thamburger: 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\t\tlet requestVersion = 0;\n\n\t\t/** 只有一层节点 */\n\t\tconst fold = computed<boolean>(() => {\n\t\t\tconst childrenKey = props.props.children ?? \"children\";\n\t\t\treturn state.originalTreeData.every((item) => !Array.isArray(item[childrenKey]) || item[childrenKey].length === 0);\n\t\t});\n\n\t\tconst loadData = async () => {\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 initParam = props.initParam ?? {};\n\t\t\t\tconst params = typeof initParam === \"object\" ? { ...initParam, searchValue: state.searchValue } : initParam;\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.originalTreeData = treeData;\n\t\t\tstate.treeData = treeData;\n\t\t\temit(\"dataChange\", 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\tnextTick(() => {\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 = () => {\n\t\t\tif (state.hamburger) {\n\t\t\t\tstate.treeData = state.originalTreeData;\n\t\t\t} else {\n\t\t\t\t// 折叠只显示一级数据\n\t\t\t\tstate.treeData = state.originalTreeData.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) => {\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) => {\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 (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\t// eslint-disable-next-line vue/custom-event-name-casing -- Element Plus 的公开事件名为 node-click,需要保持原始名称透传。\n\t\t\temit(\"node-click\", data, node, instance, event);\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\t{ immediate: true }\n\t\t);\n\n\t\twatch(\n\t\t\t() => props.hamburger,\n\t\t\t(newValue) => {\n\t\t\t\tstate.hamburger = newValue;\n\t\t\t},\n\t\t\t{ immediate: true }\n\t\t);\n\n\t\twatch(\n\t\t\t() => props.data,\n\t\t\t() => {\n\t\t\t\tif (!props.requestApi) {\n\t\t\t\t\treturn loadData();\n\t\t\t\t}\n\t\t\t},\n\t\t\t{ deep: true }\n\t\t);\n\n\t\tonMounted(async () => {\n\t\t\tawait loadData();\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\tclass=\"fa-tree__inner\"\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 fa-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: () => 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/** 过滤所有树节点,过滤后的节点将被隐藏 */\n\t\t\tfilter: computed(() => treeRef.value?.filter),\n\t\t\t/** 获取节点的唯一标识。 */\n\t\t\tgetNodeKey: computed(() => treeRef.value?.getNodeKey),\n\t\t\t/** 获取指定节点的路径数据。 */\n\t\t\tgetNodePath: computed(() => treeRef.value?.getNodePath),\n\t\t\t/** 为节点设置新数据,只有当设置 node-key 属性的时候才可用 */\n\t\t\tupdateKeyChildren: computed(() => treeRef.value?.updateKeyChildren),\n\t\t\t/** 如果节点可以被选中,(show-checkbox 为 true), 本方法将返回当前选中节点的数组 */\n\t\t\tgetCheckedNodes: computed(() => treeRef.value?.getCheckedNodes),\n\t\t\t/** 设置目前勾选的节点,使用此方法必须提前设置 node-key 属性 */\n\t\t\tsetCheckedNodes: computed(() => treeRef.value?.setCheckedNodes),\n\t\t\t/** 若节点可用被选中 (show-checkbox 为 true), 它将返回当前选中节点 key 的数组 */\n\t\t\tgetCheckedKeys: computed(() => treeRef.value?.getCheckedKeys),\n\t\t\t/** 设置目前选中的节点,使用此方法必须设置 node-key 属性 */\n\t\t\tsetCheckedKeys: computed(() => treeRef.value?.setCheckedKeys),\n\t\t\t/** 设置节点是否被选中, 使用此方法必须设置 node-key 属性 */\n\t\t\tsetChecked: computed(() => treeRef.value?.setChecked),\n\t\t\t/** 如果节点可用被选中 (show-checkbox 为 true), 它将返回当前半选中的节点组成的数组 */\n\t\t\tgetHalfCheckedNodes: computed(() => treeRef.value?.getHalfCheckedNodes),\n\t\t\t/** 若节点可被选中(show-checkbox 为 true),则返回目前半选中的节点的 key 所组成的数组 */\n\t\t\tgetHalfCheckedKeys: computed(() => treeRef.value?.getHalfCheckedKeys),\n\t\t\t/** 返回当前被选中节点的数据 (如果没有则返回 null) */\n\t\t\tgetCurrentKey: computed(() => treeRef.value?.getCurrentKey),\n\t\t\t/** 返回当前被选中节点的数据 (如果没有则返回 null) */\n\t\t\tgetCurrentNode: computed(() => treeRef.value?.getCurrentNode),\n\t\t\t/** 通过 key 设置某个节点的当前选中状态,使用此方法必须设置 node-key 属性 */\n\t\t\tsetCurrentKey: computed(() => treeRef.value?.setCurrentKey),\n\t\t\t/** 设置节点为选中状态,使用此方法必须设置 node-key 属性 */\n\t\t\tsetCurrentNode: computed(() => treeRef.value?.setCurrentNode),\n\t\t\t/** 根据 data 或者 key 拿到 Tree 组件中的 node */\n\t\t\tgetNode: computed(() => treeRef.value?.getNode),\n\t\t\t/** 删除 Tree 中的一个节点,使用此方法必须设置 node-key 属性 */\n\t\t\tremove: computed(() => treeRef.value?.remove),\n\t\t\t/** 为 Tree 中的一个节点追加一个子节点 */\n\t\t\tappend: computed(() => treeRef.value?.append),\n\t\t\t/** 在 Tree 中给定节点前插入一个节点 */\n\t\t\tinsertBefore: computed(() => treeRef.value?.insertBefore),\n\t\t\t/** 在 Tree 中给定节点后插入一个节点 */\n\t\t\tinsertAfter: computed(() => treeRef.value?.insertAfter),\n\t\t\t/** 加载状态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;;GAE5C,QAAQ,eAAe,QAAQ,OAAO,MAAM;;GAE5C,cAAc,eAAe,QAAQ,OAAO,YAAY;;GAExD,aAAa,eAAe,QAAQ,OAAO,WAAW;;GAEtD,SAAS,MAAM,OAAO,SAAS;;GAE/B,SAAS;EACV,CAAC;CACF;AACD,CAAC"}
|
|
@@ -15,7 +15,7 @@ export declare const faTreeSelectProps: {
|
|
|
15
15
|
* The cached data of the lazy node, the structure is the same as the data, used to get the label of the unloaded data
|
|
16
16
|
*/
|
|
17
17
|
cacheData: {
|
|
18
|
-
type: import("vue").PropType<{
|
|
18
|
+
type: import("vue").PropType<ElSelectorOutput<ElSelectorValue, any>[] | {
|
|
19
19
|
value: string | number | boolean | object;
|
|
20
20
|
currentLabel: string | number;
|
|
21
21
|
isDisabled: boolean;
|
|
@@ -176,7 +176,9 @@ export declare const faTreeSelectProps: {
|
|
|
176
176
|
accordion: BooleanConstructor;
|
|
177
177
|
indent: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<NumberConstructor, unknown, unknown, 18, boolean>;
|
|
178
178
|
icon: {
|
|
179
|
-
readonly type: import("vue").PropType<import("element-plus/es/utils/vue/props/types.mjs").EpPropMergeType<(new (
|
|
179
|
+
readonly type: import("vue").PropType<import("element-plus/es/utils/vue/props/types.mjs").EpPropMergeType<(new (
|
|
180
|
+
/** 配置选项 */
|
|
181
|
+
...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component) | (((new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component)) | null)[], unknown, unknown>>;
|
|
180
182
|
readonly required: false;
|
|
181
183
|
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
182
184
|
__epPropKey: true;
|
|
@@ -194,16 +196,14 @@ export declare const faTreeSelectProps: {
|
|
|
194
196
|
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
195
197
|
__epPropKey: true;
|
|
196
198
|
};
|
|
197
|
-
effect: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<(new (
|
|
198
|
-
/** 每个树节点用来作为唯一标识的属性,整棵树应该是唯一的 */
|
|
199
|
-
...args: any[]) => string) | (() => import("element-plus").PopperEffect) | (((new (...args: any[]) => string) | (() => import("element-plus").PopperEffect)) | null)[], unknown, unknown, string, boolean>;
|
|
199
|
+
effect: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<(new (...args: any[]) => string) | (() => import("element-plus").PopperEffect) | (((new (...args: any[]) => string) | (() => import("element-plus").PopperEffect)) | null)[], unknown, unknown, string, boolean>;
|
|
200
200
|
clearable: BooleanConstructor;
|
|
201
201
|
filterable: BooleanConstructor;
|
|
202
202
|
allowCreate: BooleanConstructor;
|
|
203
203
|
loading: BooleanConstructor;
|
|
204
204
|
popperClass: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<(new (...args: any[]) => string | false | Record<string, any> | import("element-plus/es/utils/typescript.mjs").ClassValue[]) | (() => import("element-plus/es/utils/typescript.mjs").ClassValue) | (((new (...args: any[]) => string | false | Record<string, any> | import("element-plus/es/utils/typescript.mjs").ClassValue[]) | (() => import("element-plus/es/utils/typescript.mjs").ClassValue)) | null)[], unknown, unknown, string, boolean>;
|
|
205
205
|
popperStyle: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<(new (...args: any[]) => string | false | import("vue").CSSProperties | import("vue").StyleValue[]) | (() => import("vue").StyleValue) | (((new (...args: any[]) => string | false | import("vue").CSSProperties | import("vue").StyleValue[]) | (() => import("vue").StyleValue)) | null)[], unknown, unknown, undefined, boolean>;
|
|
206
|
-
popperOptions: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<(new (...
|
|
206
|
+
popperOptions: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<(new (...args: any[]) => Partial<import("element-plus").Options>) | (() => Partial<import("element-plus").Options>) | (((new (...args: any[]) => Partial<import("element-plus").Options>) | (() => Partial<import("element-plus").Options>)) | null)[], unknown, unknown, () => Partial<import("element-plus").Options>, boolean>;
|
|
207
207
|
remote: BooleanConstructor;
|
|
208
208
|
debounce: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<NumberConstructor, unknown, unknown, number, boolean>;
|
|
209
209
|
remoteMethod: {
|
|
@@ -238,7 +238,7 @@ export declare const faTreeSelectProps: {
|
|
|
238
238
|
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>;
|
|
239
239
|
tagType: {
|
|
240
240
|
default: string;
|
|
241
|
-
type: import("vue").PropType<import("element-plus/es/utils/vue/props/types.mjs").EpPropMergeType<StringConstructor, "
|
|
241
|
+
type: import("vue").PropType<import("element-plus/es/utils/vue/props/types.mjs").EpPropMergeType<StringConstructor, "primary" | "success" | "warning" | "info" | "danger", unknown>>;
|
|
242
242
|
required: false;
|
|
243
243
|
validator: ((val: unknown) => boolean) | undefined;
|
|
244
244
|
__epPropKey: true;
|
|
@@ -256,7 +256,7 @@ export declare const faTreeSelectProps: {
|
|
|
256
256
|
offset: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<NumberConstructor, unknown, unknown, number, boolean>;
|
|
257
257
|
placement: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<(new (...args: any[]) => "auto" | "left" | "right" | "bottom" | "top" | "auto-start" | "auto-end" | "top-start" | "top-end" | "bottom-start" | "bottom-end" | "right-start" | "right-end" | "left-start" | "left-end") | (() => import("element-plus").Placement) | (((new (...args: any[]) => "auto" | "left" | "right" | "bottom" | "top" | "auto-start" | "auto-end" | "top-start" | "top-end" | "bottom-start" | "bottom-end" | "right-start" | "right-end" | "left-start" | "left-end") | (() => import("element-plus").Placement)) | null)[], import("element-plus").Placement, unknown, string, boolean>;
|
|
258
258
|
fallbackPlacements: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<(new (...args: any[]) => import("element-plus").Placement[]) | (() => import("element-plus").Placement[]) | (((new (...args: any[]) => import("element-plus").Placement[]) | (() => import("element-plus").Placement[])) | null)[], unknown, unknown, string[], boolean>;
|
|
259
|
-
tabindex: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<(
|
|
259
|
+
tabindex: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<(NumberConstructor | StringConstructor)[], unknown, unknown, number, boolean>;
|
|
260
260
|
appendTo: {
|
|
261
261
|
readonly type: import("vue").PropType<import("element-plus/es/utils/vue/props/types.mjs").EpPropMergeType<(new (...args: any[]) => string | HTMLElement) | (() => string | HTMLElement) | (((new (...args: any[]) => string | HTMLElement) | (() => string | HTMLElement)) | null)[], unknown, unknown>>;
|
|
262
262
|
readonly required: false;
|
|
@@ -311,6 +311,7 @@ export interface FaTreeSelectSlots extends Record<string, unknown> {
|
|
|
311
311
|
default: {
|
|
312
312
|
node: TreeNode;
|
|
313
313
|
data: ElSelectorOutput;
|
|
314
|
+
store: TreeInstance["store"];
|
|
314
315
|
};
|
|
315
316
|
/** 下拉列表顶部的内容 */
|
|
316
317
|
header: never;
|
|
@@ -321,13 +322,18 @@ export interface FaTreeSelectSlots extends Record<string, unknown> {
|
|
|
321
322
|
/** 无选项时的列表 */
|
|
322
323
|
empty: never;
|
|
323
324
|
/** select 组件自定义标签内容 */
|
|
324
|
-
tag:
|
|
325
|
+
tag: {
|
|
326
|
+
data: SelectInstance["states"]["selected"];
|
|
327
|
+
deleteTag: SelectInstance["deleteTag"];
|
|
328
|
+
selectDisabled: boolean;
|
|
329
|
+
};
|
|
325
330
|
/** Select 组件自定义加载内容 */
|
|
326
331
|
loading: never;
|
|
327
332
|
/** select 组件自定义标签内容 */
|
|
328
333
|
label: {
|
|
329
334
|
label: string;
|
|
330
335
|
value: string | number | boolean | object;
|
|
336
|
+
index?: number;
|
|
331
337
|
};
|
|
332
338
|
}
|
|
333
339
|
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
@@ -340,7 +346,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
340
346
|
* The cached data of the lazy node, the structure is the same as the data, used to get the label of the unloaded data
|
|
341
347
|
*/
|
|
342
348
|
cacheData: {
|
|
343
|
-
type: import("vue").PropType<{
|
|
349
|
+
type: import("vue").PropType<ElSelectorOutput<ElSelectorValue, any>[] | {
|
|
344
350
|
value: string | number | boolean | object;
|
|
345
351
|
currentLabel: string | number;
|
|
346
352
|
isDisabled: boolean;
|
|
@@ -501,7 +507,9 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
501
507
|
accordion: BooleanConstructor;
|
|
502
508
|
indent: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<NumberConstructor, unknown, unknown, 18, boolean>;
|
|
503
509
|
icon: {
|
|
504
|
-
readonly type: import("vue").PropType<import("element-plus/es/utils/vue/props/types.mjs").EpPropMergeType<(new (
|
|
510
|
+
readonly type: import("vue").PropType<import("element-plus/es/utils/vue/props/types.mjs").EpPropMergeType<(new (
|
|
511
|
+
/** 配置选项 */
|
|
512
|
+
...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component) | (((new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component)) | null)[], unknown, unknown>>;
|
|
505
513
|
readonly required: false;
|
|
506
514
|
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
507
515
|
__epPropKey: true;
|
|
@@ -519,16 +527,14 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
519
527
|
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
520
528
|
__epPropKey: true;
|
|
521
529
|
};
|
|
522
|
-
effect: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<(new (
|
|
523
|
-
/** 每个树节点用来作为唯一标识的属性,整棵树应该是唯一的 */
|
|
524
|
-
...args: any[]) => string) | (() => import("element-plus").PopperEffect) | (((new (...args: any[]) => string) | (() => import("element-plus").PopperEffect)) | null)[], unknown, unknown, string, boolean>;
|
|
530
|
+
effect: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<(new (...args: any[]) => string) | (() => import("element-plus").PopperEffect) | (((new (...args: any[]) => string) | (() => import("element-plus").PopperEffect)) | null)[], unknown, unknown, string, boolean>;
|
|
525
531
|
clearable: BooleanConstructor;
|
|
526
532
|
filterable: BooleanConstructor;
|
|
527
533
|
allowCreate: BooleanConstructor;
|
|
528
534
|
loading: BooleanConstructor;
|
|
529
535
|
popperClass: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<(new (...args: any[]) => string | false | Record<string, any> | import("element-plus/es/utils/typescript.mjs").ClassValue[]) | (() => import("element-plus/es/utils/typescript.mjs").ClassValue) | (((new (...args: any[]) => string | false | Record<string, any> | import("element-plus/es/utils/typescript.mjs").ClassValue[]) | (() => import("element-plus/es/utils/typescript.mjs").ClassValue)) | null)[], unknown, unknown, string, boolean>;
|
|
530
536
|
popperStyle: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<(new (...args: any[]) => string | false | import("vue").CSSProperties | import("vue").StyleValue[]) | (() => import("vue").StyleValue) | (((new (...args: any[]) => string | false | import("vue").CSSProperties | import("vue").StyleValue[]) | (() => import("vue").StyleValue)) | null)[], unknown, unknown, undefined, boolean>;
|
|
531
|
-
popperOptions: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<(new (...
|
|
537
|
+
popperOptions: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<(new (...args: any[]) => Partial<import("element-plus").Options>) | (() => Partial<import("element-plus").Options>) | (((new (...args: any[]) => Partial<import("element-plus").Options>) | (() => Partial<import("element-plus").Options>)) | null)[], unknown, unknown, () => Partial<import("element-plus").Options>, boolean>;
|
|
532
538
|
remote: BooleanConstructor;
|
|
533
539
|
debounce: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<NumberConstructor, unknown, unknown, number, boolean>;
|
|
534
540
|
remoteMethod: {
|
|
@@ -563,7 +569,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
563
569
|
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>;
|
|
564
570
|
tagType: {
|
|
565
571
|
default: string;
|
|
566
|
-
type: import("vue").PropType<import("element-plus/es/utils/vue/props/types.mjs").EpPropMergeType<StringConstructor, "
|
|
572
|
+
type: import("vue").PropType<import("element-plus/es/utils/vue/props/types.mjs").EpPropMergeType<StringConstructor, "primary" | "success" | "warning" | "info" | "danger", unknown>>;
|
|
567
573
|
required: false;
|
|
568
574
|
validator: ((val: unknown) => boolean) | undefined;
|
|
569
575
|
__epPropKey: true;
|
|
@@ -581,7 +587,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
581
587
|
offset: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<NumberConstructor, unknown, unknown, number, boolean>;
|
|
582
588
|
placement: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<(new (...args: any[]) => "auto" | "left" | "right" | "bottom" | "top" | "auto-start" | "auto-end" | "top-start" | "top-end" | "bottom-start" | "bottom-end" | "right-start" | "right-end" | "left-start" | "left-end") | (() => import("element-plus").Placement) | (((new (...args: any[]) => "auto" | "left" | "right" | "bottom" | "top" | "auto-start" | "auto-end" | "top-start" | "top-end" | "bottom-start" | "bottom-end" | "right-start" | "right-end" | "left-start" | "left-end") | (() => import("element-plus").Placement)) | null)[], import("element-plus").Placement, unknown, string, boolean>;
|
|
583
589
|
fallbackPlacements: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<(new (...args: any[]) => import("element-plus").Placement[]) | (() => import("element-plus").Placement[]) | (((new (...args: any[]) => import("element-plus").Placement[]) | (() => import("element-plus").Placement[])) | null)[], unknown, unknown, string[], boolean>;
|
|
584
|
-
tabindex: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<(
|
|
590
|
+
tabindex: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<(NumberConstructor | StringConstructor)[], unknown, unknown, number, boolean>;
|
|
585
591
|
appendTo: {
|
|
586
592
|
readonly type: import("vue").PropType<import("element-plus/es/utils/vue/props/types.mjs").EpPropMergeType<(new (...args: any[]) => string | HTMLElement) | (() => string | HTMLElement) | (((new (...args: any[]) => string | HTMLElement) | (() => string | HTMLElement)) | null)[], unknown, unknown>>;
|
|
587
593
|
readonly required: false;
|
|
@@ -692,7 +698,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
692
698
|
* The cached data of the lazy node, the structure is the same as the data, used to get the label of the unloaded data
|
|
693
699
|
*/
|
|
694
700
|
cacheData: {
|
|
695
|
-
type: import("vue").PropType<{
|
|
701
|
+
type: import("vue").PropType<ElSelectorOutput<ElSelectorValue, any>[] | {
|
|
696
702
|
value: string | number | boolean | object;
|
|
697
703
|
currentLabel: string | number;
|
|
698
704
|
isDisabled: boolean;
|
|
@@ -853,7 +859,9 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
853
859
|
accordion: BooleanConstructor;
|
|
854
860
|
indent: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<NumberConstructor, unknown, unknown, 18, boolean>;
|
|
855
861
|
icon: {
|
|
856
|
-
readonly type: import("vue").PropType<import("element-plus/es/utils/vue/props/types.mjs").EpPropMergeType<(new (
|
|
862
|
+
readonly type: import("vue").PropType<import("element-plus/es/utils/vue/props/types.mjs").EpPropMergeType<(new (
|
|
863
|
+
/** 配置选项 */
|
|
864
|
+
...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component) | (((new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component)) | null)[], unknown, unknown>>;
|
|
857
865
|
readonly required: false;
|
|
858
866
|
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
859
867
|
__epPropKey: true;
|
|
@@ -871,16 +879,14 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
871
879
|
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
872
880
|
__epPropKey: true;
|
|
873
881
|
};
|
|
874
|
-
effect: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<(new (
|
|
875
|
-
/** 每个树节点用来作为唯一标识的属性,整棵树应该是唯一的 */
|
|
876
|
-
...args: any[]) => string) | (() => import("element-plus").PopperEffect) | (((new (...args: any[]) => string) | (() => import("element-plus").PopperEffect)) | null)[], unknown, unknown, string, boolean>;
|
|
882
|
+
effect: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<(new (...args: any[]) => string) | (() => import("element-plus").PopperEffect) | (((new (...args: any[]) => string) | (() => import("element-plus").PopperEffect)) | null)[], unknown, unknown, string, boolean>;
|
|
877
883
|
clearable: BooleanConstructor;
|
|
878
884
|
filterable: BooleanConstructor;
|
|
879
885
|
allowCreate: BooleanConstructor;
|
|
880
886
|
loading: BooleanConstructor;
|
|
881
887
|
popperClass: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<(new (...args: any[]) => string | false | Record<string, any> | import("element-plus/es/utils/typescript.mjs").ClassValue[]) | (() => import("element-plus/es/utils/typescript.mjs").ClassValue) | (((new (...args: any[]) => string | false | Record<string, any> | import("element-plus/es/utils/typescript.mjs").ClassValue[]) | (() => import("element-plus/es/utils/typescript.mjs").ClassValue)) | null)[], unknown, unknown, string, boolean>;
|
|
882
888
|
popperStyle: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<(new (...args: any[]) => string | false | import("vue").CSSProperties | import("vue").StyleValue[]) | (() => import("vue").StyleValue) | (((new (...args: any[]) => string | false | import("vue").CSSProperties | import("vue").StyleValue[]) | (() => import("vue").StyleValue)) | null)[], unknown, unknown, undefined, boolean>;
|
|
883
|
-
popperOptions: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<(new (...
|
|
889
|
+
popperOptions: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<(new (...args: any[]) => Partial<import("element-plus").Options>) | (() => Partial<import("element-plus").Options>) | (((new (...args: any[]) => Partial<import("element-plus").Options>) | (() => Partial<import("element-plus").Options>)) | null)[], unknown, unknown, () => Partial<import("element-plus").Options>, boolean>;
|
|
884
890
|
remote: BooleanConstructor;
|
|
885
891
|
debounce: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<NumberConstructor, unknown, unknown, number, boolean>;
|
|
886
892
|
remoteMethod: {
|
|
@@ -915,7 +921,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
915
921
|
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>;
|
|
916
922
|
tagType: {
|
|
917
923
|
default: string;
|
|
918
|
-
type: import("vue").PropType<import("element-plus/es/utils/vue/props/types.mjs").EpPropMergeType<StringConstructor, "
|
|
924
|
+
type: import("vue").PropType<import("element-plus/es/utils/vue/props/types.mjs").EpPropMergeType<StringConstructor, "primary" | "success" | "warning" | "info" | "danger", unknown>>;
|
|
919
925
|
required: false;
|
|
920
926
|
validator: ((val: unknown) => boolean) | undefined;
|
|
921
927
|
__epPropKey: true;
|
|
@@ -933,7 +939,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
933
939
|
offset: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<NumberConstructor, unknown, unknown, number, boolean>;
|
|
934
940
|
placement: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<(new (...args: any[]) => "auto" | "left" | "right" | "bottom" | "top" | "auto-start" | "auto-end" | "top-start" | "top-end" | "bottom-start" | "bottom-end" | "right-start" | "right-end" | "left-start" | "left-end") | (() => import("element-plus").Placement) | (((new (...args: any[]) => "auto" | "left" | "right" | "bottom" | "top" | "auto-start" | "auto-end" | "top-start" | "top-end" | "bottom-start" | "bottom-end" | "right-start" | "right-end" | "left-start" | "left-end") | (() => import("element-plus").Placement)) | null)[], import("element-plus").Placement, unknown, string, boolean>;
|
|
935
941
|
fallbackPlacements: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<(new (...args: any[]) => import("element-plus").Placement[]) | (() => import("element-plus").Placement[]) | (((new (...args: any[]) => import("element-plus").Placement[]) | (() => import("element-plus").Placement[])) | null)[], unknown, unknown, string[], boolean>;
|
|
936
|
-
tabindex: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<(
|
|
942
|
+
tabindex: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<(NumberConstructor | StringConstructor)[], unknown, unknown, number, boolean>;
|
|
937
943
|
appendTo: {
|
|
938
944
|
readonly type: import("vue").PropType<import("element-plus/es/utils/vue/props/types.mjs").EpPropMergeType<(new (...args: any[]) => string | HTMLElement) | (() => string | HTMLElement) | (((new (...args: any[]) => string | HTMLElement) | (() => string | HTMLElement)) | null)[], unknown, unknown>>;
|
|
939
945
|
readonly required: false;
|
|
@@ -970,7 +976,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
970
976
|
onCheck?: ((data: any, checkedInfo: import("element-plus").CheckedInfo) => any) | undefined;
|
|
971
977
|
"onNode-drag-start"?: ((node: import("element-plus/es/components/tree/src/model/node.mjs").default, evt: DragEvent) => any) | undefined;
|
|
972
978
|
"onNode-drag-end"?: ((draggingNode: import("element-plus/es/components/tree/src/model/node.mjs").default, dropNode: import("element-plus/es/components/tree/src/model/node.mjs").default | null, dropType: import("element-plus").NodeDropType, evt: DragEvent) => any) | undefined;
|
|
973
|
-
"onNode-drop"?: ((draggingNode: import("element-plus/es/components/tree/src/model/node.mjs").default, dropNode: import("element-plus/es/components/tree/src/model/node.mjs").default, dropType: "
|
|
979
|
+
"onNode-drop"?: ((draggingNode: import("element-plus/es/components/tree/src/model/node.mjs").default, dropNode: import("element-plus/es/components/tree/src/model/node.mjs").default, dropType: "after" | "before" | "inner", evt: DragEvent) => any) | undefined;
|
|
974
980
|
"onNode-drag-leave"?: ((draggingNode: import("element-plus/es/components/tree/src/model/node.mjs").default, oldDropNode: import("element-plus/es/components/tree/src/model/node.mjs").default, evt: DragEvent) => any) | undefined;
|
|
975
981
|
"onNode-drag-enter"?: ((draggingNode: import("element-plus/es/components/tree/src/model/node.mjs").default, dropNode: import("element-plus/es/components/tree/src/model/node.mjs").default, evt: DragEvent) => any) | undefined;
|
|
976
982
|
"onNode-drag-over"?: ((draggingNode: import("element-plus/es/components/tree/src/model/node.mjs").default, dropNode: import("element-plus/es/components/tree/src/model/node.mjs").default, evt: DragEvent) => any) | undefined;
|
|
@@ -1037,7 +1043,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
1037
1043
|
autoExpandParent: import("element-plus/es/utils/vue/props/types.mjs").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
1038
1044
|
showCheckbox: boolean;
|
|
1039
1045
|
accordion: boolean;
|
|
1040
|
-
cacheData: {
|
|
1046
|
+
cacheData: ElSelectorOutput<ElSelectorValue, any>[] | {
|
|
1041
1047
|
value: string | number | boolean | object;
|
|
1042
1048
|
currentLabel: string | number;
|
|
1043
1049
|
isDisabled: boolean;
|
|
@@ -246,22 +246,29 @@ var treeSelect_default = defineComponent({
|
|
|
246
246
|
emit("visible-change", visible);
|
|
247
247
|
};
|
|
248
248
|
const flattenOptions = (data) => data.flatMap((item) => [item, ...flattenOptions(item.children ?? [])]);
|
|
249
|
+
const nodeLazy = computed(() => !props.requestApi && typeof props.load === "function");
|
|
249
250
|
const handleChange = (value) => {
|
|
250
251
|
const selectorData = flattenOptions(state.selectorData);
|
|
252
|
+
const findOption = (key) => {
|
|
253
|
+
const option = selectorData.find((item) => item.value !== void 0 && isEqual(item.value, key));
|
|
254
|
+
if (option || !nodeLazy.value || typeof key !== "number" && typeof key !== "string") return option;
|
|
255
|
+
const node = treeSelectRef.value?.getNode(key);
|
|
256
|
+
return node ? handleData([node.data])[0] : void 0;
|
|
257
|
+
};
|
|
251
258
|
if (props.multiple) {
|
|
252
259
|
const valueList = Array.isArray(value) ? value : [];
|
|
253
260
|
if (valueList.length === 0) {
|
|
254
261
|
emit("change", null, null);
|
|
255
262
|
return;
|
|
256
263
|
}
|
|
257
|
-
emit("change", valueList.map(
|
|
264
|
+
emit("change", valueList.map(findOption).filter((item) => item !== void 0), value);
|
|
258
265
|
return;
|
|
259
266
|
}
|
|
260
267
|
if (value == null || Array.isArray(value)) {
|
|
261
268
|
emit("change", null, null);
|
|
262
269
|
return;
|
|
263
270
|
}
|
|
264
|
-
emit("change",
|
|
271
|
+
emit("change", findOption(value) ?? null, value);
|
|
265
272
|
};
|
|
266
273
|
watch(() => props.modelValue, (newValue) => {
|
|
267
274
|
if (state.echo && newValue != null) {
|
|
@@ -376,28 +383,23 @@ var treeSelect_default = defineComponent({
|
|
|
376
383
|
"modelValue": state.value,
|
|
377
384
|
"onUpdate:modelValue": handleModelValueUpdate,
|
|
378
385
|
"onChange": handleChange,
|
|
379
|
-
"lazy":
|
|
386
|
+
"lazy": nodeLazy.value,
|
|
380
387
|
"loading": state.loading,
|
|
381
388
|
"data": state.selectorData,
|
|
389
|
+
"cacheData": props.cacheData,
|
|
382
390
|
"expandOnClickNode": props.checkOnClickNode ? false : props.expandOnClickNode,
|
|
383
391
|
"filterNodeMethod": handleFilterNode,
|
|
384
392
|
"onNodeClick": handleNodeClick,
|
|
385
393
|
"onVisible-change": handleVisibleChange
|
|
386
394
|
}), {
|
|
387
|
-
...slots.default && { default:
|
|
388
|
-
node,
|
|
389
|
-
data
|
|
390
|
-
}) ?? [] },
|
|
395
|
+
...slots.default && { default: slots.default },
|
|
391
396
|
...slots.header && { header: () => slots.header?.() ?? [] },
|
|
392
397
|
...slots.footer && { footer: () => slots.footer?.() ?? [] },
|
|
393
398
|
...slots.prefix && { prefix: () => slots.prefix?.() ?? [] },
|
|
394
399
|
...slots.empty && { empty: () => slots.empty?.() ?? [] },
|
|
395
|
-
...slots.tag && { tag:
|
|
400
|
+
...slots.tag && { tag: slots.tag },
|
|
396
401
|
...slots.loading && { loading: () => slots.loading?.() ?? [] },
|
|
397
|
-
...slots.label && { label:
|
|
398
|
-
label,
|
|
399
|
-
value
|
|
400
|
-
}) ?? [] }
|
|
402
|
+
...slots.label && { label: slots.label }
|
|
401
403
|
}));
|
|
402
404
|
return useExpose(expose, {
|
|
403
405
|
/** 使选择器的输入框获取焦点。 */
|