bitboss-ui 3.0.0-beta.75 → 3.0.0-beta.76
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/README.md +5 -5
- package/bin/cli.mjs +16 -10
- package/dist/ai/BbAlert.md +1 -1
- package/dist/ai/BbBreadcrumbs.md +1 -1
- package/dist/ai/BbButton.md +2 -2
- package/dist/ai/BbColorInput.md +1 -1
- package/dist/ai/BbColorPalette.md +1 -1
- package/dist/ai/BbConfirm.md +1 -1
- package/dist/ai/BbDatePicker.md +1 -1
- package/dist/ai/BbDatePickerInput.md +1 -1
- package/dist/ai/BbDialog.md +3 -2
- package/dist/ai/BbDropdown.md +23 -21
- package/dist/ai/BbDropdownButton.md +13 -11
- package/dist/ai/BbGallery.md +3 -2
- package/dist/ai/BbIcon.md +10 -10
- package/dist/ai/BbOffCanvas.md +3 -2
- package/dist/ai/BbPopover.md +1 -1
- package/dist/ai/BbSelect.md +153 -43
- package/dist/ai/BbSelectPopover.md +115 -9
- package/dist/ai/BbTable.md +1 -1
- package/dist/ai/BbTimePicker.md +1 -1
- package/dist/ai/BbTimePickerInput.md +1 -1
- package/dist/ai/GroupedListBox.md +2 -2
- package/dist/ai/ListBox.md +3 -2
- package/dist/ai/changelog.json +153 -7
- package/dist/ai/components.json +12 -12
- package/dist/ai/guides/agent-contract.md +1 -1
- package/dist/ai/guides/calendars-and-digits.md +1 -1
- package/dist/ai/guides/eslint-rules.md +1 -1
- package/dist/ai/guides/icons-policy.md +32 -11
- package/dist/ai/guides/installation-and-plugin-setup.md +24 -23
- package/dist/ai/guides/migration/adoption-checklist.md +1 -1
- package/dist/ai/guides/migration/components/bb-icon.md +4 -4
- package/dist/ai/guides/migration/v2-to-v3.md +48 -19
- package/dist/ai/guides/migration/v3-beta-css-classes.md +18 -3
- package/dist/ai/guides/passthrough.md +58 -58
- package/dist/ai/helpers/inertia/manifest.json +1 -1
- package/dist/ai/manifest/components/BbDialog.tree.json +1 -1
- package/dist/ai/manifest/components/BbDropdown.json +19 -17
- package/dist/ai/manifest/components/BbDropdown.tree.json +9 -9
- package/dist/ai/manifest/components/BbDropdownButton.json +12 -10
- package/dist/ai/manifest/components/BbDropdownButton.tree.json +2 -0
- package/dist/ai/manifest/components/BbGallery.tree.json +1 -1
- package/dist/ai/manifest/components/BbOffCanvas.tree.json +1 -1
- package/dist/ai/manifest/components/BbSelect.json +44 -40
- package/dist/ai/manifest/components/BbSelect.tree.json +2 -1
- package/dist/ai/manifest/components/BbSelectPopover.json +10 -6
- package/dist/ai/manifest/components/BbSelectPopover.tree.json +4 -1
- package/dist/ai/manifest/components/BbTable.tree.json +5 -1
- package/dist/ai/manifest/components/GroupedListBox.json +1 -1
- package/dist/ai/manifest/components/GroupedListBox.tree.json +1 -0
- package/dist/ai/manifest/components/ListBox.json +1 -1
- package/dist/ai/manifest/components/ListBox.tree.json +1 -1
- package/dist/ai/manifest/index.json +2 -2
- package/dist/ai/recipes/inertia/inline-edit-workspace.md +1 -1
- package/dist/ai/recipes/inertia/onboarding.md +1 -1
- package/dist/ai/recipes/nuxt/inline-edit-workspace.md +1 -1
- package/dist/ai/recipes/nuxt/onboarding.md +1 -1
- package/dist/ai/recipes/vue/inline-edit-workspace.md +1 -1
- package/dist/ai/recipes/vue/onboarding.md +2 -2
- package/dist/ai/source/BbAccordion.md +4 -5
- package/dist/ai/source/BbAvatar.md +9 -2
- package/dist/ai/source/BbBadge.md +6 -2
- package/dist/ai/source/BbBreadcrumbs.md +5 -2
- package/dist/ai/source/BbCalendar.md +8 -6
- package/dist/ai/source/BbCarousel.md +10 -6
- package/dist/ai/source/BbColorPalette.md +5 -2
- package/dist/ai/source/BbDatePickerInput.md +7 -2
- package/dist/ai/source/BbDropdown.md +91 -66
- package/dist/ai/source/BbDropdownButton.md +36 -19
- package/dist/ai/source/BbDropdownGroup.md +91 -66
- package/dist/ai/source/BbGallery.md +6 -5
- package/dist/ai/source/BbPagination.md +12 -28
- package/dist/ai/source/BbRating.md +4 -4
- package/dist/ai/source/BbSelect.md +130 -106
- package/dist/ai/source/BbSelectPopover.md +128 -21
- package/dist/ai/source/BbTable.md +42 -9
- package/dist/ai/source/BbTimePickerInput.md +6 -2
- package/dist/ai/source/ClearableButton.md +4 -2
- package/dist/ai/source/ErrorIcon.md +4 -3
- package/dist/ai/source/FlatListBox.md +7 -2
- package/dist/ai/source/GroupedListBox.md +22 -3
- package/dist/ai/source/ListBox.md +7 -1
- package/dist/ai/source/WarningIcon.md +4 -3
- package/dist/assets/svgs/close.svg_raw.js +1 -1
- package/dist/components/BbAccordion/BbAccordion.vue.d.ts +1 -1
- package/dist/components/BbAccordion/BbAccordion.vue_vue_type_script_setup_true_lang.js +35 -34
- package/dist/components/BbAvatar/BbAvatar.vue_vue_type_script_setup_true_lang.js +48 -47
- package/dist/components/BbBadge/BbBadge.vue_vue_type_script_setup_true_lang.js +60 -59
- package/dist/components/BbBreadcrumbs/BbBreadcrumbs.vue_vue_type_script_setup_true_lang.js +128 -127
- package/dist/components/BbCalendar/BbCalendar.vue.d.ts +1 -1
- package/dist/components/BbCalendar/BbCalendar.vue_vue_type_script_setup_true_lang.js +240 -239
- package/dist/components/BbCarousel/BbCarousel.vue_vue_type_script_setup_true_lang.js +500 -499
- package/dist/components/BbCheckboxGroup/BbCheckboxGroup.vue.d.ts +4 -4
- package/dist/components/BbColorPalette/BbColorPalette.vue_vue_type_script_setup_true_lang.js +175 -174
- package/dist/components/BbDatePicker/BbDatePicker.vue.d.ts +1 -1
- package/dist/components/BbDatePickerInput/BbDatePickerInput.vue.d.ts +2 -2
- package/dist/components/BbDatePickerInput/BbDatePickerInput.vue_vue_type_script_setup_true_lang.js +263 -262
- package/dist/components/BbDropdown/AdaptiveDropdown.vue_vue_type_script_setup_true_lang.js +81 -80
- package/dist/components/BbDropdown/BbDropdown.vue_vue_type_script_setup_true_lang.js +4 -0
- package/dist/components/BbDropdown/BbDropdownList.vue_vue_type_script_setup_true_lang.js +318 -312
- package/dist/components/BbDropdown/DropdownRow.vue_vue_type_script_setup_true_lang.js +47 -46
- package/dist/components/BbDropdown/ptKeys.generated.d.ts +36 -20
- package/dist/components/BbDropdown/types.d.ts +51 -53
- package/dist/components/BbDropdown/types.js +2 -0
- package/dist/components/BbDropdownButton/BbDropdownButton.vue.d.ts +1 -1
- package/dist/components/BbDropdownButton/BbDropdownButton.vue_vue_type_script_setup_true_lang.js +74 -59
- package/dist/components/BbDropdownButton/ptKeys.generated.d.ts +111 -63
- package/dist/components/BbDropdownButton/types.d.ts +12 -10
- package/dist/components/BbDropdownButton/types.js +2 -0
- package/dist/components/BbDropzone/BbDropzone.vue.d.ts +1 -1
- package/dist/components/BbGallery/BbGallery.vue_vue_type_script_setup_true_lang.js +204 -203
- package/dist/components/BbIcon/iconCache.js +1 -1
- package/dist/components/BbNumberInput/BbNumberInput.vue.d.ts +1 -1
- package/dist/components/BbPagination/BbPagination.vue.d.ts +2 -2
- package/dist/components/BbPagination/BbPagination.vue_vue_type_script_setup_true_lang.js +138 -136
- package/dist/components/BbProgress/BbProgress.vue.d.ts +1 -1
- package/dist/components/BbRadioGroup/BbRadioGroup.vue.d.ts +4 -4
- package/dist/components/BbRating/BbRating.vue.d.ts +1 -1
- package/dist/components/BbRating/BbRating.vue_vue_type_script_setup_true_lang.js +100 -99
- package/dist/components/BbSelect/BbSelect.vue.d.ts +30 -20
- package/dist/components/BbSelect/BbSelect.vue_vue_type_script_setup_true_lang.js +201 -184
- package/dist/components/BbSelect/ptKeys.generated.d.ts +128 -96
- package/dist/components/BbSelect/types.d.ts +101 -105
- package/dist/components/BbSelect/types.js +1 -27
- package/dist/components/BbSelectPopover/BbSelectPopover.vue.d.ts +6 -3
- package/dist/components/BbSelectPopover/BbSelectPopover.vue_vue_type_script_setup_true_lang.js +617 -585
- package/dist/components/BbSelectPopover/ptKeys.generated.d.ts +22 -10
- package/dist/components/BbSelectPopover/types.d.ts +22 -13
- package/dist/components/BbSelectPopover/types.js +3 -1
- package/dist/components/BbSwitchGroup/BbSwitchGroup.vue.d.ts +1 -1
- package/dist/components/BbTable/BbTable.vue.d.ts +1 -1
- package/dist/components/BbTable/BbTable.vue_vue_type_script_setup_true_lang.js +1092 -1090
- package/dist/components/BbTable/BbTableDataRow.js +97 -90
- package/dist/components/BbTabs/BbTabs.vue.d.ts +3 -3
- package/dist/components/BbTimePicker/BbTimePicker.vue.d.ts +2 -2
- package/dist/components/BbTimePickerInput/BbTimePickerInput.vue.d.ts +2 -2
- package/dist/components/BbTimePickerInput/BbTimePickerInput.vue_vue_type_script_setup_true_lang.js +225 -224
- package/dist/components/BbToast/BbToastMessage.vue_vue_type_script_setup_true_lang.js +76 -75
- package/dist/components/ClearableButton/ClearableButton.vue_vue_type_script_setup_true_lang.js +9 -8
- package/dist/components/CloseIcon/CloseButton.vue.js +1 -1
- package/dist/components/CloseIcon/CloseButton.vue_vue_type_script_setup_true_lang.js +9 -7
- package/dist/components/ErrorIcon/ErrorIcon.vue_vue_type_script_setup_true_lang.js +8 -6
- package/dist/components/FlatListBox/FlatListBox.vue_vue_type_script_setup_true_lang.js +69 -68
- package/dist/components/GroupedListBox/GroupedListBox.vue_vue_type_script_setup_true_lang.js +166 -165
- package/dist/components/WarningIcon/WarningIcon.vue_vue_type_script_setup_true_lang.js +8 -6
- package/dist/composables/useInternalIcon.js +25 -0
- package/dist/icon-scan.d.ts +1 -1
- package/dist/llms-full.txt +477 -187
- package/dist/llms-medium.txt +25 -24
- package/dist/llms.txt +1 -1
- package/dist/nuxt.js +1 -1
- package/dist/styles.css +2 -2
- package/dist/types/Config.d.ts +8 -1
- package/dist/types/ConfigDefaults.d.ts +10 -2
- package/dist/types/internalIcons.d.ts +89 -0
- package/dist/types/internalIcons.js +158 -0
- package/dist/types/ptComponentMap.d.ts +4 -4
- package/dist/utils/configDefaults.js +75 -64
- package/dist/utils/iconsOption.js +48 -0
- package/dist/utils/versionCheck.js +1 -1
- package/dist/vite-plugin.d.ts +10 -16
- package/dist/vite.js +319 -306
- package/llms.txt +1 -1
- package/package.json +1 -1
- package/scripts/lib/adoption-checklist.json +1 -1
- package/scripts/lib/update-install.mjs +48 -0
- package/scripts/lib/validate-bb-markup.mjs +73 -12
- package/dist/assets/svgs/caret_down.svg_raw.js +0 -3
|
@@ -7,38 +7,39 @@ import { usePassthrough as a } from "../../composables/usePassthrough.js";
|
|
|
7
7
|
import { useLocale as o } from "../../composables/useLocale.js";
|
|
8
8
|
import { BB_CAROUSEL_PT as s } from "./types.js";
|
|
9
9
|
import { dragVelocity as c, quickRelease as ee } from "./dragRelease.js";
|
|
10
|
-
import {
|
|
10
|
+
import { useInternalIcon as l } from "../../composables/useInternalIcon.js";
|
|
11
|
+
import { Comment as u, Fragment as d, Text as f, cloneVNode as te, computed as p, createBlock as ne, createCommentVNode as re, createElementBlock as m, createElementVNode as h, createVNode as ie, defineComponent as ae, mergeModels as g, mergeProps as _, nextTick as v, onBeforeUnmount as oe, onMounted as se, onUpdated as ce, openBlock as y, ref as b, renderList as le, renderSlot as ue, resolveDynamicComponent as de, toDisplayString as fe, unref as x, useAttrs as pe, useModel as me, useSlots as he, watch as ge, withModifiers as _e } from "vue";
|
|
11
12
|
// src/components/BbCarousel/BbCarousel.vue?vue&type=script&setup=true&lang.ts
|
|
12
|
-
var
|
|
13
|
+
var ve = ["aria-label", "aria-roledescription"], ye = ["aria-label"], be = ["aria-label"], xe = [
|
|
13
14
|
"aria-current",
|
|
14
15
|
"aria-label",
|
|
15
16
|
"inert",
|
|
16
17
|
"tabindex",
|
|
17
18
|
"onClick"
|
|
18
|
-
],
|
|
19
|
+
], Se = ["aria-disabled", "aria-label"], Ce = ["aria-disabled", "aria-label"], we = [
|
|
19
20
|
"aria-hidden",
|
|
20
21
|
"aria-label",
|
|
21
22
|
"aria-roledescription",
|
|
22
23
|
"inert",
|
|
23
24
|
"role"
|
|
24
|
-
],
|
|
25
|
+
], Te = ["aria-current", "aria-label"], Ee = [
|
|
25
26
|
"loading",
|
|
26
27
|
"sizes",
|
|
27
28
|
"src",
|
|
28
29
|
"srcset"
|
|
29
|
-
],
|
|
30
|
+
], De = [
|
|
30
31
|
"alt",
|
|
31
32
|
"loading",
|
|
32
33
|
"sizes",
|
|
33
34
|
"src",
|
|
34
35
|
"srcset"
|
|
35
|
-
],
|
|
36
|
+
], Oe = {
|
|
36
37
|
"aria-live": "polite",
|
|
37
38
|
class: "bb-sr-only"
|
|
38
|
-
},
|
|
39
|
+
}, S = /*@__PURE__*/ ae({
|
|
39
40
|
inheritAttrs: !1,
|
|
40
41
|
__name: "BbCarousel",
|
|
41
|
-
props: /*@__PURE__*/
|
|
42
|
+
props: /*@__PURE__*/ g({
|
|
42
43
|
"pt:root": {},
|
|
43
44
|
"pt:slide": {},
|
|
44
45
|
"pt:slide:current": {},
|
|
@@ -78,48 +79,48 @@ var ye = ["aria-label", "aria-roledescription"], be = ["aria-label"], xe = ["ari
|
|
|
78
79
|
modelModifiers: {}
|
|
79
80
|
}),
|
|
80
81
|
emits: ["update:modelValue"],
|
|
81
|
-
setup(
|
|
82
|
-
let
|
|
82
|
+
setup(ae) {
|
|
83
|
+
let g = me(ae, "modelValue"), S = ae, C = he(), ke = l("play", i), Ae = l("pause", r), je = l("next", n), Me = l("prev", t), w = b(g.value), { t: T } = o(), E = a({
|
|
83
84
|
component: "BbCarousel",
|
|
84
|
-
attrs:
|
|
85
|
-
props:
|
|
85
|
+
attrs: pe(),
|
|
86
|
+
props: S,
|
|
86
87
|
parts: s.parts,
|
|
87
88
|
states: s.states,
|
|
88
89
|
active: {}
|
|
89
|
-
}),
|
|
90
|
+
}), D = b(null), O = b(null), k = b(!1), Ne = (e) => e.flatMap((e) => e.type === u ? [] : e.type === d ? Ne(e.children) : e.type === f && !String(e.children).trim() ? [] : [e]), Pe = /* @__PURE__ */ new WeakMap(), Fe = 0, Ie = (e) => {
|
|
90
91
|
let t = /* @__PURE__ */ new Map();
|
|
91
92
|
return e.map((e) => {
|
|
92
|
-
if (typeof e == "object" && e) return
|
|
93
|
+
if (typeof e == "object" && e) return Pe.has(e) || Pe.set(e, ++Fe), `o${Pe.get(e)}`;
|
|
93
94
|
let n = (t.get(e) ?? 0) + 1;
|
|
94
95
|
return t.set(e, n), `${typeof e}:${String(e)}:${n}`;
|
|
95
96
|
});
|
|
96
|
-
},
|
|
97
|
-
let { items: e } =
|
|
97
|
+
}, Le = () => {
|
|
98
|
+
let { items: e } = S;
|
|
98
99
|
if (typeof e == "number") return Array.from({ length: Math.max(0, Math.floor(e)) }, (e, t) => ({
|
|
99
100
|
key: t,
|
|
100
101
|
item: t
|
|
101
102
|
}));
|
|
102
103
|
if (e) {
|
|
103
|
-
let t =
|
|
104
|
+
let t = Ie(e);
|
|
104
105
|
return e.map((e, n) => ({
|
|
105
106
|
key: t[n],
|
|
106
107
|
item: e
|
|
107
108
|
}));
|
|
108
109
|
}
|
|
109
|
-
return
|
|
110
|
+
return Ne(C.default?.() ?? []).map((e, t) => ({
|
|
110
111
|
key: e.key ?? t,
|
|
111
112
|
node: e
|
|
112
113
|
}));
|
|
113
|
-
},
|
|
114
|
+
}, Re = (e) => {
|
|
114
115
|
let t = e.map((e, t) => ({
|
|
115
116
|
...e,
|
|
116
117
|
real: t,
|
|
117
118
|
clone: !1
|
|
118
|
-
})), n = Math.min(
|
|
119
|
+
})), n = Math.min(N.value, e.length);
|
|
119
120
|
if (!n) return t;
|
|
120
121
|
let r = (e, t, n) => ({
|
|
121
122
|
key: `${n}${String(e.key)}`,
|
|
122
|
-
node: e.node ?
|
|
123
|
+
node: e.node ? te(e.node) : void 0,
|
|
123
124
|
item: e.item,
|
|
124
125
|
real: t,
|
|
125
126
|
clone: !0
|
|
@@ -129,7 +130,7 @@ var ye = ["aria-label", "aria-roledescription"], be = ["aria-label"], xe = ["ari
|
|
|
129
130
|
...t,
|
|
130
131
|
...e.slice(0, n).map((e, t) => r(e, t, ">"))
|
|
131
132
|
];
|
|
132
|
-
},
|
|
133
|
+
}, A = (e) => {
|
|
133
134
|
if (typeof e == "string") return {
|
|
134
135
|
src: e,
|
|
135
136
|
alt: ""
|
|
@@ -142,136 +143,136 @@ var ye = ["aria-label", "aria-roledescription"], be = ["aria-label"], xe = ["ari
|
|
|
142
143
|
sizes: a(r),
|
|
143
144
|
alt: i == null ? "" : String(i)
|
|
144
145
|
};
|
|
145
|
-
},
|
|
146
|
-
let n =
|
|
147
|
-
return n.trim() ? n :
|
|
148
|
-
},
|
|
149
|
-
let e =
|
|
150
|
-
if (!
|
|
146
|
+
}, ze = (e, t) => {
|
|
147
|
+
let n = A(e)?.alt ?? "";
|
|
148
|
+
return n.trim() ? n : T("carousel.goTo", t + 1).value;
|
|
149
|
+
}, Be = b(1), j = b(0), M = b(0), N = b(0), P = b(w.value), Ve = b(0), He = b(0), Ue = 0, F = b(!1), We = b(0), Ge = b(!1), Ke = () => Math.max(1, Math.floor(Be.value + .01)), qe = () => F.value || S.picker ? 1 : Ke(), I = p(() => {
|
|
150
|
+
let e = j.value, t = qe(), n = [];
|
|
151
|
+
if (!M.value) return n;
|
|
151
152
|
for (let r = 0; r < e; r += t) {
|
|
152
|
-
let e =
|
|
153
|
+
let e = U() ? r : Math.min(r, M.value - 1);
|
|
153
154
|
n.length && n[n.length - 1].start === e || n.push({
|
|
154
155
|
start: e,
|
|
155
156
|
first: r
|
|
156
157
|
});
|
|
157
158
|
}
|
|
158
159
|
return n;
|
|
159
|
-
}),
|
|
160
|
+
}), Je = p(() => new Set(I.value.map((e) => e.start))), L = () => I.value.length, Ye = (e) => {
|
|
160
161
|
let t = 0;
|
|
161
|
-
return
|
|
162
|
+
return I.value.forEach((n, r) => {
|
|
162
163
|
n.first <= e && (t = r);
|
|
163
164
|
}), t;
|
|
164
|
-
},
|
|
165
|
-
if (
|
|
166
|
-
let t = Math.floor((
|
|
167
|
-
return
|
|
165
|
+
}, Xe = (e) => {
|
|
166
|
+
if (S.picker && !F.value) {
|
|
167
|
+
let t = Math.floor((Ke() - 1) / 2), n = j.value;
|
|
168
|
+
return U() ? ((e - t) % n + n) % n : Math.min(Math.max(e - t, 0), M.value - 1);
|
|
168
169
|
}
|
|
169
|
-
return
|
|
170
|
-
},
|
|
171
|
-
let n =
|
|
172
|
-
if (
|
|
173
|
-
let r =
|
|
174
|
-
if (
|
|
170
|
+
return I.value[Ye(e)]?.start ?? 0;
|
|
171
|
+
}, Ze = (e) => N.value ? Je.value.has(Y(e)) : Je.value.has(e), Qe = (e, t) => {
|
|
172
|
+
let n = j.value;
|
|
173
|
+
if (F.value) return t === e;
|
|
174
|
+
let r = Ke();
|
|
175
|
+
if (U()) return ((t - e) % n + n) % n < r;
|
|
175
176
|
let i = Math.min(e, Math.max(0, n - r));
|
|
176
177
|
return t >= i && t < i + r;
|
|
177
|
-
},
|
|
178
|
-
let e =
|
|
179
|
-
return e >= 0 &&
|
|
180
|
-
},
|
|
181
|
-
let n =
|
|
182
|
-
for (let r = e + t; r >= 0 && r <= n; r += t) if (
|
|
178
|
+
}, $e = () => {
|
|
179
|
+
let e = I.value.findIndex((e) => e.start === w.value);
|
|
180
|
+
return e >= 0 && Qe(w.value, g.value) ? e : Ye(g.value);
|
|
181
|
+
}, et = (e) => S.picker || Qe(e, g.value) ? g.value : I.value.find((t) => t.start === e)?.first ?? e, tt = (e, t) => {
|
|
182
|
+
let n = N.value ? R().length - 1 : M.value - 1;
|
|
183
|
+
for (let r = e + t; r >= 0 && r <= n; r += t) if (Ze(r)) return r;
|
|
183
184
|
return e;
|
|
184
|
-
},
|
|
185
|
-
if (!
|
|
186
|
-
|
|
187
|
-
let e =
|
|
188
|
-
if (
|
|
189
|
-
|
|
190
|
-
let t =
|
|
191
|
-
|
|
192
|
-
let n =
|
|
193
|
-
if (Math.abs(n -
|
|
185
|
+
}, nt = () => F.value ? Math.floor((Be.value - 1) / 2 + .01) : 0, rt = () => F.value ? 1 + 2 * nt() : Ke(), R = () => Array.from(O.value?.children ?? []), z = (e) => R()[e + N.value], it = () => !!D.value && getComputedStyle(D.value).direction === "rtl", B = (e) => it() ? e.offsetLeft + e.offsetWidth - O.value.clientWidth + Ue : e.offsetLeft - Ue, at = () => O.value ? O.value.scrollWidth - O.value.clientWidth : 0, ot = () => !O.value || O.value.clientWidth === 0, st = "", ct = !1, lt = () => {
|
|
186
|
+
if (!D.value || !O.value) return;
|
|
187
|
+
$n();
|
|
188
|
+
let e = R().length - 2 * N.value;
|
|
189
|
+
if (j.value = Math.max(0, e), ot()) return;
|
|
190
|
+
Be.value = Math.max(1, parseFloat(getComputedStyle(D.value).getPropertyValue("--per-view")) || 1);
|
|
191
|
+
let t = z(0);
|
|
192
|
+
F.value = getComputedStyle(D.value).getPropertyValue("--align").trim() === "center", Ge.value = parseFloat(getComputedStyle(D.value).getPropertyValue("--py")) > 0;
|
|
193
|
+
let n = F.value && t ? Math.max(0, (D.value.clientWidth - t.offsetWidth) / 2) : 0;
|
|
194
|
+
if (Math.abs(n - We.value) > .5) We.value = n, ct = !0;
|
|
194
195
|
else {
|
|
195
|
-
if (
|
|
196
|
-
let n = parseFloat(getComputedStyle(
|
|
197
|
-
|
|
198
|
-
let r = Math.min(e, Math.ceil(
|
|
199
|
-
if (r !==
|
|
200
|
-
|
|
196
|
+
if (Ue = parseFloat(getComputedStyle(O.value).scrollPaddingInlineStart) || 0, S.loop && e > Ke() && t) {
|
|
197
|
+
let n = parseFloat(getComputedStyle(O.value).columnGap) || 0;
|
|
198
|
+
Nt = t.offsetWidth + n;
|
|
199
|
+
let r = Math.min(e, Math.ceil(O.value.clientWidth / Math.max(1, Nt)) + 2);
|
|
200
|
+
if (r !== N.value) {
|
|
201
|
+
N.value = r, ct = !0;
|
|
201
202
|
return;
|
|
202
203
|
}
|
|
203
|
-
} else if (
|
|
204
|
-
|
|
204
|
+
} else if (N.value) {
|
|
205
|
+
N.value = 0, ct = !0;
|
|
205
206
|
return;
|
|
206
207
|
}
|
|
207
|
-
if (
|
|
208
|
+
if (S.loop && N.value) M.value = e;
|
|
208
209
|
else {
|
|
209
|
-
let t =
|
|
210
|
-
|
|
210
|
+
let t = at(), n = R().slice(0, e).findIndex((e) => Math.abs(B(e)) >= t - 1);
|
|
211
|
+
M.value = e === 0 ? 0 : n === -1 ? e : n + 1;
|
|
211
212
|
}
|
|
212
|
-
if (
|
|
213
|
-
let t =
|
|
214
|
-
n !== t &&
|
|
213
|
+
if (M.value && w.value > M.value - 1 && qt(M.value - 1), e > 0) {
|
|
214
|
+
let t = g.value, n = Number.isFinite(t) ? Math.min(Math.max(Math.round(t), 0), e - 1) : 0;
|
|
215
|
+
n !== t && J(n);
|
|
215
216
|
}
|
|
216
217
|
}
|
|
217
|
-
},
|
|
218
|
-
if (
|
|
219
|
-
if (
|
|
220
|
-
if (
|
|
221
|
-
|
|
218
|
+
}, V = () => {
|
|
219
|
+
if (ct = !1, lt(), ct) return void v(V);
|
|
220
|
+
if (ot() || Q.value) return;
|
|
221
|
+
if (K()) return void (Ot = !0);
|
|
222
|
+
W === null && (P.value = w.value + N.value);
|
|
222
223
|
let e = [
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
j.value,
|
|
226
|
-
Re.value,
|
|
227
|
-
ze.value,
|
|
228
|
-
k.value,
|
|
229
|
-
A.value,
|
|
224
|
+
O.value.clientWidth,
|
|
225
|
+
Be.value,
|
|
230
226
|
N.value,
|
|
231
|
-
Ve.value
|
|
227
|
+
Ve.value,
|
|
228
|
+
He.value,
|
|
229
|
+
j.value,
|
|
230
|
+
M.value,
|
|
231
|
+
F.value,
|
|
232
|
+
We.value
|
|
232
233
|
].join();
|
|
233
|
-
if (e ===
|
|
234
|
-
if (!
|
|
235
|
-
|
|
236
|
-
let t = !
|
|
237
|
-
|
|
238
|
-
},
|
|
234
|
+
if (e === st) return;
|
|
235
|
+
if (!I.value.length) return void Xt(w.value);
|
|
236
|
+
st = e;
|
|
237
|
+
let t = !S.picker && Je.value.has(w.value) && Qe(w.value, g.value) ? w.value : Xe(g.value);
|
|
238
|
+
qt(t), Xt(t);
|
|
239
|
+
}, ut = p(() => Y(P.value)), dt = p(() => {
|
|
239
240
|
let e = 0;
|
|
240
|
-
return
|
|
241
|
-
t.start <=
|
|
241
|
+
return I.value.forEach((t, n) => {
|
|
242
|
+
t.start <= ut.value && (e = n);
|
|
242
243
|
}), e;
|
|
243
|
-
}),
|
|
244
|
-
if (!
|
|
245
|
-
let t =
|
|
246
|
-
return
|
|
247
|
-
},
|
|
248
|
-
if (!
|
|
244
|
+
}), ft = p(() => et(ut.value)), pt = (e) => {
|
|
245
|
+
if (!k.value) return !0;
|
|
246
|
+
let t = j.value, n = e - ut.value;
|
|
247
|
+
return U() && (n = (n % t + t) % t, n > t / 2 && (n -= t)), n >= -nt() && n < rt() - nt();
|
|
248
|
+
}, H = (e) => k.value ? e === ft.value : e === g.value, mt = (e, t) => {
|
|
249
|
+
if (!k.value) return !1;
|
|
249
250
|
if (t) return !0;
|
|
250
|
-
let n =
|
|
251
|
+
let n = w.value - nt(), r = n + rt();
|
|
251
252
|
if (e >= n && e < r) return !1;
|
|
252
|
-
if (!(
|
|
253
|
-
let i =
|
|
253
|
+
if (!(S.loop && N.value > 0)) return !0;
|
|
254
|
+
let i = j.value;
|
|
254
255
|
return !(e + i < r || e - i >= n);
|
|
255
|
-
},
|
|
256
|
-
if (!
|
|
257
|
-
let t =
|
|
256
|
+
}, ht = () => L() > 7, gt = () => Math.min(Math.max(dt.value - 3, 0), L() - 7), _t = (e) => !ht() || e >= gt() && e < gt() + 7, vt = (e) => {
|
|
257
|
+
if (!ht()) return;
|
|
258
|
+
let t = gt(), n = t + 7 - 1, r = Math.min(t > 0 ? e - t : Infinity, n < L() - 1 ? n - e : Infinity);
|
|
258
259
|
if (r === 0) return "bb-carousel__dot--far";
|
|
259
260
|
if (r === 1) return "bb-carousel__dot--near";
|
|
260
|
-
},
|
|
261
|
-
let e =
|
|
262
|
-
return !e || !(
|
|
263
|
-
},
|
|
264
|
-
let t = 1 +
|
|
265
|
-
return e >= r && e <= i ? !0 : !
|
|
266
|
-
},
|
|
267
|
-
if (!
|
|
268
|
-
let e =
|
|
269
|
-
|
|
261
|
+
}, yt = () => {
|
|
262
|
+
let e = k.value ? z(0) : void 0;
|
|
263
|
+
return !e || !(Ve.value || He.value) ? 0 : Math.ceil(Math.max(Ve.value, He.value) / Math.max(1, e.offsetWidth));
|
|
264
|
+
}, bt = (e) => {
|
|
265
|
+
let t = 1 + yt(), n = F.value ? Math.ceil((Be.value - 1) / 2) : 0, r = w.value - n - t, i = F.value ? w.value + n + t : w.value + Math.ceil(Be.value - .01) - 1 + t;
|
|
266
|
+
return e >= r && e <= i ? !0 : !S.loop || !j.value ? !1 : e - j.value >= r || e + j.value <= i;
|
|
267
|
+
}, xt = () => Array.isArray(S.items) && S.items.length > 0 && !C.slide && !C["slide:header"] && !C["slide:footer"] && S.items.every((e) => A(e) !== void 0), U = () => !!S.loop && N.value > 0, St = () => S.loop || (S.picker ? g.value : $e()) > 0, Ct = () => S.loop || (S.picker ? g.value < j.value - 1 : $e() < L() - 1), wt = () => typeof window < "u" && !!window.matchMedia?.("(prefers-reduced-motion: reduce)").matches, W = null, Tt = !1, Et = b(""), Dt = !1, Ot = !1, G = [], K = () => G.length > 0, kt = 0, At = 0, jt = 300, Mt = .4, Nt = 0, Pt = [], Ft = {}, It = () => {
|
|
268
|
+
if (!K()) return;
|
|
269
|
+
let e = G[0].currentTime, t = new Set(G.map((e) => e.effect.target));
|
|
270
|
+
R().forEach((n) => {
|
|
270
271
|
if (t.has(n)) return;
|
|
271
|
-
let r = n.animate(
|
|
272
|
-
r.currentTime = e,
|
|
272
|
+
let r = n.animate(Pt, Ft);
|
|
273
|
+
r.currentTime = e, G.push(r);
|
|
273
274
|
});
|
|
274
|
-
},
|
|
275
|
+
}, Lt = (e, t) => {
|
|
275
276
|
let n = (e) => .75 * e * (1 - e) + e ** 3, r = (e) => .75 * (1 - 2 * e) + 3 * e * e, i = e;
|
|
276
277
|
for (let t = 0; t < 8; t++) {
|
|
277
278
|
let t = n(i) - e;
|
|
@@ -289,210 +290,210 @@ var ye = ["aria-label", "aria-roledescription"], be = ["aria-label"], xe = ["ari
|
|
|
289
290
|
p: o,
|
|
290
291
|
slope: r(i) > 1e-6 ? s / r(i) : t
|
|
291
292
|
};
|
|
292
|
-
},
|
|
293
|
-
if (!
|
|
294
|
-
let e = getComputedStyle(
|
|
293
|
+
}, Rt = () => {
|
|
294
|
+
if (!D.value) return 300;
|
|
295
|
+
let e = getComputedStyle(D.value).getPropertyValue("--speed").trim(), t = parseFloat(e);
|
|
295
296
|
return Number.isFinite(t) ? e.endsWith("ms") ? t : e.endsWith("s") ? t * 1e3 : t : 300;
|
|
296
|
-
},
|
|
297
|
-
|
|
298
|
-
},
|
|
299
|
-
let e = Math.min(1, Math.max(0, Number(
|
|
297
|
+
}, q = (e) => {
|
|
298
|
+
O.value && (O.value.style.scrollSnapType = e ? "none" : "");
|
|
299
|
+
}, zt = () => {
|
|
300
|
+
let e = Math.min(1, Math.max(0, Number(G[0]?.currentTime ?? jt) / jt)), t = Lt(e, Mt);
|
|
300
301
|
return {
|
|
301
|
-
at:
|
|
302
|
-
speed: (
|
|
302
|
+
at: kt + (At - kt) * t.p,
|
|
303
|
+
speed: (At - kt) * t.slope / (jt / 1e3)
|
|
303
304
|
};
|
|
304
|
-
}, Lt = () => {
|
|
305
|
-
let e = U;
|
|
306
|
-
U = [], e.forEach((e) => e.cancel());
|
|
307
|
-
}, Rt = () => {
|
|
308
|
-
Lt(), wt = !1, G(!1);
|
|
309
|
-
}, zt = () => {
|
|
310
|
-
if (!W() || !E.value) return;
|
|
311
|
-
let { at: e } = It();
|
|
312
|
-
G(!0), Lt(), E.value.scrollLeft = e, wt = !0;
|
|
313
305
|
}, Bt = () => {
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
306
|
+
let e = G;
|
|
307
|
+
G = [], e.forEach((e) => e.cancel());
|
|
308
|
+
}, Vt = () => {
|
|
309
|
+
Bt(), Dt = !1, q(!1);
|
|
310
|
+
}, Ht = () => {
|
|
311
|
+
if (!K() || !O.value) return;
|
|
312
|
+
let { at: e } = zt();
|
|
313
|
+
q(!0), Bt(), O.value.scrollLeft = e, Dt = !0;
|
|
314
|
+
}, Ut = () => {
|
|
315
|
+
Ht(), W = null, Kn();
|
|
316
|
+
}, Wt = (e, t, n = 0) => {
|
|
317
|
+
let r = O.value;
|
|
317
318
|
if (!r) return;
|
|
318
|
-
let i =
|
|
319
|
-
if (
|
|
320
|
-
|
|
319
|
+
let i = at(), a = Math.sign(e) * Math.min(Math.abs(e), i), o = Rt();
|
|
320
|
+
if (wt() || o <= 0) {
|
|
321
|
+
Vt(), r.scrollTo({
|
|
321
322
|
left: a,
|
|
322
323
|
behavior: "instant"
|
|
323
324
|
});
|
|
324
325
|
return;
|
|
325
326
|
}
|
|
326
|
-
if (
|
|
327
|
-
let s =
|
|
328
|
-
if (
|
|
327
|
+
if (K() && Math.abs(a - At) < .5 && !n) return;
|
|
328
|
+
let s = K() ? zt() : null, c = (s ? s.at : r.scrollLeft) + n, ee = s ? s.speed : t ?? 0, l = a - c;
|
|
329
|
+
if (Bt(), Dt = !1, q(!0), Math.abs(a - r.scrollLeft) >= .5 && r.scrollTo({
|
|
329
330
|
left: a,
|
|
330
331
|
behavior: "instant"
|
|
331
|
-
}), Math.abs(
|
|
332
|
-
|
|
332
|
+
}), Math.abs(l) < .5) {
|
|
333
|
+
q(!1), X();
|
|
333
334
|
return;
|
|
334
335
|
}
|
|
335
|
-
|
|
336
|
+
kt = c, At = a, jt = o, Mt = Math.min(4, Math.max(.4, o / 1e3 * ee / l)), Pt = [{ translate: `${l}px 0` }, { translate: "0px 0" }], Ft = {
|
|
336
337
|
duration: o,
|
|
337
|
-
easing: `cubic-bezier(0.25, ${(.25 *
|
|
338
|
+
easing: `cubic-bezier(0.25, ${(.25 * Mt).toFixed(4)}, 0.25, 1)`
|
|
338
339
|
};
|
|
339
|
-
let
|
|
340
|
-
s &&
|
|
341
|
-
|
|
340
|
+
let u = R().map((e) => e.animate(Pt, Ft)), d = document.timeline?.currentTime;
|
|
341
|
+
s && d != null && u.forEach((e) => e.startTime = Number(d)), G = u, u[0].onfinish = () => {
|
|
342
|
+
G === u && (G = [], q(!1), X(), Ot && (Ot = !1, V()));
|
|
342
343
|
};
|
|
343
|
-
},
|
|
344
|
-
if (!
|
|
345
|
-
let t =
|
|
344
|
+
}, Gt = 0, Kt = (e = O.value?.scrollLeft ?? 0) => {
|
|
345
|
+
if (!N.value || !O.value) return 0;
|
|
346
|
+
let t = j.value, n = R(), r = n[N.value], i = n[N.value + t];
|
|
346
347
|
if (!r || !i) return 0;
|
|
347
|
-
let a =
|
|
348
|
+
let a = B(r), o = B(i) - a;
|
|
348
349
|
if (!o) return 0;
|
|
349
350
|
let s = (e - a) / o, c = 0;
|
|
350
351
|
if (s >= .999 ? c = -t : s < -.001 && (c = t), !c) return 0;
|
|
351
352
|
let ee = c / t * o;
|
|
352
|
-
return
|
|
353
|
-
}, Wt = (e) => {
|
|
354
|
-
S.value = e, M.value = e + j.value;
|
|
355
|
-
}, Gt = !1, Kt = null, K = (e) => {
|
|
356
|
-
e !== m.value && (Gt = !0, Kt = e, m.value = e, Gt = !1);
|
|
353
|
+
return Gt = c, O.value.scrollLeft = e + ee, P.value += c, W !== null && (W += c), ee;
|
|
357
354
|
}, qt = (e) => {
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
355
|
+
w.value = e, P.value = e + N.value;
|
|
356
|
+
}, Jt = !1, Yt = null, J = (e) => {
|
|
357
|
+
e !== g.value && (Jt = !0, Yt = e, g.value = e, Jt = !1);
|
|
358
|
+
}, Xt = (e) => {
|
|
359
|
+
let t = R()[e + N.value];
|
|
360
|
+
if (!t || !O.value) return;
|
|
361
|
+
Vt();
|
|
362
|
+
let n = B(t);
|
|
363
|
+
Math.abs(O.value.scrollLeft - n) >= 1 && O.value.scrollTo({
|
|
363
364
|
left: n,
|
|
364
365
|
behavior: "instant"
|
|
365
366
|
});
|
|
366
|
-
},
|
|
367
|
-
|
|
368
|
-
},
|
|
369
|
-
let n =
|
|
367
|
+
}, Zt = (e) => {
|
|
368
|
+
Un.value || (Et.value = "", v(() => Et.value = T("carousel.slideOf", (e ?? g.value) + 1, j.value).value));
|
|
369
|
+
}, Qt = (e, t = !1) => {
|
|
370
|
+
let n = I.value;
|
|
370
371
|
if (!n.length) return;
|
|
371
372
|
let r = n[Math.min(Math.max(e, 0), n.length - 1)];
|
|
372
|
-
t &&
|
|
373
|
-
},
|
|
374
|
-
let n =
|
|
373
|
+
t && Kn(), S.picker || J(r.first), en(r.start + N.value, t);
|
|
374
|
+
}, $t = (e, t = !1) => {
|
|
375
|
+
let n = j.value;
|
|
375
376
|
if (!n) return;
|
|
376
|
-
let r =
|
|
377
|
-
t &&
|
|
378
|
-
let i =
|
|
379
|
-
|
|
380
|
-
},
|
|
381
|
-
let r =
|
|
382
|
-
if (
|
|
377
|
+
let r = S.loop ? (e % n + n) % n : Math.min(Math.max(e, 0), n - 1);
|
|
378
|
+
t && Kn();
|
|
379
|
+
let i = g.value;
|
|
380
|
+
J(r), rn(r, t && r !== i);
|
|
381
|
+
}, en = (e, t, n) => {
|
|
382
|
+
let r = j.value, i = ((e - N.value) % r + r) % r;
|
|
383
|
+
if (W = e, qt(i), P.value = e, Tt = t, !O.value || !R().length) return;
|
|
383
384
|
let a = 0;
|
|
384
|
-
if (
|
|
385
|
-
let t =
|
|
386
|
-
for (; e + n <
|
|
387
|
-
for (; e + n >=
|
|
385
|
+
if (N.value) {
|
|
386
|
+
let t = j.value, n = 0;
|
|
387
|
+
for (; e + n < N.value;) n += t;
|
|
388
|
+
for (; e + n >= N.value + t;) n -= t;
|
|
388
389
|
if (n) {
|
|
389
|
-
let t =
|
|
390
|
-
r >= o - 1 && r <= s + 1 ? (e += n, a = t,
|
|
390
|
+
let t = tn(e + n) - tn(e), r = (K() ? zt().at : O.value.scrollLeft) + t, i = R(), o = Math.min(B(i[0]), B(i[i.length - 1])), s = Math.max(B(i[0]), B(i[i.length - 1]));
|
|
391
|
+
r >= o - 1 && r <= s + 1 ? (e += n, a = t, W = e, P.value = e) : e = Math.min(Math.max(e, 0), i.length - 1);
|
|
391
392
|
}
|
|
392
393
|
}
|
|
393
|
-
let o =
|
|
394
|
-
if (!
|
|
395
|
-
|
|
396
|
-
},
|
|
397
|
-
let t =
|
|
398
|
-
if (t[e]) return
|
|
399
|
-
let n = t[
|
|
400
|
-
return !n || !r ?
|
|
401
|
-
},
|
|
402
|
-
let n =
|
|
394
|
+
let o = tn(e);
|
|
395
|
+
if (!K() && Math.abs(O.value.scrollLeft - o) < 1) return Dt = !1, q(!1), an();
|
|
396
|
+
Wt(o, n, a);
|
|
397
|
+
}, tn = (e) => {
|
|
398
|
+
let t = R();
|
|
399
|
+
if (t[e]) return B(t[e]);
|
|
400
|
+
let n = t[N.value], r = t[N.value + j.value];
|
|
401
|
+
return !n || !r ? B(t[Math.max(0, Math.min(e, t.length - 1))]) : B(n) + (e - N.value) * (B(r) - B(n)) / j.value;
|
|
402
|
+
}, nn = (e, t = !0) => {
|
|
403
|
+
let n = I.value;
|
|
403
404
|
if (!n.length) return;
|
|
404
|
-
if (
|
|
405
|
-
if (t &&
|
|
406
|
-
let n =
|
|
405
|
+
if (S.picker) return $t(g.value + e, t);
|
|
406
|
+
if (t && Kn(), U()) {
|
|
407
|
+
let n = W ?? w.value + N.value;
|
|
407
408
|
do
|
|
408
409
|
n += e;
|
|
409
|
-
while (!
|
|
410
|
-
|
|
410
|
+
while (!Je.value.has(Y(n)));
|
|
411
|
+
J(Y(n)), en(n, t);
|
|
411
412
|
return;
|
|
412
413
|
}
|
|
413
|
-
let r = n.length - 1, i =
|
|
414
|
-
a < 0 && (a =
|
|
415
|
-
},
|
|
416
|
-
if (!
|
|
417
|
-
let n =
|
|
418
|
-
if (
|
|
419
|
-
t &&
|
|
414
|
+
let r = n.length - 1, i = $e(), a = i + e;
|
|
415
|
+
a < 0 && (a = S.loop ? r : 0), a > r && (a = S.loop ? 0 : r), a !== i && (Math.abs(a - i) > 1 ? (W = null, J(n[a].first), qt(n[a].start), Xt(n[a].start), t && Zt(n[a].first)) : Qt(a, t));
|
|
416
|
+
}, rn = (e, t = !1) => {
|
|
417
|
+
if (!I.value.length || Q.value || dn) return;
|
|
418
|
+
let n = Xe(e);
|
|
419
|
+
if (S.picker ? n === w.value : Qe(w.value, e)) {
|
|
420
|
+
t && Zt(e);
|
|
420
421
|
return;
|
|
421
422
|
}
|
|
422
|
-
let r = n +
|
|
423
|
-
if (
|
|
424
|
-
let e =
|
|
423
|
+
let r = n + N.value;
|
|
424
|
+
if (U()) {
|
|
425
|
+
let e = j.value, t = W ?? w.value + N.value;
|
|
425
426
|
for (let n of [r - e, r + e]) Math.abs(n - t) < Math.abs(r - t) && (r = n);
|
|
426
427
|
}
|
|
427
|
-
|
|
428
|
-
},
|
|
429
|
-
let e =
|
|
430
|
-
if (
|
|
431
|
-
let t = e -
|
|
432
|
-
(t < 0 || t >=
|
|
428
|
+
en(r, t);
|
|
429
|
+
}, an = () => {
|
|
430
|
+
let e = W;
|
|
431
|
+
if (W = null, e !== null && N.value) {
|
|
432
|
+
let t = e - N.value;
|
|
433
|
+
(t < 0 || t >= j.value) && (Xt(w.value), P.value = w.value + N.value);
|
|
433
434
|
}
|
|
434
|
-
|
|
435
|
-
},
|
|
436
|
-
if (!
|
|
437
|
-
let e =
|
|
438
|
-
if (!
|
|
439
|
-
let t =
|
|
435
|
+
Tt && Zt(), Tt = !1;
|
|
436
|
+
}, on = () => {
|
|
437
|
+
if (!O.value) return 0;
|
|
438
|
+
let e = O.value.scrollLeft;
|
|
439
|
+
if (!N.value && Math.abs(e) >= at() - 1) return I.value[I.value.length - 1]?.start ?? M.value - 1;
|
|
440
|
+
let t = R(), n = -1;
|
|
440
441
|
return t.forEach((r, i) => {
|
|
441
|
-
|
|
442
|
+
Ze(i) && (n < 0 || Math.abs(B(r) - e) < Math.abs(B(t[n]) - e)) && (n = i);
|
|
442
443
|
}), Math.max(0, n);
|
|
443
|
-
},
|
|
444
|
-
let t =
|
|
445
|
-
return t ? ((e -
|
|
446
|
-
},
|
|
447
|
-
if (clearTimeout(
|
|
448
|
-
if (
|
|
449
|
-
if (
|
|
450
|
-
let e =
|
|
451
|
-
|
|
444
|
+
}, Y = (e) => {
|
|
445
|
+
let t = j.value;
|
|
446
|
+
return t ? ((e - N.value) % t + t) % t : 0;
|
|
447
|
+
}, X = () => {
|
|
448
|
+
if (clearTimeout(Z), sn = !1, !O.value || !M.value || dn || K()) return;
|
|
449
|
+
if (Dt) {
|
|
450
|
+
if (Q.value) return;
|
|
451
|
+
let e = on(), t = et(Y(e)), n = t !== g.value;
|
|
452
|
+
J(t), en(e, n);
|
|
452
453
|
return;
|
|
453
454
|
}
|
|
454
|
-
let e =
|
|
455
|
-
if (
|
|
456
|
-
let t =
|
|
455
|
+
let e = O.value.scrollLeft;
|
|
456
|
+
if (W !== null) {
|
|
457
|
+
let t = tn(W), n = Math.sign(t) * Math.min(Math.abs(t), at());
|
|
457
458
|
if (Math.abs(n - e) > 1) return;
|
|
458
|
-
|
|
459
|
+
an();
|
|
459
460
|
return;
|
|
460
461
|
}
|
|
461
|
-
let t =
|
|
462
|
-
|
|
463
|
-
let r =
|
|
464
|
-
|
|
465
|
-
},
|
|
466
|
-
|
|
467
|
-
},
|
|
468
|
-
clearTimeout(
|
|
469
|
-
|
|
462
|
+
let t = on(), n = Y(t);
|
|
463
|
+
N.value && (t < N.value || t >= N.value + j.value) && Xt(n);
|
|
464
|
+
let r = et(n);
|
|
465
|
+
qt(n), r !== g.value && (J(r), Zt(r)), Kn();
|
|
466
|
+
}, Z, sn = !1, cn = () => {
|
|
467
|
+
sn || X();
|
|
468
|
+
}, ln = 0, un = () => {
|
|
469
|
+
clearTimeout(Z), Z = setTimeout(X, 150), W !== null || ln || (ln = requestAnimationFrame(() => {
|
|
470
|
+
ln = 0, W === null && M.value && (P.value = on());
|
|
470
471
|
}));
|
|
471
472
|
};
|
|
472
|
-
|
|
473
|
-
if (
|
|
474
|
-
if (e ===
|
|
475
|
-
let t =
|
|
473
|
+
ge(g, (e) => {
|
|
474
|
+
if (Jt || !k.value) return;
|
|
475
|
+
if (e === Yt) return void (Yt = null);
|
|
476
|
+
let t = j.value;
|
|
476
477
|
if (!t) return;
|
|
477
478
|
let n = Number.isFinite(e) ? Math.min(Math.max(Math.round(e), 0), t - 1) : 0;
|
|
478
|
-
n !== e &&
|
|
479
|
-
}, { flush: "sync" }),
|
|
479
|
+
n !== e && J(n), rn(n);
|
|
480
|
+
}, { flush: "sync" }), ge(w, () => {
|
|
480
481
|
let e = document.activeElement;
|
|
481
|
-
e &&
|
|
482
|
-
document.activeElement === e && (e.closest("[inert]") || !e.isConnected) &&
|
|
482
|
+
e && D.value?.contains(e) && (e.classList.contains("bb-carousel__dot") ? v(() => D.value?.querySelectorAll(".bb-carousel__dot")[dt.value]?.focus({ preventScroll: !0 })) : e.closest(".bb-carousel__slide") && v(() => {
|
|
483
|
+
document.activeElement === e && (e.closest("[inert]") || !e.isConnected) && O.value?.focus({ preventScroll: !0 });
|
|
483
484
|
}));
|
|
484
485
|
});
|
|
485
|
-
let
|
|
486
|
-
|
|
487
|
-
},
|
|
488
|
-
|
|
489
|
-
},
|
|
490
|
-
|
|
491
|
-
},
|
|
492
|
-
if (!
|
|
493
|
-
|
|
494
|
-
let t =
|
|
495
|
-
e.target.closest?.("input, select, option, textarea, video, [contenteditable]") || !
|
|
486
|
+
let dn = !1, fn = (e) => {
|
|
487
|
+
dn = e, D.value?.classList.toggle("bb-carousel--dragging", e);
|
|
488
|
+
}, Q = b(!1), $ = null, pn = null, mn = !1, hn = !1, gn = (e) => e.target?.closest?.(".bb-carousel__track") === O.value, _n = (e) => {
|
|
489
|
+
gn(e) && (Math.abs(e.deltaX) <= Math.abs(e.deltaY) && !e.shiftKey || (K() && (sn = !0, clearTimeout(Z), Z = setTimeout(X, 150)), Ut()));
|
|
490
|
+
}, vn = "mouse", yn = (e) => {
|
|
491
|
+
gn(e) && vn === "mouse" && (e.button !== 0 || L() < 2 || e.target.closest?.("input, select, option, textarea, button, video, label, [contenteditable]") || (e.preventDefault(), O.value && (O.value.dataset.pointer = "", O.value.focus({ preventScroll: !0 }))));
|
|
492
|
+
}, bn = (e) => {
|
|
493
|
+
if (!gn(e) || !e.isPrimary) return;
|
|
494
|
+
vn = e.pointerType, ($ || pn !== null) && (mn = !1, wn(void 0, !0)), hn = !1;
|
|
495
|
+
let t = W ?? w.value + N.value;
|
|
496
|
+
e.target.closest?.("input, select, option, textarea, video, [contenteditable]") || !O.value || L() < 2 || (e.pointerType !== "mouse" || e.button === 0) && (e.pointerType !== "mouse" && Ut(), Q.value = !0, window.addEventListener("pointermove", xn), window.addEventListener("pointerup", Sn), window.addEventListener("pointercancel", Cn), e.pointerType !== "mouse" && !U() ? pn = e.pointerId : $ = {
|
|
496
497
|
pointerId: e.pointerId,
|
|
497
498
|
pointerType: e.pointerType,
|
|
498
499
|
x: e.clientX,
|
|
@@ -504,141 +505,141 @@ var ye = ["aria-label", "aria-roledescription"], be = ["aria-label"], xe = ["ari
|
|
|
504
505
|
start: 0,
|
|
505
506
|
t0: e.timeStamp
|
|
506
507
|
});
|
|
507
|
-
},
|
|
508
|
-
if (
|
|
509
|
-
let t = e.clientX -
|
|
510
|
-
if (
|
|
511
|
-
if (
|
|
512
|
-
|
|
508
|
+
}, xn = (e) => {
|
|
509
|
+
if (!$ || !O.value || e.pointerId !== $.pointerId) return;
|
|
510
|
+
let t = e.clientX - $.x;
|
|
511
|
+
if (!$.moved && Math.abs(t) < 5) return;
|
|
512
|
+
if (!$.moved) {
|
|
513
|
+
$.moved = !0, $.x = e.clientX, Ut(), Dt = !0, q(!0), $.left = $.start = O.value.scrollLeft, $.samples = [{
|
|
513
514
|
t: e.timeStamp,
|
|
514
|
-
left:
|
|
515
|
-
}],
|
|
515
|
+
left: $.left
|
|
516
|
+
}], fn(!0);
|
|
516
517
|
return;
|
|
517
518
|
}
|
|
518
519
|
let n = typeof e.getCoalescedEvents == "function" ? e.getCoalescedEvents() : [];
|
|
519
|
-
for (let t of n.length ? n : [e])
|
|
520
|
+
for (let t of n.length ? n : [e]) $.samples.push({
|
|
520
521
|
t: t.timeStamp,
|
|
521
|
-
left:
|
|
522
|
+
left: $.left - (t.clientX - $.x)
|
|
522
523
|
});
|
|
523
|
-
let r =
|
|
524
|
-
|
|
525
|
-
let i =
|
|
526
|
-
i && (
|
|
524
|
+
let r = $.samples[$.samples.length - 1];
|
|
525
|
+
$.samples = $.samples.filter((e) => r.t - e.t <= 250), $.v = c($.samples), O.value.scrollLeft = r.left;
|
|
526
|
+
let i = Kt();
|
|
527
|
+
i && ($.left += i, $.start += i, $.from += Gt, $.samples = $.samples.map((e) => ({
|
|
527
528
|
t: e.t,
|
|
528
529
|
left: e.left + i
|
|
529
530
|
})));
|
|
530
|
-
},
|
|
531
|
-
if (e && e.pointerId !==
|
|
532
|
-
if (t && e && e.pointerId ===
|
|
533
|
-
window.removeEventListener("pointermove",
|
|
531
|
+
}, Sn = (e) => wn(e, !1), Cn = (e) => wn(e, !0), wn = (e, t) => {
|
|
532
|
+
if (e && e.pointerId !== $?.pointerId && e.pointerId !== pn) return;
|
|
533
|
+
if (t && e && e.pointerId === pn && e.pointerType === "touch") {
|
|
534
|
+
window.removeEventListener("pointermove", xn), window.removeEventListener("pointerup", Sn), window.removeEventListener("pointercancel", Cn), pn = null, mn = !0;
|
|
534
535
|
return;
|
|
535
536
|
}
|
|
536
|
-
window.removeEventListener("pointermove",
|
|
537
|
-
let n =
|
|
538
|
-
if (
|
|
537
|
+
window.removeEventListener("pointermove", xn), window.removeEventListener("pointerup", Sn), window.removeEventListener("pointercancel", Cn), Q.value = !1;
|
|
538
|
+
let n = $;
|
|
539
|
+
if ($ = null, pn = null, !O.value) return;
|
|
539
540
|
if (!n?.moved) {
|
|
540
|
-
e && e.pointerType !== "mouse" && (
|
|
541
|
+
e && e.pointerType !== "mouse" && (Kn(), clearTimeout(Z), Z = setTimeout(X, 150));
|
|
541
542
|
return;
|
|
542
543
|
}
|
|
543
544
|
let r = n.samples[n.samples.length - 1];
|
|
544
545
|
e && !t && (n.samples.push({
|
|
545
546
|
t: e.timeStamp,
|
|
546
547
|
left: n.left - (e.clientX - n.x)
|
|
547
|
-
}), n.v = c(n.samples)), (t || e && r && e.timeStamp - r.t > 80) && (n.v = 0),
|
|
548
|
-
let i =
|
|
548
|
+
}), n.v = c(n.samples)), (t || e && r && e.timeStamp - r.t > 80) && (n.v = 0), hn = !t, fn(!1);
|
|
549
|
+
let i = O.value.scrollLeft, a = i - n.start, o = it() ? -1 : 1, s = Math.sign(a) * o, l = ee({
|
|
549
550
|
moved: a,
|
|
550
551
|
durationMs: (e?.timeStamp ?? n.t0) - n.t0,
|
|
551
552
|
velocity: n.v,
|
|
552
553
|
cancelled: t
|
|
553
|
-
}),
|
|
554
|
-
if (
|
|
555
|
-
let e = (i - R(
|
|
556
|
-
|
|
554
|
+
}), u = l.speed, d = l.quick, f = on();
|
|
555
|
+
if (d && s) {
|
|
556
|
+
let e = (i - B(R()[f])) * o;
|
|
557
|
+
f = tt((s > 0 ? e < 0 : e > 0) ? tt(f, -s) : f, s);
|
|
557
558
|
}
|
|
558
|
-
Math.sign(
|
|
559
|
-
},
|
|
560
|
-
if (e.target.closest?.(".bb-carousel") !==
|
|
561
|
-
if (
|
|
562
|
-
|
|
559
|
+
Math.sign(u) !== Math.sign(tn(f) - i) && (u = 0), J(et(Y(f))), en(f, !0, u);
|
|
560
|
+
}, Tn = (e) => {
|
|
561
|
+
if (e.target.closest?.(".bb-carousel") !== D.value) return;
|
|
562
|
+
if (hn) {
|
|
563
|
+
hn = !1, e.preventDefault(), e.stopPropagation();
|
|
563
564
|
return;
|
|
564
565
|
}
|
|
565
|
-
if (
|
|
566
|
+
if (K() || !D.value || !O.value) return;
|
|
566
567
|
let t = (e) => {
|
|
567
|
-
if (
|
|
568
|
-
|
|
568
|
+
if (S.picker || F.value) return $t(Y(e), !0);
|
|
569
|
+
Y(e) !== g.value && (J(Y(e)), Zt(Y(e)));
|
|
569
570
|
};
|
|
570
|
-
if (e.target !==
|
|
571
|
+
if (e.target !== O.value) {
|
|
571
572
|
let n = e.target.closest?.(".bb-carousel__slide");
|
|
572
|
-
for (; n && n.parentElement !==
|
|
573
|
-
let r = n ?
|
|
573
|
+
for (; n && n.parentElement !== O.value;) n = n.parentElement?.closest(".bb-carousel__slide") ?? null;
|
|
574
|
+
let r = n ? R().indexOf(n) : -1;
|
|
574
575
|
r >= 0 && !n.hasAttribute("inert") && t(r);
|
|
575
576
|
return;
|
|
576
577
|
}
|
|
577
|
-
let n =
|
|
578
|
+
let n = R(), r = n.findIndex((t) => {
|
|
578
579
|
let n = t.getBoundingClientRect();
|
|
579
580
|
return e.clientX >= n.left && e.clientX <= n.right;
|
|
580
581
|
});
|
|
581
582
|
if (r < 0 || !n[r].hasAttribute("inert")) return;
|
|
582
|
-
let i =
|
|
583
|
+
let i = D.value.getBoundingClientRect(), a = n[r].getBoundingClientRect();
|
|
583
584
|
if (a.left >= i.left - 1 && a.right <= i.right + 1) return t(r);
|
|
584
|
-
if (getComputedStyle(
|
|
585
|
-
if (
|
|
585
|
+
if (getComputedStyle(D.value).getPropertyValue("--peek-click").trim() === "off") return;
|
|
586
|
+
if (S.picker) return $t(Y(r), !0);
|
|
586
587
|
let o = r;
|
|
587
|
-
for (; o > 0 && !
|
|
588
|
-
|
|
589
|
-
},
|
|
590
|
-
|
|
591
|
-
},
|
|
592
|
-
|
|
593
|
-
},
|
|
594
|
-
if (delete
|
|
588
|
+
for (; o > 0 && !Ze(o);) o--;
|
|
589
|
+
N.value || (o = Xe(r)), J(Y(r)), en(o, !0);
|
|
590
|
+
}, En = (e) => {
|
|
591
|
+
gn(e) && ($ || pn !== null || mn || e.touches.length && (mn = !0, Q.value = !0, Ut()));
|
|
592
|
+
}, Dn = (e) => {
|
|
593
|
+
mn && !e.touches.length && (mn = !1, Q.value = !1, Kn(), clearTimeout(Z), Z = setTimeout(X, 150));
|
|
594
|
+
}, On = (e) => e instanceof HTMLElement && (e.isContentEditable || /^(INPUT|TEXTAREA|SELECT)$/.test(e.tagName)), kn = (e) => {
|
|
595
|
+
if (delete O.value?.dataset.pointer, On(e.target) || e.altKey || e.ctrlKey || e.metaKey) return;
|
|
595
596
|
let t = e.target, n = !!t.closest?.(".bb-carousel__slide");
|
|
596
|
-
if (n && (e.defaultPrevented || t.closest(".bb-carousel") !==
|
|
597
|
-
let r =
|
|
598
|
-
if (e.key === r)
|
|
599
|
-
else if (e.key === i)
|
|
600
|
-
else if (e.key === "Home")
|
|
601
|
-
else if (e.key === "End")
|
|
597
|
+
if (n && (e.defaultPrevented || t.closest(".bb-carousel") !== D.value || t.closest("audio, video, [role=\"slider\"], [role=\"spinbutton\"], [role=\"tablist\"], [role=\"tab\"], [role=\"menu\"], [role=\"menubar\"], [role=\"menuitem\"], [role=\"listbox\"], [role=\"option\"], [role=\"radiogroup\"], [role=\"radio\"], [role=\"grid\"], [role=\"tree\"], [role=\"combobox\"], [role=\"toolbar\"]"))) return;
|
|
598
|
+
let r = it() ? "ArrowLeft" : "ArrowRight", i = it() ? "ArrowRight" : "ArrowLeft", a = S.picker ? j.value - 1 : L() - 1;
|
|
599
|
+
if (e.key === r) nn(1);
|
|
600
|
+
else if (e.key === i) nn(-1);
|
|
601
|
+
else if (e.key === "Home") S.picker ? $t(0, !0) : Qt(0, !0);
|
|
602
|
+
else if (e.key === "End") S.picker ? $t(a, !0) : Qt(a, !0);
|
|
602
603
|
else return;
|
|
603
|
-
e.preventDefault(), n &&
|
|
604
|
-
},
|
|
605
|
-
|
|
604
|
+
e.preventDefault(), n && v(() => z(g.value)?.querySelector("a[href], button, input, select, textarea, [tabindex]:not([tabindex=\"-1\"])")?.focus({ preventScroll: !0 }));
|
|
605
|
+
}, An = p(() => S.autoplay === !0 ? 5e3 : Number(S.autoplay) || 0), jn = b(!1), Mn = b(!1), Nn = b(!1), Pn = b(!1), Fn = b(!1), In = b(!1), Ln = b(!1), Rn = (e) => {
|
|
606
|
+
Mn.value = !0;
|
|
606
607
|
let t = e.target;
|
|
607
|
-
|
|
608
|
-
},
|
|
609
|
-
|
|
610
|
-
},
|
|
611
|
-
|
|
612
|
-
},
|
|
613
|
-
|
|
614
|
-
},
|
|
615
|
-
clearInterval(
|
|
616
|
-
if (
|
|
617
|
-
else if (
|
|
608
|
+
An.value > 0 && !Pn.value && !t.classList.contains("bb-carousel__pause") && t.matches?.(":focus-visible") && (Nn.value = !0);
|
|
609
|
+
}, zn = (e) => {
|
|
610
|
+
D.value?.contains(e.relatedTarget) || (Mn.value = !1, jn.value || (Pn.value = !1));
|
|
611
|
+
}, Bn = () => {
|
|
612
|
+
jn.value = !1, Mn.value || (Pn.value = !1);
|
|
613
|
+
}, Vn = () => {
|
|
614
|
+
Nn.value = !Nn.value, Pn.value = !Nn.value;
|
|
615
|
+
}, Hn = () => k.value && An.value > 0 && !In.value && L() > 1, Un = p(() => Hn() && !Nn.value && !Fn.value && !Ln.value && !Q.value && (Pn.value || !jn.value && !Mn.value)), Wn, Gn = () => {
|
|
616
|
+
clearInterval(Wn), Un.value && (Wn = setInterval(() => {
|
|
617
|
+
if (S.picker) $t(g.value >= j.value - 1 ? 0 : g.value + 1);
|
|
618
|
+
else if (U()) nn(1, !1);
|
|
618
619
|
else {
|
|
619
|
-
let e =
|
|
620
|
-
|
|
620
|
+
let e = $e();
|
|
621
|
+
Qt(e >= L() - 1 ? 0 : e + 1);
|
|
621
622
|
}
|
|
622
|
-
},
|
|
623
|
-
},
|
|
624
|
-
|
|
623
|
+
}, An.value));
|
|
624
|
+
}, Kn = () => {
|
|
625
|
+
Un.value && Gn();
|
|
625
626
|
};
|
|
626
|
-
|
|
627
|
-
let
|
|
627
|
+
ge([Un, An], Gn, { flush: "post" });
|
|
628
|
+
let qn = b(!1), Jn = b(!1), Yn = p(() => k.value && (Ve.value > 0 || He.value > 0)), Xn = p(() => {
|
|
628
629
|
let e = {};
|
|
629
|
-
return
|
|
630
|
+
return S.perView !== void 0 && (e["--per-view"] = String(S.perView)), S.bleed !== void 0 && (e["--bleed"] = S.bleed ? "auto" : "0px"), S.align !== void 0 && (e["--align"] = S.align), e;
|
|
630
631
|
});
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
], () => void
|
|
636
|
-
let
|
|
637
|
-
"--_cp":
|
|
638
|
-
"--_bleed-start":
|
|
639
|
-
"--_bleed-end":
|
|
640
|
-
} : void 0),
|
|
641
|
-
let e =
|
|
632
|
+
ge(() => [
|
|
633
|
+
S.perView,
|
|
634
|
+
S.bleed,
|
|
635
|
+
S.align
|
|
636
|
+
], () => void v(V));
|
|
637
|
+
let Zn = p(() => k.value ? {
|
|
638
|
+
"--_cp": F.value ? `${We.value}px` : void 0,
|
|
639
|
+
"--_bleed-start": qn.value ? `${Ve.value}px` : void 0,
|
|
640
|
+
"--_bleed-end": Jn.value ? `${He.value}px` : void 0
|
|
641
|
+
} : void 0), Qn = () => {
|
|
642
|
+
let e = D.value?.parentElement ?? null;
|
|
642
643
|
for (; e && e !== document.body && e !== document.documentElement;) {
|
|
643
644
|
if (getComputedStyle(e).overflowX !== "visible") {
|
|
644
645
|
let t = e.getBoundingClientRect();
|
|
@@ -653,191 +654,191 @@ var ye = ["aria-label", "aria-roledescription"], be = ["aria-label"], xe = ["ari
|
|
|
653
654
|
left: 0,
|
|
654
655
|
right: document.documentElement.clientWidth
|
|
655
656
|
};
|
|
656
|
-
},
|
|
657
|
-
if (!
|
|
658
|
-
let e = getComputedStyle(
|
|
659
|
-
|
|
657
|
+
}, $n = () => {
|
|
658
|
+
if (!D.value || !O.value) return;
|
|
659
|
+
let e = getComputedStyle(D.value);
|
|
660
|
+
qn.value = e.getPropertyValue("--bleed-start").trim() === "auto", Jn.value = e.getPropertyValue("--bleed-end").trim() === "auto";
|
|
660
661
|
let t = 0, n = 0;
|
|
661
|
-
if (
|
|
662
|
-
let e =
|
|
662
|
+
if (qn.value || Jn.value) {
|
|
663
|
+
let e = D.value.getBoundingClientRect();
|
|
663
664
|
if (!e.width) return;
|
|
664
|
-
let r =
|
|
665
|
-
t =
|
|
665
|
+
let r = Qn(), i = Math.max(0, Math.floor(e.left - r.left)), a = Math.max(0, Math.floor(r.right - e.right));
|
|
666
|
+
t = it() ? a : i, n = it() ? i : a;
|
|
666
667
|
}
|
|
667
|
-
let r = getComputedStyle(
|
|
668
|
-
|
|
669
|
-
},
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
}),
|
|
674
|
-
|
|
675
|
-
}),
|
|
668
|
+
let r = getComputedStyle(O.value);
|
|
669
|
+
qn.value || (t = parseFloat(r.paddingInlineStart) || 0), Jn.value || (n = parseFloat(r.paddingInlineEnd) || 0), Ve.value = t, He.value = n;
|
|
670
|
+
}, er, tr, nr, rr = () => In.value = !!nr?.matches, ir = () => Fn.value = document.hidden, ar = () => V();
|
|
671
|
+
se(() => {
|
|
672
|
+
k.value = !0, P.value = w.value + N.value, lt(), v(() => {
|
|
673
|
+
lt(), st = "", V();
|
|
674
|
+
}), er = new ResizeObserver(() => V()), O.value && er.observe(O.value), z(0) && er.observe(z(0)), er.observe(D.value), er.observe(document.documentElement), window.addEventListener("resize", ar), tr = new IntersectionObserver(([e]) => {
|
|
675
|
+
Ln.value = !e.isIntersecting, e.isIntersecting && V();
|
|
676
|
+
}), tr.observe(D.value), nr = window.matchMedia?.("(prefers-reduced-motion: reduce)"), rr(), nr?.addEventListener("change", rr), document.addEventListener("visibilitychange", ir);
|
|
676
677
|
});
|
|
677
|
-
let
|
|
678
|
-
return
|
|
679
|
-
|
|
680
|
-
let e =
|
|
681
|
-
e !==
|
|
682
|
-
}),
|
|
683
|
-
|
|
684
|
-
}),
|
|
685
|
-
clearInterval(
|
|
686
|
-
}), (
|
|
678
|
+
let or = -1;
|
|
679
|
+
return ce(() => {
|
|
680
|
+
It();
|
|
681
|
+
let e = R().length;
|
|
682
|
+
e !== or && (or = e, V(), z(0) && er?.observe(z(0)));
|
|
683
|
+
}), ge(() => [S.loop, S.picker], () => {
|
|
684
|
+
st = "", v(V);
|
|
685
|
+
}), oe(() => {
|
|
686
|
+
clearInterval(Wn), clearTimeout(Z), cancelAnimationFrame(ln), Vt(), er?.disconnect(), tr?.disconnect(), nr?.removeEventListener("change", rr), document.removeEventListener("visibilitychange", ir), window.removeEventListener("resize", ar), Sn();
|
|
687
|
+
}), (t, n) => (y(), m("section", _({
|
|
687
688
|
ref_key: "root",
|
|
688
|
-
ref:
|
|
689
|
-
"aria-label":
|
|
690
|
-
"aria-roledescription":
|
|
689
|
+
ref: D,
|
|
690
|
+
"aria-label": ae.label || x(T)("carousel.label").value,
|
|
691
|
+
"aria-roledescription": x(T)("carousel.role").value,
|
|
691
692
|
class: ["bb-carousel", {
|
|
692
|
-
"bb-carousel--autoplay":
|
|
693
|
-
"bb-carousel--bleed":
|
|
694
|
-
"bb-carousel--draggable":
|
|
695
|
-
"bb-carousel--dots-below":
|
|
696
|
-
"bb-carousel--framed": !!(
|
|
697
|
-
"bb-carousel--centred":
|
|
698
|
-
"bb-carousel--picker":
|
|
699
|
-
"bb-carousel--py":
|
|
700
|
-
"bb-carousel--loop":
|
|
693
|
+
"bb-carousel--autoplay": Hn(),
|
|
694
|
+
"bb-carousel--bleed": Yn.value,
|
|
695
|
+
"bb-carousel--draggable": k.value && L() > 1,
|
|
696
|
+
"bb-carousel--dots-below": k.value && L() > 1 && !xt(),
|
|
697
|
+
"bb-carousel--framed": !!(C["slide:header"] || C["slide:footer"]),
|
|
698
|
+
"bb-carousel--centred": F.value,
|
|
699
|
+
"bb-carousel--picker": S.picker,
|
|
700
|
+
"bb-carousel--py": Ge.value,
|
|
701
|
+
"bb-carousel--loop": U()
|
|
701
702
|
}],
|
|
702
|
-
style: [
|
|
703
|
-
},
|
|
704
|
-
onFocusin:
|
|
705
|
-
onFocusout:
|
|
706
|
-
onKeydown:
|
|
707
|
-
onMouseenter:
|
|
708
|
-
onMouseleave:
|
|
703
|
+
style: [Xn.value, Zn.value]
|
|
704
|
+
}, x(E).rootAttrs, {
|
|
705
|
+
onFocusin: Rn,
|
|
706
|
+
onFocusout: zn,
|
|
707
|
+
onKeydown: kn,
|
|
708
|
+
onMouseenter: n[3] ||= (e) => jn.value = !0,
|
|
709
|
+
onMouseleave: Bn
|
|
709
710
|
}), [
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
class: ["bb-carousel__dots", { "bb-carousel__dots--window":
|
|
713
|
-
style:
|
|
714
|
-
},
|
|
711
|
+
k.value && L() > 1 ? (y(), m(d, { key: 0 }, [
|
|
712
|
+
h("div", _({
|
|
713
|
+
class: ["bb-carousel__dots", { "bb-carousel__dots--window": ht() }],
|
|
714
|
+
style: ht() ? { "--start": gt() } : void 0
|
|
715
|
+
}, x(E).dots), [Hn() ? (y(), m("button", _({
|
|
715
716
|
key: 0,
|
|
716
|
-
"aria-label":
|
|
717
|
+
"aria-label": Nn.value ? x(T)("carousel.play").value : x(T)("carousel.pause").value,
|
|
717
718
|
class: "bb-carousel__pause",
|
|
718
719
|
type: "button"
|
|
719
|
-
},
|
|
720
|
-
icon:
|
|
720
|
+
}, x(E).pause, { onClick: Vn }), [ie(e, {
|
|
721
|
+
icon: Nn.value ? x(ke) : x(Ae),
|
|
721
722
|
size: "10px"
|
|
722
|
-
}, null, 8, ["icon"])], 16,
|
|
723
|
-
"aria-label":
|
|
723
|
+
}, null, 8, ["icon"])], 16, ye)) : re("", !0), h("div", {
|
|
724
|
+
"aria-label": x(T)("carousel.slides").value,
|
|
724
725
|
class: "bb-carousel__dot-list",
|
|
725
726
|
role: "group"
|
|
726
|
-
}, [(
|
|
727
|
+
}, [(y(!0), m(d, null, le(L(), (e) => (y(), m("button", _({
|
|
727
728
|
key: e,
|
|
728
|
-
"aria-current": e - 1 ===
|
|
729
|
-
"aria-label":
|
|
730
|
-
class: ["bb-carousel__dot", [{ "bb-carousel__dot--active": e - 1 ===
|
|
731
|
-
inert: !
|
|
732
|
-
tabindex: e - 1 ===
|
|
729
|
+
"aria-current": e - 1 === dt.value || void 0,
|
|
730
|
+
"aria-label": x(T)("carousel.goTo", I.value[e - 1].first + 1).value,
|
|
731
|
+
class: ["bb-carousel__dot", [{ "bb-carousel__dot--active": e - 1 === dt.value }, vt(e - 1)]],
|
|
732
|
+
inert: !_t(e - 1) || void 0,
|
|
733
|
+
tabindex: e - 1 === dt.value ? 0 : -1,
|
|
733
734
|
type: "button"
|
|
734
|
-
}, { ref_for: !0 },
|
|
735
|
-
|
|
736
|
-
"aria-disabled": !
|
|
737
|
-
"aria-label":
|
|
735
|
+
}, { ref_for: !0 }, x(E).part("dot", { active: e - 1 === dt.value || void 0 }), { onClick: (t) => Qt(e - 1, !0) }), null, 16, xe))), 128))], 8, be)], 16),
|
|
736
|
+
h("button", _({
|
|
737
|
+
"aria-disabled": !St() || void 0,
|
|
738
|
+
"aria-label": x(T)("carousel.previous").value,
|
|
738
739
|
class: "bb-carousel__arrow bb-carousel__prev",
|
|
739
740
|
type: "button"
|
|
740
|
-
},
|
|
741
|
-
icon:
|
|
741
|
+
}, x(E).part("prev", { disabled: !St() || void 0 }), { onClick: n[0] ||= (e) => nn(-1) }), [ie(e, {
|
|
742
|
+
icon: x(Me),
|
|
742
743
|
size: "50%"
|
|
743
|
-
}, null, 8, ["icon"])], 16,
|
|
744
|
-
|
|
745
|
-
"aria-disabled": !
|
|
746
|
-
"aria-label":
|
|
744
|
+
}, null, 8, ["icon"])], 16, Se),
|
|
745
|
+
h("button", _({
|
|
746
|
+
"aria-disabled": !Ct() || void 0,
|
|
747
|
+
"aria-label": x(T)("carousel.next").value,
|
|
747
748
|
class: "bb-carousel__arrow bb-carousel__next",
|
|
748
749
|
type: "button"
|
|
749
|
-
},
|
|
750
|
-
icon:
|
|
750
|
+
}, x(E).part("next", { disabled: !Ct() || void 0 }), { onClick: n[1] ||= (e) => nn(1) }), [ie(e, {
|
|
751
|
+
icon: x(je),
|
|
751
752
|
size: "50%"
|
|
752
|
-
}, null, 8, ["icon"])], 16,
|
|
753
|
-
], 64)) :
|
|
754
|
-
|
|
753
|
+
}, null, 8, ["icon"])], 16, Ce)
|
|
754
|
+
], 64)) : re("", !0),
|
|
755
|
+
h("div", {
|
|
755
756
|
ref_key: "track",
|
|
756
|
-
ref:
|
|
757
|
+
ref: O,
|
|
757
758
|
class: "bb-carousel__track",
|
|
758
759
|
tabindex: "-1",
|
|
759
|
-
onClickCapture:
|
|
760
|
-
onDragstart:
|
|
761
|
-
onMousedown:
|
|
762
|
-
onPointerdown:
|
|
763
|
-
onScrollPassive:
|
|
764
|
-
onScrollend:
|
|
765
|
-
onTouchcancelPassive:
|
|
766
|
-
onTouchendPassive:
|
|
767
|
-
onTouchstartPassive:
|
|
768
|
-
onWheelPassive:
|
|
769
|
-
}, [(
|
|
770
|
-
key:
|
|
771
|
-
"aria-hidden":
|
|
772
|
-
"aria-label":
|
|
773
|
-
"aria-roledescription":
|
|
760
|
+
onClickCapture: Tn,
|
|
761
|
+
onDragstart: n[2] ||= _e(() => {}, ["prevent"]),
|
|
762
|
+
onMousedown: yn,
|
|
763
|
+
onPointerdown: bn,
|
|
764
|
+
onScrollPassive: un,
|
|
765
|
+
onScrollend: cn,
|
|
766
|
+
onTouchcancelPassive: Dn,
|
|
767
|
+
onTouchendPassive: Dn,
|
|
768
|
+
onTouchstartPassive: En,
|
|
769
|
+
onWheelPassive: _n
|
|
770
|
+
}, [(y(!0), m(d, null, le([Le()], (e, n) => (y(), m(d, { key: n }, [(y(!0), m(d, null, le(Re(e), (n, r) => (y(), m("div", _({
|
|
771
|
+
key: n.key,
|
|
772
|
+
"aria-hidden": n.clone || void 0,
|
|
773
|
+
"aria-label": n.clone ? void 0 : x(T)("carousel.slideOf", n.real + 1, e.length).value,
|
|
774
|
+
"aria-roledescription": n.clone ? void 0 : x(T)("carousel.slideRole").value,
|
|
774
775
|
class: ["bb-carousel__slide", {
|
|
775
|
-
"bb-carousel__slide--active":
|
|
776
|
-
"bb-carousel__slide--current":
|
|
777
|
-
"bb-carousel__slide--clone":
|
|
778
|
-
"bb-carousel__slide--page": !
|
|
776
|
+
"bb-carousel__slide--active": pt(n.real),
|
|
777
|
+
"bb-carousel__slide--current": H(n.real),
|
|
778
|
+
"bb-carousel__slide--clone": n.clone,
|
|
779
|
+
"bb-carousel__slide--page": !k.value || Ze(r)
|
|
779
780
|
}],
|
|
780
|
-
inert:
|
|
781
|
-
role:
|
|
782
|
-
}, { ref_for: !0 },
|
|
783
|
-
active:
|
|
784
|
-
current:
|
|
781
|
+
inert: mt(n.real, n.clone) || void 0,
|
|
782
|
+
role: n.clone ? void 0 : "group"
|
|
783
|
+
}, { ref_for: !0 }, x(E).part("slide", {
|
|
784
|
+
active: pt(n.real) || void 0,
|
|
785
|
+
current: H(n.real) || void 0
|
|
785
786
|
})), [
|
|
786
|
-
|
|
787
|
-
active:
|
|
788
|
-
current:
|
|
789
|
-
index:
|
|
790
|
-
item:
|
|
791
|
-
}, void 0, void 0, 0) :
|
|
792
|
-
|
|
793
|
-
active:
|
|
794
|
-
current:
|
|
795
|
-
index:
|
|
796
|
-
item:
|
|
797
|
-
}, () => [
|
|
787
|
+
C["slide:header"] ? ue(t.$slots, "slide:header", {
|
|
788
|
+
active: pt(n.real),
|
|
789
|
+
current: H(n.real),
|
|
790
|
+
index: n.real,
|
|
791
|
+
item: n.item
|
|
792
|
+
}, void 0, void 0, 0) : re("", !0),
|
|
793
|
+
n.node ? (y(), ne(de(n.node), { key: 1 })) : ue(t.$slots, "slide", {
|
|
794
|
+
active: pt(n.real),
|
|
795
|
+
current: H(n.real),
|
|
796
|
+
index: n.real,
|
|
797
|
+
item: n.item
|
|
798
|
+
}, () => [S.picker && A(n.item) ? (y(), m("button", _({
|
|
798
799
|
key: 0,
|
|
799
|
-
"aria-current":
|
|
800
|
-
"aria-label":
|
|
800
|
+
"aria-current": H(n.real) || void 0,
|
|
801
|
+
"aria-label": ze(n.item, n.real),
|
|
801
802
|
class: "bb-carousel__thumb",
|
|
802
803
|
type: "button"
|
|
803
|
-
}, { ref_for: !0 },
|
|
804
|
+
}, { ref_for: !0 }, x(E).thumb), [h("img", _({
|
|
804
805
|
alt: "",
|
|
805
806
|
class: "bb-carousel__image",
|
|
806
807
|
decoding: "async",
|
|
807
808
|
draggable: "false",
|
|
808
|
-
loading:
|
|
809
|
-
sizes:
|
|
810
|
-
src:
|
|
811
|
-
srcset:
|
|
812
|
-
}, { ref_for: !0 },
|
|
809
|
+
loading: bt(n.real) ? void 0 : "lazy",
|
|
810
|
+
sizes: A(n.item).sizes,
|
|
811
|
+
src: A(n.item).src,
|
|
812
|
+
srcset: A(n.item).srcset
|
|
813
|
+
}, { ref_for: !0 }, x(E).image), null, 16, Ee)], 16, Te)) : A(n.item) ? (y(), m("img", _({
|
|
813
814
|
key: 1,
|
|
814
|
-
alt:
|
|
815
|
+
alt: A(n.item).alt,
|
|
815
816
|
class: "bb-carousel__image",
|
|
816
817
|
decoding: "async",
|
|
817
818
|
draggable: "false",
|
|
818
|
-
loading:
|
|
819
|
-
sizes:
|
|
820
|
-
src:
|
|
821
|
-
srcset:
|
|
822
|
-
}, { ref_for: !0 },
|
|
823
|
-
|
|
824
|
-
active:
|
|
825
|
-
current:
|
|
826
|
-
index:
|
|
827
|
-
item:
|
|
828
|
-
}, void 0, void 0, 3) :
|
|
829
|
-
|
|
819
|
+
loading: bt(n.real) ? void 0 : "lazy",
|
|
820
|
+
sizes: A(n.item).sizes,
|
|
821
|
+
src: A(n.item).src,
|
|
822
|
+
srcset: A(n.item).srcset
|
|
823
|
+
}, { ref_for: !0 }, x(E).image), null, 16, De)) : re("", !0)], void 0, 2),
|
|
824
|
+
C["slide:footer"] ? ue(t.$slots, "slide:footer", {
|
|
825
|
+
active: pt(n.real),
|
|
826
|
+
current: H(n.real),
|
|
827
|
+
index: n.real,
|
|
828
|
+
item: n.item
|
|
829
|
+
}, void 0, void 0, 3) : re("", !0),
|
|
830
|
+
C.overlay ? (y(), m("div", _({
|
|
830
831
|
key: 4,
|
|
831
832
|
class: "bb-carousel__overlay"
|
|
832
|
-
}, { ref_for: !0 },
|
|
833
|
-
active:
|
|
834
|
-
current:
|
|
835
|
-
index:
|
|
836
|
-
item:
|
|
837
|
-
})], 16)) :
|
|
838
|
-
], 16,
|
|
839
|
-
|
|
840
|
-
], 16,
|
|
833
|
+
}, { ref_for: !0 }, x(E).overlay), [ue(t.$slots, "overlay", {
|
|
834
|
+
active: pt(n.real),
|
|
835
|
+
current: H(n.real),
|
|
836
|
+
index: n.real,
|
|
837
|
+
item: n.item
|
|
838
|
+
})], 16)) : re("", !0)
|
|
839
|
+
], 16, we))), 128))], 64))), 128))], 544),
|
|
840
|
+
h("span", Oe, fe(Et.value), 1)
|
|
841
|
+
], 16, ve));
|
|
841
842
|
}
|
|
842
843
|
});
|
|
843
|
-
export {
|
|
844
|
+
export { S as default };
|