@bridge-ui/vue 0.11.0 → 0.13.0
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/ai/skills/bridge-ui-components/SKILL.md +2 -1
- package/dist/Adapters/Examples/date-moment.js +31 -31
- package/dist/Adapters/Examples/i18n-dictionary.js +14 -0
- package/dist/Adapters/Examples/icon-fontawesome.js +53 -40
- package/dist/Adapters/Examples/icon-heroicons.js +46 -33
- package/dist/Adapters/Examples/icon-lucide.js +47 -34
- package/dist/Adapters/Examples/icon-phosphor.js +48 -35
- package/dist/Adapters/Examples/icon-tabler.js +45 -32
- package/dist/Adapters/Examples/rich-text-tiptap.d.ts +5 -0
- package/dist/Adapters/Examples/rich-text-tiptap.js +138 -0
- package/dist/Adapters/RichText/index.d.ts +1 -0
- package/dist/Adapters/RichText/index.js +2 -0
- package/dist/Adapters/RichText/mockRichTextAdapter.d.ts +5 -0
- package/dist/Adapters/RichText/useRichTextAdapter.d.ts +12 -0
- package/dist/Adapters/RichText/useRichTextAdapter.js +13 -0
- package/dist/Adapters/index.d.ts +1 -0
- package/dist/Adapters/index.js +2 -1
- package/dist/Components/ActionFooter/composables/useActionFooter.d.ts +6 -6
- package/dist/Components/Autocomplete/composables/useAutocomplete.js +2 -2
- package/dist/Components/BaseField/composables/useBaseField.d.ts +3 -3
- package/dist/Components/BaseField/composables/useBaseField.js +7 -7
- package/dist/Components/Breadcrumb/Breadcrumb.vue.d.ts +17 -10
- package/dist/Components/Breadcrumb/Breadcrumb.vue_vue_type_script_setup_true_lang.js +7 -2
- package/dist/Components/Breadcrumb/breadcrumb.types.d.ts +22 -4
- package/dist/Components/Breadcrumb/breadcrumbInjectionKey.d.ts +5 -1
- package/dist/Components/Breadcrumb/composables/useBreadcrumb.d.ts +6 -5
- package/dist/Components/Breadcrumb/composables/useBreadcrumb.js +2 -0
- package/dist/Components/BreadcrumbItem/BreadcrumbItem.vue.d.ts +17 -11
- package/dist/Components/BreadcrumbItem/BreadcrumbItem.vue_vue_type_script_setup_true_lang.js +2 -0
- package/dist/Components/BreadcrumbItem/breadcrumbItem.types.d.ts +21 -3
- package/dist/Components/BreadcrumbItem/composables/useBreadcrumbItem.d.ts +10 -6
- package/dist/Components/BreadcrumbItem/composables/useBreadcrumbItem.js +65 -59
- package/dist/Components/Button/Button.vue.d.ts +17 -8
- package/dist/Components/Button/Button.vue_vue_type_script_setup_true_lang.js +10 -10
- package/dist/Components/Button/button.types.d.ts +22 -5
- package/dist/Components/Button/composables/useButton.d.ts +198 -8
- package/dist/Components/Button/composables/useButton.js +101 -86
- package/dist/Components/Calendar/Calendar.vue_vue_type_script_setup_true_lang.js +8 -8
- package/dist/Components/Carousel/Carousel.js +5 -0
- package/dist/Components/Carousel/Carousel.vue.d.ts +22 -0
- package/dist/Components/Carousel/Carousel.vue_vue_type_script_setup_true_lang.js +49 -0
- package/dist/Components/Carousel/carousel.types.d.ts +236 -0
- package/dist/Components/Carousel/carouselInjectionKey.d.ts +48 -0
- package/dist/Components/Carousel/carouselInjectionKey.js +4 -0
- package/dist/Components/Carousel/composables/useCarousel.d.ts +91 -0
- package/dist/Components/Carousel/composables/useCarousel.js +331 -0
- package/dist/Components/Carousel/index.d.ts +4 -0
- package/dist/Components/Carousel/index.js +4 -0
- package/dist/Components/CarouselSlide/CarouselSlide.js +5 -0
- package/dist/Components/CarouselSlide/CarouselSlide.vue.d.ts +11 -0
- package/dist/Components/CarouselSlide/CarouselSlide.vue_vue_type_script_setup_true_lang.js +17 -0
- package/dist/Components/CarouselSlide/carouselSlide.types.d.ts +40 -0
- package/dist/Components/CarouselSlide/composables/useCarouselSlide.d.ts +205 -0
- package/dist/Components/CarouselSlide/composables/useCarouselSlide.js +79 -0
- package/dist/Components/CarouselSlide/index.d.ts +3 -0
- package/dist/Components/CarouselSlide/index.js +3 -0
- package/dist/Components/ColorPicker/composables/useColorPicker.js +1 -1
- package/dist/Components/DataTable/DataTable.vue.d.ts +1 -1
- package/dist/Components/DataTable/composables/useDataTable.d.ts +1 -1
- package/dist/Components/DataTable/composables/useDataTable.js +288 -282
- package/dist/Components/Drawer/composables/useDrawer.d.ts +1 -1
- package/dist/Components/Drawer/composables/useDrawer.js +2 -2
- package/dist/Components/FileUpload/FileUpload.js +5 -0
- package/dist/Components/FileUpload/FileUpload.vue.d.ts +26 -0
- package/dist/Components/FileUpload/FileUpload.vue_vue_type_script_setup_true_lang.js +141 -0
- package/dist/Components/FileUpload/composables/useFileUpload.d.ts +120 -0
- package/dist/Components/FileUpload/composables/useFileUpload.js +235 -0
- package/dist/Components/FileUpload/fileUpload.types.d.ts +396 -0
- package/dist/Components/FileUpload/fileUploadInjectionKey.d.ts +61 -0
- package/dist/Components/FileUpload/fileUploadInjectionKey.js +4 -0
- package/dist/Components/FileUpload/index.d.ts +3 -0
- package/dist/Components/FileUpload/index.js +3 -0
- package/dist/Components/FileUploadItem/FileUploadItem.js +5 -0
- package/dist/Components/FileUploadItem/FileUploadItem.vue.d.ts +12 -0
- package/dist/Components/FileUploadItem/FileUploadItem.vue_vue_type_script_setup_true_lang.js +83 -0
- package/dist/Components/FileUploadItem/composables/useFileUploadItem.d.ts +1153 -0
- package/dist/Components/FileUploadItem/composables/useFileUploadItem.js +94 -0
- package/dist/Components/FileUploadItem/fileUploadItem.types.d.ts +20 -0
- package/dist/Components/FileUploadItem/index.d.ts +3 -0
- package/dist/Components/FileUploadItem/index.js +3 -0
- package/dist/Components/FormField/composables/useFormField.d.ts +1 -1
- package/dist/Components/Link/Link.vue.d.ts +17 -8
- package/dist/Components/Link/Link.vue_vue_type_script_setup_true_lang.js +30 -25
- package/dist/Components/Link/composables/useLink.d.ts +8 -6
- package/dist/Components/Link/composables/useLink.js +52 -45
- package/dist/Components/Link/link.types.d.ts +21 -4
- package/dist/Components/ListItem/ListItem.vue.d.ts +17 -15
- package/dist/Components/ListItem/ListItem.vue_vue_type_script_setup_true_lang.js +2 -0
- package/dist/Components/ListItem/composables/useListItem.d.ts +7 -6
- package/dist/Components/ListItem/composables/useListItem.js +108 -105
- package/dist/Components/ListItem/listItem.types.d.ts +19 -3
- package/dist/Components/Listbox/composables/useListbox.d.ts +2 -2
- package/dist/Components/Menu/composables/useMenu.js +6 -6
- package/dist/Components/Modal/composables/useModal.d.ts +1 -1
- package/dist/Components/Modal/composables/useModal.js +2 -2
- package/dist/Components/Pagination/composables/usePagination.d.ts +1 -1
- package/dist/Components/RichTextEditor/RichTextEditor.js +5 -0
- package/dist/Components/RichTextEditor/RichTextEditor.vue.d.ts +23 -0
- package/dist/Components/RichTextEditor/RichTextEditor.vue_vue_type_script_setup_true_lang.js +104 -0
- package/dist/Components/RichTextEditor/composables/useRichTextEditor.d.ts +488 -0
- package/dist/Components/RichTextEditor/composables/useRichTextEditor.js +226 -0
- package/dist/Components/RichTextEditor/index.d.ts +3 -0
- package/dist/Components/RichTextEditor/index.js +3 -0
- package/dist/Components/RichTextEditor/richTextEditor.types.d.ts +103 -0
- package/dist/Components/Select/composables/useSelect.js +2 -2
- package/dist/Components/Sidebar/SidebarListItem.vue.d.ts +17 -9
- package/dist/Components/Sidebar/SidebarListItem.vue_vue_type_script_setup_true_lang.js +2 -0
- package/dist/Components/Sidebar/composables/useSidebarListItem.js +1 -1
- package/dist/Components/Sidebar/composables/useSidebarTrigger.d.ts +1 -1
- package/dist/Components/Sidebar/sidebar.types.d.ts +2 -1
- package/dist/Components/Snackbar/composables/useSnackbar.js +1 -1
- package/dist/Components/Textarea/composables/useTextarea.js +1 -1
- package/dist/Components/Tooltip/composables/useTooltip.js +3 -3
- package/dist/Utils/linkAs.d.ts +29 -0
- package/dist/Utils/linkAs.js +18 -0
- package/dist/augments.d.ts +19 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +181 -170
- package/dist/theme.css +3 -0
- package/docs/README.md +4 -0
- package/docs/components/Breadcrumb.md +16 -0
- package/docs/components/BridgeUIProvider.md +18 -1
- package/docs/components/Button.md +31 -19
- package/docs/components/Carousel.md +113 -0
- package/docs/components/DataTable.md +1 -1
- package/docs/components/FileUpload.md +197 -0
- package/docs/components/Link.md +28 -12
- package/docs/components/List.md +21 -19
- package/docs/components/RichTextEditor.md +88 -0
- package/docs/components/Sidebar.md +1 -1
- package/package.json +54 -18
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { mergePartBind as e, useBridgeUIComponent as t, useBridgeUIMergedRegistryClasses as n } from "../../../Utils/index.js";
|
|
2
2
|
import { BUTTON_GROUP_INJECTION_KEY as r } from "../../ButtonGroup/buttonGroupInjectionKey.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
3
|
+
import { resolveLinkAsProps as i } from "../../../Utils/linkAs.js";
|
|
4
|
+
import { computed as a, inject as o, useAttrs as s } from "vue";
|
|
5
|
+
import { get as c, includes as l, isNil as u } from "es-toolkit/compat";
|
|
6
|
+
import { buttonDensityProps as d, buttonRoundedProps as f, buttonVariantProps as p } from "@bridge-ui/core/Tokens";
|
|
7
|
+
import { cn as m, mergeBridgeUILayeredClasses as h, splitComponentProps as g } from "@bridge-ui/core/Utils";
|
|
7
8
|
//#region src/Components/Button/composables/useButton.ts
|
|
8
|
-
var
|
|
9
|
+
var _ = [
|
|
9
10
|
"as",
|
|
10
11
|
"full",
|
|
11
12
|
"href",
|
|
@@ -13,6 +14,7 @@ var g = [
|
|
|
13
14
|
"size",
|
|
14
15
|
"text",
|
|
15
16
|
"color",
|
|
17
|
+
"linkAs",
|
|
16
18
|
"classes",
|
|
17
19
|
"density",
|
|
18
20
|
"endIcon",
|
|
@@ -21,18 +23,19 @@ var g = [
|
|
|
21
23
|
"variant",
|
|
22
24
|
"disabled",
|
|
23
25
|
"selected",
|
|
26
|
+
"linkProps",
|
|
24
27
|
"startIcon",
|
|
25
28
|
"customProps"
|
|
26
29
|
];
|
|
27
|
-
function
|
|
28
|
-
let
|
|
29
|
-
bridgeKeys:
|
|
30
|
+
function v(v, y) {
|
|
31
|
+
let b = s(), x = o(r, null), S = a(() => g({
|
|
32
|
+
bridgeKeys: _,
|
|
30
33
|
props: {
|
|
31
|
-
...
|
|
32
|
-
...
|
|
34
|
+
...b,
|
|
35
|
+
...v
|
|
33
36
|
}
|
|
34
|
-
})),
|
|
35
|
-
let e =
|
|
37
|
+
})), C = a(() => {
|
|
38
|
+
let e = S.value.componentProps, t = x?.value;
|
|
36
39
|
return {
|
|
37
40
|
...e,
|
|
38
41
|
size: e.size ?? t?.size,
|
|
@@ -41,93 +44,105 @@ function _(_, v) {
|
|
|
41
44
|
rounded: e.rounded ?? t?.rounded,
|
|
42
45
|
variant: e.variant ?? t?.variant
|
|
43
46
|
};
|
|
44
|
-
}), { merged:
|
|
45
|
-
libDefaults:
|
|
47
|
+
}), { merged: w, entry: T } = t({
|
|
48
|
+
libDefaults: y,
|
|
46
49
|
componentName: "Button",
|
|
47
|
-
props: () =>
|
|
48
|
-
}),
|
|
49
|
-
entry:
|
|
50
|
-
props: () =>
|
|
51
|
-
}),
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
50
|
+
props: () => C.value
|
|
51
|
+
}), E = a(() => w.value.customProps), D = n({
|
|
52
|
+
entry: T,
|
|
53
|
+
props: () => S.value.componentProps
|
|
54
|
+
}), O = a(() => {
|
|
55
|
+
let e = S.value.componentProps.as, t = w.value.linkAs, n = !!(w.value.disabled || w.value.loading);
|
|
56
|
+
return e === "button" || e === "span" ? e : e === "a" || e == null && (w.value.as === "a" || t && w.value.href) ? n || t == null ? "a" : t : w.value.as ?? "button";
|
|
57
|
+
}), k = a(() => O.value !== "button" && O.value !== "span"), A = a(() => O.value === "button"), j = a(() => w.value.density === "mini"), M = a(() => w.value.disabled || w.value.loading), N = a(() => A.value ? M.value : void 0), P = a(() => w.value.loading ? !0 : void 0), F = a(() => M.value && !A.value ? !0 : void 0), I = a(() => {
|
|
58
|
+
if (k.value && !M.value && w.value.href) return w.value.href;
|
|
59
|
+
}), L = a(() => {
|
|
60
|
+
if (!A.value) return;
|
|
61
|
+
let e = c(S.value.inheritedAttrs, "type");
|
|
62
|
+
return l([
|
|
57
63
|
"submit",
|
|
58
64
|
"reset",
|
|
59
65
|
"button"
|
|
60
66
|
], e) ? e : "button";
|
|
61
|
-
}),
|
|
62
|
-
let e =
|
|
63
|
-
return
|
|
64
|
-
}),
|
|
65
|
-
let e =
|
|
66
|
-
return
|
|
67
|
-
}),
|
|
68
|
-
let e =
|
|
69
|
-
return
|
|
70
|
-
}),
|
|
67
|
+
}), R = a(() => {
|
|
68
|
+
let e = h(d, T.value?.tokens?.density);
|
|
69
|
+
return c(e, [w.value.density, w.value.size]);
|
|
70
|
+
}), z = a(() => u(C.value.variant) ? u(x) && j.value ? "flat" : w.value.variant : C.value.variant), B = a(() => {
|
|
71
|
+
let e = h(p, T.value?.tokens?.variant);
|
|
72
|
+
return c(e, [z.value, w.value.color]);
|
|
73
|
+
}), V = a(() => {
|
|
74
|
+
let e = h(f, T.value?.tokens?.rounded);
|
|
75
|
+
return c(e, w.value.rounded);
|
|
76
|
+
}), H = a(() => e(E.value?.icon, {}, m({
|
|
71
77
|
"shrink-0": !0,
|
|
72
|
-
[
|
|
73
|
-
}))),
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
"
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
78
|
+
[D.value.icon ?? ""]: !0
|
|
79
|
+
}))), U = a(() => {
|
|
80
|
+
let t = e(E.value?.root, {
|
|
81
|
+
...S.value.inheritedAttrs,
|
|
82
|
+
...i(w.value.linkAs, w.value.linkProps, O.value)
|
|
83
|
+
}, {
|
|
84
|
+
"aria-pressed": u(w.value.selected) ? void 0 : w.value.selected,
|
|
85
|
+
class: m({
|
|
86
|
+
"inline-flex items-center justify-center": !0,
|
|
87
|
+
"cursor-pointer outline-none outline-hidden": !0,
|
|
88
|
+
"shrink-0": j.value,
|
|
89
|
+
[R.value ?? ""]: !0,
|
|
90
|
+
[V.value ?? ""]: !0,
|
|
91
|
+
"h-auto": j.value && !u(x) && x.value?.density !== "mini",
|
|
92
|
+
"border border-transparent": !u(x) && z.value !== "outline",
|
|
93
|
+
"w-full": !j.value && w.value.full,
|
|
94
|
+
"w-fit": !j.value && !w.value.full,
|
|
95
|
+
"group hover:shadow-xs": !j.value,
|
|
96
|
+
[c(B.value, "base") ?? ""]: !0,
|
|
97
|
+
[c(B.value, "hover") ?? ""]: !0,
|
|
98
|
+
[c(B.value, "focus") ?? ""]: !0,
|
|
99
|
+
[c(B.value, "selected") ?? ""]: w.value.selected === !0,
|
|
100
|
+
relative: !0,
|
|
101
|
+
"z-10": w.value.selected === !0,
|
|
102
|
+
"transition-all ease-in-out duration-200": !0,
|
|
103
|
+
"focus:ring-2": !0,
|
|
104
|
+
"focus:ring-offset-background-white dark:focus:ring-offset-background-dark": !0,
|
|
105
|
+
"disabled:opacity-80 disabled:cursor-not-allowed": !0,
|
|
106
|
+
"aria-disabled:opacity-80 aria-disabled:cursor-not-allowed aria-disabled:pointer-events-none": !0,
|
|
107
|
+
[D.value.root ?? ""]: !0
|
|
108
|
+
})
|
|
109
|
+
});
|
|
110
|
+
return L.value == null ? t : {
|
|
111
|
+
...t,
|
|
112
|
+
type: L.value
|
|
113
|
+
};
|
|
114
|
+
}), W = a(() => e(E.value?.endIcon, {}, m({
|
|
100
115
|
"shrink-0": !0,
|
|
101
|
-
[
|
|
102
|
-
}))),
|
|
116
|
+
[D.value.endIcon ?? ""]: !0
|
|
117
|
+
}))), G = a(() => e(E.value?.end, {}, "inline-flex shrink-0 items-center")), K = a(() => e(E.value?.startIcon, {}, m({
|
|
103
118
|
"shrink-0": !0,
|
|
104
|
-
[
|
|
105
|
-
}))),
|
|
119
|
+
[D.value.startIcon ?? ""]: !0
|
|
120
|
+
}))), q = a(() => e(E.value?.start, {}, "inline-flex shrink-0 items-center")), J = a(() => e({}, {}, "pointer-events-none absolute inset-0 flex items-center justify-center"));
|
|
106
121
|
return {
|
|
107
|
-
tag:
|
|
108
|
-
merged:
|
|
109
|
-
isMini:
|
|
110
|
-
iconBind:
|
|
111
|
-
rootBind:
|
|
112
|
-
rootHref:
|
|
113
|
-
rootType:
|
|
114
|
-
endIconBind:
|
|
115
|
-
contentBind:
|
|
122
|
+
tag: O,
|
|
123
|
+
merged: w,
|
|
124
|
+
isMini: j,
|
|
125
|
+
iconBind: H,
|
|
126
|
+
rootBind: U,
|
|
127
|
+
rootHref: I,
|
|
128
|
+
rootType: L,
|
|
129
|
+
endIconBind: W,
|
|
130
|
+
contentBind: a(() => e({}, {}, m({
|
|
116
131
|
contents: !0,
|
|
117
|
-
invisible:
|
|
132
|
+
invisible: w.value.loading
|
|
118
133
|
}))),
|
|
119
|
-
endSlotBind:
|
|
120
|
-
rootAriaBusy:
|
|
121
|
-
rootDisabled:
|
|
122
|
-
startIconBind:
|
|
123
|
-
startSlotBind:
|
|
124
|
-
loadingIconBind:
|
|
134
|
+
endSlotBind: G,
|
|
135
|
+
rootAriaBusy: P,
|
|
136
|
+
rootDisabled: N,
|
|
137
|
+
startIconBind: K,
|
|
138
|
+
startSlotBind: q,
|
|
139
|
+
loadingIconBind: a(() => e(E.value?.loading, {}, m({
|
|
125
140
|
"shrink-0 animate-spin": !0,
|
|
126
|
-
[
|
|
141
|
+
[D.value.loading ?? ""]: !0
|
|
127
142
|
}))),
|
|
128
|
-
loadingWrapBind:
|
|
129
|
-
rootAriaDisabled:
|
|
143
|
+
loadingWrapBind: J,
|
|
144
|
+
rootAriaDisabled: F
|
|
130
145
|
};
|
|
131
146
|
}
|
|
132
147
|
//#endregion
|
|
133
|
-
export {
|
|
148
|
+
export { v as useButton };
|
|
@@ -50,12 +50,12 @@ var S = { class: "flex w-full min-w-0 items-center gap-x-2" }, C = {
|
|
|
50
50
|
"viewDateChange"
|
|
51
51
|
],
|
|
52
52
|
setup(d, { emit: w }) {
|
|
53
|
-
let T =
|
|
53
|
+
let T = w, E = d, { view: D, value: O, merged: k, shared: A, showNav: j, rootBind: M, viewDate: N, viewYear: P, bodyBind: F, viewMonth: I, yearLabel: L, monthLabel: R, headerBind: z, navIconBind: B, setViewDate: V, granularity: H, handleChange: U, yearPageSize: W, yearPageStart: G, nextButtonBind: K, todayButtonBind: q, yearSelectorBind: J, handleYearSelect: Y, showYearSelector: X, monthSelectorBind: Z, handleMonthSelect: Q, showMonthSelector: te, previousButtonBind: ne } = t(E, {
|
|
54
54
|
rounded: "md",
|
|
55
55
|
startOfWeek: 0,
|
|
56
56
|
color: "primary",
|
|
57
57
|
defaultView: "date"
|
|
58
|
-
},
|
|
58
|
+
}, T);
|
|
59
59
|
function $(e) {
|
|
60
60
|
let t = _(B)?.class;
|
|
61
61
|
return x({
|
|
@@ -86,7 +86,7 @@ var S = { class: "flex w-full min-w-0 items-center gap-x-2" }, C = {
|
|
|
86
86
|
"view-date": v(N),
|
|
87
87
|
onChange: v(U),
|
|
88
88
|
multiple: v(k).multiple,
|
|
89
|
-
"preview-date":
|
|
89
|
+
"preview-date": E.previewDate,
|
|
90
90
|
onViewDateChange: v(V),
|
|
91
91
|
"start-of-week": v(k).startOfWeek,
|
|
92
92
|
"disable-dates": v(k).disableDates,
|
|
@@ -94,7 +94,7 @@ var S = { class: "flex w-full min-w-0 items-center gap-x-2" }, C = {
|
|
|
94
94
|
"hide-weekdays": v(k).hideWeekdays,
|
|
95
95
|
"disable-months": v(k).disableMonths,
|
|
96
96
|
"hide-outside-days": v(k).hideOutsideDays,
|
|
97
|
-
onPreviewDateChange: d[0] ||= (e) =>
|
|
97
|
+
onPreviewDateChange: d[0] ||= (e) => T("previewDateChange", e)
|
|
98
98
|
}), {
|
|
99
99
|
day: y((e) => [ee(t.$slots, "day", m(f(e)), () => [l(g(e.label), 1)])]),
|
|
100
100
|
_: 3
|
|
@@ -118,12 +118,12 @@ var S = { class: "flex w-full min-w-0 items-center gap-x-2" }, C = {
|
|
|
118
118
|
range: v(k).range,
|
|
119
119
|
multiple: v(k).multiple,
|
|
120
120
|
onChange: v(Q),
|
|
121
|
-
"preview-date":
|
|
121
|
+
"preview-date": E.previewDate,
|
|
122
122
|
"disable-dates": v(k).disableDates,
|
|
123
123
|
"disable-years": v(k).disableYears,
|
|
124
124
|
"disable-months": v(k).disableMonths,
|
|
125
125
|
selection: v(H) === "month" ? v(O) : void 0,
|
|
126
|
-
onPreviewDateChange: d[1] ||= (e) =>
|
|
126
|
+
onPreviewDateChange: d[1] ||= (e) => T("previewDateChange", e)
|
|
127
127
|
}), null, 16, [
|
|
128
128
|
"year",
|
|
129
129
|
"value",
|
|
@@ -142,11 +142,11 @@ var S = { class: "flex w-full min-w-0 items-center gap-x-2" }, C = {
|
|
|
142
142
|
"start-year": v(G),
|
|
143
143
|
multiple: v(k).multiple,
|
|
144
144
|
onChange: v(Y),
|
|
145
|
-
"preview-date":
|
|
145
|
+
"preview-date": E.previewDate,
|
|
146
146
|
"disable-dates": v(k).disableDates,
|
|
147
147
|
"disable-years": v(k).disableYears,
|
|
148
148
|
selection: v(H) === "year" ? v(O) : void 0,
|
|
149
|
-
onPreviewDateChange: d[2] ||= (e) =>
|
|
149
|
+
onPreviewDateChange: d[2] ||= (e) => T("previewDateChange", e)
|
|
150
150
|
}), null, 16, [
|
|
151
151
|
"value",
|
|
152
152
|
"range",
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { CarouselOwnProps, CarouselSlots } from './carousel.types';
|
|
2
|
+
type __VLS_Slots = CarouselSlots;
|
|
3
|
+
type __VLS_Props = CarouselOwnProps;
|
|
4
|
+
type __VLS_ModelProps = {
|
|
5
|
+
"index"?: number;
|
|
6
|
+
};
|
|
7
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
8
|
+
declare const __VLS_base: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
9
|
+
"update:index": (value: number | undefined) => any;
|
|
10
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
11
|
+
"onUpdate:index"?: ((value: number | undefined) => any) | undefined;
|
|
12
|
+
}>, {
|
|
13
|
+
indicators: boolean;
|
|
14
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
15
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
16
|
+
declare const _default: typeof __VLS_export;
|
|
17
|
+
export default _default;
|
|
18
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
19
|
+
new (): {
|
|
20
|
+
$slots: S;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import e from "../Icon/Icon.js";
|
|
2
|
+
import { useCarousel as t } from "./composables/useCarousel.js";
|
|
3
|
+
import { Fragment as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, createVNode as o, defineComponent as s, guardReactiveProps as c, mergeModels as l, mergeProps as u, normalizeClass as d, normalizeProps as f, openBlock as p, renderList as m, renderSlot as h, toDisplayString as g, unref as _, useModel as v } from "vue";
|
|
4
|
+
//#region src/Components/Carousel/Carousel.vue?vue&type=script&setup=true&lang.ts
|
|
5
|
+
var y = /*@__PURE__*/ s({
|
|
6
|
+
inheritAttrs: !1,
|
|
7
|
+
__name: "Carousel",
|
|
8
|
+
props: /*@__PURE__*/ l({
|
|
9
|
+
autoPlay: { type: [Number, Boolean] },
|
|
10
|
+
classes: {},
|
|
11
|
+
customProps: {},
|
|
12
|
+
defaultIndex: {},
|
|
13
|
+
gap: {},
|
|
14
|
+
indicators: {
|
|
15
|
+
type: Boolean,
|
|
16
|
+
default: !0
|
|
17
|
+
},
|
|
18
|
+
loop: { type: Boolean },
|
|
19
|
+
orientation: {},
|
|
20
|
+
size: {},
|
|
21
|
+
slidesPerView: {}
|
|
22
|
+
}, {
|
|
23
|
+
index: {},
|
|
24
|
+
indexModifiers: {}
|
|
25
|
+
}),
|
|
26
|
+
emits: ["update:index"],
|
|
27
|
+
setup(s) {
|
|
28
|
+
let l = s, y = v(s, "index"), { liveBind: b, nextBind: x, prevBind: S, rootBind: C, nextIcon: w, prevIcon: T, trackBind: E, activeIndex: D, controlsBind: O, nextIconBind: k, prevIconBind: A, showControls: j, viewportBind: M, announcement: N, frameClassName: P, indicatorsBind: F, showIndicators: I, getIndicatorBind: L, indicatorIndexes: R } = t(l, {
|
|
29
|
+
gap: 0,
|
|
30
|
+
size: "md",
|
|
31
|
+
loop: !1,
|
|
32
|
+
autoPlay: !1,
|
|
33
|
+
defaultIndex: 0,
|
|
34
|
+
indicators: !0,
|
|
35
|
+
slidesPerView: 1,
|
|
36
|
+
orientation: "horizontal"
|
|
37
|
+
}, y);
|
|
38
|
+
return (t, s) => (p(), i("section", f(c(_(C))), [
|
|
39
|
+
a("div", { class: d(_(P)) }, [a("div", f(c(_(M))), [a("div", f(c(_(E))), [h(t.$slots, "default")], 16)], 16), _(j) ? (p(), i("div", f(u({ key: 0 }, _(O))), [a("button", f(c(_(S))), [h(t.$slots, "prev", {}, () => [o(_(e), u({ icon: _(T) }, _(A)), null, 16, ["icon"])])], 16), a("button", f(c(_(x))), [h(t.$slots, "next", {}, () => [o(_(e), u({ icon: _(w) }, _(k)), null, 16, ["icon"])])], 16)], 16)) : r("", !0)], 2),
|
|
40
|
+
_(I) ? (p(), i("div", f(u({ key: 0 }, _(F))), [(p(!0), i(n, null, m(_(R), (e) => (p(), i("button", u({ key: e }, { ref_for: !0 }, _(L)(e)), [h(t.$slots, "indicator", {
|
|
41
|
+
index: e,
|
|
42
|
+
selected: e === _(D)
|
|
43
|
+
})], 16))), 128))], 16)) : r("", !0),
|
|
44
|
+
a("div", f(c(_(b))), g(_(N)), 17)
|
|
45
|
+
], 16));
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
//#endregion
|
|
49
|
+
export { y as default };
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
import { ButtonHTMLAttributes, HTMLAttributes, Slot } from 'vue';
|
|
2
|
+
import { CarouselOrientation } from '@bridge-ui/core/Domain';
|
|
3
|
+
import { CarouselSize } from '@bridge-ui/core/Tokens';
|
|
4
|
+
import { MergeHtmlProps, MergeProps } from '@bridge-ui/core/Utils';
|
|
5
|
+
import { IconProps } from '../Icon';
|
|
6
|
+
export interface CarouselSizeOverrides {}
|
|
7
|
+
export interface CarouselClasses {
|
|
8
|
+
/**
|
|
9
|
+
* Classes merged onto previous/next buttons.
|
|
10
|
+
*/
|
|
11
|
+
control?: string;
|
|
12
|
+
/**
|
|
13
|
+
* Classes merged onto the previous and next control group.
|
|
14
|
+
*/
|
|
15
|
+
controls?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Classes merged onto each indicator button.
|
|
18
|
+
*/
|
|
19
|
+
indicator?: string;
|
|
20
|
+
/**
|
|
21
|
+
* Classes merged onto the indicator group.
|
|
22
|
+
*/
|
|
23
|
+
indicators?: string;
|
|
24
|
+
/**
|
|
25
|
+
* Classes merged onto the live region.
|
|
26
|
+
*/
|
|
27
|
+
live?: string;
|
|
28
|
+
/**
|
|
29
|
+
* Classes merged onto the next button.
|
|
30
|
+
*/
|
|
31
|
+
next?: string;
|
|
32
|
+
/**
|
|
33
|
+
* Classes merged onto the previous button.
|
|
34
|
+
*/
|
|
35
|
+
prev?: string;
|
|
36
|
+
/**
|
|
37
|
+
* Classes merged onto the region root.
|
|
38
|
+
*/
|
|
39
|
+
root?: string;
|
|
40
|
+
/**
|
|
41
|
+
* Classes merged onto each slide.
|
|
42
|
+
*/
|
|
43
|
+
slide?: string;
|
|
44
|
+
/**
|
|
45
|
+
* Classes merged onto the track.
|
|
46
|
+
*/
|
|
47
|
+
track?: string;
|
|
48
|
+
/**
|
|
49
|
+
* Classes merged onto the viewport.
|
|
50
|
+
*/
|
|
51
|
+
viewport?: string;
|
|
52
|
+
}
|
|
53
|
+
export interface CarouselCustomProps {
|
|
54
|
+
/**
|
|
55
|
+
* Props forwarded to the previous and next control group.
|
|
56
|
+
*
|
|
57
|
+
* @default undefined
|
|
58
|
+
*/
|
|
59
|
+
controls?: HTMLAttributes;
|
|
60
|
+
/**
|
|
61
|
+
* Props forwarded to each indicator button.
|
|
62
|
+
*
|
|
63
|
+
* @default undefined
|
|
64
|
+
*/
|
|
65
|
+
indicator?: ButtonHTMLAttributes;
|
|
66
|
+
/**
|
|
67
|
+
* Props forwarded to the indicator group.
|
|
68
|
+
*
|
|
69
|
+
* @default undefined
|
|
70
|
+
*/
|
|
71
|
+
indicators?: HTMLAttributes;
|
|
72
|
+
/**
|
|
73
|
+
* Props forwarded to the live region.
|
|
74
|
+
*
|
|
75
|
+
* @default undefined
|
|
76
|
+
*/
|
|
77
|
+
live?: HTMLAttributes;
|
|
78
|
+
/**
|
|
79
|
+
* Props forwarded to the next button.
|
|
80
|
+
*
|
|
81
|
+
* @default undefined
|
|
82
|
+
*/
|
|
83
|
+
next?: ButtonHTMLAttributes;
|
|
84
|
+
/**
|
|
85
|
+
* Props forwarded to the next `Icon`.
|
|
86
|
+
*
|
|
87
|
+
* @default undefined
|
|
88
|
+
*/
|
|
89
|
+
nextIcon?: Partial<Omit<IconProps, "icon">>;
|
|
90
|
+
/**
|
|
91
|
+
* Props forwarded to the previous button.
|
|
92
|
+
*
|
|
93
|
+
* @default undefined
|
|
94
|
+
*/
|
|
95
|
+
prev?: ButtonHTMLAttributes;
|
|
96
|
+
/**
|
|
97
|
+
* Props forwarded to the previous `Icon`.
|
|
98
|
+
*
|
|
99
|
+
* @default undefined
|
|
100
|
+
*/
|
|
101
|
+
prevIcon?: Partial<Omit<IconProps, "icon">>;
|
|
102
|
+
/**
|
|
103
|
+
* Props forwarded to the region root.
|
|
104
|
+
*
|
|
105
|
+
* @default undefined
|
|
106
|
+
*/
|
|
107
|
+
root?: HTMLAttributes;
|
|
108
|
+
/**
|
|
109
|
+
* Props forwarded to each `CarouselSlide`.
|
|
110
|
+
*
|
|
111
|
+
* @default undefined
|
|
112
|
+
*/
|
|
113
|
+
slide?: HTMLAttributes;
|
|
114
|
+
/**
|
|
115
|
+
* Props forwarded to the track.
|
|
116
|
+
*
|
|
117
|
+
* @default undefined
|
|
118
|
+
*/
|
|
119
|
+
track?: HTMLAttributes;
|
|
120
|
+
/**
|
|
121
|
+
* Props forwarded to the viewport.
|
|
122
|
+
*
|
|
123
|
+
* @default undefined
|
|
124
|
+
*/
|
|
125
|
+
viewport?: HTMLAttributes;
|
|
126
|
+
}
|
|
127
|
+
export interface CarouselEmits {
|
|
128
|
+
/**
|
|
129
|
+
* Emitted when the active slide changes (`v-model:index`).
|
|
130
|
+
*/
|
|
131
|
+
"update:index": [index: number];
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* State passed to the indicator slot.
|
|
135
|
+
*/
|
|
136
|
+
export interface CarouselIndicatorState {
|
|
137
|
+
/**
|
|
138
|
+
* 0-based snap index.
|
|
139
|
+
*/
|
|
140
|
+
index: number;
|
|
141
|
+
/**
|
|
142
|
+
* Whether this indicator is the active snap.
|
|
143
|
+
*/
|
|
144
|
+
selected: boolean;
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Slideshow region. Compose with `CarouselSlide`.
|
|
148
|
+
*/
|
|
149
|
+
export interface CarouselOwnProps {
|
|
150
|
+
/**
|
|
151
|
+
* Auto-advance. `true` uses a 5s interval; a number is the interval in ms.
|
|
152
|
+
*
|
|
153
|
+
* @default false
|
|
154
|
+
*/
|
|
155
|
+
autoPlay?: number | boolean;
|
|
156
|
+
/**
|
|
157
|
+
* Classes for carousel parts.
|
|
158
|
+
*
|
|
159
|
+
* @default undefined
|
|
160
|
+
*/
|
|
161
|
+
classes?: CarouselClasses;
|
|
162
|
+
/**
|
|
163
|
+
* Extra props for internal parts.
|
|
164
|
+
*
|
|
165
|
+
* @default undefined
|
|
166
|
+
*/
|
|
167
|
+
customProps?: CarouselCustomProps;
|
|
168
|
+
/**
|
|
169
|
+
* Initial slide when uncontrolled.
|
|
170
|
+
*
|
|
171
|
+
* @default 0
|
|
172
|
+
*/
|
|
173
|
+
defaultIndex?: number;
|
|
174
|
+
/**
|
|
175
|
+
* Space between slides, in px. Padding sits on the slide so the snap
|
|
176
|
+
* distance stays even.
|
|
177
|
+
*
|
|
178
|
+
* @default 0
|
|
179
|
+
*/
|
|
180
|
+
gap?: number;
|
|
181
|
+
/**
|
|
182
|
+
* Show dot indicators.
|
|
183
|
+
*
|
|
184
|
+
* @default true
|
|
185
|
+
*/
|
|
186
|
+
indicators?: boolean;
|
|
187
|
+
/**
|
|
188
|
+
* Wrap from the last slide to the first and back.
|
|
189
|
+
*
|
|
190
|
+
* @default false
|
|
191
|
+
*/
|
|
192
|
+
loop?: boolean;
|
|
193
|
+
/**
|
|
194
|
+
* Scroll axis. Vertical carousels use up/down keys and a vertical swipe.
|
|
195
|
+
*
|
|
196
|
+
* @default "horizontal"
|
|
197
|
+
*/
|
|
198
|
+
orientation?: CarouselOrientation;
|
|
199
|
+
/**
|
|
200
|
+
* Control and indicator scale.
|
|
201
|
+
*
|
|
202
|
+
* @default "md"
|
|
203
|
+
*/
|
|
204
|
+
size?: MergeProps<CarouselSize, CarouselSizeOverrides>;
|
|
205
|
+
/**
|
|
206
|
+
* How many slides fit in the viewport. `1` shows one slide. A larger
|
|
207
|
+
* number, including fractions, reveals the next slide.
|
|
208
|
+
*
|
|
209
|
+
* @default 1
|
|
210
|
+
*/
|
|
211
|
+
slidesPerView?: number;
|
|
212
|
+
}
|
|
213
|
+
export interface CarouselSlots {
|
|
214
|
+
/**
|
|
215
|
+
* Slide elements (`CarouselSlide`).
|
|
216
|
+
*/
|
|
217
|
+
default?: Slot<undefined>;
|
|
218
|
+
/**
|
|
219
|
+
* Custom indicator content. The button chrome stays in place.
|
|
220
|
+
*/
|
|
221
|
+
indicator?: Slot<CarouselIndicatorState>;
|
|
222
|
+
/**
|
|
223
|
+
* Custom next control content (default chevron icon).
|
|
224
|
+
*/
|
|
225
|
+
next?: Slot<undefined>;
|
|
226
|
+
/**
|
|
227
|
+
* Custom previous control content (default chevron icon).
|
|
228
|
+
*/
|
|
229
|
+
prev?: Slot<undefined>;
|
|
230
|
+
}
|
|
231
|
+
export type CarouselProps = MergeHtmlProps<CarouselOwnProps, HTMLAttributes> & {
|
|
232
|
+
/**
|
|
233
|
+
* Bound with `v-model:index`.
|
|
234
|
+
*/
|
|
235
|
+
index?: number;
|
|
236
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { ComputedRef, HTMLAttributes, InjectionKey } from 'vue';
|
|
2
|
+
import { CarouselSizeItem } from '@bridge-ui/core/Tokens';
|
|
3
|
+
/**
|
|
4
|
+
* Shared carousel state for `CarouselSlide` descendants.
|
|
5
|
+
*/
|
|
6
|
+
export type CarouselContextValue = {
|
|
7
|
+
/**
|
|
8
|
+
* Bound 0-based active index.
|
|
9
|
+
*/
|
|
10
|
+
activeIndex: number;
|
|
11
|
+
/**
|
|
12
|
+
* Resolves a registered slide's 0-based index.
|
|
13
|
+
*/
|
|
14
|
+
getIndex: (id: string) => number;
|
|
15
|
+
/**
|
|
16
|
+
* Stable id prefix for slide elements.
|
|
17
|
+
*/
|
|
18
|
+
id: string;
|
|
19
|
+
/**
|
|
20
|
+
* Registers a slide id and returns unregister.
|
|
21
|
+
*/
|
|
22
|
+
registerSlide: (id: string) => () => void;
|
|
23
|
+
/**
|
|
24
|
+
* Size class map.
|
|
25
|
+
*/
|
|
26
|
+
sizeItem: undefined | CarouselSizeItem;
|
|
27
|
+
/**
|
|
28
|
+
* Classes from the carousel `classes.slide` part.
|
|
29
|
+
*/
|
|
30
|
+
slideClassName: string;
|
|
31
|
+
/**
|
|
32
|
+
* Number of registered slides.
|
|
33
|
+
*/
|
|
34
|
+
slideCount: number;
|
|
35
|
+
/**
|
|
36
|
+
* Props forwarded from `customProps.slide`.
|
|
37
|
+
*/
|
|
38
|
+
slidePartProps: undefined | HTMLAttributes;
|
|
39
|
+
/**
|
|
40
|
+
* How many slides fit in the viewport.
|
|
41
|
+
*/
|
|
42
|
+
slidesPerView: number;
|
|
43
|
+
/**
|
|
44
|
+
* Inline size for each slide (basis and gap padding).
|
|
45
|
+
*/
|
|
46
|
+
slideStyle: Record<string, string>;
|
|
47
|
+
};
|
|
48
|
+
export declare const CAROUSEL_INJECTION_KEY: InjectionKey<ComputedRef<CarouselContextValue>>;
|