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,209 @@
|
|
|
1
|
+
import { defineComponent as Q, inject as W, ref as K, computed as y, watch as X, unref as S, createVNode as l, mergeProps as L, toRaw as Y } from "vue";
|
|
2
|
+
import { get as v } from "lodash-unified";
|
|
3
|
+
import { isUndefined as Z } from "../../../utils/types.js";
|
|
4
|
+
import { isIOS as ee } from "@vueuse/core";
|
|
5
|
+
import { isObject as N } from "@vue/shared";
|
|
6
|
+
import { getEventCode as te } from "../../../utils/dom/event.js";
|
|
7
|
+
import "@element-plus/icons-vue";
|
|
8
|
+
import { EVENT_CODE as oe } from "../../../constants/aria.js";
|
|
9
|
+
import re from "../../virtual-list/src/components/fixed-size-list.js";
|
|
10
|
+
import ie from "../../virtual-list/src/components/dynamic-size-list.js";
|
|
11
|
+
import "../../virtual-list/src/props.js";
|
|
12
|
+
import { useNamespace as ne } from "../../../hooks/use-namespace/index.js";
|
|
13
|
+
import "../../../hooks/use-size/index.js";
|
|
14
|
+
import "@popperjs/core";
|
|
15
|
+
import "../../../hooks/use-z-index/index.js";
|
|
16
|
+
import "../../../hooks/use-delayed-toggle/index.js";
|
|
17
|
+
import "../../../hooks/use-aria/index.js";
|
|
18
|
+
import "../../../hooks/use-model-toggle/index.js";
|
|
19
|
+
import "../../../hooks/use-empty-values/index.js";
|
|
20
|
+
import ae from "./group-item.vue.js";
|
|
21
|
+
import ce from "./option-item.vue.js";
|
|
22
|
+
import { useProps as se } from "./useProps.js";
|
|
23
|
+
import { selectV2InjectionKey as de } from "./token.js";
|
|
24
|
+
import "../../scrollbar/index.js";
|
|
25
|
+
import { scrollbarEmits as me } from "../../scrollbar/src/scrollbar.js";
|
|
26
|
+
const le = {
|
|
27
|
+
loading: Boolean,
|
|
28
|
+
data: {
|
|
29
|
+
type: Array,
|
|
30
|
+
required: !0
|
|
31
|
+
},
|
|
32
|
+
hoveringIndex: Number,
|
|
33
|
+
width: Number,
|
|
34
|
+
id: String,
|
|
35
|
+
ariaLabel: String
|
|
36
|
+
}, qe = /* @__PURE__ */ Q({
|
|
37
|
+
name: "ElSelectDropdown",
|
|
38
|
+
props: le,
|
|
39
|
+
emits: {
|
|
40
|
+
"end-reached": me["end-reached"]
|
|
41
|
+
},
|
|
42
|
+
setup(p, {
|
|
43
|
+
slots: o,
|
|
44
|
+
expose: T,
|
|
45
|
+
emit: k
|
|
46
|
+
}) {
|
|
47
|
+
const r = W(de), w = ne("select"), {
|
|
48
|
+
getLabel: P,
|
|
49
|
+
getValue: I,
|
|
50
|
+
getDisabled: R
|
|
51
|
+
} = se(r.props), A = K([]), u = K(), V = y(() => p.data.length);
|
|
52
|
+
X(() => V.value, () => {
|
|
53
|
+
var e, t;
|
|
54
|
+
(t = (e = r.tooltipRef.value) == null ? void 0 : e.updatePopper) == null || t.call(e);
|
|
55
|
+
});
|
|
56
|
+
const f = y(() => Z(r.props.estimatedOptionHeight)), E = y(() => f.value ? {
|
|
57
|
+
itemSize: r.props.itemHeight
|
|
58
|
+
} : {
|
|
59
|
+
estimatedSize: r.props.estimatedOptionHeight,
|
|
60
|
+
itemSize: (e) => A.value[e]
|
|
61
|
+
}), j = (e = [], t) => {
|
|
62
|
+
const {
|
|
63
|
+
props: {
|
|
64
|
+
valueKey: i
|
|
65
|
+
}
|
|
66
|
+
} = r;
|
|
67
|
+
return N(t) ? e && e.some((n) => Y(v(n, i)) === v(t, i)) : e.includes(t);
|
|
68
|
+
}, C = (e, t) => {
|
|
69
|
+
if (N(t)) {
|
|
70
|
+
const {
|
|
71
|
+
valueKey: i
|
|
72
|
+
} = r.props;
|
|
73
|
+
return v(e, i) === v(t, i);
|
|
74
|
+
} else
|
|
75
|
+
return e === t;
|
|
76
|
+
}, z = (e, t) => r.props.multiple ? j(e, I(t)) : C(e, I(t)), x = (e, t) => {
|
|
77
|
+
const {
|
|
78
|
+
disabled: i,
|
|
79
|
+
multiple: n,
|
|
80
|
+
multipleLimit: c
|
|
81
|
+
} = r.props;
|
|
82
|
+
return i || !t && (n ? c > 0 && e.length >= c : !1);
|
|
83
|
+
}, O = (e) => p.hoveringIndex === e;
|
|
84
|
+
T({
|
|
85
|
+
listRef: u,
|
|
86
|
+
isSized: f,
|
|
87
|
+
isItemDisabled: x,
|
|
88
|
+
isItemHovering: O,
|
|
89
|
+
isItemSelected: z,
|
|
90
|
+
scrollToItem: (e) => {
|
|
91
|
+
const t = u.value;
|
|
92
|
+
t && t.scrollToItem(e);
|
|
93
|
+
},
|
|
94
|
+
resetScrollTop: () => {
|
|
95
|
+
const e = u.value;
|
|
96
|
+
e && e.resetScrollTop();
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
const q = (e) => {
|
|
100
|
+
const {
|
|
101
|
+
index: t,
|
|
102
|
+
data: i,
|
|
103
|
+
style: n
|
|
104
|
+
} = e, c = S(f), {
|
|
105
|
+
itemSize: d,
|
|
106
|
+
estimatedSize: m
|
|
107
|
+
} = S(E), {
|
|
108
|
+
modelValue: s
|
|
109
|
+
} = r.props, {
|
|
110
|
+
onSelect: h,
|
|
111
|
+
onHover: b
|
|
112
|
+
} = r, a = i[t];
|
|
113
|
+
if (a.type === "Group")
|
|
114
|
+
return l(ae, {
|
|
115
|
+
item: a,
|
|
116
|
+
style: n,
|
|
117
|
+
height: c ? d : m
|
|
118
|
+
}, null);
|
|
119
|
+
const g = z(s, a), _ = x(s, g), $ = O(t);
|
|
120
|
+
return l(ce, L(e, {
|
|
121
|
+
selected: g,
|
|
122
|
+
disabled: R(a) || _,
|
|
123
|
+
created: !!a.created,
|
|
124
|
+
hovering: $,
|
|
125
|
+
item: a,
|
|
126
|
+
onSelect: h,
|
|
127
|
+
onHover: b
|
|
128
|
+
}), {
|
|
129
|
+
default: (J) => {
|
|
130
|
+
var D;
|
|
131
|
+
return ((D = o.default) == null ? void 0 : D.call(o, J)) || l("span", null, [P(a)]);
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
}, {
|
|
135
|
+
onKeyboardNavigate: H,
|
|
136
|
+
onKeyboardSelect: B
|
|
137
|
+
} = r, F = () => {
|
|
138
|
+
H("forward");
|
|
139
|
+
}, G = () => {
|
|
140
|
+
H("backward");
|
|
141
|
+
}, M = (e) => {
|
|
142
|
+
const t = te(e), {
|
|
143
|
+
tab: i,
|
|
144
|
+
esc: n,
|
|
145
|
+
down: c,
|
|
146
|
+
up: d,
|
|
147
|
+
enter: m,
|
|
148
|
+
numpadEnter: s
|
|
149
|
+
} = oe;
|
|
150
|
+
switch ([n, c, d, m, s].includes(t) && (e.preventDefault(), e.stopPropagation()), t) {
|
|
151
|
+
case i:
|
|
152
|
+
case n:
|
|
153
|
+
break;
|
|
154
|
+
case c:
|
|
155
|
+
F();
|
|
156
|
+
break;
|
|
157
|
+
case d:
|
|
158
|
+
G();
|
|
159
|
+
break;
|
|
160
|
+
case m:
|
|
161
|
+
case s:
|
|
162
|
+
B();
|
|
163
|
+
break;
|
|
164
|
+
}
|
|
165
|
+
}, U = (e) => {
|
|
166
|
+
k("end-reached", e);
|
|
167
|
+
};
|
|
168
|
+
return () => {
|
|
169
|
+
var s, h, b, a;
|
|
170
|
+
const {
|
|
171
|
+
data: e,
|
|
172
|
+
width: t
|
|
173
|
+
} = p, {
|
|
174
|
+
height: i,
|
|
175
|
+
multiple: n,
|
|
176
|
+
scrollbarAlwaysOn: c
|
|
177
|
+
} = r.props, d = ee ? !0 : c, m = S(f) ? re : ie;
|
|
178
|
+
return l("div", {
|
|
179
|
+
class: [w.b("dropdown"), w.is("multiple", n)],
|
|
180
|
+
style: {
|
|
181
|
+
width: `${t}px`
|
|
182
|
+
}
|
|
183
|
+
}, [(s = o.header) == null ? void 0 : s.call(o), ((h = o.loading) == null ? void 0 : h.call(o)) || ((b = o.empty) == null ? void 0 : b.call(o)) || l(m, L({
|
|
184
|
+
ref: u
|
|
185
|
+
}, S(E), {
|
|
186
|
+
className: w.be("dropdown", "list"),
|
|
187
|
+
scrollbarAlwaysOn: d,
|
|
188
|
+
data: e,
|
|
189
|
+
height: i,
|
|
190
|
+
width: t,
|
|
191
|
+
total: e.length,
|
|
192
|
+
innerElement: "ul",
|
|
193
|
+
innerProps: {
|
|
194
|
+
id: p.id,
|
|
195
|
+
role: "listbox",
|
|
196
|
+
"aria-label": p.ariaLabel,
|
|
197
|
+
"aria-orientation": "vertical"
|
|
198
|
+
},
|
|
199
|
+
onEndReached: U,
|
|
200
|
+
onKeydown: M
|
|
201
|
+
}), {
|
|
202
|
+
default: (g) => l(q, g, null)
|
|
203
|
+
}), (a = o.footer) == null ? void 0 : a.call(o)]);
|
|
204
|
+
};
|
|
205
|
+
}
|
|
206
|
+
});
|
|
207
|
+
export {
|
|
208
|
+
qe as default
|
|
209
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
type OptionCommon = Record<string, any>;
|
|
2
2
|
export type Option = OptionCommon & {
|
|
3
3
|
created?: boolean;
|
|
4
4
|
};
|
|
@@ -23,3 +23,4 @@ export type SelectStates = {
|
|
|
23
23
|
menuVisibleOnFocus: boolean;
|
|
24
24
|
isBeforeHide: boolean;
|
|
25
25
|
};
|
|
26
|
+
export {};
|