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
|
@@ -2,29 +2,31 @@ import { asSheetAttrs as e } from "../BbOffCanvas/sheetAttrs.js";
|
|
|
2
2
|
import { useConfig as t } from "../../composables/useConfig.js";
|
|
3
3
|
import { useConfigDefaults as n, useConfigSetting as r } from "../../composables/useConfigDefaults.js";
|
|
4
4
|
import { useId as i } from "../../composables/useId.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
5
|
+
import { useOwnModel as a } from "../../composables/useOwnModel.js";
|
|
6
|
+
import { extractDomContainer as o } from "../../utilities/functions/extractDomContainer.js";
|
|
7
|
+
import { useLocale as s } from "../../composables/useLocale.js";
|
|
8
|
+
import { useLogger as c } from "../../composables/useLogger.js";
|
|
9
|
+
import { useEscapeStackEntry as ee } from "../../composables/useEscapeStackEntry.js";
|
|
10
|
+
import { useMobile as te } from "../../composables/useMobile.js";
|
|
10
11
|
import { transitions as l } from "../../utilities/misc/transitions.js";
|
|
11
|
-
import
|
|
12
|
-
import { spokenTimeOf as
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
12
|
+
import ne from "../CommonTimeSelector/CommonTimeSelector.vue.js";
|
|
13
|
+
import { spokenTimeOf as re } from "../BbCalendar/useDayjsLocale.js";
|
|
14
|
+
import { useHydrated as ie } from "../../composables/useHydrated.js";
|
|
15
|
+
import ae from "../BbOffCanvas/BbOffCanvas.vue.js";
|
|
16
|
+
import { BB_OFF_CANVAS_PT as oe } from "../BbOffCanvas/types.js";
|
|
17
|
+
import se from "../CommonPopover/CommonPopover.vue.js";
|
|
16
18
|
import { BB_TIME_PICKER_PT as u } from "./types.js";
|
|
17
|
-
import { usePassthrough as
|
|
18
|
-
import { firstFocusableMatch as
|
|
19
|
-
import { withoutPt as
|
|
20
|
-
import { Fragment as d, computed as f, createBlock as p, createCommentVNode as m, createElementBlock as h, createElementVNode as
|
|
21
|
-
import { createReusableTemplate as
|
|
19
|
+
import { usePassthrough as ce } from "../../composables/usePassthrough.js";
|
|
20
|
+
import { firstFocusableMatch as le } from "../../utils/focusVisibility.js";
|
|
21
|
+
import { withoutPt as ue } from "../../utils/passthrough.js";
|
|
22
|
+
import { Fragment as d, computed as f, createBlock as p, createCommentVNode as m, createElementBlock as h, createElementVNode as de, createVNode as g, defineComponent as _, guardReactiveProps as v, mergeProps as y, nextTick as fe, normalizeClass as pe, normalizeProps as me, onBeforeUnmount as he, onDeactivated as ge, openBlock as b, ref as x, renderList as _e, renderSlot as ve, toDisplayString as S, unref as C, useAttrs as ye, watch as w, withCtx as T } from "vue";
|
|
23
|
+
import { createReusableTemplate as be } from "@vueuse/core";
|
|
22
24
|
// src/components/BbTimePicker/BbTimePicker.vue?vue&type=script&setup=true&lang.ts
|
|
23
|
-
var
|
|
25
|
+
var xe = ["aria-label"], Se = [
|
|
24
26
|
"aria-pressed",
|
|
25
27
|
"disabled",
|
|
26
28
|
"onClick"
|
|
27
|
-
], E = /*@__PURE__*/
|
|
29
|
+
], E = /*@__PURE__*/ _({
|
|
28
30
|
inheritAttrs: !1,
|
|
29
31
|
__name: "BbTimePicker",
|
|
30
32
|
props: {
|
|
@@ -84,8 +86,8 @@ var ye = ["aria-label"], be = [
|
|
|
84
86
|
"error",
|
|
85
87
|
"time-pick"
|
|
86
88
|
],
|
|
87
|
-
setup(l, { emit:
|
|
88
|
-
let E = l,
|
|
89
|
+
setup(l, { emit: _ }) {
|
|
90
|
+
let E = l, Ce = _, we = r(null, "popoverOffset"), D = E, O = Ce, { model: k, set: A } = a(D, "modelValue", (e, t) => O(e, t), () => D.range ? [] : null), j = ce({
|
|
89
91
|
component: "BbTimePicker",
|
|
90
92
|
props: D,
|
|
91
93
|
parts: u.parts,
|
|
@@ -94,92 +96,96 @@ var ye = ["aria-label"], be = [
|
|
|
94
96
|
open: () => H.value,
|
|
95
97
|
disabled: () => !!D.disabled
|
|
96
98
|
},
|
|
97
|
-
attrs:
|
|
98
|
-
}),
|
|
99
|
-
let e = (e) =>
|
|
99
|
+
attrs: ye()
|
|
100
|
+
}), Te = t(), { isHydrated: Ee } = ie(), De = f(() => {
|
|
101
|
+
let e = (e) => re(e, Te.locale, !!D.ampm, !!D.seconds, Ee.value), t = k.value;
|
|
100
102
|
return Array.isArray(t) ? t.filter(Boolean).map(e).join(" – ") : t ? e(t) : "";
|
|
101
|
-
}), { t:
|
|
102
|
-
id:
|
|
103
|
-
class: ["bb-time-picker__panel", { "bb-time-picker__panel--sheet":
|
|
104
|
-
},
|
|
103
|
+
}), { t: M } = s(), { isMobile: N } = te(), Oe = c(), [ke, Ae] = be(), P = i().id.value, F = `${P}-panel`, je = f(() => y({
|
|
104
|
+
id: F,
|
|
105
|
+
class: ["bb-time-picker__panel", { "bb-time-picker__panel--sheet": Q.value }]
|
|
106
|
+
}, Q.value ? {} : j.panel ?? {})), I = /^(\d{1,2}):(\d{1,2})(?::(\d{1,2}))?$/, L = (e) => {
|
|
105
107
|
let t = I.exec(e);
|
|
106
108
|
if (!t) return null;
|
|
107
109
|
let n = parseInt(t[1], 10), r = parseInt(t[2], 10);
|
|
108
110
|
return n > 23 || r > 59 ? null : n * 60 + r;
|
|
109
111
|
};
|
|
110
|
-
for (let [e, t] of [["min", D.min], ["max", D.max]]) t && L(t) === null &&
|
|
111
|
-
let R = f(() => D.activeSegment ?? z.value), z = x("start"),
|
|
112
|
+
for (let [e, t] of [["min", D.min], ["max", D.max]]) t && L(t) === null && Oe.throw(`BbTimePicker: ${e} must be in the format HH:mm`);
|
|
113
|
+
let R = f(() => D.activeSegment ?? z.value), z = x("start"), Me = (e) => {
|
|
112
114
|
z.value = e, O("update:activeSegment", e);
|
|
113
|
-
},
|
|
115
|
+
}, Ne = f(() => [{
|
|
114
116
|
value: "start",
|
|
115
|
-
label:
|
|
117
|
+
label: M("timePickerInput.start").value
|
|
116
118
|
}, {
|
|
117
119
|
value: "end",
|
|
118
|
-
label:
|
|
119
|
-
}]),
|
|
120
|
-
B.value =
|
|
121
|
-
},
|
|
122
|
-
V.value =
|
|
120
|
+
label: M("timePickerInput.end").value
|
|
121
|
+
}]), Pe = f(() => `${M("timePickerInput.start").value} / ${M("timePickerInput.end").value}`), B = x(), V = x(), Fe = f(() => D.activator != null), Ie = (e) => {
|
|
122
|
+
B.value = o(e) ?? void 0;
|
|
123
|
+
}, Le = (e) => {
|
|
124
|
+
V.value = o(e) ?? void 0;
|
|
123
125
|
};
|
|
124
126
|
w(() => D.activator, (e) => {
|
|
125
|
-
B.value =
|
|
127
|
+
B.value = o(e) ?? void 0;
|
|
126
128
|
}, { immediate: !0 }), w(() => D.anchor, (e) => {
|
|
127
|
-
V.value = e == null ? void 0 :
|
|
129
|
+
V.value = e == null ? void 0 : o(e) ?? void 0;
|
|
128
130
|
}, { immediate: !0 });
|
|
129
|
-
let
|
|
130
|
-
D.disabled || D.readonly || (e.stopPropagation(), H.value || (
|
|
131
|
+
let Re = f(() => V.value ?? B.value), H = x(!1), U = null, W = (e) => {
|
|
132
|
+
D.disabled || D.readonly || (e.stopPropagation(), H.value || (Z.value = X()), H.value = !H.value);
|
|
131
133
|
}, G = (e) => {
|
|
132
|
-
|
|
134
|
+
let t = e.target;
|
|
135
|
+
t instanceof Node && ((document.getElementById(F)?.closest(".bb-common-popover"))?.contains(t) || B.value?.contains(t) || (H.value = !1));
|
|
133
136
|
};
|
|
134
137
|
w(H, async (e) => {
|
|
135
|
-
e ? (U = document.activeElement instanceof HTMLElement ? document.activeElement : null,
|
|
138
|
+
e ? (U = document.activeElement instanceof HTMLElement ? document.activeElement : null, Q.value || document.addEventListener("click", G, {
|
|
139
|
+
passive: !0,
|
|
140
|
+
capture: !0
|
|
141
|
+
}), await fe(), le(document.getElementById(F), "[tabindex=\"0\"]")?.focus()) : (document.removeEventListener("click", G, { capture: !0 }), U?.focus(), U = null);
|
|
136
142
|
});
|
|
137
143
|
let K = null, q = x();
|
|
138
144
|
w(B, (e) => {
|
|
139
145
|
if (K?.(), K = null, !e) return;
|
|
140
146
|
let t = !e.id;
|
|
141
|
-
t && (e.id = `${
|
|
147
|
+
t && (e.id = `${P}_activator`), q.value = e.id, e.addEventListener("click", W), K = () => {
|
|
142
148
|
e.removeEventListener("click", W), e.removeAttribute("aria-haspopup"), e.removeAttribute("aria-expanded"), e.removeAttribute("aria-labelledby"), e.removeAttribute("aria-controls"), t && e.removeAttribute("id"), q.value = void 0;
|
|
143
149
|
};
|
|
144
150
|
}, { immediate: !0 });
|
|
145
|
-
let
|
|
151
|
+
let J = f(() => D.label ?? M("timePickerInput.openPicker").value), Y = `${P}_label`, ze = f(() => q.value ? `${Y} ${q.value}` : Y);
|
|
146
152
|
w([B, H], ([e, t]) => {
|
|
147
|
-
e && (e.setAttribute("aria-haspopup", "dialog"), e.setAttribute("aria-expanded", t ? "true" : "false"), e.setAttribute("aria-labelledby", `${
|
|
148
|
-
}, { immediate: !0 }),
|
|
149
|
-
K?.(), document.removeEventListener("click", G);
|
|
153
|
+
e && (e.setAttribute("aria-haspopup", "dialog"), e.setAttribute("aria-expanded", t ? "true" : "false"), e.setAttribute("aria-labelledby", `${Y} ${e.id}`), t ? e.setAttribute("aria-controls", F) : e.removeAttribute("aria-controls"));
|
|
154
|
+
}, { immediate: !0 }), he(() => {
|
|
155
|
+
K?.(), document.removeEventListener("click", G, { capture: !0 });
|
|
150
156
|
});
|
|
151
|
-
let
|
|
157
|
+
let Be = n("BbTimePicker", D, { adaptive: !0 }), X = () => Be.adaptive && N.value ? "canvas" : "popover", Z = x(X()), Q = f(() => Z.value === "canvas");
|
|
152
158
|
w([
|
|
153
|
-
() =>
|
|
154
|
-
|
|
159
|
+
() => Be.adaptive,
|
|
160
|
+
N,
|
|
155
161
|
H
|
|
156
162
|
], () => {
|
|
157
|
-
H.value || (
|
|
158
|
-
}),
|
|
159
|
-
let
|
|
163
|
+
H.value || (Z.value = X());
|
|
164
|
+
}), ee(() => H.value && !Q.value, () => H.value = !1);
|
|
165
|
+
let Ve = f(() => ({
|
|
160
166
|
side: "bottom",
|
|
161
167
|
size: "auto",
|
|
162
168
|
draggable: !0,
|
|
163
169
|
transitionDuration: D.transitionDuration,
|
|
164
170
|
hideClose: !0,
|
|
165
|
-
...D.offCanvasProps?.title ? {} : { "aria-labelledby":
|
|
166
|
-
...
|
|
167
|
-
})),
|
|
171
|
+
...D.offCanvasProps?.title ? {} : { "aria-labelledby": ze.value },
|
|
172
|
+
...ue(D.offCanvasProps)
|
|
173
|
+
})), He = () => {
|
|
168
174
|
B.value?.focus(), O("hidden");
|
|
169
|
-
},
|
|
170
|
-
let t =
|
|
171
|
-
return t == null ? null : Array.isArray(t) ? t[
|
|
172
|
-
},
|
|
173
|
-
let t =
|
|
175
|
+
}, Ue = (e) => +(e === "end"), We = (e) => {
|
|
176
|
+
let t = k.value;
|
|
177
|
+
return t == null ? null : Array.isArray(t) ? t[Ue(e)] ?? null : e === "start" && typeof t == "string" ? t : null;
|
|
178
|
+
}, Ge = (e) => {
|
|
179
|
+
let t = We(e), n = t ? I.exec(t) : null;
|
|
174
180
|
return n ? {
|
|
175
181
|
hour: n[1].padStart(2, "0"),
|
|
176
182
|
minute: n[2].padStart(2, "0"),
|
|
177
183
|
second: (n[3] ?? "").padStart(n[3] ? 2 : 0, "0")
|
|
178
184
|
} : null;
|
|
179
|
-
}, $ = f(() =>
|
|
185
|
+
}, $ = f(() => Ge(R.value)), Ke = f(() => $.value?.hour ?? ""), qe = f(() => $.value?.minute ?? ""), Je = f(() => $.value?.second ?? ""), Ye = (e) => D.seconds ? `${e.hour}:${e.minute}:${e.second || "00"}` : `${e.hour}:${e.minute}`, Xe = (e) => {
|
|
180
186
|
let t = L(e);
|
|
181
187
|
return t === null ? e : D.min && t < L(D.min) ? D.min + (D.seconds ? ":00" : "") : D.max && t > L(D.max) ? D.max + (D.seconds ? ":00" : "") : e;
|
|
182
|
-
},
|
|
188
|
+
}, Ze = (e) => {
|
|
183
189
|
O("time-pick", e);
|
|
184
190
|
let t = R.value, n = $.value ? { ...$.value } : {
|
|
185
191
|
hour: "",
|
|
@@ -191,63 +197,63 @@ var ye = ["aria-label"], be = [
|
|
|
191
197
|
r && t < 12 && (t += 12), !r && t >= 12 && (t -= 12), n.hour = String(t).padStart(2, "0");
|
|
192
198
|
} else n[e.unit] = e.value;
|
|
193
199
|
n.hour ||= "00", n.minute ||= "00", D.seconds && !n.second && (n.second = "00");
|
|
194
|
-
let r =
|
|
200
|
+
let r = Ye(n), i = Xe(r);
|
|
195
201
|
if (i !== r && O("error", {
|
|
196
202
|
code: "disabled_time",
|
|
197
203
|
original: r,
|
|
198
204
|
normalized: i
|
|
199
205
|
}), !D.range) {
|
|
200
|
-
|
|
206
|
+
A(i);
|
|
201
207
|
return;
|
|
202
208
|
}
|
|
203
|
-
let a =
|
|
204
|
-
o && c.push(o), s && c.push(s),
|
|
209
|
+
let a = We(t === "start" ? "end" : "start"), o = t === "start" ? i : a, s = t === "start" ? a : i, c = [];
|
|
210
|
+
o && c.push(o), s && c.push(s), A(c);
|
|
205
211
|
};
|
|
206
|
-
return
|
|
212
|
+
return ge(() => {
|
|
207
213
|
H.value = !1;
|
|
208
214
|
}), (t, n) => (b(), h(d, null, [
|
|
209
|
-
|
|
215
|
+
Fe.value ? m("", !0) : ve(t.$slots, "activator", me(v({
|
|
210
216
|
props: {
|
|
211
|
-
ref:
|
|
217
|
+
ref: Ie,
|
|
212
218
|
"aria-haspopup": "dialog",
|
|
213
219
|
"aria-expanded": H.value ? "true" : "false",
|
|
214
|
-
"aria-labelledby":
|
|
220
|
+
"aria-labelledby": ze.value
|
|
215
221
|
},
|
|
216
|
-
anchorProps: { ref:
|
|
222
|
+
anchorProps: { ref: Le },
|
|
217
223
|
open: H.value,
|
|
218
|
-
value:
|
|
219
|
-
text:
|
|
224
|
+
value: C(k),
|
|
225
|
+
text: De.value,
|
|
220
226
|
disabled: !!l.disabled
|
|
221
227
|
})), void 0, void 0, 0),
|
|
222
|
-
|
|
223
|
-
id:
|
|
228
|
+
de("span", {
|
|
229
|
+
id: Y,
|
|
224
230
|
hidden: ""
|
|
225
|
-
}, S(
|
|
226
|
-
|
|
231
|
+
}, S(J.value), 1),
|
|
232
|
+
g(C(ke), null, {
|
|
227
233
|
default: T(() => [l.range ? (b(), h("div", {
|
|
228
234
|
key: 0,
|
|
229
|
-
"aria-label":
|
|
235
|
+
"aria-label": Pe.value,
|
|
230
236
|
class: "bb-time-picker__segments",
|
|
231
237
|
role: "group"
|
|
232
|
-
}, [(b(!0), h(d, null,
|
|
238
|
+
}, [(b(!0), h(d, null, _e(Ne.value, (e) => (b(), h("button", {
|
|
233
239
|
key: e.value,
|
|
234
240
|
"aria-pressed": R.value === e.value,
|
|
235
|
-
class:
|
|
241
|
+
class: pe(["bb-time-picker__segment", { "bb-time-picker__segment--active": R.value === e.value }]),
|
|
236
242
|
disabled: l.disabled || l.readonly,
|
|
237
243
|
type: "button",
|
|
238
|
-
onClick: (t) =>
|
|
239
|
-
}, S(e.label), 11,
|
|
244
|
+
onClick: (t) => Me(e.value)
|
|
245
|
+
}, S(e.label), 11, Se))), 128))], 8, xe)) : m("", !0), g(ne, {
|
|
240
246
|
ampm: l.ampm,
|
|
241
247
|
disabled: l.disabled || l.readonly,
|
|
242
|
-
hour:
|
|
248
|
+
hour: Ke.value,
|
|
243
249
|
max: l.max,
|
|
244
250
|
min: l.min,
|
|
245
|
-
minute:
|
|
246
|
-
passthrough: C(
|
|
247
|
-
second:
|
|
251
|
+
minute: qe.value,
|
|
252
|
+
passthrough: C(j),
|
|
253
|
+
second: Je.value,
|
|
248
254
|
seconds: l.seconds,
|
|
249
255
|
step: l.step,
|
|
250
|
-
onSelect:
|
|
256
|
+
onSelect: Ze
|
|
251
257
|
}, null, 8, [
|
|
252
258
|
"ampm",
|
|
253
259
|
"disabled",
|
|
@@ -262,37 +268,37 @@ var ye = ["aria-label"], be = [
|
|
|
262
268
|
])]),
|
|
263
269
|
_: 1
|
|
264
270
|
}),
|
|
265
|
-
|
|
271
|
+
Q.value ? (b(), p(ae, y({
|
|
266
272
|
key: 1,
|
|
267
273
|
modelValue: H.value,
|
|
268
274
|
"onUpdate:modelValue": n[0] ||= (e) => H.value = e,
|
|
269
275
|
class: "bb-time-picker__sheet",
|
|
270
|
-
pt: C(
|
|
276
|
+
pt: C(j).forward({
|
|
271
277
|
panel: "root",
|
|
272
278
|
sheet: "root"
|
|
273
|
-
}, C(
|
|
274
|
-
},
|
|
275
|
-
onHidden:
|
|
279
|
+
}, C(oe).states, () => l.offCanvasProps?.pt)
|
|
280
|
+
}, y(Ve.value, C(e)(C(j).forwardAttrs)), {
|
|
281
|
+
onHidden: He,
|
|
276
282
|
onHide: n[1] ||= (e) => C(O)("hide"),
|
|
277
283
|
onShow: n[2] ||= (e) => C(O)("show"),
|
|
278
284
|
onShown: n[3] ||= (e) => C(O)("shown")
|
|
279
285
|
}), {
|
|
280
|
-
default: T(() => [
|
|
286
|
+
default: T(() => [de("div", me(v(je.value)), [g(C(Ae))], 16)]),
|
|
281
287
|
_: 1
|
|
282
|
-
}, 16, ["modelValue", "pt"])) : (b(), p(
|
|
288
|
+
}, 16, ["modelValue", "pt"])) : (b(), p(se, y({
|
|
283
289
|
key: 2,
|
|
284
290
|
modelValue: H.value,
|
|
285
291
|
"onUpdate:modelValue": n[4] ||= (e) => H.value = e,
|
|
286
|
-
anchor:
|
|
287
|
-
"aria-label":
|
|
292
|
+
anchor: Re.value,
|
|
293
|
+
"aria-label": J.value,
|
|
288
294
|
boundary: l.boundary,
|
|
289
|
-
"bubble-attrs":
|
|
295
|
+
"bubble-attrs": je.value,
|
|
290
296
|
class: "bb-time-picker",
|
|
291
297
|
dialog: "",
|
|
292
298
|
"disable-flip": l.disableFlip,
|
|
293
299
|
eager: l.eager,
|
|
294
300
|
"hide-arrow": "",
|
|
295
|
-
offset: l.offset ?? C(
|
|
301
|
+
offset: l.offset ?? C(we)() ?? 4,
|
|
296
302
|
padding: l.padding,
|
|
297
303
|
placement: l.placement,
|
|
298
304
|
"transition-duration": l.transitionDuration,
|
|
@@ -300,8 +306,8 @@ var ye = ["aria-label"], be = [
|
|
|
300
306
|
onHide: n[6] ||= (e) => C(O)("hide"),
|
|
301
307
|
onShow: n[7] ||= (e) => C(O)("show"),
|
|
302
308
|
onShown: n[8] ||= (e) => C(O)("shown")
|
|
303
|
-
}, C(
|
|
304
|
-
default: T(() => [
|
|
309
|
+
}, C(j).rootAttrs), {
|
|
310
|
+
default: T(() => [g(C(Ae))]),
|
|
305
311
|
_: 1
|
|
306
312
|
}, 16, [
|
|
307
313
|
"modelValue",
|
|
@@ -94,7 +94,7 @@ export type BbTimePickerBaseProps = BbTimePickerPtProps & {
|
|
|
94
94
|
* v-model value: `null` for empty, a 24-hour `HH:mm` (or `HH:mm:ss` with
|
|
95
95
|
* `seconds`) string, or a two-element `[start, end]` array when `range` is true.
|
|
96
96
|
*/
|
|
97
|
-
modelValue
|
|
97
|
+
modelValue?: string | string[] | null;
|
|
98
98
|
/**
|
|
99
99
|
* Which end the columns edit in range mode (`v-model:active-segment`).
|
|
100
100
|
* Standalone use manages this internally via the in-panel toggle; a host can
|
|
@@ -180,7 +180,7 @@ export type BbTimePickerBaseProps = BbTimePickerPtProps & {
|
|
|
180
180
|
*/
|
|
181
181
|
export type BbTimePickerModelProps<R extends boolean = boolean> = {
|
|
182
182
|
range?: R;
|
|
183
|
-
modelValue
|
|
183
|
+
modelValue?: PtNoInfer<BbTimeModel<R>>;
|
|
184
184
|
};
|
|
185
185
|
export type BbTimePickerProps<R extends boolean = boolean> = BbTimePickerBaseProps & BbTimePickerModelProps<R>;
|
|
186
186
|
export type BbTimePickerEvents<R extends boolean = boolean> = {
|