ep-craft 0.1.41 → 0.1.42

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.
@@ -1,17 +1,17 @@
1
- import { defineComponent as he, ref as Q, reactive as Ve, computed as N, toRef as Y, watch as Z, onMounted as ye, onUpdated as Ee, openBlock as b, createElementBlock as w, withModifiers as ge, normalizeClass as I, unref as r, toDisplayString as xe, createCommentVNode as R, withDirectives as _, withKeys as ee, renderSlot as S, createVNode as $, withCtx as A, createBlock as F, createSlots as we } from "vue";
2
- import { isNil as k } from "lodash-unified";
1
+ import { defineComponent as he, ref as Q, reactive as Ve, computed as N, toRef as Y, watch as Z, onMounted as ye, onUpdated as Ee, openBlock as b, createElementBlock as w, withModifiers as ge, normalizeClass as I, unref as n, toDisplayString as xe, createCommentVNode as R, withDirectives as _, withKeys as ee, renderSlot as S, createVNode as $, withCtx as A, createBlock as L, createSlots as we } from "vue";
2
+ import { isNil as F } from "lodash-unified";
3
3
  import { EpInput as Ie } from "../input/index.js";
4
4
  import { ElIcon as te } from "../icon/index.js";
5
5
  import { vRepeatClick as ae } from "../../directives/repeat-click/index.js";
6
6
  import { useNamespace as Se } from "../../hooks/use-namespace/index.js";
7
7
  import { useLocale as Ae } from "../../hooks/use-locale/index.js";
8
- import { useId as Fe } from "../../hooks/use-id/index.js";
8
+ import { useId as Le } from "../../hooks/use-id/index.js";
9
9
  import "../../hooks/use-size/index.js";
10
10
  import "../../hooks/use-aria/index.js";
11
- import { useFloatLabel as ke } from "../../hooks/use-float-label/index.js";
12
- import { debugWarn as z, throwError as Le } from "../../utils/error.js";
13
- import { isString as Ce, NOOP as ne } from "@vue/shared";
14
- import { isNumber as h, isUndefined as L } from "../../utils/types.js";
11
+ import { useFloatLabel as Fe } from "../../hooks/use-float-label/index.js";
12
+ import { debugWarn as z, throwError as ke } from "../../utils/error.js";
13
+ import { isString as Ce, NOOP as re } from "@vue/shared";
14
+ import { isNumber as h, isUndefined as k } from "../../utils/types.js";
15
15
  import { getEventCode as De, getEventKey as Me } from "../../utils/dom/event.js";
16
16
  import { ArrowDown as Pe, Minus as Te, ArrowUp as Be, Plus as Oe } from "@element-plus/icons-vue";
17
17
  import { EVENT_CODE as le } from "../../constants/aria.js";
