vft 0.0.511 → 0.0.514

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.
Files changed (137) hide show
  1. package/dist/index.css +1 -1
  2. package/es/components/cascader/cascader.vue2.js +202 -203
  3. package/es/components/cascader-panel/menu.vue2.js +49 -50
  4. package/es/components/clamp-toggle/clamp-toggle.vue2.js +18 -19
  5. package/es/components/color-picker/color-picker.vue2.js +133 -134
  6. package/es/components/config-provider/config-provider.vue.d.ts +0 -2
  7. package/es/components/config-provider/config-provider.vue2.js +4 -5
  8. package/es/components/config-provider/constants.d.ts +0 -1
  9. package/es/components/config-provider/constants.js +2 -3
  10. package/es/components/config-provider/hooks/use-global-config.js +30 -33
  11. package/es/components/config-provider/index.d.ts +0 -9
  12. package/es/components/config-provider/index.js +5 -6
  13. package/es/components/date-picker/composables/use-basic-date-table.js +82 -83
  14. package/es/components/date-picker/composables/use-month-range-header.js +14 -15
  15. package/es/components/date-picker/composables/use-panel-date-range.js +23 -24
  16. package/es/components/date-picker/date-picker-com/basic-month-table.vue2.js +38 -39
  17. package/es/components/date-picker/date-picker-com/basic-year-table.vue2.js +38 -39
  18. package/es/components/date-picker/date-picker-com/panel-date-pick.vue2.js +183 -184
  19. package/es/components/date-picker/date-picker-com/panel-date-range.vue2.js +224 -225
  20. package/es/components/date-time-select/date-time-select.vue2.js +36 -39
  21. package/es/components/dropdown/dropdown-item-impl.vue.d.ts +1 -1
  22. package/es/components/dropdown/dropdown-item.vue.d.ts +1 -1
  23. package/es/components/dropdown/dropdown.vue.d.ts +1 -1
  24. package/es/components/dropdown/dropdown.vue2.js +67 -68
  25. package/es/components/dropdown/index.d.ts +33 -33
  26. package/es/components/empty/empty.vue2.js +38 -39
  27. package/es/components/full-screen/full-screen.vue2.js +17 -18
  28. package/es/components/image/image.vue2.js +59 -60
  29. package/es/components/image-viewer/image-viewer.vue2.js +44 -45
  30. package/es/components/index.js +97 -98
  31. package/es/components/md-container/md-container.vue2.js +74 -75
  32. package/es/components/md-container/toc.js +36 -37
  33. package/es/components/message-box/message-box.vue2.js +3 -3
  34. package/es/components/message-box/method.js +47 -48
  35. package/es/components/modal/modal-footer-action.vue2.js +24 -25
  36. package/es/components/multiple-tabs/multiple-tabs.vue2.js +15 -16
  37. package/es/components/multiple-tabs/use/use-tab-dropdown.js +53 -54
  38. package/es/components/popconfirm/popconfirm.vue2.js +39 -40
  39. package/es/components/search/search.vue2.js +50 -51
  40. package/es/components/select/useSelect.js +231 -232
  41. package/es/components/super-form/super-form-item.vue2.js +66 -66
  42. package/es/components/time-picker/time-picker-com/panel-time-pick.vue2.js +65 -66
  43. package/es/components/time-picker/time-picker-com/panel-time-range.vue2.js +133 -134
  44. package/es/components/transfer/transfer-panel.vue2.js +56 -57
  45. package/es/components/transfer/transfer.vue2.js +69 -70
  46. package/es/components/tree/tree.vue2.js +59 -60
  47. package/es/components/upload/upload-content.vue2.js +49 -50
  48. package/es/components/upload/upload-list.vue2.js +45 -46
  49. package/es/components/upload/upload.vue2.js +99 -100
  50. package/es/hooks/use-z-index/index.js +3 -3
  51. package/es/index.d.ts +0 -1
  52. package/es/index.js +1 -5
  53. package/es/package.json.d.ts +1 -1
  54. package/es/package.json.js +1 -1
  55. package/lib/components/cascader/cascader.vue2.cjs +1 -1
  56. package/lib/components/cascader-panel/menu.vue2.cjs +4 -4
  57. package/lib/components/clamp-toggle/clamp-toggle.vue2.cjs +1 -1
  58. package/lib/components/color-picker/color-picker.vue2.cjs +1 -1
  59. package/lib/components/config-provider/config-provider.vue.d.ts +0 -2
  60. package/lib/components/config-provider/config-provider.vue2.cjs +1 -1
  61. package/lib/components/config-provider/constants.cjs +1 -1
  62. package/lib/components/config-provider/constants.d.ts +0 -1
  63. package/lib/components/config-provider/hooks/use-global-config.cjs +1 -1
  64. package/lib/components/config-provider/index.cjs +1 -1
  65. package/lib/components/config-provider/index.d.ts +0 -9
  66. package/lib/components/date-picker/composables/use-basic-date-table.cjs +1 -1
  67. package/lib/components/date-picker/composables/use-month-range-header.cjs +1 -1
  68. package/lib/components/date-picker/composables/use-panel-date-range.cjs +1 -1
  69. package/lib/components/date-picker/date-picker-com/basic-month-table.vue2.cjs +1 -1
  70. package/lib/components/date-picker/date-picker-com/basic-year-table.vue2.cjs +1 -1
  71. package/lib/components/date-picker/date-picker-com/panel-date-pick.vue2.cjs +1 -1
  72. package/lib/components/date-picker/date-picker-com/panel-date-range.vue2.cjs +1 -1
  73. package/lib/components/date-time-select/date-time-select.vue2.cjs +1 -1
  74. package/lib/components/dropdown/dropdown-item-impl.vue.d.ts +1 -1
  75. package/lib/components/dropdown/dropdown-item.vue.d.ts +1 -1
  76. package/lib/components/dropdown/dropdown.vue.d.ts +1 -1
  77. package/lib/components/dropdown/dropdown.vue2.cjs +1 -1
  78. package/lib/components/dropdown/index.d.ts +33 -33
  79. package/lib/components/empty/empty.vue2.cjs +1 -1
  80. package/lib/components/full-screen/full-screen.vue2.cjs +1 -1
  81. package/lib/components/image/image.vue2.cjs +1 -1
  82. package/lib/components/image-viewer/image-viewer.vue2.cjs +1 -1
  83. package/lib/components/index.cjs +1 -1
  84. package/lib/components/md-container/md-container.vue2.cjs +1 -1
  85. package/lib/components/md-container/toc.cjs +1 -1
  86. package/lib/components/message-box/message-box.vue2.cjs +1 -1
  87. package/lib/components/message-box/method.cjs +1 -1
  88. package/lib/components/modal/modal-footer-action.vue2.cjs +1 -1
  89. package/lib/components/multiple-tabs/multiple-tabs.vue2.cjs +1 -1
  90. package/lib/components/multiple-tabs/use/use-tab-dropdown.cjs +1 -1
  91. package/lib/components/popconfirm/popconfirm.vue2.cjs +1 -1
  92. package/lib/components/search/search.vue2.cjs +1 -1
  93. package/lib/components/select/useSelect.cjs +1 -1
  94. package/lib/components/super-form/super-form-item.vue2.cjs +1 -1
  95. package/lib/components/time-picker/time-picker-com/panel-time-pick.vue2.cjs +1 -1
  96. package/lib/components/time-picker/time-picker-com/panel-time-range.vue2.cjs +1 -1
  97. package/lib/components/transfer/transfer-panel.vue2.cjs +1 -1
  98. package/lib/components/transfer/transfer.vue2.cjs +1 -1
  99. package/lib/components/tree/tree.vue2.cjs +1 -1
  100. package/lib/components/upload/upload-content.vue2.cjs +1 -1
  101. package/lib/components/upload/upload-list.vue2.cjs +1 -1
  102. package/lib/components/upload/upload.vue2.cjs +1 -1
  103. package/lib/index.cjs +1 -1
  104. package/lib/index.d.ts +0 -1
  105. package/lib/package.json.cjs +1 -1
  106. package/lib/package.json.d.ts +1 -1
  107. package/package.json +3 -3
  108. package/theme-style/index.css +1 -1
  109. package/theme-style/src/image-viewer.scss +12 -0
  110. package/theme-style/src/message-box.scss +2 -2
  111. package/theme-style/src/table.scss +6 -0
  112. package/theme-style/vft-image-viewer.css +1 -1
  113. package/theme-style/vft-message-box.css +1 -1
  114. package/theme-style/vft-table.css +1 -1
  115. package/web-types.json +1 -1
  116. package/es/locale/index.d.js +0 -1
  117. package/es/locale/index.d.ts +0 -26
  118. package/es/locale/index.js +0 -10
  119. package/es/locale/lang/en.d.ts +0 -183
  120. package/es/locale/lang/en.js +0 -241
  121. package/es/locale/lang/zh-cn.d.ts +0 -183
  122. package/es/locale/lang/zh-cn.js +0 -241
  123. package/es/locale/lang/zh-tw.d.ts +0 -183
  124. package/es/locale/lang/zh-tw.js +0 -241
  125. package/es/locale/use-locale.d.ts +0 -17
  126. package/es/locale/use-locale.js +0 -56
  127. package/lib/locale/index.cjs +0 -1
  128. package/lib/locale/index.d.cjs +0 -1
  129. package/lib/locale/index.d.ts +0 -26
  130. package/lib/locale/lang/en.cjs +0 -1
  131. package/lib/locale/lang/en.d.ts +0 -183
  132. package/lib/locale/lang/zh-cn.cjs +0 -1
  133. package/lib/locale/lang/zh-cn.d.ts +0 -183
  134. package/lib/locale/lang/zh-tw.cjs +0 -1
  135. package/lib/locale/lang/zh-tw.d.ts +0 -183
  136. package/lib/locale/use-locale.cjs +0 -1
  137. package/lib/locale/use-locale.d.ts +0 -17
