vft 0.0.388 → 0.0.389
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/es/components/alert/alert.vue.d.ts +11 -1
- package/es/components/alert/alert.vue2.js +65 -13
- package/es/components/alert/index.d.ts +76 -28
- package/es/components/autocomplete/autocomplete.vue.d.ts +2 -2
- package/es/components/autocomplete/index.d.ts +6 -6
- package/es/components/carousel/index.d.ts +3 -3
- package/es/components/carousel/types.d.ts +1 -1
- package/es/components/carousel/use-carousel.d.ts +2 -2
- package/es/components/carousel/use-carousel.js +37 -37
- package/es/components/index.js +137 -138
- package/es/components/input-tag/input-tag.vue.d.ts +1 -1
- package/es/components/select/index.d.ts +5 -5
- package/es/components/select/select.vue.d.ts +5 -5
- package/es/components/select/useSelect.d.ts +4 -4
- package/es/components/super-form/component-map.d.ts +1 -34
- package/es/components/super-form/component-map.js +39 -43
- package/es/components/super-form/index.js +8 -9
- package/es/components/super-form/super-form-item.vue2.js +4 -3
- package/es/components/super-form/types.d.ts +1 -1
- package/es/components/super-form/use/helper.d.ts +1 -1
- package/es/components/super-form/use/helper.js +32 -31
- package/es/components/super-form/use/use-auto-focus.js +1 -1
- package/es/components/super-form/use/use-form-events.js +41 -40
- package/es/components/table/table.vue2.js +22 -22
- package/es/constants/index.js +10 -9
- package/es/constants/key.d.ts +34 -0
- package/es/constants/key.js +4 -2
- package/es/index.js +2 -2
- package/es/package.json.d.ts +1 -1
- package/es/package.json.js +1 -1
- package/lib/components/alert/alert.vue.d.ts +11 -1
- package/lib/components/alert/alert.vue2.cjs +1 -1
- package/lib/components/alert/index.d.ts +76 -28
- package/lib/components/autocomplete/autocomplete.vue.d.ts +2 -2
- package/lib/components/autocomplete/index.d.ts +6 -6
- package/lib/components/carousel/index.d.ts +3 -3
- package/lib/components/carousel/types.d.ts +1 -1
- package/lib/components/carousel/use-carousel.cjs +1 -1
- package/lib/components/carousel/use-carousel.d.ts +2 -2
- package/lib/components/index.cjs +1 -1
- package/lib/components/input-tag/input-tag.vue.d.ts +1 -1
- package/lib/components/select/index.d.ts +5 -5
- package/lib/components/select/select.vue.d.ts +5 -5
- package/lib/components/select/useSelect.d.ts +4 -4
- package/lib/components/super-form/component-map.cjs +1 -1
- package/lib/components/super-form/component-map.d.ts +1 -34
- package/lib/components/super-form/index.cjs +1 -1
- package/lib/components/super-form/super-form-item.vue2.cjs +1 -1
- package/lib/components/super-form/types.d.ts +1 -1
- package/lib/components/super-form/use/helper.cjs +1 -1
- package/lib/components/super-form/use/helper.d.ts +1 -1
- package/lib/components/super-form/use/use-auto-focus.cjs +1 -1
- package/lib/components/super-form/use/use-form-events.cjs +1 -1
- package/lib/components/table/table.vue2.cjs +1 -1
- package/lib/constants/index.cjs +1 -1
- package/lib/constants/key.cjs +1 -1
- package/lib/constants/key.d.ts +34 -0
- package/lib/index.cjs +1 -1
- package/lib/package.json.cjs +1 -1
- package/lib/package.json.d.ts +1 -1
- package/package.json +4 -4
- package/web-types.json +1 -1
|
@@ -27,11 +27,16 @@ export interface AlertProps {
|
|
|
27
27
|
center?: boolean;
|
|
28
28
|
effect?: alertEffects;
|
|
29
29
|
}
|
|
30
|
-
declare
|
|
30
|
+
declare function __VLS_template(): {
|
|
31
|
+
title?(_: {}): any;
|
|
32
|
+
default?(_: {}): any;
|
|
33
|
+
};
|
|
34
|
+
declare const __VLS_component: import("vue").DefineComponent<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<AlertProps>>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
31
35
|
close: (evt: MouseEvent) => void;
|
|
32
36
|
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<AlertProps>>> & Readonly<{
|
|
33
37
|
onClose?: ((evt: MouseEvent) => any) | undefined;
|
|
34
38
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
39
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
|
|
35
40
|
export default _default;
|
|
36
41
|
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
37
42
|
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
@@ -42,3 +47,8 @@ type __VLS_TypePropsToRuntimeProps<T> = {
|
|
|
42
47
|
required: true;
|
|
43
48
|
};
|
|
44
49
|
};
|
|
50
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
51
|
+
new (): {
|
|
52
|
+
$slots: S;
|
|
53
|
+
};
|
|
54
|
+
};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { VftIcon as
|
|
1
|
+
import { defineComponent as C, useSlots as g, ref as N, computed as c, createBlock as r, openBlock as s, Transition as S, unref as o, withCtx as V, withDirectives as $, createElementVNode as v, normalizeClass as l, createCommentVNode as i, createElementBlock as a, renderSlot as y, createTextVNode as k, toDisplayString as u, Fragment as E, vShow as I } from "vue";
|
|
2
|
+
import { VftIcon as b } from "../icon/index.js";
|
|
3
3
|
import "@vueuse/core";
|
|
4
4
|
import "@vft/utils";
|
|
5
5
|
import "../config-provider/hooks/use-global-config.js";
|
|
6
6
|
import "lodash-es";
|
|
7
|
-
import { useNamespace as
|
|
7
|
+
import { useNamespace as D } from "../../hooks/use-namespace/index.js";
|
|
8
8
|
import "../../hooks/use-model-toggle/index.js";
|
|
9
9
|
import "@popperjs/core";
|
|
10
10
|
import "../../hooks/use-z-index/index.js";
|
|
11
|
-
const
|
|
11
|
+
const z = C({
|
|
12
12
|
name: "vft-alert"
|
|
13
|
-
}),
|
|
14
|
-
...
|
|
13
|
+
}), P = /* @__PURE__ */ C({
|
|
14
|
+
...z,
|
|
15
15
|
props: {
|
|
16
16
|
title: { default: "" },
|
|
17
17
|
description: { default: "" },
|
|
@@ -23,16 +23,68 @@ const m = i({
|
|
|
23
23
|
effect: { default: "light" }
|
|
24
24
|
},
|
|
25
25
|
emits: {
|
|
26
|
-
close: (
|
|
26
|
+
close: (n) => n instanceof MouseEvent
|
|
27
27
|
},
|
|
28
|
-
setup(
|
|
29
|
-
const t =
|
|
30
|
-
return l(!0), o(() => e.type), o(() => [
|
|
28
|
+
setup(n, { emit: h }) {
|
|
29
|
+
const t = D("alert"), B = h, d = g(), m = N(!0), f = c(() => n.type), T = c(() => [
|
|
31
30
|
t.e("icon"),
|
|
32
|
-
{ [t.is("big")]: !!
|
|
33
|
-
]),
|
|
31
|
+
{ [t.is("big")]: !!n.description || !!d.default }
|
|
32
|
+
]), w = c(() => ({ [t.is("bold")]: n.description || d.default })), p = (e) => {
|
|
33
|
+
m.value = !1, B("close", e);
|
|
34
|
+
};
|
|
35
|
+
return (e, F) => (s(), r(S, {
|
|
36
|
+
name: o(t).b("fade")
|
|
37
|
+
}, {
|
|
38
|
+
default: V(() => [
|
|
39
|
+
$(v("div", {
|
|
40
|
+
class: l([o(t).b(), o(t).m(e.type), o(t).is("center", e.center), o(t).is(e.effect)]),
|
|
41
|
+
role: "alert"
|
|
42
|
+
}, [
|
|
43
|
+
e.showIcon && f.value ? (s(), r(o(b), {
|
|
44
|
+
key: 0,
|
|
45
|
+
class: l(T.value),
|
|
46
|
+
icon: f.value
|
|
47
|
+
}, null, 8, ["class", "icon"])) : i("", !0),
|
|
48
|
+
v("div", {
|
|
49
|
+
class: l(o(t).e("content"))
|
|
50
|
+
}, [
|
|
51
|
+
e.title || e.$slots.title ? (s(), a("span", {
|
|
52
|
+
key: 0,
|
|
53
|
+
class: l([o(t).e("title"), w.value])
|
|
54
|
+
}, [
|
|
55
|
+
y(e.$slots, "title", {}, () => [
|
|
56
|
+
k(u(e.title), 1)
|
|
57
|
+
])
|
|
58
|
+
], 2)) : i("", !0),
|
|
59
|
+
e.$slots.default || e.description ? (s(), a("p", {
|
|
60
|
+
key: 1,
|
|
61
|
+
class: l(o(t).e("description"))
|
|
62
|
+
}, [
|
|
63
|
+
y(e.$slots, "default", {}, () => [
|
|
64
|
+
k(u(e.description), 1)
|
|
65
|
+
])
|
|
66
|
+
], 2)) : i("", !0),
|
|
67
|
+
e.closable ? (s(), a(E, { key: 2 }, [
|
|
68
|
+
e.closeText ? (s(), a("div", {
|
|
69
|
+
key: 0,
|
|
70
|
+
class: l([o(t).e("close-btn"), o(t).is("customed")]),
|
|
71
|
+
onClick: p
|
|
72
|
+
}, u(e.closeText), 3)) : (s(), r(o(b), {
|
|
73
|
+
key: 1,
|
|
74
|
+
class: l(o(t).e("close-btn")),
|
|
75
|
+
onClick: p,
|
|
76
|
+
icon: "icon-close"
|
|
77
|
+
}, null, 8, ["class"]))
|
|
78
|
+
], 64)) : i("", !0)
|
|
79
|
+
], 2)
|
|
80
|
+
], 2), [
|
|
81
|
+
[I, m.value]
|
|
82
|
+
])
|
|
83
|
+
]),
|
|
84
|
+
_: 3
|
|
85
|
+
}, 8, ["name"]));
|
|
34
86
|
}
|
|
35
87
|
});
|
|
36
88
|
export {
|
|
37
|
-
|
|
89
|
+
P as default
|
|
38
90
|
};
|
|
@@ -1,5 +1,73 @@
|
|
|
1
1
|
export * from './types';
|
|
2
|
-
export declare const VftAlert: import("vft/es/utils").SFCWithInstall<
|
|
2
|
+
export declare const VftAlert: import("vft/es/utils").SFCWithInstall<{
|
|
3
|
+
new (...args: any[]): import("vue").CreateComponentPublicInstanceWithMixins<Readonly<import("vue").ExtractPropTypes<{
|
|
4
|
+
title: {
|
|
5
|
+
type: import("vue").PropType<string>;
|
|
6
|
+
};
|
|
7
|
+
description: {
|
|
8
|
+
type: import("vue").PropType<string>;
|
|
9
|
+
};
|
|
10
|
+
type: {
|
|
11
|
+
type: import("vue").PropType<import("./types").TypeComponents>;
|
|
12
|
+
};
|
|
13
|
+
closable: {
|
|
14
|
+
type: import("vue").PropType<boolean>;
|
|
15
|
+
};
|
|
16
|
+
closeText: {
|
|
17
|
+
type: import("vue").PropType<string>;
|
|
18
|
+
};
|
|
19
|
+
showIcon: {
|
|
20
|
+
type: import("vue").PropType<boolean>;
|
|
21
|
+
};
|
|
22
|
+
center: {
|
|
23
|
+
type: import("vue").PropType<boolean>;
|
|
24
|
+
};
|
|
25
|
+
effect: {
|
|
26
|
+
type: import("vue").PropType<import("./types").alertEffects>;
|
|
27
|
+
};
|
|
28
|
+
}>> & Readonly<{
|
|
29
|
+
onClose?: ((evt: MouseEvent) => any) | undefined;
|
|
30
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
31
|
+
close: (evt: MouseEvent) => void;
|
|
32
|
+
}, import("vue").PublicProps, {}, true, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
|
|
33
|
+
P: {};
|
|
34
|
+
B: {};
|
|
35
|
+
D: {};
|
|
36
|
+
C: {};
|
|
37
|
+
M: {};
|
|
38
|
+
Defaults: {};
|
|
39
|
+
}, Readonly<import("vue").ExtractPropTypes<{
|
|
40
|
+
title: {
|
|
41
|
+
type: import("vue").PropType<string>;
|
|
42
|
+
};
|
|
43
|
+
description: {
|
|
44
|
+
type: import("vue").PropType<string>;
|
|
45
|
+
};
|
|
46
|
+
type: {
|
|
47
|
+
type: import("vue").PropType<import("./types").TypeComponents>;
|
|
48
|
+
};
|
|
49
|
+
closable: {
|
|
50
|
+
type: import("vue").PropType<boolean>;
|
|
51
|
+
};
|
|
52
|
+
closeText: {
|
|
53
|
+
type: import("vue").PropType<string>;
|
|
54
|
+
};
|
|
55
|
+
showIcon: {
|
|
56
|
+
type: import("vue").PropType<boolean>;
|
|
57
|
+
};
|
|
58
|
+
center: {
|
|
59
|
+
type: import("vue").PropType<boolean>;
|
|
60
|
+
};
|
|
61
|
+
effect: {
|
|
62
|
+
type: import("vue").PropType<import("./types").alertEffects>;
|
|
63
|
+
};
|
|
64
|
+
}>> & Readonly<{
|
|
65
|
+
onClose?: ((evt: MouseEvent) => any) | undefined;
|
|
66
|
+
}>, {}, {}, {}, {}, {}>;
|
|
67
|
+
__isFragment?: never;
|
|
68
|
+
__isTeleport?: never;
|
|
69
|
+
__isSuspense?: never;
|
|
70
|
+
} & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
|
|
3
71
|
title: {
|
|
4
72
|
type: import("vue").PropType<string>;
|
|
5
73
|
};
|
|
@@ -24,34 +92,14 @@ export declare const VftAlert: import("vft/es/utils").SFCWithInstall<import("vue
|
|
|
24
92
|
effect: {
|
|
25
93
|
type: import("vue").PropType<import("./types").alertEffects>;
|
|
26
94
|
};
|
|
95
|
+
}>> & Readonly<{
|
|
96
|
+
onClose?: ((evt: MouseEvent) => any) | undefined;
|
|
27
97
|
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
28
98
|
close: (evt: MouseEvent) => void;
|
|
29
|
-
}, string, import("vue").
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
description: {
|
|
34
|
-
type: import("vue").PropType<string>;
|
|
99
|
+
}, string, {}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
|
|
100
|
+
$slots: {
|
|
101
|
+
title?(_: {}): any;
|
|
102
|
+
default?(_: {}): any;
|
|
35
103
|
};
|
|
36
|
-
|
|
37
|
-
type: import("vue").PropType<import("./types").TypeComponents>;
|
|
38
|
-
};
|
|
39
|
-
closable: {
|
|
40
|
-
type: import("vue").PropType<boolean>;
|
|
41
|
-
};
|
|
42
|
-
closeText: {
|
|
43
|
-
type: import("vue").PropType<string>;
|
|
44
|
-
};
|
|
45
|
-
showIcon: {
|
|
46
|
-
type: import("vue").PropType<boolean>;
|
|
47
|
-
};
|
|
48
|
-
center: {
|
|
49
|
-
type: import("vue").PropType<boolean>;
|
|
50
|
-
};
|
|
51
|
-
effect: {
|
|
52
|
-
type: import("vue").PropType<import("./types").alertEffects>;
|
|
53
|
-
};
|
|
54
|
-
}>> & Readonly<{
|
|
55
|
-
onClose?: ((evt: MouseEvent) => any) | undefined;
|
|
56
|
-
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>> & Record<string, any>;
|
|
104
|
+
})> & Record<string, any>;
|
|
57
105
|
export default VftAlert;
|
|
@@ -62,9 +62,9 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
|
|
|
62
62
|
readonly strategy?: "fixed" | "absolute" | undefined;
|
|
63
63
|
readonly effect?: "light" | "dark" | undefined;
|
|
64
64
|
readonly trigger?: import("vft/es/components/tooltip").TooltipTriggerType | undefined;
|
|
65
|
+
readonly visible?: boolean | undefined;
|
|
65
66
|
readonly teleported?: boolean | undefined;
|
|
66
67
|
readonly open?: boolean | undefined;
|
|
67
|
-
readonly visible?: boolean | undefined;
|
|
68
68
|
readonly arrowOffset?: number | undefined;
|
|
69
69
|
readonly gpuAcceleration?: boolean | undefined;
|
|
70
70
|
readonly fallbackPlacements?: import("@popperjs/core").Placement[] | undefined;
|
|
@@ -480,9 +480,9 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
|
|
|
480
480
|
readonly strategy?: "fixed" | "absolute" | undefined;
|
|
481
481
|
readonly effect?: "light" | "dark" | undefined;
|
|
482
482
|
readonly trigger?: import("vft/es/components/tooltip").TooltipTriggerType | undefined;
|
|
483
|
+
readonly visible?: boolean | undefined;
|
|
483
484
|
readonly teleported?: boolean | undefined;
|
|
484
485
|
readonly open?: boolean | undefined;
|
|
485
|
-
readonly visible?: boolean | undefined;
|
|
486
486
|
readonly arrowOffset?: number | undefined;
|
|
487
487
|
readonly gpuAcceleration?: boolean | undefined;
|
|
488
488
|
readonly fallbackPlacements?: import("@popperjs/core").Placement[] | undefined;
|
|
@@ -86,9 +86,9 @@ export declare const VftAutocomplete: import("vft/es/utils").SFCWithInstall<{
|
|
|
86
86
|
readonly strategy?: "fixed" | "absolute" | undefined;
|
|
87
87
|
readonly effect?: "light" | "dark" | undefined;
|
|
88
88
|
readonly trigger?: import("vft/es/vft").TooltipTriggerType | undefined;
|
|
89
|
+
readonly visible?: boolean | undefined;
|
|
89
90
|
readonly teleported?: boolean | undefined;
|
|
90
91
|
readonly open?: boolean | undefined;
|
|
91
|
-
readonly visible?: boolean | undefined;
|
|
92
92
|
readonly arrowOffset?: number | undefined;
|
|
93
93
|
readonly gpuAcceleration?: boolean | undefined;
|
|
94
94
|
readonly fallbackPlacements?: import("@popperjs/core").Placement[] | undefined;
|
|
@@ -504,9 +504,9 @@ export declare const VftAutocomplete: import("vft/es/utils").SFCWithInstall<{
|
|
|
504
504
|
readonly strategy?: "fixed" | "absolute" | undefined;
|
|
505
505
|
readonly effect?: "light" | "dark" | undefined;
|
|
506
506
|
readonly trigger?: import("vft/es/vft").TooltipTriggerType | undefined;
|
|
507
|
+
readonly visible?: boolean | undefined;
|
|
507
508
|
readonly teleported?: boolean | undefined;
|
|
508
509
|
readonly open?: boolean | undefined;
|
|
509
|
-
readonly visible?: boolean | undefined;
|
|
510
510
|
readonly arrowOffset?: number | undefined;
|
|
511
511
|
readonly gpuAcceleration?: boolean | undefined;
|
|
512
512
|
readonly fallbackPlacements?: import("@popperjs/core").Placement[] | undefined;
|
|
@@ -1007,9 +1007,9 @@ export declare const VftAutocomplete: import("vft/es/utils").SFCWithInstall<{
|
|
|
1007
1007
|
readonly strategy?: "fixed" | "absolute" | undefined;
|
|
1008
1008
|
readonly effect?: "light" | "dark" | undefined;
|
|
1009
1009
|
readonly trigger?: import("vft/es/vft").TooltipTriggerType | undefined;
|
|
1010
|
+
readonly visible?: boolean | undefined;
|
|
1010
1011
|
readonly teleported?: boolean | undefined;
|
|
1011
1012
|
readonly open?: boolean | undefined;
|
|
1012
|
-
readonly visible?: boolean | undefined;
|
|
1013
1013
|
readonly arrowOffset?: number | undefined;
|
|
1014
1014
|
readonly gpuAcceleration?: boolean | undefined;
|
|
1015
1015
|
readonly fallbackPlacements?: import("@popperjs/core").Placement[] | undefined;
|
|
@@ -1425,9 +1425,9 @@ export declare const VftAutocomplete: import("vft/es/utils").SFCWithInstall<{
|
|
|
1425
1425
|
readonly strategy?: "fixed" | "absolute" | undefined;
|
|
1426
1426
|
readonly effect?: "light" | "dark" | undefined;
|
|
1427
1427
|
readonly trigger?: import("vft/es/vft").TooltipTriggerType | undefined;
|
|
1428
|
+
readonly visible?: boolean | undefined;
|
|
1428
1429
|
readonly teleported?: boolean | undefined;
|
|
1429
1430
|
readonly open?: boolean | undefined;
|
|
1430
|
-
readonly visible?: boolean | undefined;
|
|
1431
1431
|
readonly arrowOffset?: number | undefined;
|
|
1432
1432
|
readonly gpuAcceleration?: boolean | undefined;
|
|
1433
1433
|
readonly fallbackPlacements?: import("@popperjs/core").Placement[] | undefined;
|
|
@@ -1917,9 +1917,9 @@ export declare const VftAutocomplete: import("vft/es/utils").SFCWithInstall<{
|
|
|
1917
1917
|
readonly strategy?: "fixed" | "absolute" | undefined;
|
|
1918
1918
|
readonly effect?: "light" | "dark" | undefined;
|
|
1919
1919
|
readonly trigger?: import("vft/es/vft").TooltipTriggerType | undefined;
|
|
1920
|
+
readonly visible?: boolean | undefined;
|
|
1920
1921
|
readonly teleported?: boolean | undefined;
|
|
1921
1922
|
readonly open?: boolean | undefined;
|
|
1922
|
-
readonly visible?: boolean | undefined;
|
|
1923
1923
|
readonly arrowOffset?: number | undefined;
|
|
1924
1924
|
readonly gpuAcceleration?: boolean | undefined;
|
|
1925
1925
|
readonly fallbackPlacements?: import("@popperjs/core").Placement[] | undefined;
|
|
@@ -2335,9 +2335,9 @@ export declare const VftAutocomplete: import("vft/es/utils").SFCWithInstall<{
|
|
|
2335
2335
|
readonly strategy?: "fixed" | "absolute" | undefined;
|
|
2336
2336
|
readonly effect?: "light" | "dark" | undefined;
|
|
2337
2337
|
readonly trigger?: import("vft/es/vft").TooltipTriggerType | undefined;
|
|
2338
|
+
readonly visible?: boolean | undefined;
|
|
2338
2339
|
readonly teleported?: boolean | undefined;
|
|
2339
2340
|
readonly open?: boolean | undefined;
|
|
2340
|
-
readonly visible?: boolean | undefined;
|
|
2341
2341
|
readonly arrowOffset?: number | undefined;
|
|
2342
2342
|
readonly gpuAcceleration?: boolean | undefined;
|
|
2343
2343
|
readonly fallbackPlacements?: import("@popperjs/core").Placement[] | undefined;
|
|
@@ -4,7 +4,7 @@ export declare const VftCarousel: import("vft/es/utils").SFCWithInstall<{
|
|
|
4
4
|
type: import("vue").PropType<string | number>;
|
|
5
5
|
};
|
|
6
6
|
height: {
|
|
7
|
-
type: import("vue").PropType<string>;
|
|
7
|
+
type: import("vue").PropType<string | number>;
|
|
8
8
|
};
|
|
9
9
|
trigger: {
|
|
10
10
|
type: import("vue").PropType<"click" | "hover">;
|
|
@@ -60,7 +60,7 @@ export declare const VftCarousel: import("vft/es/utils").SFCWithInstall<{
|
|
|
60
60
|
type: import("vue").PropType<string | number>;
|
|
61
61
|
};
|
|
62
62
|
height: {
|
|
63
|
-
type: import("vue").PropType<string>;
|
|
63
|
+
type: import("vue").PropType<string | number>;
|
|
64
64
|
};
|
|
65
65
|
trigger: {
|
|
66
66
|
type: import("vue").PropType<"click" | "hover">;
|
|
@@ -111,7 +111,7 @@ export declare const VftCarousel: import("vft/es/utils").SFCWithInstall<{
|
|
|
111
111
|
type: import("vue").PropType<string | number>;
|
|
112
112
|
};
|
|
113
113
|
height: {
|
|
114
|
-
type: import("vue").PropType<string>;
|
|
114
|
+
type: import("vue").PropType<string | number>;
|
|
115
115
|
};
|
|
116
116
|
trigger: {
|
|
117
117
|
type: import("vue").PropType<"click" | "hover">;
|
|
@@ -10,10 +10,10 @@ export declare const useCarousel: (props: CarouselProps, emit: any, componentNam
|
|
|
10
10
|
items: import("vue").ShallowRef<CarouselItemContext[], CarouselItemContext[]>;
|
|
11
11
|
isVertical: import("vue").ComputedRef<boolean>;
|
|
12
12
|
containerStyle: import("vue").ComputedRef<{
|
|
13
|
-
height: string | undefined;
|
|
13
|
+
height: string | number | undefined;
|
|
14
14
|
overflow?: undefined;
|
|
15
15
|
} | {
|
|
16
|
-
height: string;
|
|
16
|
+
height: string | undefined;
|
|
17
17
|
overflow: string;
|
|
18
18
|
}>;
|
|
19
19
|
isItemsTwoLength: import("vue").Ref<boolean, boolean>;
|
|
@@ -1,42 +1,42 @@
|
|
|
1
1
|
import { getCurrentInstance as ae, useSlots as oe, ref as u, computed as f, unref as g, watch as m, shallowRef as re, onMounted as ie, onBeforeUnmount as ue, provide as se, isVNode as ce } from "vue";
|
|
2
2
|
import { throttle as N } from "lodash-es";
|
|
3
3
|
import { useResizeObserver as ve } from "@vueuse/core";
|
|
4
|
-
import {
|
|
5
|
-
import { debugWarn as
|
|
4
|
+
import { addUnit as fe, isString as me } from "@vft/utils";
|
|
5
|
+
import { debugWarn as he } from "../../utils/error.js";
|
|
6
6
|
import "../config-provider/hooks/use-global-config.js";
|
|
7
|
-
import { CHANGE_EVENT as
|
|
8
|
-
import { flattedChildren as
|
|
7
|
+
import { CHANGE_EVENT as de } from "../../constants/event.js";
|
|
8
|
+
import { flattedChildren as Ie } from "../../utils/vue/vnode.js";
|
|
9
9
|
import "../../hooks/use-model-toggle/index.js";
|
|
10
|
-
import { useOrderedChildren as
|
|
10
|
+
import { useOrderedChildren as ge } from "../../hooks/use-ordered-children/index.js";
|
|
11
11
|
import "@popperjs/core";
|
|
12
12
|
import "../../hooks/use-z-index/index.js";
|
|
13
|
-
import { CAROUSEL_ITEM_NAME as H, carouselContextKey as
|
|
14
|
-
const L = 300,
|
|
13
|
+
import { CAROUSEL_ITEM_NAME as H, carouselContextKey as Se } from "./constants.js";
|
|
14
|
+
const L = 300, Re = (t, O, M) => {
|
|
15
15
|
const {
|
|
16
16
|
children: o,
|
|
17
17
|
addChild: _,
|
|
18
18
|
removeChild: R,
|
|
19
19
|
ChildrenSorter: z
|
|
20
|
-
} =
|
|
20
|
+
} = ge(
|
|
21
21
|
ae(),
|
|
22
22
|
H
|
|
23
23
|
), B = oe(), l = u(-1), s = u(null), S = u(!1), h = u(), w = u(0), c = u(!0), P = f(
|
|
24
24
|
() => t.arrow !== "never" && !g(v)
|
|
25
|
-
),
|
|
25
|
+
), U = f(() => o.value.some(
|
|
26
26
|
(e) => e.props.label && e.props.label?.toString().length > 0
|
|
27
|
-
)), C = f(() => t.type === "card"), v = f(() => t.direction === "vertical"),
|
|
27
|
+
)), C = f(() => t.type === "card"), v = f(() => t.direction === "vertical"), V = f(() => t.height !== "auto" ? {
|
|
28
28
|
height: t.height
|
|
29
29
|
} : {
|
|
30
|
-
height:
|
|
30
|
+
height: fe(w.value),
|
|
31
31
|
overflow: "hidden"
|
|
32
|
-
}),
|
|
32
|
+
}), k = N(
|
|
33
33
|
(e) => {
|
|
34
34
|
i(e);
|
|
35
35
|
},
|
|
36
36
|
L,
|
|
37
37
|
{ trailing: !0 }
|
|
38
38
|
), D = N((e) => {
|
|
39
|
-
|
|
39
|
+
X(e);
|
|
40
40
|
}, L), F = (e) => c.value ? l.value <= 1 ? e <= 1 : e > 1 : !0;
|
|
41
41
|
function d() {
|
|
42
42
|
s.value && (clearInterval(s.value), s.value = null);
|
|
@@ -48,14 +48,14 @@ const L = 300, _e = (t, O, M) => {
|
|
|
48
48
|
l.value < o.value.length - 1 ? l.value = l.value + 1 : t.loop && (l.value = 0);
|
|
49
49
|
};
|
|
50
50
|
function i(e) {
|
|
51
|
-
if (
|
|
51
|
+
if (me(e)) {
|
|
52
52
|
const r = o.value.filter(
|
|
53
53
|
(b) => b.props.name === e
|
|
54
54
|
);
|
|
55
55
|
r.length > 0 && (e = o.value.indexOf(r[0]));
|
|
56
56
|
}
|
|
57
57
|
if (e = Number(e), Number.isNaN(e) || e !== Math.floor(e)) {
|
|
58
|
-
|
|
58
|
+
he(M, "index must be integer.");
|
|
59
59
|
return;
|
|
60
60
|
}
|
|
61
61
|
const n = o.value.length, a = l.value;
|
|
@@ -75,47 +75,47 @@ const L = 300, _e = (t, O, M) => {
|
|
|
75
75
|
function W() {
|
|
76
76
|
S.value = !0, t.pauseOnHover && d();
|
|
77
77
|
}
|
|
78
|
-
function
|
|
78
|
+
function j() {
|
|
79
79
|
S.value = !1, I();
|
|
80
80
|
}
|
|
81
|
-
function
|
|
81
|
+
function q(e) {
|
|
82
82
|
g(v) || o.value.forEach((n, a) => {
|
|
83
83
|
e === K(n, a) && (n.states.hover = !0);
|
|
84
84
|
});
|
|
85
85
|
}
|
|
86
|
-
function
|
|
86
|
+
function J() {
|
|
87
87
|
g(v) || o.value.forEach((e) => {
|
|
88
88
|
e.states.hover = !1;
|
|
89
89
|
});
|
|
90
90
|
}
|
|
91
|
-
function
|
|
91
|
+
function Q(e) {
|
|
92
92
|
l.value = e;
|
|
93
93
|
}
|
|
94
|
-
function
|
|
94
|
+
function X(e) {
|
|
95
95
|
t.trigger === "hover" && e !== l.value && (l.value = e);
|
|
96
96
|
}
|
|
97
|
-
function
|
|
97
|
+
function Y() {
|
|
98
98
|
i(l.value - 1);
|
|
99
99
|
}
|
|
100
|
-
function
|
|
100
|
+
function Z() {
|
|
101
101
|
i(l.value + 1);
|
|
102
102
|
}
|
|
103
103
|
function y() {
|
|
104
104
|
d(), t.pauseOnHover || I();
|
|
105
105
|
}
|
|
106
|
-
function
|
|
106
|
+
function $(e) {
|
|
107
107
|
t.height === "auto" && (w.value = e);
|
|
108
108
|
}
|
|
109
109
|
function x() {
|
|
110
110
|
const e = B.default?.();
|
|
111
111
|
if (!e) return null;
|
|
112
|
-
const a =
|
|
112
|
+
const a = Ie(e).filter((r) => ce(r) && r.type.name === H);
|
|
113
113
|
return a?.length === 2 && t.loop && !C.value ? (c.value = !0, a) : (c.value = !1, null);
|
|
114
114
|
}
|
|
115
115
|
m(
|
|
116
116
|
() => l.value,
|
|
117
117
|
(e, n) => {
|
|
118
|
-
E(n), c.value && (e = e % 2, n = n % 2), n > -1 && O(
|
|
118
|
+
E(n), c.value && (e = e % 2, n = n % 2), n > -1 && O(de, e, n);
|
|
119
119
|
}
|
|
120
120
|
), m(
|
|
121
121
|
() => t.autoplay,
|
|
@@ -148,7 +148,7 @@ const L = 300, _e = (t, O, M) => {
|
|
|
148
148
|
}), I();
|
|
149
149
|
}), ue(() => {
|
|
150
150
|
d(), h.value && T.value && T.value.stop();
|
|
151
|
-
}), se(
|
|
151
|
+
}), se(Se, {
|
|
152
152
|
root: h,
|
|
153
153
|
isCardType: C,
|
|
154
154
|
isVertical: v,
|
|
@@ -158,33 +158,33 @@ const L = 300, _e = (t, O, M) => {
|
|
|
158
158
|
addItem: _,
|
|
159
159
|
removeItem: R,
|
|
160
160
|
setActiveItem: i,
|
|
161
|
-
setContainerHeight:
|
|
161
|
+
setContainerHeight: $
|
|
162
162
|
}), {
|
|
163
163
|
root: h,
|
|
164
164
|
activeIndex: l,
|
|
165
165
|
arrowDisplay: P,
|
|
166
|
-
hasLabel:
|
|
166
|
+
hasLabel: U,
|
|
167
167
|
hover: S,
|
|
168
168
|
isCardType: C,
|
|
169
169
|
items: o,
|
|
170
170
|
isVertical: v,
|
|
171
|
-
containerStyle:
|
|
171
|
+
containerStyle: V,
|
|
172
172
|
isItemsTwoLength: c,
|
|
173
|
-
handleButtonEnter:
|
|
174
|
-
handleButtonLeave:
|
|
175
|
-
handleIndicatorClick:
|
|
173
|
+
handleButtonEnter: q,
|
|
174
|
+
handleButtonLeave: J,
|
|
175
|
+
handleIndicatorClick: Q,
|
|
176
176
|
handleMouseEnter: W,
|
|
177
|
-
handleMouseLeave:
|
|
177
|
+
handleMouseLeave: j,
|
|
178
178
|
setActiveItem: i,
|
|
179
|
-
prev:
|
|
180
|
-
next:
|
|
179
|
+
prev: Y,
|
|
180
|
+
next: Z,
|
|
181
181
|
PlaceholderItem: x,
|
|
182
182
|
isTwoLengthShow: F,
|
|
183
183
|
ItemsSorter: z,
|
|
184
|
-
throttledArrowClick:
|
|
184
|
+
throttledArrowClick: k,
|
|
185
185
|
throttledIndicatorHover: D
|
|
186
186
|
};
|
|
187
187
|
};
|
|
188
188
|
export {
|
|
189
|
-
|
|
189
|
+
Re as useCarousel
|
|
190
190
|
};
|