ep-craft 0.1.26 → 0.1.28

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 (87) hide show
  1. package/dist/components/date-picker/src/date-picker.js +38 -34
  2. package/dist/components/date-picker/src/props.js +19 -7
  3. package/dist/components/form/EpForm.vue.d.ts +61 -0
  4. package/dist/components/form/EpForm.vue.js +199 -0
  5. package/dist/components/form/EpForm2.vue.js +4 -0
  6. package/dist/components/form/index.d.ts +12 -2
  7. package/dist/components/form/index.js +9 -3
  8. package/dist/components/form/instance.d.ts +2 -0
  9. package/dist/components/form/src/form-item.d.ts +103 -0
  10. package/dist/components/form/src/form-item.js +91 -0
  11. package/dist/components/form/src/form-label-wrap.d.ts +11 -0
  12. package/dist/components/form/src/form-label-wrap.js +74 -0
  13. package/dist/components/form/src/form.d.ts +127 -0
  14. package/dist/components/form/src/form.js +112 -0
  15. package/dist/components/form/src/types.d.ts +48 -19
  16. package/dist/components/form/src/utils.d.ts +9 -0
  17. package/dist/components/form/src/utils.js +45 -0
  18. package/dist/components/form-item/EpFormItem.vue.d.ts +55 -0
  19. package/dist/components/form-item/EpFormItem.vue.js +257 -0
  20. package/dist/components/form-item/EpFormItem2.vue.js +4 -0
  21. package/dist/components/form-item/index.d.ts +5 -2
  22. package/dist/components/form-item/index.js +5 -3
  23. package/dist/components/form-item/instance.d.ts +2 -0
  24. package/dist/components/scrollbar/index.d.ts +1 -0
  25. package/dist/components/scrollbar/src/util.d.ts +40 -0
  26. package/dist/components/scrollbar/src/util.js +25 -0
  27. package/dist/components/select/select.vue.d.ts +9 -9
  28. package/dist/components/select/src/useSelect.d.ts +3 -3
  29. package/dist/components/select-v2/index.d.ts +6 -2
  30. package/dist/components/select-v2/index.js +7 -4
  31. package/dist/components/select-v2/src/defaults.d.ts +258 -0
  32. package/dist/components/select-v2/src/defaults.js +359 -0
  33. package/dist/components/select-v2/src/group-item.vue.d.ts +40 -0
  34. package/dist/components/select-v2/src/group-item.vue.js +13 -0
  35. package/dist/components/select-v2/src/group-item2.vue.js +33 -0
  36. package/dist/components/select-v2/src/option-item.vue.d.ts +66 -0
  37. package/dist/components/select-v2/src/option-item.vue.js +37 -0
  38. package/dist/components/select-v2/src/option-item2.vue.js +46 -0
  39. package/dist/components/select-v2/src/select-dropdown.d.ts +53 -0
  40. package/dist/components/select-v2/src/select-dropdown.js +209 -0
  41. package/dist/components/select-v2/src/select.types.d.ts +2 -1
  42. package/dist/components/select-v2/src/select.vue.d.ts +918 -0
  43. package/dist/components/select-v2/src/select.vue.js +388 -0
  44. package/dist/components/select-v2/src/select2.vue.js +86 -0
  45. package/dist/components/select-v2/src/token.d.ts +16 -0
  46. package/dist/components/select-v2/src/token.js +6 -0
  47. package/dist/components/select-v2/src/useAllowCreate.d.ts +8 -0
  48. package/dist/components/select-v2/src/useAllowCreate.js +64 -0
  49. package/dist/components/select-v2/src/useOption.d.ts +7 -0
  50. package/dist/components/select-v2/src/useOption.js +13 -0
  51. package/dist/components/select-v2/src/useProps.d.ts +2 -3
  52. package/dist/components/select-v2/src/useSelect.d.ts +129 -0
  53. package/dist/components/select-v2/src/useSelect.js +501 -0
  54. package/dist/components/time-picker/index.js +10 -11
  55. package/dist/components/time-picker/src/common/picker.vue.d.ts +131 -125
  56. package/dist/components/time-picker/src/common/picker.vue.js +163 -160
  57. package/dist/components/time-picker/src/common/props.d.ts +0 -1
  58. package/dist/components/time-picker/src/common/props.js +13 -14
  59. package/dist/components/time-picker/src/time-picker.d.ts +0 -3
  60. package/dist/components/virtual-list/index.d.ts +8 -0
  61. package/dist/components/virtual-list/src/builders/build-list.d.ts +187 -0
  62. package/dist/components/virtual-list/src/builders/build-list.js +363 -0
  63. package/dist/components/virtual-list/src/components/dynamic-size-list.d.ts +186 -0
  64. package/dist/components/virtual-list/src/components/dynamic-size-list.js +112 -0
  65. package/dist/components/virtual-list/src/components/fixed-size-list.d.ts +185 -0
  66. package/dist/components/virtual-list/src/components/fixed-size-list.js +68 -0
  67. package/dist/components/virtual-list/src/components/scrollbar.d.ts +79 -0
  68. package/dist/components/virtual-list/src/components/scrollbar.js +134 -0
  69. package/dist/components/virtual-list/src/defaults.d.ts +27 -0
  70. package/dist/components/virtual-list/src/defaults.js +26 -0
  71. package/dist/components/virtual-list/src/hooks/use-cache.d.ts +1 -0
  72. package/dist/components/virtual-list/src/hooks/use-cache.js +13 -0
  73. package/dist/components/virtual-list/src/hooks/use-wheel.d.ts +13 -0
  74. package/dist/components/virtual-list/src/hooks/use-wheel.js +26 -0
  75. package/dist/components/virtual-list/src/props.d.ts +211 -0
  76. package/dist/components/virtual-list/src/props.js +151 -0
  77. package/dist/components/virtual-list/src/types.d.ts +152 -0
  78. package/dist/components/virtual-list/src/utils.d.ts +16 -0
  79. package/dist/components/virtual-list/src/utils.js +22 -0
  80. package/dist/hooks/use-float-label/index.d.ts +6 -2
  81. package/dist/hooks/use-float-label/index.js +11 -7
  82. package/dist/index.css +1 -1
  83. package/dist/utils/objects.js +11 -3
  84. package/dist/vendored-components.d.ts +1 -1
  85. package/dist/vendored-components.js +1 -0
  86. package/package.json +3 -1
  87. package/theme-chalk/src/float-label.scss +57 -0