@@ -1,29 +1,28 @@
1
1
  import "../form/index.js";
2
- import { EVENT_CODE as Ot } from "../../constants/aria.js";
3
- import { UPDATE_MODEL_EVENT as It, CHANGE_EVENT as pt } from "../../constants/event.js";
2
+ import { EVENT_CODE as xt } from "../../constants/aria.js";
3
+ import { UPDATE_MODEL_EVENT as Ot, CHANGE_EVENT as It } from "../../constants/event.js";
4
4
  import { useResizeObserver as p } from "@vueuse/core";
5
- import { isArray as w, isFunction as A, isObject as te, isNumber as wt, isUndefined as yt } from "@vft/utils";
6
- import { debugWarn as le } from "../../utils/error.js";
5
+ import { isArray as w, isFunction as z, isObject as ee, isNumber as pt, isUndefined as wt } from "@vft/utils";
6
+ import { debugWarn as te } from "../../utils/error.js";
7
7
  import "../config-provider/hooks/use-global-config.js";
8
- import { reactive as Ct, ref as m, computed as o, toRaw as Et, watch as T, nextTick as h, watchEffect as Me, onMounted as Tt } from "vue";
9
- import { escapeStringRegexp as St } from "../../utils/vue/data-helper.js";
10
- import { debounce as Mt, get as _, isEqual as $, findLastIndex as Rt } from "lodash-es";
8
+ import { reactive as yt, ref as m, computed as o, toRaw as Ct, watch as T, nextTick as h, watchEffect as Se, onMounted as Et } from "vue";
9
+ import { escapeStringRegexp as Tt } from "../../utils/vue/data-helper.js";
10
+ import { debounce as St, get as A, isEqual as _, findLastIndex as Rt } from "lodash-es";
11
11
  import { useNamespace as Re } from "../../hooks/use-namespace/index.js";
