bitboss-ui 2.1.135 → 3.0.0-alpha.4
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/LICENSE +21 -0
- package/README.md +274 -24
- package/bin/bitboss-ui-mcp.mjs +662 -0
- package/bin/bitboss-ui.mjs +710 -0
- package/bin/bitboss-ui.node.test.mjs +113 -0
- package/dist/ai/BbAccordion.md +528 -113
- package/dist/ai/BbAlert.md +380 -197
- package/dist/ai/BbAsterisk.md +46 -0
- package/dist/ai/BbAvatar.md +458 -178
- package/dist/ai/BbBadge.md +697 -225
- package/dist/ai/BbBadgeButton.md +54 -0
- package/dist/ai/BbBaseButton.md +491 -0
- package/dist/ai/BbBaseCheckbox.md +49 -0
- package/dist/ai/BbBaseCheckboxGroup.md +64 -0
- package/dist/ai/BbBaseCheckboxIcon.md +176 -0
- package/dist/ai/BbBaseColorInput.md +64 -0
- package/dist/ai/BbBaseColorPalette.md +39 -0
- package/dist/ai/BbBaseDatePicker.md +42 -0
- package/dist/ai/BbBaseDatePickerInput.md +73 -0
- package/dist/ai/BbBaseInputContainer.md +48 -0
- package/dist/ai/BbBaseNumberInput.md +71 -0
- package/dist/ai/BbBaseRadio.md +46 -0
- package/dist/ai/BbBaseRadioGroup.md +64 -0
- package/dist/ai/BbBaseRadioIcon.md +191 -0
- package/dist/ai/BbBaseRating.md +51 -0
- package/dist/ai/BbBaseSelect.md +88 -0
- package/dist/ai/BbBaseSlider.md +56 -0
- package/dist/ai/BbBaseSwitch.md +49 -0
- package/dist/ai/BbBaseSwitchGroup.md +64 -0
- package/dist/ai/BbBaseSwitchIcon.md +186 -0
- package/dist/ai/BbBaseTag.md +68 -0
- package/dist/ai/BbBaseTextInput.md +75 -0
- package/dist/ai/BbBaseTextarea.md +62 -0
- package/dist/ai/BbBaseTimePickerInput.md +62 -0
- package/dist/ai/BbBreadcrumbs.md +553 -503
- package/dist/ai/BbButton.md +841 -636
- package/dist/ai/BbCheckbox.md +585 -254
- package/dist/ai/BbCheckboxGroup.md +573 -361
- package/dist/ai/BbCollapsible.md +425 -103
- package/dist/ai/BbColorInput.md +536 -323
- package/dist/ai/BbColorPalette.md +569 -330
- package/dist/ai/BbConfirm.md +659 -136
- package/dist/ai/BbConfirmPortal.md +28 -0
- package/dist/ai/BbDatePicker.md +244 -0
- package/dist/ai/BbDatePickerInput.md +720 -388
- package/dist/ai/BbDialog.md +778 -99
- package/dist/ai/BbDropdown.md +1072 -763
- package/dist/ai/BbDropdownButton.md +525 -614
- package/dist/ai/BbDropdownGroup.md +34 -0
- package/dist/ai/BbDropzone.md +1206 -436
- package/dist/ai/BbForm.md +239 -0
- package/dist/ai/BbIcon.md +382 -212
- package/dist/ai/BbIndicator.md +283 -0
- package/dist/ai/BbNumberInput.md +717 -355
- package/dist/ai/BbOffCanvas.md +897 -498
- package/dist/ai/BbPagination.md +489 -535
- package/dist/ai/BbPopover.md +591 -546
- package/dist/ai/BbProgress.md +462 -69
- package/dist/ai/BbRadio.md +352 -229
- package/dist/ai/BbRadioGroup.md +437 -353
- package/dist/ai/BbRating.md +372 -225
- package/dist/ai/BbSelect.md +1399 -536
- package/dist/ai/BbSelectPopover.md +1255 -1578
- package/dist/ai/BbSlider.md +500 -256
- package/dist/ai/BbSmoothHeight.md +485 -139
- package/dist/ai/BbSpinner.md +718 -131
- package/dist/ai/BbSwitch.md +573 -119
- package/dist/ai/BbSwitchGroup.md +521 -214
- package/dist/ai/BbTable.md +1996 -2365
- package/dist/ai/BbTabs.md +1147 -0
- package/dist/ai/BbTabsList.md +29 -0
- package/dist/ai/BbTabsPanes.md +27 -0
- package/dist/ai/BbTabsRoot.md +57 -0
- package/dist/ai/BbTag.md +416 -292
- package/dist/ai/BbTextInput.md +878 -333
- package/dist/ai/BbTextarea.md +850 -255
- package/dist/ai/BbTimePicker.md +231 -0
- package/dist/ai/BbTimePickerInput.md +200 -0
- package/dist/ai/BbToast.md +669 -196
- package/dist/ai/BbToastPortal.md +28 -0
- package/dist/ai/BbTooltip.md +453 -346
- package/dist/ai/BbTree.md +993 -234
- package/dist/ai/ChipsBox.md +27 -199
- package/dist/ai/ClearableButton.md +21 -55
- package/dist/ai/CommaBox.md +25 -200
- package/dist/ai/CommonInputWrapper.md +42 -0
- package/dist/ai/CommonPopover.md +30 -510
- package/dist/ai/ErrorIcon.md +19 -56
- package/dist/ai/FlatListBox.md +35 -379
- package/dist/ai/GroupedListBox.md +37 -535
- package/dist/ai/GuidesComponent.md +21 -0
- package/dist/ai/ListBox.md +38 -231
- package/dist/ai/OptionsContainer.md +34 -253
- package/dist/ai/WarningIcon.md +21 -0
- package/dist/ai/components.json +15897 -0
- package/dist/ai/composables/useBbConfig.md +80 -0
- package/dist/ai/composables/useBbFormContext.md +110 -0
- package/dist/ai/composables/useBbTableContext.md +167 -0
- package/dist/ai/composables/useBbTabsContext.md +118 -0
- package/dist/ai/composables/useBroadcastChannelInstance.md +97 -0
- package/dist/ai/composables/useConfirm.md +313 -0
- package/dist/ai/composables/useCountdown.md +86 -0
- package/dist/ai/composables/useId.md +60 -0
- package/dist/ai/composables/useMobile.md +85 -0
- package/dist/ai/composables/useToast.md +238 -0
- package/dist/ai/guides/agent-contract.md +165 -0
- package/dist/ai/guides/ai-router.md +113 -0
- package/dist/ai/guides/app-layout.md +318 -0
- package/dist/ai/guides/coherence-playbook.md +136 -0
- package/dist/ai/guides/component-picker.md +236 -0
- package/dist/ai/guides/design-language.md +478 -0
- package/dist/ai/guides/design-tokens.md +450 -0
- package/dist/ai/guides/fetch-items-playbook.md +161 -0
- package/dist/ai/guides/floating-bottom-panel.md +130 -0
- package/dist/ai/guides/icons-policy.md +257 -0
- package/dist/ai/guides/inertia-helpers.md +1443 -0
- package/dist/ai/guides/inline-edit-playbook.md +267 -0
- package/dist/ai/guides/installation-and-plugin-setup.md +440 -0
- package/dist/ai/guides/migration/components/bb-alert.md +37 -0
- package/dist/ai/guides/migration/components/bb-avatar.md +24 -0
- package/dist/ai/guides/migration/components/bb-badge.md +110 -0
- package/dist/ai/guides/migration/components/bb-breadcrumbs.md +26 -0
- package/dist/ai/guides/migration/components/bb-button.md +55 -0
- package/dist/ai/guides/migration/components/bb-checkbox-group.md +54 -0
- package/dist/ai/guides/migration/components/bb-checkbox.md +45 -0
- package/dist/ai/guides/migration/components/bb-chip.md +35 -0
- package/dist/ai/guides/migration/components/bb-collapsible.md +26 -0
- package/dist/ai/guides/migration/components/bb-color-input.md +23 -0
- package/dist/ai/guides/migration/components/bb-color-palette.md +31 -0
- package/dist/ai/guides/migration/components/bb-date-picker-input.md +84 -0
- package/dist/ai/guides/migration/components/bb-dialog.md +46 -0
- package/dist/ai/guides/migration/components/bb-dropdown-button.md +31 -0
- package/dist/ai/guides/migration/components/bb-dropdown.md +36 -0
- package/dist/ai/guides/migration/components/bb-dropzone.md +27 -0
- package/dist/ai/guides/migration/components/bb-icon.md +27 -0
- package/dist/ai/guides/migration/components/bb-offcanvas.md +63 -0
- package/dist/ai/guides/migration/components/bb-pagination.md +24 -0
- package/dist/ai/guides/migration/components/bb-popover.md +52 -0
- package/dist/ai/guides/migration/components/bb-rating.md +24 -0
- package/dist/ai/guides/migration/components/bb-select-popover.md +59 -0
- package/dist/ai/guides/migration/components/bb-select.md +69 -0
- package/dist/ai/guides/migration/components/bb-slider.md +25 -0
- package/dist/ai/guides/migration/components/bb-smooth-height.md +45 -0
- package/dist/ai/guides/migration/components/bb-spinner.md +23 -0
- package/dist/ai/guides/migration/components/bb-table.md +66 -0
- package/dist/ai/guides/migration/components/bb-tabs.md +47 -0
- package/dist/ai/guides/migration/components/bb-tag.md +29 -0
- package/dist/ai/guides/migration/components/bb-text-input.md +37 -0
- package/dist/ai/guides/migration/components/bb-toast.md +47 -0
- package/dist/ai/guides/migration/components/bb-tooltip.md +34 -0
- package/dist/ai/guides/migration/components/bb-tree.md +77 -0
- package/dist/ai/guides/migration/components/use-confirm.md +46 -0
- package/dist/ai/guides/migration/v2-to-v3.md +649 -0
- package/dist/ai/guides/options-items-playbook.md +222 -0
- package/dist/ai/guides/page-shell.md +113 -0
- package/dist/ai/guides/validated-forms.md +177 -0
- package/dist/ai/index.md +158 -32
- package/dist/ai/recipes/inertia/approvals-inbox.md +1635 -0
- package/dist/ai/recipes/inertia/inline-edit-workspace.md +1765 -0
- package/dist/ai/recipes/inertia/layout-scaffold.md +385 -0
- package/dist/ai/recipes/inertia/onboarding.md +1791 -0
- package/dist/ai/recipes/inertia/ownership-atlas.md +1327 -0
- package/dist/ai/recipes/inertia/record-form.md +1489 -0
- package/dist/ai/recipes/inertia/records-workspace.md +1416 -0
- package/dist/ai/recipes/inertia/upload-center.md +2003 -0
- package/dist/ai/recipes/inertia/wizard-form.md +1500 -0
- package/dist/ai/recipes/nuxt/approvals-inbox.md +1578 -0
- package/dist/ai/recipes/nuxt/inline-edit-workspace.md +1703 -0
- package/dist/ai/recipes/nuxt/layout-scaffold.md +385 -0
- package/dist/ai/recipes/nuxt/onboarding.md +1724 -0
- package/dist/ai/recipes/nuxt/record-form.md +1502 -0
- package/dist/ai/recipes/nuxt/records-workspace.md +1329 -0
- package/dist/ai/recipes/nuxt/upload-center.md +1886 -0
- package/dist/ai/recipes/nuxt/wizard-form.md +1509 -0
- package/dist/ai/recipes/vue/approvals-inbox.md +1496 -0
- package/dist/ai/recipes/vue/inline-edit-workspace.md +1594 -0
- package/dist/ai/recipes/vue/layout-scaffold.md +385 -0
- package/dist/ai/recipes/vue/onboarding.md +1679 -0
- package/dist/ai/recipes/vue/record-form.md +1586 -0
- package/dist/ai/recipes/vue/records-workspace.md +1245 -0
- package/dist/ai/recipes/vue/upload-center.md +1845 -0
- package/dist/ai/recipes/vue/wizard-form.md +1441 -0
- package/dist/ai/source/BbAccordion.md +123 -0
- package/dist/ai/source/BbAlert.md +401 -0
- package/dist/ai/source/BbAsterisk.md +32 -0
- package/dist/ai/source/BbAvatar.md +258 -0
- package/dist/ai/source/BbBadge.md +560 -0
- package/dist/ai/source/BbBadgeButton.md +490 -0
- package/dist/ai/source/BbBaseButton.md +682 -0
- package/dist/ai/source/BbBaseCheckbox.md +461 -0
- package/dist/ai/source/BbBaseCheckboxGroup.md +554 -0
- package/dist/ai/source/BbBaseCheckboxIcon.md +201 -0
- package/dist/ai/source/BbBaseColorInput.md +416 -0
- package/dist/ai/source/BbBaseColorPalette.md +934 -0
- package/dist/ai/source/BbBaseDatePicker.md +1001 -0
- package/dist/ai/source/BbBaseDatePickerInput.md +1785 -0
- package/dist/ai/source/BbBaseInputContainer.md +1210 -0
- package/dist/ai/source/BbBaseNumberInput.md +617 -0
- package/dist/ai/source/BbBaseRadio.md +377 -0
- package/dist/ai/source/BbBaseRadioGroup.md +533 -0
- package/dist/ai/source/BbBaseRadioIcon.md +153 -0
- package/dist/ai/source/BbBaseRating.md +573 -0
- package/dist/ai/source/BbBaseSelect.md +898 -0
- package/dist/ai/source/BbBaseSlider.md +1085 -0
- package/dist/ai/source/BbBaseSwitch.md +246 -0
- package/dist/ai/source/BbBaseSwitchGroup.md +302 -0
- package/dist/ai/source/BbBaseSwitchIcon.md +206 -0
- package/dist/ai/source/BbBaseTag.md +694 -0
- package/dist/ai/source/BbBaseTextInput.md +511 -0
- package/dist/ai/source/BbBaseTextarea.md +480 -0
- package/dist/ai/source/BbBaseTimePickerInput.md +1031 -0
- package/dist/ai/source/BbBreadcrumbs.md +815 -0
- package/dist/ai/source/BbButton.md +1006 -0
- package/dist/ai/source/BbCheckbox.md +326 -0
- package/dist/ai/source/BbCheckboxGroup.md +419 -0
- package/dist/ai/source/BbCollapsible.md +137 -0
- package/dist/ai/source/BbColorInput.md +322 -0
- package/dist/ai/source/BbColorPalette.md +371 -0
- package/dist/ai/source/BbConfirm.md +193 -0
- package/dist/ai/source/BbConfirmPortal.md +74 -0
- package/dist/ai/source/BbDatePicker.md +729 -0
- package/dist/ai/source/BbDatePickerInput.md +525 -0
- package/dist/ai/source/BbDialog.md +818 -0
- package/dist/ai/source/BbDropdown.md +2387 -0
- package/dist/ai/source/BbDropdownButton.md +315 -0
- package/dist/ai/source/BbDropdownGroup.md +1259 -0
- package/dist/ai/source/BbDropzone.md +864 -0
- package/dist/ai/source/BbForm.md +100 -0
- package/dist/ai/source/BbIcon.md +214 -0
- package/dist/ai/source/BbIndicator.md +298 -0
- package/dist/ai/source/BbNumberInput.md +374 -0
- package/dist/ai/source/BbOffCanvas.md +1266 -0
- package/dist/ai/source/BbPagination.md +835 -0
- package/dist/ai/source/BbPopover.md +860 -0
- package/dist/ai/source/BbProgress.md +140 -0
- package/dist/ai/source/BbRadio.md +303 -0
- package/dist/ai/source/BbRadioGroup.md +420 -0
- package/dist/ai/source/BbRating.md +369 -0
- package/dist/ai/source/BbSelect.md +688 -0
- package/dist/ai/source/BbSelectPopover.md +2234 -0
- package/dist/ai/source/BbSlider.md +378 -0
- package/dist/ai/source/BbSmoothHeight.md +265 -0
- package/dist/ai/source/BbSpinner.md +127 -0
- package/dist/ai/source/BbSwitch.md +175 -0
- package/dist/ai/source/BbSwitchGroup.md +240 -0
- package/dist/ai/source/BbTable.md +3433 -0
- package/dist/ai/source/BbTabs.md +403 -0
- package/dist/ai/source/BbTabsList.md +578 -0
- package/dist/ai/source/BbTabsPanes.md +368 -0
- package/dist/ai/source/BbTabsRoot.md +372 -0
- package/dist/ai/source/BbTag.md +390 -0
- package/dist/ai/source/BbTextInput.md +352 -0
- package/dist/ai/source/BbTextarea.md +337 -0
- package/dist/ai/source/BbTimePicker.md +595 -0
- package/dist/ai/source/BbTimePickerInput.md +376 -0
- package/dist/ai/source/BbToast.md +525 -0
- package/dist/ai/source/BbToastPortal.md +482 -0
- package/dist/ai/source/BbTooltip.md +522 -0
- package/dist/ai/source/BbTree.md +323 -0
- package/dist/ai/source/ChipsBox.md +201 -0
- package/dist/ai/source/ClearableButton.md +70 -0
- package/dist/ai/source/CommaBox.md +202 -0
- package/dist/ai/source/CommonInputWrapper.md +554 -0
- package/dist/ai/source/CommonPopover.md +616 -0
- package/dist/ai/source/ErrorIcon.md +43 -0
- package/dist/ai/source/FlatListBox.md +396 -0
- package/dist/ai/source/GroupedListBox.md +540 -0
- package/dist/ai/source/GuidesComponent.md +383 -0
- package/dist/ai/source/ListBox.md +238 -0
- package/dist/ai/source/OptionsContainer.md +191 -0
- package/dist/ai/source/WarningIcon.md +47 -0
- package/dist/alert-variants.d.ts +19 -0
- package/dist/assets/css/reset.css_inline.js +4 -0
- package/dist/assets/svgs/alert.svg_raw.js +4 -0
- package/dist/assets/svgs/calendar.svg_raw.js +4 -0
- package/dist/assets/svgs/check_stroke.svg_raw.js +4 -0
- package/dist/assets/svgs/chevron_down.svg_raw.js +4 -0
- package/dist/assets/svgs/chevron_right.svg_raw.js +4 -0
- package/dist/assets/svgs/clear.svg_raw.js +4 -0
- package/dist/assets/svgs/clock.svg_raw.js +4 -0
- package/dist/assets/svgs/error.svg_raw.js +4 -0
- package/dist/assets/svgs/search.svg_raw.js +4 -0
- package/dist/assets/svgs/sort.svg_raw.js +4 -0
- package/dist/assets/svgs/spinner.svg_raw.js +4 -0
- package/dist/assets/svgs/user.svg_raw.js +4 -0
- package/dist/badge-variants.d.ts +19 -0
- package/dist/button-variants.d.ts +21 -0
- package/dist/components/BbAccordion/BbAccordion.vue.d.ts +9 -3
- package/dist/components/BbAccordion/BbAccordion.vue.js +6 -0
- package/dist/components/BbAccordion/BbAccordion.vue_vue_type_script_setup_true_lang.js +66 -0
- package/dist/components/BbAccordion/types.d.ts +12 -8
- package/dist/components/BbAlert/BbAlert.vue.d.ts +12 -3
- package/dist/components/BbAlert/BbAlert.vue.js +6 -0
- package/dist/components/BbAlert/BbAlert.vue_vue_type_script_setup_true_lang.js +65 -0
- package/dist/components/BbAlert/types.d.ts +56 -12
- package/dist/components/BbAsterisk/BbAsterisk.vue.d.ts +3 -0
- package/dist/components/BbAsterisk/BbAsterisk.vue.js +6 -0
- package/dist/components/BbAsterisk/BbAsterisk.vue_vue_type_script_setup_true_lang.js +13 -0
- package/dist/components/BbAvatar/BbAvatar.vue.d.ts +5 -0
- package/dist/components/BbAvatar/BbAvatar.vue.js +6 -0
- package/dist/components/BbAvatar/BbAvatar.vue_vue_type_script_setup_true_lang.js +78 -0
- package/dist/components/BbAvatar/types.d.ts +6 -5
- package/dist/components/BbBadge/BadgeAppendIcon.vue.d.ts +3 -0
- package/dist/components/BbBadge/BadgeAppendIcon.vue.js +5 -0
- package/dist/components/BbBadge/BadgeAppendIcon.vue_vue_type_script_setup_true_lang.js +22 -0
- package/dist/components/BbBadge/BadgeBodyContent.vue.d.ts +15 -0
- package/dist/components/BbBadge/BadgeBodyContent.vue.js +5 -0
- package/dist/components/BbBadge/BadgeBodyContent.vue_vue_type_script_setup_true_lang.js +34 -0
- package/dist/components/BbBadge/BbBadge.vue.d.ts +8 -1
- package/dist/components/BbBadge/BbBadge.vue.js +6 -0
- package/dist/components/BbBadge/BbBadge.vue_vue_type_script_setup_true_lang.js +83 -0
- package/dist/components/BbBadge/BbBadgeButton.vue.d.ts +12 -0
- package/dist/components/BbBadge/BbBadgeButton.vue.js +5 -0
- package/dist/components/BbBadge/BbBadgeButton.vue_vue_type_script_setup_true_lang.js +54 -0
- package/dist/components/BbBadge/badgeButtonContext.d.ts +27 -0
- package/dist/components/BbBadge/badgeButtonContext.js +5 -0
- package/dist/components/BbBadge/types.d.ts +61 -16
- package/dist/components/BbBaseButton/BbBaseButton.vue.d.ts +13 -0
- package/dist/components/BbBaseButton/BbBaseButton.vue.js +6 -0
- package/dist/components/BbBaseButton/BbBaseButton.vue_vue_type_script_setup_true_lang.js +171 -0
- package/dist/components/BbBaseButton/RouterComponent.vue.js +5 -0
- package/dist/components/BbBaseButton/RouterComponent.vue_vue_type_script_setup_true_lang.js +29 -0
- package/dist/components/BbBaseButton/types.d.ts +191 -0
- package/dist/components/BbBaseButton/types.js +33 -0
- package/dist/components/BbBaseCheckbox/BbBaseCheckbox.vue.d.ts +40 -0
- package/dist/components/BbBaseCheckbox/BbBaseCheckbox.vue.js +6 -0
- package/dist/components/BbBaseCheckbox/BbBaseCheckbox.vue_vue_type_script_setup_true_lang.js +145 -0
- package/dist/components/BbBaseCheckbox/types.d.ts +224 -0
- package/dist/components/BbBaseCheckboxGroup/BbBaseCheckboxGroup.vue.d.ts +19 -0
- package/dist/components/BbBaseCheckboxGroup/BbBaseCheckboxGroup.vue.js +6 -0
- package/dist/components/BbBaseCheckboxGroup/BbBaseCheckboxGroup.vue_vue_type_script_setup_true_lang.js +190 -0
- package/dist/components/BbBaseCheckboxGroup/types.d.ts +257 -0
- package/dist/components/BbBaseCheckboxIcon/BbBaseCheckboxIcon.vue.d.ts +4 -0
- package/dist/components/BbBaseCheckboxIcon/BbBaseCheckboxIcon.vue.js +6 -0
- package/dist/components/BbBaseCheckboxIcon/BbBaseCheckboxIcon.vue_vue_type_script_setup_true_lang.js +43 -0
- package/dist/components/BbBaseCheckboxIcon/types.d.ts +47 -0
- package/dist/components/BbBaseColorInput/BbBaseColorInput.vue.d.ts +42 -0
- package/dist/components/BbBaseColorInput/BbBaseColorInput.vue.js +6 -0
- package/dist/components/BbBaseColorInput/BbBaseColorInput.vue_vue_type_script_setup_true_lang.js +178 -0
- package/dist/components/BbBaseColorInput/types.d.ts +210 -0
- package/dist/components/BbBaseColorPalette/BbBaseColorPalette.vue.d.ts +13 -0
- package/dist/components/BbBaseColorPalette/BbBaseColorPalette.vue.js +6 -0
- package/dist/components/BbBaseColorPalette/BbBaseColorPalette.vue_vue_type_script_setup_true_lang.js +395 -0
- package/dist/components/BbBaseColorPalette/types.d.ts +40 -0
- package/dist/components/BbBaseDatePicker/BbBaseDatePicker.vue.js +6 -0
- package/dist/components/BbBaseDatePicker/BbBaseDatePicker.vue_vue_type_script_setup_true_lang.js +300 -0
- package/dist/components/BbBaseDatePicker/BbBaseDatePickerInputDaySelector.vue.d.ts +44 -0
- package/dist/components/BbBaseDatePicker/BbBaseDatePickerInputDaySelector.vue.js +5 -0
- package/dist/components/BbBaseDatePicker/BbBaseDatePickerInputDaySelector.vue_vue_type_script_setup_true_lang.js +310 -0
- package/dist/components/BbBaseDatePicker/BbBaseDatePickerMonthSelector.vue.d.ts +5 -0
- package/dist/components/BbBaseDatePicker/BbBaseDatePickerMonthSelector.vue.js +5 -0
- package/dist/components/BbBaseDatePicker/BbBaseDatePickerMonthSelector.vue_vue_type_script_setup_true_lang.js +63 -0
- package/dist/components/BbBaseDatePicker/BbBaseDatePickerYearSelector.vue.d.ts +5 -0
- package/dist/components/BbBaseDatePicker/BbBaseDatePickerYearSelector.vue.js +5 -0
- package/dist/components/BbBaseDatePicker/BbBaseDatePickerYearSelector.vue_vue_type_script_setup_true_lang.js +75 -0
- package/dist/components/BbBaseDatePicker/typeahead.d.ts +112 -0
- package/dist/components/BbBaseDatePicker/typeahead.js +37 -0
- package/dist/components/BbBaseDatePicker/types.d.ts +97 -0
- package/dist/components/BbBaseDatePicker/useDatePickerContext.d.ts +58 -0
- package/dist/components/BbBaseDatePicker/useDatePickerContext.js +11 -0
- package/dist/components/BbBaseDatePickerInput/BbBaseDatePickerInput.vue.d.ts +30 -0
- package/dist/components/BbBaseDatePickerInput/BbBaseDatePickerInput.vue.js +6 -0
- package/dist/components/BbBaseDatePickerInput/BbBaseDatePickerInput.vue_vue_type_script_setup_true_lang.js +716 -0
- package/dist/components/BbBaseDatePickerInput/BbBaseDatePickerTimeSelector.vue.d.ts +30 -0
- package/dist/components/BbBaseDatePickerInput/BbBaseDatePickerTimeSelector.vue.js +6 -0
- package/dist/components/BbBaseDatePickerInput/BbBaseDatePickerTimeSelector.vue_vue_type_script_setup_true_lang.js +204 -0
- package/dist/components/BbBaseDatePickerInput/types.d.ts +311 -0
- package/dist/components/BbBaseInputContainer/BbBaseInputContainer.vue.d.ts +17 -0
- package/dist/components/BbBaseInputContainer/BbBaseInputContainer.vue.js +6 -0
- package/dist/components/BbBaseInputContainer/BbBaseInputContainer.vue_vue_type_script_setup_true_lang.js +191 -0
- package/dist/components/BbBaseInputContainer/types.d.ts +197 -0
- package/dist/components/BbBaseNumberInput/BbBaseNumberInput.vue.d.ts +52 -0
- package/dist/components/BbBaseNumberInput/BbBaseNumberInput.vue.js +6 -0
- package/dist/components/BbBaseNumberInput/BbBaseNumberInput.vue_vue_type_script_setup_true_lang.js +215 -0
- package/dist/components/BbBaseNumberInput/types.d.ts +211 -0
- package/dist/components/BbBaseRadio/BbBaseRadio.vue.d.ts +33 -0
- package/dist/components/BbBaseRadio/BbBaseRadio.vue.js +6 -0
- package/dist/components/BbBaseRadio/BbBaseRadio.vue_vue_type_script_setup_true_lang.js +114 -0
- package/dist/components/BbBaseRadio/types.d.ts +179 -0
- package/dist/components/BbBaseRadioGroup/BbBaseRadioGroup.vue.d.ts +19 -0
- package/dist/components/BbBaseRadioGroup/BbBaseRadioGroup.vue.js +6 -0
- package/dist/components/BbBaseRadioGroup/BbBaseRadioGroup.vue_vue_type_script_setup_true_lang.js +177 -0
- package/dist/components/BbBaseRadioGroup/types.d.ts +223 -0
- package/dist/components/BbBaseRadioIcon/BbBaseRadioIcon.vue.d.ts +4 -0
- package/dist/components/BbBaseRadioIcon/BbBaseRadioIcon.vue.js +6 -0
- package/dist/components/BbBaseRadioIcon/BbBaseRadioIcon.vue_vue_type_script_setup_true_lang.js +28 -0
- package/dist/components/BbBaseRadioIcon/types.d.ts +41 -0
- package/dist/components/BbBaseRating/BbBaseRating.vue.d.ts +38 -0
- package/dist/components/BbBaseRating/BbBaseRating.vue.js +6 -0
- package/dist/components/BbBaseRating/BbBaseRating.vue_vue_type_script_setup_true_lang.js +184 -0
- package/dist/components/BbBaseRating/types.d.ts +168 -0
- package/dist/components/BbBaseSelect/BbBaseSelect.vue.d.ts +19 -0
- package/dist/components/BbBaseSelect/BbBaseSelect.vue.js +6 -0
- package/dist/components/BbBaseSelect/BbBaseSelect.vue_vue_type_script_setup_true_lang.js +307 -0
- package/dist/components/BbBaseSelect/types.d.ts +297 -0
- package/dist/components/BbBaseSlider/BbBaseSlider.vue.d.ts +35 -0
- package/dist/components/BbBaseSlider/BbBaseSlider.vue.js +6 -0
- package/dist/components/BbBaseSlider/BbBaseSlider.vue_vue_type_script_setup_true_lang.js +324 -0
- package/dist/components/BbBaseSlider/types.d.ts +200 -0
- package/dist/components/BbBaseSwitch/BbBaseSwitch.vue.d.ts +35 -0
- package/dist/components/BbBaseSwitch/BbBaseSwitch.vue.js +6 -0
- package/dist/components/BbBaseSwitch/BbBaseSwitch.vue_vue_type_script_setup_true_lang.js +146 -0
- package/dist/components/BbBaseSwitch/types.d.ts +10 -0
- package/dist/components/BbBaseSwitchGroup/BbBaseSwitchGroup.vue.d.ts +19 -0
- package/dist/components/BbBaseSwitchGroup/BbBaseSwitchGroup.vue.js +6 -0
- package/dist/components/BbBaseSwitchGroup/BbBaseSwitchGroup.vue_vue_type_script_setup_true_lang.js +190 -0
- package/dist/components/BbBaseSwitchGroup/types.d.ts +8 -0
- package/dist/components/BbBaseSwitchIcon/BbBaseSwitchIcon.vue.d.ts +4 -0
- package/dist/components/BbBaseSwitchIcon/BbBaseSwitchIcon.vue.js +6 -0
- package/dist/components/BbBaseSwitchIcon/BbBaseSwitchIcon.vue_vue_type_script_setup_true_lang.js +30 -0
- package/dist/components/BbBaseSwitchIcon/types.d.ts +48 -0
- package/dist/components/BbBaseTag/BbBaseTag.vue.d.ts +50 -0
- package/dist/components/BbBaseTag/BbBaseTag.vue.js +6 -0
- package/dist/components/BbBaseTag/BbBaseTag.vue_vue_type_script_setup_true_lang.js +266 -0
- package/dist/components/BbBaseTag/types.d.ts +160 -0
- package/dist/components/BbBaseTextInput/BbBaseTextInput.vue.d.ts +45 -0
- package/dist/components/BbBaseTextInput/BbBaseTextInput.vue.js +6 -0
- package/dist/components/BbBaseTextInput/BbBaseTextInput.vue_vue_type_script_setup_true_lang.js +200 -0
- package/dist/components/BbBaseTextInput/types.d.ts +209 -0
- package/dist/components/BbBaseTextarea/BbBaseTextarea.vue.d.ts +39 -0
- package/dist/components/BbBaseTextarea/BbBaseTextarea.vue.js +6 -0
- package/dist/components/BbBaseTextarea/BbBaseTextarea.vue_vue_type_script_setup_true_lang.js +175 -0
- package/dist/components/BbBaseTextarea/types.d.ts +170 -0
- package/dist/components/BbBaseTimePickerInput/BbBaseTimePickerInput.vue.d.ts +27 -0
- package/dist/components/BbBaseTimePickerInput/BbBaseTimePickerInput.vue.js +6 -0
- package/dist/components/BbBaseTimePickerInput/BbBaseTimePickerInput.vue_vue_type_script_setup_true_lang.js +522 -0
- package/dist/components/BbBaseTimePickerInput/types.d.ts +151 -0
- package/dist/components/BbBreadcrumbs/BbBreadcrumbs.vue.d.ts +0 -1
- package/dist/components/BbBreadcrumbs/BbBreadcrumbs.vue.js +6 -0
- package/dist/components/BbBreadcrumbs/BbBreadcrumbs.vue_vue_type_script_setup_true_lang.js +224 -0
- package/dist/components/BbBreadcrumbs/estimateBreadcrumbItemWidth.js +47 -0
- package/dist/components/BbBreadcrumbs/types.d.ts +37 -22
- package/dist/components/BbButton/BbButton.vue.d.ts +6 -5
- package/dist/components/BbButton/BbButton.vue.js +6 -0
- package/dist/components/BbButton/BbButton.vue_vue_type_script_setup_true_lang.js +181 -0
- package/dist/components/BbButton/types.d.ts +48 -47
- package/dist/components/BbCheckbox/BbCheckbox.vue.d.ts +4 -3
- package/dist/components/BbCheckbox/BbCheckbox.vue.js +6 -0
- package/dist/components/BbCheckbox/BbCheckbox.vue_vue_type_script_setup_true_lang.js +146 -0
- package/dist/components/BbCheckbox/types.d.ts +31 -10
- package/dist/components/BbCheckboxGroup/BbCheckboxGroup.vue.d.ts +2 -13
- package/dist/components/BbCheckboxGroup/BbCheckboxGroup.vue.js +6 -0
- package/dist/components/BbCheckboxGroup/BbCheckboxGroup.vue_vue_type_script_setup_true_lang.js +190 -0
- package/dist/components/BbCheckboxGroup/types.d.ts +51 -23
- package/dist/components/BbCollapsible/BbCollapsible.vue.d.ts +2 -1
- package/dist/components/BbCollapsible/BbCollapsible.vue.js +6 -0
- package/dist/components/BbCollapsible/BbCollapsible.vue_vue_type_script_setup_true_lang.js +31 -0
- package/dist/components/BbCollapsible/types.d.ts +13 -8
- package/dist/components/BbColorInput/BbColorInput.vue.d.ts +10 -1
- package/dist/components/BbColorInput/BbColorInput.vue.js +6 -0
- package/dist/components/BbColorInput/BbColorInput.vue_vue_type_script_setup_true_lang.js +177 -0
- package/dist/components/BbColorInput/types.d.ts +44 -11
- package/dist/components/BbColorPalette/BbColorPalette.vue.d.ts +5 -8
- package/dist/components/BbColorPalette/BbColorPalette.vue.js +5 -0
- package/dist/components/BbColorPalette/BbColorPalette.vue_vue_type_script_setup_true_lang.js +126 -0
- package/dist/components/BbColorPalette/types.d.ts +71 -52
- package/dist/components/BbConfirm/BbConfirm.vue.js +6 -0
- package/dist/components/BbConfirm/BbConfirm.vue_vue_type_script_setup_true_lang.js +138 -0
- package/dist/components/BbConfirm/BbConfirmPortal.vue.d.ts +5 -6
- package/dist/components/BbConfirm/BbConfirmPortal.vue.js +5 -0
- package/dist/components/BbConfirm/BbConfirmPortal.vue_vue_type_script_setup_true_lang.js +19 -0
- package/dist/components/BbDatePicker/BbDatePicker.vue.d.ts +37 -0
- package/dist/components/BbDatePicker/BbDatePicker.vue.js +6 -0
- package/dist/components/BbDatePicker/BbDatePicker.vue_vue_type_script_setup_true_lang.js +319 -0
- package/dist/components/BbDatePicker/types.d.ts +159 -0
- package/dist/components/BbDatePickerInput/BbDatePickerInput.vue.d.ts +3 -1
- package/dist/components/BbDatePickerInput/BbDatePickerInput.vue.js +6 -0
- package/dist/components/BbDatePickerInput/BbDatePickerInput.vue_vue_type_script_setup_true_lang.js +179 -0
- package/dist/components/BbDatePickerInput/types.d.ts +134 -16
- package/dist/components/BbDialog/BbDialog.vue.d.ts +14 -6
- package/dist/components/BbDialog/BbDialog.vue.js +6 -0
- package/dist/components/BbDialog/BbDialog.vue_vue_type_script_setup_true_lang.js +214 -0
- package/dist/components/BbDialog/types.d.ts +146 -1
- package/dist/components/BbDialog/useDialogStack.d.ts +5 -0
- package/dist/components/BbDialog/useDialogStack.js +20 -0
- package/dist/components/BbDropdown/AdaptiveDropdown.vue.d.ts +24 -0
- package/dist/components/BbDropdown/AdaptiveDropdown.vue.js +6 -0
- package/dist/components/BbDropdown/AdaptiveDropdown.vue_vue_type_script_setup_true_lang.js +116 -0
- package/dist/components/BbDropdown/BbDropdown.vue.d.ts +14 -7
- package/dist/components/BbDropdown/BbDropdown.vue.js +6 -0
- package/dist/components/BbDropdown/BbDropdown.vue_vue_type_script_setup_true_lang.js +561 -0
- package/dist/components/BbDropdown/BbDropdownGroup.vue.d.ts +44 -0
- package/dist/components/BbDropdown/BbDropdownGroup.vue.js +5 -0
- package/dist/components/BbDropdown/BbDropdownGroup.vue_vue_type_script_setup_true_lang.js +36 -0
- package/dist/components/BbDropdown/BbDropdownList.vue.d.ts +31 -0
- package/dist/components/BbDropdown/BbDropdownList.vue.js +6 -0
- package/dist/components/BbDropdown/BbDropdownList.vue_vue_type_script_setup_true_lang.js +470 -0
- package/dist/components/BbDropdown/DropdownPipelineResolver.vue.d.ts +16 -0
- package/dist/components/BbDropdown/DropdownPipelineResolver.vue.js +5 -0
- package/dist/components/BbDropdown/DropdownPipelineResolver.vue_vue_type_script_setup_true_lang.js +168 -0
- package/dist/components/BbDropdown/normalizeGroups.d.ts +18 -0
- package/dist/components/BbDropdown/normalizeGroups.js +46 -0
- package/dist/components/BbDropdown/types.d.ts +468 -46
- package/dist/components/BbDropdown/types.js +4 -0
- package/dist/components/BbDropdown/useDropdownContext.d.ts +89 -0
- package/dist/components/BbDropdown/useDropdownContext.js +9 -0
- package/dist/components/BbDropdown/useDropdownGroupRegistry.d.ts +108 -0
- package/dist/components/BbDropdown/useDropdownGroupRegistry.js +5 -0
- package/dist/components/BbDropdownButton/BbDropdownButton.vue.d.ts +3 -3
- package/dist/components/BbDropdownButton/BbDropdownButton.vue.js +6 -0
- package/dist/components/BbDropdownButton/BbDropdownButton.vue_vue_type_script_setup_true_lang.js +119 -0
- package/dist/components/BbDropdownButton/types.d.ts +47 -52
- package/dist/components/BbDropzone/BbDropzone.vue.d.ts +5 -4
- package/dist/components/BbDropzone/BbDropzone.vue.js +6 -0
- package/dist/components/BbDropzone/BbDropzone.vue_vue_type_script_setup_true_lang.js +308 -0
- package/dist/components/BbDropzone/types.d.ts +77 -8
- package/dist/components/BbIcon/BbIcon.vue.d.ts +3 -2
- package/dist/components/BbIcon/BbIcon.vue.js +6 -0
- package/dist/components/BbIcon/BbIcon.vue_vue_type_script_setup_true_lang.js +65 -0
- package/dist/components/BbIcon/types.d.ts +6 -19
- package/dist/components/BbIndicator/BbIndicator.vue.d.ts +14 -0
- package/dist/components/BbIndicator/BbIndicator.vue.js +6 -0
- package/dist/components/BbIndicator/BbIndicator.vue_vue_type_script_setup_true_lang.js +56 -0
- package/dist/components/BbIndicator/types.d.ts +49 -0
- package/dist/components/BbNumberInput/BbNumberInput.vue.d.ts +12 -6
- package/dist/components/BbNumberInput/BbNumberInput.vue.js +6 -0
- package/dist/components/BbNumberInput/BbNumberInput.vue_vue_type_script_setup_true_lang.js +194 -0
- package/dist/components/BbNumberInput/types.d.ts +40 -4
- package/dist/components/BbOffCanvas/BbOffCanvas.vue.d.ts +16 -10
- package/dist/components/BbOffCanvas/BbOffCanvas.vue.js +6 -0
- package/dist/components/BbOffCanvas/BbOffCanvas.vue_vue_type_script_setup_true_lang.js +284 -0
- package/dist/components/BbOffCanvas/types.d.ts +71 -39
- package/dist/components/BbOffCanvas/useOffCanvasStack.d.ts +25 -0
- package/dist/components/BbOffCanvas/useOffCanvasStack.js +68 -0
- package/dist/components/BbPagination/BbPagination.vue.d.ts +9 -4
- package/dist/components/BbPagination/BbPagination.vue.js +6 -0
- package/dist/components/BbPagination/BbPagination.vue_vue_type_script_setup_true_lang.js +244 -0
- package/dist/components/BbPagination/paginationFit.d.ts +38 -0
- package/dist/components/BbPagination/paginationFit.js +13 -0
- package/dist/components/BbPagination/types.d.ts +51 -16
- package/dist/components/BbPopover/BbPopover.vue.d.ts +16 -15
- package/dist/components/BbPopover/BbPopover.vue.js +6 -0
- package/dist/components/BbPopover/BbPopover.vue_vue_type_script_setup_true_lang.js +309 -0
- package/dist/components/BbPopover/escapeStack.d.ts +6 -0
- package/dist/components/BbPopover/escapeStack.js +10 -0
- package/dist/components/BbPopover/types.d.ts +90 -31
- package/dist/components/BbProgress/BbProgress.vue.d.ts +1 -0
- package/dist/components/BbProgress/BbProgress.vue.js +6 -0
- package/dist/components/BbProgress/BbProgress.vue_vue_type_script_setup_true_lang.js +36 -0
- package/dist/components/BbProgress/types.d.ts +15 -1
- package/dist/components/BbRadio/BbRadio.vue.d.ts +5 -3
- package/dist/components/BbRadio/BbRadio.vue.js +6 -0
- package/dist/components/BbRadio/BbRadio.vue_vue_type_script_setup_true_lang.js +133 -0
- package/dist/components/BbRadio/types.d.ts +32 -9
- package/dist/components/BbRadioGroup/BbRadioGroup.vue.d.ts +4 -14
- package/dist/components/BbRadioGroup/BbRadioGroup.vue.js +6 -0
- package/dist/components/BbRadioGroup/BbRadioGroup.vue_vue_type_script_setup_true_lang.js +186 -0
- package/dist/components/BbRadioGroup/types.d.ts +48 -22
- package/dist/components/BbRating/BbRating.vue.d.ts +4 -1
- package/dist/components/BbRating/BbRating.vue.js +6 -0
- package/dist/components/BbRating/BbRating.vue_vue_type_script_setup_true_lang.js +150 -0
- package/dist/components/BbRating/types.d.ts +44 -10
- package/dist/components/BbSelect/BbSelect.vue.d.ts +2 -11
- package/dist/components/BbSelect/BbSelect.vue.js +6 -0
- package/dist/components/BbSelect/BbSelect.vue_vue_type_script_setup_true_lang.js +241 -0
- package/dist/components/BbSelect/types.d.ts +112 -59
- package/dist/components/BbSelectPopover/BbSelectPopover.vue.d.ts +1 -10
- package/dist/components/BbSelectPopover/BbSelectPopover.vue.js +6 -0
- package/dist/components/BbSelectPopover/BbSelectPopover.vue_vue_type_script_setup_true_lang.js +639 -0
- package/dist/components/BbSelectPopover/types.d.ts +197 -105
- package/dist/components/BbSlider/BbSlider.vue.d.ts +3 -6
- package/dist/components/BbSlider/BbSlider.vue.js +6 -0
- package/dist/components/BbSlider/BbSlider.vue_vue_type_script_setup_true_lang.js +166 -0
- package/dist/components/BbSlider/types.d.ts +44 -13
- package/dist/components/BbSmoothHeight/BbSmoothHeight.vue.d.ts +3 -1
- package/dist/components/BbSmoothHeight/BbSmoothHeight.vue.js +6 -0
- package/dist/components/BbSmoothHeight/BbSmoothHeight.vue_vue_type_script_setup_true_lang.js +79 -0
- package/dist/components/BbSmoothHeight/types.d.ts +17 -2
- package/dist/components/BbSpinner/BbSpinner.vue.d.ts +1 -1
- package/dist/components/BbSpinner/BbSpinner.vue.js +6 -0
- package/dist/components/BbSpinner/BbSpinner.vue_vue_type_script_setup_true_lang.js +30 -0
- package/dist/components/BbSpinner/types.d.ts +10 -3
- package/dist/components/BbSwitch/BbSwitch.vue.d.ts +5 -3
- package/dist/components/BbSwitch/BbSwitch.vue.js +6 -0
- package/dist/components/BbSwitch/BbSwitch.vue_vue_type_script_setup_true_lang.js +142 -0
- package/dist/components/BbSwitch/types.d.ts +3 -1
- package/dist/components/BbSwitchGroup/BbSwitchGroup.vue.d.ts +4 -14
- package/dist/components/BbSwitchGroup/BbSwitchGroup.vue.js +6 -0
- package/dist/components/BbSwitchGroup/BbSwitchGroup.vue_vue_type_script_setup_true_lang.js +190 -0
- package/dist/components/BbSwitchGroup/types.d.ts +3 -22
- package/dist/components/BbTable/BbTable.vue.d.ts +58 -31
- package/dist/components/BbTable/BbTable.vue.js +6 -0
- package/dist/components/BbTable/BbTable.vue_vue_type_script_setup_true_lang.js +900 -0
- package/dist/components/BbTable/types.d.ts +213 -37
- package/dist/components/BbTable/utils.d.ts +9 -1
- package/dist/components/BbTable/utils.js +53 -0
- package/dist/components/BbTabs/BbTabs.vue.d.ts +20 -0
- package/dist/components/BbTabs/BbTabs.vue.js +6 -0
- package/dist/components/BbTabs/BbTabs.vue_vue_type_script_setup_true_lang.js +64 -0
- package/dist/components/BbTabs/BbTabsList.vue.d.ts +19 -0
- package/dist/components/BbTabs/BbTabsList.vue.js +6 -0
- package/dist/components/BbTabs/BbTabsList.vue_vue_type_script_setup_true_lang.js +123 -0
- package/dist/components/BbTabs/BbTabsPanes.vue.d.ts +16 -0
- package/dist/components/BbTabs/BbTabsPanes.vue.js +6 -0
- package/dist/components/BbTabs/BbTabsPanes.vue_vue_type_script_setup_true_lang.js +35 -0
- package/dist/components/BbTabs/BbTabsRoot.vue.d.ts +20 -0
- package/dist/components/BbTabs/BbTabsRoot.vue.js +5 -0
- package/dist/components/BbTabs/BbTabsRoot.vue_vue_type_script_setup_true_lang.js +55 -0
- package/dist/components/BbTabs/types.d.ts +264 -0
- package/dist/components/BbTag/BbTag.vue.d.ts +19 -6
- package/dist/components/BbTag/BbTag.vue.js +6 -0
- package/dist/components/BbTag/BbTag.vue_vue_type_script_setup_true_lang.js +187 -0
- package/dist/components/BbTag/types.d.ts +55 -17
- package/dist/components/BbTextInput/BbTextInput.vue.d.ts +10 -1
- package/dist/components/BbTextInput/BbTextInput.vue.js +6 -0
- package/dist/components/BbTextInput/BbTextInput.vue_vue_type_script_setup_true_lang.js +195 -0
- package/dist/components/BbTextInput/types.d.ts +31 -4
- package/dist/components/BbTextarea/BbTextarea.vue.d.ts +10 -1
- package/dist/components/BbTextarea/BbTextarea.vue.js +6 -0
- package/dist/components/BbTextarea/BbTextarea.vue_vue_type_script_setup_true_lang.js +178 -0
- package/dist/components/BbTextarea/types.d.ts +33 -2
- package/dist/components/BbTimePicker/BbTimePicker.vue.d.ts +33 -0
- package/dist/components/BbTimePicker/BbTimePicker.vue.js +6 -0
- package/dist/components/BbTimePicker/BbTimePicker.vue_vue_type_script_setup_true_lang.js +244 -0
- package/dist/components/BbTimePicker/types.d.ts +133 -0
- package/dist/components/BbTimePickerInput/BbTimePickerInput.vue.d.ts +25 -0
- package/dist/components/BbTimePickerInput/BbTimePickerInput.vue.js +6 -0
- package/dist/components/BbTimePickerInput/BbTimePickerInput.vue_vue_type_script_setup_true_lang.js +157 -0
- package/dist/components/BbTimePickerInput/types.d.ts +174 -0
- package/dist/components/BbToast/BbToast.vue.d.ts +2 -3
- package/dist/components/BbToast/BbToast.vue.js +6 -0
- package/dist/components/BbToast/BbToast.vue_vue_type_script_setup_true_lang.js +39 -0
- package/dist/components/BbToast/BbToastMessage.vue.d.ts +17 -8
- package/dist/components/BbToast/BbToastMessage.vue.js +5 -0
- package/dist/components/BbToast/BbToastMessage.vue_vue_type_script_setup_true_lang.js +170 -0
- package/dist/components/BbToast/BbToastPortal.vue.d.ts +30 -0
- package/dist/components/BbToast/BbToastPortal.vue.js +5 -0
- package/dist/components/BbToast/BbToastPortal.vue_vue_type_script_setup_true_lang.js +19 -0
- package/dist/components/BbToast/BbToastRegion.vue.d.ts +8 -0
- package/dist/components/BbToast/BbToastRegion.vue.js +5 -0
- package/dist/components/BbToast/BbToastRegion.vue_vue_type_script_setup_true_lang.js +100 -0
- package/dist/components/BbToast/types.d.ts +69 -5
- package/dist/components/BbTooltip/BbTooltip.vue.d.ts +10 -3
- package/dist/components/BbTooltip/BbTooltip.vue.js +6 -0
- package/dist/components/BbTooltip/BbTooltip.vue_vue_type_script_setup_true_lang.js +160 -0
- package/dist/components/BbTooltip/types.d.ts +69 -11
- package/dist/components/BbTree/BbTree.vue.d.ts +28 -13
- package/dist/components/BbTree/BbTree.vue.js +6 -0
- package/dist/components/BbTree/BbTree.vue_vue_type_script_setup_true_lang.js +55 -0
- package/dist/components/BbTree/BbTreeLevel.vue.d.ts +19 -0
- package/dist/components/BbTree/BbTreeLevel.vue.js +5 -0
- package/dist/components/BbTree/BbTreeLevel.vue_vue_type_script_setup_true_lang.js +94 -0
- package/dist/components/BbTree/context.d.ts +17 -0
- package/dist/components/BbTree/context.js +4 -0
- package/dist/components/BbTree/types.d.ts +94 -41
- package/dist/components/ChipsBox/ChipsBox.vue.d.ts +2 -1
- package/dist/components/ChipsBox/ChipsBox.vue.js +5 -0
- package/dist/components/ChipsBox/ChipsBox.vue_vue_type_script_setup_true_lang.js +98 -0
- package/dist/components/ChipsBox/types.d.ts +12 -5
- package/dist/components/ClearableButton/ClearableButton.vue.d.ts +2 -1
- package/dist/components/ClearableButton/ClearableButton.vue.js +6 -0
- package/dist/components/ClearableButton/ClearableButton.vue_vue_type_script_setup_true_lang.js +19 -0
- package/dist/components/ClearableButton/types.d.ts +7 -1
- package/dist/components/CloseIcon/CloseButton.vue.d.ts +5 -0
- package/dist/components/CloseIcon/CloseButton.vue.js +7 -0
- package/dist/components/CloseIcon/CloseButton.vue_vue_type_script_setup_true_lang.js +23 -0
- package/dist/components/CloseIcon/types.d.ts +2 -0
- package/dist/components/CommaBox/CommaBox.vue.d.ts +2 -1
- package/dist/components/CommaBox/CommaBox.vue.js +6 -0
- package/dist/components/CommaBox/CommaBox.vue_vue_type_script_setup_true_lang.js +81 -0
- package/dist/components/CommaBox/types.d.ts +6 -7
- package/dist/components/CommonInputWrapper/CommonInputWrapper.vue.d.ts +19 -0
- package/dist/components/CommonInputWrapper/CommonInputWrapper.vue.js +6 -0
- package/dist/components/CommonInputWrapper/CommonInputWrapper.vue_vue_type_script_setup_true_lang.js +107 -0
- package/dist/components/CommonInputWrapper/types.d.ts +96 -0
- package/dist/components/CommonPopover/CommonPopover.vue.d.ts +9 -3
- package/dist/components/CommonPopover/CommonPopover.vue.js +6 -0
- package/dist/components/CommonPopover/CommonPopover.vue_vue_type_script_setup_true_lang.js +160 -0
- package/dist/components/CommonPopover/types.d.ts +65 -16
- package/dist/components/ErrorIcon/ErrorIcon.vue.d.ts +2 -0
- package/dist/components/ErrorIcon/ErrorIcon.vue.js +6 -0
- package/dist/components/ErrorIcon/ErrorIcon.vue_vue_type_script_setup_true_lang.js +16 -0
- package/dist/components/FlatListBox/FlatListBox.vue.d.ts +2 -5
- package/dist/components/FlatListBox/FlatListBox.vue.js +5 -0
- package/dist/components/FlatListBox/FlatListBox.vue_vue_type_script_setup_true_lang.js +167 -0
- package/dist/components/FlatListBox/types.d.ts +1 -1
- package/dist/components/GroupedListBox/GroupedListBox.vue.d.ts +2 -5
- package/dist/components/GroupedListBox/GroupedListBox.vue.js +5 -0
- package/dist/components/GroupedListBox/GroupedListBox.vue_vue_type_script_setup_true_lang.js +218 -0
- package/dist/components/ListBox/ListBox.vue.d.ts +3 -6
- package/dist/components/ListBox/ListBox.vue.js +5 -0
- package/dist/components/ListBox/ListBox.vue_vue_type_script_setup_true_lang.js +112 -0
- package/dist/components/ListBox/types.d.ts +1 -1
- package/dist/components/OptionsContainer/OptionsContainer.vue.d.ts +1 -0
- package/dist/components/OptionsContainer/OptionsContainer.vue.js +5 -0
- package/dist/components/OptionsContainer/OptionsContainer.vue_vue_type_script_setup_true_lang.js +52 -0
- package/dist/components/OptionsContainer/types.d.ts +14 -24
- package/dist/components/Transitions/ScaleFade.vue.d.ts +2 -2
- package/dist/components/Transitions/ScaleFade.vue.js +5 -0
- package/dist/components/Transitions/ScaleFade.vue_vue_type_script_setup_true_lang.js +47 -0
- package/dist/components/Transitions/Slide.vue.d.ts +15 -0
- package/dist/components/Transitions/Slide.vue.js +7 -0
- package/dist/components/Transitions/Slide.vue_vue_type_script_setup_true_lang.js +28 -0
- package/dist/components/WarningIcon/WarningIcon.vue.d.ts +5 -0
- package/dist/components/WarningIcon/WarningIcon.vue.js +6 -0
- package/dist/components/WarningIcon/WarningIcon.vue_vue_type_script_setup_true_lang.js +16 -0
- package/dist/components/WarningIcon/types.d.ts +3 -0
- package/dist/composables/__testResets.d.ts +1 -0
- package/dist/composables/useActiveInactiveState.d.ts +4 -0
- package/dist/composables/useActiveInactiveState.js +21 -0
- package/dist/composables/useBaseOptions.d.ts +3 -3
- package/dist/composables/useBaseOptions.js +31 -0
- package/dist/composables/useBbConfig.d.ts +8 -37
- package/dist/composables/useBbConfig.js +5 -0
- package/dist/composables/useBbDropdownContext.d.ts +89 -0
- package/dist/composables/useBbDropdownContext.js +46 -0
- package/dist/composables/useBbFormContext.d.ts +90 -0
- package/dist/composables/useBbFormContext.js +69 -0
- package/dist/composables/useBbTableContext.d.ts +195 -0
- package/dist/composables/useBbTableContext.js +208 -0
- package/dist/composables/useBbTabsContext.d.ts +111 -0
- package/dist/composables/useBbTabsContext.js +225 -0
- package/dist/composables/useBreakpoint.d.ts +13 -0
- package/dist/composables/useBreakpoint.js +39 -0
- package/dist/composables/useBroadcastChannelInstance.d.ts +1 -3
- package/dist/composables/useBroadcastChannelInstance.js +39 -0
- package/dist/composables/useCancelableFunction.js +37 -0
- package/dist/composables/useClosingInert.d.ts +28 -0
- package/dist/composables/useClosingInert.js +23 -0
- package/dist/composables/useCoherence.js +16 -0
- package/dist/composables/useConfirm.d.ts +278 -68
- package/dist/composables/useConfirm.js +130 -0
- package/dist/composables/useCountdown.js +42 -0
- package/dist/composables/useHashedWatcher.d.ts +17 -0
- package/dist/composables/useHashedWatcher.js +14 -0
- package/dist/composables/useId.d.ts +3 -2
- package/dist/composables/useIndexById.js +16 -0
- package/dist/composables/useInertiaPage.d.ts +10 -0
- package/dist/composables/useInertiaPage.js +8 -0
- package/dist/composables/useItemText.js +17 -0
- package/dist/composables/useItemValue.js +9 -0
- package/dist/composables/useItemsGetter.d.ts +1 -1
- package/dist/composables/useItemsGetter.js +30 -0
- package/dist/composables/useListboxFocus.js +66 -0
- package/dist/composables/useLocale.d.ts +1 -1
- package/dist/composables/useLocale.js +11 -0
- package/dist/composables/useLogger.d.ts +1 -1
- package/dist/composables/useLogger.js +10 -0
- package/dist/composables/useMinimalQueue.d.ts +1 -1
- package/dist/composables/useMobile.js +7 -0
- package/dist/composables/useOnFalsy.d.ts +2 -0
- package/dist/composables/useOnFalsy.js +9 -0
- package/dist/composables/useOnTruthy.d.ts +7 -0
- package/dist/composables/useOnTruthy.js +9 -0
- package/dist/composables/usePrefill.d.ts +2 -1
- package/dist/composables/usePrefill.js +24 -0
- package/dist/composables/useQuery.d.ts +15 -3
- package/dist/composables/useQuery.js +42 -0
- package/dist/composables/useRoute.js +11 -0
- package/dist/composables/useRouter.js +8 -0
- package/dist/composables/useSafeArea.d.ts +51 -0
- package/dist/composables/useSafeArea.js +16 -0
- package/dist/composables/useSegmentedFields.d.ts +104 -0
- package/dist/composables/useSegmentedFields.js +159 -0
- package/dist/composables/useTableWidthContext.d.ts +5 -0
- package/dist/composables/useTableWidthContext.js +42 -0
- package/dist/composables/useToast.d.ts +40 -70
- package/dist/composables/useToast.js +58 -0
- package/dist/composables/useTopLayer.d.ts +9 -0
- package/dist/composables/useTopLayer.js +7 -0
- package/dist/composables/useUntil.js +13 -0
- package/dist/composables/useViewportWidth.d.ts +17 -0
- package/dist/composables/useViewportWidth.js +6 -0
- package/dist/confirm-variants.d.ts +17 -0
- package/dist/deprecation/ai-deprecations.json.d.ts +784 -0
- package/dist/deprecation/ai-deprecations.json.js +4 -0
- package/dist/deprecation/removedProps.d.ts +3 -0
- package/dist/deprecation/removedProps.js +13 -0
- package/dist/directives/bbColor.d.ts +65 -0
- package/dist/directives/bbColor.js +24 -0
- package/dist/directives/bbDate.d.ts +66 -0
- package/dist/directives/bbDate.js +24 -0
- package/dist/directives/bbDropdown.d.ts +15 -11
- package/dist/directives/bbDropdown.js +23 -0
- package/dist/directives/bbTime.d.ts +64 -0
- package/dist/directives/bbTime.js +24 -0
- package/dist/directives/bbTooltip.d.ts +16 -11
- package/dist/directives/bbTooltip.js +24 -0
- package/dist/directives/createPopoverDirective.js +54 -0
- package/dist/dropdown-item-variants.d.ts +17 -0
- package/dist/i18n/index.d.ts +51 -3
- package/dist/i18n/index.js +27 -0
- package/dist/i18n/locales/cs.json +115 -0
- package/dist/i18n/locales/da.json +115 -0
- package/dist/i18n/locales/de.json +115 -0
- package/dist/i18n/locales/el.json +115 -0
- package/dist/i18n/locales/en.json +115 -0
- package/dist/i18n/locales/es.json +115 -0
- package/dist/i18n/locales/fi.json +115 -0
- package/dist/i18n/locales/fr.json +115 -0
- package/dist/i18n/locales/hu.json +115 -0
- package/dist/i18n/locales/it.json +115 -0
- package/dist/i18n/locales/ja.json +115 -0
- package/dist/i18n/locales/ko.json +115 -0
- package/dist/i18n/locales/nb.json +115 -0
- package/dist/i18n/locales/nl.json +115 -0
- package/dist/i18n/locales/pl.json +115 -0
- package/dist/i18n/locales/pt.json +115 -0
- package/dist/i18n/locales/ro.json +115 -0
- package/dist/i18n/locales/ru.json +115 -0
- package/dist/i18n/locales/sv.json +115 -0
- package/dist/i18n/locales/tr.json +115 -0
- package/dist/i18n/locales/uk.json +115 -0
- package/dist/i18n/locales/zh-cn.json +115 -0
- package/dist/icons-whitelist.d.ts +8 -0
- package/dist/index.d.ts +96 -79
- package/dist/index.js +76 -82
- package/dist/indicator-variants.d.ts +20 -0
- package/dist/llms-full.txt +79703 -0
- package/dist/llms-medium.txt +1514 -0
- package/dist/llms.txt +105 -0
- package/dist/locale-blueprint.json +141 -0
- package/dist/locale-registry.d.ts +37 -0
- package/dist/nuxt-module.d.ts +3 -0
- package/dist/nuxt.js +19 -0
- package/dist/plugin.d.ts +4 -0
- package/dist/plugin.js +22 -0
- package/dist/reset.css +1 -0
- package/dist/reset.d.ts +0 -0
- package/dist/runtime/nuxt-plugin.d.ts +2 -0
- package/dist/runtime/nuxt-plugin.js +24 -0
- package/dist/styles.css +2 -0
- package/dist/styles.d.ts +0 -0
- package/dist/toast-variants.d.ts +20 -0
- package/dist/tooltip-variants.d.ts +17 -0
- package/dist/types/ActionButton.d.ts +32 -0
- package/dist/types/AlertVariant.d.ts +16 -0
- package/dist/types/BadgeVariant.d.ts +16 -0
- package/dist/types/ButtonVariant.d.ts +17 -0
- package/dist/types/Classes.d.ts +1 -1
- package/dist/types/ColumnName.d.ts +1 -1
- package/dist/types/CommonProps.d.ts +68 -277
- package/dist/types/Config.d.ts +84 -0
- package/dist/types/ConfirmVariant.d.ts +15 -0
- package/dist/types/DropdownItemVariant.d.ts +18 -0
- package/dist/types/Icon.d.ts +5 -7
- package/dist/types/IndicatorVariant.d.ts +16 -0
- package/dist/types/InputDirection.d.ts +15 -0
- package/dist/types/ItemAccessor.d.ts +21 -0
- package/dist/types/Placement.d.ts +6 -0
- package/dist/types/ResponsiveSize.d.ts +20 -0
- package/dist/types/SizeScale.d.ts +8 -0
- package/dist/types/ToastVariant.d.ts +17 -0
- package/dist/types/TooltipVariant.d.ts +18 -0
- package/dist/utilities/functions/bytesToUnit.d.ts +2 -0
- package/dist/utilities/functions/bytesToUnit.js +18 -0
- package/dist/utilities/functions/clampPrecision.js +10 -0
- package/dist/utilities/functions/convertDateValue.d.ts +23 -10
- package/dist/utilities/functions/convertDateValue.js +12 -0
- package/dist/utilities/functions/deburr.js +5 -0
- package/dist/utilities/functions/empty.js +5 -0
- package/dist/utilities/functions/flattenTree.d.ts +1 -1
- package/dist/utilities/functions/hash.js +5 -0
- package/dist/utilities/functions/isDateDisabled.d.ts +1 -0
- package/dist/utilities/functions/isDateDisabled.js +20 -0
- package/dist/utilities/functions/isEqual.js +5 -0
- package/dist/utilities/functions/isNotEmpty.js +5 -0
- package/dist/utilities/functions/matchAnyKey.d.ts +1 -1
- package/dist/utilities/functions/matchAnyKey.js +15 -0
- package/dist/utilities/functions/parseSize.d.ts +1 -1
- package/dist/utilities/functions/parseSize.js +15 -0
- package/dist/utilities/functions/percentage.js +11 -0
- package/dist/utilities/functions/pipe.d.ts +1 -1
- package/dist/utilities/functions/reject.d.ts +25 -0
- package/dist/utilities/functions/reject.js +28 -0
- package/dist/utilities/functions/resolveEnumProp.d.ts +19 -0
- package/dist/utilities/functions/resolveEnumProp.js +5 -0
- package/dist/utilities/functions/slotKey.d.ts +13 -0
- package/dist/utilities/functions/slotKey.js +4 -0
- package/dist/utilities/functions/sort.d.ts +2 -2
- package/dist/utilities/functions/sort.js +19 -0
- package/dist/utilities/functions/throttle.js +5 -0
- package/dist/utilities/functions/waitFor.d.ts +9 -2
- package/dist/utilities/functions/waitFor.js +14 -0
- package/dist/utilities/functions/warnRemovedAttrs.d.ts +11 -0
- package/dist/utilities/functions/warnRemovedAttrs.js +20 -0
- package/dist/utilities/functions/when.js +5 -0
- package/dist/utilities/misc/iconsInjectionKey.d.ts +15 -0
- package/dist/utilities/misc/iconsInjectionKey.js +4 -0
- package/dist/utilities/misc/transitions.d.ts +5 -0
- package/dist/utilities/misc/transitions.js +8 -0
- package/dist/utils/injectLibraryStyles.d.ts +6 -0
- package/dist/utils/injectLibraryStyles.js +38 -0
- package/dist/validated/BbCheckbox.vue.d.ts +29 -0
- package/dist/validated/BbCheckbox.vue.js +5 -0
- package/dist/validated/BbCheckbox.vue_vue_type_script_setup_true_lang.js +75 -0
- package/dist/validated/BbCheckboxGroup.vue.d.ts +34 -0
- package/dist/validated/BbCheckboxGroup.vue.js +5 -0
- package/dist/validated/BbCheckboxGroup.vue_vue_type_script_setup_true_lang.js +82 -0
- package/dist/validated/BbColorInput.vue.d.ts +36 -0
- package/dist/validated/BbColorInput.vue.js +5 -0
- package/dist/validated/BbColorInput.vue_vue_type_script_setup_true_lang.js +71 -0
- package/dist/validated/BbDatePickerInput.vue.d.ts +41 -0
- package/dist/validated/BbDatePickerInput.vue.js +5 -0
- package/dist/validated/BbDatePickerInput.vue_vue_type_script_setup_true_lang.js +90 -0
- package/dist/validated/BbDropzone.vue.d.ts +24 -0
- package/dist/validated/BbDropzone.vue.js +5 -0
- package/dist/validated/BbDropzone.vue_vue_type_script_setup_true_lang.js +45 -0
- package/dist/validated/BbForm.vue.d.ts +28 -0
- package/dist/validated/BbForm.vue.js +5 -0
- package/dist/validated/BbForm.vue_vue_type_script_setup_true_lang.js +42 -0
- package/dist/validated/BbNumberInput.vue.d.ts +36 -0
- package/dist/validated/BbNumberInput.vue.js +5 -0
- package/dist/validated/BbNumberInput.vue_vue_type_script_setup_true_lang.js +72 -0
- package/dist/validated/BbRadioGroup.vue.d.ts +34 -0
- package/dist/validated/BbRadioGroup.vue.js +5 -0
- package/dist/validated/BbRadioGroup.vue_vue_type_script_setup_true_lang.js +78 -0
- package/dist/validated/BbRating.vue.d.ts +30 -0
- package/dist/validated/BbRating.vue.js +5 -0
- package/dist/validated/BbRating.vue_vue_type_script_setup_true_lang.js +63 -0
- package/dist/validated/BbSelect.vue.d.ts +46 -0
- package/dist/validated/BbSelect.vue.js +5 -0
- package/dist/validated/BbSelect.vue_vue_type_script_setup_true_lang.js +109 -0
- package/dist/validated/BbSlider.vue.d.ts +36 -0
- package/dist/validated/BbSlider.vue.js +5 -0
- package/dist/validated/BbSlider.vue_vue_type_script_setup_true_lang.js +69 -0
- package/dist/validated/BbSwitch.vue.d.ts +29 -0
- package/dist/validated/BbSwitch.vue.js +5 -0
- package/dist/validated/BbSwitch.vue_vue_type_script_setup_true_lang.js +75 -0
- package/dist/validated/BbSwitchGroup.vue.d.ts +34 -0
- package/dist/validated/BbSwitchGroup.vue.js +5 -0
- package/dist/validated/BbSwitchGroup.vue_vue_type_script_setup_true_lang.js +82 -0
- package/dist/validated/BbTag.vue.d.ts +36 -0
- package/dist/validated/BbTag.vue.js +5 -0
- package/dist/validated/BbTag.vue_vue_type_script_setup_true_lang.js +72 -0
- package/dist/validated/BbTextInput.vue.d.ts +36 -0
- package/dist/validated/BbTextInput.vue.js +5 -0
- package/dist/validated/BbTextInput.vue_vue_type_script_setup_true_lang.js +72 -0
- package/dist/validated/BbTextarea.vue.d.ts +36 -0
- package/dist/validated/BbTextarea.vue.js +5 -0
- package/dist/validated/BbTextarea.vue_vue_type_script_setup_true_lang.js +70 -0
- package/dist/validated/BbTimePickerInput.vue.d.ts +37 -0
- package/dist/validated/BbTimePickerInput.vue.js +5 -0
- package/dist/validated/BbTimePickerInput.vue_vue_type_script_setup_true_lang.js +81 -0
- package/dist/validated/index.d.ts +29 -0
- package/dist/validated/useValidatedField.d.ts +93 -0
- package/dist/validated/useValidatedField.js +51 -0
- package/dist/validated.js +21 -0
- package/dist/vite-plugin.d.ts +261 -0
- package/dist/vite.js +603 -0
- package/llms.txt +107 -0
- package/package.json +181 -60
- package/scripts/lib/__fixtures__/validated-manifest.json +65 -0
- package/scripts/lib/ensure-manifest.mjs +39 -0
- package/scripts/lib/eslint-plugin-autofix.node.test.mjs +109 -0
- package/scripts/lib/eslint-plugin-recommended.node.test.mjs +87 -0
- package/scripts/lib/eslint-plugin-slots.node.test.mjs +271 -0
- package/scripts/lib/eslint-plugin.mjs +702 -0
- package/scripts/lib/eslint-plugin.node.test.mjs +193 -0
- package/scripts/lib/html-attributes.mjs +191 -0
- package/scripts/lib/mcp-config.mjs +126 -0
- package/scripts/lib/migrate-fix.mjs +115 -0
- package/scripts/lib/validate-bb-markup.mjs +488 -0
- package/dist/ai/BaseButton.md +0 -449
- package/dist/ai/BaseCheckbox.md +0 -512
- package/dist/ai/BaseCheckboxGroup.md +0 -597
- package/dist/ai/BaseColorInput.md +0 -461
- package/dist/ai/BaseDatePicker.md +0 -739
- package/dist/ai/BaseDatePickerInput.md +0 -1517
- package/dist/ai/BaseDialog.md +0 -610
- package/dist/ai/BaseInputContainer.md +0 -570
- package/dist/ai/BaseNumberInput.md +0 -509
- package/dist/ai/BaseRadio.md +0 -405
- package/dist/ai/BaseRadioGroup.md +0 -535
- package/dist/ai/BaseRating.md +0 -489
- package/dist/ai/BaseSelect.md +0 -1742
- package/dist/ai/BaseSlider.md +0 -871
- package/dist/ai/BaseSwitch.md +0 -322
- package/dist/ai/BaseSwitchGroup.md +0 -298
- package/dist/ai/BaseTag.md +0 -623
- package/dist/ai/BaseTextInput.md +0 -392
- package/dist/ai/BaseTextarea.md +0 -398
- package/dist/ai/BbChip.md +0 -147
- package/dist/ai/BbIntersection.md +0 -120
- package/dist/ai/BbRatio.md +0 -61
- package/dist/ai/BbRows.md +0 -307
- package/dist/ai/BbTab.md +0 -950
- package/dist/ai/CommonInputInnerContainer.md +0 -414
- package/dist/ai/CommonInputOuterContainer.md +0 -55
- package/dist/components/BaseButton/BaseButton.vue.d.ts +0 -14
- package/dist/components/BaseButton/types.d.ts +0 -159
- package/dist/components/BaseCheckbox/BaseCheckbox.vue.d.ts +0 -39
- package/dist/components/BaseCheckbox/types.d.ts +0 -213
- package/dist/components/BaseCheckboxGroup/BaseCheckboxGroup.vue.d.ts +0 -30
- package/dist/components/BaseCheckboxGroup/types.d.ts +0 -282
- package/dist/components/BaseColorInput/BaseColorInput.vue.d.ts +0 -35
- package/dist/components/BaseColorInput/ColorPalette.vue.d.ts +0 -13
- package/dist/components/BaseColorInput/types.d.ts +0 -233
- package/dist/components/BaseDatePicker/BaseDatePickerHeader.vue.d.ts +0 -15
- package/dist/components/BaseDatePicker/BaseDatePickerInputDaySelector.vue.d.ts +0 -58
- package/dist/components/BaseDatePicker/BaseDatePickerMonthSelector.vue.d.ts +0 -12
- package/dist/components/BaseDatePicker/BaseDatePickerYearSelector.vue.d.ts +0 -12
- package/dist/components/BaseDatePicker/types.d.ts +0 -100
- package/dist/components/BaseDatePickerInput/BaseDatePickerInput.vue.d.ts +0 -26
- package/dist/components/BaseDatePickerInput/types.d.ts +0 -206
- package/dist/components/BaseDialog/BaseDialog.vue.d.ts +0 -37
- package/dist/components/BaseDialog/types.d.ts +0 -180
- package/dist/components/BaseInputContainer/BaseInputContainer.vue.d.ts +0 -18
- package/dist/components/BaseInputContainer/types.d.ts +0 -126
- package/dist/components/BaseNumberInput/BaseNumberInput.vue.d.ts +0 -46
- package/dist/components/BaseNumberInput/types.d.ts +0 -191
- package/dist/components/BaseRadio/BaseRadio.vue.d.ts +0 -31
- package/dist/components/BaseRadio/types.d.ts +0 -173
- package/dist/components/BaseRadioGroup/BaseRadioGroup.vue.d.ts +0 -30
- package/dist/components/BaseRadioGroup/types.d.ts +0 -240
- package/dist/components/BaseRating/BaseRating.vue.d.ts +0 -35
- package/dist/components/BaseRating/types.d.ts +0 -144
- package/dist/components/BaseSelect/BaseSelect.vue.d.ts +0 -28
- package/dist/components/BaseSelect/types.d.ts +0 -470
- package/dist/components/BaseSlider/BaseSlider.vue.d.ts +0 -38
- package/dist/components/BaseSlider/types.d.ts +0 -201
- package/dist/components/BaseSwitch/BaseSwitch.vue.d.ts +0 -34
- package/dist/components/BaseSwitch/types.d.ts +0 -25
- package/dist/components/BaseSwitchGroup/BaseSwitchGroup.vue.d.ts +0 -30
- package/dist/components/BaseSwitchGroup/types.d.ts +0 -8
- package/dist/components/BaseTag/BaseTag.vue.d.ts +0 -37
- package/dist/components/BaseTag/types.d.ts +0 -136
- package/dist/components/BaseTextInput/BaseTextInput.vue.d.ts +0 -33
- package/dist/components/BaseTextInput/types.d.ts +0 -166
- package/dist/components/BaseTextarea/BaseTextarea.vue.d.ts +0 -31
- package/dist/components/BaseTextarea/types.d.ts +0 -151
- package/dist/components/BbChip/BbChip.vue.d.ts +0 -17
- package/dist/components/BbChip/types.d.ts +0 -23
- package/dist/components/BbIntersection/BbIntersection.vue.d.ts +0 -23
- package/dist/components/BbIntersection/types.d.ts +0 -36
- package/dist/components/BbRatio/BbRatio.vue.d.ts +0 -14
- package/dist/components/BbRatio/types.d.ts +0 -15
- package/dist/components/BbRows/BbRows.vue.d.ts +0 -62
- package/dist/components/BbRows/types.d.ts +0 -21
- package/dist/components/BbTab/BbTab.vue.d.ts +0 -27
- package/dist/components/BbTab/types.d.ts +0 -186
- package/dist/components/CommonInputInnerContainer/CommonInputInnerContainer.vue.d.ts +0 -15
- package/dist/components/CommonInputInnerContainer/types.d.ts +0 -47
- package/dist/components/CommonInputOuterContainer/CommonInputOuterContainer.vue.d.ts +0 -11
- package/dist/components/CommonInputOuterContainer/types.d.ts +0 -16
- package/dist/composables/useModalsState.d.ts +0 -5
- package/dist/composables/useQueue.d.ts +0 -58
- package/dist/composables/useWizard.d.ts +0 -85
- package/dist/i18n/en.d.ts +0 -67
- package/dist/i18n/it.d.ts +0 -67
- package/dist/index.css +0 -2
- package/dist/index100.js +0 -6
- package/dist/index101.js +0 -300
- package/dist/index102.js +0 -16
- package/dist/index103.js +0 -16
- package/dist/index104.js +0 -27
- package/dist/index109.js +0 -19
- package/dist/index11.js +0 -42
- package/dist/index110.js +0 -12
- package/dist/index111.js +0 -19
- package/dist/index112.js +0 -25
- package/dist/index114.js +0 -7
- package/dist/index115.js +0 -241
- package/dist/index116.js +0 -5
- package/dist/index117.js +0 -42
- package/dist/index118.js +0 -5
- package/dist/index119.js +0 -53
- package/dist/index120.js +0 -5
- package/dist/index121.js +0 -32
- package/dist/index122.js +0 -5
- package/dist/index124.js +0 -52
- package/dist/index125.js +0 -5
- package/dist/index126.js +0 -223
- package/dist/index128.js +0 -6
- package/dist/index129.js +0 -162
- package/dist/index13.js +0 -92
- package/dist/index130.js +0 -25
- package/dist/index131.js +0 -51
- package/dist/index132.js +0 -5
- package/dist/index133.js +0 -607
- package/dist/index135.js +0 -6
- package/dist/index136.js +0 -14
- package/dist/index137.js +0 -153
- package/dist/index139.js +0 -6
- package/dist/index14.js +0 -306
- package/dist/index140.js +0 -224
- package/dist/index141.js +0 -5
- package/dist/index143.js +0 -128
- package/dist/index145.js +0 -6
- package/dist/index146.js +0 -8
- package/dist/index147.js +0 -182
- package/dist/index149.js +0 -6
- package/dist/index15.js +0 -10
- package/dist/index151.js +0 -4
- package/dist/index152.js +0 -95
- package/dist/index154.js +0 -6
- package/dist/index155.js +0 -168
- package/dist/index157.js +0 -6
- package/dist/index158.js +0 -145
- package/dist/index16.js +0 -59
- package/dist/index160.js +0 -6
- package/dist/index161.js +0 -53
- package/dist/index163.js +0 -6
- package/dist/index164.js +0 -16
- package/dist/index166.js +0 -35
- package/dist/index168.js +0 -6
- package/dist/index169.js +0 -89
- package/dist/index171.js +0 -6
- package/dist/index172.js +0 -82
- package/dist/index174.js +0 -6
- package/dist/index175.js +0 -38
- package/dist/index176.js +0 -461
- package/dist/index177.js +0 -28
- package/dist/index178.js +0 -66
- package/dist/index18.js +0 -35
- package/dist/index180.js +0 -162
- package/dist/index181.js +0 -5
- package/dist/index182.js +0 -217
- package/dist/index183.js +0 -5
- package/dist/index184.js +0 -112
- package/dist/index185.js +0 -5
- package/dist/index186.js +0 -459
- package/dist/index188.js +0 -6
- package/dist/index19.js +0 -4
- package/dist/index192.js +0 -268
- package/dist/index194.js +0 -6
- package/dist/index195.js +0 -124
- package/dist/index197.js +0 -6
- package/dist/index198.js +0 -174
- package/dist/index2.js +0 -20
- package/dist/index20.js +0 -9
- package/dist/index200.js +0 -6
- package/dist/index201.js +0 -224
- package/dist/index203.js +0 -6
- package/dist/index204.js +0 -135
- package/dist/index206.js +0 -6
- package/dist/index207.js +0 -5
- package/dist/index208.js +0 -170
- package/dist/index21.js +0 -35
- package/dist/index210.js +0 -6
- package/dist/index211.js +0 -37
- package/dist/index213.js +0 -6
- package/dist/index214.js +0 -63
- package/dist/index216.js +0 -6
- package/dist/index217.js +0 -74
- package/dist/index219.js +0 -6
- package/dist/index22.js +0 -6
- package/dist/index220.js +0 -65
- package/dist/index222.js +0 -6
- package/dist/index223.js +0 -67
- package/dist/index225.js +0 -6
- package/dist/index226.js +0 -41
- package/dist/index228.js +0 -6
- package/dist/index229.js +0 -10
- package/dist/index23.js +0 -7
- package/dist/index230.js +0 -22
- package/dist/index232.js +0 -8
- package/dist/index233.js +0 -297
- package/dist/index235.js +0 -6
- package/dist/index236.js +0 -47
- package/dist/index237.js +0 -165
- package/dist/index239.js +0 -6
- package/dist/index24.js +0 -9
- package/dist/index241.js +0 -159
- package/dist/index243.js +0 -6
- package/dist/index244.js +0 -134
- package/dist/index246.js +0 -6
- package/dist/index247.js +0 -167
- package/dist/index249.js +0 -6
- package/dist/index25.js +0 -24
- package/dist/index250.js +0 -147
- package/dist/index252.js +0 -6
- package/dist/index253.js +0 -35
- package/dist/index255.js +0 -6
- package/dist/index256.js +0 -65
- package/dist/index258.js +0 -6
- package/dist/index259.js +0 -19
- package/dist/index260.js +0 -5
- package/dist/index261.js +0 -160
- package/dist/index263.js +0 -6
- package/dist/index264.js +0 -60
- package/dist/index266.js +0 -6
- package/dist/index267.js +0 -134
- package/dist/index269.js +0 -6
- package/dist/index27.js +0 -4
- package/dist/index271.js +0 -206
- package/dist/index273.js +0 -6
- package/dist/index274.js +0 -85
- package/dist/index275.js +0 -5
- package/dist/index276.js +0 -55
- package/dist/index277.js +0 -5
- package/dist/index278.js +0 -164
- package/dist/index28.js +0 -8
- package/dist/index280.js +0 -6
- package/dist/index281.js +0 -145
- package/dist/index283.js +0 -6
- package/dist/index284.js +0 -11
- package/dist/index285.js +0 -200
- package/dist/index287.js +0 -6
- package/dist/index288.js +0 -241
- package/dist/index29.js +0 -7
- package/dist/index290.js +0 -6
- package/dist/index291.js +0 -21
- package/dist/index293.js +0 -6
- package/dist/index294.js +0 -125
- package/dist/index296.js +0 -6
- package/dist/index297.js +0 -161
- package/dist/index299.js +0 -6
- package/dist/index30.js +0 -118
- package/dist/index300.js +0 -127
- package/dist/index302.js +0 -6
- package/dist/index303.js +0 -20
- package/dist/index305.js +0 -6
- package/dist/index306.js +0 -116
- package/dist/index307.js +0 -5
- package/dist/index308.js +0 -507
- package/dist/index31.js +0 -10
- package/dist/index310.js +0 -6
- package/dist/index311.js +0 -196
- package/dist/index313.js +0 -6
- package/dist/index314.js +0 -142
- package/dist/index316.js +0 -6
- package/dist/index317.js +0 -134
- package/dist/index319.js +0 -6
- package/dist/index32.js +0 -28
- package/dist/index320.js +0 -162
- package/dist/index322.js +0 -6
- package/dist/index323.js +0 -319
- package/dist/index325.js +0 -6
- package/dist/index326.js +0 -40
- package/dist/index327.js +0 -43
- package/dist/index328.js +0 -665
- package/dist/index33.js +0 -5
- package/dist/index330.js +0 -6
- package/dist/index331.js +0 -155
- package/dist/index333.js +0 -6
- package/dist/index334.js +0 -142
- package/dist/index336.js +0 -6
- package/dist/index337.js +0 -155
- package/dist/index339.js +0 -6
- package/dist/index34.js +0 -112
- package/dist/index340.js +0 -58
- package/dist/index341.js +0 -5
- package/dist/index342.js +0 -20
- package/dist/index344.js +0 -6
- package/dist/index345.js +0 -142
- package/dist/index347.js +0 -6
- package/dist/index349.js +0 -109
- package/dist/index351.js +0 -6
- package/dist/index352.js +0 -55
- package/dist/index353.js +0 -24
- package/dist/index354.js +0 -23
- package/dist/index355.js +0 -839
- package/dist/index356.js +0 -474
- package/dist/index357.js +0 -52
- package/dist/index358.js +0 -7
- package/dist/index36.js +0 -6
- package/dist/index38.js +0 -63
- package/dist/index39.js +0 -63
- package/dist/index40.js +0 -9
- package/dist/index42.js +0 -8
- package/dist/index43.js +0 -179
- package/dist/index44.js +0 -21
- package/dist/index46.js +0 -385
- package/dist/index48.js +0 -6
- package/dist/index49.js +0 -33
- package/dist/index5.js +0 -34
- package/dist/index50.js +0 -12
- package/dist/index51.js +0 -8
- package/dist/index52.js +0 -106
- package/dist/index53.js +0 -330
- package/dist/index54.js +0 -97
- package/dist/index55.js +0 -328
- package/dist/index56.js +0 -28
- package/dist/index57.js +0 -102
- package/dist/index58.js +0 -157
- package/dist/index6.js +0 -38
- package/dist/index60.js +0 -6
- package/dist/index61.js +0 -131
- package/dist/index62.js +0 -5
- package/dist/index65.js +0 -35
- package/dist/index66.js +0 -26
- package/dist/index68.js +0 -6
- package/dist/index69.js +0 -54
- package/dist/index7.js +0 -58
- package/dist/index71.js +0 -6
- package/dist/index72.js +0 -14
- package/dist/index74.js +0 -6
- package/dist/index75.js +0 -159
- package/dist/index77.js +0 -6
- package/dist/index78.js +0 -4
- package/dist/index79.js +0 -4
- package/dist/index80.js +0 -54
- package/dist/index81.js +0 -5
- package/dist/index82.js +0 -5
- package/dist/index83.js +0 -141
- package/dist/index85.js +0 -6
- package/dist/index86.js +0 -65
- package/dist/index88.js +0 -6
- package/dist/index89.js +0 -30
- package/dist/index9.js +0 -11
- package/dist/index90.js +0 -19
- package/dist/index91.js +0 -17
- package/dist/index92.js +0 -9
- package/dist/index93.js +0 -34
- package/dist/index95.js +0 -16
- package/dist/index96.js +0 -10
- package/dist/index97.js +0 -18
- package/dist/index98.js +0 -189
- package/dist/types/VoidHtmlElements.d.ts +0 -1
- package/dist/utilities/functions/add.d.ts +0 -1
- package/dist/utilities/functions/booleanishToBoolean.d.ts +0 -6
- package/dist/utilities/functions/capitalize.d.ts +0 -4
- package/dist/utilities/functions/cloneDeep.d.ts +0 -1
- package/dist/utilities/functions/debounce.d.ts +0 -1
- package/dist/utilities/functions/drop.d.ts +0 -1
- package/dist/utilities/functions/exceedsPrecision.d.ts +0 -1
- package/dist/utilities/functions/findRight.d.ts +0 -4
- package/dist/utilities/functions/findRightIndex.d.ts +0 -4
- package/dist/utilities/functions/flow.d.ts +0 -1
- package/dist/utilities/functions/getHueFromRGB.d.ts +0 -9
- package/dist/utilities/functions/groupBy.d.ts +0 -6
- package/dist/utilities/functions/gt.d.ts +0 -7
- package/dist/utilities/functions/hexToRGB.d.ts +0 -7
- package/dist/utilities/functions/hslToHex.d.ts +0 -1
- package/dist/utilities/functions/includes.d.ts +0 -1
- package/dist/utilities/functions/initial.d.ts +0 -1
- package/dist/utilities/functions/isCssColor.d.ts +0 -5
- package/dist/utilities/functions/lt.d.ts +0 -7
- package/dist/utilities/functions/makeUrl.d.ts +0 -1
- package/dist/utilities/functions/mapKeys.d.ts +0 -5
- package/dist/utilities/functions/mapValues.d.ts +0 -1
- package/dist/utilities/functions/matchesPropertyInsensitive.d.ts +0 -1
- package/dist/utilities/functions/max.d.ts +0 -2
- package/dist/utilities/functions/mean.d.ts +0 -4
- package/dist/utilities/functions/merge.d.ts +0 -11
- package/dist/utilities/functions/millisecondsTo.d.ts +0 -1
- package/dist/utilities/functions/negate.d.ts +0 -4
- package/dist/utilities/functions/normalizeItemGroups.d.ts +0 -13
- package/dist/utilities/functions/omit.d.ts +0 -2
- package/dist/utilities/functions/overEvery.d.ts +0 -4
- package/dist/utilities/functions/pick.d.ts +0 -1
- package/dist/utilities/functions/replace.d.ts +0 -1
- package/dist/utilities/functions/replaceInTree.d.ts +0 -4
- package/dist/utilities/functions/retry.d.ts +0 -5
- package/dist/utilities/functions/roundToTheNearest.d.ts +0 -8
- package/dist/utilities/functions/set.d.ts +0 -15
- package/dist/utilities/functions/stub.d.ts +0 -6
- package/dist/utilities/functions/transposePercent.d.ts +0 -9
- package/dist/utilities/functions/tryTo.d.ts +0 -2
- package/dist/utilities/functions/uniqBy.d.ts +0 -1
- /package/dist/{index64.js → _virtual/_plugin-vue_export-helper.js} +0 -0
- /package/dist/components/{BaseButton → BbBaseButton}/RouterComponent.vue.d.ts +0 -0
- /package/dist/components/{BaseDatePicker/BaseDatePicker.vue.d.ts → BbBaseDatePicker/BbBaseDatePicker.vue.d.ts} +0 -0
- /package/dist/{index165.js → composables/useArray.js} +0 -0
- /package/dist/{index17.js → composables/useFrameworkDetection.js} +0 -0
- /package/dist/{index12.js → composables/useId.js} +0 -0
- /package/dist/{index107.js → utilities/functions/chunk.js} +0 -0
- /package/dist/{index8.js → utilities/functions/clamp.js} +0 -0
- /package/dist/{index150.js → utilities/functions/curry.js} +0 -0
- /package/dist/{index45.js → utilities/functions/extractDomContainer.js} +0 -0
- /package/dist/{index270.js → utilities/functions/findInTree.js} +0 -0
- /package/dist/{index348.js → utilities/functions/flattenTree.js} +0 -0
- /package/dist/{index41.js → utilities/functions/get.js} +0 -0
- /package/dist/{index189.js → utilities/functions/head.js} +0 -0
- /package/dist/{index108.js → utilities/functions/identity.js} +0 -0
- /package/dist/{index179.js → utilities/functions/indexBy.js} +0 -0
- /package/dist/{index37.js → utilities/functions/isHex.js} +0 -0
- /package/dist/{index94.js → utilities/functions/isNil.js} +0 -0
- /package/dist/{index26.js → utilities/functions/isNotNil.js} +0 -0
- /package/dist/{index105.js → utilities/functions/last.js} +0 -0
- /package/dist/{index142.js → utilities/functions/noop.js} +0 -0
- /package/dist/{index231.js → utilities/functions/parseWidthString.js} +0 -0
- /package/dist/{index240.js → utilities/functions/pickBy.js} +0 -0
- /package/dist/{index123.js → utilities/functions/range.js} +0 -0
- /package/dist/{index190.js → utilities/functions/snapToStep.js} +0 -0
- /package/dist/{index191.js → utilities/functions/transpose.js} +0 -0
- /package/dist/{index106.js → utilities/functions/validateDateFormat.js} +0 -0
- /package/dist/{index10.js → utilities/functions/wait.js} +0 -0
|
@@ -0,0 +1,1785 @@
|
|
|
1
|
+
# BbBaseDatePickerInput — Implementation Source
|
|
2
|
+
|
|
3
|
+
> Full implementation for deep dives. For everyday usage read the typed contract: [../BbBaseDatePickerInput.md](../BbBaseDatePickerInput.md).
|
|
4
|
+
>
|
|
5
|
+
> Safety level: **Reference Only - Internal** — do not use in consumer-facing code unless explicitly requested.
|
|
6
|
+
|
|
7
|
+
## Template & Script
|
|
8
|
+
|
|
9
|
+
```vue
|
|
10
|
+
<template>
|
|
11
|
+
<CommonInputWrapper
|
|
12
|
+
ref="wrapper"
|
|
13
|
+
:active="active"
|
|
14
|
+
:append:icon="props['append:icon']"
|
|
15
|
+
class="bb-base-date-picker-input"
|
|
16
|
+
:class="{
|
|
17
|
+
'bb-base-date-picker-input--range': props.range,
|
|
18
|
+
}"
|
|
19
|
+
:clearable="props.clearable && !isEmpty(modelValue)"
|
|
20
|
+
:compact="props.compact"
|
|
21
|
+
:disabled="props.disabled"
|
|
22
|
+
:has-errors="props.hasErrors"
|
|
23
|
+
:has-value="hasValue"
|
|
24
|
+
:has-warning="props.hasWarning"
|
|
25
|
+
:loading="props.loading"
|
|
26
|
+
:prepend:icon="props['prepend:icon']"
|
|
27
|
+
:readonly="props.readonly"
|
|
28
|
+
@click:clear="onClickClear"
|
|
29
|
+
@focusin="onFocusIn"
|
|
30
|
+
>
|
|
31
|
+
<template #prepend-outer><slot name="prepend-outer"></slot></template>
|
|
32
|
+
<template #prepend><slot name="prepend" /></template>
|
|
33
|
+
<template v-if="$slots.prefix" #prefix><slot name="prefix" /></template>
|
|
34
|
+
|
|
35
|
+
<div
|
|
36
|
+
class="bb-base-date-picker-input__fields"
|
|
37
|
+
:class="{
|
|
38
|
+
'bb-base-date-picker-input__fields--empty': showPlaceholder,
|
|
39
|
+
'bb-base-date-picker-input__fields--range': range,
|
|
40
|
+
}"
|
|
41
|
+
:style="{ '--fields-min-ch': minChars }"
|
|
42
|
+
>
|
|
43
|
+
<span
|
|
44
|
+
v-if="showPlaceholder"
|
|
45
|
+
aria-hidden="true"
|
|
46
|
+
class="bb-base-date-picker-input__placeholder"
|
|
47
|
+
@click="focusFirstField"
|
|
48
|
+
>
|
|
49
|
+
{{ placeholderText }}
|
|
50
|
+
</span>
|
|
51
|
+
<template
|
|
52
|
+
v-for="(descriptor, index) in fieldOrder"
|
|
53
|
+
:key="descriptorKey(descriptor)"
|
|
54
|
+
>
|
|
55
|
+
<span
|
|
56
|
+
class="bb-base-date-picker-input__field-sizer"
|
|
57
|
+
:data-value="getSizedValue(descriptor)"
|
|
58
|
+
>
|
|
59
|
+
<input
|
|
60
|
+
:id="index === 0 ? id : getFieldId(descriptor)"
|
|
61
|
+
:ref="
|
|
62
|
+
(el) =>
|
|
63
|
+
(fieldRefs[descriptorKey(descriptor)] = el as HTMLInputElement)
|
|
64
|
+
"
|
|
65
|
+
:aria-describedby="mergedDescribedby"
|
|
66
|
+
:aria-disabled="disabled || undefined"
|
|
67
|
+
:aria-invalid="props.hasErrors ? 'true' : undefined"
|
|
68
|
+
:aria-label="getFieldLabel(descriptor)"
|
|
69
|
+
:aria-readonly="isInputReadonly || undefined"
|
|
70
|
+
:autocomplete="autocomplete"
|
|
71
|
+
:autofocus="autofocus && index === 0"
|
|
72
|
+
class="bb-base-date-picker-input__field"
|
|
73
|
+
:class="[
|
|
74
|
+
`bb-base-date-picker-input__field--${descriptor.field}`,
|
|
75
|
+
`bb-base-date-picker-input__field--${descriptor.segment}`,
|
|
76
|
+
]"
|
|
77
|
+
:disabled="disabled"
|
|
78
|
+
:inputmode="inputmode"
|
|
79
|
+
:maxlength="fieldSpecs[descriptor.field].maxLength"
|
|
80
|
+
:name="getFieldName(descriptor)"
|
|
81
|
+
:readonly="isInputReadonly"
|
|
82
|
+
:required="required"
|
|
83
|
+
:tabindex="index % 3 === 0 ? 0 : -1"
|
|
84
|
+
type="text"
|
|
85
|
+
:value="fields[descriptor.segment][descriptor.field]"
|
|
86
|
+
@blur="onFieldBlur(descriptor)"
|
|
87
|
+
@focus="onSegmentFieldFocus(descriptor)"
|
|
88
|
+
@input="onFieldInput(descriptor, $event)"
|
|
89
|
+
@keydown="onFieldKeydown(descriptor, $event)"
|
|
90
|
+
@paste="onFieldPaste(descriptor, $event)"
|
|
91
|
+
/>
|
|
92
|
+
</span>
|
|
93
|
+
<span
|
|
94
|
+
v-if="index < fieldOrder.length - 1"
|
|
95
|
+
aria-hidden="true"
|
|
96
|
+
class="bb-base-date-picker-input__separator"
|
|
97
|
+
:class="{
|
|
98
|
+
'bb-base-date-picker-input__separator--range':
|
|
99
|
+
fieldOrder[index].segment !== fieldOrder[index + 1].segment,
|
|
100
|
+
}"
|
|
101
|
+
role="presentation"
|
|
102
|
+
@click="focusField(fieldOrder[index + 1], { select: true })"
|
|
103
|
+
>{{
|
|
104
|
+
separatorBetween(fieldOrder[index], fieldOrder[index + 1])
|
|
105
|
+
}}</span
|
|
106
|
+
>
|
|
107
|
+
</template>
|
|
108
|
+
</div>
|
|
109
|
+
|
|
110
|
+
<template #append>
|
|
111
|
+
<!-- The calendar surface (popover / adaptive sheet + grid + time rail)
|
|
112
|
+
lives in BbDatePicker; the toggle button is its activator. The input
|
|
113
|
+
keeps its value engine and drives the picker through the raw grid/time
|
|
114
|
+
relays, staying authoritative over the emitted value, while BbDatePicker
|
|
115
|
+
owns open/close, adaptive and ARIA (haspopup/expanded/label). -->
|
|
116
|
+
<BbDatePicker
|
|
117
|
+
v-if="!isCalendarDisabled"
|
|
118
|
+
ref="datePicker"
|
|
119
|
+
:active-segment="timeTargetSegment"
|
|
120
|
+
:adaptive="adaptive"
|
|
121
|
+
:ampm="ampm"
|
|
122
|
+
:anchor="wrapper"
|
|
123
|
+
:datetime="datetime"
|
|
124
|
+
:disabled="disabled"
|
|
125
|
+
:first-day-of-week="firstDayOfWeek"
|
|
126
|
+
:floating="floating"
|
|
127
|
+
:label="accessibleButtonLabel"
|
|
128
|
+
:max="max"
|
|
129
|
+
:min="min"
|
|
130
|
+
:model-value="modelValue"
|
|
131
|
+
:off-canvas-props="offCanvasProps"
|
|
132
|
+
:range="range"
|
|
133
|
+
:readonly="readonly"
|
|
134
|
+
:seconds="seconds"
|
|
135
|
+
:selectable="selectable"
|
|
136
|
+
:step="step"
|
|
137
|
+
:time="time"
|
|
138
|
+
:transition-duration="transitionDuration"
|
|
139
|
+
:utc="utc"
|
|
140
|
+
@grid-pick="calendarEventListeners['onUpdate:modelValue']"
|
|
141
|
+
@time-pick="onTimeSelect"
|
|
142
|
+
>
|
|
143
|
+
<template #activator="{ props: activatorProps }">
|
|
144
|
+
<button
|
|
145
|
+
v-bind="activatorProps"
|
|
146
|
+
class="bb-base-date-picker-input__calendar-btn"
|
|
147
|
+
:disabled="disabled || readonly"
|
|
148
|
+
type="button"
|
|
149
|
+
>
|
|
150
|
+
<BbIcon
|
|
151
|
+
class="bb-base-date-picker-input__calendar-icon"
|
|
152
|
+
:icon="calendarIcon"
|
|
153
|
+
/>
|
|
154
|
+
</button>
|
|
155
|
+
</template>
|
|
156
|
+
<template #day="slotProps">
|
|
157
|
+
<slot name="day" v-bind="slotProps" />
|
|
158
|
+
</template>
|
|
159
|
+
<template #append:day="slotProps">
|
|
160
|
+
<slot name="append:day" v-bind="slotProps" />
|
|
161
|
+
</template>
|
|
162
|
+
</BbDatePicker>
|
|
163
|
+
<slot name="append" />
|
|
164
|
+
</template>
|
|
165
|
+
|
|
166
|
+
<span
|
|
167
|
+
:id="descriptionId"
|
|
168
|
+
class="bb-base-date-picker-input__accessible-description sr-only"
|
|
169
|
+
>{{ t('baseDatePickerInput.dateFormat') }} {{ formatHint }}</span
|
|
170
|
+
>
|
|
171
|
+
<template v-if="$slots.suffix" #suffix><slot name="suffix" /></template>
|
|
172
|
+
|
|
173
|
+
<template #append-outer><slot name="append-outer"></slot></template>
|
|
174
|
+
</CommonInputWrapper>
|
|
175
|
+
</template>
|
|
176
|
+
|
|
177
|
+
<script setup lang="ts">
|
|
178
|
+
import { config } from 'virtual:bitboss-ui/config';
|
|
179
|
+
import { computed, onBeforeUnmount, ref, watch, watchEffect } from 'vue';
|
|
180
|
+
import type { Dayjs } from 'dayjs';
|
|
181
|
+
import { default as dayjs } from 'dayjs';
|
|
182
|
+
import { default as customParseFormat } from 'dayjs/plugin/customParseFormat';
|
|
183
|
+
import { default as isSameOrAfter } from 'dayjs/plugin/isSameOrAfter';
|
|
184
|
+
import { default as isSameOrBefore } from 'dayjs/plugin/isSameOrBefore';
|
|
185
|
+
// The ONLY dayjs locale packs in the graph: the plugin bundles packs for the
|
|
186
|
+
// enabled built-ins (`pt` maps to pt-br — Brazilian-leaning) and for custom
|
|
187
|
+
// `locales` keys dayjs ships. Nothing else enters the bundle; dayjs core
|
|
188
|
+
// itself provides `en`, the fallback below.
|
|
189
|
+
import { dayjsLocales } from 'virtual:bitboss-ui/dayjs-locales';
|
|
190
|
+
import { isEmpty } from '@/utilities/functions/empty';
|
|
191
|
+
import { hash } from '@/utilities/functions/hash';
|
|
192
|
+
import {
|
|
193
|
+
toOuterValue as convertToOuterValue,
|
|
194
|
+
toInnerValue as convertToInnerValue,
|
|
195
|
+
} from '@/utilities/functions/convertDateValue';
|
|
196
|
+
import { useId } from '@/composables/useId';
|
|
197
|
+
import {
|
|
198
|
+
useSegmentedFields,
|
|
199
|
+
type SegmentedFieldSpec,
|
|
200
|
+
type FieldDescriptor as SegmentedFieldDescriptor,
|
|
201
|
+
} from '@/composables/useSegmentedFields';
|
|
202
|
+
import { useLocale } from '@/composables/useLocale';
|
|
203
|
+
import { useLogger } from '@/composables/useLogger';
|
|
204
|
+
import { useMobile } from '@/composables/useMobile';
|
|
205
|
+
import calendarIcon from '@/assets/svgs/calendar.svg?raw';
|
|
206
|
+
import type { TimeUnit } from './BbBaseDatePickerTimeSelector.vue';
|
|
207
|
+
import BbIcon from '../BbIcon/BbIcon.vue';
|
|
208
|
+
import BbDatePicker from '../BbDatePicker/BbDatePicker.vue';
|
|
209
|
+
import CommonInputWrapper from '../CommonInputWrapper/CommonInputWrapper.vue';
|
|
210
|
+
import type {
|
|
211
|
+
BaseDatePickerInputProps,
|
|
212
|
+
BaseDatePickerInputEvents,
|
|
213
|
+
BaseDatePickerInputSlots,
|
|
214
|
+
DatePickerInputError,
|
|
215
|
+
} from './types';
|
|
216
|
+
import { isNotEmpty } from '@/utilities/functions/isNotEmpty';
|
|
217
|
+
|
|
218
|
+
const props = withDefaults(defineProps<BaseDatePickerInputProps>(), {
|
|
219
|
+
// `undefined` (declared, not omitted) keeps `adaptive` three-state: it disables
|
|
220
|
+
// Vue's absent→`false` Boolean cast so `props.adaptive ?? config.adaptive` can
|
|
221
|
+
// reach the config default, while keeping the Boolean type so the valueless
|
|
222
|
+
// `adaptive` shorthand still resolves to `true`.
|
|
223
|
+
adaptive: undefined,
|
|
224
|
+
disableWriting: false,
|
|
225
|
+
disableCalendar: false,
|
|
226
|
+
autocomplete: 'off',
|
|
227
|
+
});
|
|
228
|
+
const emit = defineEmits<BaseDatePickerInputEvents>();
|
|
229
|
+
defineSlots<BaseDatePickerInputSlots>();
|
|
230
|
+
dayjs.extend(customParseFormat);
|
|
231
|
+
dayjs.extend(isSameOrAfter);
|
|
232
|
+
dayjs.extend(isSameOrBefore);
|
|
233
|
+
// The calendar follows `config.locale` through the packs the plugin bundled
|
|
234
|
+
// (enabled built-ins + custom keys dayjs ships). A key with no pack means the
|
|
235
|
+
// build already warned the consumer — fall back to dayjs's core 'en' here,
|
|
236
|
+
// silently by design (build-time warning, never a runtime one).
|
|
237
|
+
watchEffect(() => {
|
|
238
|
+
dayjs.locale(dayjsLocales[config.locale] ?? 'en');
|
|
239
|
+
});
|
|
240
|
+
|
|
241
|
+
const { t } = useLocale();
|
|
242
|
+
const logger = useLogger();
|
|
243
|
+
|
|
244
|
+
const BOUNDARY_DATE_FORMAT = 'YYYY-MM-DD';
|
|
245
|
+
|
|
246
|
+
const wrapper = ref<InstanceType<typeof CommonInputWrapper> | null>(null);
|
|
247
|
+
const datePicker = ref<InstanceType<typeof BbDatePicker> | null>(null);
|
|
248
|
+
const id = props.id || `bdpi-${useId().id.value}`;
|
|
249
|
+
const descriptionId = `bdpi-description_${id}`;
|
|
250
|
+
const mergedDescribedby = computed(() => {
|
|
251
|
+
const ids = [props.ariaDescribedby, descriptionId]
|
|
252
|
+
.filter((value): value is string => !!value?.trim())
|
|
253
|
+
.flatMap((value) => value.split(/\s+/))
|
|
254
|
+
.filter(Boolean);
|
|
255
|
+
return Array.from(new Set(ids)).join(' ');
|
|
256
|
+
});
|
|
257
|
+
const hasValue = computed(() => isNotEmpty(props.modelValue));
|
|
258
|
+
const { isMobile } = useMobile();
|
|
259
|
+
const isWritingAllowed = computed(() => {
|
|
260
|
+
if (props.disableWriting === 'mobile') return !isMobile.value;
|
|
261
|
+
if (props.disableWriting === 'desktop') return isMobile.value;
|
|
262
|
+
return !props.disableWriting;
|
|
263
|
+
});
|
|
264
|
+
|
|
265
|
+
const isCalendarDisabled = computed(() => {
|
|
266
|
+
if (props.disableCalendar === 'mobile') return isMobile.value;
|
|
267
|
+
if (props.disableCalendar === 'desktop') return !isMobile.value;
|
|
268
|
+
return !!props.disableCalendar;
|
|
269
|
+
});
|
|
270
|
+
|
|
271
|
+
const isInputReadonly = computed(
|
|
272
|
+
() => !!props.readonly || !isWritingAllowed.value
|
|
273
|
+
);
|
|
274
|
+
|
|
275
|
+
const inputmode = computed(() => (isWritingAllowed.value ? 'numeric' : 'none'));
|
|
276
|
+
|
|
277
|
+
const BOUNDARY_DATETIME_FORMAT = 'YYYY-MM-DDTHH:mm';
|
|
278
|
+
|
|
279
|
+
/** True when a boundary string carries a time part. */
|
|
280
|
+
const boundaryHasTime = (value: string) => value.includes('T');
|
|
281
|
+
|
|
282
|
+
/** Parses a boundary in either accepted format (`YYYY-MM-DD` or `...THH:mm`). */
|
|
283
|
+
const parseBoundary = (value: string): Dayjs =>
|
|
284
|
+
boundaryHasTime(value)
|
|
285
|
+
? dayjs(value, BOUNDARY_DATETIME_FORMAT, true)
|
|
286
|
+
: dayjs(value, BOUNDARY_DATE_FORMAT, true);
|
|
287
|
+
|
|
288
|
+
for (const [name, value] of [
|
|
289
|
+
['min', props.min],
|
|
290
|
+
['max', props.max],
|
|
291
|
+
] as const) {
|
|
292
|
+
if (!value) continue;
|
|
293
|
+
if (!parseBoundary(value).isValid()) {
|
|
294
|
+
logger.throw(
|
|
295
|
+
`BaseDatePickerInput: ${name} must be in the format YYYY-MM-DD or YYYY-MM-DDTHH:mm`
|
|
296
|
+
);
|
|
297
|
+
}
|
|
298
|
+
if (import.meta.env.DEV && boundaryHasTime(value) && !props.datetime) {
|
|
299
|
+
logger.warn(
|
|
300
|
+
`BaseDatePickerInput: the time part of \`${name}\` has no effect without \`datetime\` — comparison stays day-granular.`
|
|
301
|
+
);
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
// Validate that at least one interaction method is available on each platform.
|
|
306
|
+
// Desktop: writing is on unless disableWriting is true or 'desktop'; the
|
|
307
|
+
// calendar is on unless disableCalendar is true or 'desktop'. Mobile mirrors
|
|
308
|
+
// with 'mobile'.
|
|
309
|
+
const desktopHasWriting =
|
|
310
|
+
props.disableWriting !== true && props.disableWriting !== 'desktop';
|
|
311
|
+
const desktopHasCalendar =
|
|
312
|
+
props.disableCalendar !== true && props.disableCalendar !== 'desktop';
|
|
313
|
+
const mobileHasWriting =
|
|
314
|
+
props.disableWriting !== true && props.disableWriting !== 'mobile';
|
|
315
|
+
const mobileHasCalendar =
|
|
316
|
+
props.disableCalendar !== true && props.disableCalendar !== 'mobile';
|
|
317
|
+
|
|
318
|
+
if (!desktopHasWriting && !desktopHasCalendar) {
|
|
319
|
+
logger.throw(
|
|
320
|
+
'BaseDatePickerInput: desktop users would have no interaction method — disableWriting:true (or "desktop") and disableCalendar:true (or "desktop") cannot be combined.'
|
|
321
|
+
);
|
|
322
|
+
}
|
|
323
|
+
if (!mobileHasWriting && !mobileHasCalendar) {
|
|
324
|
+
logger.throw(
|
|
325
|
+
'BaseDatePickerInput: mobile users would have no interaction method — combine disableWriting:"mobile" with disableCalendar:"desktop" to keep calendar interaction on mobile while staying keyboard-first on desktop.'
|
|
326
|
+
);
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
/** Outer-string contract shared by every emit/parse in this component. */
|
|
330
|
+
const valueOptions = computed(() => ({
|
|
331
|
+
floating: props.floating,
|
|
332
|
+
utc: props.utc,
|
|
333
|
+
}));
|
|
334
|
+
|
|
335
|
+
const toOuterValue = (value: Dayjs): string =>
|
|
336
|
+
convertToOuterValue(value, valueOptions.value);
|
|
337
|
+
|
|
338
|
+
const toInnerValue = (value: string): Dayjs =>
|
|
339
|
+
convertToInnerValue(value, valueOptions.value);
|
|
340
|
+
|
|
341
|
+
// `floating` + `utc` is incoherent (a plain date has no zone): `utc` is
|
|
342
|
+
// ignored, matching the library's warn-and-ignore pattern for inert
|
|
343
|
+
// combinations (cf. BbBaseSlider's range-mode stepper warning).
|
|
344
|
+
if (import.meta.env.DEV && props.floating && props.utc) {
|
|
345
|
+
logger.warn(
|
|
346
|
+
'BaseDatePickerInput: `utc` has no effect when `floating` is set — a plain date carries no zone. The prop is ignored.'
|
|
347
|
+
);
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
// Same warn-and-ignore doctrine for the datetime satellite props: they are
|
|
351
|
+
// inert without `datetime`, and `step` only shapes what the panel offers.
|
|
352
|
+
if (import.meta.env.DEV) {
|
|
353
|
+
if (!props.datetime) {
|
|
354
|
+
if (props.seconds)
|
|
355
|
+
logger.warn(
|
|
356
|
+
'BaseDatePickerInput: `seconds` has no effect without `datetime`. The prop is ignored.'
|
|
357
|
+
);
|
|
358
|
+
if (props.ampm)
|
|
359
|
+
logger.warn(
|
|
360
|
+
'BaseDatePickerInput: `ampm` has no effect without `datetime`. The prop is ignored.'
|
|
361
|
+
);
|
|
362
|
+
if (props.step !== undefined)
|
|
363
|
+
logger.warn(
|
|
364
|
+
'BaseDatePickerInput: `step` has no effect without `datetime`. The prop is ignored.'
|
|
365
|
+
);
|
|
366
|
+
if (props.time !== undefined && props.time !== null)
|
|
367
|
+
logger.warn(
|
|
368
|
+
'BaseDatePickerInput: `v-model:time` has no effect without `datetime`. The model is ignored.'
|
|
369
|
+
);
|
|
370
|
+
} else if (props.step !== undefined) {
|
|
371
|
+
if (!Number.isFinite(props.step) || props.step < 1) {
|
|
372
|
+
logger.warn(
|
|
373
|
+
'BaseDatePickerInput: `step` must be a finite number >= 1 — falling back to 1.'
|
|
374
|
+
);
|
|
375
|
+
} else if (60 % Math.floor(props.step) !== 0) {
|
|
376
|
+
logger.warn(
|
|
377
|
+
`BaseDatePickerInput: \`step\` ${props.step} does not divide 60 — the minute column restarts unevenly at each hour boundary.`
|
|
378
|
+
);
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
/**
|
|
384
|
+
* Applies a class when the user is inside this whole component.
|
|
385
|
+
* We cannot use focus within as it doesn't work for elements that are teleported.
|
|
386
|
+
* Also we cannot use the <input/> if we physically move focus to the calendar so
|
|
387
|
+
* we track it manually.
|
|
388
|
+
*/
|
|
389
|
+
const active = ref(false);
|
|
390
|
+
|
|
391
|
+
const onFocusIn = () => {
|
|
392
|
+
if (active.value) return;
|
|
393
|
+
emit('active');
|
|
394
|
+
active.value = true;
|
|
395
|
+
document.addEventListener('focusin', onDocumentInteraction);
|
|
396
|
+
document.addEventListener('click', onDocumentInteraction);
|
|
397
|
+
};
|
|
398
|
+
|
|
399
|
+
const onDocumentInteraction = (event: Event) => {
|
|
400
|
+
const target = event.target;
|
|
401
|
+
if (!(target instanceof HTMLElement)) return;
|
|
402
|
+
if (!wrapper.value?.$el) return;
|
|
403
|
+
if (wrapper.value.$el.contains(target)) return;
|
|
404
|
+
// The calendar surface lives in BbDatePicker's popover/sheet (outside this
|
|
405
|
+
// component's DOM subtree); treat interaction inside the open picker as still
|
|
406
|
+
// interacting with us so a grid/time pick never finalizes the fields. Scope to
|
|
407
|
+
// THIS picker's exposed calendar element — a page-wide
|
|
408
|
+
// `.bb-date-picker__calendar` query could match a different open picker.
|
|
409
|
+
if (datePicker.value?.calendarEl?.contains(target)) return;
|
|
410
|
+
|
|
411
|
+
// Finalize on inactive: apply normalization/swap/reset only once user leaves.
|
|
412
|
+
combineFieldsToModelValue({ finalize: true });
|
|
413
|
+
// If user left an incomplete date, restore the last coherent model value.
|
|
414
|
+
if (hasPartialSegments()) {
|
|
415
|
+
restoreFieldsFromModelValue();
|
|
416
|
+
updateAllSizedValues();
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
active.value = false;
|
|
420
|
+
emit('inactive');
|
|
421
|
+
document.removeEventListener('focusin', onDocumentInteraction);
|
|
422
|
+
document.removeEventListener('click', onDocumentInteraction);
|
|
423
|
+
};
|
|
424
|
+
|
|
425
|
+
/**
|
|
426
|
+
* Applies a calendar-picked date (always a midnight) into a segment's date
|
|
427
|
+
* fields, leaving the time fields untouched so the grid never wipes a time.
|
|
428
|
+
*/
|
|
429
|
+
const applyPickedDate = (segment: Segment, value: string) => {
|
|
430
|
+
const parsed = toInnerValue(value);
|
|
431
|
+
if (!parsed.isValid()) return;
|
|
432
|
+
const group = fields.value[segment];
|
|
433
|
+
group.day = parsed.format('DD');
|
|
434
|
+
group.month = parsed.format('MM');
|
|
435
|
+
group.year = parsed.format('YYYY');
|
|
436
|
+
};
|
|
437
|
+
|
|
438
|
+
/**
|
|
439
|
+
* Handles a raw calendar-grid pick relayed from BbDatePicker. Without `datetime`
|
|
440
|
+
* the grid's value is final — propagate it (BbDatePicker closes itself once the
|
|
441
|
+
* selection is complete). With it, the grid only sets the date part — the time
|
|
442
|
+
* is carried over from the fields (blank → 00:00) and the panel stays open so
|
|
443
|
+
* the user can still pick a time.
|
|
444
|
+
*/
|
|
445
|
+
const calendarEventListeners = {
|
|
446
|
+
'onUpdate:modelValue': (value: string | string[] | null) => {
|
|
447
|
+
if (!props.datetime) {
|
|
448
|
+
emit('update:modelValue', value);
|
|
449
|
+
return;
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
if (value === null) {
|
|
453
|
+
fields.value.start = emptyFieldGroup();
|
|
454
|
+
fields.value.end = emptyFieldGroup();
|
|
455
|
+
updateAllSizedValues();
|
|
456
|
+
emitValue(null);
|
|
457
|
+
return;
|
|
458
|
+
}
|
|
459
|
+
if (Array.isArray(value)) {
|
|
460
|
+
// Range picks arrive sorted; reset both ends' dates, keep the times.
|
|
461
|
+
const [startRaw, endRaw] = value;
|
|
462
|
+
if (startRaw) applyPickedDate('start', startRaw);
|
|
463
|
+
else fields.value.start = emptyFieldGroup();
|
|
464
|
+
// A one-element pick starts a new range; the old end (date AND
|
|
465
|
+
// time) is discarded — a dangling time with no date would block
|
|
466
|
+
// the commit as `partial`.
|
|
467
|
+
if (endRaw) applyPickedDate('end', endRaw);
|
|
468
|
+
else fields.value.end = emptyFieldGroup();
|
|
469
|
+
updateAllSizedValues();
|
|
470
|
+
combineFieldsToModelValue({ finalize: false });
|
|
471
|
+
return;
|
|
472
|
+
}
|
|
473
|
+
applyPickedDate('start', value);
|
|
474
|
+
updateAllSizedValues();
|
|
475
|
+
combineFieldsToModelValue({ finalize: false });
|
|
476
|
+
},
|
|
477
|
+
};
|
|
478
|
+
|
|
479
|
+
/** Whether a segment's date part is fully typed (4-digit year). */
|
|
480
|
+
const dateCompleteFor = (segment: Segment) => {
|
|
481
|
+
const g = fields.value[segment];
|
|
482
|
+
return !!(g.day && g.month && g.year && g.year.length === 4);
|
|
483
|
+
};
|
|
484
|
+
|
|
485
|
+
/**
|
|
486
|
+
* Focus-follows affordance for range mode: the panel's time columns edit the
|
|
487
|
+
* segment whose fields were focused last (when it has a date), falling back
|
|
488
|
+
* to the end being built — `end` once its date exists, else `start`.
|
|
489
|
+
*/
|
|
490
|
+
const lastFocusedSegment = ref<Segment>('start');
|
|
491
|
+
const onSegmentFieldFocus = (descriptor: FieldDescriptor) => {
|
|
492
|
+
lastFocusedSegment.value = descriptor.segment;
|
|
493
|
+
onFieldFocus(descriptor);
|
|
494
|
+
};
|
|
495
|
+
|
|
496
|
+
/** Which segment the panel's time columns edit. Single mode: always `start`. */
|
|
497
|
+
const timeTargetSegment = computed<Segment>(() => {
|
|
498
|
+
if (!props.range) return 'start';
|
|
499
|
+
if (dateCompleteFor(lastFocusedSegment.value))
|
|
500
|
+
return lastFocusedSegment.value;
|
|
501
|
+
return dateCompleteFor('end') ? 'end' : 'start';
|
|
502
|
+
});
|
|
503
|
+
|
|
504
|
+
/** A column pick fills the obvious blanks so a single tap commits a full time. */
|
|
505
|
+
const onTimeSelect = ({ unit, value }: { unit: TimeUnit; value: string }) => {
|
|
506
|
+
const group = fields.value[timeTargetSegment.value];
|
|
507
|
+
if (unit === 'hour') setGroupHour(group, parseInt(value, 10));
|
|
508
|
+
else group[unit] = value;
|
|
509
|
+
// Fill the remaining blanks so a single tap commits a full time — without
|
|
510
|
+
// clobbering the unit just picked (choosing PM first must survive the
|
|
511
|
+
// hour default).
|
|
512
|
+
if (!group.hour) {
|
|
513
|
+
if (props.ampm)
|
|
514
|
+
group.hour = '12'; // 12 AM = midnight
|
|
515
|
+
else group.hour = '00';
|
|
516
|
+
}
|
|
517
|
+
if (props.ampm && !group.meridiem) group.meridiem = 'AM';
|
|
518
|
+
if (!group.minute) group.minute = '00';
|
|
519
|
+
if (props.seconds && !group.second) group.second = '00';
|
|
520
|
+
updateAllSizedValues();
|
|
521
|
+
combineFieldsToModelValue({ finalize: false });
|
|
522
|
+
};
|
|
523
|
+
|
|
524
|
+
/** Spoken value format for the calendar button: date, plus time with `datetime`. */
|
|
525
|
+
const spokenValueFormat = computed(() => {
|
|
526
|
+
if (!props.datetime) return 'D MMMM YYYY';
|
|
527
|
+
if (props.ampm)
|
|
528
|
+
return props.seconds ? 'D MMMM YYYY h:mm:ss A' : 'D MMMM YYYY h:mm A';
|
|
529
|
+
return props.seconds ? 'D MMMM YYYY HH:mm:ss' : 'D MMMM YYYY HH:mm';
|
|
530
|
+
});
|
|
531
|
+
|
|
532
|
+
const accessibleButtonLabel = computed(() => {
|
|
533
|
+
if (props.range) {
|
|
534
|
+
const values = Array.isArray(props.modelValue) ? props.modelValue : [];
|
|
535
|
+
const [startRaw, endRaw] = values;
|
|
536
|
+
if (!startRaw || !endRaw) return t('baseDatePickerInput.emptyRange').value;
|
|
537
|
+
|
|
538
|
+
const start = toInnerValue(startRaw);
|
|
539
|
+
const end = toInnerValue(endRaw);
|
|
540
|
+
if (!start.isValid() || !end.isValid())
|
|
541
|
+
return t('baseDatePickerInput.emptyRange').value;
|
|
542
|
+
|
|
543
|
+
return t(
|
|
544
|
+
'baseDatePickerInput.changeSelectionRange',
|
|
545
|
+
start.format(spokenValueFormat.value),
|
|
546
|
+
end.format(spokenValueFormat.value)
|
|
547
|
+
).value;
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
if (typeof props.modelValue === 'string') {
|
|
551
|
+
const parsed = toInnerValue(props.modelValue);
|
|
552
|
+
if (!parsed.isValid()) return t('baseDatePickerInput.emptySelection').value;
|
|
553
|
+
|
|
554
|
+
return t(
|
|
555
|
+
'baseDatePickerInput.changeSelection',
|
|
556
|
+
parsed.format(spokenValueFormat.value)
|
|
557
|
+
).value;
|
|
558
|
+
}
|
|
559
|
+
return t('baseDatePickerInput.emptySelection').value;
|
|
560
|
+
});
|
|
561
|
+
|
|
562
|
+
const isDateDisabled = (date: Dayjs) => {
|
|
563
|
+
if (!date.isValid()) return true;
|
|
564
|
+
|
|
565
|
+
let passing = true;
|
|
566
|
+
// Date-only bounds compare day-granular on purpose: a datetime value
|
|
567
|
+
// inside the boundary day (10:00 on the `max` date) must not be rejected
|
|
568
|
+
// by the midnight boundary instant. A time-bearing bound (with `datetime`)
|
|
569
|
+
// tightens the boundary day to the minute.
|
|
570
|
+
const unitFor = (bound: string) =>
|
|
571
|
+
props.datetime && boundaryHasTime(bound) ? 'minute' : 'day';
|
|
572
|
+
if (props.min) {
|
|
573
|
+
passing &&= date.isSameOrAfter(
|
|
574
|
+
parseBoundary(props.min),
|
|
575
|
+
unitFor(props.min)
|
|
576
|
+
);
|
|
577
|
+
}
|
|
578
|
+
if (props.max) {
|
|
579
|
+
passing &&= date.isSameOrBefore(
|
|
580
|
+
parseBoundary(props.max),
|
|
581
|
+
unitFor(props.max)
|
|
582
|
+
);
|
|
583
|
+
}
|
|
584
|
+
if (typeof props.selectable === 'function') {
|
|
585
|
+
passing &&= props.selectable(toOuterValue(date));
|
|
586
|
+
}
|
|
587
|
+
return !passing;
|
|
588
|
+
};
|
|
589
|
+
|
|
590
|
+
const onClickClear = () => {
|
|
591
|
+
if (props.range) {
|
|
592
|
+
emit('update:modelValue', []);
|
|
593
|
+
if (props.datetime) {
|
|
594
|
+
lastEmittedTime.value = [];
|
|
595
|
+
emit('update:time', []);
|
|
596
|
+
}
|
|
597
|
+
} else {
|
|
598
|
+
emit('update:modelValue', null);
|
|
599
|
+
if (props.datetime) {
|
|
600
|
+
lastEmittedTime.value = null;
|
|
601
|
+
emit('update:time', null);
|
|
602
|
+
}
|
|
603
|
+
}
|
|
604
|
+
};
|
|
605
|
+
|
|
606
|
+
// ==========================================================================
|
|
607
|
+
// Segmented field system — used for both single and range modes
|
|
608
|
+
// ==========================================================================
|
|
609
|
+
|
|
610
|
+
type DateFieldKey =
|
|
611
|
+
| 'day'
|
|
612
|
+
| 'month'
|
|
613
|
+
| 'year'
|
|
614
|
+
| 'hour'
|
|
615
|
+
| 'minute'
|
|
616
|
+
| 'second'
|
|
617
|
+
| 'meridiem';
|
|
618
|
+
type Segment = 'start' | 'end';
|
|
619
|
+
type FieldDescriptor = SegmentedFieldDescriptor<DateFieldKey, Segment>;
|
|
620
|
+
|
|
621
|
+
const TIME_FIELDS: ReadonlySet<DateFieldKey> = new Set([
|
|
622
|
+
'hour',
|
|
623
|
+
'minute',
|
|
624
|
+
'second',
|
|
625
|
+
'meridiem',
|
|
626
|
+
]);
|
|
627
|
+
|
|
628
|
+
// ── 12h/24h conversions ─────────────────────────────────────────────────────
|
|
629
|
+
// `ampm` is display-only: the fields hold 12-hour digits + a meridiem, while
|
|
630
|
+
// every model value stays 24-hour.
|
|
631
|
+
|
|
632
|
+
const to24Hour = (hour12: number, meridiem: string): number => {
|
|
633
|
+
if (meridiem === 'PM') return hour12 === 12 ? 12 : hour12 + 12;
|
|
634
|
+
return hour12 === 12 ? 0 : hour12;
|
|
635
|
+
};
|
|
636
|
+
|
|
637
|
+
const from24Hour = (
|
|
638
|
+
hour24: number
|
|
639
|
+
): { hour: string; meridiem: 'AM' | 'PM' } => {
|
|
640
|
+
const meridiem = hour24 >= 12 ? 'PM' : 'AM';
|
|
641
|
+
let hour12 = hour24 % 12;
|
|
642
|
+
if (hour12 === 0) hour12 = 12;
|
|
643
|
+
return { hour: String(hour12).padStart(2, '0'), meridiem };
|
|
644
|
+
};
|
|
645
|
+
|
|
646
|
+
const dateFieldOrder = computed<DateFieldKey[]>(() => {
|
|
647
|
+
// For Italian and most European locales, use DD/MM/YYYY
|
|
648
|
+
// For English and US locales, use MM/DD/YYYY
|
|
649
|
+
const locale = config.locale;
|
|
650
|
+
if (locale === 'en') return ['month', 'day', 'year'];
|
|
651
|
+
return ['day', 'month', 'year'];
|
|
652
|
+
});
|
|
653
|
+
|
|
654
|
+
/** Time fields rendered after the date, in fixed HH:mm(:ss)( AM) order. */
|
|
655
|
+
const timeFieldOrder = computed<DateFieldKey[]>(() => {
|
|
656
|
+
if (!props.datetime) return [];
|
|
657
|
+
const order: DateFieldKey[] = ['hour', 'minute'];
|
|
658
|
+
if (props.seconds) order.push('second');
|
|
659
|
+
if (props.ampm) order.push('meridiem');
|
|
660
|
+
return order;
|
|
661
|
+
});
|
|
662
|
+
|
|
663
|
+
const fieldOrder = computed<FieldDescriptor[]>(() => {
|
|
664
|
+
const order = [...dateFieldOrder.value, ...timeFieldOrder.value];
|
|
665
|
+
const start: FieldDescriptor[] = order.map((field) => ({
|
|
666
|
+
segment: 'start',
|
|
667
|
+
field,
|
|
668
|
+
}));
|
|
669
|
+
if (!props.range) return start;
|
|
670
|
+
const end: FieldDescriptor[] = order.map((field) => ({
|
|
671
|
+
segment: 'end',
|
|
672
|
+
field,
|
|
673
|
+
}));
|
|
674
|
+
return [...start, ...end];
|
|
675
|
+
});
|
|
676
|
+
|
|
677
|
+
/**
|
|
678
|
+
* Per-field behaviour table driving the segmented-field engine. Computed
|
|
679
|
+
* because the hour row changes shape with `ampm` (12-hour clamp + the
|
|
680
|
+
* meridiem enum segment).
|
|
681
|
+
*/
|
|
682
|
+
const fieldSpecs = computed<Record<DateFieldKey, SegmentedFieldSpec>>(() => ({
|
|
683
|
+
day: {
|
|
684
|
+
kind: 'numeric',
|
|
685
|
+
maxLength: 2,
|
|
686
|
+
max: 31,
|
|
687
|
+
rejectZero: true,
|
|
688
|
+
padTo: 2,
|
|
689
|
+
// Days 4-9 can only be 04-09 (no valid 40+)
|
|
690
|
+
autoAdvanceFrom: 4,
|
|
691
|
+
label: 'Day',
|
|
692
|
+
},
|
|
693
|
+
month: {
|
|
694
|
+
kind: 'numeric',
|
|
695
|
+
maxLength: 2,
|
|
696
|
+
max: 12,
|
|
697
|
+
rejectZero: true,
|
|
698
|
+
padTo: 2,
|
|
699
|
+
// Months 2-9 can only be 02-09 (no valid 20+)
|
|
700
|
+
autoAdvanceFrom: 2,
|
|
701
|
+
label: 'Month',
|
|
702
|
+
},
|
|
703
|
+
year: {
|
|
704
|
+
kind: 'numeric',
|
|
705
|
+
maxLength: 4,
|
|
706
|
+
// Year must be 4 digits to disambiguate; day/month can be 1 or 2
|
|
707
|
+
// (they'll be padded by parseSegmentAndCorrect before emission).
|
|
708
|
+
requireFullLength: true,
|
|
709
|
+
label: 'Year',
|
|
710
|
+
},
|
|
711
|
+
// `00` is a valid 24-hour/minute/second, so no rejectZero on those rows;
|
|
712
|
+
// 12-hour display has no `00`, hence the ampm variant rejects it.
|
|
713
|
+
hour: props.ampm
|
|
714
|
+
? {
|
|
715
|
+
kind: 'numeric',
|
|
716
|
+
maxLength: 2,
|
|
717
|
+
max: 12,
|
|
718
|
+
rejectZero: true,
|
|
719
|
+
padTo: 2,
|
|
720
|
+
// 12h hours 2-9 can only be 02-09 (only 1x reaches 10-12)
|
|
721
|
+
autoAdvanceFrom: 2,
|
|
722
|
+
label: 'Hour',
|
|
723
|
+
}
|
|
724
|
+
: {
|
|
725
|
+
kind: 'numeric',
|
|
726
|
+
maxLength: 2,
|
|
727
|
+
max: 23,
|
|
728
|
+
padTo: 2,
|
|
729
|
+
// Hours 3-9 can only be 03-09 (no valid 30+)
|
|
730
|
+
autoAdvanceFrom: 3,
|
|
731
|
+
label: 'Hour',
|
|
732
|
+
},
|
|
733
|
+
minute: {
|
|
734
|
+
kind: 'numeric',
|
|
735
|
+
maxLength: 2,
|
|
736
|
+
max: 59,
|
|
737
|
+
padTo: 2,
|
|
738
|
+
// Minutes 6-9 can only be 06-09 (no valid 60+)
|
|
739
|
+
autoAdvanceFrom: 6,
|
|
740
|
+
label: 'Minute',
|
|
741
|
+
},
|
|
742
|
+
second: {
|
|
743
|
+
kind: 'numeric',
|
|
744
|
+
maxLength: 2,
|
|
745
|
+
max: 59,
|
|
746
|
+
padTo: 2,
|
|
747
|
+
autoAdvanceFrom: 6,
|
|
748
|
+
label: 'Second',
|
|
749
|
+
},
|
|
750
|
+
meridiem: {
|
|
751
|
+
kind: 'enum',
|
|
752
|
+
maxLength: 2,
|
|
753
|
+
enum: { values: ['AM', 'PM'], keys: { a: 'AM', p: 'PM' } },
|
|
754
|
+
sizerMin: 'AM',
|
|
755
|
+
label: 'AM/PM',
|
|
756
|
+
},
|
|
757
|
+
}));
|
|
758
|
+
|
|
759
|
+
/**
|
|
760
|
+
* Separator between two adjacent fields: `–` between range ends, `/` inside
|
|
761
|
+
* a date, `:` inside a time, and a non-breaking space at the date→time
|
|
762
|
+
* boundary.
|
|
763
|
+
*/
|
|
764
|
+
const separatorBetween = (a: FieldDescriptor, b: FieldDescriptor) => {
|
|
765
|
+
if (a.segment !== b.segment) return '–';
|
|
766
|
+
if (b.field === 'meridiem') return ' ';
|
|
767
|
+
const aTime = TIME_FIELDS.has(a.field);
|
|
768
|
+
const bTime = TIME_FIELDS.has(b.field);
|
|
769
|
+
if (aTime && bTime) return ':';
|
|
770
|
+
if (!aTime && bTime) return ' ';
|
|
771
|
+
return '/';
|
|
772
|
+
};
|
|
773
|
+
|
|
774
|
+
const {
|
|
775
|
+
fields,
|
|
776
|
+
fieldRefs,
|
|
777
|
+
descriptorKey,
|
|
778
|
+
emptyFieldGroup,
|
|
779
|
+
getSizedValue,
|
|
780
|
+
minChars,
|
|
781
|
+
updateAllSizedValues,
|
|
782
|
+
isOwnField,
|
|
783
|
+
focusField,
|
|
784
|
+
focusFirstField,
|
|
785
|
+
segmentStatus,
|
|
786
|
+
onFieldInput,
|
|
787
|
+
onFieldKeydown,
|
|
788
|
+
onFieldFocus,
|
|
789
|
+
onFieldBlur,
|
|
790
|
+
onFieldPaste,
|
|
791
|
+
} = useSegmentedFields<DateFieldKey, Segment>({
|
|
792
|
+
fieldOrder,
|
|
793
|
+
specs: fieldSpecs,
|
|
794
|
+
segments: ['start', 'end'],
|
|
795
|
+
fieldKeys: ['day', 'month', 'year', 'hour', 'minute', 'second', 'meridiem'],
|
|
796
|
+
// Blank time commits as 00:00 (the consumer default); a half-typed time
|
|
797
|
+
// blocks the commit. Seconds are their own group so 14:30 with an empty
|
|
798
|
+
// seconds field still commits (as 14:30:00). Unrendered members (meridiem
|
|
799
|
+
// without `ampm`) are ignored by the engine's rendered-fields filter.
|
|
800
|
+
optionalGroups: [['hour', 'minute', 'meridiem'], ['second']],
|
|
801
|
+
onDirty: () => combineFieldsToModelValue({ finalize: false }),
|
|
802
|
+
});
|
|
803
|
+
|
|
804
|
+
const getFieldId = (d: FieldDescriptor): string => {
|
|
805
|
+
if (!props.range) return `${id}-${d.field}`;
|
|
806
|
+
return `${id}-${d.segment}-${d.field}`;
|
|
807
|
+
};
|
|
808
|
+
|
|
809
|
+
const getFieldName = (d: FieldDescriptor): string | undefined => {
|
|
810
|
+
if (!props.name) return undefined;
|
|
811
|
+
if (!props.range) return `${props.name}-${d.field}`;
|
|
812
|
+
return `${props.name}-${d.segment}-${d.field}`;
|
|
813
|
+
};
|
|
814
|
+
|
|
815
|
+
const fieldLabelKeys = {
|
|
816
|
+
day: 'baseDatePickerInput.dayField',
|
|
817
|
+
month: 'baseDatePickerInput.monthField',
|
|
818
|
+
year: 'baseDatePickerInput.yearField',
|
|
819
|
+
hour: 'baseDatePickerInput.hourField',
|
|
820
|
+
minute: 'baseDatePickerInput.minuteField',
|
|
821
|
+
second: 'baseDatePickerInput.secondField',
|
|
822
|
+
meridiem: 'baseDatePickerInput.meridiemField',
|
|
823
|
+
} as const;
|
|
824
|
+
|
|
825
|
+
const getFieldLabel = (descriptor: FieldDescriptor): string => {
|
|
826
|
+
const base = t(fieldLabelKeys[descriptor.field]).value;
|
|
827
|
+
if (!props.range) return base;
|
|
828
|
+
return t(
|
|
829
|
+
descriptor.segment === 'start'
|
|
830
|
+
? 'baseDatePickerInput.startFieldLabel'
|
|
831
|
+
: 'baseDatePickerInput.endFieldLabel',
|
|
832
|
+
base
|
|
833
|
+
).value;
|
|
834
|
+
};
|
|
835
|
+
|
|
836
|
+
// ── Time helpers ────────────────────────────────────────────────────────────
|
|
837
|
+
|
|
838
|
+
/** Writes a 24-hour hour into a group's display fields (12h + meridiem with `ampm`). */
|
|
839
|
+
const setGroupHour = (group: Record<DateFieldKey, string>, hour24: number) => {
|
|
840
|
+
if (!props.ampm) {
|
|
841
|
+
group.hour = String(hour24).padStart(2, '0');
|
|
842
|
+
return;
|
|
843
|
+
}
|
|
844
|
+
const twelve = from24Hour(hour24);
|
|
845
|
+
group.hour = twelve.hour;
|
|
846
|
+
group.meridiem = twelve.meridiem;
|
|
847
|
+
};
|
|
848
|
+
|
|
849
|
+
/** Reads a group's displayed hour back as 24-hour (blank meridiem = AM). */
|
|
850
|
+
const groupHour24 = (g: Record<DateFieldKey, string>): number => {
|
|
851
|
+
if (!g.hour) return 0;
|
|
852
|
+
const num = parseInt(g.hour, 10);
|
|
853
|
+
if (!props.ampm) return num;
|
|
854
|
+
return to24Hour(num, g.meridiem || 'AM');
|
|
855
|
+
};
|
|
856
|
+
|
|
857
|
+
const timeDisplayFormat = computed(() =>
|
|
858
|
+
props.seconds ? 'HH:mm:ss' : 'HH:mm'
|
|
859
|
+
);
|
|
860
|
+
|
|
861
|
+
/** Formats the time part of a value for the `v-model:time` mirror. */
|
|
862
|
+
const formatTimeOf = (d: Dayjs) => d.format(timeDisplayFormat.value);
|
|
863
|
+
|
|
864
|
+
const TIME_STRING_RE = /^(\d{1,2}):(\d{1,2})(?::(\d{1,2}))?$/;
|
|
865
|
+
|
|
866
|
+
/** Parses a `HH:mm(:ss)` model string into padded field values. */
|
|
867
|
+
const parseTimeParts = (
|
|
868
|
+
value: string | null | undefined
|
|
869
|
+
): { hour: string; minute: string; second: string } | null => {
|
|
870
|
+
if (!value) return null;
|
|
871
|
+
const match = TIME_STRING_RE.exec(value);
|
|
872
|
+
if (!match) return null;
|
|
873
|
+
const [, h, m, s] = match;
|
|
874
|
+
if (parseInt(h, 10) > 23 || parseInt(m, 10) > 59) return null;
|
|
875
|
+
if (s && parseInt(s, 10) > 59) return null;
|
|
876
|
+
return {
|
|
877
|
+
hour: h.padStart(2, '0'),
|
|
878
|
+
minute: m.padStart(2, '0'),
|
|
879
|
+
second: (s ?? '').padStart(s ? 2 : 0, '0'),
|
|
880
|
+
};
|
|
881
|
+
};
|
|
882
|
+
|
|
883
|
+
/** Overlays a `HH:mm(:ss)` string onto a field group's time fields. */
|
|
884
|
+
const applyTimeToGroup = (
|
|
885
|
+
group: Record<DateFieldKey, string>,
|
|
886
|
+
value: string | null | undefined
|
|
887
|
+
) => {
|
|
888
|
+
if (!props.datetime) return;
|
|
889
|
+
const parts = parseTimeParts(value);
|
|
890
|
+
if (!parts) {
|
|
891
|
+
group.hour = '';
|
|
892
|
+
group.minute = '';
|
|
893
|
+
group.second = '';
|
|
894
|
+
group.meridiem = '';
|
|
895
|
+
return;
|
|
896
|
+
}
|
|
897
|
+
setGroupHour(group, parseInt(parts.hour, 10));
|
|
898
|
+
group.minute = parts.minute;
|
|
899
|
+
group.second = props.seconds ? parts.second : '';
|
|
900
|
+
};
|
|
901
|
+
|
|
902
|
+
const timeHintKey = computed(() =>
|
|
903
|
+
props.seconds
|
|
904
|
+
? 'baseDatePickerInput.timeFormatSeconds'
|
|
905
|
+
: 'baseDatePickerInput.timeFormat'
|
|
906
|
+
);
|
|
907
|
+
|
|
908
|
+
/** Localized format hint used by the placeholder and the sr-only description. */
|
|
909
|
+
const formatHint = computed(() => {
|
|
910
|
+
if (!props.datetime) {
|
|
911
|
+
return t(
|
|
912
|
+
props.range
|
|
913
|
+
? 'baseDatePickerInput.dateFormatRange'
|
|
914
|
+
: 'baseDatePickerInput.dateFormatSingle'
|
|
915
|
+
).value;
|
|
916
|
+
}
|
|
917
|
+
const single = `${t('baseDatePickerInput.dateFormatSingle').value} ${t(timeHintKey.value).value}`;
|
|
918
|
+
return props.range ? `${single} – ${single}` : single;
|
|
919
|
+
});
|
|
920
|
+
|
|
921
|
+
const placeholderText = computed(() => props.placeholder || formatHint.value);
|
|
922
|
+
|
|
923
|
+
const showPlaceholder = computed(() =>
|
|
924
|
+
fieldOrder.value.every((d) => !fields.value[d.segment][d.field])
|
|
925
|
+
);
|
|
926
|
+
|
|
927
|
+
const parseValueToFieldGroup = (
|
|
928
|
+
value: string | null | undefined
|
|
929
|
+
): Record<DateFieldKey, string> => {
|
|
930
|
+
if (!value) return emptyFieldGroup();
|
|
931
|
+
const parsed = toInnerValue(value);
|
|
932
|
+
if (!parsed.isValid()) return emptyFieldGroup();
|
|
933
|
+
const group = emptyFieldGroup();
|
|
934
|
+
group.day = parsed.format('DD');
|
|
935
|
+
group.month = parsed.format('MM');
|
|
936
|
+
group.year = parsed.format('YYYY');
|
|
937
|
+
// Non-floating values carry their time inline; floating dates are plain
|
|
938
|
+
// and the time is overlaid from the `time` model by the caller. Without
|
|
939
|
+
// `seconds` an incoming seconds part displays truncated (and zeroes out on
|
|
940
|
+
// the next user commit) — deliberate, no hidden precision rides along.
|
|
941
|
+
if (props.datetime && !props.floating) {
|
|
942
|
+
setGroupHour(group, parsed.hour());
|
|
943
|
+
group.minute = parsed.format('mm');
|
|
944
|
+
group.second = props.seconds ? parsed.format('ss') : '';
|
|
945
|
+
}
|
|
946
|
+
return group;
|
|
947
|
+
};
|
|
948
|
+
|
|
949
|
+
/** The `time` model entry for a segment (single string or array element). */
|
|
950
|
+
const timeModelFor = (segment: Segment): string | null | undefined => {
|
|
951
|
+
if (Array.isArray(props.time)) {
|
|
952
|
+
return props.time[segment === 'start' ? 0 : 1];
|
|
953
|
+
}
|
|
954
|
+
return segment === 'start' ? props.time : undefined;
|
|
955
|
+
};
|
|
956
|
+
|
|
957
|
+
const parseModelValueToFields = (value: typeof props.modelValue) => {
|
|
958
|
+
if (!value) {
|
|
959
|
+
fields.value = { start: emptyFieldGroup(), end: emptyFieldGroup() };
|
|
960
|
+
return;
|
|
961
|
+
}
|
|
962
|
+
if (props.range) {
|
|
963
|
+
const arr = Array.isArray(value) ? value : [];
|
|
964
|
+
const [startRaw, endRaw] = arr;
|
|
965
|
+
fields.value = {
|
|
966
|
+
start: parseValueToFieldGroup(startRaw),
|
|
967
|
+
end: parseValueToFieldGroup(endRaw),
|
|
968
|
+
};
|
|
969
|
+
} else if (Array.isArray(value)) {
|
|
970
|
+
fields.value = { start: emptyFieldGroup(), end: emptyFieldGroup() };
|
|
971
|
+
} else {
|
|
972
|
+
fields.value = {
|
|
973
|
+
start: parseValueToFieldGroup(value),
|
|
974
|
+
end: emptyFieldGroup(),
|
|
975
|
+
};
|
|
976
|
+
}
|
|
977
|
+
// Floating dates carry no time — the `time` model is the only source.
|
|
978
|
+
if (props.datetime && props.floating) {
|
|
979
|
+
for (const segment of ['start', 'end'] as const) {
|
|
980
|
+
const group = fields.value[segment];
|
|
981
|
+
if (group.day) applyTimeToGroup(group, timeModelFor(segment));
|
|
982
|
+
}
|
|
983
|
+
}
|
|
984
|
+
};
|
|
985
|
+
|
|
986
|
+
/**
|
|
987
|
+
* Restores the field inputs to match the current modelValue.
|
|
988
|
+
* Called when focus leaves the component to ensure display coherence.
|
|
989
|
+
*/
|
|
990
|
+
const restoreFieldsFromModelValue = () => {
|
|
991
|
+
parseModelValueToFields(props.modelValue);
|
|
992
|
+
};
|
|
993
|
+
|
|
994
|
+
// Initialize fields from modelValue
|
|
995
|
+
parseModelValueToFields(props.modelValue);
|
|
996
|
+
updateAllSizedValues();
|
|
997
|
+
|
|
998
|
+
/**
|
|
999
|
+
* Mirrors the time part of a (non-floating) modelValue into `update:time`
|
|
1000
|
+
* after an external change, keeping the two models in sync without a commit.
|
|
1001
|
+
*/
|
|
1002
|
+
const mirrorTimeFromModelValue = (value: typeof props.modelValue) => {
|
|
1003
|
+
if (!props.datetime || props.floating) return;
|
|
1004
|
+
let time: string | string[] | null;
|
|
1005
|
+
if (!value) time = null;
|
|
1006
|
+
else if (Array.isArray(value))
|
|
1007
|
+
time = value.map((entry) => formatTimeOf(toInnerValue(entry)));
|
|
1008
|
+
else time = formatTimeOf(toInnerValue(value));
|
|
1009
|
+
lastEmittedTime.value = time;
|
|
1010
|
+
emit('update:time', time);
|
|
1011
|
+
};
|
|
1012
|
+
|
|
1013
|
+
// Watch for external modelValue changes
|
|
1014
|
+
watch(
|
|
1015
|
+
() => props.modelValue,
|
|
1016
|
+
(value) => {
|
|
1017
|
+
// Always clear fields when modelValue is cleared from outside
|
|
1018
|
+
if (value === null || (Array.isArray(value) && value.length === 0)) {
|
|
1019
|
+
parseModelValueToFields(value);
|
|
1020
|
+
updateAllSizedValues();
|
|
1021
|
+
mirrorTimeFromModelValue(value);
|
|
1022
|
+
return;
|
|
1023
|
+
}
|
|
1024
|
+
|
|
1025
|
+
// Only update if not currently editing (to avoid overwriting user input)
|
|
1026
|
+
const activeEl = document.activeElement;
|
|
1027
|
+
if (activeEl && isOwnField(activeEl)) return;
|
|
1028
|
+
parseModelValueToFields(value);
|
|
1029
|
+
updateAllSizedValues();
|
|
1030
|
+
mirrorTimeFromModelValue(value);
|
|
1031
|
+
}
|
|
1032
|
+
);
|
|
1033
|
+
|
|
1034
|
+
/**
|
|
1035
|
+
* External writes to the `time` model rewrite the time part of the fields
|
|
1036
|
+
* and re-commit, so `modelValue` and the mirror stay coherent. The echo of
|
|
1037
|
+
* our own emission is swallowed via `lastEmittedTime`.
|
|
1038
|
+
*/
|
|
1039
|
+
watch(
|
|
1040
|
+
() => props.time,
|
|
1041
|
+
(value) => {
|
|
1042
|
+
if (!props.datetime) return;
|
|
1043
|
+
if (hash(value ?? null) === hash(lastEmittedTime.value ?? null)) return;
|
|
1044
|
+
const activeEl = document.activeElement;
|
|
1045
|
+
if (activeEl && isOwnField(activeEl)) return;
|
|
1046
|
+
|
|
1047
|
+
for (const segment of ['start', 'end'] as const) {
|
|
1048
|
+
if (segment === 'end' && !props.range) break;
|
|
1049
|
+
const entry = timeModelFor(segment);
|
|
1050
|
+
const group = fields.value[segment];
|
|
1051
|
+
if (entry === undefined) continue;
|
|
1052
|
+
applyTimeToGroup(group, entry);
|
|
1053
|
+
}
|
|
1054
|
+
updateAllSizedValues();
|
|
1055
|
+
// Re-commit only when a date exists — time never invents a day; with
|
|
1056
|
+
// no (or a partial) date the combine below is a no-op by design.
|
|
1057
|
+
combineFieldsToModelValue({ finalize: false });
|
|
1058
|
+
}
|
|
1059
|
+
);
|
|
1060
|
+
|
|
1061
|
+
const hasPartialSegments = () => {
|
|
1062
|
+
const start = segmentStatus('start');
|
|
1063
|
+
if (start === 'partial') return true;
|
|
1064
|
+
if (!props.range) return false;
|
|
1065
|
+
return segmentStatus('end') === 'partial';
|
|
1066
|
+
};
|
|
1067
|
+
|
|
1068
|
+
const parseSegmentAndCorrect = (segment: Segment): Dayjs | null => {
|
|
1069
|
+
const g = fields.value[segment];
|
|
1070
|
+
if (!g.day || !g.month || !g.year) return null;
|
|
1071
|
+
|
|
1072
|
+
const dayNum = parseInt(g.day, 10);
|
|
1073
|
+
const monthNum = parseInt(g.month, 10);
|
|
1074
|
+
const yearNum = parseInt(g.year, 10);
|
|
1075
|
+
|
|
1076
|
+
if (
|
|
1077
|
+
dayNum < 1 ||
|
|
1078
|
+
dayNum > 31 ||
|
|
1079
|
+
monthNum < 1 ||
|
|
1080
|
+
monthNum > 12 ||
|
|
1081
|
+
yearNum < 1000 ||
|
|
1082
|
+
yearNum > 9999
|
|
1083
|
+
) {
|
|
1084
|
+
return null;
|
|
1085
|
+
}
|
|
1086
|
+
|
|
1087
|
+
const year = g.year.padStart(4, '0');
|
|
1088
|
+
const month = g.month.padStart(2, '0');
|
|
1089
|
+
const day = g.day.padStart(2, '0');
|
|
1090
|
+
|
|
1091
|
+
// Blank time fields commit as 00:00(:00); without `seconds` any typed
|
|
1092
|
+
// seconds are ignored so precision never rides along invisibly.
|
|
1093
|
+
let timeSuffix = '';
|
|
1094
|
+
let timeFormatSuffix = '';
|
|
1095
|
+
if (props.datetime) {
|
|
1096
|
+
// With `ampm` the field holds 1-12 and the meridiem disambiguates;
|
|
1097
|
+
// convert to 24h before building the value string.
|
|
1098
|
+
if (props.ampm && g.hour) {
|
|
1099
|
+
const hour12 = parseInt(g.hour, 10);
|
|
1100
|
+
if (hour12 < 1 || hour12 > 12) return null;
|
|
1101
|
+
}
|
|
1102
|
+
const hour = String(groupHour24(g)).padStart(2, '0');
|
|
1103
|
+
const minute = (g.minute || '0').padStart(2, '0');
|
|
1104
|
+
const second = ((props.seconds ? g.second : '') || '0').padStart(2, '0');
|
|
1105
|
+
if (
|
|
1106
|
+
parseInt(hour, 10) > 23 ||
|
|
1107
|
+
parseInt(minute, 10) > 59 ||
|
|
1108
|
+
parseInt(second, 10) > 59
|
|
1109
|
+
) {
|
|
1110
|
+
return null;
|
|
1111
|
+
}
|
|
1112
|
+
timeSuffix = `T${hour}:${minute}:${second}`;
|
|
1113
|
+
timeFormatSuffix = 'THH:mm:ss';
|
|
1114
|
+
}
|
|
1115
|
+
|
|
1116
|
+
const dateString = `${year}-${month}-${day}${timeSuffix}`;
|
|
1117
|
+
let parsed = dayjs(dateString, BOUNDARY_DATE_FORMAT + timeFormatSuffix, true);
|
|
1118
|
+
|
|
1119
|
+
// If date is invalid (e.g., Feb 31), snap to the last valid day of that month
|
|
1120
|
+
if (!parsed.isValid()) {
|
|
1121
|
+
const lastDayOfMonth = dayjs(
|
|
1122
|
+
`${year}-${month}-01`,
|
|
1123
|
+
BOUNDARY_DATE_FORMAT,
|
|
1124
|
+
true
|
|
1125
|
+
)
|
|
1126
|
+
.endOf('month')
|
|
1127
|
+
.date();
|
|
1128
|
+
const correctedDay = Math.min(dayNum, lastDayOfMonth);
|
|
1129
|
+
const correctedDateString = `${year}-${month}-${String(correctedDay).padStart(2, '0')}${timeSuffix}`;
|
|
1130
|
+
parsed = dayjs(
|
|
1131
|
+
correctedDateString,
|
|
1132
|
+
BOUNDARY_DATE_FORMAT + timeFormatSuffix,
|
|
1133
|
+
true
|
|
1134
|
+
);
|
|
1135
|
+
fields.value[segment].day = String(correctedDay).padStart(2, '0');
|
|
1136
|
+
}
|
|
1137
|
+
|
|
1138
|
+
return parsed.isValid() ? parsed : null;
|
|
1139
|
+
};
|
|
1140
|
+
|
|
1141
|
+
/**
|
|
1142
|
+
* Converts a Dayjs into the display field strings used by the inputs
|
|
1143
|
+
* (DD/MM/YYYY, plus HH/mm/ss when `datetime` is on).
|
|
1144
|
+
*/
|
|
1145
|
+
const dayjsToFieldGroup = (d: Dayjs): Record<DateFieldKey, string> => {
|
|
1146
|
+
const group = emptyFieldGroup();
|
|
1147
|
+
group.day = d.format('DD');
|
|
1148
|
+
group.month = d.format('MM');
|
|
1149
|
+
group.year = d.format('YYYY');
|
|
1150
|
+
if (props.datetime) {
|
|
1151
|
+
setGroupHour(group, d.hour());
|
|
1152
|
+
group.minute = d.format('mm');
|
|
1153
|
+
group.second = props.seconds ? d.format('ss') : '';
|
|
1154
|
+
}
|
|
1155
|
+
return group;
|
|
1156
|
+
};
|
|
1157
|
+
|
|
1158
|
+
/**
|
|
1159
|
+
* Attempts to snap a disabled date to the nearest valid boundary.
|
|
1160
|
+
*
|
|
1161
|
+
* - If the date is below `min`, returns `min` (provided `min` itself passes all constraints).
|
|
1162
|
+
* - If the date is above `max`, returns `max` (same caveat).
|
|
1163
|
+
* - If the date is disabled only by `selectable` (i.e. within min/max), there is no
|
|
1164
|
+
* deterministic "closest" value, so `null` is returned and the caller should remove it.
|
|
1165
|
+
*/
|
|
1166
|
+
const normalizeDisabledDate = (date: Dayjs): Dayjs | null => {
|
|
1167
|
+
// Snapping to a date-only bound keeps the typed time (the boundary day
|
|
1168
|
+
// still contains it); a time-bearing bound clamps to its exact minute.
|
|
1169
|
+
const grafted = (bound: Dayjs, hasTime: boolean) =>
|
|
1170
|
+
props.datetime && !hasTime
|
|
1171
|
+
? bound.hour(date.hour()).minute(date.minute()).second(date.second())
|
|
1172
|
+
: bound;
|
|
1173
|
+
const compareUnit = props.datetime ? 'minute' : 'day';
|
|
1174
|
+
let candidate = date;
|
|
1175
|
+
if (props.min) {
|
|
1176
|
+
const hasTime = boundaryHasTime(props.min);
|
|
1177
|
+
const min = parseBoundary(props.min);
|
|
1178
|
+
if (candidate.isBefore(min, props.datetime && hasTime ? 'minute' : 'day'))
|
|
1179
|
+
candidate = grafted(min, hasTime);
|
|
1180
|
+
}
|
|
1181
|
+
if (props.max) {
|
|
1182
|
+
const hasTime = boundaryHasTime(props.max);
|
|
1183
|
+
const max = parseBoundary(props.max);
|
|
1184
|
+
if (candidate.isAfter(max, props.datetime && hasTime ? 'minute' : 'day'))
|
|
1185
|
+
candidate = grafted(max, hasTime);
|
|
1186
|
+
}
|
|
1187
|
+
// No boundary clamping happened → date is disabled by `selectable` only
|
|
1188
|
+
if (candidate.isSame(date, compareUnit)) return null;
|
|
1189
|
+
// The boundary itself might be blocked by `selectable`
|
|
1190
|
+
if (isDateDisabled(candidate)) return null;
|
|
1191
|
+
return candidate;
|
|
1192
|
+
};
|
|
1193
|
+
|
|
1194
|
+
const emitError = (error: DatePickerInputError) => {
|
|
1195
|
+
emit('error', error);
|
|
1196
|
+
};
|
|
1197
|
+
|
|
1198
|
+
/**
|
|
1199
|
+
* Reads a segment's committed time (blank fields → 00) for the time mirror.
|
|
1200
|
+
* Every emission site syncs the fields before emitting, so the fields are
|
|
1201
|
+
* always the authoritative source of the just-committed time.
|
|
1202
|
+
*/
|
|
1203
|
+
const timeFromFields = (segment: Segment): string => {
|
|
1204
|
+
const g = fields.value[segment];
|
|
1205
|
+
const hour = String(groupHour24(g)).padStart(2, '0');
|
|
1206
|
+
const minute = (g.minute || '0').padStart(2, '0');
|
|
1207
|
+
if (!props.seconds) return `${hour}:${minute}`;
|
|
1208
|
+
return `${hour}:${minute}:${(g.second || '0').padStart(2, '0')}`;
|
|
1209
|
+
};
|
|
1210
|
+
|
|
1211
|
+
/** Last mirror emission, used to swallow the v-model echo in the watcher. */
|
|
1212
|
+
const lastEmittedTime = ref<string | string[] | null | undefined>(undefined);
|
|
1213
|
+
|
|
1214
|
+
/**
|
|
1215
|
+
* Emits `update:modelValue` and, while `datetime` is on, the matching
|
|
1216
|
+
* `update:time` mirror (always 24-hour digits, array-shaped in range mode).
|
|
1217
|
+
*/
|
|
1218
|
+
const emitValue = (value: BaseDatePickerInputProps['modelValue']): void => {
|
|
1219
|
+
emit('update:modelValue', value);
|
|
1220
|
+
if (!props.datetime) return;
|
|
1221
|
+
let time: string | string[] | null;
|
|
1222
|
+
if (value === null) time = null;
|
|
1223
|
+
else if (Array.isArray(value))
|
|
1224
|
+
time = value.map((_, index) =>
|
|
1225
|
+
timeFromFields(index === 0 ? 'start' : 'end')
|
|
1226
|
+
);
|
|
1227
|
+
else time = timeFromFields('start');
|
|
1228
|
+
lastEmittedTime.value = time;
|
|
1229
|
+
emit('update:time', time);
|
|
1230
|
+
};
|
|
1231
|
+
|
|
1232
|
+
const combineFieldsToModelValue = (
|
|
1233
|
+
options: {
|
|
1234
|
+
/**
|
|
1235
|
+
* When true, apply destructive autofixes (normalize/reset/swap).
|
|
1236
|
+
* This should run only when interaction ends (component inactive).
|
|
1237
|
+
*/
|
|
1238
|
+
finalize?: boolean;
|
|
1239
|
+
} = {}
|
|
1240
|
+
): void => {
|
|
1241
|
+
const finalize = !!options.finalize;
|
|
1242
|
+
const startStatus = segmentStatus('start');
|
|
1243
|
+
|
|
1244
|
+
if (!props.range) {
|
|
1245
|
+
if (startStatus === 'empty') {
|
|
1246
|
+
emitValue(null);
|
|
1247
|
+
return;
|
|
1248
|
+
}
|
|
1249
|
+
if (startStatus === 'partial') return;
|
|
1250
|
+
|
|
1251
|
+
const parsed = parseSegmentAndCorrect('start');
|
|
1252
|
+
if (!parsed) return;
|
|
1253
|
+
if (isDateDisabled(parsed)) {
|
|
1254
|
+
if (!finalize) return;
|
|
1255
|
+
const original = toOuterValue(parsed);
|
|
1256
|
+
const candidate = normalizeDisabledDate(parsed);
|
|
1257
|
+
if (candidate) {
|
|
1258
|
+
const normalized = toOuterValue(candidate);
|
|
1259
|
+
fields.value.start = dayjsToFieldGroup(candidate);
|
|
1260
|
+
emitValue(normalized);
|
|
1261
|
+
emitError({ code: 'disabled_date', original, normalized });
|
|
1262
|
+
} else {
|
|
1263
|
+
fields.value.start = emptyFieldGroup();
|
|
1264
|
+
emitValue(null);
|
|
1265
|
+
emitError({ code: 'disabled_date', original, normalized: null });
|
|
1266
|
+
}
|
|
1267
|
+
return;
|
|
1268
|
+
}
|
|
1269
|
+
emitValue(toOuterValue(parsed));
|
|
1270
|
+
return;
|
|
1271
|
+
}
|
|
1272
|
+
|
|
1273
|
+
// ── Range mode ──────────────────────────────────────────────────────────────
|
|
1274
|
+
|
|
1275
|
+
const endStatus = segmentStatus('end');
|
|
1276
|
+
|
|
1277
|
+
if (startStatus === 'empty' && endStatus === 'empty') {
|
|
1278
|
+
emitValue(null);
|
|
1279
|
+
return;
|
|
1280
|
+
}
|
|
1281
|
+
if (startStatus === 'partial' || endStatus === 'partial') return;
|
|
1282
|
+
// end complete but start empty is ambiguous — defer until user fills start
|
|
1283
|
+
if (startStatus === 'empty') return;
|
|
1284
|
+
|
|
1285
|
+
const startParsed = parseSegmentAndCorrect('start');
|
|
1286
|
+
if (!startParsed) return;
|
|
1287
|
+
const endParsed =
|
|
1288
|
+
endStatus !== 'empty' ? parseSegmentAndCorrect('end') : null;
|
|
1289
|
+
|
|
1290
|
+
// Original outer values captured before any normalization
|
|
1291
|
+
const startOriginal = toOuterValue(startParsed);
|
|
1292
|
+
const endOriginal = endParsed ? toOuterValue(endParsed) : null;
|
|
1293
|
+
|
|
1294
|
+
// Normalize start if disabled ──────────────────────────────────────────────
|
|
1295
|
+
let effectiveStart = startParsed;
|
|
1296
|
+
let startNormalized = false;
|
|
1297
|
+
|
|
1298
|
+
if (isDateDisabled(startParsed)) {
|
|
1299
|
+
if (!finalize) return;
|
|
1300
|
+
const candidate = normalizeDisabledDate(startParsed);
|
|
1301
|
+
const original: string[] = endOriginal
|
|
1302
|
+
? [startOriginal, endOriginal]
|
|
1303
|
+
: [startOriginal];
|
|
1304
|
+
if (!candidate) {
|
|
1305
|
+
fields.value.start = emptyFieldGroup();
|
|
1306
|
+
fields.value.end = emptyFieldGroup();
|
|
1307
|
+
emitValue(null);
|
|
1308
|
+
emitError({ code: 'disabled_range_start', original, normalized: null });
|
|
1309
|
+
return;
|
|
1310
|
+
}
|
|
1311
|
+
effectiveStart = candidate;
|
|
1312
|
+
startNormalized = true;
|
|
1313
|
+
fields.value.start = dayjsToFieldGroup(candidate);
|
|
1314
|
+
if (!endParsed) {
|
|
1315
|
+
const normalized = [toOuterValue(candidate)];
|
|
1316
|
+
emitValue(normalized);
|
|
1317
|
+
emitError({ code: 'disabled_range_start', original, normalized });
|
|
1318
|
+
return;
|
|
1319
|
+
}
|
|
1320
|
+
}
|
|
1321
|
+
|
|
1322
|
+
if (!endParsed) {
|
|
1323
|
+
emitValue([toOuterValue(effectiveStart)]);
|
|
1324
|
+
return;
|
|
1325
|
+
}
|
|
1326
|
+
|
|
1327
|
+
// Normalize end if disabled ────────────────────────────────────────────────
|
|
1328
|
+
let effectiveEnd = endParsed;
|
|
1329
|
+
let endNormalized = false;
|
|
1330
|
+
|
|
1331
|
+
if (isDateDisabled(endParsed)) {
|
|
1332
|
+
if (!finalize) return;
|
|
1333
|
+
const candidate = normalizeDisabledDate(endParsed);
|
|
1334
|
+
const original: [string, string] = [startOriginal, endOriginal!];
|
|
1335
|
+
if (!candidate) {
|
|
1336
|
+
const normalized: [string] = [toOuterValue(effectiveStart)];
|
|
1337
|
+
fields.value.end = emptyFieldGroup();
|
|
1338
|
+
emitValue(normalized);
|
|
1339
|
+
if (startNormalized)
|
|
1340
|
+
emitError({
|
|
1341
|
+
code: 'disabled_range_start',
|
|
1342
|
+
original,
|
|
1343
|
+
normalized,
|
|
1344
|
+
});
|
|
1345
|
+
emitError({ code: 'disabled_range_end', original, normalized });
|
|
1346
|
+
return;
|
|
1347
|
+
}
|
|
1348
|
+
effectiveEnd = candidate;
|
|
1349
|
+
endNormalized = true;
|
|
1350
|
+
fields.value.end = dayjsToFieldGroup(candidate);
|
|
1351
|
+
}
|
|
1352
|
+
|
|
1353
|
+
// Ordering check ───────────────────────────────────────────────────────────
|
|
1354
|
+
// Whole-value granularity with datetime: a same-day 14:00 → 09:00 range is
|
|
1355
|
+
// inverted too, not only day-level inversions.
|
|
1356
|
+
if (
|
|
1357
|
+
effectiveEnd.isBefore(effectiveStart, props.datetime ? 'second' : 'day')
|
|
1358
|
+
) {
|
|
1359
|
+
if (!finalize) return;
|
|
1360
|
+
const original: [string, string] = [
|
|
1361
|
+
toOuterValue(effectiveStart),
|
|
1362
|
+
toOuterValue(effectiveEnd),
|
|
1363
|
+
];
|
|
1364
|
+
const normalized: [string, string] = [
|
|
1365
|
+
toOuterValue(effectiveEnd),
|
|
1366
|
+
toOuterValue(effectiveStart),
|
|
1367
|
+
];
|
|
1368
|
+
const savedStart = { ...fields.value.start };
|
|
1369
|
+
fields.value.start = { ...fields.value.end };
|
|
1370
|
+
fields.value.end = savedStart;
|
|
1371
|
+
updateAllSizedValues();
|
|
1372
|
+
emitValue(normalized);
|
|
1373
|
+
if (startNormalized)
|
|
1374
|
+
emitError({
|
|
1375
|
+
code: 'disabled_range_start',
|
|
1376
|
+
original: [startOriginal, endOriginal!],
|
|
1377
|
+
normalized,
|
|
1378
|
+
});
|
|
1379
|
+
if (endNormalized)
|
|
1380
|
+
emitError({
|
|
1381
|
+
code: 'disabled_range_end',
|
|
1382
|
+
original: [startOriginal, endOriginal!],
|
|
1383
|
+
normalized,
|
|
1384
|
+
});
|
|
1385
|
+
emitError({ code: 'end_before_start', original, normalized });
|
|
1386
|
+
return;
|
|
1387
|
+
}
|
|
1388
|
+
|
|
1389
|
+
// All valid ────────────────────────────────────────────────────────────────
|
|
1390
|
+
const finalValue: [string, string] = [
|
|
1391
|
+
toOuterValue(effectiveStart),
|
|
1392
|
+
toOuterValue(effectiveEnd),
|
|
1393
|
+
];
|
|
1394
|
+
emitValue(finalValue);
|
|
1395
|
+
if (startNormalized)
|
|
1396
|
+
emitError({
|
|
1397
|
+
code: 'disabled_range_start',
|
|
1398
|
+
original: endOriginal ? [startOriginal, endOriginal] : [startOriginal],
|
|
1399
|
+
normalized: finalValue,
|
|
1400
|
+
});
|
|
1401
|
+
if (endNormalized)
|
|
1402
|
+
emitError({
|
|
1403
|
+
code: 'disabled_range_end',
|
|
1404
|
+
original: [startOriginal, endOriginal!],
|
|
1405
|
+
normalized: finalValue,
|
|
1406
|
+
});
|
|
1407
|
+
};
|
|
1408
|
+
|
|
1409
|
+
onBeforeUnmount(() => {
|
|
1410
|
+
document.removeEventListener('focusin', onDocumentInteraction);
|
|
1411
|
+
document.removeEventListener('click', onDocumentInteraction);
|
|
1412
|
+
});
|
|
1413
|
+
</script>
|
|
1414
|
+
|
|
1415
|
+
<style lang="postcss">
|
|
1416
|
+
@import './index.css';
|
|
1417
|
+
</style>
|
|
1418
|
+
```
|
|
1419
|
+
|
|
1420
|
+
## Types
|
|
1421
|
+
|
|
1422
|
+
```ts
|
|
1423
|
+
import type { HTMLAttributes, InputHTMLAttributes } from 'vue';
|
|
1424
|
+
import type { IconType } from '@/types/Icon';
|
|
1425
|
+
import type { BbOffCanvasProps } from '../BbOffCanvas/types';
|
|
1426
|
+
|
|
1427
|
+
/**
|
|
1428
|
+
* Props for the low-level date-picker input that couples a segmented text field with a popover calendar.
|
|
1429
|
+
* Accepts ISO strings (or `YYYY-MM-DD` when `floating` is true) and can operate in single or range mode.
|
|
1430
|
+
* In both modes users type directly into segmented day / month / year inputs with auto-advance between them.
|
|
1431
|
+
*/
|
|
1432
|
+
export type BaseDatePickerInputProps = {
|
|
1433
|
+
/**
|
|
1434
|
+
* On mobile the calendar opens inside a bottom off-canvas sheet instead of a
|
|
1435
|
+
* floating popover, mirroring the adaptive behaviour of `BbPopover`/`BbSelectPopover`.
|
|
1436
|
+
* When unset, falls back to the global `config.adaptive`.
|
|
1437
|
+
* @defaultValue `config.adaptive` (`true`)
|
|
1438
|
+
*/
|
|
1439
|
+
adaptive?: boolean;
|
|
1440
|
+
|
|
1441
|
+
/**
|
|
1442
|
+
* Extra props forwarded to the `BbOffCanvas` sheet when `adaptive` is active on
|
|
1443
|
+
* mobile (e.g. `title`, `size`, `persistent`).
|
|
1444
|
+
*/
|
|
1445
|
+
offCanvasProps?: Partial<BbOffCanvasProps>;
|
|
1446
|
+
|
|
1447
|
+
/**
|
|
1448
|
+
* Controls whether manual typing is disabled inside the text fields.
|
|
1449
|
+
* Use `'mobile'` to disable typing only on mobile, `'desktop'` to disable typing only on desktop.
|
|
1450
|
+
* Applies to both single and range modes.
|
|
1451
|
+
* @defaultValue `false`
|
|
1452
|
+
*/
|
|
1453
|
+
disableWriting?: boolean | 'mobile' | 'desktop';
|
|
1454
|
+
|
|
1455
|
+
/**
|
|
1456
|
+
* Name of the icon to render at the right hand side of the input.
|
|
1457
|
+
*/
|
|
1458
|
+
|
|
1459
|
+
'append:icon'?: IconType;
|
|
1460
|
+
|
|
1461
|
+
/**
|
|
1462
|
+
* Browser autocomplete hint for the input.
|
|
1463
|
+
* @defaultValue `'off'`
|
|
1464
|
+
*/
|
|
1465
|
+
autocomplete?: InputHTMLAttributes['autocomplete'];
|
|
1466
|
+
|
|
1467
|
+
/**
|
|
1468
|
+
* Additional description id(s) announced by assistive technologies.
|
|
1469
|
+
* Usually provided by an outer input container to link hint/error text.
|
|
1470
|
+
*/
|
|
1471
|
+
ariaDescribedby?: string;
|
|
1472
|
+
|
|
1473
|
+
/**
|
|
1474
|
+
* Focus the first text field automatically when the component mounts.
|
|
1475
|
+
*/
|
|
1476
|
+
autofocus?: InputHTMLAttributes['autofocus'];
|
|
1477
|
+
|
|
1478
|
+
/**
|
|
1479
|
+
* Displays a clear button whenever a value is present and the control is interactive.
|
|
1480
|
+
*/
|
|
1481
|
+
clearable?: boolean;
|
|
1482
|
+
|
|
1483
|
+
/**
|
|
1484
|
+
* Applies the compact density styles to the control.
|
|
1485
|
+
*/
|
|
1486
|
+
compact?: boolean;
|
|
1487
|
+
|
|
1488
|
+
/**
|
|
1489
|
+
* Disables the input, calendar trigger, and popover.
|
|
1490
|
+
*/
|
|
1491
|
+
disabled?: boolean;
|
|
1492
|
+
|
|
1493
|
+
/**
|
|
1494
|
+
* Sets the first day of the week for the calendar (0 = Sunday, 6 = Saturday).
|
|
1495
|
+
*/
|
|
1496
|
+
firstDayOfWeek?: 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
1497
|
+
|
|
1498
|
+
/**
|
|
1499
|
+
* Emit dates formatted as `YYYY-MM-DD` instead of ISO strings.
|
|
1500
|
+
*/
|
|
1501
|
+
floating?: boolean;
|
|
1502
|
+
|
|
1503
|
+
/**
|
|
1504
|
+
* Marks the control as invalid, applying error styles and setting `aria-invalid`.
|
|
1505
|
+
*/
|
|
1506
|
+
hasErrors?: boolean;
|
|
1507
|
+
|
|
1508
|
+
/**
|
|
1509
|
+
* Apply warning styling (same chrome as errors, `--bb-warn` color).
|
|
1510
|
+
* Suppressed when `hasErrors` is also set.
|
|
1511
|
+
*/
|
|
1512
|
+
hasWarning?: boolean;
|
|
1513
|
+
|
|
1514
|
+
/**
|
|
1515
|
+
* Explicit id for the input element. Falls back to an auto-generated `bdpi-<uid>` value.
|
|
1516
|
+
*/
|
|
1517
|
+
id?: HTMLAttributes['id'];
|
|
1518
|
+
|
|
1519
|
+
/**
|
|
1520
|
+
* Shows loading visuals on the input.
|
|
1521
|
+
*/
|
|
1522
|
+
loading?: boolean;
|
|
1523
|
+
|
|
1524
|
+
/**
|
|
1525
|
+
* Maximum selectable date in `YYYY-MM-DD` format — or, with `datetime`,
|
|
1526
|
+
* `YYYY-MM-DDTHH:mm` to tighten the boundary day to a minute. Values
|
|
1527
|
+
* outside both patterns throw during setup to surface configuration
|
|
1528
|
+
* mistakes.
|
|
1529
|
+
*/
|
|
1530
|
+
max?: string;
|
|
1531
|
+
|
|
1532
|
+
/**
|
|
1533
|
+
* Minimum selectable date in `YYYY-MM-DD` format — or, with `datetime`,
|
|
1534
|
+
* `YYYY-MM-DDTHH:mm` to tighten the boundary day to a minute. Values
|
|
1535
|
+
* outside both patterns throw during setup to surface configuration
|
|
1536
|
+
* mistakes.
|
|
1537
|
+
*/
|
|
1538
|
+
min?: string;
|
|
1539
|
+
|
|
1540
|
+
/**
|
|
1541
|
+
* v-model value. Use `null` for empty, a single string for single selection,
|
|
1542
|
+
* or a two-element string array (`[start, end]`) when `range` is true.
|
|
1543
|
+
*/
|
|
1544
|
+
modelValue: string | string[] | null;
|
|
1545
|
+
|
|
1546
|
+
/**
|
|
1547
|
+
* Name attribute forwarded to the native inputs. In single mode fields are named
|
|
1548
|
+
* `${name}-day`, `${name}-month`, `${name}-year`; in range mode they are prefixed
|
|
1549
|
+
* with the segment (`${name}-start-day`, `${name}-end-day`, …).
|
|
1550
|
+
*/
|
|
1551
|
+
name?: InputHTMLAttributes['name'];
|
|
1552
|
+
|
|
1553
|
+
/**
|
|
1554
|
+
* Placeholder text displayed when no value is present. Defaults to the
|
|
1555
|
+
* localized format hint (`baseDatePickerInput.dateFormatSingle` /
|
|
1556
|
+
* `dateFormatRange` — e.g. `MM/DD/YYYY` for `en`, `GG/MM/AAAA` for `it`).
|
|
1557
|
+
*/
|
|
1558
|
+
placeholder?: InputHTMLAttributes['placeholder'];
|
|
1559
|
+
|
|
1560
|
+
/**
|
|
1561
|
+
* Icon name rendered before the input field.
|
|
1562
|
+
*/
|
|
1563
|
+
|
|
1564
|
+
'prepend:icon'?: IconType;
|
|
1565
|
+
|
|
1566
|
+
/**
|
|
1567
|
+
* Enables range selection. When active, v-model expects a two-element array `[start, end]`.
|
|
1568
|
+
* Users can still type into the start and end segments unless `disableWriting` disables typing.
|
|
1569
|
+
*/
|
|
1570
|
+
range?: boolean;
|
|
1571
|
+
|
|
1572
|
+
/**
|
|
1573
|
+
* Makes the text fields read-only and prevents opening the calendar.
|
|
1574
|
+
*/
|
|
1575
|
+
readonly?: boolean;
|
|
1576
|
+
|
|
1577
|
+
/**
|
|
1578
|
+
* Marks the inputs as required to the browser.
|
|
1579
|
+
*/
|
|
1580
|
+
required?: boolean;
|
|
1581
|
+
|
|
1582
|
+
/**
|
|
1583
|
+
* Predicate invoked for each candidate date. Return `false` to disable selection for that value.
|
|
1584
|
+
*/
|
|
1585
|
+
selectable?: (date: string) => boolean;
|
|
1586
|
+
|
|
1587
|
+
/**
|
|
1588
|
+
* Disables the calendar: hides the trigger button and prevents the popover
|
|
1589
|
+
* from opening. Use `'desktop'` to disable it on desktop only (keyboard-first
|
|
1590
|
+
* there, calendar-first on mobile — complementing `disableWriting: 'mobile'`)
|
|
1591
|
+
* or `'mobile'` to disable it on mobile only. An error is thrown if both
|
|
1592
|
+
* writing and the calendar would be unavailable on the same platform.
|
|
1593
|
+
*
|
|
1594
|
+
* @defaultValue `false`
|
|
1595
|
+
*/
|
|
1596
|
+
disableCalendar?: boolean | 'mobile' | 'desktop';
|
|
1597
|
+
|
|
1598
|
+
/**
|
|
1599
|
+
* Adds time selection beside date selection: `HH:mm` segments in the text
|
|
1600
|
+
* field (24-hour) and time columns under the calendar. A picked or typed
|
|
1601
|
+
* date with a blank time commits at `00:00`. Non-floating values carry the
|
|
1602
|
+
* time inside `modelValue`; with `floating` the date string stays plain and
|
|
1603
|
+
* the time travels only through `v-model:time`.
|
|
1604
|
+
*/
|
|
1605
|
+
datetime?: boolean;
|
|
1606
|
+
|
|
1607
|
+
/**
|
|
1608
|
+
* 12-hour display with an AM/PM segment (requires `datetime`). Purely a
|
|
1609
|
+
* field-composition concern: `modelValue` and the `time` model stay 24-hour
|
|
1610
|
+
* regardless. Type `A`/`P` (or ArrowUp/Down) to set the meridiem.
|
|
1611
|
+
*/
|
|
1612
|
+
ampm?: boolean;
|
|
1613
|
+
|
|
1614
|
+
/**
|
|
1615
|
+
* Adds the seconds segment (requires `datetime`). Without it, an incoming
|
|
1616
|
+
* value carrying seconds displays truncated and is left untouched until the
|
|
1617
|
+
* user commits an edit, at which point seconds zero out.
|
|
1618
|
+
*/
|
|
1619
|
+
seconds?: boolean;
|
|
1620
|
+
|
|
1621
|
+
/**
|
|
1622
|
+
* Minute granularity for the calendar's minute column and arrow stepping
|
|
1623
|
+
* (requires `datetime`). Constrains what the component produces, never what
|
|
1624
|
+
* it accepts: a typed off-grid value (e.g. `10:07` with `step: 15`) is
|
|
1625
|
+
* emitted verbatim, and no column row highlights for it.
|
|
1626
|
+
* @defaultValue `1`
|
|
1627
|
+
*/
|
|
1628
|
+
step?: number;
|
|
1629
|
+
|
|
1630
|
+
/**
|
|
1631
|
+
* Companion model for the time part (`v-model:time`), always 24-hour
|
|
1632
|
+
* `HH:mm` / `HH:mm:ss` regardless of display. With `floating` it is the
|
|
1633
|
+
* only carrier of the time; otherwise it mirrors the time inside
|
|
1634
|
+
* `modelValue` (same digits) and writing it rewrites the model's time part.
|
|
1635
|
+
* Requires `datetime`.
|
|
1636
|
+
*/
|
|
1637
|
+
time?: string | string[] | null;
|
|
1638
|
+
|
|
1639
|
+
/**
|
|
1640
|
+
* Emits values as UTC ISO strings (`...Z`) instead of ISO strings carrying
|
|
1641
|
+
* the local offset (`...+01:00`). Emission-only: incoming values are parsed
|
|
1642
|
+
* identically either way, so the prop can be added or removed without
|
|
1643
|
+
* touching stored values. Fields always display local time — UTC is a
|
|
1644
|
+
* backend concern. Ignored when `floating` is set (a plain date has no zone).
|
|
1645
|
+
*/
|
|
1646
|
+
utc?: boolean;
|
|
1647
|
+
|
|
1648
|
+
/**
|
|
1649
|
+
* Transition duration, in milliseconds, for the popover appearance.
|
|
1650
|
+
*/
|
|
1651
|
+
transitionDuration?: number;
|
|
1652
|
+
};
|
|
1653
|
+
|
|
1654
|
+
/**
|
|
1655
|
+
* Structured payload carried by every `error` event.
|
|
1656
|
+
*
|
|
1657
|
+
* | `code` | Trigger | `original` | `normalized` |
|
|
1658
|
+
* |------------------------|------------------------------------|------------------------------|-------------------------------------------------------|
|
|
1659
|
+
* | `disabled_date` | Typed single date is disabled | The disabled date | Snapped to `min`/`max`, or `null` if not normalizable |
|
|
1660
|
+
* | `disabled_range_start` | Typed range start is disabled | `[start]` or `[start, end]` | Snapped range, or `null` if start is not normalizable |
|
|
1661
|
+
* | `disabled_range_end` | Typed range end is disabled | `[start, end]` | Snapped range (length 1 or 2), or `null` |
|
|
1662
|
+
* | `end_before_start` | Typed end is chronologically first | `[start, end]` (wrong order) | `[end, start]` — always the swapped pair |
|
|
1663
|
+
*/
|
|
1664
|
+
export type DatePickerInputError =
|
|
1665
|
+
| {
|
|
1666
|
+
code: 'disabled_date';
|
|
1667
|
+
/** The value the user typed before normalization. */
|
|
1668
|
+
original: string;
|
|
1669
|
+
/** Snapped to the nearest `min`/`max` boundary, or `null` if disabled by `selectable`. */
|
|
1670
|
+
normalized: string | null;
|
|
1671
|
+
}
|
|
1672
|
+
| {
|
|
1673
|
+
code: 'disabled_range_start';
|
|
1674
|
+
/** The range value before normalization (may be `[start]` or `[start, end]`). */
|
|
1675
|
+
original: string[];
|
|
1676
|
+
/** Snapped range, or `null` if start could not be normalized. */
|
|
1677
|
+
normalized: string[] | null;
|
|
1678
|
+
}
|
|
1679
|
+
| {
|
|
1680
|
+
code: 'disabled_range_end';
|
|
1681
|
+
/** The full range before normalization. */
|
|
1682
|
+
original: [string, string];
|
|
1683
|
+
/** Range with end snapped, or `[start]` if end could not be normalized. */
|
|
1684
|
+
normalized: string[] | null;
|
|
1685
|
+
}
|
|
1686
|
+
| {
|
|
1687
|
+
code: 'end_before_start';
|
|
1688
|
+
/** `[start, end]` in the order the user typed them. */
|
|
1689
|
+
original: [string, string];
|
|
1690
|
+
/** `[end, start]` — the chronologically corrected pair. */
|
|
1691
|
+
normalized: [string, string];
|
|
1692
|
+
};
|
|
1693
|
+
|
|
1694
|
+
export type BaseDatePickerInputEvents = {
|
|
1695
|
+
/**
|
|
1696
|
+
* Emitted when the composite control receives focus (first focusin after being inactive).
|
|
1697
|
+
*/
|
|
1698
|
+
(e: 'active'): void;
|
|
1699
|
+
/**
|
|
1700
|
+
* Emitted alongside every value normalization or removal when the typed date is invalid or out of range.
|
|
1701
|
+
* See `DatePickerInputError` for the full code map and payload shapes.
|
|
1702
|
+
*/
|
|
1703
|
+
(e: 'error', error: DatePickerInputError): void;
|
|
1704
|
+
/**
|
|
1705
|
+
* Emitted when a native text field inside the control gains focus.
|
|
1706
|
+
* Forwards the original DOM `FocusEvent`.
|
|
1707
|
+
*/
|
|
1708
|
+
(e: 'focus', event: FocusEvent): void;
|
|
1709
|
+
/**
|
|
1710
|
+
* Emitted when focus/click moves outside the entire composite control.
|
|
1711
|
+
*/
|
|
1712
|
+
(e: 'inactive'): void;
|
|
1713
|
+
/**
|
|
1714
|
+
* Emitted whenever the selected date value changes.
|
|
1715
|
+
* Payload is `null` for cleared values, a single string for single-date mode,
|
|
1716
|
+
* or a two-element array for range mode.
|
|
1717
|
+
*/
|
|
1718
|
+
(e: 'update:modelValue', value: BaseDatePickerInputProps['modelValue']): void;
|
|
1719
|
+
/**
|
|
1720
|
+
* Companion time model (`v-model:time`), emitted alongside every value
|
|
1721
|
+
* change while `datetime` is on. Always 24-hour `HH:mm` (or `HH:mm:ss` with
|
|
1722
|
+
* `seconds`); `null` when cleared, an array in range mode.
|
|
1723
|
+
*/
|
|
1724
|
+
(e: 'update:time', value: string | string[] | null): void;
|
|
1725
|
+
};
|
|
1726
|
+
|
|
1727
|
+
export type BaseDatePickerInputSlots = {
|
|
1728
|
+
/**
|
|
1729
|
+
* Replaces the day button label inside each calendar day.
|
|
1730
|
+
*/
|
|
1731
|
+
day?: (props: {
|
|
1732
|
+
first: boolean;
|
|
1733
|
+
highlighted: boolean;
|
|
1734
|
+
item: any;
|
|
1735
|
+
label: string;
|
|
1736
|
+
last: boolean;
|
|
1737
|
+
middle: boolean;
|
|
1738
|
+
selected: boolean;
|
|
1739
|
+
}) => any;
|
|
1740
|
+
/**
|
|
1741
|
+
* Appends content below each calendar day.
|
|
1742
|
+
*/
|
|
1743
|
+
'append:day'?: (props: {
|
|
1744
|
+
first: boolean;
|
|
1745
|
+
highlighted: boolean;
|
|
1746
|
+
item: any;
|
|
1747
|
+
label: string;
|
|
1748
|
+
last: boolean;
|
|
1749
|
+
middle: boolean;
|
|
1750
|
+
selected: boolean;
|
|
1751
|
+
}) => any;
|
|
1752
|
+
/**
|
|
1753
|
+
* Content rendered before the entire input control, outside the input chrome.
|
|
1754
|
+
*/
|
|
1755
|
+
'prepend-outer'?: (props: object) => any;
|
|
1756
|
+
/**
|
|
1757
|
+
* Content rendered before the date fields, at the start of the inner container.
|
|
1758
|
+
*/
|
|
1759
|
+
prepend?: (props: object) => any;
|
|
1760
|
+
/**
|
|
1761
|
+
* Inline content rendered at the start of the input field area, before the date fields.
|
|
1762
|
+
*/
|
|
1763
|
+
prefix?: (props: object) => any;
|
|
1764
|
+
/**
|
|
1765
|
+
* Content rendered after the date fields, at the end of the inner container (before the calendar toggle button).
|
|
1766
|
+
*/
|
|
1767
|
+
append?: (props: object) => any;
|
|
1768
|
+
/**
|
|
1769
|
+
* Content rendered after the entire input control, outside the input chrome.
|
|
1770
|
+
*/
|
|
1771
|
+
'append-outer'?: (props: object) => any;
|
|
1772
|
+
/**
|
|
1773
|
+
* Inline content rendered at the end of the input field area, after the date fields.
|
|
1774
|
+
*/
|
|
1775
|
+
suffix?: (props: object) => any;
|
|
1776
|
+
};
|
|
1777
|
+
```
|
|
1778
|
+
|
|
1779
|
+
## Styles
|
|
1780
|
+
|
|
1781
|
+
```css
|
|
1782
|
+
/* The segmented-field chrome is shared with BbBaseTimePickerInput — see
|
|
1783
|
+
./segmented-fields.css. Only date-input-specific rules would live here. */
|
|
1784
|
+
@import './segmented-fields.css';
|
|
1785
|
+
```
|