bitboss-ui 3.0.0-beta.72 → 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 +34 -7
- 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 +17 -4
- package/dist/ai/BbDropdown.md +23 -10
- package/dist/ai/BbDropdownButton.md +2 -2
- package/dist/ai/BbForm.md +11 -7
- 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 +60 -4
- package/dist/ai/components.json +56 -20
- 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/components/use-confirm.md +4 -1
- 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/BbConfirm.removed.json +4 -4
- package/dist/ai/manifest/components/BbConfirmPortal.json +1 -1
- package/dist/ai/manifest/components/BbConfirmPortal.removed.json +2 -2
- 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/BbToast.removed.json +1 -1
- 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 +80 -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/deprecation/ai-deprecations.json.js +1 -1
- 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 +874 -136
- 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 +123 -3
- package/dist/utilities/functions/isEqual.js +69 -3
- package/dist/utils/versionCheck.js +1 -1
- package/dist/vite-plugin.d.ts +2 -1
- package/dist/vite.js +8 -5
- package/llms.txt +3 -1
- package/package.json +2 -3
- package/scripts/README.md +43 -43
- 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/helpers-add.mjs +21 -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 +153 -6
- 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
|
@@ -130,7 +130,7 @@ export type BbColorPaletteProps = BbColorPalettePtProps & {
|
|
|
130
130
|
* v-model: the current color as a `#RRGGBB` hex string (or `#RRGGBBAA` when
|
|
131
131
|
* `alpha` is enabled), or `null` when empty.
|
|
132
132
|
*/
|
|
133
|
-
modelValue
|
|
133
|
+
modelValue?: string | null;
|
|
134
134
|
/**
|
|
135
135
|
* Space the floating container will maintain from the activator.
|
|
136
136
|
*
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BbConfirmPortalSlots } from './types.js';
|
|
2
2
|
type __VLS_Props = {
|
|
3
3
|
/** The name a confirm passes as `portal: '<name>'` to render this content. */
|
|
4
4
|
name: string;
|
|
5
5
|
};
|
|
6
|
-
type __VLS_Slots =
|
|
7
|
-
default?: (scope: BbConfirmPortalSlotProps) => any;
|
|
8
|
-
};
|
|
6
|
+
type __VLS_Slots = BbConfirmPortalSlots;
|
|
9
7
|
declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
10
8
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
11
9
|
declare const _default: typeof __VLS_export;
|
|
@@ -70,4 +70,9 @@ export type BbConfirmPortalSlotProps<P = any> = {
|
|
|
70
70
|
/** Resolves the confirm with `false` (through `cancel.onClick` when set). */
|
|
71
71
|
cancel: () => void;
|
|
72
72
|
};
|
|
73
|
+
/** BbConfirmPortal's slots; index it for one slot's type: `BbConfirmPortalSlots<MyData>['default']`. */
|
|
74
|
+
export type BbConfirmPortalSlots<P = any> = {
|
|
75
|
+
/** The confirm's body. */
|
|
76
|
+
default?: (scope: BbConfirmPortalSlotProps<P>) => unknown;
|
|
77
|
+
};
|
|
73
78
|
export {};
|
|
@@ -23,7 +23,7 @@ declare const __VLS_export: <R extends boolean = false, M extends boolean = fals
|
|
|
23
23
|
pt?: { [K in import('./types.js').BbDatePickerPtKey]?: import('../../types/passthrough.js').PtValue; };
|
|
24
24
|
activator?: import('../../index.js').ElementOrComponentRef;
|
|
25
25
|
anchor?: import('../../index.js').ElementOrComponentRef;
|
|
26
|
-
modelValue
|
|
26
|
+
modelValue?: string | string[] | null;
|
|
27
27
|
time?: string | string[] | null;
|
|
28
28
|
activeSegment?: import('./types.js').BbDatePickerSegment;
|
|
29
29
|
type?: import('../../types/DatePickerType.js').DatePickerType;
|
|
@@ -5,27 +5,29 @@ import { useConfig as r } from "../../composables/useConfig.js";
|
|
|
5
5
|
import { useConfigDefaults as i, useConfigSetting as a } from "../../composables/useConfigDefaults.js";
|
|
6
6
|
import { extractDomContainer as o } from "../../utilities/functions/extractDomContainer.js";
|
|
7
7
|
import { useId as s } from "../../composables/useId.js";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
8
|
+
import { useOwnModel as c } from "../../composables/useOwnModel.js";
|
|
9
|
+
import { useLocale as l } from "../../composables/useLocale.js";
|
|
10
|
+
import { useEscapeStackEntry as u } from "../../composables/useEscapeStackEntry.js";
|
|
11
|
+
import { useMobile as d } from "../../composables/useMobile.js";
|
|
12
|
+
import { transitions as f } from "../../utilities/misc/transitions.js";
|
|
12
13
|
import ee from "../BbCalendar/BbCalendar.vue.js";
|
|
13
14
|
import { isLabelType as te } from "../../types/DatePickerType.js";
|
|
14
15
|
import { isoWeekOf as ne } from "../../utilities/functions/isoWeek.js";
|
|
15
|
-
import { formatDateOf as
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import
|
|
21
|
-
import
|
|
22
|
-
import
|
|
23
|
-
import
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
16
|
+
import { formatDateOf as re, spokenClockOf as ie, spokenDateOptionsOf as ae, spokenTimeOf as oe, useDayjsLocale as se } from "../BbCalendar/useDayjsLocale.js";
|
|
17
|
+
import { useHydrated as ce } from "../../composables/useHydrated.js";
|
|
18
|
+
import { toInnerValue as le } from "../../utilities/functions/convertDateValue.js";
|
|
19
|
+
import { calendarSystemOf as ue, formatCalendarDate as de, localeOf as fe } from "../../utilities/calendar/index.js";
|
|
20
|
+
import { checkCalendarProps as pe, provideCalendarHost as me } from "../BbCalendar/calendarHost.js";
|
|
21
|
+
import { BB_CALENDAR_PT as he } from "../BbCalendar/types.js";
|
|
22
|
+
import ge from "../BbOffCanvas/BbOffCanvas.vue.js";
|
|
23
|
+
import { BB_OFF_CANVAS_PT as _e } from "../BbOffCanvas/types.js";
|
|
24
|
+
import ve from "../CommonPopover/CommonPopover.vue.js";
|
|
25
|
+
import { BB_DATE_PICKER_PT as p, DATE_PICKER_CALENDAR_PARTS as ye } from "./types.js";
|
|
26
|
+
import { usePassthrough as be } from "../../composables/usePassthrough.js";
|
|
27
|
+
import { firstFocusableMatch as xe } from "../../utils/focusVisibility.js";
|
|
28
|
+
import { withoutPt as Se } from "../../utils/passthrough.js";
|
|
29
|
+
import { Fragment as Ce, computed as m, createBlock as h, createCommentVNode as we, createElementBlock as Te, createElementVNode as g, createSlots as Ee, createVNode as _, defineComponent as v, guardReactiveProps as y, mergeProps as b, nextTick as De, normalizeProps as x, onBeforeUnmount as Oe, onDeactivated as ke, openBlock as S, ref as C, renderList as Ae, renderSlot as w, toDisplayString as je, unref as T, useAttrs as Me, useSlots as Ne, watch as E, withCtx as D } from "vue";
|
|
30
|
+
import { createReusableTemplate as Pe } from "@vueuse/core";
|
|
29
31
|
import { formatDigits as O } from "virtual:bitboss-ui/calendars";
|
|
30
32
|
// src/components/BbDatePicker/BbDatePicker.vue?vue&type=script&setup=true&lang.ts
|
|
31
33
|
var k = /*@__PURE__*/ v({
|
|
@@ -139,7 +141,7 @@ var k = /*@__PURE__*/ v({
|
|
|
139
141
|
default: void 0
|
|
140
142
|
},
|
|
141
143
|
offCanvasProps: {},
|
|
142
|
-
transitionDuration: { default:
|
|
144
|
+
transitionDuration: { default: f.medium },
|
|
143
145
|
placement: {},
|
|
144
146
|
offset: { default: void 0 },
|
|
145
147
|
padding: {},
|
|
@@ -159,161 +161,165 @@ var k = /*@__PURE__*/ v({
|
|
|
159
161
|
"grid-pick",
|
|
160
162
|
"time-pick"
|
|
161
163
|
],
|
|
162
|
-
setup(
|
|
163
|
-
let k =
|
|
164
|
+
setup(f, { emit: v }) {
|
|
165
|
+
let k = f, Fe = v, Ie = Ne(), Le = a(null, "popoverOffset"), A = k, j = Fe, { model: M, set: Re } = c(A, "modelValue", (e, t) => j(e, t), () => A.multiple ? [] : null), ze = m(() => M.value);
|
|
164
166
|
process.env.NODE_ENV !== "production" && n("BbDatePicker", t("BbDatePicker"));
|
|
165
|
-
let
|
|
167
|
+
let Be = /^\d{4}-\d{2}-\d{2}(:append)?$/, Ve = () => Object.keys(Ie).filter((e) => Be.test(e)), N = be({
|
|
166
168
|
component: "BbDatePicker",
|
|
167
169
|
props: A,
|
|
168
170
|
parts: p.parts,
|
|
169
171
|
states: p.states,
|
|
170
172
|
active: {
|
|
171
|
-
open: () =>
|
|
173
|
+
open: () => U.value,
|
|
172
174
|
disabled: () => !!A.disabled
|
|
173
175
|
},
|
|
174
|
-
attrs:
|
|
175
|
-
}),
|
|
176
|
-
let e = A.type === "datetime", t = !!A.floating || te(A.type), n = A.time, r =
|
|
177
|
-
let s =
|
|
176
|
+
attrs: Me()
|
|
177
|
+
}), P = r(), { isHydrated: He } = ce(), Ue = m(() => {
|
|
178
|
+
let e = A.type === "datetime", t = !!A.floating || te(A.type), n = A.time, r = fe(P.locale), i = de ? ue(r.calendar) : void 0, a = (a, o) => {
|
|
179
|
+
let s = He.value, c = le(a, {
|
|
178
180
|
floating: t,
|
|
179
181
|
utc: A.utc,
|
|
180
182
|
type: A.type,
|
|
181
183
|
calendar: i
|
|
182
184
|
});
|
|
183
|
-
if (!
|
|
185
|
+
if (!c.isValid()) return a;
|
|
184
186
|
if (A.type === "week") {
|
|
185
|
-
let { week: e, year: t } = ne(
|
|
186
|
-
return
|
|
187
|
+
let { week: e, year: t } = ne(c), n = r.numberingSystem, i = (e) => O ? O(e, n) : String(e);
|
|
188
|
+
return I("datePicker.weekValue", i(e), i(t)).value;
|
|
187
189
|
}
|
|
188
|
-
let
|
|
189
|
-
if (!e) return
|
|
190
|
-
let
|
|
191
|
-
return
|
|
192
|
-
}, o =
|
|
190
|
+
let l = re(c, P.locale, ae(A.type));
|
|
191
|
+
if (!e) return l;
|
|
192
|
+
let u = t ? Array.isArray(n) ? n[o] : o === 0 ? n : null : null, d = t ? u ? oe(u, P.locale, !!A.ampm, !!A.seconds, s) : "" : ie(c, P.locale, !!A.ampm, !!A.seconds, s);
|
|
193
|
+
return d ? `${l} ${d}` : l;
|
|
194
|
+
}, o = M.value;
|
|
193
195
|
return Array.isArray(o) ? o.filter(Boolean).map(a).join(A.multiple ? ", " : " – ") : o ? a(o, 0) : "";
|
|
194
196
|
});
|
|
195
|
-
|
|
196
|
-
let
|
|
197
|
-
|
|
198
|
-
let { t:
|
|
199
|
-
B.value = o(e) ?? void 0;
|
|
200
|
-
}, He = (e) => {
|
|
197
|
+
se();
|
|
198
|
+
let F = m(() => A.type === "datetime");
|
|
199
|
+
pe("BbDatePicker", A);
|
|
200
|
+
let { t: I } = l(), { isMobile: L } = d(), R = `bdp-${s().id.value}`, [We, z] = Pe(), B = `${R}-panel`, V = C(), H = C(), Ge = m(() => A.activator != null), Ke = (e) => {
|
|
201
201
|
V.value = o(e) ?? void 0;
|
|
202
|
+
}, qe = (e) => {
|
|
203
|
+
H.value = o(e) ?? void 0;
|
|
202
204
|
};
|
|
203
205
|
E(() => A.activator, (e) => {
|
|
204
|
-
|
|
206
|
+
V.value = o(e) ?? void 0;
|
|
205
207
|
}, { immediate: !0 }), E(() => A.anchor, (e) => {
|
|
206
|
-
|
|
208
|
+
H.value = e == null ? void 0 : o(e) ?? void 0;
|
|
207
209
|
}, { immediate: !0 });
|
|
208
|
-
let
|
|
209
|
-
|
|
210
|
+
let Je = m(() => H.value ?? V.value), U = C(!1), W = null;
|
|
211
|
+
me({
|
|
210
212
|
name: "BbDatePicker",
|
|
211
|
-
open:
|
|
213
|
+
open: U
|
|
212
214
|
});
|
|
213
|
-
let
|
|
214
|
-
A.disabled || A.readonly || (e.stopPropagation(),
|
|
215
|
-
},
|
|
216
|
-
|
|
215
|
+
let G = (e) => {
|
|
216
|
+
A.disabled || A.readonly || (e.stopPropagation(), U.value = !U.value);
|
|
217
|
+
}, K = (e) => {
|
|
218
|
+
let t = e.target;
|
|
219
|
+
t instanceof Node && ((document.getElementById(B)?.closest(".bb-common-popover"))?.contains(t) || V.value?.contains(t) || (U.value = !1));
|
|
217
220
|
};
|
|
218
|
-
E(
|
|
219
|
-
e ? (
|
|
221
|
+
E(U, async (e) => {
|
|
222
|
+
e ? (W = document.activeElement instanceof HTMLElement ? document.activeElement : null, Q.value || document.addEventListener("click", K, {
|
|
223
|
+
passive: !0,
|
|
224
|
+
capture: !0
|
|
225
|
+
}), await De(), xe(document.getElementById(B), "[tabindex=\"0\"]")?.focus()) : (document.removeEventListener("click", K, { capture: !0 }), W?.focus(), W = null);
|
|
220
226
|
});
|
|
221
|
-
let
|
|
222
|
-
E(
|
|
223
|
-
if (
|
|
227
|
+
let q = null, J = C();
|
|
228
|
+
E(V, (e) => {
|
|
229
|
+
if (q?.(), q = null, !e) return;
|
|
224
230
|
let t = !e.id;
|
|
225
|
-
t && (e.id = `${
|
|
226
|
-
e.removeEventListener("click",
|
|
231
|
+
t && (e.id = `${R}_activator`), J.value = e.id, e.addEventListener("click", G), q = () => {
|
|
232
|
+
e.removeEventListener("click", G), e.removeAttribute("aria-haspopup"), e.removeAttribute("aria-expanded"), e.removeAttribute("aria-labelledby"), e.removeAttribute("aria-controls"), t && e.removeAttribute("id"), J.value = void 0;
|
|
227
233
|
};
|
|
228
234
|
}, { immediate: !0 });
|
|
229
|
-
let
|
|
230
|
-
E([
|
|
231
|
-
e && (e.setAttribute("aria-haspopup", "dialog"), e.setAttribute("aria-expanded", t ? "true" : "false"), e.setAttribute("aria-labelledby", `${
|
|
232
|
-
}, { immediate: !0 }),
|
|
233
|
-
|
|
235
|
+
let Y = m(() => A.label ?? I("datePicker.openPicker").value), X = `${R}_label`, Ye = m(() => J.value ? `${X} ${J.value}` : X);
|
|
236
|
+
E([V, U], ([e, t]) => {
|
|
237
|
+
e && (e.setAttribute("aria-haspopup", "dialog"), e.setAttribute("aria-expanded", t ? "true" : "false"), e.setAttribute("aria-labelledby", `${X} ${e.id}`), t ? e.setAttribute("aria-controls", B) : e.removeAttribute("aria-controls"));
|
|
238
|
+
}, { immediate: !0 }), Oe(() => {
|
|
239
|
+
q?.(), document.removeEventListener("click", K, { capture: !0 });
|
|
234
240
|
});
|
|
235
|
-
let
|
|
241
|
+
let Xe = i("BbDatePicker", A, { adaptive: !0 }), Ze = () => Xe.adaptive && L.value ? "canvas" : "popover", Z = C(Ze()), Q = m(() => Z.value === "canvas");
|
|
236
242
|
E([
|
|
237
|
-
() =>
|
|
238
|
-
|
|
239
|
-
|
|
243
|
+
() => Xe.adaptive,
|
|
244
|
+
L,
|
|
245
|
+
U
|
|
240
246
|
], () => {
|
|
241
|
-
|
|
242
|
-
}),
|
|
243
|
-
let
|
|
247
|
+
U.value || (Z.value = Ze());
|
|
248
|
+
}), u(() => U.value && !Q.value, () => U.value = !1);
|
|
249
|
+
let Qe = m(() => ({
|
|
244
250
|
side: "bottom",
|
|
245
251
|
size: "auto",
|
|
246
252
|
draggable: !0,
|
|
247
253
|
transitionDuration: A.transitionDuration,
|
|
248
254
|
hideClose: !0,
|
|
249
|
-
...A.offCanvasProps?.title ? {} : { "aria-labelledby":
|
|
250
|
-
...
|
|
251
|
-
})),
|
|
252
|
-
|
|
253
|
-
},
|
|
254
|
-
|
|
255
|
+
...A.offCanvasProps?.title ? {} : { "aria-labelledby": Ye.value },
|
|
256
|
+
...Se(A.offCanvasProps)
|
|
257
|
+
})), $e = () => {
|
|
258
|
+
V.value?.focus(), j("hidden");
|
|
259
|
+
}, et = (e) => A.multiple || F.value ? !1 : A.range ? Array.isArray(e) && e.length === 2 : !!e, tt = (e) => {
|
|
260
|
+
Re(e), et(e) && (U.value = !1);
|
|
255
261
|
}, $ = m(() => b({
|
|
256
|
-
id:
|
|
262
|
+
id: B,
|
|
257
263
|
class: ["bb-date-picker__panel", {
|
|
258
|
-
"bb-date-picker__panel--datetime":
|
|
264
|
+
"bb-date-picker__panel--datetime": F.value,
|
|
259
265
|
"bb-date-picker__panel--sheet": Q.value
|
|
260
266
|
}]
|
|
261
|
-
}, Q.value ? {} :
|
|
267
|
+
}, Q.value ? {} : N.panel ?? {})), nt = ({ availableHeight: e }) => (A.numberOfMonths ?? 1) > 1 && e ? b($.value, { style: {
|
|
262
268
|
maxHeight: `${e}px`,
|
|
263
269
|
overflowY: "auto"
|
|
264
270
|
} }) : $.value;
|
|
265
|
-
return
|
|
266
|
-
|
|
267
|
-
}), (t, n) => (S(), Ce
|
|
268
|
-
|
|
271
|
+
return ke(() => {
|
|
272
|
+
U.value = !1;
|
|
273
|
+
}), (t, n) => (S(), Te(Ce, null, [
|
|
274
|
+
Ge.value ? we("", !0) : w(t.$slots, "activator", x(y({
|
|
269
275
|
props: {
|
|
270
|
-
ref:
|
|
276
|
+
ref: Ke,
|
|
271
277
|
"aria-haspopup": "dialog",
|
|
272
|
-
"aria-expanded":
|
|
273
|
-
"aria-labelledby":
|
|
278
|
+
"aria-expanded": U.value ? "true" : "false",
|
|
279
|
+
"aria-labelledby": Ye.value
|
|
274
280
|
},
|
|
275
|
-
anchorProps: { ref:
|
|
276
|
-
open:
|
|
277
|
-
value:
|
|
278
|
-
text:
|
|
279
|
-
disabled: !!
|
|
281
|
+
anchorProps: { ref: qe },
|
|
282
|
+
open: U.value,
|
|
283
|
+
value: T(M),
|
|
284
|
+
text: Ue.value,
|
|
285
|
+
disabled: !!f.disabled
|
|
280
286
|
})), void 0, void 0, 0),
|
|
281
287
|
g("span", {
|
|
282
|
-
id:
|
|
288
|
+
id: X,
|
|
283
289
|
hidden: ""
|
|
284
|
-
},
|
|
285
|
-
_(T(
|
|
290
|
+
}, je(Y.value), 1),
|
|
291
|
+
_(T(We), null, {
|
|
286
292
|
default: D(() => [_(ee, {
|
|
287
|
-
"active-segment":
|
|
288
|
-
ampm:
|
|
289
|
-
clearable:
|
|
290
|
-
disabled:
|
|
291
|
-
"first-day-of-week":
|
|
292
|
-
floating:
|
|
293
|
-
max:
|
|
294
|
-
min:
|
|
295
|
-
"model-value":
|
|
296
|
-
multiple:
|
|
297
|
-
"number-of-months": Q.value ? 1 :
|
|
298
|
-
pt: T(
|
|
299
|
-
range:
|
|
300
|
-
readonly:
|
|
301
|
-
seconds:
|
|
302
|
-
selectable:
|
|
303
|
-
step:
|
|
304
|
-
time:
|
|
305
|
-
type:
|
|
306
|
-
utc:
|
|
293
|
+
"active-segment": f.activeSegment,
|
|
294
|
+
ampm: f.ampm,
|
|
295
|
+
clearable: f.clearable,
|
|
296
|
+
disabled: f.disabled,
|
|
297
|
+
"first-day-of-week": f.firstDayOfWeek,
|
|
298
|
+
floating: f.floating,
|
|
299
|
+
max: f.max,
|
|
300
|
+
min: f.min,
|
|
301
|
+
"model-value": ze.value,
|
|
302
|
+
multiple: f.multiple,
|
|
303
|
+
"number-of-months": Q.value ? 1 : f.numberOfMonths,
|
|
304
|
+
pt: T(N).forward(T(ye), T(he).states),
|
|
305
|
+
range: f.range,
|
|
306
|
+
readonly: f.readonly,
|
|
307
|
+
seconds: f.seconds,
|
|
308
|
+
selectable: f.selectable,
|
|
309
|
+
step: f.step,
|
|
310
|
+
time: f.time,
|
|
311
|
+
type: f.type,
|
|
312
|
+
utc: f.utc,
|
|
307
313
|
onGridPick: n[0] ||= (e) => T(j)("grid-pick", e),
|
|
308
314
|
onTimePick: n[1] ||= (e) => T(j)("time-pick", e),
|
|
309
315
|
"onUpdate:activeSegment": n[2] ||= (e) => T(j)("update:activeSegment", e),
|
|
310
|
-
"onUpdate:modelValue":
|
|
316
|
+
"onUpdate:modelValue": tt,
|
|
311
317
|
"onUpdate:time": n[3] ||= (e) => T(j)("update:time", e)
|
|
312
|
-
},
|
|
318
|
+
}, Ee({
|
|
313
319
|
day: D((e) => [w(t.$slots, "day", x(y(e)))]),
|
|
314
320
|
"day:append": D((e) => [w(t.$slots, "day:append", x(y(e)))]),
|
|
315
321
|
_: 2
|
|
316
|
-
}, [
|
|
322
|
+
}, [Ae(Ve(), (e) => ({
|
|
317
323
|
name: e,
|
|
318
324
|
fn: D((n) => [w(t.$slots, e, x(y(n)))])
|
|
319
325
|
}))]), 1032, [
|
|
@@ -340,46 +346,46 @@ var k = /*@__PURE__*/ v({
|
|
|
340
346
|
])]),
|
|
341
347
|
_: 3
|
|
342
348
|
}),
|
|
343
|
-
Q.value ? (S(), h(
|
|
349
|
+
Q.value ? (S(), h(ge, b({
|
|
344
350
|
key: 1,
|
|
345
|
-
modelValue:
|
|
346
|
-
"onUpdate:modelValue": n[4] ||= (e) =>
|
|
351
|
+
modelValue: U.value,
|
|
352
|
+
"onUpdate:modelValue": n[4] ||= (e) => U.value = e,
|
|
347
353
|
class: "bb-date-picker__sheet",
|
|
348
|
-
pt: T(
|
|
354
|
+
pt: T(N).forward({
|
|
349
355
|
panel: "root",
|
|
350
356
|
sheet: "root"
|
|
351
|
-
}, T(
|
|
352
|
-
}, b(
|
|
353
|
-
onHidden:
|
|
357
|
+
}, T(_e).states, () => f.offCanvasProps?.pt)
|
|
358
|
+
}, b(Qe.value, T(e)(T(N).forwardAttrs)), {
|
|
359
|
+
onHidden: $e,
|
|
354
360
|
onHide: n[5] ||= (e) => T(j)("hide"),
|
|
355
361
|
onShow: n[6] ||= (e) => T(j)("show"),
|
|
356
362
|
onShown: n[7] ||= (e) => T(j)("shown")
|
|
357
363
|
}), {
|
|
358
|
-
default: D(() => [g("div", x(y($.value)), [_(T(
|
|
364
|
+
default: D(() => [g("div", x(y($.value)), [_(T(z))], 16)]),
|
|
359
365
|
_: 1
|
|
360
|
-
}, 16, ["modelValue", "pt"])) : (S(), h(
|
|
366
|
+
}, 16, ["modelValue", "pt"])) : (S(), h(ve, b({
|
|
361
367
|
key: 2,
|
|
362
|
-
modelValue:
|
|
363
|
-
"onUpdate:modelValue": n[8] ||= (e) =>
|
|
364
|
-
anchor:
|
|
365
|
-
"aria-label":
|
|
366
|
-
boundary:
|
|
367
|
-
"bubble-attrs":
|
|
368
|
+
modelValue: U.value,
|
|
369
|
+
"onUpdate:modelValue": n[8] ||= (e) => U.value = e,
|
|
370
|
+
anchor: Je.value,
|
|
371
|
+
"aria-label": Y.value,
|
|
372
|
+
boundary: f.boundary,
|
|
373
|
+
"bubble-attrs": nt,
|
|
368
374
|
class: "bb-date-picker",
|
|
369
375
|
dialog: "",
|
|
370
|
-
"disable-flip":
|
|
371
|
-
eager:
|
|
376
|
+
"disable-flip": f.disableFlip,
|
|
377
|
+
eager: f.eager,
|
|
372
378
|
"hide-arrow": "",
|
|
373
|
-
offset:
|
|
374
|
-
padding:
|
|
375
|
-
placement:
|
|
376
|
-
"transition-duration":
|
|
379
|
+
offset: f.offset ?? T(Le)() ?? 4,
|
|
380
|
+
padding: f.padding,
|
|
381
|
+
placement: f.placement,
|
|
382
|
+
"transition-duration": f.transitionDuration,
|
|
377
383
|
onHidden: n[9] ||= (e) => T(j)("hidden"),
|
|
378
384
|
onHide: n[10] ||= (e) => T(j)("hide"),
|
|
379
385
|
onShow: n[11] ||= (e) => T(j)("show"),
|
|
380
386
|
onShown: n[12] ||= (e) => T(j)("shown")
|
|
381
|
-
}, T(
|
|
382
|
-
default: D(() => [_(T(
|
|
387
|
+
}, T(N).rootAttrs), {
|
|
388
|
+
default: D(() => [_(T(z))]),
|
|
383
389
|
_: 1
|
|
384
390
|
}, 16, [
|
|
385
391
|
"modelValue",
|
|
@@ -106,7 +106,7 @@ export type BbDatePickerBaseProps = BbDatePickerPtProps & {
|
|
|
106
106
|
* `year`), otherwise a zoned
|
|
107
107
|
* ISO instant (carrying the time under `datetime`).
|
|
108
108
|
*/
|
|
109
|
-
modelValue
|
|
109
|
+
modelValue?: string | string[] | null;
|
|
110
110
|
/**
|
|
111
111
|
* Companion time model (`v-model:time`), 24-hour `HH:mm` / `HH:mm:ss`.
|
|
112
112
|
* With `floating` it is the only carrier of the time; otherwise it mirrors
|
|
@@ -249,7 +249,7 @@ export type BbDatePickerBaseProps = BbDatePickerPtProps & {
|
|
|
249
249
|
export type BbDatePickerModelProps<R extends boolean = boolean, M extends boolean = boolean> = {
|
|
250
250
|
range?: R;
|
|
251
251
|
multiple?: M;
|
|
252
|
-
modelValue
|
|
252
|
+
modelValue?: PtNoInfer<BbDateModel<R, M>>;
|
|
253
253
|
time?: PtNoInfer<BbTimeModel<R>>;
|
|
254
254
|
};
|
|
255
255
|
export type BbDatePickerProps<R extends boolean = boolean, M extends boolean = boolean> = BbDatePickerBaseProps & BbDatePickerModelProps<R, M>;
|