ep-craft 0.1.26 → 0.1.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/date-picker/src/date-picker.js +38 -34
- package/dist/components/date-picker/src/props.js +19 -7
- package/dist/components/form/src/types.d.ts +1 -1
- package/dist/components/scrollbar/index.d.ts +1 -0
- package/dist/components/scrollbar/src/util.d.ts +40 -0
- package/dist/components/scrollbar/src/util.js +25 -0
- package/dist/components/select/select.vue.d.ts +8 -8
- package/dist/components/select/src/useSelect.d.ts +2 -2
- package/dist/components/select-v2/index.d.ts +6 -2
- package/dist/components/select-v2/index.js +7 -4
- package/dist/components/select-v2/src/defaults.d.ts +258 -0
- package/dist/components/select-v2/src/defaults.js +359 -0
- package/dist/components/select-v2/src/group-item.vue.d.ts +40 -0
- package/dist/components/select-v2/src/group-item.vue.js +13 -0
- package/dist/components/select-v2/src/group-item2.vue.js +33 -0
- package/dist/components/select-v2/src/option-item.vue.d.ts +66 -0
- package/dist/components/select-v2/src/option-item.vue.js +37 -0
- package/dist/components/select-v2/src/option-item2.vue.js +46 -0
- package/dist/components/select-v2/src/select-dropdown.d.ts +53 -0
- package/dist/components/select-v2/src/select-dropdown.js +209 -0
- package/dist/components/select-v2/src/select.types.d.ts +2 -1
- package/dist/components/select-v2/src/select.vue.d.ts +918 -0
- package/dist/components/select-v2/src/select.vue.js +388 -0
- package/dist/components/select-v2/src/select2.vue.js +86 -0
- package/dist/components/select-v2/src/token.d.ts +16 -0
- package/dist/components/select-v2/src/token.js +6 -0
- package/dist/components/select-v2/src/useAllowCreate.d.ts +8 -0
- package/dist/components/select-v2/src/useAllowCreate.js +64 -0
- package/dist/components/select-v2/src/useOption.d.ts +7 -0
- package/dist/components/select-v2/src/useOption.js +13 -0
- package/dist/components/select-v2/src/useProps.d.ts +2 -3
- package/dist/components/select-v2/src/useSelect.d.ts +129 -0
- package/dist/components/select-v2/src/useSelect.js +501 -0
- package/dist/components/time-picker/index.js +10 -11
- package/dist/components/time-picker/src/common/picker.vue.d.ts +131 -125
- package/dist/components/time-picker/src/common/picker.vue.js +163 -160
- package/dist/components/time-picker/src/common/props.d.ts +0 -1
- package/dist/components/time-picker/src/common/props.js +13 -14
- package/dist/components/time-picker/src/time-picker.d.ts +0 -3
- package/dist/components/virtual-list/index.d.ts +8 -0
- package/dist/components/virtual-list/src/builders/build-list.d.ts +187 -0
- package/dist/components/virtual-list/src/builders/build-list.js +363 -0
- package/dist/components/virtual-list/src/components/dynamic-size-list.d.ts +186 -0
- package/dist/components/virtual-list/src/components/dynamic-size-list.js +112 -0
- package/dist/components/virtual-list/src/components/fixed-size-list.d.ts +185 -0
- package/dist/components/virtual-list/src/components/fixed-size-list.js +68 -0
- package/dist/components/virtual-list/src/components/scrollbar.d.ts +79 -0
- package/dist/components/virtual-list/src/components/scrollbar.js +134 -0
- package/dist/components/virtual-list/src/defaults.d.ts +27 -0
- package/dist/components/virtual-list/src/defaults.js +26 -0
- package/dist/components/virtual-list/src/hooks/use-cache.d.ts +1 -0
- package/dist/components/virtual-list/src/hooks/use-cache.js +13 -0
- package/dist/components/virtual-list/src/hooks/use-wheel.d.ts +13 -0
- package/dist/components/virtual-list/src/hooks/use-wheel.js +26 -0
- package/dist/components/virtual-list/src/props.d.ts +211 -0
- package/dist/components/virtual-list/src/props.js +151 -0
- package/dist/components/virtual-list/src/types.d.ts +152 -0
- package/dist/components/virtual-list/src/utils.d.ts +16 -0
- package/dist/components/virtual-list/src/utils.js +22 -0
- package/dist/hooks/use-float-label/index.d.ts +6 -2
- package/dist/hooks/use-float-label/index.js +11 -7
- package/dist/index.css +1 -1
- package/dist/vendored-components.d.ts +1 -1
- package/dist/vendored-components.js +1 -0
- package/package.json +2 -1
- package/theme-chalk/src/float-label.scss +57 -0
|
@@ -0,0 +1,359 @@
|
|
|
1
|
+
import { placements as i } from "@popperjs/core";
|
|
2
|
+
import "vue";
|
|
3
|
+
import { isBoolean as n, isNumber as l } from "../../../utils/types.js";
|
|
4
|
+
import "lodash-unified";
|
|
5
|
+
import "@vueuse/core";
|
|
6
|
+
import "@vue/shared";
|
|
7
|
+
import { CHANGE_EVENT as u, UPDATE_MODEL_EVENT as m } from "../../../constants/event.js";
|
|
8
|
+
import { iconPropType as r } from "../../../utils/vue/icon.js";
|
|
9
|
+
import { buildProps as p, definePropType as t } from "../../../utils/vue/props/runtime.js";
|
|
10
|
+
import { useSizeProp as d } from "../../../hooks/use-size/index.js";
|
|
11
|
+
import "../../../hooks/use-z-index/index.js";
|
|
12
|
+
import "../../../hooks/use-delayed-toggle/index.js";
|
|
13
|
+
import { useAriaProps as s } from "../../../hooks/use-aria/index.js";
|
|
14
|
+
import "../../../hooks/use-model-toggle/index.js";
|
|
15
|
+
import { useEmptyValuesProps as f } from "../../../hooks/use-empty-values/index.js";
|
|
16
|
+
import { floatLabelProp as c } from "../../../hooks/use-float-label/index.js";
|
|
17
|
+
import "../../scrollbar/index.js";
|
|
18
|
+
import "../../tooltip/index.js";
|
|
19
|
+
import { ArrowDown as y, CircleClose as b } from "@element-plus/icons-vue";
|
|
20
|
+
import "../../tag/index.js";
|
|
21
|
+
import { defaultProps as g } from "./useProps.js";
|
|
22
|
+
import { useTooltipContentProps as o } from "../../tooltip/src/content.js";
|
|
23
|
+
import { tagProps as a } from "../../tag/tag.js";
|
|
24
|
+
import { scrollbarEmits as B } from "../../scrollbar/src/scrollbar.js";
|
|
25
|
+
const G = p({
|
|
26
|
+
/**
|
|
27
|
+
* @description whether creating new items is allowed. To use this, `filterable` must be true
|
|
28
|
+
*/
|
|
29
|
+
allowCreate: Boolean,
|
|
30
|
+
/**
|
|
31
|
+
* @description autocomplete of select input
|
|
32
|
+
*/
|
|
33
|
+
autocomplete: {
|
|
34
|
+
type: t(String),
|
|
35
|
+
default: "none"
|
|
36
|
+
},
|
|
37
|
+
/**
|
|
38
|
+
* @description for non-filterable Select, this prop decides if the option menu pops up when the input is focused
|
|
39
|
+
*/
|
|
40
|
+
automaticDropdown: Boolean,
|
|
41
|
+
/**
|
|
42
|
+
* @description whether select can be cleared
|
|
43
|
+
*/
|
|
44
|
+
clearable: Boolean,
|
|
45
|
+
/**
|
|
46
|
+
* @description custom clear icon
|
|
47
|
+
*/
|
|
48
|
+
clearIcon: {
|
|
49
|
+
type: r,
|
|
50
|
+
default: b
|
|
51
|
+
},
|
|
52
|
+
/**
|
|
53
|
+
* @description tooltip theme, built-in theme: `dark` / `light`
|
|
54
|
+
*/
|
|
55
|
+
effect: {
|
|
56
|
+
type: t(String),
|
|
57
|
+
default: "light"
|
|
58
|
+
},
|
|
59
|
+
/**
|
|
60
|
+
* @description whether to collapse tags to a text when multiple selecting
|
|
61
|
+
*/
|
|
62
|
+
collapseTags: Boolean,
|
|
63
|
+
/**
|
|
64
|
+
* @description whether show all selected tags when mouse hover text of collapse-tags. To use this, `collapse-tags` must be true
|
|
65
|
+
*/
|
|
66
|
+
collapseTagsTooltip: Boolean,
|
|
67
|
+
/**
|
|
68
|
+
* @description configuration object for the collapse-tags tooltip. To use this, `collapse-tags` and `collapse-tags-tooltip` must be true
|
|
69
|
+
*/
|
|
70
|
+
tagTooltip: {
|
|
71
|
+
type: t(Object),
|
|
72
|
+
default: () => ({})
|
|
73
|
+
},
|
|
74
|
+
/**
|
|
75
|
+
* @description The max tags number to be shown. To use this, `collapse-tags` must be true
|
|
76
|
+
*/
|
|
77
|
+
maxCollapseTags: {
|
|
78
|
+
type: Number,
|
|
79
|
+
default: 1
|
|
80
|
+
},
|
|
81
|
+
/**
|
|
82
|
+
* @description
|
|
83
|
+
*/
|
|
84
|
+
defaultFirstOption: Boolean,
|
|
85
|
+
/**
|
|
86
|
+
* @description is disabled
|
|
87
|
+
*/
|
|
88
|
+
disabled: {
|
|
89
|
+
type: Boolean,
|
|
90
|
+
default: void 0
|
|
91
|
+
},
|
|
92
|
+
/**
|
|
93
|
+
* @description Estimated item height for variable option sizes. Defaults to fixed `itemHeight` when omitted.
|
|
94
|
+
*/
|
|
95
|
+
estimatedOptionHeight: {
|
|
96
|
+
type: Number,
|
|
97
|
+
default: void 0
|
|
98
|
+
},
|
|
99
|
+
/**
|
|
100
|
+
* @description whether Select is filterable
|
|
101
|
+
*/
|
|
102
|
+
filterable: Boolean,
|
|
103
|
+
/**
|
|
104
|
+
* @description custom filter method, the first parameter is the current input value. To use this, `filterable` must be true
|
|
105
|
+
*/
|
|
106
|
+
filterMethod: {
|
|
107
|
+
type: t(Function)
|
|
108
|
+
},
|
|
109
|
+
/**
|
|
110
|
+
* @description The height of the dropdown panel, 34px for each item
|
|
111
|
+
*/
|
|
112
|
+
height: {
|
|
113
|
+
type: Number,
|
|
114
|
+
default: 274
|
|
115
|
+
// same as select dropdown menu
|
|
116
|
+
},
|
|
117
|
+
/**
|
|
118
|
+
* @description The height of the dropdown item
|
|
119
|
+
*/
|
|
120
|
+
itemHeight: {
|
|
121
|
+
type: Number,
|
|
122
|
+
default: 34
|
|
123
|
+
},
|
|
124
|
+
/**
|
|
125
|
+
* @description native input id
|
|
126
|
+
*/
|
|
127
|
+
id: String,
|
|
128
|
+
/**
|
|
129
|
+
* @description whether Select is loading data from server
|
|
130
|
+
*/
|
|
131
|
+
loading: Boolean,
|
|
132
|
+
/**
|
|
133
|
+
* @description displayed text while loading data from server, default is 'Loading'
|
|
134
|
+
*/
|
|
135
|
+
loadingText: String,
|
|
136
|
+
/**
|
|
137
|
+
* @description biding value
|
|
138
|
+
*/
|
|
139
|
+
modelValue: {
|
|
140
|
+
type: t([Array, String, Number, Boolean, Object]),
|
|
141
|
+
default: void 0
|
|
142
|
+
},
|
|
143
|
+
/**
|
|
144
|
+
* @description is multiple
|
|
145
|
+
*/
|
|
146
|
+
multiple: Boolean,
|
|
147
|
+
/**
|
|
148
|
+
* @description maximum number of options user can select when multiple is true. No limit when set to 0
|
|
149
|
+
*/
|
|
150
|
+
multipleLimit: {
|
|
151
|
+
type: Number,
|
|
152
|
+
default: 0
|
|
153
|
+
},
|
|
154
|
+
/**
|
|
155
|
+
* @description the name attribute of select input
|
|
156
|
+
*/
|
|
157
|
+
name: String,
|
|
158
|
+
/**
|
|
159
|
+
* @description displayed text when there is no options, you can also use slot empty, the default is 'No Data'
|
|
160
|
+
*/
|
|
161
|
+
noDataText: String,
|
|
162
|
+
/**
|
|
163
|
+
* @description displayed text when no data matches the filtering query, you can also use slot `empty`, default is 'No matching data'
|
|
164
|
+
*/
|
|
165
|
+
noMatchText: String,
|
|
166
|
+
/**
|
|
167
|
+
* @description function that gets called when the input value changes. Its parameter is the current input value. To use this, `filterable` must be true
|
|
168
|
+
*/
|
|
169
|
+
remoteMethod: {
|
|
170
|
+
type: t(Function)
|
|
171
|
+
},
|
|
172
|
+
/**
|
|
173
|
+
* @description whether reserve the keyword after select filtered option.
|
|
174
|
+
*/
|
|
175
|
+
reserveKeyword: {
|
|
176
|
+
type: Boolean,
|
|
177
|
+
default: !0
|
|
178
|
+
},
|
|
179
|
+
/**
|
|
180
|
+
* @description data of the options, the key of `value` and `label` can be customize by `props`
|
|
181
|
+
*/
|
|
182
|
+
options: {
|
|
183
|
+
type: t(Array),
|
|
184
|
+
required: !0
|
|
185
|
+
},
|
|
186
|
+
/**
|
|
187
|
+
* @description placeholder, the default is 'Please select'
|
|
188
|
+
*/
|
|
189
|
+
placeholder: {
|
|
190
|
+
type: String
|
|
191
|
+
},
|
|
192
|
+
/**
|
|
193
|
+
* @description whether select dropdown is teleported, if `true` it will be teleported to where `append-to` sets
|
|
194
|
+
*/
|
|
195
|
+
teleported: o.teleported,
|
|
196
|
+
/**
|
|
197
|
+
* @description when select dropdown is inactive and `persistent` is `false`, select dropdown will be destroyed
|
|
198
|
+
*/
|
|
199
|
+
persistent: {
|
|
200
|
+
type: Boolean,
|
|
201
|
+
default: !0
|
|
202
|
+
},
|
|
203
|
+
/**
|
|
204
|
+
* @description custom class name for Select's dropdown
|
|
205
|
+
*/
|
|
206
|
+
popperClass: o.popperClass,
|
|
207
|
+
/**
|
|
208
|
+
* @description custom style for Select's dropdown
|
|
209
|
+
*/
|
|
210
|
+
popperStyle: o.popperStyle,
|
|
211
|
+
/**
|
|
212
|
+
* @description [popper.js](https://popper.js.org/docs/v2/) parameters
|
|
213
|
+
*/
|
|
214
|
+
popperOptions: {
|
|
215
|
+
type: t(Object),
|
|
216
|
+
default: () => ({})
|
|
217
|
+
},
|
|
218
|
+
/**
|
|
219
|
+
* @description whether search data from server
|
|
220
|
+
*/
|
|
221
|
+
remote: Boolean,
|
|
222
|
+
/**
|
|
223
|
+
* @description debounce delay during remote search, in milliseconds
|
|
224
|
+
*/
|
|
225
|
+
debounce: {
|
|
226
|
+
type: Number,
|
|
227
|
+
default: 300
|
|
228
|
+
},
|
|
229
|
+
/**
|
|
230
|
+
* @description size of component
|
|
231
|
+
*/
|
|
232
|
+
size: d,
|
|
233
|
+
/**
|
|
234
|
+
* @description configuration options, see the following table
|
|
235
|
+
*/
|
|
236
|
+
props: {
|
|
237
|
+
type: t(Object),
|
|
238
|
+
default: () => g
|
|
239
|
+
},
|
|
240
|
+
/**
|
|
241
|
+
* @description unique identity key name for value, required when value is an object
|
|
242
|
+
*/
|
|
243
|
+
valueKey: {
|
|
244
|
+
type: String,
|
|
245
|
+
default: "value"
|
|
246
|
+
},
|
|
247
|
+
/**
|
|
248
|
+
* @description Controls whether the scrollbar is always displayed
|
|
249
|
+
*/
|
|
250
|
+
scrollbarAlwaysOn: Boolean,
|
|
251
|
+
/**
|
|
252
|
+
* @description whether to trigger form validation
|
|
253
|
+
*/
|
|
254
|
+
validateEvent: {
|
|
255
|
+
type: Boolean,
|
|
256
|
+
default: !0
|
|
257
|
+
},
|
|
258
|
+
/**
|
|
259
|
+
* @description offset of the dropdown
|
|
260
|
+
*/
|
|
261
|
+
offset: {
|
|
262
|
+
type: Number,
|
|
263
|
+
default: 12
|
|
264
|
+
},
|
|
265
|
+
/**
|
|
266
|
+
* @description in remote search method show suffix icon
|
|
267
|
+
*/
|
|
268
|
+
remoteShowSuffix: Boolean,
|
|
269
|
+
/**
|
|
270
|
+
* @description Determines whether the arrow is displayed
|
|
271
|
+
*/
|
|
272
|
+
showArrow: {
|
|
273
|
+
type: Boolean,
|
|
274
|
+
default: !0
|
|
275
|
+
},
|
|
276
|
+
/**
|
|
277
|
+
* @description position of dropdown
|
|
278
|
+
*/
|
|
279
|
+
placement: {
|
|
280
|
+
type: t(String),
|
|
281
|
+
values: i,
|
|
282
|
+
default: "bottom-start"
|
|
283
|
+
},
|
|
284
|
+
/**
|
|
285
|
+
* @description list of possible positions for dropdown
|
|
286
|
+
*/
|
|
287
|
+
fallbackPlacements: {
|
|
288
|
+
type: t(Array),
|
|
289
|
+
default: ["bottom-start", "top-start", "right", "left"]
|
|
290
|
+
},
|
|
291
|
+
/**
|
|
292
|
+
* @description tag type
|
|
293
|
+
*/
|
|
294
|
+
tagType: { ...a.type, default: "info" },
|
|
295
|
+
/**
|
|
296
|
+
* @description tag effect
|
|
297
|
+
*/
|
|
298
|
+
tagEffect: { ...a.effect, default: "light" },
|
|
299
|
+
/**
|
|
300
|
+
* @description tabindex for input
|
|
301
|
+
*/
|
|
302
|
+
tabindex: {
|
|
303
|
+
type: [String, Number],
|
|
304
|
+
default: 0
|
|
305
|
+
},
|
|
306
|
+
/**
|
|
307
|
+
* @description which element the select dropdown appends to
|
|
308
|
+
*/
|
|
309
|
+
appendTo: o.appendTo,
|
|
310
|
+
/**
|
|
311
|
+
* @description if it is `true`, the width of the dropdown panel is the same as the input box.
|
|
312
|
+
* if it is `false`, the width is automatically calculated based on the value of `label`,
|
|
313
|
+
* or it can be set to a number to make it a fixed width
|
|
314
|
+
*/
|
|
315
|
+
fitInputWidth: {
|
|
316
|
+
type: [Boolean, Number],
|
|
317
|
+
default: !0,
|
|
318
|
+
validator(e) {
|
|
319
|
+
return n(e) || l(e);
|
|
320
|
+
}
|
|
321
|
+
},
|
|
322
|
+
suffixIcon: {
|
|
323
|
+
type: r,
|
|
324
|
+
default: y
|
|
325
|
+
},
|
|
326
|
+
...c,
|
|
327
|
+
...f,
|
|
328
|
+
...s(["ariaLabel"])
|
|
329
|
+
}), U = p({
|
|
330
|
+
data: Array,
|
|
331
|
+
disabled: Boolean,
|
|
332
|
+
hovering: Boolean,
|
|
333
|
+
item: {
|
|
334
|
+
type: t(Object),
|
|
335
|
+
required: !0
|
|
336
|
+
},
|
|
337
|
+
index: Number,
|
|
338
|
+
style: Object,
|
|
339
|
+
selected: Boolean,
|
|
340
|
+
created: Boolean
|
|
341
|
+
}), W = {
|
|
342
|
+
[m]: (e) => !0,
|
|
343
|
+
[u]: (e) => !0,
|
|
344
|
+
"end-reached": B["end-reached"],
|
|
345
|
+
"remove-tag": (e) => !0,
|
|
346
|
+
"visible-change": (e) => !0,
|
|
347
|
+
focus: (e) => e instanceof FocusEvent,
|
|
348
|
+
blur: (e) => e instanceof FocusEvent,
|
|
349
|
+
clear: () => !0
|
|
350
|
+
}, J = {
|
|
351
|
+
hover: (e) => l(e),
|
|
352
|
+
select: (e, v) => !0
|
|
353
|
+
};
|
|
354
|
+
export {
|
|
355
|
+
J as optionV2Emits,
|
|
356
|
+
U as optionV2Props,
|
|
357
|
+
W as selectV2Emits,
|
|
358
|
+
G as selectV2Props
|
|
359
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { CSSProperties, PropType } from 'vue';
|
|
2
|
+
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
3
|
+
item: {
|
|
4
|
+
type: ObjectConstructor;
|
|
5
|
+
required: true;
|
|
6
|
+
};
|
|
7
|
+
style: {
|
|
8
|
+
type: PropType<CSSProperties>;
|
|
9
|
+
};
|
|
10
|
+
height: NumberConstructor;
|
|
11
|
+
}>, {
|
|
12
|
+
ns: {
|
|
13
|
+
namespace: import("vue").ComputedRef<string>;
|
|
14
|
+
b: (blockSuffix?: string) => string;
|
|
15
|
+
e: (element?: string) => string;
|
|
16
|
+
m: (modifier?: string) => string;
|
|
17
|
+
be: (blockSuffix?: string, element?: string) => string;
|
|
18
|
+
em: (element?: string, modifier?: string) => string;
|
|
19
|
+
bm: (blockSuffix?: string, modifier?: string) => string;
|
|
20
|
+
bem: (blockSuffix?: string, element?: string, modifier?: string) => string;
|
|
21
|
+
is: {
|
|
22
|
+
(name: string, state: boolean | undefined): string;
|
|
23
|
+
(name: string): string;
|
|
24
|
+
};
|
|
25
|
+
cssVar: (object: Record<string, string>) => Record<string, string>;
|
|
26
|
+
cssVarName: (name: string) => string;
|
|
27
|
+
cssVarBlock: (object: Record<string, string>) => Record<string, string>;
|
|
28
|
+
cssVarBlockName: (name: string) => string;
|
|
29
|
+
};
|
|
30
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
31
|
+
item: {
|
|
32
|
+
type: ObjectConstructor;
|
|
33
|
+
required: true;
|
|
34
|
+
};
|
|
35
|
+
style: {
|
|
36
|
+
type: PropType<CSSProperties>;
|
|
37
|
+
};
|
|
38
|
+
height: NumberConstructor;
|
|
39
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
40
|
+
export default _default;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import t from "./group-item2.vue.js";
|
|
2
|
+
import { openBlock as o, createElementBlock as r, normalizeStyle as i, normalizeClass as l, toDisplayString as s } from "vue";
|
|
3
|
+
import n from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
function p(e, a, m, c, f, u) {
|
|
5
|
+
return o(), r("div", {
|
|
6
|
+
class: l(e.ns.be("group", "title")),
|
|
7
|
+
style: i({ ...e.style, lineHeight: `${e.height}px` })
|
|
8
|
+
}, s(e.item.label), 7);
|
|
9
|
+
}
|
|
10
|
+
const h = /* @__PURE__ */ n(t, [["render", p]]);
|
|
11
|
+
export {
|
|
12
|
+
h as default
|
|
13
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { defineComponent as t } from "vue";
|
|
2
|
+
import { useNamespace as e } from "../../../hooks/use-namespace/index.js";
|
|
3
|
+
import "@vue/shared";
|
|
4
|
+
import "lodash-unified";
|
|
5
|
+
import "@vueuse/core";
|
|
6
|
+
import "@element-plus/icons-vue";
|
|
7
|
+
import "../../../hooks/use-size/index.js";
|
|
8
|
+
import "@popperjs/core";
|
|
9
|
+
import "../../../hooks/use-z-index/index.js";
|
|
10
|
+
import "../../../hooks/use-delayed-toggle/index.js";
|
|
11
|
+
import "../../../hooks/use-aria/index.js";
|
|
12
|
+
import "../../../hooks/use-model-toggle/index.js";
|
|
13
|
+
import "../../../hooks/use-empty-values/index.js";
|
|
14
|
+
const y = t({
|
|
15
|
+
props: {
|
|
16
|
+
item: {
|
|
17
|
+
type: Object,
|
|
18
|
+
required: !0
|
|
19
|
+
},
|
|
20
|
+
style: {
|
|
21
|
+
type: Object
|
|
22
|
+
},
|
|
23
|
+
height: Number
|
|
24
|
+
},
|
|
25
|
+
setup() {
|
|
26
|
+
return {
|
|
27
|
+
ns: e("select")
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
export {
|
|
32
|
+
y as default
|
|
33
|
+
};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
2
|
+
readonly data: ArrayConstructor;
|
|
3
|
+
readonly disabled: BooleanConstructor;
|
|
4
|
+
readonly hovering: BooleanConstructor;
|
|
5
|
+
readonly item: {
|
|
6
|
+
readonly type: import("vue").PropType<import("./select.types").Option>;
|
|
7
|
+
readonly required: true;
|
|
8
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
9
|
+
__epPropKey: true;
|
|
10
|
+
};
|
|
11
|
+
readonly index: NumberConstructor;
|
|
12
|
+
readonly style: ObjectConstructor;
|
|
13
|
+
readonly selected: BooleanConstructor;
|
|
14
|
+
readonly created: BooleanConstructor;
|
|
15
|
+
}>, {
|
|
16
|
+
ns: {
|
|
17
|
+
namespace: import("vue").ComputedRef<string>;
|
|
18
|
+
b: (blockSuffix?: string) => string;
|
|
19
|
+
e: (element?: string) => string;
|
|
20
|
+
m: (modifier?: string) => string;
|
|
21
|
+
be: (blockSuffix?: string, element?: string) => string;
|
|
22
|
+
em: (element?: string, modifier?: string) => string;
|
|
23
|
+
bm: (blockSuffix?: string, modifier?: string) => string;
|
|
24
|
+
bem: (blockSuffix?: string, element?: string, modifier?: string) => string;
|
|
25
|
+
is: {
|
|
26
|
+
(name: string, state: boolean | undefined): string;
|
|
27
|
+
(name: string): string;
|
|
28
|
+
};
|
|
29
|
+
cssVar: (object: Record<string, string>) => Record<string, string>;
|
|
30
|
+
cssVarName: (name: string) => string;
|
|
31
|
+
cssVarBlock: (object: Record<string, string>) => Record<string, string>;
|
|
32
|
+
cssVarBlockName: (name: string) => string;
|
|
33
|
+
};
|
|
34
|
+
contentId: import("vue").Ref<string, string>;
|
|
35
|
+
mouseMoveEventName: string | null;
|
|
36
|
+
hoverItem: () => void;
|
|
37
|
+
handleMousedown: (event: MouseEvent) => void;
|
|
38
|
+
selectOptionClick: () => void;
|
|
39
|
+
getLabel: (option: import("./select.types").Option) => any;
|
|
40
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
41
|
+
hover: (index?: number) => index is number;
|
|
42
|
+
select: (val: import("./select.types").Option, index?: number) => boolean;
|
|
43
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
44
|
+
readonly data: ArrayConstructor;
|
|
45
|
+
readonly disabled: BooleanConstructor;
|
|
46
|
+
readonly hovering: BooleanConstructor;
|
|
47
|
+
readonly item: {
|
|
48
|
+
readonly type: import("vue").PropType<import("./select.types").Option>;
|
|
49
|
+
readonly required: true;
|
|
50
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
51
|
+
__epPropKey: true;
|
|
52
|
+
};
|
|
53
|
+
readonly index: NumberConstructor;
|
|
54
|
+
readonly style: ObjectConstructor;
|
|
55
|
+
readonly selected: BooleanConstructor;
|
|
56
|
+
readonly created: BooleanConstructor;
|
|
57
|
+
}>> & Readonly<{
|
|
58
|
+
onSelect?: ((val: import("./select.types").Option, index?: number | undefined) => any) | undefined;
|
|
59
|
+
onHover?: ((index?: number | undefined) => any) | undefined;
|
|
60
|
+
}>, {
|
|
61
|
+
readonly created: boolean;
|
|
62
|
+
readonly disabled: boolean;
|
|
63
|
+
readonly selected: boolean;
|
|
64
|
+
readonly hovering: boolean;
|
|
65
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
66
|
+
export default _default;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import i from "./option-item2.vue.js";
|
|
2
|
+
import { openBlock as d, createElementBlock as n, mergeProps as l, toHandlerKey as r, withModifiers as a, renderSlot as t, createElementVNode as m, toDisplayString as p } from "vue";
|
|
3
|
+
import f from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
const u = ["id", "aria-selected", "aria-disabled"];
|
|
5
|
+
function b(e, o, v, $, g, k) {
|
|
6
|
+
return d(), n("li", l({
|
|
7
|
+
id: `${e.contentId}-${e.index}`,
|
|
8
|
+
role: "option",
|
|
9
|
+
"aria-selected": e.selected,
|
|
10
|
+
"aria-disabled": e.disabled || void 0,
|
|
11
|
+
style: e.style,
|
|
12
|
+
class: [
|
|
13
|
+
e.ns.be("dropdown", "item"),
|
|
14
|
+
e.ns.is("selected", e.selected),
|
|
15
|
+
e.ns.is("disabled", e.disabled),
|
|
16
|
+
e.ns.is("created", e.created),
|
|
17
|
+
e.ns.is("hovering", e.hovering)
|
|
18
|
+
]
|
|
19
|
+
}, {
|
|
20
|
+
[r(e.mouseMoveEventName)]: o[0] || (o[0] = (...s) => e.hoverItem && e.hoverItem(...s))
|
|
21
|
+
}, {
|
|
22
|
+
onMousedown: o[1] || (o[1] = (...s) => e.handleMousedown && e.handleMousedown(...s)),
|
|
23
|
+
onClick: o[2] || (o[2] = a((...s) => e.selectOptionClick && e.selectOptionClick(...s), ["stop"]))
|
|
24
|
+
}), [
|
|
25
|
+
t(e.$slots, "default", {
|
|
26
|
+
item: e.item,
|
|
27
|
+
index: e.index,
|
|
28
|
+
disabled: e.disabled
|
|
29
|
+
}, () => [
|
|
30
|
+
m("span", null, p(e.getLabel(e.item)), 1)
|
|
31
|
+
])
|
|
32
|
+
], 16, u);
|
|
33
|
+
}
|
|
34
|
+
const I = /* @__PURE__ */ f(i, [["render", b]]);
|
|
35
|
+
export {
|
|
36
|
+
I as default
|
|
37
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { defineComponent as u, inject as f } from "vue";
|
|
2
|
+
import { useNamespace as d } from "../../../hooks/use-namespace/index.js";
|
|
3
|
+
import "@vue/shared";
|
|
4
|
+
import "lodash-unified";
|
|
5
|
+
import { isIOS as g } from "@vueuse/core";
|
|
6
|
+
import { isFocusable as I } from "../../../utils/dom/aria.js";
|
|
7
|
+
import "@element-plus/icons-vue";
|
|
8
|
+
import "../../../hooks/use-size/index.js";
|
|
9
|
+
import "@popperjs/core";
|
|
10
|
+
import "../../../hooks/use-z-index/index.js";
|
|
11
|
+
import "../../../hooks/use-delayed-toggle/index.js";
|
|
12
|
+
import "../../../hooks/use-aria/index.js";
|
|
13
|
+
import "../../../hooks/use-model-toggle/index.js";
|
|
14
|
+
import "../../../hooks/use-empty-values/index.js";
|
|
15
|
+
import { useOption as h } from "./useOption.js";
|
|
16
|
+
import { useProps as v } from "./useProps.js";
|
|
17
|
+
import { optionV2Emits as w, optionV2Props as E } from "./defaults.js";
|
|
18
|
+
import { selectV2InjectionKey as M } from "./token.js";
|
|
19
|
+
const A = u({
|
|
20
|
+
props: E,
|
|
21
|
+
emits: w,
|
|
22
|
+
setup(r, { emit: m }) {
|
|
23
|
+
const e = f(M), n = d("select"), p = g ? null : "mousemove", { hoverItem: s, selectOptionClick: i } = h(r, { emit: m }), { getLabel: c } = v(e.props), a = e.contentId;
|
|
24
|
+
return {
|
|
25
|
+
ns: n,
|
|
26
|
+
contentId: a,
|
|
27
|
+
mouseMoveEventName: p,
|
|
28
|
+
hoverItem: s,
|
|
29
|
+
handleMousedown: (o) => {
|
|
30
|
+
let t = o.target;
|
|
31
|
+
const l = o.currentTarget;
|
|
32
|
+
for (; t && t !== l; ) {
|
|
33
|
+
if (I(t))
|
|
34
|
+
return;
|
|
35
|
+
t = t.parentElement;
|
|
36
|
+
}
|
|
37
|
+
o.preventDefault();
|
|
38
|
+
},
|
|
39
|
+
selectOptionClick: i,
|
|
40
|
+
getLabel: c
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
export {
|
|
45
|
+
A as default
|
|
46
|
+
};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { ScrollbarDirection } from '@element-plus/components/scrollbar';
|
|
2
|
+
import type { DynamicSizeListInstance, FixedSizeListInstance } from '@element-plus/components/virtual-list';
|
|
3
|
+
import type { Option } from './select.types';
|
|
4
|
+
import type { ComponentPublicInstance, ComputedRef, ExtractPropTypes, Ref } from 'vue';
|
|
5
|
+
declare const props: {
|
|
6
|
+
loading: BooleanConstructor;
|
|
7
|
+
data: {
|
|
8
|
+
type: ArrayConstructor;
|
|
9
|
+
required: true;
|
|
10
|
+
};
|
|
11
|
+
hoveringIndex: NumberConstructor;
|
|
12
|
+
width: NumberConstructor;
|
|
13
|
+
id: StringConstructor;
|
|
14
|
+
ariaLabel: StringConstructor;
|
|
15
|
+
};
|
|
16
|
+
interface SelectDropdownExposed {
|
|
17
|
+
listRef: Ref<FixedSizeListInstance | DynamicSizeListInstance | undefined>;
|
|
18
|
+
isSized: ComputedRef<boolean>;
|
|
19
|
+
isItemDisabled: (modelValue: any[] | any, selected: boolean) => boolean;
|
|
20
|
+
isItemHovering: (target: number) => boolean;
|
|
21
|
+
isItemSelected: (modelValue: any[] | any, target: Option) => boolean;
|
|
22
|
+
scrollToItem: (index: number) => void;
|
|
23
|
+
resetScrollTop: () => void;
|
|
24
|
+
}
|
|
25
|
+
export type SelectDropdownInstance = ComponentPublicInstance<ExtractPropTypes<typeof props>, SelectDropdownExposed>;
|
|
26
|
+
declare const _default: import("vue").DefineComponent<ExtractPropTypes<{
|
|
27
|
+
loading: BooleanConstructor;
|
|
28
|
+
data: {
|
|
29
|
+
type: ArrayConstructor;
|
|
30
|
+
required: true;
|
|
31
|
+
};
|
|
32
|
+
hoveringIndex: NumberConstructor;
|
|
33
|
+
width: NumberConstructor;
|
|
34
|
+
id: StringConstructor;
|
|
35
|
+
ariaLabel: StringConstructor;
|
|
36
|
+
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
37
|
+
'end-reached': (direction: ScrollbarDirection) => boolean;
|
|
38
|
+
}, string, import("vue").PublicProps, Readonly<ExtractPropTypes<{
|
|
39
|
+
loading: BooleanConstructor;
|
|
40
|
+
data: {
|
|
41
|
+
type: ArrayConstructor;
|
|
42
|
+
required: true;
|
|
43
|
+
};
|
|
44
|
+
hoveringIndex: NumberConstructor;
|
|
45
|
+
width: NumberConstructor;
|
|
46
|
+
id: StringConstructor;
|
|
47
|
+
ariaLabel: StringConstructor;
|
|
48
|
+
}>> & Readonly<{
|
|
49
|
+
"onEnd-reached"?: ((direction: ScrollbarDirection) => any) | undefined;
|
|
50
|
+
}>, {
|
|
51
|
+
loading: boolean;
|
|
52
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
53
|
+
export default _default;
|