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.
- package/dist/components/date-picker/src/date-picker.js +38 -34
- package/dist/components/date-picker/src/props.js +19 -7
- package/dist/components/form/EpForm.vue.d.ts +61 -0
- package/dist/components/form/EpForm.vue.js +199 -0
- package/dist/components/form/EpForm2.vue.js +4 -0
- package/dist/components/form/index.d.ts +12 -2
- package/dist/components/form/index.js +9 -3
- package/dist/components/form/instance.d.ts +2 -0
- package/dist/components/form/src/form-item.d.ts +103 -0
- package/dist/components/form/src/form-item.js +91 -0
- package/dist/components/form/src/form-label-wrap.d.ts +11 -0
- package/dist/components/form/src/form-label-wrap.js +74 -0
- package/dist/components/form/src/form.d.ts +127 -0
- package/dist/components/form/src/form.js +112 -0
- package/dist/components/form/src/types.d.ts +48 -19
- package/dist/components/form/src/utils.d.ts +9 -0
- package/dist/components/form/src/utils.js +45 -0
- package/dist/components/form-item/EpFormItem.vue.d.ts +55 -0
- package/dist/components/form-item/EpFormItem.vue.js +257 -0
- package/dist/components/form-item/EpFormItem2.vue.js +4 -0
- package/dist/components/form-item/index.d.ts +5 -2
- package/dist/components/form-item/index.js +5 -3
- package/dist/components/form-item/instance.d.ts +2 -0
- package/dist/components/scrollbar/index.d.ts +1 -0
- package/dist/components/scrollbar/src/util.d.ts +40 -0
- package/dist/components/scrollbar/src/util.js +25 -0
- package/dist/components/select/select.vue.d.ts +9 -9
- package/dist/components/select/src/useSelect.d.ts +3 -3
- package/dist/components/select-v2/index.d.ts +6 -2
- package/dist/components/select-v2/index.js +7 -4
- package/dist/components/select-v2/src/defaults.d.ts +258 -0
- package/dist/components/select-v2/src/defaults.js +359 -0
- package/dist/components/select-v2/src/group-item.vue.d.ts +40 -0
- package/dist/components/select-v2/src/group-item.vue.js +13 -0
- package/dist/components/select-v2/src/group-item2.vue.js +33 -0
- package/dist/components/select-v2/src/option-item.vue.d.ts +66 -0
- package/dist/components/select-v2/src/option-item.vue.js +37 -0
- package/dist/components/select-v2/src/option-item2.vue.js +46 -0
- package/dist/components/select-v2/src/select-dropdown.d.ts +53 -0
- package/dist/components/select-v2/src/select-dropdown.js +209 -0
- package/dist/components/select-v2/src/select.types.d.ts +2 -1
- package/dist/components/select-v2/src/select.vue.d.ts +918 -0
- package/dist/components/select-v2/src/select.vue.js +388 -0
- package/dist/components/select-v2/src/select2.vue.js +86 -0
- package/dist/components/select-v2/src/token.d.ts +16 -0
- package/dist/components/select-v2/src/token.js +6 -0
- package/dist/components/select-v2/src/useAllowCreate.d.ts +8 -0
- package/dist/components/select-v2/src/useAllowCreate.js +64 -0
- package/dist/components/select-v2/src/useOption.d.ts +7 -0
- package/dist/components/select-v2/src/useOption.js +13 -0
- package/dist/components/select-v2/src/useProps.d.ts +2 -3
- package/dist/components/select-v2/src/useSelect.d.ts +129 -0
- package/dist/components/select-v2/src/useSelect.js +501 -0
- package/dist/components/time-picker/index.js +10 -11
- package/dist/components/time-picker/src/common/picker.vue.d.ts +131 -125
- package/dist/components/time-picker/src/common/picker.vue.js +163 -160
- package/dist/components/time-picker/src/common/props.d.ts +0 -1
- package/dist/components/time-picker/src/common/props.js +13 -14
- package/dist/components/time-picker/src/time-picker.d.ts +0 -3
- package/dist/components/virtual-list/index.d.ts +8 -0
- package/dist/components/virtual-list/src/builders/build-list.d.ts +187 -0
- package/dist/components/virtual-list/src/builders/build-list.js +363 -0
- package/dist/components/virtual-list/src/components/dynamic-size-list.d.ts +186 -0
- package/dist/components/virtual-list/src/components/dynamic-size-list.js +112 -0
- package/dist/components/virtual-list/src/components/fixed-size-list.d.ts +185 -0
- package/dist/components/virtual-list/src/components/fixed-size-list.js +68 -0
- package/dist/components/virtual-list/src/components/scrollbar.d.ts +79 -0
- package/dist/components/virtual-list/src/components/scrollbar.js +134 -0
- package/dist/components/virtual-list/src/defaults.d.ts +27 -0
- package/dist/components/virtual-list/src/defaults.js +26 -0
- package/dist/components/virtual-list/src/hooks/use-cache.d.ts +1 -0
- package/dist/components/virtual-list/src/hooks/use-cache.js +13 -0
- package/dist/components/virtual-list/src/hooks/use-wheel.d.ts +13 -0
- package/dist/components/virtual-list/src/hooks/use-wheel.js +26 -0
- package/dist/components/virtual-list/src/props.d.ts +211 -0
- package/dist/components/virtual-list/src/props.js +151 -0
- package/dist/components/virtual-list/src/types.d.ts +152 -0
- package/dist/components/virtual-list/src/utils.d.ts +16 -0
- package/dist/components/virtual-list/src/utils.js +22 -0
- package/dist/hooks/use-float-label/index.d.ts +6 -2
- package/dist/hooks/use-float-label/index.js +11 -7
- package/dist/index.css +1 -1
- package/dist/utils/objects.js +11 -3
- package/dist/vendored-components.d.ts +1 -1
- package/dist/vendored-components.js +1 -0
- package/package.json +3 -1
- package/theme-chalk/src/float-label.scss +57 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { defineComponent as t } from "vue";
|
|
2
|
+
import { useNamespace as e } from "../../../hooks/use-namespace/index.js";
|
|
3
|
+
import "@vue/shared";
|
|
4
|
+
import "lodash-unified";
|
|
5
|
+
import "@vueuse/core";
|
|
6
|
+
import "@element-plus/icons-vue";
|
|
7
|
+
import "../../../hooks/use-size/index.js";
|
|
8
|
+
import "@popperjs/core";
|
|
9
|
+
import "../../../hooks/use-z-index/index.js";
|
|
10
|
+
import "../../../hooks/use-delayed-toggle/index.js";
|
|
11
|
+
import "../../../hooks/use-aria/index.js";
|
|
12
|
+
import "../../../hooks/use-model-toggle/index.js";
|
|
13
|
+
import "../../../hooks/use-empty-values/index.js";
|
|
14
|
+
const y = t({
|
|
15
|
+
props: {
|
|
16
|
+
item: {
|
|
17
|
+
type: Object,
|
|
18
|
+
required: !0
|
|
19
|
+
},
|
|
20
|
+
style: {
|
|
21
|
+
type: Object
|
|
22
|
+
},
|
|
23
|
+
height: Number
|
|
24
|
+
},
|
|
25
|
+
setup() {
|
|
26
|
+
return {
|
|
27
|
+
ns: e("select")
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
export {
|
|
32
|
+
y as default
|
|
33
|
+
};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
2
|
+
readonly data: ArrayConstructor;
|
|
3
|
+
readonly disabled: BooleanConstructor;
|
|
4
|
+
readonly hovering: BooleanConstructor;
|
|
5
|
+
readonly item: {
|
|
6
|
+
readonly type: import("vue").PropType<import("./select.types").Option>;
|
|
7
|
+
readonly required: true;
|
|
8
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
9
|
+
__epPropKey: true;
|
|
10
|
+
};
|
|
11
|
+
readonly index: NumberConstructor;
|
|
12
|
+
readonly style: ObjectConstructor;
|
|
13
|
+
readonly selected: BooleanConstructor;
|
|
14
|
+
readonly created: BooleanConstructor;
|
|
15
|
+
}>, {
|
|
16
|
+
ns: {
|
|
17
|
+
namespace: import("vue").ComputedRef<string>;
|
|
18
|
+
b: (blockSuffix?: string) => string;
|
|
19
|
+
e: (element?: string) => string;
|
|
20
|
+
m: (modifier?: string) => string;
|
|
21
|
+
be: (blockSuffix?: string, element?: string) => string;
|
|
22
|
+
em: (element?: string, modifier?: string) => string;
|
|
23
|
+
bm: (blockSuffix?: string, modifier?: string) => string;
|
|
24
|
+
bem: (blockSuffix?: string, element?: string, modifier?: string) => string;
|
|
25
|
+
is: {
|
|
26
|
+
(name: string, state: boolean | undefined): string;
|
|
27
|
+
(name: string): string;
|
|
28
|
+
};
|
|
29
|
+
cssVar: (object: Record<string, string>) => Record<string, string>;
|
|
30
|
+
cssVarName: (name: string) => string;
|
|
31
|
+
cssVarBlock: (object: Record<string, string>) => Record<string, string>;
|
|
32
|
+
cssVarBlockName: (name: string) => string;
|
|
33
|
+
};
|
|
34
|
+
contentId: import("vue").Ref<string, string>;
|
|
35
|
+
mouseMoveEventName: string | null;
|
|
36
|
+
hoverItem: () => void;
|
|
37
|
+
handleMousedown: (event: MouseEvent) => void;
|
|
38
|
+
selectOptionClick: () => void;
|
|
39
|
+
getLabel: (option: import("./select.types").Option) => any;
|
|
40
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
41
|
+
hover: (index?: number) => index is number;
|
|
42
|
+
select: (val: import("./select.types").Option, index?: number) => boolean;
|
|
43
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
44
|
+
readonly data: ArrayConstructor;
|
|
45
|
+
readonly disabled: BooleanConstructor;
|
|
46
|
+
readonly hovering: BooleanConstructor;
|
|
47
|
+
readonly item: {
|
|
48
|
+
readonly type: import("vue").PropType<import("./select.types").Option>;
|
|
49
|
+
readonly required: true;
|
|
50
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
51
|
+
__epPropKey: true;
|
|
52
|
+
};
|
|
53
|
+
readonly index: NumberConstructor;
|
|
54
|
+
readonly style: ObjectConstructor;
|
|
55
|
+
readonly selected: BooleanConstructor;
|
|
56
|
+
readonly created: BooleanConstructor;
|
|
57
|
+
}>> & Readonly<{
|
|
58
|
+
onSelect?: ((val: import("./select.types").Option, index?: number | undefined) => any) | undefined;
|
|
59
|
+
onHover?: ((index?: number | undefined) => any) | undefined;
|
|
60
|
+
}>, {
|
|
61
|
+
readonly created: boolean;
|
|
62
|
+
readonly disabled: boolean;
|
|
63
|
+
readonly selected: boolean;
|
|
64
|
+
readonly hovering: boolean;
|
|
65
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
66
|
+
export default _default;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import i from "./option-item2.vue.js";
|
|
2
|
+
import { openBlock as d, createElementBlock as n, mergeProps as l, toHandlerKey as r, withModifiers as a, renderSlot as t, createElementVNode as m, toDisplayString as p } from "vue";
|
|
3
|
+
import f from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
const u = ["id", "aria-selected", "aria-disabled"];
|
|
5
|
+
function b(e, o, v, $, g, k) {
|
|
6
|
+
return d(), n("li", l({
|
|
7
|
+
id: `${e.contentId}-${e.index}`,
|
|
8
|
+
role: "option",
|
|
9
|
+
"aria-selected": e.selected,
|
|
10
|
+
"aria-disabled": e.disabled || void 0,
|
|
11
|
+
style: e.style,
|
|
12
|
+
class: [
|
|
13
|
+
e.ns.be("dropdown", "item"),
|
|
14
|
+
e.ns.is("selected", e.selected),
|
|
15
|
+
e.ns.is("disabled", e.disabled),
|
|
16
|
+
e.ns.is("created", e.created),
|
|
17
|
+
e.ns.is("hovering", e.hovering)
|
|
18
|
+
]
|
|
19
|
+
}, {
|
|
20
|
+
[r(e.mouseMoveEventName)]: o[0] || (o[0] = (...s) => e.hoverItem && e.hoverItem(...s))
|
|
21
|
+
}, {
|
|
22
|
+
onMousedown: o[1] || (o[1] = (...s) => e.handleMousedown && e.handleMousedown(...s)),
|
|
23
|
+
onClick: o[2] || (o[2] = a((...s) => e.selectOptionClick && e.selectOptionClick(...s), ["stop"]))
|
|
24
|
+
}), [
|
|
25
|
+
t(e.$slots, "default", {
|
|
26
|
+
item: e.item,
|
|
27
|
+
index: e.index,
|
|
28
|
+
disabled: e.disabled
|
|
29
|
+
}, () => [
|
|
30
|
+
m("span", null, p(e.getLabel(e.item)), 1)
|
|
31
|
+
])
|
|
32
|
+
], 16, u);
|
|
33
|
+
}
|
|
34
|
+
const I = /* @__PURE__ */ f(i, [["render", b]]);
|
|
35
|
+
export {
|
|
36
|
+
I as default
|
|
37
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { defineComponent as u, inject as f } from "vue";
|
|
2
|
+
import { useNamespace as d } from "../../../hooks/use-namespace/index.js";
|
|
3
|
+
import "@vue/shared";
|
|
4
|
+
import "lodash-unified";
|
|
5
|
+
import { isIOS as g } from "@vueuse/core";
|
|
6
|
+
import { isFocusable as I } from "../../../utils/dom/aria.js";
|
|
7
|
+
import "@element-plus/icons-vue";
|
|
8
|
+
import "../../../hooks/use-size/index.js";
|
|
9
|
+
import "@popperjs/core";
|
|
10
|
+
import "../../../hooks/use-z-index/index.js";
|
|
11
|
+
import "../../../hooks/use-delayed-toggle/index.js";
|
|
12
|
+
import "../../../hooks/use-aria/index.js";
|
|
13
|
+
import "../../../hooks/use-model-toggle/index.js";
|
|
14
|
+
import "../../../hooks/use-empty-values/index.js";
|
|
15
|
+
import { useOption as h } from "./useOption.js";
|
|
16
|
+
import { useProps as v } from "./useProps.js";
|
|
17
|
+
import { optionV2Emits as w, optionV2Props as E } from "./defaults.js";
|
|
18
|
+
import { selectV2InjectionKey as M } from "./token.js";
|
|
19
|
+
const A = u({
|
|
20
|
+
props: E,
|
|
21
|
+
emits: w,
|
|
22
|
+
setup(r, { emit: m }) {
|
|
23
|
+
const e = f(M), n = d("select"), p = g ? null : "mousemove", { hoverItem: s, selectOptionClick: i } = h(r, { emit: m }), { getLabel: c } = v(e.props), a = e.contentId;
|
|
24
|
+
return {
|
|
25
|
+
ns: n,
|
|
26
|
+
contentId: a,
|
|
27
|
+
mouseMoveEventName: p,
|
|
28
|
+
hoverItem: s,
|
|
29
|
+
handleMousedown: (o) => {
|
|
30
|
+
let t = o.target;
|
|
31
|
+
const l = o.currentTarget;
|
|
32
|
+
for (; t && t !== l; ) {
|
|
33
|
+
if (I(t))
|
|
34
|
+
return;
|
|
35
|
+
t = t.parentElement;
|
|
36
|
+
}
|
|
37
|
+
o.preventDefault();
|
|
38
|
+
},
|
|
39
|
+
selectOptionClick: i,
|
|
40
|
+
getLabel: c
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
export {
|
|
45
|
+
A as default
|
|
46
|
+
};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { ScrollbarDirection } from '@element-plus/components/scrollbar';
|
|
2
|
+
import type { DynamicSizeListInstance, FixedSizeListInstance } from '@element-plus/components/virtual-list';
|
|
3
|
+
import type { Option } from './select.types';
|
|
4
|
+
import type { ComponentPublicInstance, ComputedRef, ExtractPropTypes, Ref } from 'vue';
|
|
5
|
+
declare const props: {
|
|
6
|
+
loading: BooleanConstructor;
|
|
7
|
+
data: {
|
|
8
|
+
type: ArrayConstructor;
|
|
9
|
+
required: true;
|
|
10
|
+
};
|
|
11
|
+
hoveringIndex: NumberConstructor;
|
|
12
|
+
width: NumberConstructor;
|
|
13
|
+
id: StringConstructor;
|
|
14
|
+
ariaLabel: StringConstructor;
|
|
15
|
+
};
|
|
16
|
+
interface SelectDropdownExposed {
|
|
17
|
+
listRef: Ref<FixedSizeListInstance | DynamicSizeListInstance | undefined>;
|
|
18
|
+
isSized: ComputedRef<boolean>;
|
|
19
|
+
isItemDisabled: (modelValue: any[] | any, selected: boolean) => boolean;
|
|
20
|
+
isItemHovering: (target: number) => boolean;
|
|
21
|
+
isItemSelected: (modelValue: any[] | any, target: Option) => boolean;
|
|
22
|
+
scrollToItem: (index: number) => void;
|
|
23
|
+
resetScrollTop: () => void;
|
|
24
|
+
}
|
|
25
|
+
export type SelectDropdownInstance = ComponentPublicInstance<ExtractPropTypes<typeof props>, SelectDropdownExposed>;
|
|
26
|
+
declare const _default: import("vue").DefineComponent<ExtractPropTypes<{
|
|
27
|
+
loading: BooleanConstructor;
|
|
28
|
+
data: {
|
|
29
|
+
type: ArrayConstructor;
|
|
30
|
+
required: true;
|
|
31
|
+
};
|
|
32
|
+
hoveringIndex: NumberConstructor;
|
|
33
|
+
width: NumberConstructor;
|
|
34
|
+
id: StringConstructor;
|
|
35
|
+
ariaLabel: StringConstructor;
|
|
36
|
+
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
37
|
+
'end-reached': (direction: ScrollbarDirection) => boolean;
|
|
38
|
+
}, string, import("vue").PublicProps, Readonly<ExtractPropTypes<{
|
|
39
|
+
loading: BooleanConstructor;
|
|
40
|
+
data: {
|
|
41
|
+
type: ArrayConstructor;
|
|
42
|
+
required: true;
|
|
43
|
+
};
|
|
44
|
+
hoveringIndex: NumberConstructor;
|
|
45
|
+
width: NumberConstructor;
|
|
46
|
+
id: StringConstructor;
|
|
47
|
+
ariaLabel: StringConstructor;
|
|
48
|
+
}>> & Readonly<{
|
|
49
|
+
"onEnd-reached"?: ((direction: ScrollbarDirection) => any) | undefined;
|
|
50
|
+
}>, {
|
|
51
|
+
loading: boolean;
|
|
52
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
53
|
+
export default _default;
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
import { defineComponent as Q, inject as W, ref as K, computed as y, watch as X, unref as S, createVNode as l, mergeProps as L, toRaw as Y } from "vue";
|
|
2
|
+
import { get as v } from "lodash-unified";
|
|
3
|
+
import { isUndefined as Z } from "../../../utils/types.js";
|
|
4
|
+
import { isIOS as ee } from "@vueuse/core";
|
|
5
|
+
import { isObject as N } from "@vue/shared";
|
|
6
|
+
import { getEventCode as te } from "../../../utils/dom/event.js";
|
|
7
|
+
import "@element-plus/icons-vue";
|
|
8
|
+
import { EVENT_CODE as oe } from "../../../constants/aria.js";
|
|
9
|
+
import re from "../../virtual-list/src/components/fixed-size-list.js";
|
|
10
|
+
import ie from "../../virtual-list/src/components/dynamic-size-list.js";
|
|
11
|
+
import "../../virtual-list/src/props.js";
|
|
12
|
+
import { useNamespace as ne } from "../../../hooks/use-namespace/index.js";
|
|
13
|
+
import "../../../hooks/use-size/index.js";
|
|
14
|
+
import "@popperjs/core";
|
|
15
|
+
import "../../../hooks/use-z-index/index.js";
|
|
16
|
+
import "../../../hooks/use-delayed-toggle/index.js";
|
|
17
|
+
import "../../../hooks/use-aria/index.js";
|
|
18
|
+
import "../../../hooks/use-model-toggle/index.js";
|
|
19
|
+
import "../../../hooks/use-empty-values/index.js";
|
|
20
|
+
import ae from "./group-item.vue.js";
|
|
21
|
+
import ce from "./option-item.vue.js";
|
|
22
|
+
import { useProps as se } from "./useProps.js";
|
|
23
|
+
import { selectV2InjectionKey as de } from "./token.js";
|
|
24
|
+
import "../../scrollbar/index.js";
|
|
25
|
+
import { scrollbarEmits as me } from "../../scrollbar/src/scrollbar.js";
|
|
26
|
+
const le = {
|
|
27
|
+
loading: Boolean,
|
|
28
|
+
data: {
|
|
29
|
+
type: Array,
|
|
30
|
+
required: !0
|
|
31
|
+
},
|
|
32
|
+
hoveringIndex: Number,
|
|
33
|
+
width: Number,
|
|
34
|
+
id: String,
|
|
35
|
+
ariaLabel: String
|
|
36
|
+
}, qe = /* @__PURE__ */ Q({
|
|
37
|
+
name: "ElSelectDropdown",
|
|
38
|
+
props: le,
|
|
39
|
+
emits: {
|
|
40
|
+
"end-reached": me["end-reached"]
|
|
41
|
+
},
|
|
42
|
+
setup(p, {
|
|
43
|
+
slots: o,
|
|
44
|
+
expose: T,
|
|
45
|
+
emit: k
|
|
46
|
+
}) {
|
|
47
|
+
const r = W(de), w = ne("select"), {
|
|
48
|
+
getLabel: P,
|
|
49
|
+
getValue: I,
|
|
50
|
+
getDisabled: R
|
|
51
|
+
} = se(r.props), A = K([]), u = K(), V = y(() => p.data.length);
|
|
52
|
+
X(() => V.value, () => {
|
|
53
|
+
var e, t;
|
|
54
|
+
(t = (e = r.tooltipRef.value) == null ? void 0 : e.updatePopper) == null || t.call(e);
|
|
55
|
+
});
|
|
56
|
+
const f = y(() => Z(r.props.estimatedOptionHeight)), E = y(() => f.value ? {
|
|
57
|
+
itemSize: r.props.itemHeight
|
|
58
|
+
} : {
|
|
59
|
+
estimatedSize: r.props.estimatedOptionHeight,
|
|
60
|
+
itemSize: (e) => A.value[e]
|
|
61
|
+
}), j = (e = [], t) => {
|
|
62
|
+
const {
|
|
63
|
+
props: {
|
|
64
|
+
valueKey: i
|
|
65
|
+
}
|
|
66
|
+
} = r;
|
|
67
|
+
return N(t) ? e && e.some((n) => Y(v(n, i)) === v(t, i)) : e.includes(t);
|
|
68
|
+
}, C = (e, t) => {
|
|
69
|
+
if (N(t)) {
|
|
70
|
+
const {
|
|
71
|
+
valueKey: i
|
|
72
|
+
} = r.props;
|
|
73
|
+
return v(e, i) === v(t, i);
|
|
74
|
+
} else
|
|
75
|
+
return e === t;
|
|
76
|
+
}, z = (e, t) => r.props.multiple ? j(e, I(t)) : C(e, I(t)), x = (e, t) => {
|
|
77
|
+
const {
|
|
78
|
+
disabled: i,
|
|
79
|
+
multiple: n,
|
|
80
|
+
multipleLimit: c
|
|
81
|
+
} = r.props;
|
|
82
|
+
return i || !t && (n ? c > 0 && e.length >= c : !1);
|
|
83
|
+
}, O = (e) => p.hoveringIndex === e;
|
|
84
|
+
T({
|
|
85
|
+
listRef: u,
|
|
86
|
+
isSized: f,
|
|
87
|
+
isItemDisabled: x,
|
|
88
|
+
isItemHovering: O,
|
|
89
|
+
isItemSelected: z,
|
|
90
|
+
scrollToItem: (e) => {
|
|
91
|
+
const t = u.value;
|
|
92
|
+
t && t.scrollToItem(e);
|
|
93
|
+
},
|
|
94
|
+
resetScrollTop: () => {
|
|
95
|
+
const e = u.value;
|
|
96
|
+
e && e.resetScrollTop();
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
const q = (e) => {
|
|
100
|
+
const {
|
|
101
|
+
index: t,
|
|
102
|
+
data: i,
|
|
103
|
+
style: n
|
|
104
|
+
} = e, c = S(f), {
|
|
105
|
+
itemSize: d,
|
|
106
|
+
estimatedSize: m
|
|
107
|
+
} = S(E), {
|
|
108
|
+
modelValue: s
|
|
109
|
+
} = r.props, {
|
|
110
|
+
onSelect: h,
|
|
111
|
+
onHover: b
|
|
112
|
+
} = r, a = i[t];
|
|
113
|
+
if (a.type === "Group")
|
|
114
|
+
return l(ae, {
|
|
115
|
+
item: a,
|
|
116
|
+
style: n,
|
|
117
|
+
height: c ? d : m
|
|
118
|
+
}, null);
|
|
119
|
+
const g = z(s, a), _ = x(s, g), $ = O(t);
|
|
120
|
+
return l(ce, L(e, {
|
|
121
|
+
selected: g,
|
|
122
|
+
disabled: R(a) || _,
|
|
123
|
+
created: !!a.created,
|
|
124
|
+
hovering: $,
|
|
125
|
+
item: a,
|
|
126
|
+
onSelect: h,
|
|
127
|
+
onHover: b
|
|
128
|
+
}), {
|
|
129
|
+
default: (J) => {
|
|
130
|
+
var D;
|
|
131
|
+
return ((D = o.default) == null ? void 0 : D.call(o, J)) || l("span", null, [P(a)]);
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
}, {
|
|
135
|
+
onKeyboardNavigate: H,
|
|
136
|
+
onKeyboardSelect: B
|
|
137
|
+
} = r, F = () => {
|
|
138
|
+
H("forward");
|
|
139
|
+
}, G = () => {
|
|
140
|
+
H("backward");
|
|
141
|
+
}, M = (e) => {
|
|
142
|
+
const t = te(e), {
|
|
143
|
+
tab: i,
|
|
144
|
+
esc: n,
|
|
145
|
+
down: c,
|
|
146
|
+
up: d,
|
|
147
|
+
enter: m,
|
|
148
|
+
numpadEnter: s
|
|
149
|
+
} = oe;
|
|
150
|
+
switch ([n, c, d, m, s].includes(t) && (e.preventDefault(), e.stopPropagation()), t) {
|
|
151
|
+
case i:
|
|
152
|
+
case n:
|
|
153
|
+
break;
|
|
154
|
+
case c:
|
|
155
|
+
F();
|
|
156
|
+
break;
|
|
157
|
+
case d:
|
|
158
|
+
G();
|
|
159
|
+
break;
|
|
160
|
+
case m:
|
|
161
|
+
case s:
|
|
162
|
+
B();
|
|
163
|
+
break;
|
|
164
|
+
}
|
|
165
|
+
}, U = (e) => {
|
|
166
|
+
k("end-reached", e);
|
|
167
|
+
};
|
|
168
|
+
return () => {
|
|
169
|
+
var s, h, b, a;
|
|
170
|
+
const {
|
|
171
|
+
data: e,
|
|
172
|
+
width: t
|
|
173
|
+
} = p, {
|
|
174
|
+
height: i,
|
|
175
|
+
multiple: n,
|
|
176
|
+
scrollbarAlwaysOn: c
|
|
177
|
+
} = r.props, d = ee ? !0 : c, m = S(f) ? re : ie;
|
|
178
|
+
return l("div", {
|
|
179
|
+
class: [w.b("dropdown"), w.is("multiple", n)],
|
|
180
|
+
style: {
|
|
181
|
+
width: `${t}px`
|
|
182
|
+
}
|
|
183
|
+
}, [(s = o.header) == null ? void 0 : s.call(o), ((h = o.loading) == null ? void 0 : h.call(o)) || ((b = o.empty) == null ? void 0 : b.call(o)) || l(m, L({
|
|
184
|
+
ref: u
|
|
185
|
+
}, S(E), {
|
|
186
|
+
className: w.be("dropdown", "list"),
|
|
187
|
+
scrollbarAlwaysOn: d,
|
|
188
|
+
data: e,
|
|
189
|
+
height: i,
|
|
190
|
+
width: t,
|
|
191
|
+
total: e.length,
|
|
192
|
+
innerElement: "ul",
|
|
193
|
+
innerProps: {
|
|
194
|
+
id: p.id,
|
|
195
|
+
role: "listbox",
|
|
196
|
+
"aria-label": p.ariaLabel,
|
|
197
|
+
"aria-orientation": "vertical"
|
|
198
|
+
},
|
|
199
|
+
onEndReached: U,
|
|
200
|
+
onKeydown: M
|
|
201
|
+
}), {
|
|
202
|
+
default: (g) => l(q, g, null)
|
|
203
|
+
}), (a = o.footer) == null ? void 0 : a.call(o)]);
|
|
204
|
+
};
|
|
205
|
+
}
|
|
206
|
+
});
|
|
207
|
+
export {
|
|
208
|
+
qe as default
|
|
209
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
type OptionCommon = Record<string, any>;
|
|
2
2
|
export type Option = OptionCommon & {
|
|
3
3
|
created?: boolean;
|
|
4
4
|
};
|
|
@@ -23,3 +23,4 @@ export type SelectStates = {
|
|
|
23
23
|
menuVisibleOnFocus: boolean;
|
|
24
24
|
isBeforeHide: boolean;
|
|
25
25
|
};
|
|
26
|
+
export {};
|