ep-craft 0.1.26 → 0.1.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) 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/src/types.d.ts +1 -1
  4. package/dist/components/scrollbar/index.d.ts +1 -0
  5. package/dist/components/scrollbar/src/util.d.ts +40 -0
  6. package/dist/components/scrollbar/src/util.js +25 -0
  7. package/dist/components/select/select.vue.d.ts +8 -8
  8. package/dist/components/select/src/useSelect.d.ts +2 -2
  9. package/dist/components/select-v2/index.d.ts +6 -2
  10. package/dist/components/select-v2/index.js +7 -4
  11. package/dist/components/select-v2/src/defaults.d.ts +258 -0
  12. package/dist/components/select-v2/src/defaults.js +359 -0
  13. package/dist/components/select-v2/src/group-item.vue.d.ts +40 -0
  14. package/dist/components/select-v2/src/group-item.vue.js +13 -0
  15. package/dist/components/select-v2/src/group-item2.vue.js +33 -0
  16. package/dist/components/select-v2/src/option-item.vue.d.ts +66 -0
  17. package/dist/components/select-v2/src/option-item.vue.js +37 -0
  18. package/dist/components/select-v2/src/option-item2.vue.js +46 -0
  19. package/dist/components/select-v2/src/select-dropdown.d.ts +53 -0
  20. package/dist/components/select-v2/src/select-dropdown.js +209 -0
  21. package/dist/components/select-v2/src/select.types.d.ts +2 -1
  22. package/dist/components/select-v2/src/select.vue.d.ts +918 -0
  23. package/dist/components/select-v2/src/select.vue.js +388 -0
  24. package/dist/components/select-v2/src/select2.vue.js +86 -0
  25. package/dist/components/select-v2/src/token.d.ts +16 -0
  26. package/dist/components/select-v2/src/token.js +6 -0
  27. package/dist/components/select-v2/src/useAllowCreate.d.ts +8 -0
  28. package/dist/components/select-v2/src/useAllowCreate.js +64 -0
  29. package/dist/components/select-v2/src/useOption.d.ts +7 -0
  30. package/dist/components/select-v2/src/useOption.js +13 -0
  31. package/dist/components/select-v2/src/useProps.d.ts +2 -3
  32. package/dist/components/select-v2/src/useSelect.d.ts +129 -0
  33. package/dist/components/select-v2/src/useSelect.js +501 -0
  34. package/dist/components/time-picker/index.js +10 -11
  35. package/dist/components/time-picker/src/common/picker.vue.d.ts +131 -125
  36. package/dist/components/time-picker/src/common/picker.vue.js +163 -160
  37. package/dist/components/time-picker/src/common/props.d.ts +0 -1
  38. package/dist/components/time-picker/src/common/props.js +13 -14
  39. package/dist/components/time-picker/src/time-picker.d.ts +0 -3
  40. package/dist/components/virtual-list/index.d.ts +8 -0
  41. package/dist/components/virtual-list/src/builders/build-list.d.ts +187 -0
  42. package/dist/components/virtual-list/src/builders/build-list.js +363 -0
  43. package/dist/components/virtual-list/src/components/dynamic-size-list.d.ts +186 -0
  44. package/dist/components/virtual-list/src/components/dynamic-size-list.js +112 -0
  45. package/dist/components/virtual-list/src/components/fixed-size-list.d.ts +185 -0
  46. package/dist/components/virtual-list/src/components/fixed-size-list.js +68 -0
  47. package/dist/components/virtual-list/src/components/scrollbar.d.ts +79 -0
  48. package/dist/components/virtual-list/src/components/scrollbar.js +134 -0
  49. package/dist/components/virtual-list/src/defaults.d.ts +27 -0
  50. package/dist/components/virtual-list/src/defaults.js +26 -0
  51. package/dist/components/virtual-list/src/hooks/use-cache.d.ts +1 -0
  52. package/dist/components/virtual-list/src/hooks/use-cache.js +13 -0
  53. package/dist/components/virtual-list/src/hooks/use-wheel.d.ts +13 -0
  54. package/dist/components/virtual-list/src/hooks/use-wheel.js +26 -0
  55. package/dist/components/virtual-list/src/props.d.ts +211 -0
  56. package/dist/components/virtual-list/src/props.js +151 -0
  57. package/dist/components/virtual-list/src/types.d.ts +152 -0
  58. package/dist/components/virtual-list/src/utils.d.ts +16 -0
  59. package/dist/components/virtual-list/src/utils.js +22 -0
  60. package/dist/hooks/use-float-label/index.d.ts +6 -2
  61. package/dist/hooks/use-float-label/index.js +11 -7
  62. package/dist/index.css +1 -1
  63. package/dist/vendored-components.d.ts +1 -1
  64. package/dist/vendored-components.js +1 -0
  65. package/package.json +2 -1
  66. package/theme-chalk/src/float-label.scss +57 -0
