vft 0.0.252 → 0.0.253

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 (56) hide show
  1. package/dist/index.css +1 -1
  2. package/es/components/carousel/carousel-item.vue.d.ts +1 -4
  3. package/es/components/carousel/carousel-item.vue2.js +43 -43
  4. package/es/components/carousel/carousel.vue.d.ts +7 -61
  5. package/es/components/carousel/carousel.vue2.js +158 -113
  6. package/es/components/carousel/constants.d.ts +7 -4
  7. package/es/components/carousel/constants.js +2 -1
  8. package/es/components/carousel/index.d.ts +69 -117
  9. package/es/components/carousel/index.js +8 -7
  10. package/es/components/carousel/types.d.ts +19 -0
  11. package/es/components/carousel/types.js +1 -0
  12. package/es/components/carousel/use-carousel-item.d.ts +2 -2
  13. package/es/components/carousel/use-carousel-item.js +53 -53
  14. package/es/components/carousel/use-carousel.d.ts +10 -1
  15. package/es/components/carousel/use-carousel.js +131 -112
  16. package/es/components/date-picker/composables/use-basic-date-table.d.ts +2 -2
  17. package/es/components/date-picker/composables/use-range-picker.d.ts +2 -2
  18. package/es/components/index.js +55 -54
  19. package/es/components/multiple-tabs/multiple-tabs.vue2.js +26 -26
  20. package/es/components/popover/popover.vue2.js +19 -19
  21. package/es/components/time-picker/composables/use-time-picker.d.ts +4 -4
  22. package/es/components/upload/use-handlers.d.ts +4 -4
  23. package/es/hooks/use-ordered-children/index.js +7 -7
  24. package/es/index.js +72 -71
  25. package/es/package.json.d.ts +1 -1
  26. package/es/package.json.js +1 -1
  27. package/lib/components/carousel/carousel-item.vue.d.ts +1 -4
  28. package/lib/components/carousel/carousel-item.vue2.cjs +1 -1
  29. package/lib/components/carousel/carousel.vue.d.ts +7 -61
  30. package/lib/components/carousel/carousel.vue2.cjs +1 -1
  31. package/lib/components/carousel/constants.cjs +1 -1
  32. package/lib/components/carousel/constants.d.ts +7 -4
  33. package/lib/components/carousel/index.cjs +1 -1
  34. package/lib/components/carousel/index.d.ts +69 -117
  35. package/lib/components/carousel/types.cjs +1 -0
  36. package/lib/components/carousel/types.d.ts +19 -0
  37. package/lib/components/carousel/use-carousel-item.cjs +1 -1
  38. package/lib/components/carousel/use-carousel-item.d.ts +2 -2
  39. package/lib/components/carousel/use-carousel.cjs +1 -1
  40. package/lib/components/carousel/use-carousel.d.ts +10 -1
  41. package/lib/components/date-picker/composables/use-basic-date-table.d.ts +2 -2
  42. package/lib/components/date-picker/composables/use-range-picker.d.ts +2 -2
  43. package/lib/components/index.cjs +1 -1
  44. package/lib/components/multiple-tabs/multiple-tabs.vue2.cjs +1 -1
  45. package/lib/components/popover/popover.vue2.cjs +1 -1
  46. package/lib/components/time-picker/composables/use-time-picker.d.ts +4 -4
  47. package/lib/components/upload/use-handlers.d.ts +4 -4
  48. package/lib/hooks/use-ordered-children/index.cjs +1 -1
  49. package/lib/index.cjs +1 -1
  50. package/lib/package.json.cjs +1 -1
  51. package/lib/package.json.d.ts +1 -1
  52. package/package.json +4 -4
  53. package/theme-style/index.css +1 -1
  54. package/theme-style/src/carousel.scss +45 -31
  55. package/theme-style/vft-carousel.css +1 -1
  56. package/web-types.json +1 -1
