bitboss-ui 3.0.0-beta.73 → 3.0.0-beta.74
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 +4 -2
- package/bin/bitboss-ui-mcp.mjs +101 -3
- package/bin/bitboss-ui.mjs +6 -1
- package/bin/cli.mjs +31 -5
- package/dist/ai/BbBadge.md +4 -4
- package/dist/ai/BbCalendar.md +4 -3
- package/dist/ai/BbColorPalette.md +8 -9
- package/dist/ai/BbConfirmPortal.md +1 -1
- package/dist/ai/BbDatePicker.md +4 -3
- package/dist/ai/BbDialog.md +14 -4
- package/dist/ai/BbDropdown.md +23 -10
- package/dist/ai/BbDropdownButton.md +2 -2
- package/dist/ai/BbForm.md +4 -1
- package/dist/ai/BbHoverCardPortal.md +1 -1
- package/dist/ai/BbNumberInput.md +5 -3
- package/dist/ai/BbPopoverPortal.md +1 -1
- package/dist/ai/BbTable.md +43 -19
- package/dist/ai/BbTimePicker.md +4 -3
- package/dist/ai/BbToastPortal.md +1 -1
- package/dist/ai/changelog.json +56 -4
- package/dist/ai/components.json +54 -18
- package/dist/ai/guides/design-tokens.md +20 -0
- package/dist/ai/guides/eslint-rules.md +1 -1
- package/dist/ai/guides/inertia-helpers.md +613 -53
- package/dist/ai/guides/migration/adoption-checklist.md +5 -5
- package/dist/ai/guides/migration/v2-to-v3.md +24 -0
- package/dist/ai/guides/migration/v3-beta-tooling.md +3 -0
- package/dist/ai/guides/preset-components.md +15 -2
- package/dist/ai/guides/reporting.md +49 -0
- package/dist/ai/helpers/inertia/manifest.json +33 -38
- package/dist/ai/helpers/inertia/useHasChanged.ts +25 -37
- package/dist/ai/helpers/inertia/useQuery.ts +24 -6
- package/dist/ai/helpers/inertia/utils.ts +552 -3
- package/dist/ai/index.md +1 -0
- package/dist/ai/manifest/components/BbAlert.tree.json +1 -1
- package/dist/ai/manifest/components/BbCalendar.json +2 -2
- package/dist/ai/manifest/components/BbColorPalette.json +3 -3
- package/dist/ai/manifest/components/BbConfirmPortal.json +1 -1
- package/dist/ai/manifest/components/BbDatePicker.json +3 -3
- package/dist/ai/manifest/components/BbDialog.tree.json +5 -1
- package/dist/ai/manifest/components/BbDropdown.json +3 -3
- package/dist/ai/manifest/components/BbDropdown.tree.json +3 -2
- package/dist/ai/manifest/components/BbDropdownButton.json +2 -2
- package/dist/ai/manifest/components/BbForm.json +1 -1
- package/dist/ai/manifest/components/BbHoverCard.json +1 -1
- package/dist/ai/manifest/components/BbHoverCardPortal.json +1 -1
- package/dist/ai/manifest/components/BbNumberInput.json +1 -1
- package/dist/ai/manifest/components/BbPopover.json +1 -1
- package/dist/ai/manifest/components/BbPopoverPortal.json +1 -1
- package/dist/ai/manifest/components/BbSelectPopover.json +1 -1
- package/dist/ai/manifest/components/BbTable.tree.json +12 -6
- package/dist/ai/manifest/components/BbTimePicker.json +3 -3
- package/dist/ai/manifest/components/BbToastPortal.json +1 -1
- package/dist/ai/manifest/components/CommonPopover.json +1 -1
- package/dist/ai/manifest/index.json +2 -2
- package/dist/ai/manifest/meta.json +36 -0
- package/dist/ai/manifest/types.advanced.json +81 -80
- package/dist/ai/manifest/types.api.json +66 -65
- package/dist/ai/manifest/types.wrapper.json +155 -118
- package/dist/ai/recipes/inertia/layout-scaffold.md +3 -1
- package/dist/ai/recipes/nuxt/layout-scaffold.md +3 -1
- package/dist/ai/recipes/vue/layout-scaffold.md +3 -1
- package/dist/ai/source/BbAlert.md +16 -4
- package/dist/ai/source/BbAvatar.md +2 -0
- package/dist/ai/source/BbBreadcrumbs.md +4 -1
- package/dist/ai/source/BbCalendar.md +22 -12
- package/dist/ai/source/BbColorPalette.md +41 -12
- package/dist/ai/source/BbConfirm.md +7 -0
- package/dist/ai/source/BbConfirmPortal.md +9 -4
- package/dist/ai/source/BbDatePicker.md +53 -22
- package/dist/ai/source/BbDatePickerInput.md +32 -8
- package/dist/ai/source/BbDialog.md +31 -1
- package/dist/ai/source/BbDropdown.md +52 -24
- package/dist/ai/source/BbDropdownGroup.md +17 -21
- package/dist/ai/source/BbForm.md +73 -6
- package/dist/ai/source/BbHoverCard.md +7 -0
- package/dist/ai/source/BbHoverCardPortal.md +9 -5
- package/dist/ai/source/BbNumberInput.md +5 -6
- package/dist/ai/source/BbOffCanvas.md +34 -1
- package/dist/ai/source/BbPopover.md +7 -0
- package/dist/ai/source/BbPopoverPortal.md +9 -5
- package/dist/ai/source/BbRadio.md +4 -3
- package/dist/ai/source/BbRadioGroup.md +7 -5
- package/dist/ai/source/BbTable.md +54 -6
- package/dist/ai/source/BbTag.md +10 -3
- package/dist/ai/source/BbTimePicker.md +50 -15
- package/dist/ai/source/BbTimePickerInput.md +30 -7
- package/dist/ai/source/BbToast.md +14 -0
- package/dist/ai/source/BbToastPortal.md +16 -4
- package/dist/ai/source/CommonFieldInput.md +11 -5
- package/dist/ai/source/CommonPopover.md +4 -1
- package/dist/components/BbAlert/BbAlert.vue_vue_type_script_setup_true_lang.js +31 -26
- package/dist/components/BbBreadcrumbs/BbBreadcrumbs.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/BbCalendar/BbCalendar.vue.d.ts +1 -1
- package/dist/components/BbCalendar/BbCalendar.vue_vue_type_script_setup_true_lang.js +235 -234
- package/dist/components/BbCalendar/types.d.ts +2 -2
- package/dist/components/BbCalendar/useDayjsLocale.js +11 -8
- package/dist/components/BbColorPalette/BbColorPalette.vue_vue_type_script_setup_true_lang.js +197 -192
- package/dist/components/BbColorPalette/types.d.ts +1 -1
- package/dist/components/BbConfirm/BbConfirmPortal.vue.d.ts +2 -4
- package/dist/components/BbConfirm/types.d.ts +5 -0
- package/dist/components/BbDatePicker/BbDatePicker.vue.d.ts +1 -1
- package/dist/components/BbDatePicker/BbDatePicker.vue_vue_type_script_setup_true_lang.js +145 -139
- package/dist/components/BbDatePicker/types.d.ts +2 -2
- package/dist/components/BbDatePickerInput/BbDatePickerInput.vue_vue_type_script_setup_true_lang.js +337 -335
- package/dist/components/BbDialog/BbDialog.vue_vue_type_script_setup_true_lang.js +253 -245
- package/dist/components/BbDialog/leaveGhost.js +33 -0
- package/dist/components/BbDialog/overlayActions.js +34 -20
- package/dist/components/BbDropdown/BbDropdown.vue_vue_type_script_setup_true_lang.js +11 -3
- package/dist/components/BbDropdown/BbDropdownList.vue_vue_type_script_setup_true_lang.js +4 -4
- package/dist/components/BbDropdown/DropdownPipelineResolver.vue_vue_type_script_setup_true_lang.js +119 -120
- package/dist/components/BbDropdown/types.d.ts +8 -17
- package/dist/components/BbForm/BbForm.vue.d.ts +2 -21
- package/dist/components/BbForm/BbForm.vue_vue_type_script_setup_true_lang.js +229 -227
- package/dist/components/BbForm/types.d.ts +31 -0
- package/dist/components/BbHoverCard/BbHoverCardPortal.vue.d.ts +2 -5
- package/dist/components/BbHoverCard/types.d.ts +5 -0
- package/dist/components/BbNumberInput/BbNumberInput.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/BbNumberInput/numberDisplay.js +102 -106
- package/dist/components/BbNumberInput/types.d.ts +4 -3
- package/dist/components/BbOffCanvas/BbOffCanvas.vue_vue_type_script_setup_true_lang.js +385 -377
- package/dist/components/BbPopover/BbPopoverPortal.vue.d.ts +2 -5
- package/dist/components/BbPopover/types.d.ts +5 -0
- package/dist/components/BbRadio/types.d.ts +4 -3
- package/dist/components/BbRadioGroup/BbRadioGroup.vue_vue_type_script_setup_true_lang.js +10 -12
- package/dist/components/BbTable/BbTable.vue_vue_type_script_setup_true_lang.js +231 -231
- package/dist/components/BbTable/BbTableDataRow.js +96 -96
- package/dist/components/BbTag/BbTag.vue_vue_type_script_setup_true_lang.js +9 -3
- package/dist/components/BbTimePicker/BbTimePicker.vue.d.ts +1 -1
- package/dist/components/BbTimePicker/BbTimePicker.vue_vue_type_script_setup_true_lang.js +106 -100
- package/dist/components/BbTimePicker/types.d.ts +2 -2
- package/dist/components/BbTimePickerInput/BbTimePickerInput.vue_vue_type_script_setup_true_lang.js +214 -213
- package/dist/components/BbToast/BbToastPortal.vue.d.ts +2 -4
- package/dist/components/BbToast/types.d.ts +5 -0
- package/dist/components/CommonFieldInput/CommonFieldInput.vue_vue_type_script_setup_true_lang.js +36 -36
- package/dist/components/CommonPopover/CommonPopover.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/CommonTimeSelector/useMeridiem.js +6 -6
- package/dist/composables/formSubmitLock.js +2 -1
- package/dist/composables/overlayRegistry.js +52 -42
- package/dist/composables/useActiveInactiveState.js +8 -4
- package/dist/composables/useBbDialog.js +5 -5
- package/dist/composables/useOwnModel.js +16 -0
- package/dist/composables/useSegmentedFields.js +31 -20
- package/dist/i18n/currencyDigits.js +58 -0
- package/dist/i18n/regionDates.js +250 -0
- package/dist/i18n/regionHints.js +30 -41
- package/dist/index.d.ts +34 -30
- package/dist/llms-full.txt +860 -129
- package/dist/llms.txt +3 -1
- package/dist/styles.css +2 -2
- package/dist/types/ActionButton.d.ts +3 -1
- package/dist/types/CommonProps.d.ts +8 -0
- package/dist/utilities/functions/hash.js +97 -64
- package/dist/utilities/functions/isEqual.js +33 -25
- package/dist/utils/versionCheck.js +1 -1
- package/dist/vite-plugin.d.ts +2 -1
- package/dist/vite.js +8 -4
- package/llms.txt +3 -1
- package/package.json +1 -2
- package/scripts/README.md +1 -1
- package/scripts/lib/adoption-checklist.json +6 -5
- package/scripts/lib/agent-manifest.mjs +33 -6
- package/scripts/lib/agent-setup.mjs +54 -6
- package/scripts/lib/cldr-pins.ts +182 -0
- package/scripts/lib/engines-include.d.mts +5 -0
- package/scripts/lib/engines-include.mjs +40 -0
- package/scripts/lib/eslint-plugin.mjs +8 -2
- package/scripts/lib/hidden-label-placeholder.mjs +25 -5
- package/scripts/lib/idiom-scan.mjs +30 -3
- package/scripts/lib/legacy-agent-files.json +152 -0
- package/scripts/lib/mcp-config.mjs +74 -7
- package/scripts/lib/portal-names.mjs +78 -8
- package/scripts/lib/release-results.mjs +5 -2
- package/scripts/lib/report.mjs +340 -0
- package/scripts/lib/run-beat.mjs +14 -0
- package/scripts/lib/run-records.mjs +313 -0
- package/scripts/lib/selector-log.mjs +98 -0
- package/scripts/lib/ticket-beat.mjs +30 -0
- package/scripts/lib/validate-bb-markup.mjs +17 -2
|
@@ -12,44 +12,45 @@ import { useUntil as de } from "../../composables/useUntil.js";
|
|
|
12
12
|
import { removedPropsFor as fe } from "../../deprecation/removedProps.js";
|
|
13
13
|
import { warnRemovedAttrs as pe } from "../../utilities/functions/warnRemovedAttrs.js";
|
|
14
14
|
import { wait as me } from "../../utilities/functions/wait.js";
|
|
15
|
-
import {
|
|
15
|
+
import { leaveAsGhost as he, surfaceGone as ge, surfaceShown as _e } from "../BbDialog/leaveGhost.js";
|
|
16
|
+
import { animationsSettled as ve } from "../../utilities/functions/animationsSettled.js";
|
|
16
17
|
import { transitions as i } from "../../utilities/misc/transitions.js";
|
|
17
|
-
import { pageText as
|
|
18
|
-
import { firstFocusableMatch as
|
|
19
|
-
import { overlaySurfaceIsolation as
|
|
20
|
-
import { useConfigDefaults as
|
|
21
|
-
import { PANEL_SIZES as
|
|
22
|
-
import
|
|
23
|
-
import { useHostCloseLabel as
|
|
24
|
-
import { useOffCanvasStack as
|
|
25
|
-
import { createVelocityTracker as
|
|
26
|
-
import { registerTopLayerHost as
|
|
27
|
-
import { useBodyScrollLock as
|
|
28
|
-
import { BB_OFF_CANVAS_PT as
|
|
29
|
-
import { usePassthrough as
|
|
30
|
-
import { useKeyboardInset as
|
|
31
|
-
import { useRefusedCloseAnnouncement as
|
|
32
|
-
import { provideOverlaySubmitGuard as
|
|
33
|
-
import { ownCompleteListener as
|
|
34
|
-
import { isOverlayStandIn as
|
|
35
|
-
import { registerStandInClose as
|
|
36
|
-
import { Fragment as
|
|
37
|
-
import { useSwipe as
|
|
18
|
+
import { pageText as ye } from "../../utilities/misc/pageText.js";
|
|
19
|
+
import { firstFocusableMatch as be } from "../../utils/focusVisibility.js";
|
|
20
|
+
import { overlaySurfaceIsolation as xe } from "../../utils/overlaySurfaceIsolation.js";
|
|
21
|
+
import { useConfigDefaults as Se, useSizeMap as Ce } from "../../composables/useConfigDefaults.js";
|
|
22
|
+
import { PANEL_SIZES as we } from "../../types/SizeScale.js";
|
|
23
|
+
import Te from "../CloseIcon/CloseButton.vue.js";
|
|
24
|
+
import { useHostCloseLabel as Ee } from "./hostCloseLabel.js";
|
|
25
|
+
import { useOffCanvasStack as De } from "./useOffCanvasStack.js";
|
|
26
|
+
import { createVelocityTracker as Oe, pickStop as ke, resolveSnapPoints as Ae, rubberBand as je, stopIndexOf as Me } from "./sheetSnap.js";
|
|
27
|
+
import { registerTopLayerHost as Ne } from "../../composables/useTopLayer.js";
|
|
28
|
+
import { useBodyScrollLock as Pe } from "../../composables/useBodyScrollLock.js";
|
|
29
|
+
import { BB_OFF_CANVAS_PT as Fe } from "./types.js";
|
|
30
|
+
import { usePassthrough as Ie } from "../../composables/usePassthrough.js";
|
|
31
|
+
import { useKeyboardInset as Le } from "../../composables/useKeyboardInset.js";
|
|
32
|
+
import { useRefusedCloseAnnouncement as Re } from "../../composables/useRefusedCloseAnnouncement.js";
|
|
33
|
+
import { provideOverlaySubmitGuard as ze } from "../../composables/formSubmitLock.js";
|
|
34
|
+
import { ownCompleteListener as Be, useOverlayActions as Ve } from "../BbDialog/overlayActions.js";
|
|
35
|
+
import { isOverlayStandIn as He, rootElementOf as Ue, routeNativeCommand as We, useOverlayHost as Ge } from "../../composables/overlayRegistry.js";
|
|
36
|
+
import { registerStandInClose as Ke, useOverlayNavigation as qe } from "../../composables/useOverlayNavigation.js";
|
|
37
|
+
import { Fragment as Je, computed as a, createBlock as Ye, createCommentVNode as o, createElementBlock as s, createElementVNode as Xe, createTextVNode as Ze, createVNode as Qe, defineComponent as $e, getCurrentInstance as et, mergeModels as c, mergeProps as l, nextTick as tt, onBeforeUnmount as nt, onDeactivated as rt, onMounted as it, openBlock as u, ref as d, renderSlot as f, toDisplayString as at, toHandlers as ot, unref as p, useAttrs as st, useModel as ct, useSlots as lt, watch as m, withModifiers as ut } from "vue";
|
|
38
|
+
import { useSwipe as dt } from "@vueuse/core";
|
|
38
39
|
// src/components/BbOffCanvas/BbOffCanvas.vue?vue&type=script&setup=true&lang.ts
|
|
39
|
-
var
|
|
40
|
+
var ft = [
|
|
40
41
|
"id",
|
|
41
42
|
"aria-describedby",
|
|
42
43
|
"aria-labelledby",
|
|
43
44
|
"inert"
|
|
44
|
-
],
|
|
45
|
+
], pt = { class: "bb-offcanvas__body-content" }, mt = [
|
|
45
46
|
"aria-label",
|
|
46
47
|
"aria-valuemax",
|
|
47
48
|
"aria-valuenow",
|
|
48
49
|
"aria-valuetext"
|
|
49
|
-
],
|
|
50
|
+
], ht = {
|
|
50
51
|
"aria-live": "polite",
|
|
51
52
|
class: "bb-sr-only"
|
|
52
|
-
},
|
|
53
|
+
}, gt = 4, _t = 50, vt = 8, yt = 500, bt = "cubic-bezier(0.32, 0.72, 0, 1)", h = /*@__PURE__*/ $e({
|
|
53
54
|
inheritAttrs: !1,
|
|
54
55
|
__name: "BbOffCanvas",
|
|
55
56
|
props: /*@__PURE__*/ c({
|
|
@@ -131,385 +132,392 @@ var lt = [
|
|
|
131
132
|
"shown",
|
|
132
133
|
"hidden"
|
|
133
134
|
], ["update:modelValue", "update:snap"]),
|
|
134
|
-
setup(i, { emit:
|
|
135
|
-
let c =
|
|
136
|
-
id: () =>
|
|
135
|
+
setup(i, { emit: $e }) {
|
|
136
|
+
let c = ct(i, "modelValue"), h = ct(i, "snap"), g = i, xt = $e, St = lt(), Ct = Se("BbOffCanvas", g, { side: "start" }), wt = et(), Tt = He(), _ = Ge("offCanvas", {
|
|
137
|
+
id: () => g.id,
|
|
137
138
|
model: c,
|
|
138
|
-
element: () =>
|
|
139
|
-
enabled: !
|
|
140
|
-
defaultData: () =>
|
|
141
|
-
onComplete: () =>
|
|
139
|
+
element: () => Ue(wt),
|
|
140
|
+
enabled: !Tt,
|
|
141
|
+
defaultData: () => g.defaultData,
|
|
142
|
+
onComplete: () => Be(wt)
|
|
142
143
|
});
|
|
143
|
-
|
|
144
|
+
Tt ? Ke(() => un("escape")) : g.navigation && _.onDemand && process.env.NODE_ENV !== "production" && ie().warn("BbOffCanvas: `navigation` is ignored on a panel opened on demand: it has no place in the page URL. For a URL panel, render the wrapper in the page and open it by id."), qe({
|
|
144
145
|
component: "BbOffCanvas",
|
|
145
|
-
enabled: () => !!
|
|
146
|
-
key: () =>
|
|
147
|
-
replace: () => !!
|
|
148
|
-
id: () =>
|
|
146
|
+
enabled: () => !!g.navigation && !Tt && !_.onDemand,
|
|
147
|
+
key: () => g.queryKey,
|
|
148
|
+
replace: () => !!g.replace,
|
|
149
|
+
id: () => g.id,
|
|
149
150
|
model: c,
|
|
150
|
-
requestClose: () =>
|
|
151
|
+
requestClose: () => un("escape")
|
|
151
152
|
});
|
|
152
|
-
let
|
|
153
|
+
let Et = st(), v = Ie({
|
|
153
154
|
component: "BbOffCanvas",
|
|
154
|
-
attrs:
|
|
155
|
-
props:
|
|
156
|
-
parts:
|
|
157
|
-
states:
|
|
155
|
+
attrs: Et,
|
|
156
|
+
props: g,
|
|
157
|
+
parts: Fe.parts,
|
|
158
|
+
states: Fe.states,
|
|
158
159
|
active: {
|
|
159
160
|
open: () => c.value,
|
|
160
|
-
fullscreen: () =>
|
|
161
|
+
fullscreen: () => gn.value
|
|
161
162
|
}
|
|
162
|
-
}),
|
|
163
|
+
}), Dt = a(() => l({
|
|
163
164
|
class: "bb-offcanvas__close",
|
|
164
|
-
onClick:
|
|
165
|
-
},
|
|
165
|
+
onClick: A
|
|
166
|
+
}, v.close)), Ot = Ce("BbOffCanvas", we);
|
|
166
167
|
process.env.NODE_ENV !== "production" && pe("BbOffCanvas", fe("BbOffCanvas"));
|
|
167
|
-
let { t:
|
|
168
|
+
let { t: y } = re(), kt = Ee(), At = a(() => kt() ?? y("offCanvas.closeLabel").value), jt = () => !!g.title || !!St.title, Mt = () => jt() || !!St.header || Ht(), Nt = ze(), Pt = Nt.saving, Ft = Ve({
|
|
168
169
|
component: "BbOffCanvas",
|
|
169
|
-
props: () =>
|
|
170
|
-
surface:
|
|
171
|
-
complete:
|
|
172
|
-
data: () =>
|
|
173
|
-
close: () =>
|
|
170
|
+
props: () => g,
|
|
171
|
+
surface: Nt,
|
|
172
|
+
complete: _.complete,
|
|
173
|
+
data: () => _.data.value,
|
|
174
|
+
close: () => A(),
|
|
175
|
+
closeLocked: () => Lt.value,
|
|
174
176
|
block: "bb-offcanvas"
|
|
175
|
-
}),
|
|
177
|
+
}), It = () => Ft.render(), Lt = a(() => g.preventClose ?? (Pt() || _.completing.value)), b = a(() => Lt.value || !!g.persistent), Rt = () => typeof document < "u", x = d(null), S = Le({
|
|
176
178
|
active: () => c.value,
|
|
177
|
-
container: () =>
|
|
178
|
-
}),
|
|
179
|
+
container: () => x.value
|
|
180
|
+
}), zt = de(() => c.value || g.eager, { initialValue: c.value || g.eager }), Bt = a(() => !!g.eager || c.value || E.value), C = d(0);
|
|
179
181
|
m(c, (e, t) => {
|
|
180
|
-
e && !t && !
|
|
182
|
+
e && !t && !g.eager && C.value++;
|
|
181
183
|
}, { flush: "sync" });
|
|
182
|
-
let
|
|
183
|
-
|
|
184
|
-
let
|
|
185
|
-
|
|
186
|
-
},
|
|
187
|
-
|
|
184
|
+
let w = `title_${ne().id.value}`, Vt = `desc_${ne().id.value}`, Ht = () => !!g.description || !!St.description, T = d(0), E = d(!1);
|
|
185
|
+
Pe(E);
|
|
186
|
+
let Ut = d(null), Wt = () => {
|
|
187
|
+
Ut.value = null;
|
|
188
|
+
}, Gt = (e) => {
|
|
189
|
+
Ut.value = {
|
|
188
190
|
startX: e.clientX,
|
|
189
191
|
startY: e.clientY,
|
|
190
192
|
startedOnBackdrop: e.target === e.currentTarget
|
|
191
193
|
};
|
|
192
|
-
},
|
|
193
|
-
let t =
|
|
194
|
-
|
|
195
|
-
},
|
|
196
|
-
|
|
197
|
-
|
|
194
|
+
}, Kt = (e) => {
|
|
195
|
+
let t = Ut.value;
|
|
196
|
+
Wt(), t && !t.startedOnBackdrop || t && (Math.abs(e.clientX - t.startX) > gt || Math.abs(e.clientY - t.startY) > gt) || ln(e, "backdrop");
|
|
197
|
+
}, qt, Jt = Re(() => y("dialog.closeRefused").value), D = (e) => {
|
|
198
|
+
Jt.announce(), clearTimeout(qt), fn.value = !0, qt = setTimeout(() => {
|
|
199
|
+
fn.value = !1;
|
|
198
200
|
}, e);
|
|
199
|
-
},
|
|
200
|
-
let e = { element: () =>
|
|
201
|
-
|
|
202
|
-
},
|
|
203
|
-
te(
|
|
204
|
-
},
|
|
205
|
-
|
|
206
|
-
},
|
|
207
|
-
if (e.key === "Escape" && !
|
|
208
|
-
},
|
|
201
|
+
}, Yt = Symbol("bb-off-canvas-escape"), Xt = t(), Zt = !1, Qt = () => {
|
|
202
|
+
let e = { element: () => x.value };
|
|
203
|
+
Zt ? n(Yt, Xt, e) : ee(Yt, e), Rt() && document.addEventListener("keydown", tn, { capture: !0 });
|
|
204
|
+
}, $t = () => {
|
|
205
|
+
te(Yt), Rt() && document.removeEventListener("keydown", tn, { capture: !0 });
|
|
206
|
+
}, en = () => {
|
|
207
|
+
g.focusTarget && be(x.value, g.focusTarget)?.focus();
|
|
208
|
+
}, tn = (e) => {
|
|
209
|
+
if (e.key === "Escape" && !Nn.value && r(Yt) && (e.stopImmediatePropagation(), b.value)) return e.preventDefault(), D(200), !1;
|
|
210
|
+
}, nn = d(), O = null, rn = null, an = null, on = async (e) => {
|
|
209
211
|
if (e) {
|
|
210
|
-
|
|
211
|
-
let e =
|
|
212
|
-
await me(
|
|
212
|
+
j.value = hn(), xt("show"), T.value++, nn.value = ye(), Qt(), await tt(), E.value = !0, x.value && !x.value.open && (an = document.activeElement, x.value.showModal()), rn = null, _e(M), jn(), Tn(M, !1), x.value && (O = Ne(x.value)), en();
|
|
213
|
+
let e = T.value;
|
|
214
|
+
await me(g.transitionDuration), await ve(x.value), e === T.value && c.value && xt("shown");
|
|
213
215
|
} else {
|
|
214
|
-
|
|
215
|
-
let e =
|
|
216
|
-
if (await me(
|
|
217
|
-
|
|
216
|
+
xt("hide", _.closingResult()), rn = performance.now(), Tn(M, !0), Mn();
|
|
217
|
+
let e = T.value;
|
|
218
|
+
if (await me(g.transitionDuration), e !== T.value) return;
|
|
219
|
+
$t(), x.value?.close(), ge(M), O?.(), O = null, E.value = !1, Tn(M, !1), V = !1, B.value = !1, Yn(), _.afterHidden(), xt("hidden");
|
|
218
220
|
}
|
|
219
|
-
},
|
|
220
|
-
process.env.NODE_ENV !== "production" &&
|
|
221
|
-
|
|
221
|
+
}, sn = () => {
|
|
222
|
+
process.env.NODE_ENV !== "production" && St.header && !g.title && Et["aria-labelledby"] == null && tt(() => {
|
|
223
|
+
x.value && !document.getElementById(w) && ie().warn(`BbOffCanvas: the #header slot does not contain an element with id="${w}", so aria-labelledby points at nothing and the panel announces as unnamed. Bind the slot's \`titleId\` to your heading: <template #header="{ titleId }"><h2 :id="titleId">…</h2></template>.`);
|
|
222
224
|
});
|
|
223
225
|
};
|
|
224
|
-
m(c,
|
|
225
|
-
c.value && (
|
|
226
|
-
}), m(
|
|
227
|
-
e &&
|
|
226
|
+
m(c, on), it(() => {
|
|
227
|
+
c.value && (Zt = !0, on(!0), Zt = !1);
|
|
228
|
+
}), m(zt, (e) => {
|
|
229
|
+
e && sn();
|
|
228
230
|
}, {
|
|
229
231
|
immediate: !0,
|
|
230
232
|
flush: "post"
|
|
231
|
-
}),
|
|
232
|
-
clearTimeout(
|
|
233
|
+
}), nt(() => {
|
|
234
|
+
clearTimeout(qt), $t(), R.value?.removeEventListener("scroll", Un), H?.disconnect(), H = null, Mn(), Tn(M, !1), he(x.value, {
|
|
235
|
+
id: M,
|
|
236
|
+
openClass: "bb-offcanvas--open",
|
|
237
|
+
duration: g.transitionDuration,
|
|
238
|
+
closingSince: rn,
|
|
239
|
+
opener: an
|
|
240
|
+
}), x.value?.open && x.value.close(), O?.(), O = null;
|
|
233
241
|
});
|
|
234
|
-
let
|
|
235
|
-
if (
|
|
236
|
-
let t =
|
|
237
|
-
return t === "auto" ? "fit-content" : e(t,
|
|
238
|
-
}),
|
|
239
|
-
if (e.preventDefault(), !
|
|
240
|
-
},
|
|
241
|
-
|
|
242
|
-
},
|
|
243
|
-
|
|
244
|
-
},
|
|
245
|
-
show:
|
|
246
|
-
close:
|
|
242
|
+
let cn = a(() => {
|
|
243
|
+
if (gn.value) return "100%";
|
|
244
|
+
let t = mn(g.size);
|
|
245
|
+
return t === "auto" ? "fit-content" : e(t, Ot.value);
|
|
246
|
+
}), ln = (e, t = "escape") => {
|
|
247
|
+
if (e.preventDefault(), !un(t)) return !1;
|
|
248
|
+
}, un = (e) => b.value ? (D(300), !1) : (k(e), !0), k = (e) => {
|
|
249
|
+
_.record(e), c.value = !1;
|
|
250
|
+
}, A = () => {
|
|
251
|
+
Lt.value ? D(300) : k("close");
|
|
252
|
+
}, dn = (e) => We(e, {
|
|
253
|
+
show: _.show,
|
|
254
|
+
close: A,
|
|
247
255
|
open: () => c.value
|
|
248
|
-
}),
|
|
249
|
-
m(() => JSON.stringify(
|
|
250
|
-
let
|
|
251
|
-
let e =
|
|
252
|
-
return e ?
|
|
253
|
-
},
|
|
254
|
-
typeof ResizeObserver < "u" &&
|
|
255
|
-
|
|
256
|
-
}),
|
|
257
|
-
},
|
|
258
|
-
|
|
259
|
-
},
|
|
260
|
-
|
|
261
|
-
},
|
|
262
|
-
|
|
263
|
-
},
|
|
264
|
-
let e =
|
|
265
|
-
return
|
|
266
|
-
}),
|
|
267
|
-
m([() =>
|
|
268
|
-
e !== -1 && (
|
|
256
|
+
}), fn = d(!1), { isMobile: pn } = ae(), { resolve: mn } = ce(), hn = () => le(mn(Ct.side), x.value), j = d(hn());
|
|
257
|
+
m(() => JSON.stringify(Ct.side), () => j.value = hn()), m(ue, () => j.value = hn());
|
|
258
|
+
let gn = a(() => g.fullscreen === !0 || g.fullscreen === "mobile" && pn.value), M = Symbol("bb-offcanvas"), { stacks: _n, push: vn, setSize: yn, remove: bn, offset: xn, openOrder: N, registerOpen: Sn, deregisterOpen: Cn, closing: wn, setClosing: Tn } = De(), P = a(() => j.value === "left" || j.value === "right" ? "x" : "y"), F = a(() => j.value === "right" || j.value === "bottom" ? 1 : -1), En = `bb-offcanvas-${ne().id.value}`, I = a(() => g.stack || En), L = null, Dn = () => {
|
|
259
|
+
let e = x.value?.getBoundingClientRect();
|
|
260
|
+
return e ? P.value === "x" ? e.width : e.height : 0;
|
|
261
|
+
}, On = null, kn = () => {
|
|
262
|
+
typeof ResizeObserver < "u" && x.value && (On = new ResizeObserver(() => {
|
|
263
|
+
L !== null && yn(L, M, Dn());
|
|
264
|
+
}), On.observe(x.value));
|
|
265
|
+
}, An = () => {
|
|
266
|
+
On?.disconnect(), On = null;
|
|
267
|
+
}, jn = () => {
|
|
268
|
+
L = I.value, vn(L, M, j.value, Dn(), g.stackGap), Sn(M), kn();
|
|
269
|
+
}, Mn = () => {
|
|
270
|
+
An(), Cn(M), L !== null && (bn(L, M), L = null);
|
|
271
|
+
}, Nn = a(() => {
|
|
272
|
+
let e = N.value.indexOf(M);
|
|
273
|
+
return E.value && e !== -1 && e < N.value.length - 1;
|
|
274
|
+
}), Pn = d(!1);
|
|
275
|
+
m([() => N.value.indexOf(M), () => wn.value.length > 0], ([e, t]) => {
|
|
276
|
+
e !== -1 && (Pn.value = t && Pn.value || e > 0);
|
|
269
277
|
}, { immediate: !0 });
|
|
270
|
-
let
|
|
278
|
+
let Fn = a(() => (N.value.includes(M) || E.value) && Pn.value);
|
|
271
279
|
m([
|
|
272
|
-
|
|
273
|
-
() =>
|
|
274
|
-
() =>
|
|
280
|
+
I,
|
|
281
|
+
() => j.value,
|
|
282
|
+
() => g.stackGap
|
|
275
283
|
], ([e]) => {
|
|
276
|
-
|
|
284
|
+
L !== null && (bn(L, M), L = e, vn(e, M, j.value, Dn(), g.stackGap));
|
|
277
285
|
});
|
|
278
|
-
let
|
|
279
|
-
|
|
280
|
-
let e =
|
|
286
|
+
let In = a(() => pn.value ? 14 : 20), Ln = a(() => {
|
|
287
|
+
_n.value;
|
|
288
|
+
let e = P.value === "x" ? se.value : oe.value, t = xn(I.value, M, e, In.value);
|
|
281
289
|
return {
|
|
282
|
-
[
|
|
290
|
+
[P.value === "x" ? "--stack-x" : "--stack-y"]: `${-F.value * t}px`,
|
|
283
291
|
"--stack-fill": `${t}px`
|
|
284
292
|
};
|
|
285
|
-
}),
|
|
286
|
-
let e =
|
|
293
|
+
}), Rn = d(!1), zn = 0, Bn = () => {
|
|
294
|
+
let e = _n.value[I.value];
|
|
287
295
|
if (!e) return !1;
|
|
288
|
-
let t = e.filter((e) => e.direction ===
|
|
296
|
+
let t = e.filter((e) => e.direction === j.value), n = t.findIndex((e) => e.id === M);
|
|
289
297
|
return n !== -1 && n !== t.length - 1;
|
|
290
298
|
};
|
|
291
|
-
m(() =>
|
|
292
|
-
let t = e?.length ?? 0, n = t > 0 && t ===
|
|
293
|
-
|
|
299
|
+
m(() => _n.value[I.value], (e) => {
|
|
300
|
+
let t = e?.length ?? 0, n = t > 0 && t === zn;
|
|
301
|
+
zn = t, Rn.value = n && Bn(), Rn.value && tt(() => Rn.value = !1);
|
|
294
302
|
});
|
|
295
|
-
let
|
|
296
|
-
|
|
297
|
-
},
|
|
298
|
-
m(
|
|
299
|
-
t?.removeEventListener("scroll",
|
|
303
|
+
let R = d(null), z = d(!1), B = d(!1), V = !1, H = null, Vn = !1, U = !1, Hn = !1, W = !1, G = () => {
|
|
304
|
+
R.value?.style.removeProperty("touch-action");
|
|
305
|
+
}, Un = () => G();
|
|
306
|
+
m(R, (e, t) => {
|
|
307
|
+
t?.removeEventListener("scroll", Un), H?.disconnect(), H = null, e && (e.addEventListener("scroll", Un, { passive: !0 }), typeof ResizeObserver < "u" && (H = new ResizeObserver(() => G()), H.observe(e)), G());
|
|
300
308
|
}, { flush: "post" }), m([
|
|
301
|
-
() =>
|
|
302
|
-
() =>
|
|
303
|
-
|
|
309
|
+
() => g.draggable,
|
|
310
|
+
() => j.value,
|
|
311
|
+
E
|
|
304
312
|
], () => G());
|
|
305
|
-
let
|
|
306
|
-
|
|
307
|
-
},
|
|
308
|
-
let t =
|
|
313
|
+
let Wn = () => P.value === "y" ? F.value === 1 ? -nr.value : nr.value : F.value === 1 ? -tr.value : tr.value, Gn = () => {
|
|
314
|
+
x.value && (x.value.style.transition = "none"), R.value && P.value === "y" && (R.value.style.touchAction = "none");
|
|
315
|
+
}, Kn = (e) => {
|
|
316
|
+
let t = x.value;
|
|
309
317
|
if (!t) return;
|
|
310
|
-
let n = e > 0 ? e *
|
|
311
|
-
t.style.transform =
|
|
312
|
-
},
|
|
313
|
-
let e =
|
|
314
|
-
e && (e.style.transform =
|
|
315
|
-
},
|
|
316
|
-
let t =
|
|
317
|
-
t && (e ? (t.style.transition = `transform ${
|
|
318
|
+
let n = e > 0 ? e * F.value : 0;
|
|
319
|
+
t.style.transform = P.value === "x" ? `translate3d(${n}px, 0, 0)` : `translate3d(0, ${n}px, 0)`;
|
|
320
|
+
}, qn = () => {
|
|
321
|
+
let e = x.value;
|
|
322
|
+
e && (e.style.transform = j.value === "bottom" ? "translate3d(0, 100%, 0)" : j.value === "top" ? "translate3d(0, -100%, 0)" : j.value === "left" ? "translate3d(-100%, 0, 0)" : "translate3d(100%, 0, 0)");
|
|
323
|
+
}, Jn = (e) => {
|
|
324
|
+
let t = x.value;
|
|
325
|
+
t && (e ? (t.style.transition = `transform ${yt}ms ${bt}`, t.style.transform = "translate3d(0, 0, 0)", window.setTimeout(() => {
|
|
318
326
|
t.isConnected && !V && (t.style.removeProperty("transform"), t.style.removeProperty("transition"), G());
|
|
319
|
-
},
|
|
320
|
-
},
|
|
321
|
-
let e =
|
|
327
|
+
}, yt)) : (t.style.transition = "", G()));
|
|
328
|
+
}, Yn = () => {
|
|
329
|
+
let e = x.value;
|
|
322
330
|
e && (V || (e.style.removeProperty("transition"), e.style.removeProperty("transform")));
|
|
323
|
-
},
|
|
324
|
-
let e =
|
|
325
|
-
e ? (V = !0,
|
|
326
|
-
},
|
|
331
|
+
}, Xn = async () => {
|
|
332
|
+
let e = x.value;
|
|
333
|
+
e ? (V = !0, B.value = !0, e.style.transition = `transform ${yt}ms ${bt}`, qn(), await me(yt), c.value ? (e.style.transition = "none", qn(), k("swipe")) : (V = !1, B.value = !1, e.style.removeProperty("transform"), e.style.removeProperty("transition"), G())) : k("swipe");
|
|
334
|
+
}, Zn = (e) => {
|
|
327
335
|
let { overflowY: t } = getComputedStyle(e);
|
|
328
336
|
return t !== "auto" && t !== "scroll" ? !1 : e.scrollHeight > e.clientHeight + 1;
|
|
329
|
-
},
|
|
330
|
-
let t =
|
|
337
|
+
}, Qn = (e) => F.value === 1 ? e.scrollTop <= 1 : e.scrollTop + e.clientHeight >= e.scrollHeight - 1, $n = (e) => {
|
|
338
|
+
let t = x.value;
|
|
331
339
|
if (!t) return !1;
|
|
332
340
|
let n = e;
|
|
333
341
|
for (; n && n !== t;) {
|
|
334
|
-
if (n instanceof HTMLElement &&
|
|
342
|
+
if (n instanceof HTMLElement && Zn(n) && !Qn(n)) return !0;
|
|
335
343
|
n = n.parentElement;
|
|
336
344
|
}
|
|
337
345
|
return !1;
|
|
338
|
-
},
|
|
339
|
-
|
|
340
|
-
}, { lengthX:
|
|
341
|
-
threshold:
|
|
346
|
+
}, er = () => {
|
|
347
|
+
Vn = !1, U = !1, Hn = !1, W = !1, z.value = !1;
|
|
348
|
+
}, { lengthX: tr, lengthY: nr } = dt(x, {
|
|
349
|
+
threshold: vt,
|
|
342
350
|
passive: !1,
|
|
343
351
|
onSwipeStart: (e) => {
|
|
344
|
-
if (
|
|
352
|
+
if (er(), !g.draggable || !E.value || e.target === x.value) return;
|
|
345
353
|
let t = e.target;
|
|
346
|
-
t instanceof Element && (t.closest("[data-bb-no-drag]") || (
|
|
354
|
+
t instanceof Element && (t.closest("[data-bb-no-drag]") || (Vn = !0, U = !!t.closest(".bb-offcanvas__content"), W = U && !cr() && $n(t), K.value && kr()));
|
|
347
355
|
},
|
|
348
356
|
onSwipe: (e) => {
|
|
349
|
-
if (!
|
|
357
|
+
if (!Vn || !g.draggable || W) return;
|
|
350
358
|
if (K.value) {
|
|
351
|
-
|
|
359
|
+
Nr(e);
|
|
352
360
|
return;
|
|
353
361
|
}
|
|
354
|
-
let t =
|
|
355
|
-
if (!
|
|
362
|
+
let t = Wn();
|
|
363
|
+
if (!Hn) {
|
|
356
364
|
if (U && t < -8) {
|
|
357
365
|
W = !0;
|
|
358
366
|
return;
|
|
359
367
|
}
|
|
360
|
-
if (t <
|
|
361
|
-
|
|
368
|
+
if (t < vt) return;
|
|
369
|
+
Hn = !0, z.value = !0, Gn();
|
|
362
370
|
}
|
|
363
|
-
e.preventDefault(),
|
|
371
|
+
e.preventDefault(), Kn(t);
|
|
364
372
|
},
|
|
365
373
|
onSwipeEnd: (e) => {
|
|
366
374
|
if (K.value) {
|
|
367
|
-
|
|
375
|
+
Fr(e.timeStamp);
|
|
368
376
|
return;
|
|
369
377
|
}
|
|
370
|
-
if (!
|
|
371
|
-
|
|
378
|
+
if (!Hn) {
|
|
379
|
+
er();
|
|
372
380
|
return;
|
|
373
381
|
}
|
|
374
|
-
let t =
|
|
375
|
-
|
|
382
|
+
let t = Wn();
|
|
383
|
+
er(), t >= _t && !b.value ? Xn() : (Jn(!0), t >= _t && D(300));
|
|
376
384
|
}
|
|
377
|
-
}), K = a(() =>
|
|
378
|
-
if (!
|
|
385
|
+
}), K = a(() => j.value === "bottom" && g.draggable && !gn.value && !!g.snapPoints?.length), rr = d(0), ir = () => {
|
|
386
|
+
if (!Rt()) return;
|
|
379
387
|
let e = document.createElement("div");
|
|
380
|
-
e.style.cssText = "position:fixed;visibility:hidden;height:env(safe-area-inset-top,0px)", document.body.append(e),
|
|
381
|
-
}, q = a(() => Math.max(0, oe.value -
|
|
382
|
-
process.env.NODE_ENV !== "production" && (
|
|
383
|
-
}) : []), Y = d(0),
|
|
384
|
-
let e =
|
|
388
|
+
e.style.cssText = "position:fixed;visibility:hidden;height:env(safe-area-inset-top,0px)", document.body.append(e), rr.value = e.getBoundingClientRect().height, e.remove();
|
|
389
|
+
}, q = a(() => Math.max(0, oe.value - S.value - rr.value - In.value)), ar = /* @__PURE__ */ new Set(), J = a(() => K.value ? Ae(g.snapPoints, q.value, (e) => {
|
|
390
|
+
process.env.NODE_ENV !== "production" && (ar.has(e) || (ar.add(e), ie().warn(`BbOffCanvas: snap point ${JSON.stringify(e)} is not a stop. Use a fraction of the screen in (0, 1] or a pixel height like '240px'.`)));
|
|
391
|
+
}) : []), Y = d(0), or = a(() => J.value[J.value.length - 1]?.height ?? 0), sr = (e) => or.value - (J.value[e]?.height ?? 0), cr = () => K.value && Y.value < J.value.length - 1, lr = () => {
|
|
392
|
+
let e = Me(J.value, h.value);
|
|
385
393
|
if (e !== -1) return e;
|
|
386
|
-
if (
|
|
387
|
-
let [e] =
|
|
394
|
+
if (h.value !== void 0) {
|
|
395
|
+
let [e] = Ae([h.value], q.value), t = e ? J.value.findIndex((t) => Math.abs(t.height - e.height) < 1) : -1;
|
|
388
396
|
if (t !== -1) return t;
|
|
389
397
|
}
|
|
390
398
|
return 0;
|
|
391
|
-
}, X = d(null),
|
|
392
|
-
|
|
393
|
-
},
|
|
394
|
-
clearTimeout(Z), Y.value = e, X.value = "instant",
|
|
399
|
+
}, X = d(null), ur = (e) => {
|
|
400
|
+
x.value?.style.setProperty("--snap-y", `${e}px`);
|
|
401
|
+
}, dr = () => parseFloat(x.value?.style.getPropertyValue("--snap-y") || "0") || 0, Z, fr = 0, pr = (e) => {
|
|
402
|
+
clearTimeout(Z), Y.value = e, X.value = "instant", ur(sr(e)), cancelAnimationFrame(fr), fr = requestAnimationFrame(() => {
|
|
395
403
|
X.value === "instant" && (X.value = null);
|
|
396
404
|
});
|
|
397
405
|
}, Q = (e, { report: t = !0 } = {}) => {
|
|
398
406
|
let n = J.value[e];
|
|
399
|
-
n && (X.value === "settle" && Math.abs(
|
|
400
|
-
},
|
|
401
|
-
function
|
|
402
|
-
clearTimeout(Z),
|
|
407
|
+
n && (X.value === "settle" && Math.abs(Ar() - dr()) < 1 && _r(), clearTimeout(Z), x.value?.removeEventListener("transitionend", vr), Y.value = e, X.value = "settle", ur(sr(e)), mr = t ? n.value : void 0, gr = t, x.value?.addEventListener("transitionend", vr), Z = setTimeout(_r, 550));
|
|
408
|
+
}, mr, hr, gr = !1;
|
|
409
|
+
function _r() {
|
|
410
|
+
clearTimeout(Z), x.value?.removeEventListener("transitionend", vr), X.value === "settle" && (X.value = null), gr && h.value !== mr && (hr = mr, h.value = mr), gr = !1, G();
|
|
403
411
|
}
|
|
404
|
-
function
|
|
405
|
-
e.target ===
|
|
412
|
+
function vr(e) {
|
|
413
|
+
e.target === x.value && e.propertyName === "translate" && _r();
|
|
406
414
|
}
|
|
407
|
-
let
|
|
408
|
-
let e =
|
|
415
|
+
let yr = () => {
|
|
416
|
+
let e = wt?.vnode.props;
|
|
409
417
|
return !!e && ("snap" in e || "onUpdate:snap" in e);
|
|
410
|
-
},
|
|
411
|
-
K.value && (
|
|
418
|
+
}, br = () => {
|
|
419
|
+
K.value && (ir(), clearTimeout(Z), X.value = null, Y.value = yr() ? lr() : 0, ur(sr(Y.value)));
|
|
412
420
|
};
|
|
413
421
|
m(c, (e) => {
|
|
414
|
-
e &&
|
|
415
|
-
}),
|
|
416
|
-
c.value &&
|
|
417
|
-
}), m(
|
|
418
|
-
if (e !== void 0 && e ===
|
|
419
|
-
|
|
422
|
+
e && br();
|
|
423
|
+
}), it(() => {
|
|
424
|
+
c.value && br();
|
|
425
|
+
}), m(h, (e) => {
|
|
426
|
+
if (e !== void 0 && e === hr) {
|
|
427
|
+
hr = void 0;
|
|
420
428
|
return;
|
|
421
429
|
}
|
|
422
|
-
if (
|
|
423
|
-
let t =
|
|
430
|
+
if (hr = void 0, !c.value || !K.value || X.value === "drag") return;
|
|
431
|
+
let t = lr();
|
|
424
432
|
(t !== Y.value || X.value === "settle") && Q(t, { report: !1 });
|
|
425
433
|
}), m(() => J.value.map((e) => e.height).join(), () => {
|
|
426
434
|
if (!c.value || !K.value || X.value === "drag") return;
|
|
427
435
|
let e = J.value.length - 1;
|
|
428
|
-
|
|
436
|
+
pr(Math.min(Y.value, Math.max(0, e)));
|
|
429
437
|
});
|
|
430
|
-
let
|
|
431
|
-
m(() =>
|
|
438
|
+
let xr = null;
|
|
439
|
+
m(() => S.value > 0, (e) => {
|
|
432
440
|
if (!c.value || !K.value) return;
|
|
433
441
|
let t = J.value.length - 1;
|
|
434
|
-
e && Y.value < t ? (
|
|
442
|
+
e && Y.value < t ? (xr = Y.value, Q(t)) : !e && xr !== null && (Y.value === t && Q(xr), xr = null);
|
|
435
443
|
});
|
|
436
|
-
let
|
|
437
|
-
let t =
|
|
438
|
-
if (t < 0) return -
|
|
439
|
-
let n =
|
|
440
|
-
return
|
|
441
|
-
},
|
|
442
|
-
|
|
443
|
-
},
|
|
444
|
-
let e =
|
|
444
|
+
let Sr = Oe(), Cr = 0, wr = 0, Tr = 0, $ = !1, Er = !1, Dr = () => sr(0), Or = (e) => {
|
|
445
|
+
let t = wr + e;
|
|
446
|
+
if (t < 0) return -je(-t, q.value);
|
|
447
|
+
let n = Dr();
|
|
448
|
+
return b.value && t > n ? n + je(t - n, q.value) : t;
|
|
449
|
+
}, kr = (e = 0) => {
|
|
450
|
+
Sr.reset(), $ = !1, Er = !1, Cr = Y.value, wr = dr(), Tr = e;
|
|
451
|
+
}, Ar = () => {
|
|
452
|
+
let e = x.value;
|
|
445
453
|
if (!e) return 0;
|
|
446
|
-
let t = oe.value -
|
|
447
|
-
return e.getBoundingClientRect().top - (t -
|
|
448
|
-
},
|
|
449
|
-
X.value === "settle" && (
|
|
450
|
-
},
|
|
451
|
-
|
|
452
|
-
},
|
|
453
|
-
let t = -
|
|
454
|
+
let t = oe.value - S.value;
|
|
455
|
+
return e.getBoundingClientRect().top - (t - or.value);
|
|
456
|
+
}, jr = () => {
|
|
457
|
+
X.value === "settle" && (wr = Ar()), $ = !0, Er = !0, clearTimeout(Z), X.value = "drag", z.value = !0, R.value && (R.value.style.touchAction = "none");
|
|
458
|
+
}, Mr = (e, t) => {
|
|
459
|
+
ur(Or(e)), Sr.add(t, -e);
|
|
460
|
+
}, Nr = (e) => {
|
|
461
|
+
let t = -nr.value;
|
|
454
462
|
if (!$) {
|
|
455
|
-
if (U && !
|
|
463
|
+
if (U && !cr() && t < -8) {
|
|
456
464
|
W = !0;
|
|
457
465
|
return;
|
|
458
466
|
}
|
|
459
|
-
if (Math.abs(t) <
|
|
460
|
-
if (Math.abs(
|
|
461
|
-
|
|
467
|
+
if (Math.abs(t) < vt) return;
|
|
468
|
+
if (Math.abs(tr.value) > Math.abs(t)) {
|
|
469
|
+
Vn = !1;
|
|
462
470
|
return;
|
|
463
471
|
}
|
|
464
|
-
|
|
472
|
+
jr();
|
|
465
473
|
}
|
|
466
|
-
e.preventDefault(),
|
|
467
|
-
},
|
|
468
|
-
let t =
|
|
474
|
+
e.preventDefault(), Mr(t, e.timeStamp);
|
|
475
|
+
}, Pr = (e) => {
|
|
476
|
+
let t = dr(), n = J.value, r = ke({
|
|
469
477
|
heights: n.map((e) => e.height),
|
|
470
|
-
height:
|
|
471
|
-
velocity:
|
|
472
|
-
startIndex:
|
|
478
|
+
height: or.value - t,
|
|
479
|
+
velocity: Sr.velocity(e),
|
|
480
|
+
startIndex: Cr
|
|
473
481
|
});
|
|
474
|
-
if (
|
|
475
|
-
if (
|
|
476
|
-
|
|
482
|
+
if (z.value = !1, r === -1) {
|
|
483
|
+
if (b.value) {
|
|
484
|
+
D(300), Q(0);
|
|
477
485
|
return;
|
|
478
486
|
}
|
|
479
|
-
X.value = null,
|
|
487
|
+
X.value = null, Xn();
|
|
480
488
|
} else Q(r);
|
|
481
|
-
},
|
|
489
|
+
}, Fr = (e) => {
|
|
482
490
|
let t = $;
|
|
483
|
-
$ = !1,
|
|
484
|
-
},
|
|
491
|
+
$ = !1, er(), t && Pr(e);
|
|
492
|
+
}, Ir = null, Lr = (e) => {
|
|
485
493
|
if (e.pointerType !== "touch" && e.button === 0) {
|
|
486
|
-
|
|
494
|
+
Ir = e.pointerId;
|
|
487
495
|
try {
|
|
488
496
|
e.currentTarget.setPointerCapture(e.pointerId);
|
|
489
497
|
} catch {}
|
|
490
|
-
|
|
498
|
+
kr(e.clientY);
|
|
491
499
|
}
|
|
492
|
-
},
|
|
493
|
-
if (e.pointerId !==
|
|
494
|
-
let t = e.clientY -
|
|
500
|
+
}, Rr = (e) => {
|
|
501
|
+
if (e.pointerId !== Ir) return;
|
|
502
|
+
let t = e.clientY - Tr;
|
|
495
503
|
if (!$) {
|
|
496
|
-
if (Math.abs(t) <
|
|
497
|
-
|
|
504
|
+
if (Math.abs(t) < vt) return;
|
|
505
|
+
jr();
|
|
498
506
|
}
|
|
499
|
-
|
|
500
|
-
},
|
|
501
|
-
if (e.pointerId !==
|
|
502
|
-
|
|
507
|
+
Mr(t, e.timeStamp);
|
|
508
|
+
}, zr = (e) => {
|
|
509
|
+
if (e.pointerId !== Ir) return;
|
|
510
|
+
Ir = null;
|
|
503
511
|
let t = $;
|
|
504
|
-
$ = !1, t &&
|
|
505
|
-
},
|
|
506
|
-
if (
|
|
507
|
-
|
|
512
|
+
$ = !1, t && Pr(e.timeStamp);
|
|
513
|
+
}, Br = () => {
|
|
514
|
+
if (Er) {
|
|
515
|
+
Er = !1;
|
|
508
516
|
return;
|
|
509
517
|
}
|
|
510
518
|
let e = (Y.value + 1) % J.value.length;
|
|
511
519
|
Q(e);
|
|
512
|
-
},
|
|
520
|
+
}, Vr = (e) => {
|
|
513
521
|
let t = J.value.length - 1, n = {
|
|
514
522
|
ArrowUp: Y.value + 1,
|
|
515
523
|
ArrowRight: Y.value + 1,
|
|
@@ -524,147 +532,147 @@ var lt = [
|
|
|
524
532
|
e.preventDefault();
|
|
525
533
|
let r = Math.min(t, Math.max(0, n[e.key]));
|
|
526
534
|
r !== Y.value && Q(r);
|
|
527
|
-
},
|
|
535
|
+
}, Hr = a(() => J.value.length > 1), Ur = a(() => {
|
|
528
536
|
let e = J.value.length, t = Y.value, n = J.value[t];
|
|
529
|
-
return t === e - 1 && n && q.value - n.height < 1 ?
|
|
530
|
-
}),
|
|
531
|
-
if (!
|
|
537
|
+
return t === e - 1 && n && q.value - n.height < 1 ? y("offCanvas.snapFull").value : y("offCanvas.snapValue", t + 1, e).value;
|
|
538
|
+
}), Wr = (e) => {
|
|
539
|
+
if (!cr() || X.value === "drag") return;
|
|
532
540
|
let t = e.target;
|
|
533
541
|
if (!(t instanceof HTMLElement) || !t.closest(".bb-offcanvas__content")) return;
|
|
534
|
-
let n = (
|
|
542
|
+
let n = (x.value?.querySelector(".bb-offcanvas__footer"))?.getBoundingClientRect().top ?? oe.value;
|
|
535
543
|
t.getBoundingClientRect().bottom > n + 1 && Q(J.value.length - 1);
|
|
536
|
-
},
|
|
537
|
-
"--snap-h": `${
|
|
538
|
-
"--snap-floor": `${
|
|
544
|
+
}, Gr = a(() => K.value ? {
|
|
545
|
+
"--snap-h": `${or.value}px`,
|
|
546
|
+
"--snap-floor": `${Dr()}px`
|
|
539
547
|
} : {});
|
|
540
|
-
return
|
|
541
|
-
clearTimeout(Z), cancelAnimationFrame(
|
|
542
|
-
}),
|
|
543
|
-
id: p(
|
|
548
|
+
return nt(() => {
|
|
549
|
+
clearTimeout(Z), cancelAnimationFrame(fr);
|
|
550
|
+
}), rt(() => k("unmounted")), (e, t) => (u(), s("dialog", l({
|
|
551
|
+
id: p(_).domId.value || void 0,
|
|
544
552
|
ref_key: "dialog",
|
|
545
|
-
ref:
|
|
546
|
-
"aria-describedby":
|
|
547
|
-
"aria-labelledby":
|
|
553
|
+
ref: x,
|
|
554
|
+
"aria-describedby": Bt.value && Ht() ? Vt : void 0,
|
|
555
|
+
"aria-labelledby": Bt.value && (jt() || e.$slots.header) ? w : void 0,
|
|
548
556
|
class: ["bb-offcanvas", [{
|
|
549
557
|
"bb-offcanvas--open": c.value,
|
|
550
|
-
"bb-offcanvas--visible":
|
|
551
|
-
"bb-offcanvas--fullscreen":
|
|
552
|
-
"bb-offcanvas--deny-close":
|
|
553
|
-
"bb-offcanvas--dragging":
|
|
554
|
-
"bb-offcanvas--swipe-exit":
|
|
555
|
-
"bb-offcanvas--instant-stack":
|
|
556
|
-
"bb-offcanvas--covered":
|
|
557
|
-
"bb-offcanvas--above":
|
|
558
|
+
"bb-offcanvas--visible": E.value,
|
|
559
|
+
"bb-offcanvas--fullscreen": gn.value,
|
|
560
|
+
"bb-offcanvas--deny-close": fn.value,
|
|
561
|
+
"bb-offcanvas--dragging": z.value,
|
|
562
|
+
"bb-offcanvas--swipe-exit": B.value,
|
|
563
|
+
"bb-offcanvas--instant-stack": Rn.value,
|
|
564
|
+
"bb-offcanvas--covered": Nn.value,
|
|
565
|
+
"bb-offcanvas--above": Fn.value,
|
|
558
566
|
"bb-offcanvas--has-handle": i.draggable,
|
|
559
|
-
"bb-offcanvas--no-header": !
|
|
560
|
-
"bb-offcanvas--keyboard": p(
|
|
567
|
+
"bb-offcanvas--no-header": !Mt(),
|
|
568
|
+
"bb-offcanvas--keyboard": p(S) > 0,
|
|
561
569
|
"bb-offcanvas--snap": K.value,
|
|
562
|
-
"bb-offcanvas--snap-low":
|
|
570
|
+
"bb-offcanvas--snap-low": cr(),
|
|
563
571
|
"bb-offcanvas--snap-settling": X.value === "settle",
|
|
564
572
|
"bb-offcanvas--snap-instant": X.value === "instant",
|
|
565
|
-
[`bb-offcanvas--${
|
|
573
|
+
[`bb-offcanvas--${j.value}`]: !0
|
|
566
574
|
}].flat()],
|
|
567
|
-
inert: !c.value && !
|
|
575
|
+
inert: !c.value && !E.value || Nn.value,
|
|
568
576
|
style: {
|
|
569
|
-
"--max-size":
|
|
570
|
-
...
|
|
571
|
-
"--transition-duration": `${
|
|
572
|
-
"--stack-gap": `${
|
|
573
|
-
"--keyboard": `${p(
|
|
574
|
-
...
|
|
575
|
-
...
|
|
577
|
+
"--max-size": cn.value,
|
|
578
|
+
...nn.value,
|
|
579
|
+
"--transition-duration": `${g.transitionDuration}ms`,
|
|
580
|
+
"--stack-gap": `${g.stackGap}px`,
|
|
581
|
+
"--keyboard": `${p(S)}px`,
|
|
582
|
+
...Ln.value,
|
|
583
|
+
...Gr.value
|
|
576
584
|
}
|
|
577
|
-
},
|
|
578
|
-
onCancel:
|
|
579
|
-
onCommand:
|
|
580
|
-
onClick:
|
|
581
|
-
onFocusin:
|
|
582
|
-
onPointercancel:
|
|
583
|
-
onPointerdown:
|
|
584
|
-
}, p(
|
|
585
|
-
|
|
586
|
-
i.draggable && !
|
|
587
|
-
key: `body-1-${
|
|
585
|
+
}, ot(p(xe), !0), {
|
|
586
|
+
onCancel: ut(ln, ["self"]),
|
|
587
|
+
onCommand: dn,
|
|
588
|
+
onClick: ut(Kt, ["self"]),
|
|
589
|
+
onFocusin: Wr,
|
|
590
|
+
onPointercancel: Wt,
|
|
591
|
+
onPointerdown: Gt
|
|
592
|
+
}, p(v).rootAttrs), [
|
|
593
|
+
Bt.value ? (u(), s(Je, { key: 0 }, [
|
|
594
|
+
i.draggable && !Hr.value ? (u(), s("div", {
|
|
595
|
+
key: `body-1-${C.value}`,
|
|
588
596
|
"aria-hidden": "true",
|
|
589
597
|
class: "bb-offcanvas__handle"
|
|
590
598
|
})) : o("", !0),
|
|
591
|
-
|
|
592
|
-
key: `body-2-${
|
|
599
|
+
Mt() ? (u(), s("div", l({
|
|
600
|
+
key: `body-2-${C.value}`,
|
|
593
601
|
class: "bb-offcanvas__header"
|
|
594
|
-
}, p(
|
|
595
|
-
close:
|
|
596
|
-
complete: p(
|
|
597
|
-
data: p(
|
|
598
|
-
reset: p(
|
|
602
|
+
}, p(v).header), [f(e.$slots, "header", {
|
|
603
|
+
close: A,
|
|
604
|
+
complete: p(_).complete,
|
|
605
|
+
data: p(_).data.value,
|
|
606
|
+
reset: p(_).reset,
|
|
599
607
|
title: i.title,
|
|
600
|
-
titleId:
|
|
608
|
+
titleId: w
|
|
601
609
|
}, () => [
|
|
602
|
-
|
|
610
|
+
jt() ? (u(), s("span", l({
|
|
603
611
|
key: 0,
|
|
604
|
-
id:
|
|
612
|
+
id: w,
|
|
605
613
|
class: "bb-offcanvas__title"
|
|
606
|
-
}, p(
|
|
607
|
-
data: p(
|
|
614
|
+
}, p(v).title), [f(e.$slots, "title", {
|
|
615
|
+
data: p(_).data.value,
|
|
608
616
|
text: i.title
|
|
609
|
-
}, () => [
|
|
610
|
-
|
|
617
|
+
}, () => [Ze(at(i.title), 1)])], 16)) : o("", !0),
|
|
618
|
+
Ht() ? (u(), s("p", l({
|
|
611
619
|
key: 1,
|
|
612
|
-
id:
|
|
620
|
+
id: Vt,
|
|
613
621
|
class: "bb-offcanvas__description"
|
|
614
|
-
}, p(
|
|
615
|
-
data: p(
|
|
622
|
+
}, p(v).description), [f(e.$slots, "description", {
|
|
623
|
+
data: p(_).data.value,
|
|
616
624
|
text: i.description
|
|
617
|
-
}, () => [
|
|
618
|
-
i.hideClose ? o("", !0) : (u(),
|
|
625
|
+
}, () => [Ze(at(i.description), 1)])], 16)) : o("", !0),
|
|
626
|
+
i.hideClose ? o("", !0) : (u(), Ye(Te, l({
|
|
619
627
|
key: 2,
|
|
620
|
-
"aria-label":
|
|
621
|
-
},
|
|
628
|
+
"aria-label": At.value
|
|
629
|
+
}, Dt.value), null, 16, ["aria-label"]))
|
|
622
630
|
])], 16)) : o("", !0),
|
|
623
631
|
(u(), s("div", l({
|
|
624
|
-
key: `body-3-${
|
|
632
|
+
key: `body-3-${C.value}`,
|
|
625
633
|
ref_key: "body",
|
|
626
|
-
ref:
|
|
634
|
+
ref: R,
|
|
627
635
|
class: "bb-offcanvas__content scrollbar-border"
|
|
628
|
-
}, p(
|
|
629
|
-
close:
|
|
630
|
-
complete: p(
|
|
631
|
-
data: p(
|
|
632
|
-
reset: p(
|
|
633
|
-
}), !
|
|
636
|
+
}, p(v).content), [Xe("div", pt, [f(e.$slots, "default", {
|
|
637
|
+
close: A,
|
|
638
|
+
complete: p(_).complete,
|
|
639
|
+
data: p(_).data.value,
|
|
640
|
+
reset: p(_).reset
|
|
641
|
+
}), !Mt() && !i.hideClose ? (u(), Ye(Te, l({
|
|
634
642
|
key: 0,
|
|
635
|
-
"aria-label":
|
|
636
|
-
},
|
|
643
|
+
"aria-label": At.value
|
|
644
|
+
}, Dt.value), null, 16, ["aria-label"])) : o("", !0)])], 16)),
|
|
637
645
|
(u(), s("div", l({
|
|
638
|
-
key: `body-4-${
|
|
646
|
+
key: `body-4-${C.value}`,
|
|
639
647
|
class: "bb-offcanvas__footer"
|
|
640
|
-
}, p(
|
|
641
|
-
close:
|
|
642
|
-
complete: p(
|
|
643
|
-
data: p(
|
|
644
|
-
reset: p(
|
|
645
|
-
}, () => [
|
|
648
|
+
}, p(v).footer), [f(e.$slots, "footer", {
|
|
649
|
+
close: A,
|
|
650
|
+
complete: p(_).complete,
|
|
651
|
+
data: p(_).data.value,
|
|
652
|
+
reset: p(_).reset
|
|
653
|
+
}, () => [Qe(It)])], 16))
|
|
646
654
|
], 64)) : o("", !0),
|
|
647
|
-
|
|
655
|
+
Bt.value && Hr.value ? (u(), s("div", {
|
|
648
656
|
key: 1,
|
|
649
|
-
"aria-label": p(
|
|
657
|
+
"aria-label": p(y)("offCanvas.snapLabel").value,
|
|
650
658
|
"aria-orientation": "vertical",
|
|
651
659
|
"aria-valuemax": J.value.length,
|
|
652
660
|
"aria-valuemin": "1",
|
|
653
661
|
"aria-valuenow": Y.value + 1,
|
|
654
|
-
"aria-valuetext":
|
|
662
|
+
"aria-valuetext": Ur.value,
|
|
655
663
|
class: "bb-offcanvas__handle bb-offcanvas__handle--slider",
|
|
656
664
|
role: "slider",
|
|
657
665
|
tabindex: "0",
|
|
658
|
-
onClick:
|
|
659
|
-
onKeydown:
|
|
660
|
-
onLostpointercapture:
|
|
661
|
-
onPointercancel:
|
|
662
|
-
onPointerdown:
|
|
663
|
-
onPointermove:
|
|
664
|
-
onPointerup:
|
|
665
|
-
}, null, 40,
|
|
666
|
-
|
|
667
|
-
], 16,
|
|
666
|
+
onClick: Br,
|
|
667
|
+
onKeydown: Vr,
|
|
668
|
+
onLostpointercapture: zr,
|
|
669
|
+
onPointercancel: zr,
|
|
670
|
+
onPointerdown: Lr,
|
|
671
|
+
onPointermove: Rr,
|
|
672
|
+
onPointerup: zr
|
|
673
|
+
}, null, 40, mt)) : o("", !0),
|
|
674
|
+
Xe("span", ht, at(p(Jt).text.value), 1)
|
|
675
|
+
], 16, ft));
|
|
668
676
|
}
|
|
669
677
|
});
|
|
670
|
-
export {
|
|
678
|
+
export { h as default };
|