@@ -3,7 +3,6 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
3
3
  * @description whether to pick a time range
4
4
  */
5
5
  isRange: BooleanConstructor;
6
- floatLabel: import("../../../utils").EpPropFinalized<BooleanConstructor, unknown, unknown, false, boolean>;
7
6
  showNow: import("../../../utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
8
7
  showConfirm: import("../../../utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
9
8
  showFooter: import("../../../utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
@@ -206,7 +205,6 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
206
205
  * @description whether to pick a time range
207
206
  */
208
207
  isRange: BooleanConstructor;
209
- floatLabel: import("../../../utils").EpPropFinalized<BooleanConstructor, unknown, unknown, false, boolean>;
210
208
  showNow: import("../../../utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
211
209
  showConfirm: import("../../../utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
212
210
  showFooter: import("../../../utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
@@ -414,7 +412,6 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
414
412
  placement: import("../../../utils").EpPropMergeType<(new (...args: any[]) => "auto" | "left" | "right" | "bottom" | "top" | "auto-start" | "auto-end" | "top-start" | "top-end" | "bottom-start" | "bottom-end" | "right-start" | "right-end" | "left-start" | "left-end") | (() => import("element-plus").Placement) | (((new (...args: any[]) => "auto" | "left" | "right" | "bottom" | "top" | "auto-start" | "auto-end" | "top-start" | "top-end" | "bottom-start" | "bottom-end" | "right-start" | "right-end" | "left-start" | "left-end") | (() => import("element-plus").Placement)) | null)[], import("element-plus").Placement, unknown>;
415
413
  modelValue: import("../../../utils").EpPropMergeType<(new (...args: any[]) => string | number | string[] | Date | number[] | Date[]) | (() => import("..").ModelValueType | null) | (((new (...args: any[]) => string | number | string[] | Date | number[] | Date[]) | (() => import("..").ModelValueType | null)) | null)[], unknown, unknown>;
416
414
  valueOnClear: import("../../../utils").EpPropMergeType<(new (...args: any[]) => string | number | boolean | Function) | (() => string | number | boolean | Function | null) | (((new (...args: any[]) => string | number | boolean | Function) | (() => string | number | boolean | Function | null)) | null)[], unknown, unknown>;
417
- floatLabel: import("../../../utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
418
415
  readonly: boolean;
419
416
  clearable: import("../../../utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
420
417
  clearIcon: import("../../../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>;
@@ -0,0 +1,8 @@
1
+ import FixedSizeList from './src/components/fixed-size-list';
2
+ import DynamicSizeList from './src/components/dynamic-size-list';
3
+ export { DynamicSizeList, FixedSizeList };
4
+ export { virtualizedListProps, virtualizedProps, virtualizedScrollbarProps, } from './src/props';
5
+ export type { Alignment, Direction, ExposesStates, GetEstimatedTotalSize, GetGridOffset, GetOffset, GetPosition, GetStartIndexForOffset, GetStopIndexForStartIndex, GridCache, GridConstructorProps, GridDefaultSlotParams, GridExposes, GridItemKeyGetter, GridItemRenderedEvtParams, GridScrollOptions, GridStates, InitCacheFunc, InitGridCacheFunc, InitListCacheFunc, Instance, ItemProps, ItemSize, LayoutDirection, ListCache, ListConstructorProps, ListExposes, ListItem, ListItemSizer, PropValidator, RTLOffsetType, ScrollDir, ScrollDirection, ScrollbarExpose, SharedExposes, } from './src/types';
6
+ export type { VirtualizedListProps, VirtualizedListPropsPublic, VirtualizedProps, VirtualizedPropsPublic, VirtualizedScrollbarProps, VirtualizedScrollbarPropsPublic, } from './src/props';
7
+ export type { DynamicSizeListInstance } from './src/components/dynamic-size-list';
8
+ export type { FixedSizeListInstance } from './src/components/fixed-size-list';
@@ -0,0 +1,187 @@
1
+ import type { CSSProperties } from 'vue';
2
+ import type { Alignment, ListConstructorProps, ScrollDirection } from '../types';
3
+ import type { VirtualizedListProps } from '../props';
4
+ declare const createList: ({ name, getOffset, getItemSize, getItemOffset, getEstimatedTotalSize, getStartIndexForOffset, getStopIndexForStartIndex, initCache, clearCache, validateProps, }: ListConstructorProps<VirtualizedListProps>) => import("vue").DefineComponent<import("vue").ExtractPropTypes<{
5
+ readonly className: import("@element-plus/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
6
+ readonly containerElement: import("@element-plus/utils").EpPropFinalized<(new (...args: any[]) => string | Element) | (() => string | Element) | (((new (...args: any[]) => string | Element) | (() => string | Element)) | null)[], unknown, unknown, "div", boolean>;
7
+ readonly data: import("@element-plus/utils").EpPropFinalized<(new (...args: any[]) => any[]) | (() => any[]) | (((new (...args: any[]) => any[]) | (() => any[])) | null)[], unknown, unknown, () => [], boolean>;
8
+ readonly direction: import("@element-plus/utils").EpPropFinalized<StringConstructor, "ltr" | "rtl", never, "ltr", false>;
9
+ readonly height: {
10
+ readonly type: import("vue").PropType<import("@element-plus/utils").EpPropMergeType<readonly [StringConstructor, NumberConstructor], unknown, unknown>>;
11
+ readonly required: true;
12
+ readonly validator: ((val: unknown) => boolean) | undefined;
13
+ __epPropKey: true;
14
+ };
15
+ readonly innerElement: import("@element-plus/utils").EpPropFinalized<readonly [StringConstructor, ObjectConstructor], unknown, unknown, "div", boolean>;
16
+ readonly innerProps: import("@element-plus/utils").EpPropFinalized<(new (...args: any[]) => Record<string, unknown>) | (() => Record<string, unknown>) | (((new (...args: any[]) => Record<string, unknown>) | (() => Record<string, unknown>)) | null)[], unknown, unknown, () => {}, boolean>;
17
+ readonly style: import("@element-plus/utils").EpPropFinalized<(new (...args: any[]) => string | false | CSSProperties | import("vue").StyleValue[]) | (() => import("vue").StyleValue) | (((new (...args: any[]) => string | false | CSSProperties | import("vue").StyleValue[]) | (() => import("vue").StyleValue)) | null)[], unknown, unknown, undefined, boolean>;
18
+ readonly useIsScrolling: BooleanConstructor;
19
+ readonly width: {
20
+ readonly type: import("vue").PropType<import("@element-plus/utils").EpPropMergeType<readonly [NumberConstructor, StringConstructor], unknown, unknown>>;
21
+ readonly required: false;
22
+ readonly validator: ((val: unknown) => boolean) | undefined;
23
+ __epPropKey: true;
24
+ };
25
+ readonly innerWidth: {
26
+ readonly type: import("vue").PropType<import("@element-plus/utils").EpPropMergeType<readonly [NumberConstructor, StringConstructor], unknown, unknown>>;
27
+ readonly required: false;
28
+ readonly validator: ((val: unknown) => boolean) | undefined;
29
+ __epPropKey: true;
30
+ };
31
+ readonly perfMode: import("@element-plus/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
32
+ readonly scrollbarAlwaysOn: BooleanConstructor;
33
+ readonly cache: import("@element-plus/utils").EpPropFinalized<NumberConstructor, never, never, 2, false>;
34
+ readonly estimatedItemSize: {
35
+ readonly type: import("vue").PropType<number>;
36
+ readonly required: false;
37
+ readonly validator: ((val: unknown) => boolean) | undefined;
38
+ __epPropKey: true;
39
+ };
40
+ readonly layout: import("@element-plus/utils").EpPropFinalized<StringConstructor, "horizontal" | "vertical", never, "vertical", false>;
41
+ readonly initScrollOffset: import("@element-plus/utils").EpPropFinalized<NumberConstructor, never, never, 0, false>;
42
+ readonly total: {
43
+ readonly type: import("vue").PropType<number>;
44
+ readonly required: true;
45
+ readonly validator: ((val: unknown) => boolean) | undefined;
46
+ __epPropKey: true;
47
+ };
48
+ readonly itemSize: {
49
+ readonly type: import("vue").PropType<import("@element-plus/utils").EpPropMergeType<(new (...args: any[]) => number | import("../types").ItemSize) | (() => number | import("../types").ItemSize) | (((new (...args: any[]) => number | import("../types").ItemSize) | (() => number | import("../types").ItemSize)) | null)[], never, never>>;
50
+ readonly required: true;
51
+ readonly validator: ((val: unknown) => boolean) | undefined;
52
+ __epPropKey: true;
53
+ };
54
+ }>, {
55
+ ns: {
56
+ namespace: import("vue").ComputedRef<string>;
57
+ b: (blockSuffix?: string) => string;
58
+ e: (element?: string) => string;
59
+ m: (modifier?: string) => string;
60
+ be: (blockSuffix?: string, element?: string) => string;
61
+ em: (element?: string, modifier?: string) => string;
62
+ bm: (blockSuffix?: string, modifier?: string) => string;
63
+ bem: (blockSuffix?: string, element?: string, modifier?: string) => string;
64
+ is: {
65
+ (name: string, state: boolean | undefined): string;
66
+ (name: string): string;
67
+ };
68
+ cssVar: (object: Record<string, string>) => Record<string, string>;
69
+ cssVarName: (name: string) => string;
70
+ cssVarBlock: (object: Record<string, string>) => Record<string, string>;
71
+ cssVarBlockName: (name: string) => string;
72
+ };
73
+ clientSize: import("vue").ComputedRef<string | number | undefined>;
74
+ estimatedTotalSize: import("vue").ComputedRef<number>;
75
+ windowStyle: import("vue").ComputedRef<(string | false | CSSProperties | import("vue").StyleValue[] | {
76
+ [x: string]: string;
77
+ position: string;
78
+ WebkitOverflowScrolling: string;
79
+ willChange: string;
80
+ } | null | undefined)[]>;
81
+ windowRef: import("vue").Ref<HTMLElement | undefined, HTMLElement | undefined>;
82
+ innerRef: import("vue").Ref<HTMLElement | undefined, HTMLElement | undefined>;
83
+ innerStyle: import("vue").ComputedRef<{
84
+ height: string;
85
+ pointerEvents: string | undefined;
86
+ width: string;
87
+ margin: number;
88
+ boxSizing: string;
89
+ }>;
90
+ itemsToRender: import("vue").ComputedRef<number[]>;
91
+ scrollbarRef: import("vue").Ref<any, any>;
92
+ states: import("vue").Ref<{
93
+ isScrolling: boolean;
94
+ scrollDir: ScrollDirection;
95
+ scrollOffset: number;
96
+ updateRequested: boolean;
97
+ isScrollbarDragging: boolean;
98
+ }, {
99
+ isScrolling: boolean;
100
+ scrollDir: ScrollDirection;
101
+ scrollOffset: number;
102
+ updateRequested: boolean;
103
+ isScrollbarDragging: boolean;
104
+ } | {
105
+ isScrolling: boolean;
106
+ scrollDir: ScrollDirection;
107
+ scrollOffset: number;
108
+ updateRequested: boolean;
109
+ isScrollbarDragging: boolean;
110
+ }>;
111
+ getItemStyle: (idx: number) => CSSProperties;
112
+ onScroll: (e: Event) => void;
113
+ onScrollbarScroll: (distanceToGo: number, totalSteps: number) => void;
114
+ onWheel: (e: WheelEvent) => void;
115
+ scrollTo: (offset: number) => void;
116
+ scrollToItem: (idx: number, alignment?: Alignment) => void;
117
+ resetScrollTop: () => void;
118
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("scroll" | "itemRendered" | "end-reached")[], "scroll" | "itemRendered" | "end-reached", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
119
+ readonly className: import("@element-plus/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
120
+ readonly containerElement: import("@element-plus/utils").EpPropFinalized<(new (...args: any[]) => string | Element) | (() => string | Element) | (((new (...args: any[]) => string | Element) | (() => string | Element)) | null)[], unknown, unknown, "div", boolean>;
121
+ readonly data: import("@element-plus/utils").EpPropFinalized<(new (...args: any[]) => any[]) | (() => any[]) | (((new (...args: any[]) => any[]) | (() => any[])) | null)[], unknown, unknown, () => [], boolean>;
122
+ readonly direction: import("@element-plus/utils").EpPropFinalized<StringConstructor, "ltr" | "rtl", never, "ltr", false>;
123
+ readonly height: {
124
+ readonly type: import("vue").PropType<import("@element-plus/utils").EpPropMergeType<readonly [StringConstructor, NumberConstructor], unknown, unknown>>;
125
+ readonly required: true;
126
+ readonly validator: ((val: unknown) => boolean) | undefined;
127
+ __epPropKey: true;
128
+ };
129
+ readonly innerElement: import("@element-plus/utils").EpPropFinalized<readonly [StringConstructor, ObjectConstructor], unknown, unknown, "div", boolean>;
130
+ readonly innerProps: import("@element-plus/utils").EpPropFinalized<(new (...args: any[]) => Record<string, unknown>) | (() => Record<string, unknown>) | (((new (...args: any[]) => Record<string, unknown>) | (() => Record<string, unknown>)) | null)[], unknown, unknown, () => {}, boolean>;
131
+ readonly style: import("@element-plus/utils").EpPropFinalized<(new (...args: any[]) => string | false | CSSProperties | import("vue").StyleValue[]) | (() => import("vue").StyleValue) | (((new (...args: any[]) => string | false | CSSProperties | import("vue").StyleValue[]) | (() => import("vue").StyleValue)) | null)[], unknown, unknown, undefined, boolean>;
132
+ readonly useIsScrolling: BooleanConstructor;
133
+ readonly width: {
134
+ readonly type: import("vue").PropType<import("@element-plus/utils").EpPropMergeType<readonly [NumberConstructor, StringConstructor], unknown, unknown>>;
135
+ readonly required: false;
136
+ readonly validator: ((val: unknown) => boolean) | undefined;
137
+ __epPropKey: true;
138
+ };
139
+ readonly innerWidth: {
140
+ readonly type: import("vue").PropType<import("@element-plus/utils").EpPropMergeType<readonly [NumberConstructor, StringConstructor], unknown, unknown>>;
141
+ readonly required: false;
142
+ readonly validator: ((val: unknown) => boolean) | undefined;
143
+ __epPropKey: true;
144
+ };
145
+ readonly perfMode: import("@element-plus/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
146
+ readonly scrollbarAlwaysOn: BooleanConstructor;
147
+ readonly cache: import("@element-plus/utils").EpPropFinalized<NumberConstructor, never, never, 2, false>;
148
+ readonly estimatedItemSize: {
149
+ readonly type: import("vue").PropType<number>;
150
+ readonly required: false;
151
+ readonly validator: ((val: unknown) => boolean) | undefined;
152
+ __epPropKey: true;
153
+ };
154
+ readonly layout: import("@element-plus/utils").EpPropFinalized<StringConstructor, "horizontal" | "vertical", never, "vertical", false>;
155
+ readonly initScrollOffset: import("@element-plus/utils").EpPropFinalized<NumberConstructor, never, never, 0, false>;
156
+ readonly total: {
157
+ readonly type: import("vue").PropType<number>;
158
+ readonly required: true;
159
+ readonly validator: ((val: unknown) => boolean) | undefined;
160
+ __epPropKey: true;
161
+ };
162
+ readonly itemSize: {
163
+ readonly type: import("vue").PropType<import("@element-plus/utils").EpPropMergeType<(new (...args: any[]) => number | import("../types").ItemSize) | (() => number | import("../types").ItemSize) | (((new (...args: any[]) => number | import("../types").ItemSize) | (() => number | import("../types").ItemSize)) | null)[], never, never>>;
164
+ readonly required: true;
165
+ readonly validator: ((val: unknown) => boolean) | undefined;
166
+ __epPropKey: true;
167
+ };
168
+ }>> & Readonly<{
169
+ onScroll?: ((...args: any[]) => any) | undefined;
170
+ "onEnd-reached"?: ((...args: any[]) => any) | undefined;
171
+ onItemRendered?: ((...args: any[]) => any) | undefined;
172
+ }>, {
173
+ readonly data: any[];
174
+ readonly layout: import("@element-plus/utils").EpPropMergeType<StringConstructor, "horizontal" | "vertical", never>;
175
+ readonly style: import("vue").StyleValue;
176
+ readonly direction: import("@element-plus/utils").EpPropMergeType<StringConstructor, "ltr" | "rtl", never>;
177
+ readonly className: string;
178
+ readonly containerElement: import("@element-plus/utils").EpPropMergeType<(new (...args: any[]) => string | Element) | (() => string | Element) | (((new (...args: any[]) => string | Element) | (() => string | Element)) | null)[], unknown, unknown>;
179
+ readonly innerElement: import("@element-plus/utils").EpPropMergeType<readonly [StringConstructor, ObjectConstructor], unknown, unknown>;
180
+ readonly innerProps: Record<string, unknown>;
181
+ readonly perfMode: import("@element-plus/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
182
+ readonly useIsScrolling: boolean;
183
+ readonly scrollbarAlwaysOn: boolean;
184
+ readonly cache: number;
185
+ readonly initScrollOffset: number;
186
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
187
+ export default createList;
@@ -0,0 +1,363 @@
1
+ import { defineComponent as bt, resolveDynamicComponent as Y, h as _, Fragment as xt, mergeProps as zt, getCurrentInstance as Lt, ref as M, computed as f, unref as s, onMounted as _t, onUpdated as Mt, onActivated as Ct, watch as Dt, nextTick as tt } from "vue";
2
+ import { useEventListener as It, isClient as At, clamp as kt } from "@vueuse/core";
3
+ import { isNumber as C } from "../../../../utils/types.js";
4
+ import "lodash-unified";
5
+ import { isString as et, hasOwn as Nt } from "@vue/shared";
6
+ import { isGreaterThan as ot } from "../../../../utils/numbers.js";
7
+ import "@element-plus/icons-vue";
8
+ import { useNamespace as Wt } from "../../../../hooks/use-namespace/index.js";
9
+ import "../../../../hooks/use-size/index.js";
10
+ import "@popperjs/core";
11
+ import "../../../../hooks/use-z-index/index.js";
12
+ import "../../../../hooks/use-delayed-toggle/index.js";
13
+ import "../../../../hooks/use-aria/index.js";
14
+ import "../../../../hooks/use-model-toggle/index.js";
15
+ import "../../../../hooks/use-empty-values/index.js";
16
+ import { useCache as Ft } from "../hooks/use-cache.js";
17
+ import $t from "../hooks/use-wheel.js";
18
+ import pt from "../components/scrollbar.js";
19
+ import { isHorizontal as Ht, getRTLOffsetType as lt, getScrollDir as qt } from "../utils.js";
20
+ import { virtualizedListProps as Pt } from "../props.js";
21
+ import { ITEM_RENDER_EVT as nt, SCROLL_EVT as st, END_REACHED_EVT as K, FORWARD as Z, HORIZONTAL as Vt, RTL as D, RTL_OFFSET_POS_ASC as Gt, RTL_OFFSET_NAG as rt, AUTO_ALIGNMENT as Bt, BACKWARD as it, RTL_OFFSET_POS_DESC as Ut } from "../defaults.js";
22
+ const he = ({
23
+ name: ct,
24
+ getOffset: at,
25
+ getItemSize: ft,
26
+ getItemOffset: dt,
27
+ getEstimatedTotalSize: ut,
28
+ getStartIndexForOffset: mt,
29
+ getStopIndexForStartIndex: ht,
30
+ initCache: St,
31
+ clearCache: q,
32
+ validateProps: gt
33
+ }) => bt({
34
+ name: ct ?? "ElVirtualList",
35
+ props: Pt,
36
+ emits: [nt, st, K],
37
+ setup(o, { emit: m, expose: P }) {
38
+ gt(o);
39
+ const R = Lt(), V = Wt("vl"), h = M(St(o, R)), y = Ft(), u = M(), I = M(), A = M(), i = M({
40
+ isScrolling: !1,
41
+ scrollDir: Z,
42
+ scrollOffset: C(o.initScrollOffset) ? o.initScrollOffset : 0,
43
+ updateRequested: !1,
44
+ isScrollbarDragging: !1
45
+ }), b = f(() => {
46
+ const { total: t, cache: l } = o, { isScrolling: e, scrollDir: r, scrollOffset: n } = s(i);
47
+ if (t === 0)
48
+ return [0, 0, 0, 0];
49
+ const c = mt(
50
+ o,
51
+ n,
52
+ s(h)
53
+ ), a = ht(
54
+ o,
55
+ c,
56
+ n,
57
+ s(h)
58
+ ), w = !e || r === it ? Math.max(1, l) : 1, T = !e || r === Z ? Math.max(1, l) : 1;
59
+ return [
60
+ Math.max(0, c - w),
61
+ Math.max(0, Math.min(t - 1, a + T)),
62
+ c,
63
+ a
64
+ ];
65
+ }), O = f(
66
+ () => ut(o, s(h))
67
+ ), d = f(() => Ht(o.layout)), G = f(() => [
68
+ {
69
+ position: "relative",
70
+ [`overflow-${d.value ? "x" : "y"}`]: "scroll",
71
+ WebkitOverflowScrolling: "touch",
72
+ willChange: "transform"
73
+ },
74
+ {
75
+ direction: o.direction,
76
+ height: C(o.height) ? `${o.height}px` : o.height,
77
+ width: C(o.width) ? `${o.width}px` : o.width
78
+ },
79
+ o.style
80
+ ]), k = f(() => {
81
+ const t = s(O), l = s(d), e = o.innerWidth;
82
+ return {
83
+ height: l ? "100%" : `${t}px`,
84
+ pointerEvents: s(i).isScrolling ? "none" : void 0,
85
+ width: l ? `${t}px` : e !== void 0 ? C(e) ? `${e}px` : e : "100%",
86
+ // fix scrolling issues in Firefox.
87
+ margin: 0,
88
+ boxSizing: "border-box"
89
+ };
90
+ }), N = f(
91
+ () => d.value ? o.width : o.height
92
+ ), S = f(
93
+ () => Math.max(0, O.value - N.value)
94
+ ), x = (t) => kt(t, 0, S.value), W = 1, F = (t) => ({
95
+ start: !ot(t, 0, W),
96
+ end: !ot(S.value, t, W)
97
+ }), $ = f(
98
+ () => x(i.value.scrollOffset)
99
+ ), v = f(
100
+ () => F($.value)
101
+ );
102
+ let g = v.value;
103
+ const p = f(() => v.value.start), B = f(() => v.value.end), { onWheel: H } = $t(
104
+ {
105
+ atStartEdge: p,
106
+ atEndEdge: B,
107
+ layout: f(() => o.layout)
108
+ },
109
+ (t) => {
110
+ var l, e;
111
+ (e = (l = A.value).onMouseUp) == null || e.call(l), L(
112
+ Math.min(i.value.scrollOffset + t, S.value)
113
+ );
114
+ }
115
+ );
116
+ It(u, "wheel", H, {
117
+ passive: !1
118
+ });
119
+ const z = () => {
120
+ const { total: t } = o;
121
+ if (t > 0) {
122
+ const [n, c, a, w] = s(b);
123
+ m(nt, n, c, a, w);
124
+ }
125
+ const { scrollDir: l, scrollOffset: e, updateRequested: r } = s(i);
126
+ m(st, l, e, r);
127
+ }, E = (t, l) => {
128
+ const e = F(l), r = o.direction === D ? "left" : "right", n = o.direction === D ? "right" : "left";
129
+ t === Z && e.end && !g.end && m(K, d.value ? r : "bottom"), t === it && e.start && !g.start && m(K, d.value ? n : "top"), g = e;
130
+ }, U = (t, {
131
+ isScrolling: l,
132
+ updateRequested: e
133
+ }) => {
134
+ const r = s(i), n = Math.max(t, 0);
135
+ if (n === r.scrollOffset)
136
+ return;
137
+ const c = qt(r.scrollOffset, n);
138
+ i.value = {
139
+ ...r,
140
+ isScrolling: l,
141
+ scrollDir: c,
142
+ scrollOffset: n,
143
+ updateRequested: e
144
+ }, E(c, x(n)), tt(Rt);
145
+ }, vt = (t) => {
146
+ const { clientHeight: l, scrollHeight: e, scrollTop: r } = t.currentTarget;
147
+ s(i).scrollOffset !== r && U(Math.min(r, e - l), {
148
+ isScrolling: !0,
149
+ updateRequested: !1
150
+ });
151
+ }, Et = (t) => {
152
+ const { clientWidth: l, scrollLeft: e, scrollWidth: r } = t.currentTarget;
153
+ if (s(i).scrollOffset === e)
154
+ return;
155
+ const { direction: c } = o;
156
+ let a = e;
157
+ if (c === D)
158
+ switch (lt()) {
159
+ case rt: {
160
+ a = -e;
161
+ break;
162
+ }
163
+ case Ut: {
164
+ a = r - l - e;
165
+ break;
166
+ }
167
+ }
168
+ U(Math.min(a, r - l), {
169
+ isScrolling: !0,
170
+ updateRequested: !1
171
+ });
172
+ }, Ot = (t) => {
173
+ s(d) ? Et(t) : vt(t), z();
174
+ }, wt = (t, l) => {
175
+ const e = S.value / l * t;
176
+ L(Math.min(S.value, e));
177
+ }, L = (t) => {
178
+ U(t, {
179
+ isScrolling: s(i).isScrolling,
180
+ updateRequested: !0
181
+ });
182
+ }, j = (t, l = Bt) => {
183
+ const { scrollOffset: e } = s(i);
184
+ t = Math.max(0, Math.min(t, o.total - 1)), L(
185
+ at(
186
+ o,
187
+ t,
188
+ l,
189
+ e,
190
+ s(h)
191
+ )
192
+ );
193
+ }, Tt = (t) => {
194
+ const { direction: l, itemSize: e, layout: r } = o, n = y.value(
195
+ q && e,
196
+ q && r,
197
+ q && l
198
+ );
199
+ let c;
200
+ if (Nt(n, String(t)))
201
+ c = n[t];
202
+ else {
203
+ const a = dt(o, t, s(h)), w = ft(o, t, s(h)), T = s(d), Q = l === D, X = T ? a : 0;
204
+ n[t] = c = {
205
+ position: "absolute",
206
+ left: Q ? void 0 : `${X}px`,
207
+ right: Q ? `${X}px` : void 0,
208
+ top: T ? 0 : `${a}px`,
209
+ height: T ? "100%" : `${w}px`,
210
+ width: T ? `${w}px` : "100%"
211
+ };
212
+ }
213
+ return c;
214
+ }, Rt = () => {
215
+ i.value.isScrolling = !1, tt(() => {
216
+ y.value(-1, null, null);
217
+ });
218
+ }, J = () => {
219
+ const t = u.value;
220
+ t && (t.scrollTop = 0);
221
+ };
222
+ _t(() => {
223
+ if (!At) return;
224
+ const { initScrollOffset: t } = o, l = s(u);
225
+ C(t) && l && (s(d) ? l.scrollLeft = t : l.scrollTop = t), z();
226
+ }), Mt(() => {
227
+ const { direction: t, layout: l } = o, { scrollOffset: e, updateRequested: r } = s(i), n = s(u);
228
+ if (r && n)
229
+ if (l === Vt)
230
+ if (t === D)
231
+ switch (lt()) {
232
+ case rt: {
233
+ n.scrollLeft = -e;
234
+ break;
235
+ }
236
+ case Gt: {
237
+ n.scrollLeft = e;
238
+ break;
239
+ }
240
+ default: {
241
+ const { clientWidth: c, scrollWidth: a } = n;
242
+ n.scrollLeft = a - c - e;
243
+ break;
244
+ }
245
+ }
246
+ else
247
+ n.scrollLeft = e;
248
+ else
249
+ n.scrollTop = e;
250
+ }), Ct(() => {
251
+ s(u).scrollTop = s(i).scrollOffset;
252
+ }), Dt(S, () => {
253
+ g = v.value;
254
+ });
255
+ const yt = {
256
+ ns: V,
257
+ clientSize: N,
258
+ estimatedTotalSize: O,
259
+ windowStyle: G,
260
+ windowRef: u,
261
+ innerRef: I,
262
+ innerStyle: k,
263
+ itemsToRender: b,
264
+ scrollbarRef: A,
265
+ states: i,
266
+ getItemStyle: Tt,
267
+ onScroll: Ot,
268
+ onScrollbarScroll: wt,
269
+ onWheel: H,
270
+ scrollTo: L,
271
+ scrollToItem: j,
272
+ resetScrollTop: J
273
+ };
274
+ return P({
275
+ windowRef: u,
276
+ innerRef: I,
277
+ getItemStyleCache: y,
278
+ scrollTo: L,
279
+ scrollToItem: j,
280
+ resetScrollTop: J,
281
+ states: i
282
+ }), yt;
283
+ },
284
+ render(o) {
285
+ var z;
286
+ const {
287
+ $slots: m,
288
+ className: P,
289
+ clientSize: R,
290
+ containerElement: V,
291
+ data: h,
292
+ getItemStyle: y,
293
+ innerElement: u,
294
+ itemsToRender: I,
295
+ innerStyle: A,
296
+ layout: i,
297
+ scrollbarAlwaysOn: b,
298
+ total: O,
299
+ onScroll: d,
300
+ onScrollbarScroll: G,
301
+ states: k,
302
+ useIsScrolling: N,
303
+ windowStyle: S,
304
+ ns: x
305
+ } = o, [W, F] = I, $ = Y(V), v = Y(u), g = [];
306
+ if (O > 0)
307
+ for (let E = W; E <= F; E++)
308
+ g.push(
309
+ _(
310
+ xt,
311
+ { key: E },
312
+ (z = m.default) == null ? void 0 : z.call(m, {
313
+ data: h,
314
+ index: E,
315
+ isScrolling: N ? k.isScrolling : void 0,
316
+ style: y(E)
317
+ })
318
+ )
319
+ );
320
+ const p = [
321
+ _(
322
+ v,
323
+ zt(o.innerProps, {
324
+ style: A,
325
+ ref: "innerRef"
326
+ }),
327
+ et(v) ? g : {
328
+ default: () => g
329
+ }
330
+ )
331
+ ], B = _(pt, {
332
+ ref: "scrollbarRef",
333
+ clientSize: R,
334
+ layout: i,
335
+ onScroll: G,
336
+ ratio: R * 100 / this.estimatedTotalSize,
337
+ scrollFrom: k.scrollOffset / (this.estimatedTotalSize - R),
338
+ total: O,
339
+ alwaysOn: b
340
+ }), H = _(
341
+ $,
342
+ {
343
+ class: [x.e("window"), P],
344
+ style: S,
345
+ onScroll: d,
346
+ ref: "windowRef",
347
+ key: 0
348
+ },
349
+ et($) ? [p] : { default: () => [p] }
350
+ );
351
+ return _(
352
+ "div",
353
+ {
354
+ key: 0,
355
+ class: [x.e("wrapper"), b ? "always-on" : ""]
356
+ },
357
+ [H, B]
358
+ );
359
+ }
360
+ });
361
+ export {
362
+ he as default
363
+ };