12
12
  import "../../hooks/use-model-toggle/index.js";
13
13
  import "@popperjs/core";
14
14
  import "../../hooks/use-z-index/index.js";
15
- import { useComposition as Wt } from "../../hooks/use-composition/index.js";
16
- import { useFocusController as Ft } from "../../hooks/use-focus-controller/index.js";
17
- import { useEmptyValues as Lt } from "../../hooks/use-empty-values/index.js";
18
- import Nt from "../../locale/use-locale.js";
19
- import { useAllowCreate as Dt } from "./useAllowCreate.js";
20
- import { useProps as Ht } from "./useProps.js";
21
- import { useFormItem as Bt, useFormItemInputId as Pt } from "../form/hooks/use-form-item.js";
22
- import { useFormSize as Kt } from "../form/hooks/use-form-common-props.js";
23
- const sl = (t, v) => {
24
- const { t: S } = Nt(), G = Re("select"), We = Re("input"), { form: ne, formItem: M } = Bt(), { inputId: Fe } = Pt(t, {
25
- formItemContext: M
26
- }), { aliasProps: ae, getLabel: g, getValue: r, getDisabled: R, getOptions: Le } = Ht(t), { valueOnClear: Ne, isEmptyValue: ie } = Lt(t), l = Ct({
15
+ import { useComposition as Mt } from "../../hooks/use-composition/index.js";
16
+ import { useFocusController as Wt } from "../../hooks/use-focus-controller/index.js";
17
+ import { useEmptyValues as Ft } from "../../hooks/use-empty-values/index.js";
18
+ import { useAllowCreate as Lt } from "./useAllowCreate.js";
19
+ import { useProps as Nt } from "./useProps.js";
20
+ import { useFormItem as Dt, useFormItemInputId as Ht } from "../form/hooks/use-form-item.js";
21
+ import { useFormSize as Bt } from "../form/hooks/use-form-common-props.js";
22
+ const il = (t, v) => {
23
+ const $ = Re("select"), Me = Re("input"), { form: le, formItem: S } = Dt(), { inputId: We } = Ht(t, {
24
+ formItemContext: S
25
+ }), { aliasProps: ne, getLabel: g, getValue: d, getDisabled: R, getOptions: Fe } = Nt(t), { valueOnClear: Le, isEmptyValue: ae } = Ft(t), l = yt({
27
26
  inputValue: "",
28
27
  cachedOptions: [],
29
28
  createdOptions: [],
@@ -36,186 +35,186 @@ const sl = (t, v) => {
36
35
  selectedLabel: "",
37
36
  menuVisibleOnFocus: !1,
38
37
  isBeforeHide: !1
39
- }), W = m(-1), Q = m(), y = m(), F = m(), U = m(), V = m(), De = m(), He = m(), b = m(), oe = m(), L = m(), {
40
- isComposing: ue,
41
- handleCompositionStart: Be,
42
- handleCompositionEnd: Pe,
43
- handleCompositionUpdate: Ke
44
- } = Wt({
45
- afterComposition: (e) => Te(e)
46
- }), x = o(() => t.disabled || !!ne?.disabled), { wrapperRef: se, isFocused: ce, handleBlur: ke } = Ft(V, {
38
+ }), M = m(-1), G = m(), y = m(), W = m(), Q = m(), V = m(), Ne = m(), De = m(), b = m(), ie = m(), F = m(), {
39
+ isComposing: oe,
40
+ handleCompositionStart: He,
41
+ handleCompositionEnd: Be,
42
+ handleCompositionUpdate: Pe
43
+ } = Mt({
44
+ afterComposition: (e) => Ee(e)
45
+ }), x = o(() => t.disabled || !!le?.disabled), { wrapperRef: ue, isFocused: se, handleBlur: Ke } = Wt(V, {
47
46
  disabled: x,
48
47
  afterFocus() {
49
48
  t.automaticDropdown && !u.value && (u.value = !0, l.menuVisibleOnFocus = !0);
50
49
  },
51
50
  beforeBlur(e) {
52
- return F.value?.isFocusInsideContent(e) || U.value?.isFocusInsideContent(e);
51
+ return W.value?.isFocusInsideContent(e) || Q.value?.isFocusInsideContent(e);
53
52
  },
54
53
  afterBlur() {
55
- u.value = !1, l.menuVisibleOnFocus = !1, t.validateEvent && M?.validate?.("blur").catch((e) => le(e));
54
+ u.value = !1, l.menuVisibleOnFocus = !1, t.validateEvent && S?.validate?.("blur").catch((e) => te(e));
56
55
  }
57
- }), re = o(() => he("")), N = o(() => t.loading ? !1 : t.options.length > 0 || l.createdOptions.length > 0), s = m([]), u = m(!1), ze = o(() => ne?.statusIcon ?? !1), Ae = o(() => {
56
+ }), ce = o(() => me("")), L = o(() => t.loading ? !1 : t.options.length > 0 || l.createdOptions.length > 0), s = m([]), u = m(!1), ke = o(() => le?.statusIcon ?? !1), ze = o(() => {
58
57
  const e = s.value.length * t.itemHeight;
59
58
  return e > t.height ? t.height : e;
60
- }), D = o(() => t.multiple ? w(t.modelValue) && t.modelValue.length > 0 : !ie(t.modelValue)), _e = o(() => t.clearable && !x.value && l.inputHovering && D.value), de = o(
59
+ }), N = o(() => t.multiple ? w(t.modelValue) && t.modelValue.length > 0 : !ae(t.modelValue)), Ae = o(() => t.clearable && !x.value && l.inputHovering && N.value), de = o(
61
60
  () => t.remote && t.filterable ? "" : "icon-arrow-down"
62
- ), $e = o(
63
- () => de.value && G.is("reverse", u.value)
64
- ), Ge = o(() => M?.validateState || ""), Qe = "validateIcon", fe = o(() => t.remote ? 300 : 0), me = o(() => t.loading ? t.loadingText || S("vft.select.loading") : t.remote && !l.inputValue && !N.value ? !1 : t.filterable && l.inputValue && N.value && s.value.length === 0 ? t.noMatchText || S("vft.select.noMatch") : N.value ? null : t.noDataText || S("vft.select.noData")), he = (e) => {
65
- const n = new RegExp(St(e), "i"), { filterMethod: a, remoteMethod: i } = Et(t), c = t.filterable && A(a), f = t.filterable && t.remote && A(i), K = (O) => c || f ? !0 : e ? n.test(g(O) || "") : !0;
61
+ ), _e = o(
62
+ () => de.value && $.is("reverse", u.value)
63
+ ), $e = o(() => S?.validateState || ""), Ge = "validateIcon", re = o(() => t.remote ? 300 : 0), fe = o(() => t.loading ? t.loadingText || "加载中" : t.remote && !l.inputValue && !L.value ? !1 : t.filterable && l.inputValue && L.value && s.value.length === 0 ? t.noMatchText || "无匹配数据" : L.value ? null : t.noDataText || "暂无数据"), me = (e) => {
64
+ const n = new RegExp(Tt(e), "i"), { filterMethod: a, remoteMethod: i } = Ct(t), c = t.filterable && z(a), f = t.filterable && t.remote && z(i), P = (O) => c || f ? !0 : e ? n.test(g(O) || "") : !0;
66
65
  return t.loading ? [] : [...l.createdOptions, ...t.options].reduce((O, I) => {
67
- const k = Le(I);
68
- if (w(k)) {
69
- const z = k.filter(K);
70
- z.length > 0 && O.push(
66
+ const K = Fe(I);
67
+ if (w(K)) {
68
+ const k = K.filter(P);
69
+ k.length > 0 && O.push(
71
70
  {
72
71
  label: g(I),
73
72
  type: "Group"
74
73
  },
75
- ...z
74
+ ...k
76
75
  );
77
- } else (t.remote || K(I)) && O.push(I);
76
+ } else (t.remote || P(I)) && O.push(I);
78
77
  return O;
79
78
  }, []);
80
- }, ve = () => {
81
- s.value = he(l.inputValue);
82
- }, ge = o(() => {
79
+ }, he = () => {
80
+ s.value = me(l.inputValue);
81
+ }, ve = o(() => {
83
82
  const e = /* @__PURE__ */ new Map();
84
- return re.value.forEach((n, a) => {
85
- e.set(d(r(n)), { option: n, index: a });
83
+ return ce.value.forEach((n, a) => {
84
+ e.set(r(d(n)), { option: n, index: a });
86
85
  }), e;
87
- }), H = o(() => {
86
+ }), D = o(() => {
88
87
  const e = /* @__PURE__ */ new Map();
89
88
  return s.value.forEach((n, a) => {
90
- e.set(d(r(n)), { option: n, index: a });
89
+ e.set(r(d(n)), { option: n, index: a });
91
90
  }), e;
92
- }), Ue = o(
91
+ }), Qe = o(
93
92
  () => s.value.every((e) => R(e))
94
- ), Ve = Kt(), je = o(
95
- () => Ve.value === "small" ? "small" : "default"
93
+ ), ge = Bt(), Ue = o(
94
+ () => ge.value === "small" ? "small" : "default"
96
95
  ), C = () => {
97
- if (wt(t.fitInputWidth)) {
98
- W.value = t.fitInputWidth;
96
+ if (pt(t.fitInputWidth)) {
97
+ M.value = t.fitInputWidth;
99
98
  return;
100
99
  }
101
- const e = Q.value?.offsetWidth || 200;
102
- !t.fitInputWidth && N.value ? h(() => {
103
- W.value = Math.max(e, qe());
104
- }) : W.value = e;
105
- }, qe = () => {
106
- const n = document.createElement("canvas").getContext("2d"), a = G.be("dropdown", "item"), c = (b.value?.listRef?.innerRef || document).querySelector(`.${a}`);
100
+ const e = G.value?.offsetWidth || 200;
101
+ !t.fitInputWidth && L.value ? h(() => {
102
+ M.value = Math.max(e, je());
103
+ }) : M.value = e;
104
+ }, je = () => {
105
+ const n = document.createElement("canvas").getContext("2d"), a = $.be("dropdown", "item"), c = (b.value?.listRef?.innerRef || document).querySelector(`.${a}`);
107
106
  if (c === null || n === null) return 0;
108
- const f = getComputedStyle(c), K = Number.parseFloat(f.paddingLeft) + Number.parseFloat(f.paddingRight);
107
+ const f = getComputedStyle(c), P = Number.parseFloat(f.paddingLeft) + Number.parseFloat(f.paddingRight);
109
108
  return n.font = `bold ${f.font.replace(
110
109
  new RegExp(`\\b${f.fontWeight}\\b`),
111
110
  ""
112
- )}`, s.value.reduce((I, k) => {
113
- const z = n.measureText(g(k));
114
- return Math.max(z.width, I);
115
- }, 0) + K;
116
- }, Je = () => {
111
+ )}`, s.value.reduce((I, K) => {
112
+ const k = n.measureText(g(K));
113
+ return Math.max(k.width, I);
114
+ }, 0) + P;
115
+ }, qe = () => {
117
116
  if (!y.value) return 0;
118
117
  const e = window.getComputedStyle(y.value);
119
118
  return Number.parseFloat(e.gap || "6px");
120
- }, Xe = o(() => {
121
- const e = Je();
122
- return { maxWidth: `${L.value && t.maxCollapseTags === 1 ? l.selectionWidth - l.collapseItemWidth - e : l.selectionWidth}px` };
123
- }), Ye = o(() => ({ maxWidth: `${l.selectionWidth}px` })), Ze = o(() => w(t.modelValue) ? t.modelValue.length === 0 && !l.inputValue : t.filterable ? !l.inputValue : !0), et = o(() => {
124
- const e = t.placeholder || S("vft.select.placeholder");
125
- return t.multiple || !D.value ? e : l.selectedLabel;
126
- }), tt = o(() => F.value?.popperRef?.contentRef), lt = o(() => {
119
+ }, Je = o(() => {
120
+ const e = qe();
121
+ return { maxWidth: `${F.value && t.maxCollapseTags === 1 ? l.selectionWidth - l.collapseItemWidth - e : l.selectionWidth}px` };
122
+ }), Xe = o(() => ({ maxWidth: `${l.selectionWidth}px` })), Ye = o(() => w(t.modelValue) ? t.modelValue.length === 0 && !l.inputValue : t.filterable ? !l.inputValue : !0), Ze = o(() => {
123
+ const e = t.placeholder || "请选择";
124
+ return t.multiple || !N.value ? e : l.selectedLabel;
125
+ }), et = o(() => W.value?.popperRef?.contentRef), tt = o(() => {
127
126
  if (t.multiple) {
128
127
  const e = t.modelValue.length;
129
- if (t.modelValue.length > 0 && H.value.has(t.modelValue[e - 1])) {
130
- const { index: n } = H.value.get(
128
+ if (t.modelValue.length > 0 && D.value.has(t.modelValue[e - 1])) {
129
+ const { index: n } = D.value.get(
131
130
  t.modelValue[e - 1]
132
131
  );
133
132
  return n;
134
133
  }
135
- } else if (!ie(t.modelValue) && H.value.has(t.modelValue)) {
136
- const { index: e } = H.value.get(t.modelValue);
134
+ } else if (!ae(t.modelValue) && D.value.has(t.modelValue)) {
135
+ const { index: e } = D.value.get(t.modelValue);
137
136
  return e;
138
137
  }
139
138
  return -1;
140
- }), nt = o({
139
+ }), lt = o({
141
140
  get() {
142
- return u.value && me.value !== !1;
141
+ return u.value && fe.value !== !1;
143
142
  },
144
143
  set(e) {
145
144
  u.value = e;
146
145
  }
147
- }), at = o(() => t.multiple ? t.collapseTags ? l.cachedOptions.slice(0, t.maxCollapseTags) : l.cachedOptions : []), it = o(() => t.multiple ? t.collapseTags ? l.cachedOptions.slice(t.maxCollapseTags) : [] : []), {
148
- createNewOption: be,
149
- removeNewOption: j,
150
- selectNewOption: xe,
151
- clearAllNewOption: q
152
- } = Dt(t, l), J = () => {
146
+ }), nt = o(() => t.multiple ? t.collapseTags ? l.cachedOptions.slice(0, t.maxCollapseTags) : l.cachedOptions : []), at = o(() => t.multiple ? t.collapseTags ? l.cachedOptions.slice(t.maxCollapseTags) : [] : []), {
147
+ createNewOption: Ve,
148
+ removeNewOption: U,
149
+ selectNewOption: be,
150
+ clearAllNewOption: j
151
+ } = Lt(t, l), q = () => {
153
152
  x.value || (l.menuVisibleOnFocus ? l.menuVisibleOnFocus = !1 : u.value = !u.value);
154
- }, Oe = () => {
155
- l.inputValue.length > 0 && !u.value && (u.value = !0), be(l.inputValue), h(() => {
156
- X(l.inputValue);
153
+ }, xe = () => {
154
+ l.inputValue.length > 0 && !u.value && (u.value = !0), Ve(l.inputValue), h(() => {
155
+ J(l.inputValue);
157
156
  });
158
- }, Ie = Mt(Oe, fe.value), X = (e) => {
159
- l.previousQuery === e || ue.value || (l.previousQuery = e, t.filterable && A(t.filterMethod) ? t.filterMethod(e) : t.filterable && t.remote && A(t.remoteMethod) && t.remoteMethod(e), t.defaultFirstOption && (t.filterable || t.remote) && s.value.length ? h(ot) : h(Vt));
160
- }, ot = () => {
157
+ }, Oe = St(xe, re.value), J = (e) => {
158
+ l.previousQuery === e || oe.value || (l.previousQuery = e, t.filterable && z(t.filterMethod) ? t.filterMethod(e) : t.filterable && t.remote && z(t.remoteMethod) && t.remoteMethod(e), t.defaultFirstOption && (t.filterable || t.remote) && s.value.length ? h(it) : h(gt));
159
+ }, it = () => {
161
160
  const e = s.value.filter(
162
161
  (i) => !i.disabled && i.type !== "Group"
163
162
  ), n = e.find((i) => i.created), a = e[0];
164
- l.hoveringIndex = Y(
163
+ l.hoveringIndex = X(
165
164
  s.value,
166
165
  n || a
167
166
  );
168
- }, ut = (e) => {
169
- $(t.modelValue, e) || v(pt, e);
167
+ }, ot = (e) => {
168
+ _(t.modelValue, e) || v(It, e);
170
169
  }, E = (e) => {
171
- v(It, e), ut(e), l.previousValue = t.multiple ? String(e) : e, h(() => {
170
+ v(Ot, e), ot(e), l.previousValue = t.multiple ? String(e) : e, h(() => {
172
171
  if (t.multiple && w(t.modelValue)) {
173
172
  const n = l.cachedOptions.slice(), a = t.modelValue.map(
174
- (i) => Se(i, n)
173
+ (i) => Te(i, n)
175
174
  );
176
- $(l.cachedOptions, a) || (l.cachedOptions = a);
175
+ _(l.cachedOptions, a) || (l.cachedOptions = a);
177
176
  } else
178
- P(!0);
177
+ B(!0);
179
178
  });
180
- }, Y = (e = [], n) => {
181
- if (!te(n))
179
+ }, X = (e = [], n) => {
180
+ if (!ee(n))
182
181
  return e.indexOf(n);
183
182
  const a = t.valueKey;
184
183
  let i = -1;
185
- return e.some((c, f) => _(c, a) === _(n, a) ? (i = f, !0) : !1), i;
186
- }, d = (e) => te(e) ? _(e, t.valueKey) : e, pe = () => {
184
+ return e.some((c, f) => A(c, a) === A(n, a) ? (i = f, !0) : !1), i;
185
+ }, r = (e) => ee(e) ? A(e, t.valueKey) : e, Ie = () => {
187
186
  C();
188
- }, we = () => {
187
+ }, pe = () => {
189
188
  l.selectionWidth = Number.parseFloat(
190
189
  window.getComputedStyle(y.value).width
191
190
  );
192
- }, st = () => {
193
- l.collapseItemWidth = L.value.getBoundingClientRect().width;
194
- }, Z = () => {
195
- F.value?.updatePopper?.();
196
- }, ye = () => {
197
- U.value?.updatePopper?.();
198
- }, Ce = (e) => {
191
+ }, ut = () => {
192
+ l.collapseItemWidth = F.value.getBoundingClientRect().width;
193
+ }, Y = () => {
194
+ W.value?.updatePopper?.();
195
+ }, we = () => {
196
+ Q.value?.updatePopper?.();
197
+ }, ye = (e) => {
199
198
  if (t.multiple) {
200
199
  let n = t.modelValue.slice();
201
- const a = Y(n, r(e));
200
+ const a = X(n, d(e));
202
201
  a > -1 ? (n = [
203
202
  ...n.slice(0, a),
204
203
  ...n.slice(a + 1)
205
- ], l.cachedOptions.splice(a, 1), j(e)) : (t.multipleLimit <= 0 || n.length < t.multipleLimit) && (n = [...n, r(e)], l.cachedOptions.push(e), xe(e)), E(n), e.created && X(""), t.filterable && !t.reserveKeyword && (l.inputValue = "");
204
+ ], l.cachedOptions.splice(a, 1), U(e)) : (t.multipleLimit <= 0 || n.length < t.multipleLimit) && (n = [...n, d(e)], l.cachedOptions.push(e), be(e)), E(n), e.created && J(""), t.filterable && !t.reserveKeyword && (l.inputValue = "");
206
205
  } else
207
- l.selectedLabel = g(e), E(r(e)), u.value = !1, xe(e), e.created || q();
208
- B();
209
- }, ct = (e, n) => {
206
+ l.selectedLabel = g(e), E(d(e)), u.value = !1, be(e), e.created || j();
207
+ H();
208
+ }, st = (e, n) => {
210
209
  let a = t.modelValue.slice();
211
- const i = Y(a, r(n));
210
+ const i = X(a, d(n));
212
211
  i > -1 && !x.value && (a = [
213
212
  ...t.modelValue.slice(0, i),
214
213
  ...t.modelValue.slice(i + 1)
215
- ], l.cachedOptions.splice(i, 1), E(a), v("remove-tag", r(n)), j(n)), e.stopPropagation(), B();
216
- }, B = () => {
214
+ ], l.cachedOptions.splice(i, 1), E(a), v("remove-tag", d(n)), U(n)), e.stopPropagation(), H();
215
+ }, H = () => {
217
216
  V.value?.focus();
218
- }, rt = () => {
217
+ }, ct = () => {
219
218
  if (u.value) {
220
219
  u.value = !1, h(() => V.value?.blur());
221
220
  return;
@@ -223,100 +222,100 @@ const sl = (t, v) => {
223
222
  V.value?.blur();
224
223
  }, dt = () => {
225
224
  l.inputValue.length > 0 ? l.inputValue = "" : u.value = !1;
226
- }, ft = (e) => Rt(
225
+ }, rt = (e) => Rt(
227
226
  e,
228
227
  (n) => !l.cachedOptions.some(
229
- (a) => r(a) === n && R(a)
228
+ (a) => d(a) === n && R(a)
230
229
  )
231
- ), mt = (e) => {
232
- if (t.multiple && e.code !== Ot.delete && l.inputValue.length === 0) {
230
+ ), ft = (e) => {
231
+ if (t.multiple && e.code !== xt.delete && l.inputValue.length === 0) {
233
232
  e.preventDefault();
234
- const n = t.modelValue.slice(), a = ft(n);
233
+ const n = t.modelValue.slice(), a = rt(n);
235
234
  if (a < 0) return;
236
235
  const i = n[a];
237
236
  n.splice(a, 1);
238
237
  const c = l.cachedOptions[a];
239
- l.cachedOptions.splice(a, 1), j(c), E(n), v("remove-tag", i);
238
+ l.cachedOptions.splice(a, 1), U(c), E(n), v("remove-tag", i);
240
239
  }
241
- }, ht = () => {
240
+ }, mt = () => {
242
241
  let e;
243
- w(t.modelValue) ? e = [] : e = Ne.value, l.selectedLabel = "", u.value = !1, E(e), v("clear"), q(), B();
244
- }, Ee = (e, n = void 0) => {
242
+ w(t.modelValue) ? e = [] : e = Le.value, l.selectedLabel = "", u.value = !1, E(e), v("clear"), j(), H();
243
+ }, Ce = (e, n = void 0) => {
245
244
  const a = s.value;
246
- if (!["forward", "backward"].includes(e) || x.value || a.length <= 0 || Ue.value || ue.value)
245
+ if (!["forward", "backward"].includes(e) || x.value || a.length <= 0 || Qe.value || oe.value)
247
246
  return;
248
247
  if (!u.value)
249
- return J();
250
- yt(n) && (n = l.hoveringIndex);
248
+ return q();
249
+ wt(n) && (n = l.hoveringIndex);
251
250
  let i = -1;
252
251
  e === "forward" ? (i = n + 1, i >= a.length && (i = 0)) : e === "backward" && (i = n - 1, (i < 0 || i >= a.length) && (i = a.length - 1));
253
252
  const c = a[i];
254
253
  if (R(c) || c.type === "Group")
255
- return Ee(e, i);
256
- l.hoveringIndex = i, ee(i);
257
- }, vt = () => {
254
+ return Ce(e, i);
255
+ l.hoveringIndex = i, Z(i);
256
+ }, ht = () => {
258
257
  if (u.value)
259
- ~l.hoveringIndex && s.value[l.hoveringIndex] && Ce(s.value[l.hoveringIndex]);
260
- else return J();
261
- }, gt = (e) => {
258
+ ~l.hoveringIndex && s.value[l.hoveringIndex] && ye(s.value[l.hoveringIndex]);
259
+ else return q();
260
+ }, vt = (e) => {
262
261
  l.hoveringIndex = e ?? -1;
263
- }, Vt = () => {
262
+ }, gt = () => {
264
263
  t.multiple ? l.hoveringIndex = s.value.findIndex(
265
264
  (e) => t.modelValue.some(
266
- (n) => d(n) === d(r(e))
265
+ (n) => r(n) === r(d(e))
267
266
  )
268
- ) : l.hoveringIndex = s.value.findIndex((e) => d(r(e)) === d(t.modelValue));
269
- }, Te = (e) => {
267
+ ) : l.hoveringIndex = s.value.findIndex((e) => r(d(e)) === r(t.modelValue));
268
+ }, Ee = (e) => {
270
269
  if (l.inputValue = e.target.value, t.remote)
271
- Ie();
270
+ Oe();
272
271
  else
273
- return Oe();
274
- }, bt = (e) => {
275
- if (u.value = !1, ce.value) {
272
+ return xe();
273
+ }, Vt = (e) => {
274
+ if (u.value = !1, se.value) {
276
275
  const n = new FocusEvent("focus", e);
277
- ke(n);
276
+ Ke(n);
278
277
  }
279
- }, xt = () => (l.isBeforeHide = !1, h(() => {
280
- ~lt.value && ee(l.hoveringIndex);
281
- })), ee = (e) => {
278
+ }, bt = () => (l.isBeforeHide = !1, h(() => {
279
+ ~tt.value && Z(l.hoveringIndex);
280
+ })), Z = (e) => {
282
281
  b.value.scrollToItem(e);
283
- }, Se = (e, n) => {
284
- const a = d(e);
285
- if (ge.value.has(a)) {
286
- const { option: i } = ge.value.get(a);
282
+ }, Te = (e, n) => {
283
+ const a = r(e);
284
+ if (ve.value.has(a)) {
285
+ const { option: i } = ve.value.get(a);
287
286
  return i;
288
287
  }
289
288
  if (n && n.length) {
290
289
  const i = n.find(
291
- (c) => d(r(c)) === a
290
+ (c) => r(d(c)) === a
292
291
  );
293
292
  if (i)
294
293
  return i;
295
294
  }
296
295
  return {
297
- [ae.value.value]: e,
298
- [ae.value.label]: e
296
+ [ne.value.value]: e,
297
+ [ne.value.label]: e
299
298
  };
300
- }, P = (e = !1) => {
299
+ }, B = (e = !1) => {
301
300
  if (t.multiple)
302
301
  if (t.modelValue.length > 0) {
303
302
  const n = l.cachedOptions.slice();
304
303
  l.cachedOptions.length = 0, l.previousValue = t.modelValue.toString();
305
304
  for (const a of t.modelValue) {
306
- const i = Se(a, n);
305
+ const i = Te(a, n);
307
306
  l.cachedOptions.push(i);
308
307
  }
309
308
  } else
310
309
  l.cachedOptions = [], l.previousValue = void 0;
311
- else if (D.value) {
310
+ else if (N.value) {
312
311
  l.previousValue = t.modelValue;
313
312
  const n = s.value, a = n.findIndex(
314
- (i) => d(r(i)) === d(t.modelValue)
313
+ (i) => r(d(i)) === r(t.modelValue)
315
314
  );
316
- ~a ? l.selectedLabel = g(n[a]) : (!l.selectedLabel || e) && (l.selectedLabel = d(t.modelValue));
315
+ ~a ? l.selectedLabel = g(n[a]) : (!l.selectedLabel || e) && (l.selectedLabel = r(t.modelValue));
317
316
  } else
318
317
  l.selectedLabel = "", l.previousValue = void 0;
319
- q(), C();
318
+ j(), C();
320
319
  };
321
320
  return T(
322
321
  () => t.fitInputWidth,
@@ -324,11 +323,11 @@ const sl = (t, v) => {
324
323
  C();
325
324
  }
326
325
  ), T(u, (e) => {
327
- e ? (t.persistent || C(), X("")) : (l.inputValue = "", l.previousQuery = null, l.isBeforeHide = !0, be("")), v("visible-change", e);
326
+ e ? (t.persistent || C(), J("")) : (l.inputValue = "", l.previousQuery = null, l.isBeforeHide = !0, Ve("")), v("visible-change", e);
328
327
  }), T(
329
328
  () => t.modelValue,
330
329
  (e, n) => {
331
- (!e || w(e) && e.length === 0 || t.multiple && !$(e.toString(), l.previousValue) || !t.multiple && d(e) !== d(l.previousValue)) && P(!0), !$(e, n) && t.validateEvent && M?.validate?.("change").catch((i) => le(i));
330
+ (!e || w(e) && e.length === 0 || t.multiple && !_(e.toString(), l.previousValue) || !t.multiple && r(e) !== r(l.previousValue)) && B(!0), !_(e, n) && t.validateEvent && S?.validate?.("change").catch((i) => te(i));
332
331
  },
333
332
  {
334
333
  deep: !0
@@ -337,7 +336,7 @@ const sl = (t, v) => {
337
336
  () => t.options,
338
337
  () => {
339
338
  const e = V.value;
340
- (!e || e && document.activeElement !== e) && P();
339
+ (!e || e && document.activeElement !== e) && B();
341
340
  },
342
341
  {
343
342
  deep: !0,
@@ -346,15 +345,15 @@ const sl = (t, v) => {
346
345
  ), T(
347
346
  () => s.value,
348
347
  () => (C(), b.value && h(b.value.resetScrollTop))
349
- ), Me(() => {
350
- l.isBeforeHide || ve();
351
- }), Me(() => {
348
+ ), Se(() => {
349
+ l.isBeforeHide || he();
350
+ }), Se(() => {
352
351
  const { valueKey: e, options: n } = t, a = /* @__PURE__ */ new Map();
353
352
  for (const i of n) {
354
- const c = r(i);
353
+ const c = d(i);
355
354
  let f = c;
356
- if (te(f) && (f = _(c, e)), a.get(f)) {
357
- le(
355
+ if (ee(f) && (f = A(c, e)), a.get(f)) {
356
+ te(
358
357
  "ElSelectV2",
359
358
  "The option values you provided seem to be duplicated, which may cause some problems, please check."
360
359
  );
@@ -362,83 +361,83 @@ const sl = (t, v) => {
362
361
  } else
363
362
  a.set(f, !0);
364
363
  }
365
- }), Tt(() => {
366
- P();
367
- }), p(Q, pe), p(y, we), p(b, Z), p(se, Z), p(oe, ye), p(L, st), {
364
+ }), Et(() => {
365
+ B();
366
+ }), p(G, Ie), p(y, pe), p(b, Y), p(ue, Y), p(ie, we), p(F, ut), {
368
367
  // data exports
369
- inputId: Fe,
370
- collapseTagSize: je,
371
- currentPlaceholder: et,
368
+ inputId: We,
369
+ collapseTagSize: Ue,
370
+ currentPlaceholder: Ze,
372
371
  expanded: u,
373
- emptyText: me,
374
- popupHeight: Ae,
375
- debounce: fe,
376
- allOptions: re,
372
+ emptyText: fe,
373
+ popupHeight: ze,
374
+ debounce: re,
375
+ allOptions: ce,
377
376
  filteredOptions: s,
378
377
  iconComponent: de,
379
- iconReverse: $e,
380
- tagStyle: Xe,
381
- collapseTagStyle: Ye,
382
- popperSize: W,
383
- dropdownMenuVisible: nt,
384
- hasModelValue: D,
385
- shouldShowPlaceholder: Ze,
378
+ iconReverse: _e,
379
+ tagStyle: Je,
380
+ collapseTagStyle: Xe,
381
+ popperSize: M,
382
+ dropdownMenuVisible: lt,
383
+ hasModelValue: N,
384
+ shouldShowPlaceholder: Ye,
386
385
  selectDisabled: x,
387
- selectSize: Ve,
388
- needStatusIcon: ze,
389
- showClearBtn: _e,
386
+ selectSize: ge,
387
+ needStatusIcon: ke,
388
+ showClearBtn: Ae,
390
389
  states: l,
391
- isFocused: ce,
392
- nsSelect: G,
393
- nsInput: We,
390
+ isFocused: se,
391
+ nsSelect: $,
392
+ nsInput: Me,
394
393
  // refs items exports
395
394
  inputRef: V,
396
395
  menuRef: b,
397
- tagMenuRef: oe,
398
- tooltipRef: F,
399
- tagTooltipRef: U,
400
- selectRef: Q,
401
- wrapperRef: se,
396
+ tagMenuRef: ie,
397
+ tooltipRef: W,
398
+ tagTooltipRef: Q,
399
+ selectRef: G,
400
+ wrapperRef: ue,
402
401
  selectionRef: y,
403
- prefixRef: De,
404
- suffixRef: He,
405
- collapseItemRef: L,
406
- popperRef: tt,
407
- validateState: Ge,
408
- validateIcon: Qe,
409
- showTagList: at,
410
- collapseTagList: it,
402
+ prefixRef: Ne,
403
+ suffixRef: De,
404
+ collapseItemRef: F,
405
+ popperRef: et,
406
+ validateState: $e,
407
+ validateIcon: Ge,
408
+ showTagList: nt,
409
+ collapseTagList: at,
411
410
  // methods exports
412
- debouncedOnInputChange: Ie,
413
- deleteTag: ct,
411
+ debouncedOnInputChange: Oe,
412
+ deleteTag: st,
414
413
  getLabel: g,
415
- getValue: r,
414
+ getValue: d,
416
415
  getDisabled: R,
417
- getValueKey: d,
418
- handleClear: ht,
419
- handleClickOutside: bt,
420
- handleDel: mt,
416
+ getValueKey: r,
417
+ handleClear: mt,
418
+ handleClickOutside: Vt,
419
+ handleDel: ft,
421
420
  handleEsc: dt,
422
- focus: B,
423
- blur: rt,
424
- handleMenuEnter: xt,
425
- handleResize: pe,
426
- resetSelectionWidth: we,
427
- updateTooltip: Z,
428
- updateTagTooltip: ye,
429
- updateOptions: ve,
430
- toggleMenu: J,
431
- scrollTo: ee,
432
- onInput: Te,
433
- onKeyboardNavigate: Ee,
434
- onKeyboardSelect: vt,
435
- onSelect: Ce,
436
- onHover: gt,
437
- handleCompositionStart: Be,
438
- handleCompositionEnd: Pe,
439
- handleCompositionUpdate: Ke
421
+ focus: H,
422
+ blur: ct,
423
+ handleMenuEnter: bt,
424
+ handleResize: Ie,
425
+ resetSelectionWidth: pe,
426
+ updateTooltip: Y,
427
+ updateTagTooltip: we,
428
+ updateOptions: he,
429
+ toggleMenu: q,
430
+ scrollTo: Z,
431
+ onInput: Ee,
432
+ onKeyboardNavigate: Ce,
433
+ onKeyboardSelect: ht,
434
+ onSelect: ye,
435
+ onHover: vt,
436
+ handleCompositionStart: He,
437
+ handleCompositionEnd: Be,
438
+ handleCompositionUpdate: Pe
440
439
  };
441
440
  };
442
441
  export {
443
- sl as default
442
+ il as default
444
443
  };