@@ -0,0 +1,129 @@
1
+ import type { Option, OptionType, SelectStates } from './select.types';
2
+ import type { SelectV2Props } from './token';
3
+ import type { SelectV2EmitFn } from './defaults';
4
+ import type { ScrollbarDirection } from '@element-plus/components/scrollbar';
5
+ import type { TooltipInstance } from '@element-plus/components/tooltip';
6
+ import type { SelectDropdownInstance } from './select-dropdown';
7
+ declare const useSelect: (props: SelectV2Props, emit: SelectV2EmitFn) => {
8
+ inputId: import("vue").Ref<string | undefined, string | undefined>;
9
+ collapseTagSize: import("vue").ComputedRef<"default" | "small">;
10
+ currentPlaceholder: import("vue").ComputedRef<string>;
11
+ expanded: import("vue").Ref<boolean, boolean>;
12
+ emptyText: import("vue").ComputedRef<string | null>;
13
+ popupHeight: import("vue").ComputedRef<number>;
14
+ debounce: import("vue").ComputedRef<number>;
15
+ allOptions: import("vue").ComputedRef<OptionType[]>;
16
+ allOptionsValueMap: import("vue").ComputedRef<Map<any, any>>;
17
+ filteredOptions: import("vue").Ref<({
18
+ [x: string]: any;
19
+ } | {
20
+ [x: string]: any;
21
+ created?: boolean | undefined;
22
+ })[], OptionType[] | ({
23
+ [x: string]: any;
24
+ } | {
25
+ [x: string]: any;
26
+ created?: boolean | undefined;
27
+ })[]>;
28
+ iconComponent: import("vue").ComputedRef<import("@element-plus/utils").EpPropMergeType<(new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component) | (((new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component)) | null)[], unknown, unknown>>;
29
+ iconReverse: import("vue").ComputedRef<string>;
30
+ tagStyle: import("vue").ComputedRef<{
31
+ maxWidth: string;
32
+ }>;
33
+ collapseTagStyle: import("vue").ComputedRef<{
34
+ maxWidth: string;
35
+ }>;
36
+ popperSize: import("vue").Ref<number, number>;
37
+ dropdownMenuVisible: import("vue").WritableComputedRef<boolean, boolean>;
38
+ hasModelValue: import("vue").ComputedRef<boolean>;
39
+ shouldShowPlaceholder: import("vue").ComputedRef<boolean>;
40
+ selectDisabled: import("vue").ComputedRef<boolean>;
41
+ selectSize: import("vue").ComputedRef<"" | "small" | "default" | "large">;
42
+ needStatusIcon: import("vue").ComputedRef<boolean>;
43
+ showClearBtn: import("vue").ComputedRef<boolean>;
44
+ states: SelectStates;
45
+ isFocused: import("vue").Ref<boolean, boolean>;
46
+ nsSelect: {
47
+ namespace: import("vue").ComputedRef<string>;
48
+ b: (blockSuffix?: string) => string;
49
+ e: (element?: string) => string;
50
+ m: (modifier?: string) => string;
51
+ be: (blockSuffix?: string, element?: string) => string;
52
+ em: (element?: string, modifier?: string) => string;
53
+ bm: (blockSuffix?: string, modifier?: string) => string;
54
+ bem: (blockSuffix?: string, element?: string, modifier?: string) => string;
55
+ is: {
56
+ (name: string, state: boolean | undefined): string;
57
+ (name: string): string;
58
+ };
59
+ cssVar: (object: Record<string, string>) => Record<string, string>;
60
+ cssVarName: (name: string) => string;
61
+ cssVarBlock: (object: Record<string, string>) => Record<string, string>;
62
+ cssVarBlockName: (name: string) => string;
63
+ };
64
+ nsInput: {
65
+ namespace: import("vue").ComputedRef<string>;
66
+ b: (blockSuffix?: string) => string;
67
+ e: (element?: string) => string;
68
+ m: (modifier?: string) => string;
69
+ be: (blockSuffix?: string, element?: string) => string;
70
+ em: (element?: string, modifier?: string) => string;
71
+ bm: (blockSuffix?: string, modifier?: string) => string;
72
+ bem: (blockSuffix?: string, element?: string, modifier?: string) => string;
73
+ is: {
74
+ (name: string, state: boolean | undefined): string;
75
+ (name: string): string;
76
+ };
77
+ cssVar: (object: Record<string, string>) => Record<string, string>;
78
+ cssVarName: (name: string) => string;
79
+ cssVarBlock: (object: Record<string, string>) => Record<string, string>;
80
+ cssVarBlockName: (name: string) => string;
81
+ };
82
+ inputRef: import("vue").Ref<HTMLElement | undefined, HTMLElement | undefined>;
83
+ menuRef: import("vue").Ref<SelectDropdownInstance | undefined, SelectDropdownInstance | undefined>;
84
+ tagMenuRef: import("vue").Ref<HTMLElement | undefined, HTMLElement | undefined>;
85
+ tooltipRef: import("vue").Ref<TooltipInstance | undefined, TooltipInstance | undefined>;
86
+ tagTooltipRef: import("vue").Ref<TooltipInstance | undefined, TooltipInstance | undefined>;
87
+ selectRef: import("vue").Ref<HTMLElement | undefined, HTMLElement | undefined>;
88
+ wrapperRef: import("vue").ShallowRef<HTMLElement | undefined, HTMLElement | undefined>;
89
+ selectionRef: import("vue").Ref<HTMLElement | undefined, HTMLElement | undefined>;
90
+ prefixRef: import("vue").Ref<HTMLElement | undefined, HTMLElement | undefined>;
91
+ suffixRef: import("vue").Ref<HTMLElement | undefined, HTMLElement | undefined>;
92
+ collapseItemRef: import("vue").Ref<HTMLElement | undefined, HTMLElement | undefined>;
93
+ popperRef: import("vue").ComputedRef<HTMLElement | undefined>;
94
+ validateState: import("vue").ComputedRef<"" | "error" | "success" | "validating">;
95
+ validateIcon: import("vue").ComputedRef<import("vue").DefineComponent<{}, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any> | undefined>;
96
+ showTagList: import("vue").ComputedRef<Option[]>;
97
+ collapseTagList: import("vue").ComputedRef<Option[]>;
98
+ debouncedOnInputChange: import("@vueuse/core").UseDebounceFnReturn<() => void>;
99
+ deleteTag: (event: MouseEvent, option: Option) => void;
100
+ getLabel: (option: Option) => any;
101
+ getValue: (option: Option) => any;
102
+ getDisabled: (option: Option) => any;
103
+ getValueKey: (item: unknown) => any;
104
+ getIndex: (option: Option) => any;
105
+ handleClear: () => void;
106
+ handleClickOutside: (event: Event) => void;
107
+ handleDel: (e: KeyboardEvent) => void;
108
+ handleEsc: () => void;
109
+ focus: () => void;
110
+ blur: () => void;
111
+ handleMenuEnter: () => Promise<void>;
112
+ handleResize: () => void;
113
+ resetSelectionWidth: () => void;
114
+ updateTooltip: () => void;
115
+ updateTagTooltip: () => void;
116
+ updateOptions: () => void;
117
+ toggleMenu: (event?: Event) => void;
118
+ scrollTo: (index: number) => void;
119
+ onInput: (event: Event) => void;
120
+ onKeyboardNavigate: (direction: "forward" | "backward", hoveringIndex?: number | undefined) => void;
121
+ onKeyboardSelect: () => void;
122
+ onEndReached: (direction: ScrollbarDirection) => void;
123
+ onSelect: (option: Option) => void;
124
+ onHover: (idx?: number) => void;
125
+ handleCompositionStart: (event: CompositionEvent) => void;
126
+ handleCompositionEnd: (event: CompositionEvent) => void;
127
+ handleCompositionUpdate: (event: CompositionEvent) => void;
128
+ };
129
+ export default useSelect;
@@ -0,0 +1,501 @@
1
+ import { useSlots as Mt, reactive as Rt, ref as m, computed as o, watch as p, nextTick as h, watchEffect as We, onMounted as Wt } from "vue";
2
+ import { get as k, isEqual as M, findLastIndex as Nt } from "lodash-unified";
3
+ import { useDebounceFn as Lt, useResizeObserver as I } from "@vueuse/core";
4
+ import { isEmpty as Dt, isNumber as Ft, isUndefined as Ht } from "../../../utils/types.js";
5
+ import { debugWarn as Pt } from "../../../utils/error.js";
6
+ import { NOOP as Ne, isArray as w, isFunction as z, isObject as ne } from "@vue/shared";
7
+ import { escapeStringRegexp as Bt } from "../../../utils/strings.js";
8
+ import { getEventCode as Kt } from "../../../utils/dom/event.js";
9
+ import { ValidateComponentsMap as _t } from "../../../utils/vue/icon.js";
10
+ import { EVENT_CODE as kt } from "../../../constants/aria.js";
11
+ import { UPDATE_MODEL_EVENT as zt, CHANGE_EVENT as At } from "../../../constants/event.js";
12
+ import { MINIMUM_INPUT_WIDTH as Qt } from "../../../constants/form.js";
13
+ import { useNamespace as Le } from "../../../hooks/use-namespace/index.js";
14
+ import { useLocale as Gt } from "../../../hooks/use-locale/index.js";
15
+ import "../../../hooks/use-size/index.js";
16
+ import "@popperjs/core";
17
+ import "../../../hooks/use-z-index/index.js";
18
+ import "../../../hooks/use-delayed-toggle/index.js";
19
+ import "../../../hooks/use-aria/index.js";
20
+ import "../../../hooks/use-model-toggle/index.js";
21
+ import { useEmptyValues as Ut } from "../../../hooks/use-empty-values/index.js";
22
+ import { useFocusController as $t } from "../../../hooks/use-focus-controller/index.js";
23
+ import { useComposition as jt } from "../../../hooks/use-composition/index.js";
24
+ import "../../form/index.js";
25
+ import { useAllowCreate as qt } from "./useAllowCreate.js";
26
+ import { useProps as Jt } from "./useProps.js";
27
+ import { useFormItem as Xt, useFormItemInputId as Yt } from "../../form/src/hooks/use-form-item.js";
28
+ import { useFormDisabled as Zt, useFormSize as el } from "../../form/src/hooks/use-form-common-props.js";
29
+ const Rl = (t, g) => {
30
+ const { t: R } = Gt(), De = Mt(), A = Le("select"), Fe = Le("input"), { form: Q, formItem: r } = Xt(), { inputId: He } = Yt(t, {
31
+ formItemContext: r
32
+ }), { aliasProps: ae, getLabel: V, getValue: v, getDisabled: W, getOptions: Pe } = Jt(t), { valueOnClear: Be, isEmptyValue: ie } = Ut(t), n = Rt({
33
+ inputValue: "",
34
+ cachedOptions: [],
35
+ createdOptions: [],
36
+ hoveringIndex: -1,
37
+ inputHovering: !1,
38
+ selectionWidth: 0,
39
+ collapseItemWidth: 0,
40
+ previousQuery: null,
41
+ previousValue: void 0,
42
+ selectedLabel: "",
43
+ menuVisibleOnFocus: !1,
44
+ isBeforeHide: !1
45
+ }), N = m(-1), G = m(!1), U = m(), y = m(), L = m(), $ = m(), b = m(), Ke = m(), oe = m(), x = m(), ue = m(), D = m(), {
46
+ isComposing: se,
47
+ handleCompositionStart: _e,
48
+ handleCompositionEnd: ke,
49
+ handleCompositionUpdate: ze
50
+ } = jt({
51
+ afterComposition: (e) => Se(e)
52
+ }), O = Zt(), { wrapperRef: ce, isFocused: j, handleBlur: Ae } = $t(b, {
53
+ disabled: O,
54
+ afterFocus() {
55
+ t.automaticDropdown && !u.value && (u.value = !0, n.menuVisibleOnFocus = !0);
56
+ },
57
+ beforeBlur(e) {
58
+ var l, a;
59
+ return ((l = L.value) == null ? void 0 : l.isFocusInsideContent(e)) || ((a = $.value) == null ? void 0 : a.isFocusInsideContent(e));
60
+ },
61
+ afterBlur() {
62
+ var e;
63
+ u.value = !1, n.menuVisibleOnFocus = !1, t.validateEvent && ((e = r == null ? void 0 : r.validate) == null || e.call(r, "blur").catch(Ne));
64
+ }
65
+ }), de = o(() => me("")), C = o(() => t.loading ? !1 : t.options.length > 0 || n.createdOptions.length > 0), c = m([]), u = m(!1), Qe = o(() => (Q == null ? void 0 : Q.statusIcon) ?? !1), Ge = o(() => {
66
+ const e = c.value.length * t.itemHeight;
67
+ return e > t.height ? t.height : e;
68
+ }), F = o(() => t.multiple ? w(t.modelValue) && t.modelValue.length > 0 : !ie(t.modelValue)), Ue = o(() => t.clearable && !O.value && F.value && (j.value || n.inputHovering)), re = o(
69
+ () => t.remote && t.filterable && !t.remoteShowSuffix ? "" : t.suffixIcon
70
+ ), $e = o(
71
+ () => re.value && A.is("reverse", u.value)
72
+ ), q = o(() => (r == null ? void 0 : r.validateState) || ""), je = o(() => {
73
+ if (q.value)
74
+ return _t[q.value];
75
+ }), fe = o(() => t.remote ? t.debounce : 0), qe = o(
76
+ () => t.remote && !n.inputValue && !C.value
77
+ ), Je = o(() => t.loading ? t.loadingText || R("el.select.loading") : t.filterable && n.inputValue && C.value && c.value.length === 0 ? t.noMatchText || R("el.select.noMatch") : C.value ? null : t.noDataText || R("el.select.noData")), Xe = o(
78
+ () => t.filterable && z(t.filterMethod)
79
+ ), Ye = o(
80
+ () => t.filterable && t.remote && z(t.remoteMethod)
81
+ ), me = (e) => {
82
+ const l = new RegExp(Bt(e), "i"), a = (i) => Xe.value || Ye.value ? !0 : e ? l.test(V(i) || "") : !0;
83
+ return t.loading ? [] : [...n.createdOptions, ...t.options].reduce((i, s) => {
84
+ const d = Pe(s);
85
+ if (w(d)) {
86
+ const _ = d.filter(a);
87
+ _.length > 0 && i.push(
88
+ {
89
+ label: V(s),
90
+ type: "Group"
91
+ },
92
+ ..._
93
+ );
94
+ } else (t.remote || a(s)) && i.push(s);
95
+ return i;
96
+ }, []);
97
+ }, ve = () => {
98
+ c.value = me(n.inputValue);
99
+ }, H = o(() => {
100
+ const e = /* @__PURE__ */ new Map();
101
+ return de.value.forEach((l, a) => {
102
+ e.set(f(v(l)), { option: l, index: a });
103
+ }), e;
104
+ }), P = o(() => {
105
+ const e = /* @__PURE__ */ new Map();
106
+ return c.value.forEach((l, a) => {
107
+ e.set(f(v(l)), { option: l, index: a });
108
+ }), e;
109
+ }), Ze = o(
110
+ () => c.value.every((e) => W(e))
111
+ ), he = el(), et = o(
112
+ () => he.value === "small" ? "small" : "default"
113
+ ), E = () => {
114
+ var l;
115
+ if (Ft(t.fitInputWidth)) {
116
+ N.value = t.fitInputWidth;
117
+ return;
118
+ }
119
+ const e = ((l = U.value) == null ? void 0 : l.offsetWidth) || 200;
120
+ !t.fitInputWidth && C.value ? h(() => {
121
+ N.value = Math.max(e, tt());
122
+ }) : N.value = e;
123
+ }, tt = () => {
124
+ var Me, Re;
125
+ const l = document.createElement("canvas").getContext("2d"), a = A.be("dropdown", "item"), s = (((Re = (Me = x.value) == null ? void 0 : Me.listRef) == null ? void 0 : Re.innerRef) || document).querySelector(`.${a}`);
126
+ if (s === null || l === null) return 0;
127
+ const d = getComputedStyle(s), _ = Number.parseFloat(d.paddingLeft) + Number.parseFloat(d.paddingRight);
128
+ return l.font = `bold ${d.font.replace(
129
+ new RegExp(`\\b${d.fontWeight}\\b`),
130
+ ""
131
+ )}`, c.value.reduce((Et, St) => {
132
+ const Tt = l.measureText(V(St));
133
+ return Math.max(Tt.width, Et);
134
+ }, 0) + _;
135
+ }, lt = () => {
136
+ if (!y.value) return 0;
137
+ const e = window.getComputedStyle(y.value);
138
+ return Number.parseFloat(e.gap || "6px");
139
+ }, nt = o(() => {
140
+ const e = lt(), l = t.filterable ? e + Qt : 0;
141
+ return { maxWidth: `${D.value && t.maxCollapseTags === 1 ? n.selectionWidth - n.collapseItemWidth - e - l : n.selectionWidth - l}px` };
142
+ }), at = o(() => ({ maxWidth: `${n.selectionWidth}px` })), it = o(() => w(t.modelValue) ? t.modelValue.length === 0 && !n.inputValue : t.filterable ? !n.inputValue : !0), ot = o(() => {
143
+ const e = t.placeholder ?? R("el.select.placeholder");
144
+ return t.multiple || !F.value ? e : n.selectedLabel;
145
+ }), ut = o(() => {
146
+ var e, l;
147
+ return (l = (e = L.value) == null ? void 0 : e.popperRef) == null ? void 0 : l.contentRef;
148
+ }), ge = o(() => {
149
+ if (t.multiple) {
150
+ const e = t.modelValue.length;
151
+ if (e > 0 && P.value.has(t.modelValue[e - 1])) {
152
+ const { index: l } = P.value.get(
153
+ t.modelValue[e - 1]
154
+ );
155
+ return l;
156
+ }
157
+ } else if (!ie(t.modelValue) && P.value.has(t.modelValue)) {
158
+ const { index: e } = P.value.get(t.modelValue);
159
+ return e;
160
+ }
161
+ return -1;
162
+ }), Ve = o({
163
+ get() {
164
+ return u.value && (t.loading || !qe.value || t.remote && !!De.empty) && (!G.value || !Dt(n.previousQuery) || C.value);
165
+ },
166
+ set(e) {
167
+ u.value = e;
168
+ }
169
+ }), st = o(() => t.multiple ? t.collapseTags ? n.cachedOptions.slice(0, t.maxCollapseTags) : n.cachedOptions : []), ct = o(() => t.multiple ? t.collapseTags ? n.cachedOptions.slice(t.maxCollapseTags) : [] : []), {
170
+ createNewOption: be,
171
+ removeNewOption: J,
172
+ selectNewOption: xe,
173
+ clearAllNewOption: X
174
+ } = qt(t, n), Y = (e) => {
175
+ var l;
176
+ O.value || t.filterable && u.value && e && !((l = oe.value) != null && l.contains(e.target)) || (n.menuVisibleOnFocus ? n.menuVisibleOnFocus = !1 : u.value = !u.value);
177
+ }, Oe = () => {
178
+ n.inputValue.length > 0 && !u.value && (u.value = !0), be(n.inputValue), h(() => {
179
+ Z(n.inputValue);
180
+ });
181
+ }, pe = Lt(() => {
182
+ Oe(), G.value = !1;
183
+ }, fe), Z = (e) => {
184
+ n.previousQuery === e || se.value || (n.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) && c.value.length ? h(dt) : h(It));
185
+ }, dt = () => {
186
+ const e = c.value.filter(
187
+ (i) => !i.disabled && i.type !== "Group"
188
+ ), l = e.find((i) => i.created), a = e[0];
189
+ n.hoveringIndex = ee(
190
+ c.value,
191
+ l || a
192
+ );
193
+ }, rt = (e) => {
194
+ M(t.modelValue, e) || g(At, e);
195
+ }, S = (e) => {
196
+ g(zt, e), rt(e), n.previousValue = t.multiple ? String(e) : e, h(() => {
197
+ if (t.multiple && w(t.modelValue)) {
198
+ const l = n.cachedOptions.slice(), a = t.modelValue.map(
199
+ (i) => Te(i, l)
200
+ );
201
+ M(n.cachedOptions, a) || (n.cachedOptions = a);
202
+ } else
203
+ K(!0);
204
+ });
205
+ }, ee = (e = [], l) => {
206
+ if (!ne(l))
207
+ return e.indexOf(l);
208
+ const a = t.valueKey;
209
+ let i = -1;
210
+ return e.some((s, d) => k(s, a) === k(l, a) ? (i = d, !0) : !1), i;
211
+ }, f = (e) => ne(e) ? k(e, t.valueKey) : e, Ie = () => {
212
+ E();
213
+ }, ft = (e) => {
214
+ g("end-reached", e);
215
+ }, we = () => {
216
+ n.selectionWidth = Number.parseFloat(
217
+ window.getComputedStyle(y.value).width
218
+ );
219
+ }, mt = () => {
220
+ n.collapseItemWidth = D.value.getBoundingClientRect().width;
221
+ }, te = () => {
222
+ var e, l;
223
+ (l = (e = L.value) == null ? void 0 : e.updatePopper) == null || l.call(e);
224
+ }, ye = () => {
225
+ var e, l;
226
+ (l = (e = $.value) == null ? void 0 : e.updatePopper) == null || l.call(e);
227
+ }, Ce = (e) => {
228
+ const l = v(e);
229
+ if (t.multiple) {
230
+ let a = t.modelValue.slice();
231
+ const i = ee(a, l);
232
+ i > -1 ? (a = [
233
+ ...a.slice(0, i),
234
+ ...a.slice(i + 1)
235
+ ], n.cachedOptions.splice(i, 1), J(e)) : (t.multipleLimit <= 0 || a.length < t.multipleLimit) && (a = [...a, l], n.cachedOptions.push(e), xe(e)), S(a), e.created && Z(""), t.filterable && (e.created || !t.reserveKeyword) && (n.inputValue = "");
236
+ } else
237
+ n.selectedLabel = V(e), !M(t.modelValue, l) && S(l), u.value = !1, xe(e), e.created || X();
238
+ B();
239
+ }, vt = (e, l) => {
240
+ let a = t.modelValue.slice();
241
+ const i = ee(a, v(l));
242
+ i > -1 && !O.value && (a = [
243
+ ...t.modelValue.slice(0, i),
244
+ ...t.modelValue.slice(i + 1)
245
+ ], n.cachedOptions.splice(i, 1), S(a), g("remove-tag", v(l)), J(l)), e.stopPropagation(), B();
246
+ }, B = () => {
247
+ var e;
248
+ (e = b.value) == null || e.focus();
249
+ }, ht = () => {
250
+ var e;
251
+ if (u.value) {
252
+ u.value = !1, h(() => {
253
+ var l;
254
+ return (l = b.value) == null ? void 0 : l.blur();
255
+ });
256
+ return;
257
+ }
258
+ (e = b.value) == null || e.blur();
259
+ }, gt = () => {
260
+ n.inputValue.length > 0 ? n.inputValue = "" : u.value = !1;
261
+ }, Vt = (e) => Nt(
262
+ e,
263
+ (l) => !n.cachedOptions.some(
264
+ (a) => v(a) === l && W(a)
265
+ )
266
+ ), bt = (e) => {
267
+ const l = Kt(e);
268
+ if (t.multiple && l !== kt.delete && n.inputValue.length === 0) {
269
+ e.preventDefault();
270
+ const a = t.modelValue.slice(), i = Vt(a);
271
+ if (i < 0) return;
272
+ const s = a[i];
273
+ a.splice(i, 1);
274
+ const d = n.cachedOptions[i];
275
+ n.cachedOptions.splice(i, 1), J(d), S(a), g("remove-tag", s);
276
+ }
277
+ }, xt = () => {
278
+ let e;
279
+ w(t.modelValue) ? e = [] : e = Be.value, n.selectedLabel = "", u.value = !1, S(e), g("clear"), X(), B();
280
+ }, Ee = (e, l = void 0) => {
281
+ const a = c.value;
282
+ if (!["forward", "backward"].includes(e) || O.value || a.length <= 0 || Ze.value || se.value)
283
+ return;
284
+ if (!u.value)
285
+ return Y();
286
+ Ht(l) && (l = n.hoveringIndex);
287
+ let i = -1;
288
+ e === "forward" ? (i = l + 1, i >= a.length && (i = 0)) : e === "backward" && (i = l - 1, (i < 0 || i >= a.length) && (i = a.length - 1));
289
+ const s = a[i];
290
+ if (W(s) || s.type === "Group")
291
+ return Ee(e, i);
292
+ n.hoveringIndex = i, le(i);
293
+ }, Ot = () => {
294
+ if (u.value)
295
+ ~n.hoveringIndex && c.value[n.hoveringIndex] && Ce(c.value[n.hoveringIndex]);
296
+ else return Y();
297
+ }, pt = (e) => {
298
+ n.hoveringIndex = e ?? -1;
299
+ }, It = () => {
300
+ if (!t.multiple)
301
+ n.hoveringIndex = c.value.findIndex((e) => f(v(e)) === f(t.modelValue));
302
+ else {
303
+ const e = t.modelValue.length;
304
+ if (e > 0) {
305
+ const l = t.modelValue[e - 1];
306
+ n.hoveringIndex = c.value.findIndex(
307
+ (a) => f(l) === f(v(a))
308
+ );
309
+ } else
310
+ n.hoveringIndex = -1;
311
+ }
312
+ }, Se = (e) => {
313
+ if (n.inputValue = e.target.value, t.remote)
314
+ G.value = !0, pe();
315
+ else
316
+ return Oe();
317
+ }, wt = (e) => {
318
+ if (u.value = !1, j.value) {
319
+ const l = new FocusEvent("blur", e);
320
+ Ae(l);
321
+ }
322
+ }, yt = () => (n.isBeforeHide = !1, h(() => {
323
+ ~ge.value && le(ge.value);
324
+ })), le = (e) => {
325
+ x.value.scrollToItem(e);
326
+ }, Te = (e, l) => {
327
+ const a = f(e);
328
+ if (H.value.has(a)) {
329
+ const { option: i } = H.value.get(a);
330
+ return i;
331
+ }
332
+ if (l && l.length) {
333
+ const i = l.find(
334
+ (s) => f(v(s)) === a
335
+ );
336
+ if (i)
337
+ return i;
338
+ }
339
+ return {
340
+ [ae.value.value]: e,
341
+ [ae.value.label]: e
342
+ };
343
+ }, Ct = (e) => {
344
+ var l;
345
+ return ((l = H.value.get(v(e))) == null ? void 0 : l.index) ?? -1;
346
+ }, K = (e = !1) => {
347
+ if (t.multiple)
348
+ if (t.modelValue.length > 0) {
349
+ const l = n.cachedOptions.slice();
350
+ n.cachedOptions.length = 0, n.previousValue = t.modelValue.toString();
351
+ for (const a of t.modelValue) {
352
+ const i = Te(a, l);
353
+ n.cachedOptions.push(i);
354
+ }
355
+ } else
356
+ n.cachedOptions = [], n.previousValue = void 0;
357
+ else if (F.value) {
358
+ n.previousValue = t.modelValue;
359
+ const l = c.value, a = l.findIndex(
360
+ (i) => f(v(i)) === f(t.modelValue)
361
+ );
362
+ ~a ? n.selectedLabel = V(l[a]) : (!n.selectedLabel || e) && (n.selectedLabel = f(t.modelValue));
363
+ } else
364
+ n.selectedLabel = "", n.previousValue = void 0;
365
+ X(), E();
366
+ };
367
+ p(
368
+ () => t.fitInputWidth,
369
+ () => {
370
+ E();
371
+ }
372
+ ), p(u, (e) => {
373
+ e ? (t.persistent || E(), Z("")) : (n.inputValue = "", n.previousQuery = null, n.isBeforeHide = !0, n.menuVisibleOnFocus = !1, be(""));
374
+ }), p(
375
+ () => t.modelValue,
376
+ (e, l) => {
377
+ var i;
378
+ (!e || w(e) && e.length === 0 || t.multiple && !M(e.toString(), n.previousValue) || !t.multiple && f(e) !== f(n.previousValue)) && K(!0), !M(e, l) && t.validateEvent && ((i = r == null ? void 0 : r.validate) == null || i.call(r, "change").catch(Ne));
379
+ },
380
+ {
381
+ deep: !0
382
+ }
383
+ ), p(
384
+ () => t.options,
385
+ () => {
386
+ const e = b.value;
387
+ (!e || e && document.activeElement !== e) && K();
388
+ },
389
+ {
390
+ deep: !0,
391
+ flush: "post"
392
+ }
393
+ ), p(
394
+ () => c.value,
395
+ () => (E(), x.value && h(x.value.resetScrollTop))
396
+ ), We(() => {
397
+ n.isBeforeHide || ve();
398
+ }), We(() => {
399
+ const { valueKey: e, options: l } = t, a = /* @__PURE__ */ new Map();
400
+ for (const i of l) {
401
+ const s = v(i);
402
+ let d = s;
403
+ if (ne(d) && (d = k(s, e)), a.get(d)) {
404
+ Pt(
405
+ "ElSelectV2",
406
+ "The option values you provided seem to be duplicated, which may cause some problems, please check."
407
+ );
408
+ break;
409
+ } else
410
+ a.set(d, !0);
411
+ }
412
+ }), Wt(() => {
413
+ K();
414
+ }), I(U, Ie), I(y, we), I(ce, te), I(ue, ye), I(D, mt);
415
+ let T;
416
+ return p(
417
+ () => Ve.value,
418
+ (e) => {
419
+ e ? T = I(x, te).stop : (T == null || T(), T = void 0), g("visible-change", e);
420
+ }
421
+ ), {
422
+ // data exports
423
+ inputId: He,
424
+ collapseTagSize: et,
425
+ currentPlaceholder: ot,
426
+ expanded: u,
427
+ emptyText: Je,
428
+ popupHeight: Ge,
429
+ debounce: fe,
430
+ allOptions: de,
431
+ allOptionsValueMap: H,
432
+ filteredOptions: c,
433
+ iconComponent: re,
434
+ iconReverse: $e,
435
+ tagStyle: nt,
436
+ collapseTagStyle: at,
437
+ popperSize: N,
438
+ dropdownMenuVisible: Ve,
439
+ hasModelValue: F,
440
+ shouldShowPlaceholder: it,
441
+ selectDisabled: O,
442
+ selectSize: he,
443
+ needStatusIcon: Qe,
444
+ showClearBtn: Ue,
445
+ states: n,
446
+ isFocused: j,
447
+ nsSelect: A,
448
+ nsInput: Fe,
449
+ // refs items exports
450
+ inputRef: b,
451
+ menuRef: x,
452
+ tagMenuRef: ue,
453
+ tooltipRef: L,
454
+ tagTooltipRef: $,
455
+ selectRef: U,
456
+ wrapperRef: ce,
457
+ selectionRef: y,
458
+ prefixRef: Ke,
459
+ suffixRef: oe,
460
+ collapseItemRef: D,
461
+ popperRef: ut,
462
+ validateState: q,
463
+ validateIcon: je,
464
+ showTagList: st,
465
+ collapseTagList: ct,
466
+ // methods exports
467
+ debouncedOnInputChange: pe,
468
+ deleteTag: vt,
469
+ getLabel: V,
470
+ getValue: v,
471
+ getDisabled: W,
472
+ getValueKey: f,
473
+ getIndex: Ct,
474
+ handleClear: xt,
475
+ handleClickOutside: wt,
476
+ handleDel: bt,
477
+ handleEsc: gt,
478
+ focus: B,
479
+ blur: ht,
480
+ handleMenuEnter: yt,
481
+ handleResize: Ie,
482
+ resetSelectionWidth: we,
483
+ updateTooltip: te,
484
+ updateTagTooltip: ye,
485
+ updateOptions: ve,
486
+ toggleMenu: Y,
487
+ scrollTo: le,
488
+ onInput: Se,
489
+ onKeyboardNavigate: Ee,
490
+ onKeyboardSelect: Ot,
491
+ onEndReached: ft,
492
+ onSelect: Ce,
493
+ onHover: pt,
494
+ handleCompositionStart: _e,
495
+ handleCompositionEnd: ke,
496
+ handleCompositionUpdate: ze
497
+ };
498
+ };
499
+ export {
500
+ Rl as default
501
+ };
@@ -1,9 +1,11 @@
1
1
  import { withInstall as r } from "../../utils/with-install.js";
