bitboss-ui 3.0.0-beta.74 → 3.0.0-beta.76
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -5
- package/bin/cli.mjs +16 -10
- package/dist/ai/BbAlert.md +1 -1
- package/dist/ai/BbAvatar.md +86 -58
- package/dist/ai/BbBadge.md +1 -1
- package/dist/ai/BbBreadcrumbs.md +3 -3
- package/dist/ai/BbButton.md +4 -4
- package/dist/ai/BbCalendar.md +5 -2
- package/dist/ai/BbCheckboxGroup.md +5 -4
- package/dist/ai/BbColorInput.md +13 -1
- package/dist/ai/BbColorPalette.md +12 -7
- package/dist/ai/BbConfirm.md +1 -1
- package/dist/ai/BbDatePicker.md +13 -1
- package/dist/ai/BbDatePickerInput.md +18 -2
- package/dist/ai/BbDialog.md +6 -3
- package/dist/ai/BbDropdown.md +174 -77
- package/dist/ai/BbDropdownButton.md +37 -16
- package/dist/ai/BbGallery.md +3 -2
- package/dist/ai/BbIcon.md +10 -10
- package/dist/ai/BbNumberInput.md +3 -1
- package/dist/ai/BbOffCanvas.md +3 -2
- package/dist/ai/BbPopover.md +1 -1
- package/dist/ai/BbRadioGroup.md +4 -4
- package/dist/ai/BbSelect.md +227 -105
- package/dist/ai/BbSelectPopover.md +139 -14
- package/dist/ai/BbSwitchGroup.md +5 -4
- package/dist/ai/BbTable.md +18 -17
- package/dist/ai/BbTimePicker.md +13 -1
- package/dist/ai/BbTimePickerInput.md +16 -2
- package/dist/ai/BbToast.md +3 -2
- package/dist/ai/BbTree.md +5 -1
- package/dist/ai/CommonPopover.md +1 -0
- package/dist/ai/FlatListBox.md +1 -0
- package/dist/ai/GroupedListBox.md +3 -2
- package/dist/ai/ListBox.md +4 -2
- package/dist/ai/OptionsContainer.md +4 -4
- package/dist/ai/changelog.json +310 -7
- package/dist/ai/components.json +33 -35
- package/dist/ai/composables/useToast.md +2 -2
- package/dist/ai/design-tokens.json +60 -0
- package/dist/ai/guides/agent-contract.md +9 -5
- package/dist/ai/guides/calendars-and-digits.md +1 -1
- package/dist/ai/guides/design-tokens.md +13 -0
- package/dist/ai/guides/eslint-rules.md +1 -1
- package/dist/ai/guides/fetch-items-playbook.md +7 -11
- package/dist/ai/guides/icons-policy.md +32 -11
- package/dist/ai/guides/installation-and-plugin-setup.md +24 -23
- package/dist/ai/guides/migration/adoption-checklist.md +1 -1
- package/dist/ai/guides/migration/components/bb-color-palette.md +11 -11
- package/dist/ai/guides/migration/components/bb-dropdown-button.md +1 -0
- package/dist/ai/guides/migration/components/bb-dropdown.md +1 -0
- package/dist/ai/guides/migration/components/bb-icon.md +4 -4
- package/dist/ai/guides/migration/components/bb-table.md +2 -1
- package/dist/ai/guides/migration/components/bb-toast.md +2 -2
- package/dist/ai/guides/migration/v2-to-v3.md +70 -24
- package/dist/ai/guides/migration/v3-beta-css-classes.md +18 -3
- package/dist/ai/guides/migration/v3-beta-tooling.md +1 -0
- package/dist/ai/guides/passthrough.md +58 -58
- package/dist/ai/helpers/inertia/manifest.json +1 -1
- package/dist/ai/index.md +1 -1
- package/dist/ai/manifest/common.json +1 -0
- package/dist/ai/manifest/components/BbAvatar.json +5 -2
- package/dist/ai/manifest/components/BbAvatar.tree.json +32 -2
- package/dist/ai/manifest/components/BbCarousel.json +0 -3
- package/dist/ai/manifest/components/BbCheckboxGroup.json +2 -2
- package/dist/ai/manifest/components/BbCheckboxGroup.tree.json +2 -0
- package/dist/ai/manifest/components/BbColorInput.json +5 -2
- package/dist/ai/manifest/components/BbColorPalette.json +5 -2
- package/dist/ai/manifest/components/BbColorPalette.removed.json +1 -2
- package/dist/ai/manifest/components/BbDatePicker.json +3 -0
- package/dist/ai/manifest/components/BbDatePickerInput.json +3 -0
- package/dist/ai/manifest/components/BbDialog.tree.json +3 -1
- package/dist/ai/manifest/components/BbDropdown.json +36 -28
- package/dist/ai/manifest/components/BbDropdown.removed.json +2 -1
- package/dist/ai/manifest/components/BbDropdown.tree.json +21 -11
- package/dist/ai/manifest/components/BbDropdownButton.json +24 -16
- package/dist/ai/manifest/components/BbDropdownButton.removed.json +2 -1
- package/dist/ai/manifest/components/BbDropdownButton.tree.json +4 -0
- package/dist/ai/manifest/components/BbGallery.tree.json +1 -1
- package/dist/ai/manifest/components/BbOffCanvas.tree.json +3 -1
- package/dist/ai/manifest/components/BbRadioGroup.json +2 -2
- package/dist/ai/manifest/components/BbRadioGroup.tree.json +2 -0
- package/dist/ai/manifest/components/BbSelect.json +47 -40
- package/dist/ai/manifest/components/BbSelect.tree.json +2 -1
- package/dist/ai/manifest/components/BbSelectPopover.json +14 -7
- package/dist/ai/manifest/components/BbSelectPopover.tree.json +9 -2
- package/dist/ai/manifest/components/BbSwitchGroup.json +2 -2
- package/dist/ai/manifest/components/BbSwitchGroup.tree.json +2 -0
- package/dist/ai/manifest/components/BbTable.json +6 -6
- package/dist/ai/manifest/components/BbTable.tree.json +9 -1
- package/dist/ai/manifest/components/BbTimePicker.json +5 -2
- package/dist/ai/manifest/components/BbTimePickerInput.json +5 -2
- package/dist/ai/manifest/components/BbTree.json +1 -1
- package/dist/ai/manifest/components/CommonPopover.json +1 -0
- package/dist/ai/manifest/components/FlatListBox.json +2 -1
- package/dist/ai/manifest/components/GroupedListBox.json +3 -2
- package/dist/ai/manifest/components/GroupedListBox.tree.json +1 -0
- package/dist/ai/manifest/components/ListBox.json +3 -2
- package/dist/ai/manifest/components/ListBox.tree.json +1 -1
- package/dist/ai/manifest/components/OptionsContainer.json +6 -4
- package/dist/ai/manifest/index.json +2 -2
- package/dist/ai/manifest/meta.json +0 -3
- package/dist/ai/manifest/types.advanced.json +6 -6
- package/dist/ai/manifest/types.api.json +1 -3
- package/dist/ai/recipes/inertia/inline-edit-workspace.md +1 -1
- package/dist/ai/recipes/inertia/onboarding.md +1 -1
- package/dist/ai/recipes/nuxt/inline-edit-workspace.md +1 -1
- package/dist/ai/recipes/nuxt/onboarding.md +1 -1
- package/dist/ai/recipes/vue/inline-edit-workspace.md +1 -1
- package/dist/ai/recipes/vue/onboarding.md +2 -2
- package/dist/ai/source/BbAccordion.md +4 -5
- package/dist/ai/source/BbAvatar.md +128 -11
- package/dist/ai/source/BbBadge.md +18 -7
- package/dist/ai/source/BbBreadcrumbs.md +57 -56
- package/dist/ai/source/BbButton.md +41 -25
- package/dist/ai/source/BbCalendar.md +8 -6
- package/dist/ai/source/BbCarousel.md +41 -34
- package/dist/ai/source/BbCheckboxGroup.md +15 -9
- package/dist/ai/source/BbColorInput.md +19 -0
- package/dist/ai/source/BbColorPalette.md +23 -2
- package/dist/ai/source/BbDatePicker.md +18 -0
- package/dist/ai/source/BbDatePickerInput.md +47 -3
- package/dist/ai/source/BbDialog.md +14 -1
- package/dist/ai/source/BbDropdown.md +296 -99
- package/dist/ai/source/BbDropdownButton.md +61 -19
- package/dist/ai/source/BbDropdownGroup.md +189 -98
- package/dist/ai/source/BbGallery.md +82 -60
- package/dist/ai/source/BbHost.md +12 -0
- package/dist/ai/source/BbNumberInput.md +17 -10
- package/dist/ai/source/BbOffCanvas.md +14 -1
- package/dist/ai/source/BbPagination.md +12 -28
- package/dist/ai/source/BbRadioGroup.md +12 -5
- package/dist/ai/source/BbRating.md +4 -4
- package/dist/ai/source/BbSelect.md +151 -112
- package/dist/ai/source/BbSelectPopover.md +244 -29
- package/dist/ai/source/BbSwitchGroup.md +11 -4
- package/dist/ai/source/BbTable.md +114 -35
- package/dist/ai/source/BbTimePicker.md +19 -0
- package/dist/ai/source/BbTimePickerInput.md +21 -2
- package/dist/ai/source/BbToast.md +2 -2
- package/dist/ai/source/BbToastPortal.md +2 -2
- package/dist/ai/source/BbTree.md +1 -1
- package/dist/ai/source/ClearableButton.md +4 -2
- package/dist/ai/source/CommonPopover.md +24 -1
- package/dist/ai/source/ErrorIcon.md +4 -3
- package/dist/ai/source/FlatListBox.md +33 -7
- package/dist/ai/source/GroupedListBox.md +85 -14
- package/dist/ai/source/ListBox.md +11 -1
- package/dist/ai/source/OptionsContainer.md +29 -11
- package/dist/ai/source/WarningIcon.md +4 -3
- package/dist/assets/svgs/close.svg_raw.js +1 -1
- package/dist/components/BbAccordion/BbAccordion.vue.d.ts +1 -1
- package/dist/components/BbAccordion/BbAccordion.vue_vue_type_script_setup_true_lang.js +35 -34
- package/dist/components/BbAvatar/BbAvatar.vue.d.ts +1 -0
- package/dist/components/BbAvatar/BbAvatar.vue_vue_type_script_setup_true_lang.js +62 -43
- package/dist/components/BbAvatar/avatarIdentity.js +25 -0
- package/dist/components/BbAvatar/ptKeys.generated.d.ts +5 -1
- package/dist/components/BbAvatar/types.d.ts +24 -5
- package/dist/components/BbAvatar/types.js +5 -1
- package/dist/components/BbBadge/BadgeBodyContent.vue_vue_type_script_setup_true_lang.js +24 -23
- package/dist/components/BbBadge/BbBadge.vue_vue_type_script_setup_true_lang.js +66 -64
- package/dist/components/BbBreadcrumbs/BbBreadcrumbs.vue_vue_type_script_setup_true_lang.js +141 -146
- package/dist/components/BbButton/BbButton.vue_vue_type_script_setup_true_lang.js +100 -85
- package/dist/components/BbCalendar/BbCalendar.vue.d.ts +1 -1
- package/dist/components/BbCalendar/BbCalendar.vue_vue_type_script_setup_true_lang.js +240 -239
- package/dist/components/BbCalendar/useDayGrid.js +120 -123
- package/dist/components/BbCarousel/BbCarousel.vue_vue_type_script_setup_true_lang.js +503 -502
- package/dist/components/BbCheckboxGroup/BbCheckboxGroup.vue.d.ts +4 -4
- package/dist/components/BbCheckboxGroup/BbCheckboxGroup.vue_vue_type_script_setup_true_lang.js +126 -122
- package/dist/components/BbCheckboxGroup/types.d.ts +7 -11
- package/dist/components/BbColorInput/BbColorInput.vue.d.ts +2 -0
- package/dist/components/BbColorInput/BbColorInput.vue_vue_type_script_setup_true_lang.js +148 -141
- package/dist/components/BbColorInput/types.d.ts +7 -0
- package/dist/components/BbColorPalette/BbColorPalette.vue.d.ts +2 -0
- package/dist/components/BbColorPalette/BbColorPalette.vue_vue_type_script_setup_true_lang.js +208 -196
- package/dist/components/BbColorPalette/types.d.ts +7 -0
- package/dist/components/BbDatePicker/BbDatePicker.vue.d.ts +3 -1
- package/dist/components/BbDatePicker/BbDatePicker.vue_vue_type_script_setup_true_lang.js +84 -73
- package/dist/components/BbDatePicker/types.d.ts +7 -0
- package/dist/components/BbDatePickerInput/BbDatePickerInput.vue.d.ts +4 -2
- package/dist/components/BbDatePickerInput/BbDatePickerInput.vue_vue_type_script_setup_true_lang.js +496 -510
- package/dist/components/BbDatePickerInput/types.d.ts +7 -0
- package/dist/components/BbDialog/BbDialog.vue_vue_type_script_setup_true_lang.js +219 -211
- package/dist/components/BbDialog/leaveGhost.js +22 -17
- package/dist/components/BbDropdown/AdaptiveDropdown.vue_vue_type_script_setup_true_lang.js +106 -100
- package/dist/components/BbDropdown/BbDropdown.vue.d.ts +3 -0
- package/dist/components/BbDropdown/BbDropdown.vue_vue_type_script_setup_true_lang.js +416 -369
- package/dist/components/BbDropdown/BbDropdownList.vue_vue_type_script_setup_true_lang.js +404 -354
- package/dist/components/BbDropdown/DropdownFailures.vue.js +4 -0
- package/dist/components/BbDropdown/DropdownFailures.vue_vue_type_script_setup_true_lang.js +24 -0
- package/dist/components/BbDropdown/DropdownPipelineResolver.vue_vue_type_script_setup_true_lang.js +117 -102
- package/dist/components/BbDropdown/DropdownRow.vue_vue_type_script_setup_true_lang.js +67 -38
- package/dist/components/BbDropdown/normalizeGroups.js +6 -2
- package/dist/components/BbDropdown/ptKeys.generated.d.ts +44 -20
- package/dist/components/BbDropdown/types.d.ts +109 -87
- package/dist/components/BbDropdown/types.js +3 -0
- package/dist/components/BbDropdownButton/BbDropdownButton.vue.d.ts +3 -1
- package/dist/components/BbDropdownButton/BbDropdownButton.vue_vue_type_script_setup_true_lang.js +101 -65
- package/dist/components/BbDropdownButton/ptKeys.generated.d.ts +153 -57
- package/dist/components/BbDropdownButton/types.d.ts +23 -10
- package/dist/components/BbDropdownButton/types.js +4 -0
- package/dist/components/BbDropzone/BbDropzone.vue.d.ts +1 -1
- package/dist/components/BbGallery/BbGallery.vue_vue_type_script_setup_true_lang.js +335 -312
- package/dist/components/BbHost/BbHost.vue_vue_type_script_setup_true_lang.js +7 -1
- package/dist/components/BbIcon/iconCache.js +1 -1
- package/dist/components/BbNumberInput/BbNumberInput.vue.d.ts +1 -1
- package/dist/components/BbNumberInput/BbNumberInput.vue_vue_type_script_setup_true_lang.js +9 -5
- package/dist/components/BbOffCanvas/BbOffCanvas.vue_vue_type_script_setup_true_lang.js +152 -144
- package/dist/components/BbPagination/BbPagination.vue.d.ts +2 -2
- package/dist/components/BbPagination/BbPagination.vue_vue_type_script_setup_true_lang.js +138 -136
- package/dist/components/BbProgress/BbProgress.vue.d.ts +1 -1
- package/dist/components/BbRadioGroup/BbRadioGroup.vue.d.ts +4 -4
- package/dist/components/BbRadioGroup/BbRadioGroup.vue_vue_type_script_setup_true_lang.js +108 -104
- package/dist/components/BbRadioGroup/types.d.ts +4 -7
- package/dist/components/BbRating/BbRating.vue.d.ts +1 -1
- package/dist/components/BbRating/BbRating.vue_vue_type_script_setup_true_lang.js +100 -99
- package/dist/components/BbSelect/BbSelect.vue.d.ts +32 -20
- package/dist/components/BbSelect/BbSelect.vue_vue_type_script_setup_true_lang.js +217 -196
- package/dist/components/BbSelect/ptKeys.generated.d.ts +128 -96
- package/dist/components/BbSelect/types.d.ts +110 -111
- package/dist/components/BbSelect/types.js +1 -27
- package/dist/components/BbSelectPopover/BbSelectPopover.vue.d.ts +8 -3
- package/dist/components/BbSelectPopover/BbSelectPopover.vue_vue_type_script_setup_true_lang.js +728 -653
- package/dist/components/BbSelectPopover/ptKeys.generated.d.ts +22 -10
- package/dist/components/BbSelectPopover/types.d.ts +32 -17
- package/dist/components/BbSelectPopover/types.js +3 -1
- package/dist/components/BbSwitchGroup/BbSwitchGroup.vue.d.ts +1 -1
- package/dist/components/BbSwitchGroup/BbSwitchGroup.vue_vue_type_script_setup_true_lang.js +159 -155
- package/dist/components/BbSwitchGroup/types.d.ts +3 -6
- package/dist/components/BbTable/BbTable.vue.d.ts +2 -4
- package/dist/components/BbTable/BbTable.vue_vue_type_script_setup_true_lang.js +1171 -1152
- package/dist/components/BbTable/BbTableDataRow.js +97 -90
- package/dist/components/BbTable/types.d.ts +11 -10
- package/dist/components/BbTabs/BbTabs.vue.d.ts +3 -3
- package/dist/components/BbTimePicker/BbTimePicker.vue.d.ts +4 -2
- package/dist/components/BbTimePicker/BbTimePicker.vue_vue_type_script_setup_true_lang.js +145 -134
- package/dist/components/BbTimePicker/types.d.ts +7 -0
- package/dist/components/BbTimePickerInput/BbTimePickerInput.vue.d.ts +4 -2
- package/dist/components/BbTimePickerInput/BbTimePickerInput.vue_vue_type_script_setup_true_lang.js +290 -280
- package/dist/components/BbTimePickerInput/types.d.ts +7 -0
- package/dist/components/BbToast/BbToastMessage.vue_vue_type_script_setup_true_lang.js +79 -78
- package/dist/components/BbToast/types.d.ts +2 -2
- package/dist/components/BbTree/BbTreeLevel.vue_vue_type_script_setup_true_lang.js +56 -46
- package/dist/components/BbTree/types.d.ts +1 -1
- package/dist/components/ClearableButton/ClearableButton.vue_vue_type_script_setup_true_lang.js +9 -8
- package/dist/components/CloseIcon/CloseButton.vue.js +1 -1
- package/dist/components/CloseIcon/CloseButton.vue_vue_type_script_setup_true_lang.js +9 -7
- package/dist/components/CommonPopover/CommonPopover.vue_vue_type_script_setup_true_lang.js +13 -1
- package/dist/components/ErrorIcon/ErrorIcon.vue_vue_type_script_setup_true_lang.js +8 -6
- package/dist/components/FlatListBox/FlatListBox.vue_vue_type_script_setup_true_lang.js +122 -102
- package/dist/components/GroupedListBox/GroupedListBox.vue_vue_type_script_setup_true_lang.js +182 -153
- package/dist/components/ListBox/ListBox.vue_vue_type_script_setup_true_lang.js +7 -4
- package/dist/components/OptionsContainer/OptionsContainer.vue_vue_type_script_setup_true_lang.js +86 -77
- package/dist/components/WarningIcon/WarningIcon.vue_vue_type_script_setup_true_lang.js +8 -6
- package/dist/composables/useInternalIcon.js +25 -0
- package/dist/composables/useItemsGetter.js +34 -32
- package/dist/composables/useOpenModel.js +20 -0
- package/dist/deprecation/ai-deprecations.json.js +1 -1
- package/dist/i18n/locales/ar.json +2 -0
- package/dist/i18n/locales/cs.json +2 -0
- package/dist/i18n/locales/da.json +2 -0
- package/dist/i18n/locales/de-CH.json +2 -0
- package/dist/i18n/locales/de.json +2 -0
- package/dist/i18n/locales/el.json +2 -0
- package/dist/i18n/locales/en-GB.json +2 -0
- package/dist/i18n/locales/en.json +2 -0
- package/dist/i18n/locales/es-MX.json +2 -0
- package/dist/i18n/locales/es.json +2 -0
- package/dist/i18n/locales/fa.json +2 -0
- package/dist/i18n/locales/fi.json +2 -0
- package/dist/i18n/locales/fr.json +2 -0
- package/dist/i18n/locales/he.json +2 -0
- package/dist/i18n/locales/hu.json +2 -0
- package/dist/i18n/locales/it.json +2 -0
- package/dist/i18n/locales/ja.json +2 -0
- package/dist/i18n/locales/ko.json +2 -0
- package/dist/i18n/locales/nb.json +2 -0
- package/dist/i18n/locales/nl.json +2 -0
- package/dist/i18n/locales/pl.json +2 -0
- package/dist/i18n/locales/pt-BR.json +2 -0
- package/dist/i18n/locales/pt-PT.json +2 -0
- package/dist/i18n/locales/ro.json +2 -0
- package/dist/i18n/locales/ru.json +2 -0
- package/dist/i18n/locales/sv.json +2 -0
- package/dist/i18n/locales/tr.json +2 -0
- package/dist/i18n/locales/uk.json +2 -0
- package/dist/i18n/locales/zh-CN.json +2 -0
- package/dist/i18n/locales/zh-HK.json +2 -0
- package/dist/i18n/locales/zh-TW.json +2 -0
- package/dist/icon-scan.d.ts +1 -1
- package/dist/icon-scan.js +68 -61
- package/dist/index.d.ts +2 -2
- package/dist/llms-full.txt +1038 -451
- package/dist/llms-medium.txt +33 -28
- package/dist/llms.txt +2 -2
- package/dist/locale-blueprint.json +2 -0
- package/dist/nuxt.js +1 -1
- package/dist/styles.css +2 -2
- package/dist/types/ActionButton.d.ts +2 -3
- package/dist/types/Config.d.ts +8 -1
- package/dist/types/ConfigDefaults.d.ts +10 -2
- package/dist/types/Option.d.ts +10 -0
- package/dist/types/internalIcons.d.ts +89 -0
- package/dist/types/internalIcons.js +158 -0
- package/dist/types/ptComponentMap.d.ts +5 -5
- package/dist/utilities/functions/slotContent.js +19 -0
- package/dist/utils/configDefaults.js +75 -64
- package/dist/utils/iconsOption.js +48 -0
- package/dist/utils/loadRetry.js +8 -0
- package/dist/utils/versionCheck.js +1 -1
- package/dist/vite-plugin.d.ts +10 -16
- package/dist/vite.js +323 -307
- package/llms.txt +2 -2
- package/package.json +3 -1
- package/scripts/README.md +2 -0
- package/scripts/lib/adoption-checklist.json +1 -1
- package/scripts/lib/agent-setup.mjs +44 -26
- package/scripts/lib/update-install.mjs +48 -0
- package/scripts/lib/validate-bb-markup.mjs +93 -12
- package/dist/ai/manifest/components/BbAvatar.removed.json +0 -6
- package/dist/assets/svgs/caret_down.svg_raw.js +0 -3
|
@@ -166,29 +166,44 @@
|
|
|
166
166
|
name="slide:header"
|
|
167
167
|
/>
|
|
168
168
|
<component :is="entry.node" v-if="entry.node" />
|
|
169
|
+
<!-- The built-in image is the slot's fallback, so a `slide` slot
|
|
170
|
+
that renders nothing for an item (a `v-if` false) keeps it. -->
|
|
169
171
|
<slot
|
|
170
|
-
v-else
|
|
172
|
+
v-else
|
|
171
173
|
:active="isActive(entry.real)"
|
|
172
174
|
:current="isCurrent(entry.real)"
|
|
173
175
|
:index="entry.real"
|
|
174
176
|
:item="entry.item as T"
|
|
175
177
|
name="slide"
|
|
176
|
-
/>
|
|
177
|
-
<!-- A picker's built-in image is a button (the thumbs are the
|
|
178
|
-
control): named by the image, `aria-current` on the current
|
|
179
|
-
one. Its click picks through the track's, like any slide
|
|
180
|
-
click; inert and clone slides take it out of reach with them.
|
|
181
|
-
`slide` slot content is never wrapped. -->
|
|
182
|
-
<button
|
|
183
|
-
v-else-if="props.picker && imageOf(entry.item)"
|
|
184
|
-
:aria-current="isCurrent(entry.real) || undefined"
|
|
185
|
-
:aria-label="thumbLabel(entry.item, entry.real)"
|
|
186
|
-
class="bb-carousel__thumb"
|
|
187
|
-
type="button"
|
|
188
|
-
v-bind="passthrough.thumb"
|
|
189
178
|
>
|
|
179
|
+
<!-- A picker's built-in image is a button (the thumbs are the
|
|
180
|
+
control): named by the image, `aria-current` on the current
|
|
181
|
+
one. Its click picks through the track's, like any slide
|
|
182
|
+
click; inert and clone slides take it out of reach with them.
|
|
183
|
+
`slide` slot content is never wrapped. -->
|
|
184
|
+
<button
|
|
185
|
+
v-if="props.picker && imageOf(entry.item)"
|
|
186
|
+
:aria-current="isCurrent(entry.real) || undefined"
|
|
187
|
+
:aria-label="thumbLabel(entry.item, entry.real)"
|
|
188
|
+
class="bb-carousel__thumb"
|
|
189
|
+
type="button"
|
|
190
|
+
v-bind="passthrough.thumb"
|
|
191
|
+
>
|
|
192
|
+
<img
|
|
193
|
+
alt=""
|
|
194
|
+
class="bb-carousel__image"
|
|
195
|
+
decoding="async"
|
|
196
|
+
draggable="false"
|
|
197
|
+
:loading="near(entry.real) ? undefined : 'lazy'"
|
|
198
|
+
:sizes="imageOf(entry.item)!.sizes"
|
|
199
|
+
:src="imageOf(entry.item)!.src"
|
|
200
|
+
:srcset="imageOf(entry.item)!.srcset"
|
|
201
|
+
v-bind="passthrough.image"
|
|
202
|
+
/>
|
|
203
|
+
</button>
|
|
190
204
|
<img
|
|
191
|
-
|
|
205
|
+
v-else-if="imageOf(entry.item)"
|
|
206
|
+
:alt="imageOf(entry.item)!.alt"
|
|
192
207
|
class="bb-carousel__image"
|
|
193
208
|
decoding="async"
|
|
194
209
|
draggable="false"
|
|
@@ -198,19 +213,7 @@
|
|
|
198
213
|
:srcset="imageOf(entry.item)!.srcset"
|
|
199
214
|
v-bind="passthrough.image"
|
|
200
215
|
/>
|
|
201
|
-
</
|
|
202
|
-
<img
|
|
203
|
-
v-else-if="imageOf(entry.item)"
|
|
204
|
-
:alt="imageOf(entry.item)!.alt"
|
|
205
|
-
class="bb-carousel__image"
|
|
206
|
-
decoding="async"
|
|
207
|
-
draggable="false"
|
|
208
|
-
:loading="near(entry.real) ? undefined : 'lazy'"
|
|
209
|
-
:sizes="imageOf(entry.item)!.sizes"
|
|
210
|
-
:src="imageOf(entry.item)!.src"
|
|
211
|
-
:srcset="imageOf(entry.item)!.srcset"
|
|
212
|
-
v-bind="passthrough.image"
|
|
213
|
-
/>
|
|
216
|
+
</slot>
|
|
214
217
|
<slot
|
|
215
218
|
v-if="slots['slide:footer']"
|
|
216
219
|
:active="isActive(entry.real)"
|
|
@@ -273,10 +276,10 @@ import {
|
|
|
273
276
|
} from 'vue';
|
|
274
277
|
import type { FallthroughAttrs } from '@/types/fallthrough';
|
|
275
278
|
import BbIcon from '../BbIcon/BbIcon.vue';
|
|
276
|
-
import
|
|
277
|
-
import
|
|
278
|
-
import
|
|
279
|
-
import
|
|
279
|
+
import chevronLeftSvgBuiltin from '@/assets/svgs/chevron_left.svg?raw';
|
|
280
|
+
import chevronRightSvgBuiltin from '@/assets/svgs/chevron_right.svg?raw';
|
|
281
|
+
import pauseSvgBuiltin from '@/assets/svgs/pause.svg?raw';
|
|
282
|
+
import playSvgBuiltin from '@/assets/svgs/play.svg?raw';
|
|
280
283
|
import { usePassthrough } from '@/composables/usePassthrough';
|
|
281
284
|
import { useLocale } from '@/composables/useLocale';
|
|
282
285
|
import {
|
|
@@ -290,9 +293,8 @@ import {
|
|
|
290
293
|
dragVelocity,
|
|
291
294
|
quickRelease,
|
|
292
295
|
} from './dragRelease';
|
|
293
|
-
|
|
296
|
+
import { useInternalIcon } from '@/composables/useInternalIcon';
|
|
294
297
|
defineOptions({ inheritAttrs: false });
|
|
295
|
-
|
|
296
298
|
/** The current slide: any slide, 0 to the last. The view shows the page
|
|
297
299
|
* that holds it; a value out of range is brought back in and written back. */
|
|
298
300
|
const current = defineModel<number>({ default: 0 });
|
|
@@ -315,6 +317,11 @@ const props = withDefaults(
|
|
|
315
317
|
}
|
|
316
318
|
);
|
|
317
319
|
const slots = defineSlots<BbCarouselSlots<T>>();
|
|
320
|
+
const playSvg = useInternalIcon('play', playSvgBuiltin);
|
|
321
|
+
const pauseSvg = useInternalIcon('pause', pauseSvgBuiltin);
|
|
322
|
+
const chevronRightSvg = useInternalIcon('next', chevronRightSvgBuiltin);
|
|
323
|
+
const chevronLeftSvg = useInternalIcon('prev', chevronLeftSvgBuiltin);
|
|
324
|
+
|
|
318
325
|
/** The snap position the view rests on (the slide sitting first): internal,
|
|
319
326
|
* one of the page starts. */
|
|
320
327
|
const index = ref(current.value);
|
|
@@ -71,6 +71,7 @@
|
|
|
71
71
|
:options="options"
|
|
72
72
|
:passthrough="passthrough"
|
|
73
73
|
:variant="variant"
|
|
74
|
+
@retry="runRetry($event, retryLoad, () => optionsElement)"
|
|
74
75
|
>
|
|
75
76
|
<template #prepend>
|
|
76
77
|
<!-- The `variant` indicators: first in the list, so the
|
|
@@ -163,6 +164,7 @@ import type { FallthroughAttrs } from '@/types/fallthrough';
|
|
|
163
164
|
import { vAutofocus } from '@/utilities/misc/autofocus';
|
|
164
165
|
import CommonField from '../CommonField/CommonField.vue';
|
|
165
166
|
import OptionsContainer from '../OptionsContainer/OptionsContainer.vue';
|
|
167
|
+
import { runRetry } from '@/utils/loadRetry';
|
|
166
168
|
import BbBaseCheckboxIcon from '../BbBaseCheckboxIcon/BbBaseCheckboxIcon.vue';
|
|
167
169
|
import {
|
|
168
170
|
aliasParts,
|
|
@@ -333,6 +335,7 @@ const {
|
|
|
333
335
|
items: internalItems,
|
|
334
336
|
loading,
|
|
335
337
|
error: itemsError,
|
|
338
|
+
retry,
|
|
336
339
|
ssrMarker,
|
|
337
340
|
} = useItemsGetter({ items, marker: true });
|
|
338
341
|
|
|
@@ -342,6 +345,11 @@ const alignToCoherenceSettings = () => {
|
|
|
342
345
|
}
|
|
343
346
|
};
|
|
344
347
|
|
|
348
|
+
/** The failure row's "Try again": the failed load again, then coherence on rows it applied. */
|
|
349
|
+
const retryLoad = async () => {
|
|
350
|
+
if ((await retry()) === 'applied') alignToCoherenceSettings();
|
|
351
|
+
};
|
|
352
|
+
|
|
345
353
|
const { hasPrefilled, whenPrefilled } = usePrefill({
|
|
346
354
|
alreadyLoaded: hydratedFromSsr,
|
|
347
355
|
clientReproducible,
|
|
@@ -835,11 +843,10 @@ export type BbCheckboxGroupBaseProps<T> = {
|
|
|
835
843
|
inputPosition?: 'left' | 'center' | 'right' | 'start' | 'end';
|
|
836
844
|
|
|
837
845
|
/**
|
|
838
|
-
* The options: an array, or a provider called with
|
|
839
|
-
*
|
|
840
|
-
*
|
|
841
|
-
*
|
|
842
|
-
* gets the `error`.
|
|
846
|
+
* The options: an array, or a provider called with `{ reason, modelValue,
|
|
847
|
+
* signal }`, sync or async. A provider fails by THROWING, never by
|
|
848
|
+
* returning `[]`: the rows clear and the failure row shows `failed-text`
|
|
849
|
+
* with "Try again".
|
|
843
850
|
*/
|
|
844
851
|
items: T[] | ((context: BbCheckboxGroupItemsContext) => T[] | Promise<T[]>);
|
|
845
852
|
|
|
@@ -1165,11 +1172,10 @@ export type BbCheckboxGroupSlots<T> = {
|
|
|
1165
1172
|
loading?: (props: object) => any;
|
|
1166
1173
|
/**
|
|
1167
1174
|
* Content shown when no options are available (replaces the default "no
|
|
1168
|
-
* data" text).
|
|
1169
|
-
*
|
|
1170
|
-
* rows, so this slot is where it shows.
|
|
1175
|
+
* data" text). Empty only: a failed load shows the library's failure row
|
|
1176
|
+
* instead (its message is `failed-text`, and it ends with "Try again").
|
|
1171
1177
|
*/
|
|
1172
|
-
empty?: (props:
|
|
1178
|
+
empty?: (props: object) => any;
|
|
1173
1179
|
/**
|
|
1174
1180
|
* Replaces the default checkmark icon for each checkbox option.
|
|
1175
1181
|
*/
|
|
@@ -105,6 +105,7 @@
|
|
|
105
105
|
:label="indicatorLabel"
|
|
106
106
|
:model-value="fieldModel ?? null"
|
|
107
107
|
:off-canvas-props="resolvedOffCanvasProps"
|
|
108
|
+
:open="openModel"
|
|
108
109
|
:pt="
|
|
109
110
|
passthrough.forward(
|
|
110
111
|
{ panel: 'panel', sheet: 'sheet', swatch: 'swatch' },
|
|
@@ -122,6 +123,7 @@
|
|
|
122
123
|
typeof $event === 'string' ? $event.toLowerCase() : $event
|
|
123
124
|
)
|
|
124
125
|
"
|
|
126
|
+
@update:open="setOpenModel"
|
|
125
127
|
>
|
|
126
128
|
<template #activator="{ props: dotProps }">
|
|
127
129
|
<button
|
|
@@ -159,6 +161,7 @@ import type { MaskaDetail, MaskInputOptions } from 'maska';
|
|
|
159
161
|
import { useConfigDefaults } from '@/composables/useConfigDefaults';
|
|
160
162
|
import { useFormBinding } from '@/composables/useFormBinding';
|
|
161
163
|
import { useLocale } from '@/composables/useLocale';
|
|
164
|
+
import { useOpenProp } from '@/composables/useOpenModel';
|
|
162
165
|
import {
|
|
163
166
|
formControlPtActive,
|
|
164
167
|
TEXT_CONTROL_NATIVE_ATTRS,
|
|
@@ -277,6 +280,15 @@ const onPaletteHide = () => {
|
|
|
277
280
|
paletteOpen.value = false;
|
|
278
281
|
emit('hide');
|
|
279
282
|
};
|
|
283
|
+
|
|
284
|
+
/**
|
|
285
|
+
* `v-model:open`, handed to the hosted picker bound: its
|
|
286
|
+
* own open and close paths run, and every close writes back here.
|
|
287
|
+
*/
|
|
288
|
+
const { model: openModel, set: setOpenModel } = useOpenProp(
|
|
289
|
+
declaredProps,
|
|
290
|
+
declaredEmit
|
|
291
|
+
);
|
|
280
292
|
const passthrough = usePassthrough({
|
|
281
293
|
component: 'BbColorInput',
|
|
282
294
|
attrs: useAttrs(),
|
|
@@ -566,6 +578,11 @@ type BbColorInputPtProps = /* @vue-ignore */ PtCompoundProps<
|
|
|
566
578
|
// asserts the resolved prop names.
|
|
567
579
|
|
|
568
580
|
export type BbColorInputProps = BbColorInputPtProps & {
|
|
581
|
+
/**
|
|
582
|
+
* Whether the panel is open (`v-model:open`; `v-model` stays the value).
|
|
583
|
+
* Bound, the app opens and closes it; unbound, the initial state.
|
|
584
|
+
*/
|
|
585
|
+
open?: boolean;
|
|
569
586
|
/**
|
|
570
587
|
* Passthrough, object form: `{ box: '…', 'box:errors': '…' }` — the same
|
|
571
588
|
* keys as the `pt:*` attributes without the prefix. See the `pt:<part>` row.
|
|
@@ -788,6 +805,8 @@ export type BbColorInputEvents = {
|
|
|
788
805
|
(e: 'shown'): void;
|
|
789
806
|
/** Emitted as soon as the palette starts to close. */
|
|
790
807
|
(e: 'hide'): void;
|
|
808
|
+
/** The panel opened or closed (`v-model:open`). */
|
|
809
|
+
(e: 'update:open', value: boolean): void;
|
|
791
810
|
/** Emitted once the palette has finished closing. */
|
|
792
811
|
(e: 'hidden'): void;
|
|
793
812
|
/**
|
|
@@ -251,7 +251,7 @@
|
|
|
251
251
|
<script setup lang="ts">
|
|
252
252
|
import { inlineStep } from '@/composables/useDirection';
|
|
253
253
|
import BbIcon from '../BbIcon/BbIcon.vue';
|
|
254
|
-
import
|
|
254
|
+
import eyedropperSvgBuiltin from '@/assets/svgs/eyedropper.svg?raw';
|
|
255
255
|
import { asSheetAttrs } from '../BbOffCanvas/sheetAttrs';
|
|
256
256
|
import type { FallthroughAttrs } from '@/types/fallthrough';
|
|
257
257
|
import {
|
|
@@ -276,6 +276,7 @@ import {
|
|
|
276
276
|
import { useClosingInert } from '@/composables/useClosingInert';
|
|
277
277
|
import { useId } from '@/composables/useId';
|
|
278
278
|
import { useOwnModel } from '@/composables/useOwnModel';
|
|
279
|
+
import { useOpenModel } from '@/composables/useOpenModel';
|
|
279
280
|
import { useLocale } from '@/composables/useLocale';
|
|
280
281
|
import { useEscapeStackEntry } from '@/composables/useEscapeStackEntry';
|
|
281
282
|
import { useMobile } from '@/composables/useMobile';
|
|
@@ -294,7 +295,7 @@ import {
|
|
|
294
295
|
import { usePassthrough } from '@/composables/usePassthrough';
|
|
295
296
|
import { withoutPt } from '@/utils/passthrough';
|
|
296
297
|
import { transitions } from '@/utilities/misc/transitions';
|
|
297
|
-
|
|
298
|
+
import { useInternalIcon } from '@/composables/useInternalIcon';
|
|
298
299
|
// The activator slot plus a floating surface is a fragment, so Vue could not
|
|
299
300
|
// inherit `class` / `$attrs` anywhere; they merge into `root` instead — the
|
|
300
301
|
// floating element, where a `class` lands on BbPopover (T21).
|
|
@@ -325,10 +326,13 @@ const props = withDefaults(
|
|
|
325
326
|
transitionDuration: transitions.medium,
|
|
326
327
|
}
|
|
327
328
|
);
|
|
329
|
+
|
|
328
330
|
const emit = defineEmits<BbColorPaletteEvents>();
|
|
329
331
|
|
|
330
332
|
defineSlots<BbColorPaletteSlots>();
|
|
331
333
|
|
|
334
|
+
const eyedropperSvg = useInternalIcon('eyedropper', eyedropperSvgBuiltin);
|
|
335
|
+
|
|
332
336
|
// No `v-model`: the picker keeps its own value, like an input.
|
|
333
337
|
const { model: ownModel, set: setModel } = useOwnModel<
|
|
334
338
|
'modelValue',
|
|
@@ -428,6 +432,16 @@ const onActivatorClick = (event: MouseEvent) => {
|
|
|
428
432
|
isOpen.value = !isOpen.value;
|
|
429
433
|
};
|
|
430
434
|
|
|
435
|
+
// `v-model:open`: the activator's own open, the same close.
|
|
436
|
+
useOpenModel(props, emit, {
|
|
437
|
+
isOpen: () => isOpen.value,
|
|
438
|
+
open: () => {
|
|
439
|
+
if (props.disabled || props.readonly) return;
|
|
440
|
+
isOpen.value = true;
|
|
441
|
+
},
|
|
442
|
+
close: () => (isOpen.value = false),
|
|
443
|
+
});
|
|
444
|
+
|
|
431
445
|
/**
|
|
432
446
|
* a click outside the panel closes it. The panel is a modal
|
|
433
447
|
* `<dialog>` whose transparent backdrop the browser does not hit-test, so the
|
|
@@ -1352,6 +1366,11 @@ type BbColorPalettePtProps = /* @vue-ignore */ PtCompoundProps<
|
|
|
1352
1366
|
// is a type and lint error instead of a silent no-op.
|
|
1353
1367
|
|
|
1354
1368
|
export type BbColorPaletteProps = BbColorPalettePtProps & {
|
|
1369
|
+
/**
|
|
1370
|
+
* Whether the panel is open (`v-model:open`; `v-model` stays the value).
|
|
1371
|
+
* Bound, the app opens and closes it; unbound, the initial state.
|
|
1372
|
+
*/
|
|
1373
|
+
open?: boolean;
|
|
1355
1374
|
/**
|
|
1356
1375
|
* Passthrough, object form: the same keys as the `pt:*` attributes
|
|
1357
1376
|
* without the prefix. See the `pt:<part>` row.
|
|
@@ -1477,6 +1496,8 @@ export type BbColorPaletteEvents = {
|
|
|
1477
1496
|
(e: 'shown'): void;
|
|
1478
1497
|
/** Emitted as soon as the palette starts to close. */
|
|
1479
1498
|
(e: 'hide'): void;
|
|
1499
|
+
/** The panel opened or closed (`v-model:open`). */
|
|
1500
|
+
(e: 'update:open', value: boolean): void;
|
|
1480
1501
|
/** Emitted once the palette has finished closing. */
|
|
1481
1502
|
(e: 'hidden'): void;
|
|
1482
1503
|
/** Emitted when a color is picked. Payload is a concrete `#RRGGBB` (or `#RRGGBBAA` when alpha is enabled) — the palette always emits a color, never `null`. */
|
|
@@ -166,6 +166,7 @@ import {
|
|
|
166
166
|
} from '@/utilities/functions/extractDomContainer';
|
|
167
167
|
import { useId } from '@/composables/useId';
|
|
168
168
|
import { useOwnModel } from '@/composables/useOwnModel';
|
|
169
|
+
import { useOpenModel } from '@/composables/useOpenModel';
|
|
169
170
|
import { useLocale } from '@/composables/useLocale';
|
|
170
171
|
import { useEscapeStackEntry } from '@/composables/useEscapeStackEntry';
|
|
171
172
|
import { useMobile } from '@/composables/useMobile';
|
|
@@ -433,6 +434,16 @@ const onActivatorClick = (event: MouseEvent) => {
|
|
|
433
434
|
isOpen.value = !isOpen.value;
|
|
434
435
|
};
|
|
435
436
|
|
|
437
|
+
// `v-model:open`: the activator's own open, the same close.
|
|
438
|
+
useOpenModel(props, emit, {
|
|
439
|
+
isOpen: () => isOpen.value,
|
|
440
|
+
open: () => {
|
|
441
|
+
if (props.disabled || props.readonly) return;
|
|
442
|
+
isOpen.value = true;
|
|
443
|
+
},
|
|
444
|
+
close: () => (isOpen.value = false),
|
|
445
|
+
});
|
|
446
|
+
|
|
436
447
|
/**
|
|
437
448
|
* a click outside the panel closes it. The panel is a modal
|
|
438
449
|
* `<dialog>` whose transparent backdrop the browser does not hit-test, so the
|
|
@@ -813,6 +824,11 @@ type BbDatePickerPtProps = /* @vue-ignore */ PtCompoundProps<
|
|
|
813
824
|
// does not substitute a generic alias's type parameters — PASSTHROUGH.md T20).
|
|
814
825
|
|
|
815
826
|
export type BbDatePickerBaseProps = BbDatePickerPtProps & {
|
|
827
|
+
/**
|
|
828
|
+
* Whether the panel is open (`v-model:open`; `v-model` stays the value).
|
|
829
|
+
* Bound, the app opens and closes it; unbound, the initial state.
|
|
830
|
+
*/
|
|
831
|
+
open?: boolean;
|
|
816
832
|
/**
|
|
817
833
|
* Passthrough, object form: the same keys as the `pt:*` attributes
|
|
818
834
|
* without the prefix. See the `pt:<part>` row.
|
|
@@ -1004,6 +1020,8 @@ export type BbDatePickerEvents<
|
|
|
1004
1020
|
(e: 'shown'): void;
|
|
1005
1021
|
/** Emitted as soon as the calendar surface starts to close. */
|
|
1006
1022
|
(e: 'hide'): void;
|
|
1023
|
+
/** The panel opened or closed (`v-model:open`). */
|
|
1024
|
+
(e: 'update:open', value: boolean): void;
|
|
1007
1025
|
/** Emitted once the calendar surface has finished closing. */
|
|
1008
1026
|
(e: 'hidden'): void;
|
|
1009
1027
|
/** Emitted when the selected date value changes (single/range/null). */
|
|
@@ -217,9 +217,10 @@
|
|
|
217
217
|
:label="accessibleButtonLabel"
|
|
218
218
|
:max="max"
|
|
219
219
|
:min="min"
|
|
220
|
-
:model-value="
|
|
220
|
+
:model-value="calendarModel"
|
|
221
221
|
:number-of-months="numberOfMonths"
|
|
222
222
|
:off-canvas-props="offCanvasProps"
|
|
223
|
+
:open="openModel"
|
|
223
224
|
:pt="passthrough.forward(PICKER_PARTS, BB_DATE_PICKER_PT.states)"
|
|
224
225
|
:range="props.range"
|
|
225
226
|
:readonly="fieldReadonly"
|
|
@@ -236,6 +237,7 @@
|
|
|
236
237
|
@show="onCalendarShow"
|
|
237
238
|
@shown="emit('shown')"
|
|
238
239
|
@time-pick="onTimeSelect"
|
|
240
|
+
@update:open="setOpenModel"
|
|
239
241
|
>
|
|
240
242
|
<template #activator="{ props: activatorProps }">
|
|
241
243
|
<!-- A saving form leaves the trigger on screen, inert (the
|
|
@@ -318,6 +320,7 @@ import { useConfig } from '@/composables/useConfig';
|
|
|
318
320
|
import { useConfigDefaults } from '@/composables/useConfigDefaults';
|
|
319
321
|
import { useFormBinding } from '@/composables/useFormBinding';
|
|
320
322
|
import { useLocale } from '@/composables/useLocale';
|
|
323
|
+
import { useOpenProp } from '@/composables/useOpenModel';
|
|
321
324
|
import { useLogger } from '@/composables/useLogger';
|
|
322
325
|
import { useMobile } from '@/composables/useMobile';
|
|
323
326
|
import {
|
|
@@ -354,10 +357,11 @@ import {
|
|
|
354
357
|
import { isEmpty } from '@/utilities/functions/empty';
|
|
355
358
|
import { hash } from '@/utilities/functions/hash';
|
|
356
359
|
import { isNotEmpty } from '@/utilities/functions/isNotEmpty';
|
|
360
|
+
import { isNotNil } from '@/utilities/functions/isNotNil';
|
|
357
361
|
import { normalizeDateBound } from '@/utilities/functions/normalizeDateBound';
|
|
358
362
|
import { isDateDisabled as isDateDisabledIn } from '@/utilities/functions/isDateDisabled';
|
|
359
363
|
import { warnRemovedAttrs } from '@/utilities/functions/warnRemovedAttrs';
|
|
360
|
-
import
|
|
364
|
+
import calendarIconBuiltin from '@/assets/svgs/calendar.svg?raw';
|
|
361
365
|
import { calendars, localeOf } from '@/utilities/calendar';
|
|
362
366
|
import type { InternationalCalendarId } from '@/utilities/calendar/types';
|
|
363
367
|
// `null` in a build whose locales are all Gregorian: the calendar fields
|
|
@@ -405,12 +409,13 @@ import {
|
|
|
405
409
|
matchEra,
|
|
406
410
|
type CalendarFieldValues,
|
|
407
411
|
} from './calendarFields';
|
|
408
|
-
|
|
412
|
+
import { useInternalIcon } from '@/composables/useInternalIcon';
|
|
409
413
|
defineOptions({
|
|
410
414
|
// An app's own variants as declared `pt:<part>:<name>` props.
|
|
411
415
|
mixins: [variantPt(BB_DATE_PICKER_INPUT_PT)],
|
|
412
416
|
inheritAttrs: false,
|
|
413
417
|
});
|
|
418
|
+
|
|
414
419
|
const declaredProps = withDefaults(
|
|
415
420
|
defineProps<
|
|
416
421
|
BbDatePickerInputBaseProps &
|
|
@@ -445,7 +450,11 @@ const declaredProps = withDefaults(
|
|
|
445
450
|
);
|
|
446
451
|
|
|
447
452
|
const declaredEmit = defineEmits<BbDatePickerInputEvents<R>>();
|
|
453
|
+
|
|
448
454
|
const slots = defineSlots<BbDatePickerInputSlots>();
|
|
455
|
+
|
|
456
|
+
const calendarIcon = useInternalIcon('calendar', calendarIconBuiltin);
|
|
457
|
+
|
|
449
458
|
// `R` types the v-model for the caller; inside, the value is either shape.
|
|
450
459
|
const anyRangeProps = declaredProps as unknown as ShapeErasedProps<
|
|
451
460
|
BbDatePickerInputProps,
|
|
@@ -521,6 +530,15 @@ const onCalendarHide = () => {
|
|
|
521
530
|
emit('hide');
|
|
522
531
|
};
|
|
523
532
|
|
|
533
|
+
/**
|
|
534
|
+
* `v-model:open`, handed to the hosted picker bound: its
|
|
535
|
+
* own open and close paths run, and every close writes back here.
|
|
536
|
+
*/
|
|
537
|
+
const { model: openModel, set: setOpenModel } = useOpenProp(
|
|
538
|
+
declaredProps,
|
|
539
|
+
declaredEmit
|
|
540
|
+
);
|
|
541
|
+
|
|
524
542
|
// Deactivated (KeepAlive) while in use counts as leaving: the control is off
|
|
525
543
|
// screen, so nothing it listens to on the document can be about it.
|
|
526
544
|
onDeactivated(() => {
|
|
@@ -1252,6 +1270,25 @@ const isDateDisabled = (date: Dayjs) => {
|
|
|
1252
1270
|
return !passing;
|
|
1253
1271
|
};
|
|
1254
1272
|
|
|
1273
|
+
/**
|
|
1274
|
+
* The value the calendar opens on. A complete date the fields show but may
|
|
1275
|
+
* not emit (outside min/max or not `selectable`) waits for the leave to
|
|
1276
|
+
* resolve it, so the model still holds the last date typed on the way there:
|
|
1277
|
+
* the calendar shows the fields' date instead, on its own month, its day
|
|
1278
|
+
* disabled as usual, never that other date as selected.
|
|
1279
|
+
*/
|
|
1280
|
+
const calendarModel = computed(() => {
|
|
1281
|
+
const start = displayedValue('start');
|
|
1282
|
+
// A range without its start shows no range yet.
|
|
1283
|
+
const shown = [
|
|
1284
|
+
start,
|
|
1285
|
+
start && props.range ? displayedValue('end') : null,
|
|
1286
|
+
].filter(isNotNil);
|
|
1287
|
+
if (!shown.some(isDateDisabled)) return fieldModel.value;
|
|
1288
|
+
const values = shown.map(toOuterValue);
|
|
1289
|
+
return props.range ? values : values[0];
|
|
1290
|
+
});
|
|
1291
|
+
|
|
1255
1292
|
const onClickClear = () => {
|
|
1256
1293
|
if (props.range) {
|
|
1257
1294
|
emit('update:modelValue', []);
|
|
@@ -2741,6 +2778,11 @@ type BbDatePickerInputPtProps = /* @vue-ignore */ PtCompoundProps<
|
|
|
2741
2778
|
BbDatePickerInputPtKeys;
|
|
2742
2779
|
|
|
2743
2780
|
export type BbDatePickerInputBaseProps = BbDatePickerInputPtProps & {
|
|
2781
|
+
/**
|
|
2782
|
+
* Whether the panel is open (`v-model:open`; `v-model` stays the value).
|
|
2783
|
+
* Bound, the app opens and closes it; unbound, the initial state.
|
|
2784
|
+
*/
|
|
2785
|
+
open?: boolean;
|
|
2744
2786
|
/**
|
|
2745
2787
|
* Passthrough, object form: the same keys as the `pt:*` attributes
|
|
2746
2788
|
* without the prefix. See the `pt:<part>` row.
|
|
@@ -3139,6 +3181,8 @@ export type BbDatePickerInputEvents<R extends boolean = boolean> = {
|
|
|
3139
3181
|
(e: 'shown'): void;
|
|
3140
3182
|
/** Emitted as soon as the calendar surface starts to close. */
|
|
3141
3183
|
(e: 'hide'): void;
|
|
3184
|
+
/** The panel opened or closed (`v-model:open`). */
|
|
3185
|
+
(e: 'update:open', value: boolean): void;
|
|
3142
3186
|
/** Emitted once the calendar surface has finished closing. */
|
|
3143
3187
|
(e: 'hidden'): void;
|
|
3144
3188
|
/**
|
|
@@ -1030,7 +1030,20 @@ const onNativeCommand = (event: Event) =>
|
|
|
1030
1030
|
// document (a modal <dialog> loses its top-layer state, a flyout its anchor)
|
|
1031
1031
|
// and its document listeners would otherwise keep firing for a cached, unseen
|
|
1032
1032
|
// node. Reactivating shows it closed; the consumer reopens it as usual.
|
|
1033
|
-
|
|
1033
|
+
// its close still plays, on a copy, as for an unmount:
|
|
1034
|
+
// the hook runs once KeepAlive has moved it out, so the copy is of the
|
|
1035
|
+
// detached node (leaveGhost.ts).
|
|
1036
|
+
onDeactivated(() => {
|
|
1037
|
+
if (isVisible.value)
|
|
1038
|
+
leaveAsGhost(dialog.value, {
|
|
1039
|
+
id: stackId,
|
|
1040
|
+
openClass: 'bb-dialog--open',
|
|
1041
|
+
duration: props.transitionDuration,
|
|
1042
|
+
closingSince,
|
|
1043
|
+
opener,
|
|
1044
|
+
});
|
|
1045
|
+
closeWith('unmounted');
|
|
1046
|
+
});
|
|
1034
1047
|
</script>
|
|
1035
1048
|
|
|
1036
1049
|
<style lang="postcss">
|