x-next 1.13.0 → 1.15.0
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/AI_CODING.md +6 -5
- package/AI_USAGE/catalog.md +108 -105
- package/AI_USAGE/components/alert-api.md +48 -0
- package/AI_USAGE/components/alert.md +222 -3
- package/AI_USAGE/components/bar-chart-api.md +177 -0
- package/AI_USAGE/components/bar-chart.md +297 -3
- package/AI_USAGE/components/boxicons.md +147 -0
- package/AI_USAGE/components/button-api.md +144 -0
- package/AI_USAGE/components/button.md +447 -3
- package/AI_USAGE/components/charts.md +81 -0
- package/AI_USAGE/components/checkbox-api.md +145 -0
- package/AI_USAGE/components/checkbox.md +365 -3
- package/AI_USAGE/components/color-picker-api.md +52 -0
- package/AI_USAGE/components/color-picker.md +211 -3
- package/AI_USAGE/components/config-provider-api.md +38 -0
- package/AI_USAGE/components/config-provider.md +250 -3
- package/AI_USAGE/components/date-picker-api.md +1114 -0
- package/AI_USAGE/components/date-picker.md +378 -3
- package/AI_USAGE/components/dialog-api.md +142 -0
- package/AI_USAGE/components/dialog.md +284 -3
- package/AI_USAGE/components/draggable-api.md +146 -0
- package/AI_USAGE/components/draggable.md +259 -0
- package/AI_USAGE/components/drawer-api.md +78 -0
- package/AI_USAGE/components/drawer.md +256 -0
- package/AI_USAGE/components/dropdown-api.md +529 -0
- package/AI_USAGE/components/dropdown.md +392 -3
- package/AI_USAGE/components/empty-api.md +36 -0
- package/AI_USAGE/components/empty.md +227 -3
- package/AI_USAGE/components/finicon.md +88 -0
- package/AI_USAGE/components/form-api.md +524 -0
- package/AI_USAGE/components/form.md +454 -0
- package/AI_USAGE/components/grid-api.md +527 -0
- package/AI_USAGE/components/grid.md +224 -0
- package/AI_USAGE/components/heatmap-api.md +122 -0
- package/AI_USAGE/components/heatmap.md +220 -0
- package/AI_USAGE/components/icon-api.md +4707 -0
- package/AI_USAGE/components/icon.md +257 -0
- package/AI_USAGE/components/image-api.md +440 -0
- package/AI_USAGE/components/image.md +465 -0
- package/AI_USAGE/components/input-api.md +184 -0
- package/AI_USAGE/components/input-number-api.md +66 -0
- package/AI_USAGE/components/input-number.md +294 -0
- package/AI_USAGE/components/input-tag-api.md +114 -0
- package/AI_USAGE/components/input-tag.md +482 -0
- package/AI_USAGE/components/input.md +293 -3
- package/AI_USAGE/components/layout-api.md +147 -0
- package/AI_USAGE/components/layout.md +230 -0
- package/AI_USAGE/components/line-chart-api.md +197 -0
- package/AI_USAGE/components/line-chart.md +306 -3
- package/AI_USAGE/components/link-api.md +42 -0
- package/AI_USAGE/components/link.md +197 -0
- package/AI_USAGE/components/menu-api.md +516 -0
- package/AI_USAGE/components/menu.md +268 -0
- package/AI_USAGE/components/message-api.md +215 -0
- package/AI_USAGE/components/message-box-api.md +108 -0
- package/AI_USAGE/components/message-box.md +268 -3
- package/AI_USAGE/components/message.md +231 -3
- package/AI_USAGE/components/network-api.md +91 -0
- package/AI_USAGE/components/network.md +378 -0
- package/AI_USAGE/components/notification-api.md +236 -0
- package/AI_USAGE/components/notification.md +275 -3
- package/AI_USAGE/components/pagination-api.md +62 -0
- package/AI_USAGE/components/pagination.md +380 -3
- package/AI_USAGE/components/pie-chart-api.md +109 -0
- package/AI_USAGE/components/pie-chart.md +245 -3
- package/AI_USAGE/components/popconfirm-api.md +75 -0
- package/AI_USAGE/components/popconfirm.md +231 -3
- package/AI_USAGE/components/popover-api.md +75 -0
- package/AI_USAGE/components/popover.md +208 -3
- package/AI_USAGE/components/popup-api.md +75 -0
- package/AI_USAGE/components/popup.md +52 -0
- package/AI_USAGE/components/progress-api.md +44 -0
- package/AI_USAGE/components/progress.md +248 -3
- package/AI_USAGE/components/radio-api.md +165 -0
- package/AI_USAGE/components/radio.md +259 -3
- package/AI_USAGE/components/rate-api.md +54 -0
- package/AI_USAGE/components/rate.md +233 -3
- package/AI_USAGE/components/resize-box-api.md +56 -0
- package/AI_USAGE/components/resize-box.md +231 -0
- package/AI_USAGE/components/scrollbar-api.md +77 -0
- package/AI_USAGE/components/scrollbar.md +218 -0
- package/AI_USAGE/components/select-api.md +758 -0
- package/AI_USAGE/components/select.md +640 -3
- package/AI_USAGE/components/skeleton-api.md +85 -0
- package/AI_USAGE/components/skeleton.md +150 -0
- package/AI_USAGE/components/slider-api.md +51 -0
- package/AI_USAGE/components/slider.md +233 -3
- package/AI_USAGE/components/space-api.md +38 -0
- package/AI_USAGE/components/space.md +145 -0
- package/AI_USAGE/components/spin-api.md +43 -0
- package/AI_USAGE/components/spin.md +205 -0
- package/AI_USAGE/components/steps-api.md +111 -0
- package/AI_USAGE/components/steps.md +201 -3
- package/AI_USAGE/components/switch-api.md +58 -0
- package/AI_USAGE/components/switch.md +290 -3
- package/AI_USAGE/components/table-api.md +2919 -0
- package/AI_USAGE/components/table.md +1457 -0
- package/AI_USAGE/components/tabs-api.md +135 -0
- package/AI_USAGE/components/tabs.md +308 -3
- package/AI_USAGE/components/tag-api.md +124 -0
- package/AI_USAGE/components/tag.md +292 -0
- package/AI_USAGE/components/textarea-api.md +55 -0
- package/AI_USAGE/components/textarea.md +326 -3
- package/AI_USAGE/components/time-picker-api.md +137 -0
- package/AI_USAGE/components/time-picker.md +271 -3
- package/AI_USAGE/components/time-range-selector-api.md +44 -0
- package/AI_USAGE/components/time-range-selector.md +355 -0
- package/AI_USAGE/components/timeline-api.md +93 -0
- package/AI_USAGE/components/timeline.md +312 -0
- package/AI_USAGE/components/tooltip-api.md +77 -0
- package/AI_USAGE/components/tooltip.md +182 -0
- package/AI_USAGE/components/tree-select-api.md +498 -0
- package/AI_USAGE/components/tree-select.md +744 -0
- package/AI_USAGE/components/trend-chart-api.md +119 -0
- package/AI_USAGE/components/trend-chart.md +335 -0
- package/AI_USAGE/components/trigger-api.md +124 -0
- package/AI_USAGE/components/trigger.md +185 -0
- package/AI_USAGE/components/upload-api.md +200 -0
- package/AI_USAGE/components/upload.md +711 -3
- package/AI_USAGE/components/watermark-api.md +87 -0
- package/AI_USAGE/components/watermark.md +200 -0
- package/AI_USAGE/core.md +1 -1
- package/AI_USAGE/index.md +36 -7
- package/AI_USAGE/recipes/form-on-demand.md +1 -1
- package/AI_USAGE.md +34972 -5
- package/CHANGELOG.md +39 -0
- package/dist/_props/css.d.ts +2 -1
- package/dist/_utils/inherit-component-type.d.ts +11 -0
- package/dist/components/bar-chart/BarChart.d.ts +1 -1
- package/dist/components/bar-chart/index.d.ts +3 -3
- package/dist/components/date-picker/index.d.ts +420 -5
- package/dist/components/form-input/index.d.ts +617 -2
- package/dist/components/index.d.ts +1 -0
- package/dist/components/layout/index.d.ts +689 -1
- package/dist/components/line-chart/LineChart.d.ts +1 -1
- package/dist/components/line-chart/index.d.ts +3 -3
- package/dist/components/line-chart/interface.d.ts +2 -2
- package/dist/components/menu/index.d.ts +786 -1
- package/dist/components/tree-select/TreeNode.vue.d.ts +478 -0
- package/dist/components/tree-select/TreeSelect.d.ts +1549 -0
- package/dist/components/tree-select/TreeSelectDropdown.vue.d.ts +569 -0
- package/dist/components/tree-select/hooks/use-tree-select.d.ts +92 -0
- package/dist/components/tree-select/index.d.ts +3321 -0
- package/dist/components/tree-select/interface.d.ts +203 -0
- package/dist/components/tree-select/utils.d.ts +64 -0
- package/dist/es/_styles/palette-aliases.js +3 -0
- package/dist/es/_utils/inherit-component-type.js +6 -0
- package/dist/es/components/_components/feedback-icon/index.vue2.js +10 -10
- package/dist/es/components/button/Button.js +9 -9
- package/dist/es/components/date-picker/index.js +18 -17
- package/dist/es/components/drawer/src/Drawer.vue.js +6 -6
- package/dist/es/components/form-input/index.js +12 -11
- package/dist/es/components/form-switch/Switch.vue2.js +18 -18
- package/dist/es/components/image/Image.vue2.js +13 -13
- package/dist/es/components/image/ImagePreview.vue2.js +33 -33
- package/dist/es/components/index.js +55 -52
- package/dist/es/components/layout/index.js +10 -9
- package/dist/es/components/link/Link.vue2.js +12 -12
- package/dist/es/components/menu/hooks/use-level.js +5 -5
- package/dist/es/components/menu/index.js +13 -10
- package/dist/es/components/message/message.vue2.js +13 -13
- package/dist/es/components/spin/Spin.js +28 -28
- package/dist/es/components/tag/Tag.vue2.js +22 -22
- package/dist/es/components/timeline/src/Timeline.js +7 -7
- package/dist/es/components/tree-select/TreeNode.vue.js +91 -0
- package/dist/es/components/tree-select/TreeNode.vue2.js +162 -0
- package/dist/es/components/tree-select/TreeSelect.js +865 -0
- package/dist/es/components/tree-select/TreeSelectDropdown.vue.js +57 -0
- package/dist/es/components/tree-select/TreeSelectDropdown.vue2.js +79 -0
- package/dist/es/components/tree-select/hooks/use-tree-select.js +376 -0
- package/dist/es/components/tree-select/index.js +13 -0
- package/dist/es/components/tree-select/utils.js +181 -0
- package/dist/es/icons/animation/animation-loading.js +2 -2
- package/dist/es/index.js +71 -68
- package/dist/es/style.css +1 -1
- package/dist/index.cjs +3 -3
- package/dist/index.umd.js +3 -3
- package/dist/style/base.css +1 -1
- package/dist/style/dependencies.json +10 -0
- package/dist/style/drawer.css +1 -1
- package/dist/style/table.css +1 -1
- package/dist/style/tree-select.css +1 -0
- package/dist/style/tree-select.js +8 -0
- package/dist/style.css +1 -1
- package/dist/types.d.ts +2 -0
- package/package.json +11 -5
- package/volar.d.ts +2 -0
|
@@ -0,0 +1,865 @@
|
|
|
1
|
+
import { defineComponent as Ze, toRefs as ea, useId as aa, computed as g, ref as m, watch as M, onBeforeUnmount as la, createVNode as h, mergeProps as A, nextTick as ta } from "vue";
|
|
2
|
+
import { isObject as oa, isUndefined as z, isFunction as i } from "../../_utils/is.js";
|
|
3
|
+
import { Trigger as _ } from "../trigger/index.js";
|
|
4
|
+
import $ from "../_components/select-view/select-view.js";
|
|
5
|
+
import na from "./TreeSelectDropdown.vue.js";
|
|
6
|
+
import ua from "./TreeNode.vue.js";
|
|
7
|
+
import ra from "../virtual-list-v2/virtual-list.vue.js";
|
|
8
|
+
import { useFormItem as da } from "../../_hooks/use-form-item.js";
|
|
9
|
+
import { useTrigger as ia } from "../../_hooks/use-trigger.js";
|
|
10
|
+
import { useLocale as ca } from "../../locale/index.js";
|
|
11
|
+
import { getClassNameMixin as sa } from "../../_utils/config.js";
|
|
12
|
+
import { omit as pa } from "../../_utils/omit.js";
|
|
13
|
+
import { getRelativeRect as fa } from "../../_utils/dom.js";
|
|
14
|
+
import { useTreeSelect as ma } from "./hooks/use-tree-select.js";
|
|
15
|
+
import { normalizeKey as W, getValueFromKey as X } from "./utils.js";
|
|
16
|
+
const ha = /* @__PURE__ */ new Set(["id", "name", "form", "tabindex", "tabIndex", "autofocus", "autoFocus", "autocomplete", "autoComplete"]), q = (a) => ha.has(a) || a.startsWith("aria-"), Aa = /* @__PURE__ */ Ze({
|
|
17
|
+
name: "TreeSelect",
|
|
18
|
+
components: {
|
|
19
|
+
Trigger: _,
|
|
20
|
+
SelectView: $
|
|
21
|
+
},
|
|
22
|
+
inheritAttrs: !1,
|
|
23
|
+
props: {
|
|
24
|
+
/**
|
|
25
|
+
* @zh 绑定值
|
|
26
|
+
* @en Value
|
|
27
|
+
*/
|
|
28
|
+
modelValue: {
|
|
29
|
+
type: [String, Number, Object, Array],
|
|
30
|
+
default: void 0
|
|
31
|
+
},
|
|
32
|
+
/**
|
|
33
|
+
* @zh 默认值(非受控模式)
|
|
34
|
+
* @en Default value (uncontrolled mode)
|
|
35
|
+
*/
|
|
36
|
+
defaultValue: {
|
|
37
|
+
type: [String, Number, Object, Array],
|
|
38
|
+
default: (a) => a.multiple || a.treeCheckable ? [] : void 0
|
|
39
|
+
},
|
|
40
|
+
/**
|
|
41
|
+
* @zh 是否开启多选模式
|
|
42
|
+
* @en Whether to open multi-select mode
|
|
43
|
+
*/
|
|
44
|
+
multiple: {
|
|
45
|
+
type: Boolean,
|
|
46
|
+
default: !1
|
|
47
|
+
},
|
|
48
|
+
/**
|
|
49
|
+
* @zh 是否开启勾选模式,开启后按复选框逻辑选择,值始终为数组
|
|
50
|
+
* @en Whether to enable checkbox mode. Values are always an array
|
|
51
|
+
*/
|
|
52
|
+
treeCheckable: {
|
|
53
|
+
type: Boolean,
|
|
54
|
+
default: !1
|
|
55
|
+
},
|
|
56
|
+
/**
|
|
57
|
+
* @zh 勾选模式是否取消父子联动
|
|
58
|
+
* @en Whether to disable parent-child conduction in checkable mode
|
|
59
|
+
*/
|
|
60
|
+
treeCheckStrictly: {
|
|
61
|
+
type: Boolean,
|
|
62
|
+
default: !1
|
|
63
|
+
},
|
|
64
|
+
/**
|
|
65
|
+
* @zh 勾选回填策略,`parent` 保留父节点,`child` 只保留叶子节点
|
|
66
|
+
* @en Checked value strategy. `parent` keeps parents, `child` keeps only leaves
|
|
67
|
+
*/
|
|
68
|
+
checkedStrategy: {
|
|
69
|
+
type: String,
|
|
70
|
+
default: "parent"
|
|
71
|
+
},
|
|
72
|
+
/**
|
|
73
|
+
* @zh 树数据
|
|
74
|
+
* @en Tree data
|
|
75
|
+
*/
|
|
76
|
+
data: {
|
|
77
|
+
type: Array,
|
|
78
|
+
default: () => []
|
|
79
|
+
},
|
|
80
|
+
/**
|
|
81
|
+
* @zh 自定义节点字段名
|
|
82
|
+
* @en Customize node field names
|
|
83
|
+
*/
|
|
84
|
+
fieldNames: {
|
|
85
|
+
type: Object
|
|
86
|
+
},
|
|
87
|
+
/**
|
|
88
|
+
* @zh 选中值是否包含标题,值形如 `{ value, label }`
|
|
89
|
+
* @en Whether the value contains the label, shaped as `{ value, label }`
|
|
90
|
+
*/
|
|
91
|
+
labelInValue: {
|
|
92
|
+
type: Boolean,
|
|
93
|
+
default: !1
|
|
94
|
+
},
|
|
95
|
+
/**
|
|
96
|
+
* @zh 节点是否可选中,也支持 `'leaf'` 仅叶子节点或自定义方法
|
|
97
|
+
* @en Whether the node is selectable. `'leaf'` or a custom method is also accepted
|
|
98
|
+
*/
|
|
99
|
+
selectable: {
|
|
100
|
+
type: [Boolean, String, Function],
|
|
101
|
+
default: !0
|
|
102
|
+
},
|
|
103
|
+
/**
|
|
104
|
+
* @zh 是否允许搜索
|
|
105
|
+
* @en Whether to allow searching
|
|
106
|
+
*/
|
|
107
|
+
allowSearch: {
|
|
108
|
+
type: [Boolean, Object],
|
|
109
|
+
default: (a) => !!(a.multiple || a.treeCheckable)
|
|
110
|
+
},
|
|
111
|
+
/**
|
|
112
|
+
* @zh 是否允许清空
|
|
113
|
+
* @en Whether to allow clear
|
|
114
|
+
*/
|
|
115
|
+
allowClear: {
|
|
116
|
+
type: Boolean,
|
|
117
|
+
default: !1
|
|
118
|
+
},
|
|
119
|
+
/**
|
|
120
|
+
* @zh 过滤节点的方法,`false` 关闭过滤
|
|
121
|
+
* @en Filter node method, `false` to disable filtering
|
|
122
|
+
*/
|
|
123
|
+
filterTreeNode: {
|
|
124
|
+
type: [Boolean, Function],
|
|
125
|
+
default: !0
|
|
126
|
+
},
|
|
127
|
+
/**
|
|
128
|
+
* @zh 触发搜索事件的延迟时间
|
|
129
|
+
* @en Delay time to trigger search event
|
|
130
|
+
*/
|
|
131
|
+
searchDelay: {
|
|
132
|
+
type: Number,
|
|
133
|
+
default: 500
|
|
134
|
+
},
|
|
135
|
+
/**
|
|
136
|
+
* @zh 搜索输入值
|
|
137
|
+
* @en Search input value
|
|
138
|
+
* @vModel
|
|
139
|
+
*/
|
|
140
|
+
inputValue: {
|
|
141
|
+
type: String
|
|
142
|
+
},
|
|
143
|
+
/**
|
|
144
|
+
* @zh 搜索输入默认值(非受控模式)
|
|
145
|
+
* @en Default search input value (uncontrolled mode)
|
|
146
|
+
*/
|
|
147
|
+
defaultInputValue: {
|
|
148
|
+
type: String,
|
|
149
|
+
default: ""
|
|
150
|
+
},
|
|
151
|
+
/**
|
|
152
|
+
* @zh 选择框的尺寸
|
|
153
|
+
* @en The size of the select
|
|
154
|
+
* @values 'mini','small','medium','large'
|
|
155
|
+
* @defaultValue 'medium'
|
|
156
|
+
*/
|
|
157
|
+
size: {
|
|
158
|
+
type: String
|
|
159
|
+
},
|
|
160
|
+
/**
|
|
161
|
+
* @zh 占位符
|
|
162
|
+
* @en Placeholder
|
|
163
|
+
*/
|
|
164
|
+
placeholder: String,
|
|
165
|
+
/**
|
|
166
|
+
* @zh 是否为加载中状态
|
|
167
|
+
* @en Whether it is loading state
|
|
168
|
+
*/
|
|
169
|
+
loading: {
|
|
170
|
+
type: Boolean,
|
|
171
|
+
default: !1
|
|
172
|
+
},
|
|
173
|
+
/**
|
|
174
|
+
* @zh 是否禁用
|
|
175
|
+
* @en Whether to disable
|
|
176
|
+
*/
|
|
177
|
+
disabled: {
|
|
178
|
+
type: Boolean,
|
|
179
|
+
default: !1
|
|
180
|
+
},
|
|
181
|
+
/**
|
|
182
|
+
* @zh 是否为错误状态
|
|
183
|
+
* @en Whether it is an error state
|
|
184
|
+
*/
|
|
185
|
+
error: {
|
|
186
|
+
type: Boolean,
|
|
187
|
+
default: !1
|
|
188
|
+
},
|
|
189
|
+
/**
|
|
190
|
+
* @zh 是否显示输入框的边框
|
|
191
|
+
* @en Whether to display the border of the input box
|
|
192
|
+
*/
|
|
193
|
+
bordered: {
|
|
194
|
+
type: Boolean,
|
|
195
|
+
default: !0
|
|
196
|
+
},
|
|
197
|
+
/**
|
|
198
|
+
* @zh 多选模式下最多显示的标签数量。0 表示不限制
|
|
199
|
+
* @en In multi-select mode, the maximum number of labels displayed. 0 means unlimited
|
|
200
|
+
*/
|
|
201
|
+
maxTagCount: {
|
|
202
|
+
type: Number,
|
|
203
|
+
default: 0
|
|
204
|
+
},
|
|
205
|
+
/**
|
|
206
|
+
* @zh 标签内容不换行
|
|
207
|
+
* @en Tag content does not wrap
|
|
208
|
+
*/
|
|
209
|
+
tagNowrap: {
|
|
210
|
+
type: Boolean,
|
|
211
|
+
default: !1
|
|
212
|
+
},
|
|
213
|
+
/**
|
|
214
|
+
* @zh 是否显示下拉菜单
|
|
215
|
+
* @en Whether to show the dropdown
|
|
216
|
+
* @vModel
|
|
217
|
+
*/
|
|
218
|
+
popupVisible: {
|
|
219
|
+
type: Boolean,
|
|
220
|
+
default: void 0
|
|
221
|
+
},
|
|
222
|
+
/**
|
|
223
|
+
* @zh 弹出框默认是否可见(非受控模式)
|
|
224
|
+
* @en Whether the popup is visible by default (uncontrolled mode)
|
|
225
|
+
*/
|
|
226
|
+
defaultPopupVisible: {
|
|
227
|
+
type: Boolean,
|
|
228
|
+
default: !1
|
|
229
|
+
},
|
|
230
|
+
/**
|
|
231
|
+
* @zh 是否在下拉菜单关闭时销毁元素
|
|
232
|
+
* @en Whether to destroy the element when the dropdown is closed
|
|
233
|
+
*/
|
|
234
|
+
unmountOnClose: {
|
|
235
|
+
type: Boolean,
|
|
236
|
+
default: !1
|
|
237
|
+
},
|
|
238
|
+
/**
|
|
239
|
+
* @zh 弹出框的挂载容器
|
|
240
|
+
* @en Mount container for popup
|
|
241
|
+
*/
|
|
242
|
+
popupContainer: {
|
|
243
|
+
type: [String, Object]
|
|
244
|
+
},
|
|
245
|
+
/**
|
|
246
|
+
* @zh 下拉菜单的触发器属性
|
|
247
|
+
* @en Trigger props of the drop-down menu
|
|
248
|
+
* @type TriggerProps
|
|
249
|
+
*/
|
|
250
|
+
triggerProps: {
|
|
251
|
+
type: Object
|
|
252
|
+
},
|
|
253
|
+
/**
|
|
254
|
+
* @zh 是否默认展开所有节点
|
|
255
|
+
* @en Whether to expand all nodes by default
|
|
256
|
+
*/
|
|
257
|
+
defaultExpandAll: {
|
|
258
|
+
type: Boolean,
|
|
259
|
+
default: !1
|
|
260
|
+
},
|
|
261
|
+
/**
|
|
262
|
+
* @zh 展开的节点
|
|
263
|
+
* @en Expanded keys
|
|
264
|
+
* @vModel
|
|
265
|
+
*/
|
|
266
|
+
expandedKeys: {
|
|
267
|
+
type: Array,
|
|
268
|
+
default: void 0
|
|
269
|
+
},
|
|
270
|
+
/**
|
|
271
|
+
* @zh 默认展开的节点(非受控模式)
|
|
272
|
+
* @en Expanded keys by default (uncontrolled mode)
|
|
273
|
+
*/
|
|
274
|
+
defaultExpandedKeys: {
|
|
275
|
+
type: Array,
|
|
276
|
+
default: () => []
|
|
277
|
+
},
|
|
278
|
+
/**
|
|
279
|
+
* @zh 是否自动展开父节点
|
|
280
|
+
* @en Whether to expand parent nodes automatically
|
|
281
|
+
*/
|
|
282
|
+
autoExpandParent: {
|
|
283
|
+
type: Boolean,
|
|
284
|
+
default: !0
|
|
285
|
+
},
|
|
286
|
+
/**
|
|
287
|
+
* @zh 是否显示连接线
|
|
288
|
+
* @en Whether to display the tree line
|
|
289
|
+
*/
|
|
290
|
+
showLine: {
|
|
291
|
+
type: Boolean,
|
|
292
|
+
default: !1
|
|
293
|
+
},
|
|
294
|
+
/**
|
|
295
|
+
* @zh 节点是否占据整行,整行可点击
|
|
296
|
+
* @en Whether the node occupies the whole row. The whole row is clickable
|
|
297
|
+
*/
|
|
298
|
+
blockNode: {
|
|
299
|
+
type: Boolean,
|
|
300
|
+
default: !1
|
|
301
|
+
},
|
|
302
|
+
/**
|
|
303
|
+
* @zh 传递虚拟列表属性,传入此参数以开启虚拟滚动 [VirtualListProps](#VirtualListProps)
|
|
304
|
+
* @en Pass the virtual list attribute, pass in this parameter to turn on virtual scrolling [VirtualListProps](#VirtualListProps)
|
|
305
|
+
* @type VirtualListProps
|
|
306
|
+
*/
|
|
307
|
+
virtualListProps: {
|
|
308
|
+
type: Object
|
|
309
|
+
},
|
|
310
|
+
/**
|
|
311
|
+
* @zh 是否开启虚拟滚动条
|
|
312
|
+
* @en Whether to enable virtual scroll bar
|
|
313
|
+
*/
|
|
314
|
+
scrollbar: {
|
|
315
|
+
type: [Boolean, Object],
|
|
316
|
+
default: !0
|
|
317
|
+
},
|
|
318
|
+
/**
|
|
319
|
+
* @zh 下拉列表最大高度
|
|
320
|
+
* @en Max height of the dropdown list
|
|
321
|
+
*/
|
|
322
|
+
maxHeight: {
|
|
323
|
+
type: [Number, String]
|
|
324
|
+
},
|
|
325
|
+
/**
|
|
326
|
+
* @zh 异步加载子节点数据
|
|
327
|
+
* @en Load child nodes asynchronously
|
|
328
|
+
*/
|
|
329
|
+
loadMore: {
|
|
330
|
+
type: Function
|
|
331
|
+
},
|
|
332
|
+
/**
|
|
333
|
+
* @zh 自定义值中不存在的节点
|
|
334
|
+
* @en Options that do not exist in custom values
|
|
335
|
+
*/
|
|
336
|
+
fallbackOption: {
|
|
337
|
+
type: [Boolean, Function],
|
|
338
|
+
default: !0
|
|
339
|
+
},
|
|
340
|
+
/**
|
|
341
|
+
* @zh 格式化显示内容
|
|
342
|
+
* @en Format display content
|
|
343
|
+
*/
|
|
344
|
+
formatLabel: {
|
|
345
|
+
type: Function
|
|
346
|
+
},
|
|
347
|
+
/**
|
|
348
|
+
* @zh 空状态时是否显示 header
|
|
349
|
+
* @en Whether to display the header in the empty state
|
|
350
|
+
*/
|
|
351
|
+
showHeaderOnEmpty: {
|
|
352
|
+
type: Boolean,
|
|
353
|
+
default: !1
|
|
354
|
+
},
|
|
355
|
+
/**
|
|
356
|
+
* @zh 空状态时是否显示 footer
|
|
357
|
+
* @en Whether to display the footer in the empty state
|
|
358
|
+
*/
|
|
359
|
+
showFooterOnEmpty: {
|
|
360
|
+
type: Boolean,
|
|
361
|
+
default: !1
|
|
362
|
+
}
|
|
363
|
+
},
|
|
364
|
+
emits: {
|
|
365
|
+
"update:modelValue": (a) => !0,
|
|
366
|
+
"update:inputValue": (a) => !0,
|
|
367
|
+
"update:popupVisible": (a) => !0,
|
|
368
|
+
"update:expandedKeys": (a) => !0,
|
|
369
|
+
/**
|
|
370
|
+
* @zh 值发生改变时触发
|
|
371
|
+
* @en Triggered when the value changes
|
|
372
|
+
* @param {TreeSelectValue | TreeSelectValue[] | undefined} value
|
|
373
|
+
* @param {object} info 节点与勾选状态
|
|
374
|
+
*/
|
|
375
|
+
change: (a, o) => !0,
|
|
376
|
+
/**
|
|
377
|
+
* @zh 输入框的值发生改变时触发
|
|
378
|
+
* @en Triggered when the value of the input changes
|
|
379
|
+
* @param {string} inputValue
|
|
380
|
+
*/
|
|
381
|
+
inputValueChange: (a) => !0,
|
|
382
|
+
/**
|
|
383
|
+
* @zh 用户搜索时触发
|
|
384
|
+
* @en Triggered when the user searches
|
|
385
|
+
* @param {string} inputValue
|
|
386
|
+
*/
|
|
387
|
+
search: (a) => !0,
|
|
388
|
+
/**
|
|
389
|
+
* @zh 下拉框的显示状态改变时触发
|
|
390
|
+
* @en Triggered when the display state of the drop-down box changes
|
|
391
|
+
* @param {boolean} visible
|
|
392
|
+
*/
|
|
393
|
+
popupVisibleChange: (a) => !0,
|
|
394
|
+
/**
|
|
395
|
+
* @zh 点击清除按钮时触发
|
|
396
|
+
* @en Triggered when the clear button is clicked
|
|
397
|
+
*/
|
|
398
|
+
clear: (a) => !0,
|
|
399
|
+
/**
|
|
400
|
+
* @zh 删除多选标签时触发
|
|
401
|
+
* @en Triggered when the delete button of the label is clicked
|
|
402
|
+
* @param {TreeSelectValue} removed
|
|
403
|
+
*/
|
|
404
|
+
remove: (a) => !0,
|
|
405
|
+
/**
|
|
406
|
+
* @zh 展开状态改变时触发
|
|
407
|
+
* @en Triggered when the expanded state changes
|
|
408
|
+
* @param {TreeSelectKey[]} keys
|
|
409
|
+
* @param {object} info
|
|
410
|
+
*/
|
|
411
|
+
expand: (a, o) => !0,
|
|
412
|
+
/**
|
|
413
|
+
* @zh 下拉菜单发生滚动时触发
|
|
414
|
+
* @en Triggered when the drop-down scrolls
|
|
415
|
+
*/
|
|
416
|
+
dropdownScroll: (a) => !0,
|
|
417
|
+
/**
|
|
418
|
+
* @zh 点击节点时触发
|
|
419
|
+
* @en Triggered when a node is clicked
|
|
420
|
+
* @param {TreeSelectValue} value
|
|
421
|
+
* @param {object} info
|
|
422
|
+
*/
|
|
423
|
+
nodeClick: (a, o) => !0,
|
|
424
|
+
focus: (a) => !0,
|
|
425
|
+
blur: (a) => !0
|
|
426
|
+
},
|
|
427
|
+
/**
|
|
428
|
+
* @zh 选项为空时的显示内容
|
|
429
|
+
* @en Display content when the option is empty
|
|
430
|
+
* @slot empty
|
|
431
|
+
*/
|
|
432
|
+
/**
|
|
433
|
+
* @zh 自定义节点标题
|
|
434
|
+
* @en Custom node title
|
|
435
|
+
* @slot title
|
|
436
|
+
* @binding {TreeSelectNodeData} node
|
|
437
|
+
* @binding {TreeSelectKey} value
|
|
438
|
+
* @binding {boolean} checked
|
|
439
|
+
* @binding {boolean} halfChecked
|
|
440
|
+
* @binding {boolean} selected
|
|
441
|
+
* @binding {boolean} expanded
|
|
442
|
+
*/
|
|
443
|
+
/**
|
|
444
|
+
* @zh 自定义节点前缀图标
|
|
445
|
+
* @en Custom node icon
|
|
446
|
+
* @slot node-icon
|
|
447
|
+
* @binding {TreeSelectNodeData} node
|
|
448
|
+
*/
|
|
449
|
+
/**
|
|
450
|
+
* @zh 自定义展开图标
|
|
451
|
+
* @en Custom switcher icon
|
|
452
|
+
* @slot switcher-icon
|
|
453
|
+
* @binding {TreeSelectNodeData} node
|
|
454
|
+
* @binding {boolean} expanded
|
|
455
|
+
* @binding {boolean} loading
|
|
456
|
+
*/
|
|
457
|
+
/**
|
|
458
|
+
* @zh 选择框的显示内容
|
|
459
|
+
* @en Display content of label
|
|
460
|
+
* @slot label
|
|
461
|
+
* @binding {TreeSelectLabelValue} data
|
|
462
|
+
*/
|
|
463
|
+
/**
|
|
464
|
+
* @zh 下拉框的页头
|
|
465
|
+
* @en The header of the drop-down box
|
|
466
|
+
* @slot header
|
|
467
|
+
*/
|
|
468
|
+
/**
|
|
469
|
+
* @zh 下拉框的页脚
|
|
470
|
+
* @en The footer of the drop-down box
|
|
471
|
+
* @slot footer
|
|
472
|
+
*/
|
|
473
|
+
/**
|
|
474
|
+
* @zh 选择框的箭头图标
|
|
475
|
+
* @en Arrow icon for select box
|
|
476
|
+
* @slot arrow-icon
|
|
477
|
+
*/
|
|
478
|
+
/**
|
|
479
|
+
* @zh 选择框的加载中图标
|
|
480
|
+
* @en Loading icon for select box
|
|
481
|
+
* @slot loading-icon
|
|
482
|
+
*/
|
|
483
|
+
/**
|
|
484
|
+
* @zh 选择框的搜索图标
|
|
485
|
+
* @en Search icon for select box
|
|
486
|
+
* @slot search-icon
|
|
487
|
+
*/
|
|
488
|
+
/**
|
|
489
|
+
* @zh 前缀元素
|
|
490
|
+
* @en Prefix
|
|
491
|
+
* @slot prefix
|
|
492
|
+
*/
|
|
493
|
+
/**
|
|
494
|
+
* @zh 自定义触发元素
|
|
495
|
+
* @en Custom trigger element
|
|
496
|
+
* @slot trigger
|
|
497
|
+
* @binding {boolean} popupVisible
|
|
498
|
+
* @binding {boolean} disabled
|
|
499
|
+
*/
|
|
500
|
+
setup(a, {
|
|
501
|
+
slots: o,
|
|
502
|
+
emit: n,
|
|
503
|
+
attrs: v,
|
|
504
|
+
expose: Y
|
|
505
|
+
}) {
|
|
506
|
+
const {
|
|
507
|
+
size: G,
|
|
508
|
+
disabled: J,
|
|
509
|
+
error: Q,
|
|
510
|
+
data: Z,
|
|
511
|
+
multiple: ee,
|
|
512
|
+
treeCheckable: ae,
|
|
513
|
+
treeCheckStrictly: le,
|
|
514
|
+
checkedStrategy: te,
|
|
515
|
+
labelInValue: w,
|
|
516
|
+
selectable: oe,
|
|
517
|
+
expandedKeys: ne,
|
|
518
|
+
defaultExpandedKeys: ue,
|
|
519
|
+
defaultExpandAll: re,
|
|
520
|
+
autoExpandParent: de,
|
|
521
|
+
defaultInputValue: ie,
|
|
522
|
+
filterTreeNode: ce,
|
|
523
|
+
loadMore: se,
|
|
524
|
+
fallbackOption: pe,
|
|
525
|
+
formatLabel: fe,
|
|
526
|
+
modelValue: me,
|
|
527
|
+
defaultValue: he,
|
|
528
|
+
fieldNames: ve,
|
|
529
|
+
popupVisible: ye,
|
|
530
|
+
defaultPopupVisible: be,
|
|
531
|
+
loading: ge
|
|
532
|
+
} = ea(a), we = sa("tree-select"), O = aa(), V = `${O}-tree`, k = (e) => `${O}-node-${encodeURIComponent(e)}`, {
|
|
533
|
+
formItemCtx: Ve,
|
|
534
|
+
mergedSize: P,
|
|
535
|
+
mergedDisabled: d,
|
|
536
|
+
mergedError: ke,
|
|
537
|
+
eventHandlers: Se
|
|
538
|
+
} = da({
|
|
539
|
+
size: G,
|
|
540
|
+
disabled: J,
|
|
541
|
+
error: Q
|
|
542
|
+
}), {
|
|
543
|
+
t: Ce
|
|
544
|
+
} = ca(), S = g(() => oa(a.allowSearch) && !!a.allowSearch.retainInputValue), C = m(), K = m(), x = m(), y = m({}), {
|
|
545
|
+
computedPopupVisible: r,
|
|
546
|
+
handlePopupVisibleChange: s
|
|
547
|
+
} = ia({
|
|
548
|
+
popupVisible: ye,
|
|
549
|
+
defaultPopupVisible: be,
|
|
550
|
+
emit: n
|
|
551
|
+
}), {
|
|
552
|
+
nodeMap: L,
|
|
553
|
+
checkState: F,
|
|
554
|
+
isCheckable: T,
|
|
555
|
+
isMultiple: N,
|
|
556
|
+
filterResult: xe,
|
|
557
|
+
visibleNodes: B,
|
|
558
|
+
activeKey: c,
|
|
559
|
+
displayValues: Te,
|
|
560
|
+
clearable: Ne,
|
|
561
|
+
computedInputValue: p,
|
|
562
|
+
getNodeInfo: R,
|
|
563
|
+
isNodeSelectable: Be,
|
|
564
|
+
isNodeSelected: Ie,
|
|
565
|
+
isNodeHalfChecked: Ee,
|
|
566
|
+
isNodeExpanded: Ae,
|
|
567
|
+
isLoadingNode: Oe,
|
|
568
|
+
updateInputValue: b,
|
|
569
|
+
setActiveKey: I,
|
|
570
|
+
expandNode: Pe,
|
|
571
|
+
handleSelect: Ke,
|
|
572
|
+
handleRemove: Le,
|
|
573
|
+
handleClear: Fe,
|
|
574
|
+
handleKeyDown: Re,
|
|
575
|
+
expandAll: De,
|
|
576
|
+
checkAll: He
|
|
577
|
+
} = ma({
|
|
578
|
+
data: Z,
|
|
579
|
+
fieldNames: ve,
|
|
580
|
+
modelValue: me,
|
|
581
|
+
defaultValue: he,
|
|
582
|
+
multiple: ee,
|
|
583
|
+
treeCheckable: ae,
|
|
584
|
+
treeCheckStrictly: le,
|
|
585
|
+
checkedStrategy: te,
|
|
586
|
+
labelInValue: w,
|
|
587
|
+
selectable: oe,
|
|
588
|
+
expandedKeys: ne,
|
|
589
|
+
defaultExpandedKeys: ue,
|
|
590
|
+
defaultExpandAll: re,
|
|
591
|
+
autoExpandParent: de,
|
|
592
|
+
defaultInputValue: ie,
|
|
593
|
+
filterTreeNode: ce,
|
|
594
|
+
loadMore: se,
|
|
595
|
+
fallbackOption: pe,
|
|
596
|
+
formatLabel: fe,
|
|
597
|
+
popupVisible: r,
|
|
598
|
+
disabled: d,
|
|
599
|
+
loading: ge,
|
|
600
|
+
onUpdateModelValue: (e) => n("update:modelValue", e),
|
|
601
|
+
onChange: (e, l) => {
|
|
602
|
+
var t, u;
|
|
603
|
+
n("change", e, l), (u = (t = Se.value) == null ? void 0 : t.onChange) == null || u.call(t);
|
|
604
|
+
},
|
|
605
|
+
onUpdateExpandedKeys: (e) => n("update:expandedKeys", e),
|
|
606
|
+
onExpand: (e, l) => n("expand", e, l),
|
|
607
|
+
onUpdateInputValue: (e) => {
|
|
608
|
+
n("update:inputValue", e), n("inputValueChange", e);
|
|
609
|
+
},
|
|
610
|
+
onPopupVisibleChange: s
|
|
611
|
+
});
|
|
612
|
+
Y({
|
|
613
|
+
focus: () => {
|
|
614
|
+
var e;
|
|
615
|
+
return (e = C.value) == null ? void 0 : e.focus();
|
|
616
|
+
},
|
|
617
|
+
blur: () => {
|
|
618
|
+
var e;
|
|
619
|
+
return (e = C.value) == null ? void 0 : e.blur();
|
|
620
|
+
},
|
|
621
|
+
expandAll: (e = !0) => De(e),
|
|
622
|
+
checkAll: (e = !0) => He(e)
|
|
623
|
+
}), M(r, (e) => {
|
|
624
|
+
!e && !S.value && p.value && b("");
|
|
625
|
+
}), M(d, (e) => {
|
|
626
|
+
e && s(!1);
|
|
627
|
+
});
|
|
628
|
+
const f = m(), D = () => {
|
|
629
|
+
f.value !== void 0 && clearTimeout(f.value), f.value = void 0;
|
|
630
|
+
};
|
|
631
|
+
la(D);
|
|
632
|
+
const je = (e) => {
|
|
633
|
+
d.value || e !== p.value && (r.value || s(!0), b(e), D(), f.value = setTimeout(() => {
|
|
634
|
+
f.value = void 0, a.allowSearch && !d.value && e === p.value && n("search", e);
|
|
635
|
+
}, Math.max(0, a.searchDelay)));
|
|
636
|
+
}, H = (e) => {
|
|
637
|
+
const l = R(e), t = F.value.checked.has(e);
|
|
638
|
+
if (Ke(e), d.value || !l) return;
|
|
639
|
+
const u = w.value ? {
|
|
640
|
+
value: l.value,
|
|
641
|
+
label: l.title,
|
|
642
|
+
raw: l.raw
|
|
643
|
+
} : l.value;
|
|
644
|
+
if (n("nodeClick", u, {
|
|
645
|
+
node: l.raw,
|
|
646
|
+
checked: T.value ? !t : void 0,
|
|
647
|
+
selected: T.value ? void 0 : !t
|
|
648
|
+
}), !N.value && Be(l)) {
|
|
649
|
+
S.value && b(l.title), s(!1);
|
|
650
|
+
return;
|
|
651
|
+
}
|
|
652
|
+
!S.value && p.value && b("");
|
|
653
|
+
}, Ue = (e) => {
|
|
654
|
+
const l = String(e), t = R(l);
|
|
655
|
+
Le(l);
|
|
656
|
+
const u = t ? w.value ? {
|
|
657
|
+
value: t.value,
|
|
658
|
+
label: t.title,
|
|
659
|
+
raw: t.raw
|
|
660
|
+
} : t.value : X(l);
|
|
661
|
+
n("remove", u);
|
|
662
|
+
}, Me = (e) => {
|
|
663
|
+
Fe(), n("clear", e);
|
|
664
|
+
}, E = (e) => {
|
|
665
|
+
if (Re(e), e.key === "ArrowUp" || e.key === "ArrowDown") {
|
|
666
|
+
const l = c.value;
|
|
667
|
+
l && ta(() => $e(l));
|
|
668
|
+
}
|
|
669
|
+
}, ze = /* @__PURE__ */ new Set(["text", "search", "password", "email", "url", "tel", "number"]), _e = (e) => {
|
|
670
|
+
const l = e.target;
|
|
671
|
+
if (l && l !== e.currentTarget) {
|
|
672
|
+
const t = l.tagName;
|
|
673
|
+
if (l.isContentEditable || t === "TEXTAREA" || t === "INPUT" && !["checkbox", "radio"].includes(l.type) && ze.has(l.type))
|
|
674
|
+
return;
|
|
675
|
+
}
|
|
676
|
+
E(e);
|
|
677
|
+
}, $e = (e) => {
|
|
678
|
+
var U;
|
|
679
|
+
x.value && x.value.scrollTo({
|
|
680
|
+
key: e
|
|
681
|
+
});
|
|
682
|
+
const l = (U = K.value) == null ? void 0 : U.wrapperRef, t = y.value[e];
|
|
683
|
+
if (!l || !t || l.scrollHeight === l.offsetHeight) return;
|
|
684
|
+
const u = fa(t, l);
|
|
685
|
+
u.top < 0 ? l.scrollTo(0, l.scrollTop + u.top) : u.bottom > l.offsetHeight && l.scrollTo(0, l.scrollTop + u.bottom - l.offsetHeight);
|
|
686
|
+
}, We = g(() => pa(v, Object.keys(v).filter(q))), Xe = g(() => ({
|
|
687
|
+
...Object.fromEntries(Object.entries(v).filter(([e]) => q(e))),
|
|
688
|
+
role: "combobox",
|
|
689
|
+
"aria-haspopup": "tree",
|
|
690
|
+
"aria-expanded": String(r.value),
|
|
691
|
+
"aria-controls": V,
|
|
692
|
+
"aria-activedescendant": r.value && !a.loading && !z(c.value) ? k(c.value) : void 0,
|
|
693
|
+
"aria-autocomplete": a.allowSearch ? "list" : "none",
|
|
694
|
+
"aria-label": v["aria-label"] ?? (Ve.labelId ? void 0 : a.placeholder ?? Ce("common.select"))
|
|
695
|
+
})), qe = g(() => Te.value.map((e) => {
|
|
696
|
+
const l = L.value.get(W(e.value));
|
|
697
|
+
return {
|
|
698
|
+
// 标签值使用内部键,数字键在 InputTag 往返后不会丢失类型
|
|
699
|
+
value: W(e.value),
|
|
700
|
+
label: e.label,
|
|
701
|
+
closable: !(l != null && l.disabled)
|
|
702
|
+
};
|
|
703
|
+
})), Ye = ({
|
|
704
|
+
data: e
|
|
705
|
+
}) => {
|
|
706
|
+
if (i(o.label) && e) {
|
|
707
|
+
const l = L.value.get(e.value);
|
|
708
|
+
return o.label({
|
|
709
|
+
data: l ? {
|
|
710
|
+
value: l.value,
|
|
711
|
+
label: l.title,
|
|
712
|
+
raw: l.raw
|
|
713
|
+
} : {
|
|
714
|
+
value: X(e.value),
|
|
715
|
+
label: e.label
|
|
716
|
+
}
|
|
717
|
+
});
|
|
718
|
+
}
|
|
719
|
+
return (e == null ? void 0 : e.label) ?? "";
|
|
720
|
+
}, Ge = () => ({
|
|
721
|
+
...i(o.title) ? {
|
|
722
|
+
default: o.title
|
|
723
|
+
} : {},
|
|
724
|
+
...i(o["node-icon"]) ? {
|
|
725
|
+
"node-icon": o["node-icon"]
|
|
726
|
+
} : {},
|
|
727
|
+
...i(o["switcher-icon"]) ? {
|
|
728
|
+
"switcher-icon": o["switcher-icon"]
|
|
729
|
+
} : {}
|
|
730
|
+
}), j = (e) => {
|
|
731
|
+
var l;
|
|
732
|
+
return h(ua, {
|
|
733
|
+
key: e.key,
|
|
734
|
+
ref: (t) => {
|
|
735
|
+
t instanceof Element ? y.value[e.key] = t : (t == null ? void 0 : t.$el) instanceof Element ? y.value[e.key] = t.$el : delete y.value[e.key];
|
|
736
|
+
},
|
|
737
|
+
node: e,
|
|
738
|
+
nodeId: k(e.key),
|
|
739
|
+
selected: Ie(e),
|
|
740
|
+
checked: F.value.checked.has(e.key),
|
|
741
|
+
halfChecked: Ee(e),
|
|
742
|
+
expanded: Ae(e),
|
|
743
|
+
active: c.value === e.key,
|
|
744
|
+
loading: Oe(e.key),
|
|
745
|
+
checkable: T.value,
|
|
746
|
+
multiple: N.value,
|
|
747
|
+
disabled: e.disabled,
|
|
748
|
+
showLine: a.showLine,
|
|
749
|
+
blockNode: a.blockNode,
|
|
750
|
+
highlight: ((l = xe.value) == null ? void 0 : l.query) ?? "",
|
|
751
|
+
size: P.value,
|
|
752
|
+
onSelect: () => H(e.key),
|
|
753
|
+
onCheck: () => H(e.key),
|
|
754
|
+
"onToggle-expand": (t) => {
|
|
755
|
+
Pe(e.key, t), I(e.key);
|
|
756
|
+
},
|
|
757
|
+
onHover: () => {
|
|
758
|
+
e.disabled || I(e.key);
|
|
759
|
+
},
|
|
760
|
+
onLeave: () => I(void 0)
|
|
761
|
+
}, Ge());
|
|
762
|
+
}, Je = (e) => {
|
|
763
|
+
n("dropdownScroll", e);
|
|
764
|
+
}, Qe = () => h(na, {
|
|
765
|
+
ref: K,
|
|
766
|
+
id: V,
|
|
767
|
+
loading: a.loading,
|
|
768
|
+
empty: B.value.length === 0,
|
|
769
|
+
virtualList: !!a.virtualListProps,
|
|
770
|
+
showLine: a.showLine,
|
|
771
|
+
scrollbar: a.scrollbar,
|
|
772
|
+
maxHeight: a.maxHeight,
|
|
773
|
+
showHeaderOnEmpty: a.showHeaderOnEmpty,
|
|
774
|
+
showFooterOnEmpty: a.showFooterOnEmpty,
|
|
775
|
+
onScroll: Je,
|
|
776
|
+
onKeydown: _e
|
|
777
|
+
}, {
|
|
778
|
+
default: () => a.virtualListProps ? void 0 : B.value.map(j),
|
|
779
|
+
"virtual-list": () => h(ra, A(a.virtualListProps, {
|
|
780
|
+
ref: x,
|
|
781
|
+
data: B.value,
|
|
782
|
+
itemKey: "key",
|
|
783
|
+
scrollbar: a.scrollbar
|
|
784
|
+
}), {
|
|
785
|
+
item: ({
|
|
786
|
+
item: e
|
|
787
|
+
}) => j(e)
|
|
788
|
+
}),
|
|
789
|
+
// 仅在用户真的提供了插槽时才透传,否则空 key 会跳过默认空态
|
|
790
|
+
...i(o.empty) ? {
|
|
791
|
+
empty: o.empty
|
|
792
|
+
} : {},
|
|
793
|
+
...i(o.header) ? {
|
|
794
|
+
header: o.header
|
|
795
|
+
} : {},
|
|
796
|
+
...i(o.footer) ? {
|
|
797
|
+
footer: o.footer
|
|
798
|
+
} : {}
|
|
799
|
+
});
|
|
800
|
+
return () => h(_, A({
|
|
801
|
+
trigger: "click",
|
|
802
|
+
position: "bl",
|
|
803
|
+
popupOffset: 4,
|
|
804
|
+
animationName: "x-slide-dynamic-origin",
|
|
805
|
+
hideEmpty: !0,
|
|
806
|
+
preventFocus: !0,
|
|
807
|
+
autoFitPopupWidth: !0,
|
|
808
|
+
autoFitTransformOrigin: !0,
|
|
809
|
+
disabled: d.value,
|
|
810
|
+
popupVisible: r.value,
|
|
811
|
+
unmountOnClose: a.unmountOnClose,
|
|
812
|
+
clickToClose: !a.allowSearch,
|
|
813
|
+
popupContainer: a.popupContainer,
|
|
814
|
+
onPopupVisibleChange: s,
|
|
815
|
+
updateAtScroll: !0
|
|
816
|
+
}, a.triggerProps), {
|
|
817
|
+
default: () => {
|
|
818
|
+
var e;
|
|
819
|
+
return [((e = o.trigger) == null ? void 0 : e.call(o, {
|
|
820
|
+
popupVisible: r.value,
|
|
821
|
+
disabled: d.value,
|
|
822
|
+
treeId: V,
|
|
823
|
+
activeDescendant: r.value && !a.loading && !z(c.value) ? k(c.value) : void 0,
|
|
824
|
+
onKeydown: E
|
|
825
|
+
})) ?? h($, A({
|
|
826
|
+
ref: C,
|
|
827
|
+
class: we.block,
|
|
828
|
+
modelValue: qe.value,
|
|
829
|
+
inputValue: p.value,
|
|
830
|
+
multiple: N.value,
|
|
831
|
+
disabled: d.value,
|
|
832
|
+
error: ke.value,
|
|
833
|
+
loading: a.loading,
|
|
834
|
+
allowClear: a.allowClear,
|
|
835
|
+
clearable: Ne.value,
|
|
836
|
+
allowSearch: !!a.allowSearch,
|
|
837
|
+
opened: r.value,
|
|
838
|
+
maxTagCount: a.maxTagCount,
|
|
839
|
+
placeholder: a.placeholder,
|
|
840
|
+
bordered: a.bordered,
|
|
841
|
+
size: P.value,
|
|
842
|
+
tagNowrap: a.tagNowrap,
|
|
843
|
+
inputAttrs: Xe.value
|
|
844
|
+
}, We.value, {
|
|
845
|
+
onInputValueChange: je,
|
|
846
|
+
onRemove: Ue,
|
|
847
|
+
onClear: Me,
|
|
848
|
+
onKeydown: E,
|
|
849
|
+
onFocus: (l) => n("focus", l),
|
|
850
|
+
onBlur: (l) => n("blur", l)
|
|
851
|
+
}), {
|
|
852
|
+
label: Ye,
|
|
853
|
+
prefix: o.prefix,
|
|
854
|
+
"arrow-icon": o["arrow-icon"],
|
|
855
|
+
"loading-icon": o["loading-icon"],
|
|
856
|
+
"search-icon": o["search-icon"]
|
|
857
|
+
})];
|
|
858
|
+
},
|
|
859
|
+
content: Qe
|
|
860
|
+
});
|
|
861
|
+
}
|
|
862
|
+
});
|
|
863
|
+
export {
|
|
864
|
+
Aa as default
|
|
865
|
+
};
|