@@ -40,6 +40,7 @@ const Ue = ["id"], We = ["aria-label"], Xe = ["aria-label"], ft = /* @__PURE__ *
40
40
  precision: {},
41
41
  validateEvent: { type: Boolean, default: !0 },
42
42
  ariaLabel: {},
43
+ ariaLabelledby: {},
43
44
  inputmode: { default: void 0 },
44
45
  align: { default: "center" },
45
46
  disabledScientific: { type: Boolean },
@@ -49,7 +50,7 @@ const Ue = ["id"], We = ["aria-label"], Xe = ["aria-label"], ft = /* @__PURE__ *
49
50
  floatLabel: { type: Boolean }
50
51
  },
51
52
  emits: $e,
52
- setup(u, { expose: re, emit: ie }) {
53
+ setup(u, { expose: ne, emit: ie }) {
53
54
  const a = u, s = ie, { t: G } = Ae(), c = Se("input-number"), p = Q(), i = Ve({
54
55
  currentValue: a.modelValue,
55
56
  userInput: null
@@ -59,40 +60,38 @@ const Ue = ["id"], We = ["aria-label"], Xe = ["aria-label"], ft = /* @__PURE__ *
59
60
  () => h(a.modelValue) && a.modelValue >= a.max
60
61
  ), ue = N(() => {
61
62
  const e = j(a.step);
62
- return L(a.precision) ? Math.max(j(a.modelValue), e) : (e > a.precision && z(
63
+ return k(a.precision) ? Math.max(j(a.modelValue), e) : (e > a.precision && z(
63
64
  "InputNumber",
64
65
  "precision should not be less than the decimal places of step"
65
66
  ), a.precision);
66
- }), C = N(() => a.controls && a.controlsPosition === "right"), X = Ke(), v = Ge(), D = Q(!1), oe = N(() => !k(i.currentValue)), { floatLabelClass: se } = ke({
67
+ }), C = N(() => a.controls && a.controlsPosition === "right"), X = Ke(), v = Ge(), D = Q(!1), oe = N(() => !F(i.currentValue)), { floatLabelClass: se } = Fe({
67
68
  floatLabel: Y(a, "floatLabel"),
68
69
  isFocused: D,
69
70
  hasValue: oe,
70
71
  isDisabled: v,
71
72
  isReadonly: Y(a, "readonly")
72
- }), H = Fe(), ce = N(
73
- () => a.floatLabel && a.placeholder && !a.ariaLabel ? H.value : void 0
74
- ), M = N(() => {
73
+ }), H = Le(), ce = N(() => a.ariaLabelledby ? a.ariaLabelledby : a.floatLabel && a.placeholder && !a.ariaLabel ? H.value : void 0), M = N(() => {
75
74
  if (i.userInput !== null)
76
75
  return i.userInput;
77
76
  let e = i.currentValue;
78
- if (k(e)) return "";
77
+ if (F(e)) return "";
79
78
  if (h(e)) {
80
79
  if (Number.isNaN(e)) return "";
81
- L(a.precision) || (e = e.toFixed(a.precision));
80
+ k(a.precision) || (e = e.toFixed(a.precision));
82
81
  }
83
82
  return e;
84
83
  }), y = (e, t) => {
85
- if (L(t) && (t = ue.value), t === 0) return Math.round(e);
86
- let n = String(e);
87
- const l = n.indexOf(".");
88
- if (l === -1 || !n.replace(".", "").split("")[l + t]) return e;
89
- const g = n.length;
90
- return n.charAt(g - 1) === "5" && (n = `${n.slice(0, Math.max(0, g - 1))}6`), Number.parseFloat(Number(n).toFixed(t));
84
+ if (k(t) && (t = ue.value), t === 0) return Math.round(e);
85
+ let r = String(e);
86
+ const l = r.indexOf(".");
87
+ if (l === -1 || !r.replace(".", "").split("")[l + t]) return e;
88
+ const g = r.length;
89
+ return r.charAt(g - 1) === "5" && (r = `${r.slice(0, Math.max(0, g - 1))}6`), Number.parseFloat(Number(r).toFixed(t));
91
90
  }, j = (e) => {
92
- if (k(e)) return 0;
93
- const t = e.toString(), n = t.indexOf(".");
91
+ if (F(e)) return 0;
92
+ const t = e.toString(), r = t.indexOf(".");
94
93
  let l = 0;
95
- return n !== -1 && (l = t.length - n - 1), l;
94
+ return r !== -1 && (l = t.length - r - 1), l;
96
95
  }, q = (e, t = 1) => h(e) ? e >= Number.MAX_SAFE_INTEGER && t === 1 ? (z(
97
96
  "InputNumber",
98
97
  "The value has reached the maximum safe integer limit."
@@ -100,8 +99,8 @@ const Ue = ["id"], We = ["aria-label"], Xe = ["aria-label"], ft = /* @__PURE__ *
100
99
  "InputNumber",
101
100
  "The value has reached the minimum safe integer limit."
102
101
  ), e) : y(e + a.step * t) : i.currentValue, de = (e) => {
103
- const t = De(e), n = Me(e);
104
- if (a.disabledScientific && ["e", "E"].includes(n)) {
102
+ const t = De(e), r = Me(e);
103
+ if (a.disabledScientific && ["e", "E"].includes(r)) {
105
104
  e.preventDefault();
106
105
  return;
107
106
  }
@@ -124,28 +123,28 @@ const Ue = ["id"], We = ["aria-label"], Xe = ["aria-label"], ft = /* @__PURE__ *
124
123
  const e = Number(M.value) || 0, t = q(e, -1);
125
124
  E(t), s(K, i.currentValue), O();
126
125
  }, B = (e, t) => {
127
- const { max: n, min: l, step: m, precision: f, stepStrictly: g, valueOnClear: x } = a;
128
- n < l && Le("InputNumber", "min should not be greater than max.");
126
+ const { max: r, min: l, step: m, precision: f, stepStrictly: g, valueOnClear: x } = a;
127
+ r < l && ke("InputNumber", "min should not be greater than max.");
129
128
  let o = e ? Number.parseFloat(String(e)) : Number(e);
130
- if (k(e) || Number.isNaN(o))
129
+ if (F(e) || Number.isNaN(o))
131
130
  return null;
132
131
  if (e === "") {
133
132
  if (x === null)
134
133
  return null;
135
- o = Ce(x) ? { min: l, max: n }[x] : x;
134
+ o = Ce(x) ? { min: l, max: r }[x] : x;
136
135
  }
137
136
  return g && (o = y(
138
137
  Math.round(y(o / m)) * m,
139
138
  f
140
- ), o !== e && t && s(V, o)), L(f) || (o = y(o, f)), (o > n || o < l) && (o = o > n ? n : l, t && s(V, o)), o;
139
+ ), o !== e && t && s(V, o)), k(f) || (o = y(o, f)), (o > r || o < l) && (o = o > r ? r : l, t && s(V, o)), o;
141
140
  }, E = (e, t = !0) => {
142
141
  var m;
143
- const n = i.currentValue, l = B(e);
142
+ const r = i.currentValue, l = B(e);
144
143
  if (!t) {
145
144
  s(V, l);
146
145
  return;
147
146
  }
148
- i.userInput = null, !(n === l && e) && (s(V, l), n !== l && s(Re, l, n), a.validateEvent && ((m = d == null ? void 0 : d.validate) == null || m.call(d, "change").catch(ne)), i.currentValue = l);
147
+ i.userInput = null, !(r === l && e) && (s(V, l), r !== l && s(Re, l, r), a.validateEvent && ((m = d == null ? void 0 : d.validate) == null || m.call(d, "change").catch(re)), i.currentValue = l);
149
148
  }, me = (e) => {
150
149
  i.userInput = e;
151
150
  let t = e === "" ? null : Number.parseFloat(e);
@@ -162,8 +161,8 @@ const Ue = ["id"], We = ["aria-label"], Xe = ["aria-label"], ft = /* @__PURE__ *
162
161
  }, pe = (e) => {
163
162
  D.value = !0, s("focus", e);
164
163
  }, Ne = (e) => {
165
- var t, n, l;
166
- D.value = !1, i.userInput = null, i.currentValue === null && ((t = p.value) != null && t.input) && (p.value.input.value = ((n = a.formatter) == null ? void 0 : n.call(a, "")) ?? ""), s("blur", e), a.validateEvent && ((l = d == null ? void 0 : d.validate) == null || l.call(d, "blur").catch(ne));
164
+ var t, r, l;
165
+ D.value = !1, i.userInput = null, i.currentValue === null && ((t = p.value) != null && t.input) && (p.value.input.value = ((r = a.formatter) == null ? void 0 : r.call(a, "")) ?? ""), s("blur", e), a.validateEvent && ((l = d == null ? void 0 : d.validate) == null || l.call(d, "blur").catch(re));
167
166
  }, O = () => {
168
167
  i.currentValue !== a.modelValue && (i.currentValue = a.modelValue);
169
168
  }, ve = (e) => {
@@ -172,8 +171,8 @@ const Ue = ["id"], We = ["aria-label"], Xe = ["aria-label"], ft = /* @__PURE__ *
172
171
  return Z(
173
172
  () => a.modelValue,
174
173
  (e, t) => {
175
- const n = B(e, !0);
176
- i.userInput === null && n !== t && (i.currentValue = n);
174
+ const r = B(e, !0);
175
+ i.userInput === null && r !== t && (i.currentValue = r);
177
176
  },
178
177
  { immediate: !0 }
179
178
  ), Z(
@@ -183,12 +182,12 @@ const Ue = ["id"], We = ["aria-label"], Xe = ["aria-label"], ft = /* @__PURE__ *
183
182
  }
184
183
  ), ye(() => {
185
184
  var m;
186
- const { min: e, max: t, modelValue: n } = a, l = (m = p.value) == null ? void 0 : m.input;
185
+ const { min: e, max: t, modelValue: r } = a, l = (m = p.value) == null ? void 0 : m.input;
187
186
  if (l.setAttribute("role", "spinbutton"), Number.isFinite(t) ? l.setAttribute("aria-valuemax", String(t)) : l.removeAttribute("aria-valuemax"), Number.isFinite(e) ? l.setAttribute("aria-valuemin", String(e)) : l.removeAttribute("aria-valuemin"), l.setAttribute(
188
187
  "aria-valuenow",
189
188
  i.currentValue || i.currentValue === 0 ? String(i.currentValue) : ""
190
- ), l.setAttribute("aria-disabled", String(v.value)), !h(n) && n != null) {
191
- let f = Number(n);
189
+ ), l.setAttribute("aria-disabled", String(v.value)), !h(r) && r != null) {
190
+ let f = Number(r);
192
191
  Number.isNaN(f) && (f = null), s(V, f);
193
192
  }
194
193
  l.addEventListener("wheel", ve, { passive: !1 });
@@ -196,67 +195,67 @@ const Ue = ["id"], We = ["aria-label"], Xe = ["aria-label"], ft = /* @__PURE__ *
196
195
  var t;
197
196
  const e = (t = p.value) == null ? void 0 : t.input;
198
197
  e == null || e.setAttribute("aria-valuenow", `${i.currentValue ?? ""}`);
199
- }), re({
198
+ }), ne({
200
199
  /** @description get focus the input component */
201
200
  focus: J,
202
201
  /** @description remove focus the input component */
203
202
  blur: be