@@ -1,70 +1,54 @@
1
1
  export declare const VftCarousel: import("vft/es/utils").SFCWithInstall<{
2
2
  new (...args: any[]): import("vue").CreateComponentPublicInstanceWithMixins<Readonly<import("vue").ExtractPropTypes<{
3
- direction: {
4
- type: import("vue").PropType<"vertical" | "horizontal">;
5
- default: string;
3
+ initialIndex: {
4
+ type: import("vue").PropType<string | number>;
6
5
  };
7
6
  height: {
8
7
  type: import("vue").PropType<string>;
9
- default: string;
10
- };
11
- type: {
12
- type: import("vue").PropType<"" | "card">;
13
- default: string;
14
- };
15
- arrow: {
16
- type: import("vue").PropType<"always" | "hover" | "never">;
17
- default: string;
18
8
  };
19
9
  trigger: {
20
10
  type: import("vue").PropType<"click" | "hover">;
21
- default: string;
22
11
  };
23
- loop: {
12
+ autoplay: {
24
13
  type: import("vue").PropType<boolean>;
25
- default: boolean;
26
- };
27
- initialIndex: {
28
- type: import("vue").PropType<string | number>;
29
- default: number;
30
14
  };
31
15
  interval: {
32
16
  type: import("vue").PropType<number>;
33
- default: number;
34
- };
35
- autoplay: {
36
- type: import("vue").PropType<boolean>;
37
- default: boolean;
38
17
  };
39
18
  indicatorPosition: {
40
19
  type: import("vue").PropType<"" | "none" | "outside">;
41
- default: string;
20
+ };
21
+ arrow: {
22
+ type: import("vue").PropType<"always" | "hover" | "never">;
23
+ };
24
+ type: {
25
+ type: import("vue").PropType<"" | "card">;
26
+ };
27
+ loop: {
28
+ type: import("vue").PropType<boolean>;
29
+ };
30
+ direction: {
31
+ type: import("vue").PropType<"vertical" | "horizontal">;
42
32
  };
43
33
  pauseOnHover: {
44
34
  type: import("vue").PropType<boolean>;
45
- default: boolean;
35
+ };
36
+ motionBlur: {
37
+ type: import("vue").PropType<boolean>;
38
+ };
39
+ cardScale: {
40
+ type: import("vue").PropType<number>;
46
41
  };
47
42
  }>> & Readonly<{
48
43
  onChange?: ((current: number, prev: number) => any) | undefined;
49
44
  }>, {
45
+ activeIndex: import("vue").Ref<number, number>;
50
46
  setActiveItem: (index: number | string) => void;
51
47
  prev: () => void;
52
48
  next: () => void;
53
49
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
54
50
  change: (current: number, prev: number) => void;
55
- }, import("vue").PublicProps, {
56
- direction: "horizontal" | "vertical";
57
- height: string;
58
- type: "" | "card";
59
- arrow: "always" | "hover" | "never";
60
- trigger: "hover" | "click";
61
- loop: boolean;
62
- initialIndex: number | string;
63
- interval: number;
64
- autoplay: boolean;
65
- indicatorPosition: "" | "none" | "outside";
66
- pauseOnHover: boolean;
67
- }, true, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
51
+ }, import("vue").PublicProps, {}, true, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
68
52
  P: {};
69
53
  B: {};
70
54
  D: {};
@@ -72,138 +56,106 @@ export declare const VftCarousel: import("vft/es/utils").SFCWithInstall<{
72
56
  M: {};
73
57
  Defaults: {};
74
58
  }, Readonly<import("vue").ExtractPropTypes<{
75
- direction: {
76
- type: import("vue").PropType<"vertical" | "horizontal">;
77
- default: string;
59
+ initialIndex: {
60
+ type: import("vue").PropType<string | number>;
78
61
  };
79
62
  height: {
80
63
  type: import("vue").PropType<string>;
81
- default: string;
82
- };
83
- type: {
84
- type: import("vue").PropType<"" | "card">;
85
- default: string;
86
- };
87
- arrow: {
88
- type: import("vue").PropType<"always" | "hover" | "never">;
89
- default: string;
90
64
  };
91
65
  trigger: {
92
66
  type: import("vue").PropType<"click" | "hover">;
93
- default: string;
94
67
  };
95
- loop: {
68
+ autoplay: {
96
69
  type: import("vue").PropType<boolean>;
97
- default: boolean;
98
- };
99
- initialIndex: {
100
- type: import("vue").PropType<string | number>;
101
- default: number;
102
70
  };
103
71
  interval: {
104
72
  type: import("vue").PropType<number>;
105
- default: number;
106
- };
107
- autoplay: {
108
- type: import("vue").PropType<boolean>;
109
- default: boolean;
110
73
  };
111
74
  indicatorPosition: {
112
75
  type: import("vue").PropType<"" | "none" | "outside">;
113
- default: string;
76
+ };
77
+ arrow: {
78
+ type: import("vue").PropType<"always" | "hover" | "never">;
79
+ };
80
+ type: {
81
+ type: import("vue").PropType<"" | "card">;
82
+ };
83
+ loop: {
84
+ type: import("vue").PropType<boolean>;
85
+ };
86
+ direction: {
87
+ type: import("vue").PropType<"vertical" | "horizontal">;
114
88
  };
115
89
  pauseOnHover: {
116
90
  type: import("vue").PropType<boolean>;
117
- default: boolean;
91
+ };
92
+ motionBlur: {
93
+ type: import("vue").PropType<boolean>;
94
+ };
95
+ cardScale: {
96
+ type: import("vue").PropType<number>;
118
97
  };
119
98
  }>> & Readonly<{
120
99
  onChange?: ((current: number, prev: number) => any) | undefined;
121
100
  }>, {
101
+ activeIndex: import("vue").Ref<number, number>;
122
102
  setActiveItem: (index: number | string) => void;
123
103
  prev: () => void;
124
104
  next: () => void;
125
- }, {}, {}, {}, {
126
- direction: "horizontal" | "vertical";
127
- height: string;
128
- type: "" | "card";
129
- arrow: "always" | "hover" | "never";
130
- trigger: "hover" | "click";
131
- loop: boolean;
132
- initialIndex: number | string;
133
- interval: number;
134
- autoplay: boolean;
135
- indicatorPosition: "" | "none" | "outside";
136
- pauseOnHover: boolean;
137
- }>;
105
+ }, {}, {}, {}, {}>;
138
106
  __isFragment?: never;
139
107
  __isTeleport?: never;
140
108
  __isSuspense?: never;
141
109
  } & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
142
- direction: {
143
- type: import("vue").PropType<"vertical" | "horizontal">;
144
- default: string;
110
+ initialIndex: {
111
+ type: import("vue").PropType<string | number>;
145
112
  };
146
113
  height: {
147
114
  type: import("vue").PropType<string>;
148
- default: string;
149
- };
150
- type: {
151
- type: import("vue").PropType<"" | "card">;
152
- default: string;
153
- };
154
- arrow: {
155
- type: import("vue").PropType<"always" | "hover" | "never">;
156
- default: string;
157
115
  };
158
116
  trigger: {
159
117
  type: import("vue").PropType<"click" | "hover">;
160
- default: string;
161
118
  };
162
- loop: {
119
+ autoplay: {
163
120
  type: import("vue").PropType<boolean>;
164
- default: boolean;
165
- };
166
- initialIndex: {
167
- type: import("vue").PropType<string | number>;
168
- default: number;
169
121
  };
170
122
  interval: {
171
123
  type: import("vue").PropType<number>;
172
- default: number;
173
- };
174
- autoplay: {
175
- type: import("vue").PropType<boolean>;
176
- default: boolean;
177
124
  };
178
125
  indicatorPosition: {
179
126
  type: import("vue").PropType<"" | "none" | "outside">;
180
- default: string;
127
+ };
128
+ arrow: {
129
+ type: import("vue").PropType<"always" | "hover" | "never">;
130
+ };
131
+ type: {
132
+ type: import("vue").PropType<"" | "card">;
133
+ };
134
+ loop: {
135
+ type: import("vue").PropType<boolean>;
136
+ };
137
+ direction: {
138
+ type: import("vue").PropType<"vertical" | "horizontal">;
181
139
  };
182
140
  pauseOnHover: {
183
141
  type: import("vue").PropType<boolean>;
184
- default: boolean;
142
+ };
143
+ motionBlur: {
144
+ type: import("vue").PropType<boolean>;
145
+ };
146
+ cardScale: {
147
+ type: import("vue").PropType<number>;
185
148
  };
186
149
  }>> & Readonly<{
187
150
  onChange?: ((current: number, prev: number) => any) | undefined;
188
151
  }>, {
152
+ activeIndex: import("vue").Ref<number, number>;
189
153
  setActiveItem: (index: number | string) => void;
190
154
  prev: () => void;
191
155
  next: () => void;
192
156
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
193
157
  change: (current: number, prev: number) => void;
194
- }, string, {
195
- direction: "horizontal" | "vertical";
196
- height: string;
197
- type: "" | "card";
198
- arrow: "always" | "hover" | "never";
199
- trigger: "hover" | "click";
200
- loop: boolean;
201
- initialIndex: number | string;
202
- interval: number;
203
- autoplay: boolean;
204
- indicatorPosition: "" | "none" | "outside";
205
- pauseOnHover: boolean;
206
- }, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
158
+ }, string, {}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
207
159
  $slots: {
208
160
  default?(_: {}): any;
209
161
  };
@@ -6,13 +6,14 @@ import "lodash-es";
6
6
  import "vue";
7
7
  import m from "./carousel.vue2.js";
8
8
  import o from "./carousel-item.vue2.js";
9
- import { carouselContextKey as _ } from "./constants.js";
10
- const c = t(m, {
9
+ import { CAROUSEL_ITEM_NAME as I, carouselContextKey as x } from "./constants.js";
10
+ const _ = t(m, {
11
11
  CarouselItem: o
12
- }), u = r(o);
12
+ }), c = r(o);
13
13
  export {
14
- c as VftCarousel,
15
- u as VftCarouselItem,
16
- _ as carouselContextKey,
17
- c as default
14
+ I as CAROUSEL_ITEM_NAME,
15
+ _ as VftCarousel,
16
+ c as VftCarouselItem,
17
+ x as carouselContextKey,
18
+ _ as default
18
19
  };
@@ -0,0 +1,19 @@
1
+ export interface CarouselProps {
2
+ initialIndex?: number | string;
3
+ height?: string;
4
+ trigger?: 'hover' | 'click';
5
+ autoplay?: boolean;
6
+ interval?: number;
7
+ indicatorPosition?: '' | 'none' | 'outside';
8
+ arrow?: 'always' | 'hover' | 'never';
9
+ type?: '' | 'card';
10
+ loop?: boolean;
11
+ direction?: 'horizontal' | 'vertical';
12
+ pauseOnHover?: boolean;
13
+ motionBlur?: boolean;
14
+ cardScale?: number;
15
+ }
16
+ export interface CarouselItemProps {
17
+ name?: string;
18
+ label?: string | number;
19
+ }
@@ -0,0 +1 @@
1
+
@@ -1,5 +1,5 @@
1
- import type { CarouselItemProps } from './carousel-item.vue';
2
- export declare const useCarouselItem: (props: CarouselItemProps, componentName: string) => {
1
+ import type { CarouselItemProps } from './types';
2
+ export declare const useCarouselItem: (props: CarouselItemProps) => {
3
3
  carouselItemRef: import("vue").Ref<HTMLElement | undefined, HTMLElement | undefined>;
4
4
  active: import("vue").Ref<boolean, boolean>;
5
5
  animating: import("vue").Ref<boolean, boolean>;
@@ -1,77 +1,77 @@
1
- import { inject as L, getCurrentInstance as N, ref as n, onMounted as R, reactive as S, onUnmounted as U, unref as l } from "vue";
1
+ import { inject as S, getCurrentInstance as U, ref as n, reactive as V, onBeforeUnmount as L, unref as u } from "vue";
2
2
  import "@vueuse/core";
3
- import { isUndefined as V } from "@vft/utils";
4
- import { debugWarn as H } from "../../utils/error.js";
3
+ import { isUndefined as R } from "@vft/utils";
4
+ import { debugWarn as A } from "../../utils/error.js";
5
5
  import "../../utils/ns-cover.js";
6
6
  import "lodash-es";
7
- import { carouselContextKey as j } from "./constants.js";
8
- const G = (T, b) => {
9
- const s = L(j), c = N();
10
- s || H(
11
- b,
12
- "usage: <vft-carousel></vft-carousel-item></vft-carousel>"
13
- ), c || H(
14
- b,
7
+ import { carouselContextKey as j, CAROUSEL_ITEM_NAME as E } from "./constants.js";
8
+ const F = (H) => {
9
+ const o = S(j), c = U();
10
+ o || A(
11
+ E,
12
+ "usage: <el-carousel></el-carousel-item></el-carousel>"
13
+ ), c || A(
14
+ E,
15
15
  "compositional hook can only be invoked inside setups"
16
16
  );
17
- const p = 0.83, h = n(), A = n(!1), f = n(0), C = n(1), i = n(!1), g = n(!1), m = n(!1), I = n(!1), { isCardType: d, isVertical: y } = s;
18
- function W(t, e, o) {
19
- const r = o - 1, u = e - 1, a = e + 1, v = o / 2;
20
- return e === 0 && t === r ? -1 : e === r && t === 0 ? o : t < u && e - t >= v ? o + 1 : t > a && t - e >= v ? -2 : t;
17
+ const h = n(), T = n(!1), f = n(0), C = n(1), i = n(!1), I = n(!1), m = n(!1), g = n(!1), { isCardType: d, isVertical: y, cardScale: p } = o;
18
+ function M(e, t, s) {
19
+ const r = s - 1, l = t - 1, a = t + 1, v = s / 2;
20
+ return t === 0 && e === r ? -1 : t === r && e === 0 ? s : e < l && t - e >= v ? s + 1 : e > a && e - t >= v ? -2 : e;
21
21
  }
22
- function k(t, e) {
23
- const o = l(y) ? s.root.value?.offsetHeight || 0 : s.root.value?.offsetWidth || 0;
24
- return m.value ? o * ((2 - p) * (t - e) + 1) / 4 : t < e ? -1.83 * o / 4 : (3 + p) * o / 4;
22
+ function N(e, t) {
23
+ const s = u(y) ? o.root.value?.offsetHeight || 0 : o.root.value?.offsetWidth || 0;
24
+ return m.value ? s * ((2 - p) * (e - t) + 1) / 4 : e < t ? -(1 + p) * s / 4 : (3 + p) * s / 4;
25
25
  }
26
- function M(t, e, o) {
27
- const r = s.root.value;
28
- return r ? ((o ? r.offsetHeight : r.offsetWidth) || 0) * (t - e) : 0;
26
+ function W(e, t, s) {
27
+ const r = o.root.value;
28
+ return r ? ((s ? r.offsetHeight : r.offsetWidth) || 0) * (e - t) : 0;
29
29
  }
30
- const _ = (t, e, o) => {
31
- const r = l(d), u = s.items.value.length ?? Number.NaN, a = t === e;
32
- !r && !V(o) && (I.value = a || t === o), !a && u > 2 && s.loop && (t = W(t, e, u));
33
- const v = l(y);
34
- i.value = a, r ? (m.value = Math.round(Math.abs(t - e)) <= 1, f.value = k(t, e), C.value = l(i) ? 1 : p) : f.value = M(t, e, v), g.value = !0, a && h.value && s.setContainerHeight(h.value.offsetHeight);
30
+ const _ = (e, t, s) => {
31
+ const r = u(d), l = o.items.value.length ?? Number.NaN, a = e === t;
32
+ !r && !R(s) && (g.value = a || e === s), !a && l > 2 && o.loop && (e = M(e, t, l));
33
+ const v = u(y);
34
+ i.value = a, r ? (m.value = Math.round(Math.abs(e - t)) <= 1, f.value = N(e, t), C.value = u(i) ? 1 : p) : f.value = W(e, t, v), I.value = !0, a && h.value && o.setContainerHeight(h.value.offsetHeight);
35
35
  };
36
- function E() {
37
- if (s && l(d)) {
38
- const t = s.items.value.findIndex(
39
- ({ uid: e }) => e === c.uid
36
+ function k() {
37
+ if (o && u(d)) {
38
+ const e = o.items.value.findIndex(
39
+ ({ uid: t }) => t === c.uid
40
40
  );
41
- s.setActiveItem(t);
41
+ o.setActiveItem(e);
42
42
  }
43
43
  }
44
- return R(() => {
45
- s.addItem({
46
- props: T,
47
- states: S({
48
- hover: A,
49
- translate: f,
50
- scale: C,
51
- active: i,
52
- ready: g,
53
- inStage: m,
54
- animating: I
55
- }),
56
- uid: c.uid,
57
- translateItem: _
58
- });
59
- }), U(() => {
60
- s.removeItem(c.uid);
44
+ const b = {
45
+ props: H,
46
+ states: V({
47
+ hover: T,
48
+ translate: f,
49
+ scale: C,
50
+ active: i,
51
+ ready: I,
52
+ inStage: m,
53
+ animating: g
54
+ }),
55
+ uid: c.uid,
56
+ getVnode: () => c.vnode,
57
+ translateItem: _
58
+ };
59
+ return o.addItem(b), L(() => {
60
+ o.removeItem(b);
61
61
  }), {
62
62
  carouselItemRef: h,
63
63
  active: i,
64
- animating: I,
65
- hover: A,
64
+ animating: g,
65
+ hover: T,
66
66
  inStage: m,
67
67
  isVertical: y,
68
68
  translate: f,
69
69
  isCardType: d,
70
70
  scale: C,
71
- ready: g,
72
- handleItemClick: E
71
+ ready: I,
72
+ handleItemClick: k
73
73
  };
74
74
  };
75
75
  export {
76
- G as useCarouselItem
76
+ F as useCarouselItem
77
77
  };
@@ -1,5 +1,5 @@
1
1
  import type { CarouselItemContext } from './constants';
2
- import type { CarouselProps } from './carousel.vue';
2
+ import type { CarouselProps } from './types';
3
3
  export declare const useCarousel: (props: CarouselProps, emit: any, componentName: string) => {
4
4
  root: import("vue").Ref<HTMLDivElement | undefined, HTMLDivElement | undefined>;
5
5
  activeIndex: import("vue").Ref<number, number>;
@@ -16,6 +16,7 @@ export declare const useCarousel: (props: CarouselProps, emit: any, componentNam
16
16
  height: string;
17
17
  overflow: string;
18
18
  }>;
19
+ isItemsTwoLength: import("vue").Ref<boolean, boolean>;
19
20
  handleButtonEnter: (arrow: "left" | "right") => void;
20
21
  handleButtonLeave: () => void;
21
22
  handleIndicatorClick: (index: number) => void;
@@ -24,6 +25,14 @@ export declare const useCarousel: (props: CarouselProps, emit: any, componentNam
24
25
  setActiveItem: (index: number | string) => void;
25
26
  prev: () => void;
26
27
  next: () => void;
28
+ PlaceholderItem: () => ({
29
+ [name: string]: unknown;
30
+ $stable?: boolean;
31
+ } | import("vft/es/utils").VNodeChildAtom)[] | null;
32
+ isTwoLengthShow: (index: number) => boolean;
33
+ ItemsSorter: import("vue").DefineComponent<{}, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
34
+ [key: string]: any;
35
+ }> | null, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
27
36
  throttledArrowClick: any;
28
37
  throttledIndicatorHover: any;
29
38
  };