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.
Files changed (185) hide show
  1. package/README.md +4 -2
  2. package/bin/bitboss-ui-mcp.mjs +101 -3
  3. package/bin/bitboss-ui.mjs +6 -1
  4. package/bin/cli.mjs +34 -7
  5. package/dist/ai/BbBadge.md +4 -4
  6. package/dist/ai/BbCalendar.md +4 -3
  7. package/dist/ai/BbColorPalette.md +8 -9
  8. package/dist/ai/BbConfirmPortal.md +1 -1
  9. package/dist/ai/BbDatePicker.md +4 -3
  10. package/dist/ai/BbDialog.md +17 -4
  11. package/dist/ai/BbDropdown.md +23 -10
  12. package/dist/ai/BbDropdownButton.md +2 -2
  13. package/dist/ai/BbForm.md +11 -7
  14. package/dist/ai/BbHoverCardPortal.md +1 -1
  15. package/dist/ai/BbNumberInput.md +5 -3
  16. package/dist/ai/BbPopoverPortal.md +1 -1
  17. package/dist/ai/BbTable.md +43 -19
  18. package/dist/ai/BbTimePicker.md +4 -3
  19. package/dist/ai/BbToastPortal.md +1 -1
  20. package/dist/ai/changelog.json +60 -4
  21. package/dist/ai/components.json +56 -20
  22. package/dist/ai/guides/design-tokens.md +20 -0
  23. package/dist/ai/guides/eslint-rules.md +1 -1
  24. package/dist/ai/guides/inertia-helpers.md +613 -53
  25. package/dist/ai/guides/migration/adoption-checklist.md +5 -5
  26. package/dist/ai/guides/migration/components/use-confirm.md +4 -1
  27. package/dist/ai/guides/migration/v2-to-v3.md +24 -0
  28. package/dist/ai/guides/migration/v3-beta-tooling.md +3 -0
  29. package/dist/ai/guides/preset-components.md +15 -2
  30. package/dist/ai/guides/reporting.md +49 -0
  31. package/dist/ai/helpers/inertia/manifest.json +33 -38
  32. package/dist/ai/helpers/inertia/useHasChanged.ts +25 -37
  33. package/dist/ai/helpers/inertia/useQuery.ts +24 -6
  34. package/dist/ai/helpers/inertia/utils.ts +552 -3
  35. package/dist/ai/index.md +1 -0
  36. package/dist/ai/manifest/components/BbAlert.tree.json +1 -1
  37. package/dist/ai/manifest/components/BbCalendar.json +2 -2
  38. package/dist/ai/manifest/components/BbColorPalette.json +3 -3
  39. package/dist/ai/manifest/components/BbConfirm.removed.json +4 -4
  40. package/dist/ai/manifest/components/BbConfirmPortal.json +1 -1
  41. package/dist/ai/manifest/components/BbConfirmPortal.removed.json +2 -2
  42. package/dist/ai/manifest/components/BbDatePicker.json +3 -3
  43. package/dist/ai/manifest/components/BbDialog.tree.json +5 -1
  44. package/dist/ai/manifest/components/BbDropdown.json +3 -3
  45. package/dist/ai/manifest/components/BbDropdown.tree.json +3 -2
  46. package/dist/ai/manifest/components/BbDropdownButton.json +2 -2
  47. package/dist/ai/manifest/components/BbForm.json +1 -1
  48. package/dist/ai/manifest/components/BbHoverCard.json +1 -1
  49. package/dist/ai/manifest/components/BbHoverCardPortal.json +1 -1
  50. package/dist/ai/manifest/components/BbNumberInput.json +1 -1
  51. package/dist/ai/manifest/components/BbPopover.json +1 -1
  52. package/dist/ai/manifest/components/BbPopoverPortal.json +1 -1
  53. package/dist/ai/manifest/components/BbSelectPopover.json +1 -1
  54. package/dist/ai/manifest/components/BbTable.tree.json +12 -6
  55. package/dist/ai/manifest/components/BbTimePicker.json +3 -3
  56. package/dist/ai/manifest/components/BbToast.removed.json +1 -1
  57. package/dist/ai/manifest/components/BbToastPortal.json +1 -1
  58. package/dist/ai/manifest/components/CommonPopover.json +1 -1
  59. package/dist/ai/manifest/index.json +2 -2
  60. package/dist/ai/manifest/meta.json +36 -0
  61. package/dist/ai/manifest/types.advanced.json +81 -80
  62. package/dist/ai/manifest/types.api.json +66 -65
  63. package/dist/ai/manifest/types.wrapper.json +155 -118
  64. package/dist/ai/recipes/inertia/layout-scaffold.md +3 -1
  65. package/dist/ai/recipes/nuxt/layout-scaffold.md +3 -1
  66. package/dist/ai/recipes/vue/layout-scaffold.md +3 -1
  67. package/dist/ai/source/BbAlert.md +16 -4
  68. package/dist/ai/source/BbAvatar.md +2 -0
  69. package/dist/ai/source/BbBreadcrumbs.md +4 -1
  70. package/dist/ai/source/BbCalendar.md +22 -12
  71. package/dist/ai/source/BbColorPalette.md +41 -12
  72. package/dist/ai/source/BbConfirm.md +7 -0
  73. package/dist/ai/source/BbConfirmPortal.md +9 -4
  74. package/dist/ai/source/BbDatePicker.md +53 -22
  75. package/dist/ai/source/BbDatePickerInput.md +32 -8
  76. package/dist/ai/source/BbDialog.md +31 -1
  77. package/dist/ai/source/BbDropdown.md +52 -24
  78. package/dist/ai/source/BbDropdownGroup.md +17 -21
  79. package/dist/ai/source/BbForm.md +80 -6
  80. package/dist/ai/source/BbHoverCard.md +7 -0
  81. package/dist/ai/source/BbHoverCardPortal.md +9 -5
  82. package/dist/ai/source/BbNumberInput.md +5 -6
  83. package/dist/ai/source/BbOffCanvas.md +34 -1
  84. package/dist/ai/source/BbPopover.md +7 -0
  85. package/dist/ai/source/BbPopoverPortal.md +9 -5
  86. package/dist/ai/source/BbRadio.md +4 -3
  87. package/dist/ai/source/BbRadioGroup.md +7 -5
  88. package/dist/ai/source/BbTable.md +54 -6
  89. package/dist/ai/source/BbTag.md +10 -3
  90. package/dist/ai/source/BbTimePicker.md +50 -15
  91. package/dist/ai/source/BbTimePickerInput.md +30 -7
  92. package/dist/ai/source/BbToast.md +14 -0
  93. package/dist/ai/source/BbToastPortal.md +16 -4
  94. package/dist/ai/source/CommonFieldInput.md +11 -5
  95. package/dist/ai/source/CommonPopover.md +4 -1
  96. package/dist/components/BbAlert/BbAlert.vue_vue_type_script_setup_true_lang.js +31 -26
  97. package/dist/components/BbBreadcrumbs/BbBreadcrumbs.vue_vue_type_script_setup_true_lang.js +1 -1
  98. package/dist/components/BbCalendar/BbCalendar.vue.d.ts +1 -1
  99. package/dist/components/BbCalendar/BbCalendar.vue_vue_type_script_setup_true_lang.js +235 -234
  100. package/dist/components/BbCalendar/types.d.ts +2 -2
  101. package/dist/components/BbCalendar/useDayjsLocale.js +11 -8
  102. package/dist/components/BbColorPalette/BbColorPalette.vue_vue_type_script_setup_true_lang.js +197 -192
  103. package/dist/components/BbColorPalette/types.d.ts +1 -1
  104. package/dist/components/BbConfirm/BbConfirmPortal.vue.d.ts +2 -4
  105. package/dist/components/BbConfirm/types.d.ts +5 -0
  106. package/dist/components/BbDatePicker/BbDatePicker.vue.d.ts +1 -1
  107. package/dist/components/BbDatePicker/BbDatePicker.vue_vue_type_script_setup_true_lang.js +145 -139
  108. package/dist/components/BbDatePicker/types.d.ts +2 -2
  109. package/dist/components/BbDatePickerInput/BbDatePickerInput.vue_vue_type_script_setup_true_lang.js +337 -335
  110. package/dist/components/BbDialog/BbDialog.vue_vue_type_script_setup_true_lang.js +253 -245
  111. package/dist/components/BbDialog/leaveGhost.js +33 -0
  112. package/dist/components/BbDialog/overlayActions.js +34 -20
  113. package/dist/components/BbDropdown/BbDropdown.vue_vue_type_script_setup_true_lang.js +11 -3
  114. package/dist/components/BbDropdown/BbDropdownList.vue_vue_type_script_setup_true_lang.js +4 -4
  115. package/dist/components/BbDropdown/DropdownPipelineResolver.vue_vue_type_script_setup_true_lang.js +119 -120
  116. package/dist/components/BbDropdown/types.d.ts +8 -17
  117. package/dist/components/BbForm/BbForm.vue.d.ts +2 -21
  118. package/dist/components/BbForm/BbForm.vue_vue_type_script_setup_true_lang.js +229 -227
  119. package/dist/components/BbForm/types.d.ts +31 -0
  120. package/dist/components/BbHoverCard/BbHoverCardPortal.vue.d.ts +2 -5
  121. package/dist/components/BbHoverCard/types.d.ts +5 -0
  122. package/dist/components/BbNumberInput/BbNumberInput.vue_vue_type_script_setup_true_lang.js +1 -1
  123. package/dist/components/BbNumberInput/numberDisplay.js +102 -106
  124. package/dist/components/BbNumberInput/types.d.ts +4 -3
  125. package/dist/components/BbOffCanvas/BbOffCanvas.vue_vue_type_script_setup_true_lang.js +385 -377
  126. package/dist/components/BbPopover/BbPopoverPortal.vue.d.ts +2 -5
  127. package/dist/components/BbPopover/types.d.ts +5 -0
  128. package/dist/components/BbRadio/types.d.ts +4 -3
  129. package/dist/components/BbRadioGroup/BbRadioGroup.vue_vue_type_script_setup_true_lang.js +10 -12
  130. package/dist/components/BbTable/BbTable.vue_vue_type_script_setup_true_lang.js +231 -231
  131. package/dist/components/BbTable/BbTableDataRow.js +96 -96
  132. package/dist/components/BbTag/BbTag.vue_vue_type_script_setup_true_lang.js +9 -3
  133. package/dist/components/BbTimePicker/BbTimePicker.vue.d.ts +1 -1
  134. package/dist/components/BbTimePicker/BbTimePicker.vue_vue_type_script_setup_true_lang.js +106 -100
  135. package/dist/components/BbTimePicker/types.d.ts +2 -2
  136. package/dist/components/BbTimePickerInput/BbTimePickerInput.vue_vue_type_script_setup_true_lang.js +214 -213
  137. package/dist/components/BbToast/BbToastPortal.vue.d.ts +2 -4
  138. package/dist/components/BbToast/types.d.ts +5 -0
  139. package/dist/components/CommonFieldInput/CommonFieldInput.vue_vue_type_script_setup_true_lang.js +36 -36
  140. package/dist/components/CommonPopover/CommonPopover.vue_vue_type_script_setup_true_lang.js +1 -1
  141. package/dist/components/CommonTimeSelector/useMeridiem.js +6 -6
  142. package/dist/composables/formSubmitLock.js +2 -1
  143. package/dist/composables/overlayRegistry.js +52 -42
  144. package/dist/composables/useActiveInactiveState.js +8 -4
  145. package/dist/composables/useBbDialog.js +5 -5
  146. package/dist/composables/useOwnModel.js +16 -0
  147. package/dist/composables/useSegmentedFields.js +31 -20
  148. package/dist/deprecation/ai-deprecations.json.js +1 -1
  149. package/dist/i18n/currencyDigits.js +58 -0
  150. package/dist/i18n/regionDates.js +250 -0
  151. package/dist/i18n/regionHints.js +30 -41
  152. package/dist/index.d.ts +34 -30
  153. package/dist/llms-full.txt +874 -136
  154. package/dist/llms.txt +3 -1
  155. package/dist/styles.css +2 -2
  156. package/dist/types/ActionButton.d.ts +3 -1
  157. package/dist/types/CommonProps.d.ts +8 -0
  158. package/dist/utilities/functions/hash.js +123 -3
  159. package/dist/utilities/functions/isEqual.js +69 -3
  160. package/dist/utils/versionCheck.js +1 -1
  161. package/dist/vite-plugin.d.ts +2 -1
  162. package/dist/vite.js +8 -5
  163. package/llms.txt +3 -1
  164. package/package.json +2 -3
  165. package/scripts/README.md +43 -43
  166. package/scripts/lib/adoption-checklist.json +6 -5
  167. package/scripts/lib/agent-manifest.mjs +33 -6
  168. package/scripts/lib/agent-setup.mjs +54 -6
  169. package/scripts/lib/cldr-pins.ts +182 -0
  170. package/scripts/lib/engines-include.d.mts +5 -0
  171. package/scripts/lib/engines-include.mjs +40 -0
  172. package/scripts/lib/eslint-plugin.mjs +8 -2
  173. package/scripts/lib/helpers-add.mjs +21 -2
  174. package/scripts/lib/hidden-label-placeholder.mjs +25 -5
  175. package/scripts/lib/idiom-scan.mjs +30 -3
  176. package/scripts/lib/legacy-agent-files.json +152 -0
  177. package/scripts/lib/mcp-config.mjs +74 -7
  178. package/scripts/lib/portal-names.mjs +78 -8
  179. package/scripts/lib/release-results.mjs +153 -6
  180. package/scripts/lib/report.mjs +340 -0
  181. package/scripts/lib/run-beat.mjs +14 -0
  182. package/scripts/lib/run-records.mjs +313 -0
  183. package/scripts/lib/selector-log.mjs +98 -0
  184. package/scripts/lib/ticket-beat.mjs +30 -0
  185. 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: string | null;
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 { BbConfirmPortalSlotProps } from './types.js';
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: string | string[] | null;
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 { useLocale as c } from "../../composables/useLocale.js";
9
- import { useEscapeStackEntry as l } from "../../composables/useEscapeStackEntry.js";
10
- import { useMobile as u } from "../../composables/useMobile.js";
11
- import { transitions as d } from "../../utilities/misc/transitions.js";
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 f, spokenDateOptionsOf as re, spokenTimeOf as ie, timeFieldsOf as ae, useDayjsLocale as oe } from "../BbCalendar/useDayjsLocale.js";
16
- import { toInnerValue as se } from "../../utilities/functions/convertDateValue.js";
17
- import { calendarSystemOf as ce, formatCalendarDate as le, localeOf as ue } from "../../utilities/calendar/index.js";
18
- import { checkCalendarProps as de, provideCalendarHost as fe } from "../BbCalendar/calendarHost.js";
19
- import { BB_CALENDAR_PT as pe } from "../BbCalendar/types.js";
20
- import me from "../BbOffCanvas/BbOffCanvas.vue.js";
21
- import { BB_OFF_CANVAS_PT as he } from "../BbOffCanvas/types.js";
22
- import ge from "../CommonPopover/CommonPopover.vue.js";
23
- import { BB_DATE_PICKER_PT as p, DATE_PICKER_CALENDAR_PARTS as _e } from "./types.js";
24
- import { usePassthrough as ve } from "../../composables/usePassthrough.js";
25
- import { firstFocusableMatch as ye } from "../../utils/focusVisibility.js";
26
- import { withoutPt as be } from "../../utils/passthrough.js";
27
- import { Fragment as xe, computed as m, createBlock as h, createCommentVNode as Se, createElementBlock as Ce, createElementVNode as g, createSlots as we, createVNode as _, defineComponent as v, guardReactiveProps as y, mergeProps as b, nextTick as Te, normalizeProps as x, onBeforeUnmount as Ee, onDeactivated as De, openBlock as S, ref as C, renderList as Oe, renderSlot as w, toDisplayString as ke, unref as T, useAttrs as Ae, useSlots as je, watch as E, withCtx as D } from "vue";
28
- import { createReusableTemplate as Me } from "@vueuse/core";
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: d.medium },
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(d, { emit: v }) {
163
- let k = d, Ne = v, Pe = je(), Fe = a(null, "popoverOffset"), A = k, j = Ne;
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 Ie = /^\d{4}-\d{2}-\d{2}(:append)?$/, Le = () => Object.keys(Pe).filter((e) => Ie.test(e)), M = ve({
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: () => H.value,
173
+ open: () => U.value,
172
174
  disabled: () => !!A.disabled
173
175
  },
174
- attrs: Ae()
175
- }), N = r(), Re = m(() => {
176
- let e = A.type === "datetime", t = !!A.floating || te(A.type), n = A.time, r = ue(N.locale), i = le ? ce(r.calendar) : void 0, a = (a, o) => {
177
- let s = se(a, {
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 (!s.isValid()) return a;
185
+ if (!c.isValid()) return a;
184
186
  if (A.type === "week") {
185
- let { week: e, year: t } = ne(s), n = r.numberingSystem, i = (e) => O ? O(e, n) : String(e);
186
- return F("datePicker.weekValue", i(e), i(t)).value;
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 c = f(s, N.locale, re(A.type));
189
- if (!e) return c;
190
- let l = t ? Array.isArray(n) ? n[o] : o === 0 ? n : null : null, u = t ? l ? ie(l, N.locale, !!A.ampm, !!A.seconds) : "" : f(s, N.locale, ae(!!A.ampm, !!A.seconds));
191
- return u ? `${c} ${u}` : c;
192
- }, o = A.modelValue;
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
- oe();
196
- let P = m(() => A.type === "datetime");
197
- de("BbDatePicker", A);
198
- let { t: F } = c(), { isMobile: I } = u(), L = `bdp-${s().id.value}`, [ze, R] = Me(), z = `${L}-panel`, B = C(), V = C(), Be = m(() => A.activator != null), Ve = (e) => {
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
- B.value = o(e) ?? void 0;
206
+ V.value = o(e) ?? void 0;
205
207
  }, { immediate: !0 }), E(() => A.anchor, (e) => {
206
- V.value = e == null ? void 0 : o(e) ?? void 0;
208
+ H.value = e == null ? void 0 : o(e) ?? void 0;
207
209
  }, { immediate: !0 });
208
- let Ue = m(() => V.value ?? B.value), H = C(!1), U = null;
209
- fe({
210
+ let Je = m(() => H.value ?? V.value), U = C(!1), W = null;
211
+ me({
210
212
  name: "BbDatePicker",
211
- open: H
213
+ open: U
212
214
  });
213
- let W = (e) => {
214
- A.disabled || A.readonly || (e.stopPropagation(), H.value = !H.value);
215
- }, G = (e) => {
216
- e.target instanceof HTMLDialogElement && (H.value = !1);
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(H, async (e) => {
219
- e ? (U = document.activeElement instanceof HTMLElement ? document.activeElement : null, Q.value || document.addEventListener("click", G, { passive: !0 }), await Te(), ye(document.getElementById(z), "[tabindex=\"0\"]")?.focus()) : (document.removeEventListener("click", G), U?.focus(), U = null);
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 K = null, q = C();
222
- E(B, (e) => {
223
- if (K?.(), K = null, !e) return;
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 = `${L}_activator`), q.value = e.id, e.addEventListener("click", W), K = () => {
226
- 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;
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 J = m(() => A.label ?? F("datePicker.openPicker").value), Y = `${L}_label`, X = m(() => q.value ? `${Y} ${q.value}` : Y);
230
- E([B, H], ([e, t]) => {
231
- 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", z) : e.removeAttribute("aria-controls"));
232
- }, { immediate: !0 }), Ee(() => {
233
- K?.(), document.removeEventListener("click", G);
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 Z = i("BbDatePicker", A, { adaptive: !0 }), We = () => Z.adaptive && I.value ? "canvas" : "popover", Ge = C(We()), Q = m(() => Ge.value === "canvas");
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
- () => Z.adaptive,
238
- I,
239
- H
243
+ () => Xe.adaptive,
244
+ L,
245
+ U
240
246
  ], () => {
241
- H.value || (Ge.value = We());
242
- }), l(() => H.value && !Q.value, () => H.value = !1);
243
- let Ke = m(() => ({
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": X.value },
250
- ...be(A.offCanvasProps)
251
- })), qe = () => {
252
- B.value?.focus(), j("hidden");
253
- }, Je = (e) => A.multiple || P.value ? !1 : A.range ? Array.isArray(e) && e.length === 2 : !!e, Ye = (e) => {
254
- j("update:modelValue", e), Je(e) && (H.value = !1);
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: z,
262
+ id: B,
257
263
  class: ["bb-date-picker__panel", {
258
- "bb-date-picker__panel--datetime": P.value,
264
+ "bb-date-picker__panel--datetime": F.value,
259
265
  "bb-date-picker__panel--sheet": Q.value
260
266
  }]
261
- }, Q.value ? {} : M.panel ?? {})), Xe = ({ availableHeight: e }) => (A.numberOfMonths ?? 1) > 1 && e ? b($.value, { style: {
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 De(() => {
266
- H.value = !1;
267
- }), (t, n) => (S(), Ce(xe, null, [
268
- Be.value ? Se("", !0) : w(t.$slots, "activator", x(y({
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: Ve,
276
+ ref: Ke,
271
277
  "aria-haspopup": "dialog",
272
- "aria-expanded": H.value ? "true" : "false",
273
- "aria-labelledby": X.value
278
+ "aria-expanded": U.value ? "true" : "false",
279
+ "aria-labelledby": Ye.value
274
280
  },
275
- anchorProps: { ref: He },
276
- open: H.value,
277
- value: d.modelValue,
278
- text: Re.value,
279
- disabled: !!d.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: Y,
288
+ id: X,
283
289
  hidden: ""
284
- }, ke(J.value), 1),
285
- _(T(ze), null, {
290
+ }, je(Y.value), 1),
291
+ _(T(We), null, {
286
292
  default: D(() => [_(ee, {
287
- "active-segment": d.activeSegment,
288
- ampm: d.ampm,
289
- clearable: d.clearable,
290
- disabled: d.disabled,
291
- "first-day-of-week": d.firstDayOfWeek,
292
- floating: d.floating,
293
- max: d.max,
294
- min: d.min,
295
- "model-value": d.modelValue,
296
- multiple: d.multiple,
297
- "number-of-months": Q.value ? 1 : d.numberOfMonths,
298
- pt: T(M).forward(T(_e), T(pe).states),
299
- range: d.range,
300
- readonly: d.readonly,
301
- seconds: d.seconds,
302
- selectable: d.selectable,
303
- step: d.step,
304
- time: d.time,
305
- type: d.type,
306
- utc: d.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": Ye,
316
+ "onUpdate:modelValue": tt,
311
317
  "onUpdate:time": n[3] ||= (e) => T(j)("update:time", e)
312
- }, we({
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
- }, [Oe(Le(), (e) => ({
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(me, b({
349
+ Q.value ? (S(), h(ge, b({
344
350
  key: 1,
345
- modelValue: H.value,
346
- "onUpdate:modelValue": n[4] ||= (e) => H.value = e,
351
+ modelValue: U.value,
352
+ "onUpdate:modelValue": n[4] ||= (e) => U.value = e,
347
353
  class: "bb-date-picker__sheet",
348
- pt: T(M).forward({
354
+ pt: T(N).forward({
349
355
  panel: "root",
350
356
  sheet: "root"
351
- }, T(he).states, () => d.offCanvasProps?.pt)
352
- }, b(Ke.value, T(e)(T(M).forwardAttrs)), {
353
- onHidden: qe,
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(R))], 16)]),
364
+ default: D(() => [g("div", x(y($.value)), [_(T(z))], 16)]),
359
365
  _: 1
360
- }, 16, ["modelValue", "pt"])) : (S(), h(ge, b({
366
+ }, 16, ["modelValue", "pt"])) : (S(), h(ve, b({
361
367
  key: 2,
362
- modelValue: H.value,
363
- "onUpdate:modelValue": n[8] ||= (e) => H.value = e,
364
- anchor: Ue.value,
365
- "aria-label": J.value,
366
- boundary: d.boundary,
367
- "bubble-attrs": Xe,
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": d.disableFlip,
371
- eager: d.eager,
376
+ "disable-flip": f.disableFlip,
377
+ eager: f.eager,
372
378
  "hide-arrow": "",
373
- offset: d.offset ?? T(Fe)() ?? 4,
374
- padding: d.padding,
375
- placement: d.placement,
376
- "transition-duration": d.transitionDuration,
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(M).rootAttrs), {
382
- default: D(() => [_(T(R))]),
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: string | string[] | null;
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: PtNoInfer<BbDateModel<R, M>>;
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>;