204
203
  }), (e, t) => (b(), w("div", {
205
204
  class: I([
206
- r(c).b(),
207
- r(c).m(r(X)),
208
- r(c).is("disabled", r(v)),
209
- r(c).is("without-controls", !u.controls),
210
- r(c).is("controls-right", C.value),
211
- r(c).is(u.align, !!u.align),
212
- r(c).is("float-label", a.floatLabel)
205
+ n(c).b(),
206
+ n(c).m(n(X)),
207
+ n(c).is("disabled", n(v)),
208
+ n(c).is("without-controls", !u.controls),
209
+ n(c).is("controls-right", C.value),
210
+ n(c).is(u.align, !!u.align),
211
+ n(c).is("float-label", a.floatLabel)
213
212
  ]),
214
213
  onDragstart: t[0] || (t[0] = ge(() => {
215
214
  }, ["prevent"]))
216
215
  }, [
217
216
  a.floatLabel ? (b(), w("span", {
218
217
  key: 0,
219
- id: r(H),
220
- class: I(["el-float-label", r(se)]),
218
+ id: n(H),
219
+ class: I(["el-float-label", n(se)]),
221
220
  onClick: J
222
221
  }, xe(u.placeholder), 11, Ue)) : R("", !0),
223
222
  u.controls ? _((b(), w("span", {
224
223
  key: 1,
225
224
  role: "button",
226
- "aria-label": r(G)("el.inputNumber.decrease"),
227
- class: I([r(c).e("decrease"), r(c).is("disabled", U.value)]),
225
+ "aria-label": n(G)("el.inputNumber.decrease"),
226
+ class: I([n(c).e("decrease"), n(c).is("disabled", U.value)]),
228
227
  onKeydown: ee(T, ["enter"])
229
228
  }, [
230
229
  S(e.$slots, "decrease-icon", {}, () => [
231
- $(r(te), null, {
230
+ $(n(te), null, {
232
231
  default: A(() => [
233
- C.value ? (b(), F(r(Pe), { key: 0 })) : (b(), F(r(Te), { key: 1 }))
232
+ C.value ? (b(), L(n(Pe), { key: 0 })) : (b(), L(n(Te), { key: 1 }))
234
233
  ]),
235
234
  _: 1
236
235
  })
237
236
  ])
238
237
  ], 42, We)), [
239
- [r(ae), T]
238
+ [n(ae), T]
240
239
  ]) : R("", !0),
241
240
  u.controls ? _((b(), w("span", {
242
241
  key: 2,
243
242
  role: "button",
244
- "aria-label": r(G)("el.inputNumber.increase"),
245
- class: I([r(c).e("increase"), r(c).is("disabled", W.value)]),
243
+ "aria-label": n(G)("el.inputNumber.increase"),
244
+ class: I([n(c).e("increase"), n(c).is("disabled", W.value)]),
246
245
  onKeydown: ee(P, ["enter"])
247
246
  }, [
248
247
  S(e.$slots, "increase-icon", {}, () => [
249
- $(r(te), null, {
248
+ $(n(te), null, {
250
249
  default: A(() => [
251
- C.value ? (b(), F(r(Be), { key: 0 })) : (b(), F(r(Oe), { key: 1 }))
250
+ C.value ? (b(), L(n(Be), { key: 0 })) : (b(), L(n(Oe), { key: 1 }))
252
251
  ]),
253
252
  _: 1
254
253
  })
255
254
  ])
256
255
  ], 42, Xe)), [
257
- [r(ae), P]
256
+ [n(ae), P]
258
257
  ]) : R("", !0),
259
- $(r(Ie), {
258
+ $(n(Ie), {
260
259
  id: u.id,
261
260
  ref_key: "input",
262
261
  ref: p,
@@ -265,8 +264,8 @@ const Ue = ["id"], We = ["aria-label"], Xe = ["aria-label"], ft = /* @__PURE__ *
265
264
  "model-value": M.value,
266
265
  placeholder: a.floatLabel ? void 0 : u.placeholder,
267
266
  readonly: u.readonly,
268
- disabled: r(v),
269
- size: r(X),
267
+ disabled: n(v),
268
+ size: n(X),
270
269
  max: u.max,
271
270
  min: u.min,
272
271
  name: u.name,
@@ -72,6 +72,10 @@ export interface InputNumberProps {
72
72
  * @description native aria-label attribute
73
73
  */
74
74
  ariaLabel?: string;
75
+ /**
76
+ * @description native aria-labelledby attribute
77
+ */
78
+ ariaLabelledby?: string;
75
79
  /**
76
80
  * @description native input mode for virtual keyboards
77
81
  */
@@ -123,6 +127,7 @@ export declare const inputNumberProps: {
123
127
  };
124
128
  readonly tabindex: import("../../utils/index.js").EpPropFinalized<readonly [StringConstructor, NumberConstructor], unknown, unknown, 0, boolean>;
125
129
  readonly ariaLabel: StringConstructor;
130
+ readonly ariaLabelledby: StringConstructor;
126
131
  readonly id: import("../../utils/index.js").EpPropFinalized<StringConstructor, unknown, unknown, undefined, boolean>;
127
132
  readonly step: import("../../utils/index.js").EpPropFinalized<NumberConstructor, unknown, unknown, 1, boolean>;
128
133
  readonly stepStrictly: BooleanConstructor;
@@ -3,9 +3,9 @@ import { isNumber as r } from "../../utils/types.js";
3
3
  import { buildProps as n, definePropType as t } from "../../utils/vue/props/runtime.js";
4
4
  import "vue";
5
5
  import "@vueuse/core";
6
- import { useSizeProp as u } from "../../hooks/use-size/index.js";
7
- import { useAriaProps as l } from "../../hooks/use-aria/index.js";
8
- import { floatLabelProp as a } from "../../hooks/use-float-label/index.js";
6
+ import { useSizeProp as l } from "../../hooks/use-size/index.js";
7
+ import { useAriaProps as a } from "../../hooks/use-aria/index.js";
8
+ import { floatLabelProp as u } from "../../hooks/use-float-label/index.js";
9
9
  import { UPDATE_MODEL_EVENT as p, INPUT_EVENT as m, CHANGE_EVENT as d } from "../../constants/event.js";
10
10
  n({
11
11
  /**
@@ -60,7 +60,7 @@ n({
60
60
  /**
61
61
  * @description size of the component
62
62
  */
63
- size: u,
63
+ size: l,
64
64
  /**
65
65
  * @description whether to enable the control buttons
66
66
  */
@@ -106,7 +106,7 @@ n({
106
106
  type: Boolean,
107
107
  default: !0
108
108
  },
109
- ...l(["ariaLabel"]),
109
+ ...a(["ariaLabel", "ariaLabelledby"]),
110
110
  /**
111
111
  * @description native input mode for virtual keyboards
112
112
  */
@@ -144,7 +144,7 @@ n({
144
144
  type: [String, Number],
145
145
  default: 0
146
146
  },
147
- ...a
147
+ ...u
148
148
  });
149
149
  const P = {
150
150
  [d]: (e, i) => i !== e,
@@ -5,6 +5,7 @@ export default EpSelect;
5
5
  export declare const ElSelect: {
6
6
  new (...args: any[]): import("vue").CreateComponentPublicInstanceWithMixins<Readonly<import("vue").ExtractPropTypes<{
7
7
  ariaLabel: StringConstructor;
8
+ ariaLabelledby: StringConstructor;
8
9
  emptyValues: ArrayConstructor;
9
10
  valueOnClear: import("../../utils/index.js").EpPropFinalized<(new (...args: any[]) => string | number | boolean | Function) | (() => string | number | boolean | Function | null) | (((new (...args: any[]) => string | number | boolean | Function) | (() => string | number | boolean | Function | null)) | null)[], unknown, unknown, undefined, boolean>;
10
11
  floatLabel: import("../../utils/index.js").EpPropFinalized<BooleanConstructor, unknown, unknown, false, boolean>;
@@ -111,7 +112,7 @@ export declare const ElSelect: {
111
112
  floatLabelClass: import("vue").ComputedRef<import("../../hooks/index.js").FloatLabelClass>;
112
113
  floatLabelText: import("vue").ComputedRef<string>;
113
114
  floatLabelId: import("vue").Ref<string, string>;
114
- floatLabelAriaLabelledby: import("vue").ComputedRef<string | undefined>;
115
+ ariaLabelledbyValue: import("vue").ComputedRef<string | undefined>;
115
116
  calculatorRef: import("vue").ShallowRef<HTMLElement | undefined, HTMLElement | undefined>;
116
117
  inputStyle: import("vue").ComputedRef<{
117
118
  minWidth: string;
@@ -961,6 +962,7 @@ export declare const ElSelect: {
961
962
  Defaults: {};
962
963
  }, Readonly<import("vue").ExtractPropTypes<{
963
964
  ariaLabel: StringConstructor;
965
+ ariaLabelledby: StringConstructor;
964
966
  emptyValues: ArrayConstructor;
965
967
  valueOnClear: import("../../utils/index.js").EpPropFinalized<(new (...args: any[]) => string | number | boolean | Function) | (() => string | number | boolean | Function | null) | (((new (...args: any[]) => string | number | boolean | Function) | (() => string | number | boolean | Function | null)) | null)[], unknown, unknown, undefined, boolean>;
966
968
  floatLabel: import("../../utils/index.js").EpPropFinalized<BooleanConstructor, unknown, unknown, false, boolean>;
@@ -1067,7 +1069,7 @@ export declare const ElSelect: {
1067
1069
  floatLabelClass: import("vue").ComputedRef<import("../../hooks/index.js").FloatLabelClass>;
1068
1070
  floatLabelText: import("vue").ComputedRef<string>;
1069
1071
  floatLabelId: import("vue").Ref<string, string>;
1070
- floatLabelAriaLabelledby: import("vue").ComputedRef<string | undefined>;
1072
+ ariaLabelledbyValue: import("vue").ComputedRef<string | undefined>;
1071
1073
  calculatorRef: import("vue").ShallowRef<HTMLElement | undefined, HTMLElement | undefined>;
1072
1074
  inputStyle: import("vue").ComputedRef<{
1073
1075
  minWidth: string;
@@ -1279,6 +1281,7 @@ export declare const ElSelect: {
1279
1281
  __isSuspense?: never;
1280
1282
  } & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
1281
1283
  ariaLabel: StringConstructor;
1284
+ ariaLabelledby: StringConstructor;
1282
1285
  emptyValues: ArrayConstructor;
1283
1286
  valueOnClear: import("../../utils/index.js").EpPropFinalized<(new (...args: any[]) => string | number | boolean | Function) | (() => string | number | boolean | Function | null) | (((new (...args: any[]) => string | number | boolean | Function) | (() => string | number | boolean | Function | null)) | null)[], unknown, unknown, undefined, boolean>;
1284
1287
  floatLabel: import("../../utils/index.js").EpPropFinalized<BooleanConstructor, unknown, unknown, false, boolean>;
@@ -1385,7 +1388,7 @@ export declare const ElSelect: {
1385
1388
  floatLabelClass: import("vue").ComputedRef<import("../../hooks/index.js").FloatLabelClass>;
1386
1389
  floatLabelText: import("vue").ComputedRef<string>;
1387
1390
  floatLabelId: import("vue").Ref<string, string>;
1388
- floatLabelAriaLabelledby: import("vue").ComputedRef<string | undefined>;
1391
+ ariaLabelledbyValue: import("vue").ComputedRef<string | undefined>;
1389
1392
  calculatorRef: import("vue").ShallowRef<HTMLElement | undefined, HTMLElement | undefined>;
1390
1393
  inputStyle: import("vue").ComputedRef<{
1391
1394
  minWidth: string;
@@ -23,6 +23,7 @@ export interface TagTooltipProps {
23
23
  }
24
24
  export declare const selectProps: {
25
25
  ariaLabel: StringConstructor;
26
+ ariaLabelledby: StringConstructor;
26
27
  emptyValues: ArrayConstructor;
27
28
  valueOnClear: import("../../utils/index.js").EpPropFinalized<(new (...args: any[]) => string | number | boolean | Function) | (() => string | number | boolean | Function | null) | (((new (...args: any[]) => string | number | boolean | Function) | (() => string | number | boolean | Function | null)) | null)[], unknown, unknown, undefined, boolean>;
28
29
  floatLabel: import("../../utils/index.js").EpPropFinalized<BooleanConstructor, unknown, unknown, false, boolean>;
@@ -10,7 +10,7 @@ import { useEmptyValuesProps as f } from "../../hooks/use-empty-values/index.js"
10
10
  import { floatLabelProp as m } from "../../hooks/use-float-label/index.js";
11
11
  import { ArrowDown as s, CircleClose as d } from "@element-plus/icons-vue";
12
12
  import { CHANGE_EVENT as c, UPDATE_MODEL_EVENT as y } from "../../constants/event.js";
13
- import { defaultProps as g } from "../select-v2/src/useProps.js";
13
+ import { defaultProps as b } from "../select-v2/src/useProps.js";
14
14
  import { scrollbarEmits as r } from "../scrollbar/src/scrollbar.js";
15
15
  import { useTooltipContentProps as a } from "../tooltip/src/content.js";
16
16
  import { tagProps as l } from "../tag/tag.js";
@@ -286,11 +286,11 @@ const F = i({
286
286
  },
287
287
  props: {
288
288
  type: e(Object),
289
- default: () => g
289
+ default: () => b
290
290
  },
291
291
  ...m,
292
292
  ...f,
293
- ...u(["ariaLabel"])
293
+ ...u(["ariaLabel", "ariaLabelledby"])
294
294
  }), L = {
295
295
  // todo: use generics to eliminate any
296
296
  [y]: (t) => !0,
@@ -2,6 +2,7 @@ import type { VNode } from 'vue';
2
2
  import type { SelectContext } from './src/type.js';
3
3
  declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
4
4
  ariaLabel: StringConstructor;
5
+ ariaLabelledby: StringConstructor;
5
6
  emptyValues: ArrayConstructor;
6
7
  valueOnClear: import("../../utils/index.js").EpPropFinalized<(new (...args: any[]) => string | number | boolean | Function) | (() => string | number | boolean | Function | null) | (((new (...args: any[]) => string | number | boolean | Function) | (() => string | number | boolean | Function | null)) | null)[], unknown, unknown, undefined, boolean>;
7
8
  floatLabel: import("../../utils/index.js").EpPropFinalized<BooleanConstructor, unknown, unknown, false, boolean>;
@@ -95,7 +96,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
95
96
  floatLabelClass: import("vue").ComputedRef<import("../../hooks/index.js").FloatLabelClass>;
96
97
  floatLabelText: import("vue").ComputedRef<string>;
97
98
  floatLabelId: import("vue").Ref<string, string>;
98
- floatLabelAriaLabelledby: import("vue").ComputedRef<string | undefined>;
99
+ ariaLabelledbyValue: import("vue").ComputedRef<string | undefined>;
99
100
  calculatorRef: import("vue").ShallowRef<HTMLElement | undefined, HTMLElement | undefined>;
100
101
  inputStyle: import("vue").ComputedRef<{
101
102
  minWidth: string;
@@ -276,6 +277,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
276
277
  clear: () => boolean;
277
278
  }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
278
279
  ariaLabel: StringConstructor;
280
+ ariaLabelledby: StringConstructor;
279
281
  emptyValues: ArrayConstructor;
280
282
  valueOnClear: import("../../utils/index.js").EpPropFinalized<(new (...args: any[]) => string | number | boolean | Function) | (() => string | number | boolean | Function | null) | (((new (...args: any[]) => string | number | boolean | Function) | (() => string | number | boolean | Function | null)) | null)[], unknown, unknown, undefined, boolean>;
281
283
  floatLabel: import("../../utils/index.js").EpPropFinalized<BooleanConstructor, unknown, unknown, false, boolean>;
@@ -1,10 +1,10 @@
1
1
  import J from "./select2.vue.js";
2
- import { resolveComponent as b, resolveDirective as Q, withDirectives as c, openBlock as l, createElementBlock as n, mergeProps as L, toHandlerKey as W, createVNode as m, withCtx as i, withModifiers as v, normalizeClass as s, renderSlot as f, createCommentVNode as p, createBlock as u, Fragment as C, renderList as k, vShow as X, createElementVNode as r, toDisplayString as g, normalizeStyle as V, createTextVNode as A, resolveDynamicComponent as R } from "vue";
2
+ import { resolveComponent as b, resolveDirective as Q, withDirectives as c, openBlock as l, createElementBlock as n, mergeProps as V, toHandlerKey as W, createVNode as m, withCtx as i, withModifiers as v, normalizeClass as s, renderSlot as f, createCommentVNode as p, createBlock as u, Fragment as C, renderList as k, vShow as X, createElementVNode as r, toDisplayString as g, normalizeStyle as L, createTextVNode as A, resolveDynamicComponent as R } from "vue";
3
3
  import Y from "../../_virtual/_plugin-vue_export-helper.js";
4
4
  const Z = ["id"], x = ["id", "value", "name", "disabled", "autocomplete", "tabindex", "readonly", "aria-activedescendant", "aria-controls", "aria-expanded", "aria-label", "aria-labelledby"], _ = ["textContent"], ee = { key: 1 };
5
5
  function le(e, o, oe, se, ae, ne) {
6
6
  const w = b("el-tag"), I = b("el-tooltip"), T = b("el-icon"), h = b("el-option"), F = b("el-option-group"), U = b("el-options"), j = b("el-scrollbar"), q = b("el-select-menu"), G = Q("click-outside");
7
- return c((l(), n("div", L({
7
+ return c((l(), n("div", V({
8
8
  ref: "selectRef",
9
9
  class: [e.nsSelect.b(), e.nsSelect.m(e.selectSize)]
10
10
  }, {
@@ -88,7 +88,7 @@ function le(e, o, oe, se, ae, ne) {
88
88
  type: e.tagType,
89
89
  effect: e.tagEffect,
90
90
  "disable-transitions": "",
91
- style: V(e.tagStyle),
91
+ style: L(e.tagStyle),
92
92
  onClose: ($) => e.deleteTag($, t)
93
93
  }, {
94
94
  default: i(() => [
@@ -141,7 +141,7 @@ function le(e, o, oe, se, ae, ne) {
141
141
  type: e.tagType,
142
142
  effect: e.tagEffect,
143
143
  "disable-transitions": "",
144
- style: V(e.collapseTagStyle)
144
+ style: L(e.collapseTagStyle)
145
145
  }, {
146
146
  default: i(() => [
147
147
  r("span", {
@@ -211,7 +211,7 @@ function le(e, o, oe, se, ae, ne) {
211
211
  class: s([e.nsSelect.e("input"), e.nsSelect.is(e.selectSize)]),
212
212
  disabled: e.selectDisabled,
213
213
  autocomplete: e.autocomplete,
214
- style: V(e.inputStyle),
214
+ style: L(e.inputStyle),
215
215
  tabindex: e.tabindex,
216
216
  role: "combobox",
217
217
  readonly: !e.filterable,
@@ -220,7 +220,7 @@ function le(e, o, oe, se, ae, ne) {
220
220
  "aria-controls": e.contentId,
221
221
  "aria-expanded": e.dropdownMenuVisible,
222
222
  "aria-label": e.ariaLabel,
223
- "aria-labelledby": e.floatLabelAriaLabelledby,
223
+ "aria-labelledby": e.ariaLabelledbyValue,
224
224
  "aria-autocomplete": "none",
225
225
  "aria-haspopup": "listbox",
226
226
  onKeydown: o[0] || (o[0] = (...a) => e.handleKeydown && e.handleKeydown(...a)),
@@ -324,7 +324,7 @@ function le(e, o, oe, se, ae, ne) {
324
324
  class: s([e.nsSelect.is("empty", e.filteredOptionsCount === 0)]),
325
325
  role: "listbox",
326
326
  "aria-label": e.ariaLabel,
327
- "aria-labelledby": e.floatLabelAriaLabelledby,
327
+ "aria-labelledby": e.ariaLabelledbyValue,
328
328
  "aria-orientation": "vertical",
329
329
  onScroll: e.popupScroll,
330
330
  onEndReached: e.endReached
@@ -347,12 +347,12 @@ function le(e, o, oe, se, ae, ne) {
347
347
  disabled: e.getDisabled(d)
348
348
  }, {
349
349
  default: i(() => [
350
- (l(!0), n(C, null, k(e.getOptions(d), (y) => (l(), u(h, L({
350
+ (l(!0), n(C, null, k(e.getOptions(d), (y) => (l(), u(h, V({
351
351
  key: e.getValue(y)
352
352
  }, { ref_for: !0 }, e.getOptionProps(y)), null, 16))), 128))
353
353
  ]),
354
354
  _: 2
355
- }, 1032, ["label", "disabled"])) : (l(), u(h, L({
355
+ }, 1032, ["label", "disabled"])) : (l(), u(h, V({
356
356
  key: 1,
357
357
  ref_for: !0
358
358
  }, e.getOptionProps(d)), null, 16))
@@ -1,4 +1,4 @@
1
- import { defineComponent as _, getCurrentInstance as P, computed as b, reactive as T, toRefs as k, toRef as N, watch as F, provide as I, onBeforeUnmount as j } from "vue";
1
+ import { defineComponent as A, getCurrentInstance as P, computed as b, reactive as T, toRefs as k, toRef as N, watch as F, provide as I, onBeforeUnmount as j } from "vue";
2
2
  import G from "../../directives/click-outside/index.js";
3
3
  import { EpTooltip as B } from "../tooltip/index.js";
4
4
  import { EpScrollbar as K } from "../scrollbar/index.js";
@@ -15,82 +15,80 @@ import { useProps as Z } from "../select-v2/src/useProps.js";
15
15
  import $ from "./src/option.vue.js";
16
16
  import ee from "./src/select-dropdown.vue.js";
17
17
  import { useSelect as te } from "./src/useSelect.js";
18
- import { selectKey as oe } from "./src/token.js";
19
- import ne from "./src/options.js";
20
- import { selectEmits as re, selectProps as le } from "./select.js";
21
- import ae from "./src/option-group.vue.js";
18
+ import { selectKey as re } from "./src/token.js";
19
+ import oe from "./src/options.js";
20
+ import { selectEmits as ne, selectProps as ae } from "./select.js";
21
+ import le from "./src/option-group.vue.js";
22
22
  import { isArray as ie, isObject as E } from "@vue/shared";
23
- const y = "EpSelect", m = /* @__PURE__ */ new WeakMap(), ce = (o) => (...n) => {
24
- var p, s, u;
25
- const l = n[0];
26
- if (!l || l.includes(
23
+ const y = "EpSelect", m = /* @__PURE__ */ new WeakMap(), ce = (t) => (...o) => {
24
+ var u, s, p;
25
+ const a = o[0];
26
+ if (!a || a.includes(
27
27
  'Slot "default" invoked outside of the render function'
28
- ) && ((p = n[2]) != null && p.includes("ElTreeSelect") || (s = n[2]) != null && s.includes("EpTreeSelect")))
28
+ ) && ((u = o[2]) != null && u.includes("ElTreeSelect") || (s = o[2]) != null && s.includes("EpTreeSelect")))
29
29
  return;
30
- const a = (u = m.get(o)) == null ? void 0 : u.originalWarnHandler;
31
- if (a) {
32
- a(...n);
30
+ const l = (p = m.get(t)) == null ? void 0 : p.originalWarnHandler;
31
+ if (l) {
32
+ l(...o);
33
33
  return;
34
34
  }
35
- console.warn(...n);
36
- }, se = (o) => {
37
- let n = m.get(o);
38
- return n || (n = {
39
- originalWarnHandler: o.config.warnHandler,
40
- handler: ce(o),
35
+ console.warn(...o);
36
+ }, se = (t) => {
37
+ let o = m.get(t);
38
+ return o || (o = {
39
+ originalWarnHandler: t.config.warnHandler,
40
+ handler: ce(t),
41
41
  count: 0
42
- }, m.set(o, n)), n;
43
- }, Ae = _({
42
+ }, m.set(t, o)), o;
43
+ }, xe = A({
44
44
  name: y,
45
45
  componentName: y,
46
46
  components: {
47
47
  ElSelectMenu: ee,
48
48
  ElOption: $,
49
- ElOptions: ne,
50
- ElOptionGroup: ae,
49
+ ElOptions: oe,
50
+ ElOptionGroup: le,
51
51
  ElTag: U,
52
52
  ElScrollbar: K,
53
53
  ElTooltip: B,
54
54
  ElIcon: q
55
55
  },
56
56
  directives: { ClickOutside: G },
57
- props: le,
58
- emits: re,
59
- setup(o, { emit: n, slots: l }) {
60
- const a = P(), p = se(a.appContext);
61
- p.count += 1, a.appContext.config.warnHandler = p.handler;
57
+ props: ae,
58
+ emits: ne,
59
+ setup(t, { emit: o, slots: a }) {
60
+ const l = P(), u = se(l.appContext);
61
+ u.count += 1, l.appContext.config.warnHandler = u.handler;
62
62
  const s = b(() => {
63
- const { modelValue: e, multiple: i } = o, r = i ? [] : void 0;
64
- return ie(e) ? i ? e : r : i ? r : e;
65
- }), u = T({
66
- ...k(o),
63
+ const { modelValue: e, multiple: i } = t, n = i ? [] : void 0;
64
+ return ie(e) ? i ? e : n : i ? n : e;
65
+ }), p = T({
66
+ ...k(t),
67
67
  modelValue: s
68
- }), t = te(u, n), { floatLabelClass: w } = Y({
69
- floatLabel: N(o, "floatLabel"),
70
- isFocused: t.isFocused,
71
- hasValue: t.hasModelValue,
72
- isDisabled: t.selectDisabled
68
+ }), r = te(p, o), { floatLabelClass: w } = Y({
69
+ floatLabel: N(t, "floatLabel"),
70
+ isFocused: r.isFocused,
71
+ hasValue: r.hasModelValue,
72
+ isDisabled: r.selectDisabled
73
73
  }), { t: D } = J(), h = b(
74
- () => o.placeholder ?? D("el.select.placeholder")
75
- ), O = Q(), H = b(
76
- () => o.floatLabel && h.value && !o.ariaLabel ? O.value : void 0
77
- ), { calculatorRef: R, inputStyle: M } = X(), { getLabel: g, getValue: v, getOptions: W, getDisabled: L } = Z(o), x = (e) => ({
78
- label: g(e),
79
- value: v(e),
80
- disabled: L(e)
81
- }), S = (e) => e.reduce((i, r) => (i.push(r), r.children && r.children.length > 0 && i.push(...S(r.children)), i), []), A = (e) => {
82
- z(e || []).forEach((r) => {
74
+ () => t.placeholder ?? D("el.select.placeholder")
75
+ ), O = Q(), H = b(() => t.ariaLabelledby ? t.ariaLabelledby : t.floatLabel && h.value && !t.ariaLabel ? O.value : void 0), { calculatorRef: R, inputStyle: M } = X(), { getLabel: L, getValue: g, getOptions: V, getDisabled: v } = Z(t), W = (e) => ({
76
+ label: L(e),
77
+ value: g(e),
78
+ disabled: v(e)
79
+ }), S = (e) => e.reduce((i, n) => (i.push(n), n.children && n.children.length > 0 && i.push(...S(n.children)), i), []), x = (e) => {
80
+ z(e || []).forEach((n) => {
83
81
  var C;
84
- const d = r.type.name;
85
- if (E(r) && (d === "ElOption" || d === "ElTree" || d === "EpTree")) {
82
+ const d = n.type.name;
83
+ if (E(n) && (d === "ElOption" || d === "ElTree" || d === "EpTree")) {
86
84
  if (d === "ElTree" || d === "EpTree") {
87
- const c = ((C = r.props) == null ? void 0 : C.data) || [];
85
+ const c = ((C = n.props) == null ? void 0 : C.data) || [];
88
86
  S(c).forEach((f) => {
89
- f.currentLabel = f.label ?? (E(f.value) ? "" : f.value), t.onOptionCreate(f);
87
+ f.currentLabel = f.label ?? (E(f.value) ? "" : f.value), r.onOptionCreate(f);
90
88
  });
91
89
  } else if (d === "ElOption") {
92
- const c = { ...r.props };
93
- c.currentLabel = c.label ?? (E(c.value) ? "" : c.value), t.onOptionCreate(c);
90
+ const c = { ...n.props };
91
+ c.currentLabel = c.label ?? (E(c.value) ? "" : c.value), r.onOptionCreate(c);
94
92
  }
95
93
  }
96
94
  });
@@ -99,52 +97,52 @@ const y = "EpSelect", m = /* @__PURE__ */ new WeakMap(), ce = (o) => (...n) => {
99
97
  () => {
100
98
  var e;
101
99
  return [
102
- o.persistent || t.expanded.value || !l.default || (e = l.default) == null ? void 0 : e.call(l),
100
+ t.persistent || r.expanded.value || !a.default || (e = a.default) == null ? void 0 : e.call(a),
103
101
  s.value
104
102
  ];
105
103
  },
106
104
  () => {
107
105
  var e;
108
- o.persistent || t.expanded.value || l.default && (t.states.options.clear(), A((e = l.default) == null ? void 0 : e.call(l)));
106
+ t.persistent || r.expanded.value || a.default && (r.states.options.clear(), x((e = a.default) == null ? void 0 : e.call(a)));
109
107
  },
110
108
  {
111
109
  immediate: !0
112
110
  }
113
111
  ), I(
114
- oe,
112
+ re,
115
113
  T({
116
- props: u,
117
- states: t.states,
118
- selectRef: t.selectRef,
119
- optionsArray: t.optionsArray,
120
- setSelected: t.setSelected,
121
- handleOptionSelect: t.handleOptionSelect,
122
- onOptionCreate: t.onOptionCreate,
123
- onOptionDestroy: t.onOptionDestroy
114
+ props: p,
115
+ states: r.states,
116
+ selectRef: r.selectRef,
117
+ optionsArray: r.optionsArray,
118
+ setSelected: r.setSelected,
119
+ handleOptionSelect: r.handleOptionSelect,
120
+ onOptionCreate: r.onOptionCreate,
121
+ onOptionDestroy: r.onOptionDestroy
124
122
  })
125
123
  );
126
- const V = b(() => o.multiple ? t.states.selected.map((e) => e.currentLabel) : t.states.selectedLabel);
124
+ const _ = b(() => t.multiple ? r.states.selected.map((e) => e.currentLabel) : r.states.selectedLabel);
127
125
  return j(() => {
128
- const e = m.get(a.appContext);
129
- e && (e.count -= 1, e.count <= 0 && (a.appContext.config.warnHandler = e.originalWarnHandler, m.delete(a.appContext)));
126
+ const e = m.get(l.appContext);
127
+ e && (e.count -= 1, e.count <= 0 && (l.appContext.config.warnHandler = e.originalWarnHandler, m.delete(l.appContext)));
130
128
  }), {
131
- ...t,
129
+ ...r,
132
130
  modelValue: s,
133
- selectedLabel: V,
131
+ selectedLabel: _,
134
132
  floatLabelClass: w,
135
133
  floatLabelText: h,
136
134
  floatLabelId: O,
137
- floatLabelAriaLabelledby: H,
135
+ ariaLabelledbyValue: H,
138
136
  calculatorRef: R,
139
137
  inputStyle: M,
140
- getLabel: g,
141
- getValue: v,
142
- getOptions: W,
143
- getDisabled: L,
144
- getOptionProps: x
138
+ getLabel: L,
139
+ getValue: g,
140
+ getOptions: V,
141
+ getDisabled: v,
142
+ getOptionProps: W
145
143
  };
146
144
  }
147
145
  });
148
146
  export {
149
- Ae as default
147
+ xe as default
150
148
  };
@@ -24,6 +24,7 @@ export interface TagTooltipProps {
24
24
  }
25
25
  export declare const selectV2Props: {
26
26
  readonly ariaLabel: StringConstructor;
27
+ readonly ariaLabelledby: StringConstructor;
27
28
  readonly emptyValues: ArrayConstructor;
28
29
  readonly valueOnClear: import("../../../utils/index.js").EpPropFinalized<(new (...args: any[]) => string | number | boolean | Function) | (() => string | number | boolean | Function | null) | (((new (...args: any[]) => string | number | boolean | Function) | (() => string | number | boolean | Function | null)) | null)[], unknown, unknown, undefined, boolean>;
29
30
  readonly floatLabel: import("../../../utils/index.js").EpPropFinalized<BooleanConstructor, unknown, unknown, false, boolean>;
@@ -318,7 +318,7 @@ const H = p({
318
318
  },
319
319
  ...m,
320
320
  ...s,
321
- ...d(["ariaLabel"])
321
+ ...d(["ariaLabel", "ariaLabelledby"])
322
322
  }), I = p({
323
323
  data: Array,
324
324
  disabled: Boolean,
@@ -1,5 +1,6 @@
1
1
  declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
2
2
  readonly ariaLabel: StringConstructor;
3
+ readonly ariaLabelledby: StringConstructor;
3
4
  readonly emptyValues: ArrayConstructor;
4
5
  readonly valueOnClear: import("../../../utils/index.js").EpPropFinalized<(new (...args: any[]) => string | number | boolean | Function) | (() => string | number | boolean | Function | null) | (((new (...args: any[]) => string | number | boolean | Function) | (() => string | number | boolean | Function | null)) | null)[], unknown, unknown, undefined, boolean>;
5
6
  readonly floatLabel: import("../../../utils/index.js").EpPropFinalized<BooleanConstructor, unknown, unknown, false, boolean>;
@@ -201,7 +202,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
201
202
  floatLabelClass: import("vue").ComputedRef<import("../../../hooks/index.js").FloatLabelClass>;
202
203
  floatLabelText: import("vue").ComputedRef<string>;
203
204
  floatLabelId: import("vue").Ref<string, string>;
204
- floatLabelAriaLabelledby: import("vue").ComputedRef<string | undefined>;
205
+ ariaLabelledbyValue: import("vue").ComputedRef<string | undefined>;
205
206
  calculatorRef: import("vue").ShallowRef<HTMLElement | undefined, HTMLElement | undefined>;
206
207
  inputStyle: import("vue").ComputedRef<{
207
208
  minWidth: string;
@@ -339,6 +340,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
339
340
  clear: () => boolean;
340
341
  }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
341
342
  readonly ariaLabel: StringConstructor;
343
+ readonly ariaLabelledby: StringConstructor;
342
344
  readonly emptyValues: ArrayConstructor;
343
345
  readonly valueOnClear: import("../../../utils/index.js").EpPropFinalized<(new (...args: any[]) => string | number | boolean | Function) | (() => string | number | boolean | Function | null) | (((new (...args: any[]) => string | number | boolean | Function) | (() => string | number | boolean | Function | null)) | null)[], unknown, unknown, undefined, boolean>;
344
346
  readonly floatLabel: import("../../../utils/index.js").EpPropFinalized<BooleanConstructor, unknown, unknown, false, boolean>;
@@ -1,5 +1,5 @@
1
1
  import W from "./select2.vue.js";
2
- import { resolveComponent as y, resolveDirective as Z, withDirectives as P, openBlock as s, createElementBlock as r, normalizeClass as o, createVNode as m, withCtx as i, createSlots as j, renderSlot as d, normalizeProps as q, guardReactiveProps as G, createElementVNode as n, withModifiers as p, toDisplayString as u, createCommentVNode as f, Fragment as A, renderList as H, normalizeStyle as T, createTextVNode as N, createBlock as g, withKeys as v, resolveDynamicComponent as w, vShow as J } from "vue";
2
+ import { resolveComponent as y, resolveDirective as Z, withDirectives as P, openBlock as s, createElementBlock as r, normalizeClass as o, createVNode as m, withCtx as i, createSlots as j, renderSlot as d, normalizeProps as q, guardReactiveProps as G, createElementVNode as n, withModifiers as p, toDisplayString as u, createCommentVNode as f, Fragment as H, renderList as N, normalizeStyle as T, createTextVNode as A, createBlock as b, withKeys as v, resolveDynamicComponent as w, vShow as J } from "vue";
3
3
  import Q from "../../../_virtual/_plugin-vue_export-helper.js";
4
4
  const X = ["id"], Y = ["id", "value", "autocomplete", "tabindex", "aria-expanded", "aria-label", "aria-labelledby", "disabled", "aria-controls", "aria-activedescendant", "readonly", "name"], c = ["textContent"], x = { key: 1 };
5
5
  function _(e, l, ee, le, oe, ae) {
@@ -7,8 +7,8 @@ function _(e, l, ee, le, oe, ae) {
7
7
  return P((s(), r("div", {
8
8
  ref: "selectRef",
9
9
  class: o([e.nsSelect.b(), e.nsSelect.m(e.selectSize)]),
10
- onMouseenter: l[15] || (l[15] = (b) => e.states.inputHovering = !0),
11
- onMouseleave: l[16] || (l[16] = (b) => e.states.inputHovering = !1)
10
+ onMouseenter: l[15] || (l[15] = (g) => e.states.inputHovering = !0),
11
+ onMouseleave: l[16] || (l[16] = (g) => e.states.inputHovering = !1)
12
12
  }, [
13
13
  m(k, {
14
14
  ref: "tooltipRef",
@@ -30,10 +30,10 @@ function _(e, l, ee, le, oe, ae) {
30
30
  "show-arrow": e.showArrow,
31
31
  offset: e.offset,
32
32
  onBeforeShow: e.handleMenuEnter,
33
- onHide: l[14] || (l[14] = (b) => e.states.isBeforeHide = !1)
33
+ onHide: l[14] || (l[14] = (g) => e.states.isBeforeHide = !1)
34
34
  }, {
35
35
  default: i(() => {
36
- var b;
36
+ var g;
37
37
  return [
38
38
  n("div", {
39
39
  ref: "wrapperRef",
@@ -76,7 +76,7 @@ function _(e, l, ee, le, oe, ae) {
76
76
  }, () => {
77
77
  var a, I, $, V, R, L, z, D, E, M, O, B, K;
78
78
  return [
79
- (s(!0), r(A, null, H(e.showTagList, (t) => (s(), r("div", {
79
+ (s(!0), r(H, null, N(e.showTagList, (t) => (s(), r("div", {
80
80
  key: e.getValueKey(e.getValue(t)),
81
81
  class: o(e.nsSelect.e("selected-item"))
82
82
  }, [
@@ -98,14 +98,14 @@ function _(e, l, ee, le, oe, ae) {
98
98
  label: e.getLabel(t),
99
99
  value: e.getValue(t)
100
100
  }, () => [
101
- N(u(e.getLabel(t)), 1)
101
+ A(u(e.getLabel(t)), 1)
102
102
  ])
103
103
  ], 2)
104
104
  ]),
105
105
  _: 2
106
106
  }, 1032, ["closable", "size", "type", "effect", "style", "onClose"])
107
107
  ], 2))), 128)),
108
- e.collapseTags && e.states.cachedOptions.length > e.maxCollapseTags ? (s(), g(k, {
108
+ e.collapseTags && e.states.cachedOptions.length > e.maxCollapseTags ? (s(), b(k, {
109
109
  key: 0,
110
110
  ref: "tagTooltipRef",
111
111
  disabled: e.dropdownMenuVisible || !e.collapseTagsTooltip,
@@ -155,7 +155,7 @@ function _(e, l, ee, le, oe, ae) {
155
155
  ref: "tagMenuRef",
156
156
  class: o(e.nsSelect.e("selection"))
157
157
  }, [
158
- (s(!0), r(A, null, H(e.collapseTagList, (t) => (s(), r("div", {
158
+ (s(!0), r(H, null, N(e.collapseTagList, (t) => (s(), r("div", {
159
159
  key: e.getValueKey(e.getValue(t)),
160
160
  class: o(e.nsSelect.e("selected-item"))
161
161
  }, [
@@ -177,7 +177,7 @@ function _(e, l, ee, le, oe, ae) {
177
177
  label: e.getLabel(t),
178
178
  value: e.getValue(t)
179
179
  }, () => [
180
- N(u(e.getLabel(t)), 1)
180
+ A(u(e.getLabel(t)), 1)
181
181
  ])
182
182
  ], 2)
183
183
  ]),
@@ -212,7 +212,7 @@ function _(e, l, ee, le, oe, ae) {
212
212
  autocapitalize: "off",
213
213
  "aria-expanded": e.expanded,
214
214
  "aria-label": e.ariaLabel,
215
- "aria-labelledby": e.floatLabelAriaLabelledby,
215
+ "aria-labelledby": e.ariaLabelledbyValue,
216
216
  class: o([e.nsSelect.e("input"), e.nsSelect.is(e.selectSize)]),
217
217
  disabled: e.selectDisabled,
218
218
  role: "combobox",
@@ -257,7 +257,7 @@ function _(e, l, ee, le, oe, ae) {
257
257
  ])
258
258
  }, [
259
259
  e.hasModelValue ? d(e.$slots, "label", {
260
- index: ((b = e.allOptionsValueMap.get(e.modelValue)) == null ? void 0 : b.index) ?? -1,
260
+ index: ((g = e.allOptionsValueMap.get(e.modelValue)) == null ? void 0 : g.index) ?? -1,
261
261
  label: e.currentPlaceholder,
262
262
  value: e.modelValue
263
263
  }, () => [
@@ -269,18 +269,18 @@ function _(e, l, ee, le, oe, ae) {
269
269
  ref: "suffixRef",
270
270
  class: o(e.nsSelect.e("suffix"))
271
271
  }, [
272
- e.iconComponent ? P((s(), g(h, {
272
+ e.iconComponent ? P((s(), b(h, {
273
273
  key: 0,
274
274
  class: o([e.nsSelect.e("caret"), e.nsInput.e("icon"), e.iconReverse])
275
275
  }, {
276
276
  default: i(() => [
277
- (s(), g(w(e.iconComponent)))
277
+ (s(), b(w(e.iconComponent)))
278
278
  ]),
279
279
  _: 1
280
280
  }, 8, ["class"])), [
281
281
  [J, !e.showClearBtn]
282
282
  ]) : f("", !0),
283
- e.showClearBtn && e.clearIcon ? (s(), g(h, {
283
+ e.showClearBtn && e.clearIcon ? (s(), b(h, {
284
284
  key: 1,
285
285
  class: o([
286
286
  e.nsSelect.e("caret"),
@@ -290,11 +290,11 @@ function _(e, l, ee, le, oe, ae) {
290
290
  onClick: p(e.handleClear, ["prevent", "stop"])
291
291
  }, {
292
292
  default: i(() => [
293
- (s(), g(w(e.clearIcon)))
293
+ (s(), b(w(e.clearIcon)))
294
294
  ]),
295
295
  _: 1
296
296
  }, 8, ["class", "onClick"])) : f("", !0),
297
- e.validateState && e.validateIcon && e.needStatusIcon ? (s(), g(h, {
297
+ e.validateState && e.validateIcon && e.needStatusIcon ? (s(), b(h, {
298
298
  key: 2,
299
299
  class: o([
300
300
  e.nsInput.e("icon"),
@@ -303,7 +303,7 @@ function _(e, l, ee, le, oe, ae) {
303
303
  ])
304
304
  }, {
305
305
  default: i(() => [
306
- (s(), g(w(e.validateIcon)))
306
+ (s(), b(w(e.validateIcon)))
307
307
  ]),
308
308
  _: 1
309
309
  }, 8, ["class"])) : f("", !0)
@@ -320,11 +320,11 @@ function _(e, l, ee, le, oe, ae) {
320
320
  "hovering-index": e.states.hoveringIndex,
321
321
  "scrollbar-always-on": e.scrollbarAlwaysOn,
322
322
  "aria-label": e.ariaLabel,
323
- "aria-labelledby": e.floatLabelAriaLabelledby,
323
+ "aria-labelledby": e.ariaLabelledbyValue,
324
324
  onEndReached: e.onEndReached
325
325
  }, j({
326
- default: i((b) => [
327
- d(e.$slots, "default", q(G(b)))
326
+ default: i((g) => [
327
+ d(e.$slots, "default", q(G(g)))
328
328
  ]),
329
329
  _: 2
330
330
  }, [
@@ -1,21 +1,21 @@
1
- import { defineComponent as h, computed as l, reactive as m, toRefs as p, toRef as V, provide as y } from "vue";
1
+ import { defineComponent as I, computed as l, reactive as m, toRefs as d, toRef as V, provide as h } from "vue";
2
2
  import R from "../../../directives/click-outside/index.js";
3
3
  import { EpTooltip as S } from "../../tooltip/index.js";
4
4
  import { EpTag as g } from "../../tag/index.js";
5
5
  import { EpIcon as T } from "../../icon/index.js";
6
6
  import { useLocale as H } from "../../../hooks/use-locale/index.js";
7
- import { useId as d } from "../../../hooks/use-id/index.js";
7
+ import { useId as f } from "../../../hooks/use-id/index.js";
8
8
  import "../../../hooks/use-size/index.js";
9
9
  import "../../../hooks/use-aria/index.js";
10
10
  import { useCalcInputWidth as K } from "../../../hooks/use-calc-input-width/index.js";
11
11
  import { useFloatLabel as O } from "../../../hooks/use-float-label/index.js";
12
12
  import x from "./select-dropdown.js";
13
- import A from "./useSelect.js";
14
- import { selectV2Emits as C, selectV2Props as D } from "./defaults.js";
15
- import { selectV2InjectionKey as _ } from "./token.js";
13
+ import C from "./useSelect.js";
14
+ import { selectV2Emits as D, selectV2Props as _ } from "./defaults.js";
15
+ import { selectV2InjectionKey as A } from "./token.js";
16
16
  import { BORDER_HORIZONTAL_WIDTH as F } from "../../../constants/form.js";
17
17
  import { isArray as M } from "@vue/shared";
18
- const ee = h({
18
+ const ee = I({
19
19
  name: "EpSelectV2",
20
20
  components: {
21
21
  ElSelectMenu: x,
@@ -24,54 +24,52 @@ const ee = h({
24
24
  ElIcon: T
25
25
  },
26
26
  directives: { ClickOutside: R },
27
- props: D,
28
- emits: C,
29
- setup(o, { emit: f }) {
27
+ props: _,
28
+ emits: D,
29
+ setup(t, { emit: u }) {
30
30
  const a = l(() => {
31
- const { modelValue: t, multiple: r } = o, n = r ? [] : void 0;
32
- return M(t) ? r ? t : n : r ? n : t;
33
- }), e = A(
31
+ const { modelValue: o, multiple: r } = t, s = r ? [] : void 0;
32
+ return M(o) ? r ? o : s : r ? s : o;
33
+ }), e = C(
34
34
  m({
35
- ...p(o),
35
+ ...d(t),
36
36
  modelValue: a
37
37
  }),
38
- f
39
- ), { floatLabelClass: u } = O({
40
- floatLabel: V(o, "floatLabel"),
38
+ u
39
+ ), { floatLabelClass: p } = O({
40
+ floatLabel: V(t, "floatLabel"),
41
41
  isFocused: e.isFocused,
42
42
  hasValue: e.hasModelValue,
43
43
  isDisabled: e.selectDisabled
44
44
  }), { t: b } = H(), i = l(
45
- () => o.placeholder ?? b("el.select.placeholder")
46
- ), c = d(), L = l(
47
- () => o.floatLabel && i.value && !o.ariaLabel ? c.value : void 0
48
- ), { calculatorRef: v, inputStyle: E } = K(), s = d();
49
- y(_, {
45
+ () => t.placeholder ?? b("el.select.placeholder")
46
+ ), c = f(), L = l(() => t.ariaLabelledby ? t.ariaLabelledby : t.floatLabel && i.value && !t.ariaLabel ? c.value : void 0), { calculatorRef: v, inputStyle: y } = K(), n = f();
47
+ h(A, {
50
48
  props: m({
51
- ...p(o),
49
+ ...d(t),
52
50
  height: e.popupHeight,
53
51
  modelValue: a
54
52
  }),
55
53
  expanded: e.expanded,
56
54
  tooltipRef: e.tooltipRef,
57
- contentId: s,
55
+ contentId: n,
58
56
  onSelect: e.onSelect,
59
57
  onHover: e.onHover,
60
58
  onKeyboardNavigate: e.onKeyboardNavigate,
61
59
  onKeyboardSelect: e.onKeyboardSelect
62
60
  });
63
- const I = l(() => o.multiple ? e.states.cachedOptions.map((t) => e.getLabel(t)) : e.states.selectedLabel);
61
+ const E = l(() => t.multiple ? e.states.cachedOptions.map((o) => e.getLabel(o)) : e.states.selectedLabel);
64
62
  return {
65
63
  ...e,
66
64
  modelValue: a,
67
- selectedLabel: I,
68
- floatLabelClass: u,
65
+ selectedLabel: E,
66
+ floatLabelClass: p,
69
67
  floatLabelText: i,
70
68
  floatLabelId: c,
71
- floatLabelAriaLabelledby: L,
69
+ ariaLabelledbyValue: L,
72
70
  calculatorRef: v,
73
- inputStyle: E,
74
- contentId: s,
71
+ inputStyle: y,
72
+ contentId: n,
75
73
  BORDER_HORIZONTAL_WIDTH: F
76
74
  };
77
75
  }
@@ -88,6 +88,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
88
88
  __epPropKey: true;
89
89
  };
90
90
  ariaLabel: StringConstructor;
91
+ ariaLabelledby: StringConstructor;
91
92
  emptyValues: ArrayConstructor;
92
93
  valueOnClear: import("../../../utils/index.js").EpPropFinalized<(new (...args: any[]) => string | number | boolean | Function) | (() => string | number | boolean | Function | null) | (((new (...args: any[]) => string | number | boolean | Function) | (() => string | number | boolean | Function | null)) | null)[], unknown, unknown, undefined, boolean>;
93
94
  floatLabel: import("../../../utils/index.js").EpPropFinalized<BooleanConstructor, unknown, unknown, false, boolean>;
@@ -266,6 +267,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
266
267
  __epPropKey: true;
267
268
  };
268
269
  ariaLabel: StringConstructor;
270
+ ariaLabelledby: StringConstructor;
269
271
  emptyValues: ArrayConstructor;
270
272
  valueOnClear: import("../../../utils/index.js").EpPropFinalized<(new (...args: any[]) => string | number | boolean | Function) | (() => string | number | boolean | Function | null) | (((new (...args: any[]) => string | number | boolean | Function) | (() => string | number | boolean | Function | null)) | null)[], unknown, unknown, undefined, boolean>;
271
273
  floatLabel: import("../../../utils/index.js").EpPropFinalized<BooleanConstructor, unknown, unknown, false, boolean>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ep-craft",
3
- "version": "0.1.41",
3
+ "version": "0.1.42",
4
4
  "description": "A self-contained Vue 3 component library with ep- prefix",
5
5
  "type": "module",
6
6
  "packageManager": "pnpm@10.34.4",