2
2
  import i from "./src/time-picker.js";
3
+ import { default as R } from "./src/common/picker.vue.js";
3
4
  import "vue";
4
- import "@vueuse/core";
5
+ import "dayjs";
5
6
  import "@vue/shared";
6
7
  import "lodash-unified";
8
+ import "@vueuse/core";
7
9
  import "@element-plus/icons-vue";
8
10
  import "../../hooks/use-size/index.js";
9
11
  import "@popperjs/core";
@@ -12,23 +14,20 @@ import "../../hooks/use-delayed-toggle/index.js";
12
14
  import "../../hooks/use-aria/index.js";
13
15
  import "../../hooks/use-model-toggle/index.js";
14
16
  import "../../hooks/use-empty-values/index.js";
15
- import "../form/index.js";
16
- import "../input/index.js";
17
- import "../icon/index.js";
18
- import "../tooltip/index.js";
19
- import "dayjs";
20
- import { timePickerDefaultProps as q, timePickerRangeTriggerProps as v } from "./src/common/props.js";
21
17
  import "./src/props/panel-time-picker.js";
22
18
  import "../../directives/click-outside/index.js";
23
19
  import "normalize-wheel-es";
24
20
  import "../scrollbar/index.js";
21
+ import "../icon/index.js";
25
22
  import "./src/props/basic-time-spinner.js";
26
- const b = r(
23
+ import { timePickerDefaultProps as b, timePickerRangeTriggerProps as j } from "./src/common/props.js";
24
+ const D = r(
27
25
  i,
28
26
  "ep-time-picker"
29
27
  );
30
28
  export {
31
- b as EpTimePicker,
32
- q as timePickerDefaultProps,
33
- v as timePickerRangeTriggerProps
29
+ R as CommonPicker,
30
+ D as EpTimePicker,
31
+ b as timePickerDefaultProps,
32
+ j as timePickerRangeTriggerProps
34
33
  };