bitboss-ui 3.0.0-beta.73 → 3.0.0-beta.75
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -2
- package/bin/bitboss-ui-mcp.mjs +101 -3
- package/bin/bitboss-ui.mjs +6 -1
- package/bin/cli.mjs +31 -5
- package/dist/ai/BbAvatar.md +86 -58
- package/dist/ai/BbBadge.md +5 -5
- package/dist/ai/BbBreadcrumbs.md +2 -2
- package/dist/ai/BbButton.md +2 -2
- package/dist/ai/BbCalendar.md +9 -5
- package/dist/ai/BbCheckboxGroup.md +5 -4
- package/dist/ai/BbColorInput.md +12 -0
- package/dist/ai/BbColorPalette.md +19 -15
- package/dist/ai/BbConfirmPortal.md +1 -1
- package/dist/ai/BbDatePicker.md +16 -3
- package/dist/ai/BbDatePickerInput.md +17 -1
- package/dist/ai/BbDialog.md +16 -4
- package/dist/ai/BbDropdown.md +175 -67
- package/dist/ai/BbDropdownButton.md +27 -8
- package/dist/ai/BbForm.md +4 -1
- package/dist/ai/BbHoverCardPortal.md +1 -1
- package/dist/ai/BbNumberInput.md +8 -4
- package/dist/ai/BbPopoverPortal.md +1 -1
- package/dist/ai/BbRadioGroup.md +4 -4
- package/dist/ai/BbSelect.md +79 -67
- package/dist/ai/BbSelectPopover.md +24 -5
- package/dist/ai/BbSwitchGroup.md +5 -4
- package/dist/ai/BbTable.md +59 -34
- package/dist/ai/BbTimePicker.md +16 -3
- package/dist/ai/BbTimePickerInput.md +15 -1
- package/dist/ai/BbToast.md +3 -2
- package/dist/ai/BbToastPortal.md +1 -1
- 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 +1 -0
- package/dist/ai/ListBox.md +1 -0
- package/dist/ai/OptionsContainer.md +4 -4
- package/dist/ai/changelog.json +215 -6
- package/dist/ai/components.json +77 -43
- package/dist/ai/composables/useToast.md +2 -2
- package/dist/ai/design-tokens.json +60 -0
- package/dist/ai/guides/agent-contract.md +8 -4
- package/dist/ai/guides/design-tokens.md +33 -0
- package/dist/ai/guides/eslint-rules.md +1 -1
- package/dist/ai/guides/fetch-items-playbook.md +7 -11
- package/dist/ai/guides/inertia-helpers.md +613 -53
- package/dist/ai/guides/migration/adoption-checklist.md +5 -5
- package/dist/ai/guides/migration/components/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-table.md +2 -1
- package/dist/ai/guides/migration/components/bb-toast.md +2 -2
- package/dist/ai/guides/migration/v2-to-v3.md +46 -5
- package/dist/ai/guides/migration/v3-beta-tooling.md +4 -0
- package/dist/ai/guides/passthrough.md +3 -3
- package/dist/ai/guides/preset-components.md +15 -2
- package/dist/ai/guides/reporting.md +49 -0
- package/dist/ai/helpers/inertia/manifest.json +33 -38
- package/dist/ai/helpers/inertia/useHasChanged.ts +25 -37
- package/dist/ai/helpers/inertia/useQuery.ts +24 -6
- package/dist/ai/helpers/inertia/utils.ts +552 -3
- package/dist/ai/index.md +2 -1
- package/dist/ai/manifest/common.json +1 -0
- package/dist/ai/manifest/components/BbAlert.tree.json +1 -1
- package/dist/ai/manifest/components/BbAvatar.json +5 -2
- package/dist/ai/manifest/components/BbAvatar.tree.json +32 -2
- package/dist/ai/manifest/components/BbCalendar.json +2 -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 +7 -4
- package/dist/ai/manifest/components/BbColorPalette.removed.json +1 -2
- package/dist/ai/manifest/components/BbConfirmPortal.json +1 -1
- package/dist/ai/manifest/components/BbDatePicker.json +6 -3
- package/dist/ai/manifest/components/BbDatePickerInput.json +3 -0
- package/dist/ai/manifest/components/BbDialog.tree.json +7 -1
- package/dist/ai/manifest/components/BbDropdown.json +23 -17
- package/dist/ai/manifest/components/BbDropdown.removed.json +2 -1
- package/dist/ai/manifest/components/BbDropdown.tree.json +16 -5
- package/dist/ai/manifest/components/BbDropdownButton.json +15 -9
- package/dist/ai/manifest/components/BbDropdownButton.removed.json +2 -1
- package/dist/ai/manifest/components/BbDropdownButton.tree.json +2 -0
- package/dist/ai/manifest/components/BbForm.json +1 -1
- package/dist/ai/manifest/components/BbHoverCard.json +1 -1
- package/dist/ai/manifest/components/BbHoverCardPortal.json +1 -1
- package/dist/ai/manifest/components/BbNumberInput.json +1 -1
- package/dist/ai/manifest/components/BbOffCanvas.tree.json +2 -0
- package/dist/ai/manifest/components/BbPopover.json +1 -1
- package/dist/ai/manifest/components/BbPopoverPortal.json +1 -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 +10 -7
- package/dist/ai/manifest/components/BbSelectPopover.json +7 -4
- package/dist/ai/manifest/components/BbSelectPopover.tree.json +5 -1
- 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 +16 -6
- package/dist/ai/manifest/components/BbTimePicker.json +7 -4
- package/dist/ai/manifest/components/BbTimePickerInput.json +5 -2
- package/dist/ai/manifest/components/BbToastPortal.json +1 -1
- package/dist/ai/manifest/components/BbTree.json +1 -1
- package/dist/ai/manifest/components/CommonPopover.json +2 -1
- package/dist/ai/manifest/components/FlatListBox.json +2 -1
- package/dist/ai/manifest/components/GroupedListBox.json +2 -1
- package/dist/ai/manifest/components/ListBox.json +2 -1
- package/dist/ai/manifest/components/OptionsContainer.json +6 -4
- package/dist/ai/manifest/index.json +2 -2
- package/dist/ai/manifest/meta.json +36 -3
- package/dist/ai/manifest/types.advanced.json +81 -80
- package/dist/ai/manifest/types.api.json +64 -65
- package/dist/ai/manifest/types.wrapper.json +155 -118
- package/dist/ai/recipes/inertia/layout-scaffold.md +3 -1
- package/dist/ai/recipes/nuxt/layout-scaffold.md +3 -1
- package/dist/ai/recipes/vue/layout-scaffold.md +3 -1
- package/dist/ai/source/BbAlert.md +16 -4
- package/dist/ai/source/BbAvatar.md +121 -9
- package/dist/ai/source/BbBadge.md +12 -5
- package/dist/ai/source/BbBreadcrumbs.md +56 -55
- package/dist/ai/source/BbButton.md +41 -25
- package/dist/ai/source/BbCalendar.md +22 -12
- package/dist/ai/source/BbCarousel.md +31 -28
- package/dist/ai/source/BbCheckboxGroup.md +15 -9
- package/dist/ai/source/BbColorInput.md +19 -0
- package/dist/ai/source/BbColorPalette.md +59 -12
- package/dist/ai/source/BbConfirm.md +7 -0
- package/dist/ai/source/BbConfirmPortal.md +9 -4
- package/dist/ai/source/BbDatePicker.md +71 -22
- package/dist/ai/source/BbDatePickerInput.md +72 -9
- package/dist/ai/source/BbDialog.md +45 -2
- package/dist/ai/source/BbDropdown.md +263 -63
- package/dist/ai/source/BbDropdownButton.md +27 -2
- package/dist/ai/source/BbDropdownGroup.md +121 -59
- package/dist/ai/source/BbForm.md +73 -6
- package/dist/ai/source/BbGallery.md +76 -55
- package/dist/ai/source/BbHost.md +12 -0
- package/dist/ai/source/BbHoverCard.md +7 -0
- package/dist/ai/source/BbHoverCardPortal.md +9 -5
- package/dist/ai/source/BbNumberInput.md +22 -16
- package/dist/ai/source/BbOffCanvas.md +48 -2
- package/dist/ai/source/BbPopover.md +7 -0
- package/dist/ai/source/BbPopoverPortal.md +9 -5
- package/dist/ai/source/BbRadio.md +4 -3
- package/dist/ai/source/BbRadioGroup.md +19 -10
- package/dist/ai/source/BbSelect.md +35 -20
- package/dist/ai/source/BbSelectPopover.md +116 -8
- package/dist/ai/source/BbSwitchGroup.md +11 -4
- package/dist/ai/source/BbTable.md +126 -32
- package/dist/ai/source/BbTag.md +10 -3
- package/dist/ai/source/BbTimePicker.md +69 -15
- package/dist/ai/source/BbTimePickerInput.md +45 -7
- package/dist/ai/source/BbToast.md +16 -2
- package/dist/ai/source/BbToastPortal.md +18 -6
- package/dist/ai/source/BbTree.md +1 -1
- package/dist/ai/source/CommonFieldInput.md +11 -5
- package/dist/ai/source/CommonPopover.md +28 -2
- package/dist/ai/source/FlatListBox.md +26 -5
- package/dist/ai/source/GroupedListBox.md +63 -11
- package/dist/ai/source/ListBox.md +4 -0
- package/dist/ai/source/OptionsContainer.md +29 -11
- package/dist/components/BbAlert/BbAlert.vue_vue_type_script_setup_true_lang.js +31 -26
- package/dist/components/BbAvatar/BbAvatar.vue.d.ts +1 -0
- package/dist/components/BbAvatar/BbAvatar.vue_vue_type_script_setup_true_lang.js +61 -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 +80 -79
- package/dist/components/BbBreadcrumbs/BbBreadcrumbs.vue_vue_type_script_setup_true_lang.js +152 -158
- 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 +235 -234
- package/dist/components/BbCalendar/types.d.ts +2 -2
- package/dist/components/BbCalendar/useDayGrid.js +120 -123
- package/dist/components/BbCalendar/useDayjsLocale.js +11 -8
- package/dist/components/BbCarousel/BbCarousel.vue_vue_type_script_setup_true_lang.js +7 -7
- 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 +239 -223
- package/dist/components/BbColorPalette/types.d.ts +8 -1
- package/dist/components/BbConfirm/BbConfirmPortal.vue.d.ts +2 -4
- package/dist/components/BbConfirm/types.d.ts +5 -0
- package/dist/components/BbDatePicker/BbDatePicker.vue.d.ts +4 -2
- package/dist/components/BbDatePicker/BbDatePicker.vue_vue_type_script_setup_true_lang.js +160 -143
- package/dist/components/BbDatePicker/types.d.ts +9 -2
- package/dist/components/BbDatePickerInput/BbDatePickerInput.vue.d.ts +3 -1
- package/dist/components/BbDatePickerInput/BbDatePickerInput.vue_vue_type_script_setup_true_lang.js +483 -496
- package/dist/components/BbDatePickerInput/types.d.ts +7 -0
- package/dist/components/BbDialog/BbDialog.vue_vue_type_script_setup_true_lang.js +252 -236
- package/dist/components/BbDialog/leaveGhost.js +38 -0
- package/dist/components/BbDialog/overlayActions.js +34 -20
- package/dist/components/BbDropdown/AdaptiveDropdown.vue_vue_type_script_setup_true_lang.js +92 -87
- package/dist/components/BbDropdown/BbDropdown.vue.d.ts +3 -0
- package/dist/components/BbDropdown/BbDropdown.vue_vue_type_script_setup_true_lang.js +419 -368
- package/dist/components/BbDropdown/BbDropdownList.vue_vue_type_script_setup_true_lang.js +384 -340
- 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 +133 -119
- package/dist/components/BbDropdown/DropdownRow.vue_vue_type_script_setup_true_lang.js +73 -45
- package/dist/components/BbDropdown/normalizeGroups.js +6 -2
- package/dist/components/BbDropdown/ptKeys.generated.d.ts +8 -0
- package/dist/components/BbDropdown/types.d.ts +73 -58
- package/dist/components/BbDropdown/types.js +1 -0
- package/dist/components/BbDropdownButton/BbDropdownButton.vue.d.ts +2 -0
- package/dist/components/BbDropdownButton/BbDropdownButton.vue_vue_type_script_setup_true_lang.js +93 -72
- package/dist/components/BbDropdownButton/ptKeys.generated.d.ts +48 -0
- package/dist/components/BbDropdownButton/types.d.ts +13 -2
- package/dist/components/BbDropdownButton/types.js +2 -0
- package/dist/components/BbForm/BbForm.vue.d.ts +2 -21
- package/dist/components/BbForm/BbForm.vue_vue_type_script_setup_true_lang.js +229 -227
- package/dist/components/BbForm/types.d.ts +31 -0
- package/dist/components/BbGallery/BbGallery.vue_vue_type_script_setup_true_lang.js +318 -296
- package/dist/components/BbHost/BbHost.vue_vue_type_script_setup_true_lang.js +7 -1
- package/dist/components/BbHoverCard/BbHoverCardPortal.vue.d.ts +2 -5
- package/dist/components/BbHoverCard/types.d.ts +5 -0
- package/dist/components/BbNumberInput/BbNumberInput.vue_vue_type_script_setup_true_lang.js +10 -6
- package/dist/components/BbNumberInput/numberDisplay.js +102 -106
- package/dist/components/BbNumberInput/types.d.ts +4 -3
- package/dist/components/BbOffCanvas/BbOffCanvas.vue_vue_type_script_setup_true_lang.js +425 -409
- package/dist/components/BbPopover/BbPopoverPortal.vue.d.ts +2 -5
- package/dist/components/BbPopover/types.d.ts +5 -0
- package/dist/components/BbRadio/types.d.ts +4 -3
- package/dist/components/BbRadioGroup/BbRadioGroup.vue_vue_type_script_setup_true_lang.js +108 -106
- package/dist/components/BbRadioGroup/types.d.ts +4 -7
- package/dist/components/BbSelect/BbSelect.vue.d.ts +3 -1
- package/dist/components/BbSelect/BbSelect.vue_vue_type_script_setup_true_lang.js +167 -163
- package/dist/components/BbSelect/types.d.ts +23 -20
- package/dist/components/BbSelectPopover/BbSelectPopover.vue.d.ts +3 -1
- package/dist/components/BbSelectPopover/BbSelectPopover.vue_vue_type_script_setup_true_lang.js +680 -637
- package/dist/components/BbSelectPopover/types.d.ts +10 -4
- 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 +1 -3
- package/dist/components/BbTable/BbTable.vue_vue_type_script_setup_true_lang.js +1182 -1165
- package/dist/components/BbTable/BbTableDataRow.js +96 -96
- package/dist/components/BbTable/types.d.ts +11 -10
- package/dist/components/BbTag/BbTag.vue_vue_type_script_setup_true_lang.js +9 -3
- package/dist/components/BbTimePicker/BbTimePicker.vue.d.ts +4 -2
- package/dist/components/BbTimePicker/BbTimePicker.vue_vue_type_script_setup_true_lang.js +157 -140
- package/dist/components/BbTimePicker/types.d.ts +9 -2
- package/dist/components/BbTimePickerInput/BbTimePickerInput.vue.d.ts +3 -1
- package/dist/components/BbTimePickerInput/BbTimePickerInput.vue_vue_type_script_setup_true_lang.js +278 -268
- package/dist/components/BbTimePickerInput/types.d.ts +7 -0
- package/dist/components/BbToast/BbToastMessage.vue_vue_type_script_setup_true_lang.js +12 -12
- package/dist/components/BbToast/BbToastPortal.vue.d.ts +2 -4
- package/dist/components/BbToast/types.d.ts +7 -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/CommonFieldInput/CommonFieldInput.vue_vue_type_script_setup_true_lang.js +36 -36
- package/dist/components/CommonPopover/CommonPopover.vue_vue_type_script_setup_true_lang.js +14 -2
- package/dist/components/CommonTimeSelector/useMeridiem.js +6 -6
- package/dist/components/FlatListBox/FlatListBox.vue_vue_type_script_setup_true_lang.js +115 -96
- package/dist/components/GroupedListBox/GroupedListBox.vue_vue_type_script_setup_true_lang.js +194 -166
- 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/composables/formSubmitLock.js +2 -1
- package/dist/composables/overlayRegistry.js +52 -42
- package/dist/composables/useActiveInactiveState.js +8 -4
- package/dist/composables/useBbDialog.js +5 -5
- package/dist/composables/useItemsGetter.js +34 -32
- package/dist/composables/useOpenModel.js +20 -0
- package/dist/composables/useOwnModel.js +16 -0
- package/dist/composables/useSegmentedFields.js +31 -20
- package/dist/deprecation/ai-deprecations.json.js +1 -1
- package/dist/i18n/currencyDigits.js +58 -0
- package/dist/i18n/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/i18n/regionDates.js +250 -0
- package/dist/i18n/regionHints.js +30 -41
- package/dist/icon-scan.js +68 -61
- package/dist/index.d.ts +35 -31
- package/dist/llms-full.txt +1428 -400
- package/dist/llms-medium.txt +8 -4
- package/dist/llms.txt +4 -2
- package/dist/locale-blueprint.json +2 -0
- package/dist/styles.css +2 -2
- package/dist/types/ActionButton.d.ts +2 -1
- package/dist/types/CommonProps.d.ts +8 -0
- package/dist/types/Option.d.ts +10 -0
- package/dist/types/ptComponentMap.d.ts +3 -3
- package/dist/utilities/functions/hash.js +97 -64
- package/dist/utilities/functions/isEqual.js +33 -25
- package/dist/utilities/functions/slotContent.js +19 -0
- package/dist/utils/loadRetry.js +8 -0
- package/dist/utils/versionCheck.js +1 -1
- package/dist/vite-plugin.d.ts +2 -1
- package/dist/vite.js +11 -4
- package/llms.txt +4 -2
- package/package.json +3 -2
- package/scripts/README.md +3 -1
- package/scripts/lib/adoption-checklist.json +6 -5
- package/scripts/lib/agent-manifest.mjs +33 -6
- package/scripts/lib/agent-setup.mjs +90 -24
- package/scripts/lib/cldr-pins.ts +182 -0
- package/scripts/lib/engines-include.d.mts +5 -0
- package/scripts/lib/engines-include.mjs +40 -0
- package/scripts/lib/eslint-plugin.mjs +8 -2
- package/scripts/lib/hidden-label-placeholder.mjs +25 -5
- package/scripts/lib/idiom-scan.mjs +30 -3
- package/scripts/lib/legacy-agent-files.json +152 -0
- package/scripts/lib/mcp-config.mjs +74 -7
- package/scripts/lib/portal-names.mjs +78 -8
- package/scripts/lib/release-results.mjs +5 -2
- package/scripts/lib/report.mjs +340 -0
- package/scripts/lib/run-beat.mjs +14 -0
- package/scripts/lib/run-records.mjs +313 -0
- package/scripts/lib/selector-log.mjs +98 -0
- package/scripts/lib/ticket-beat.mjs +30 -0
- package/scripts/lib/validate-bb-markup.mjs +37 -2
- package/dist/ai/manifest/components/BbAvatar.removed.json +0 -6
|
@@ -45,16 +45,23 @@
|
|
|
45
45
|
:title="title"
|
|
46
46
|
:title-id="titleId"
|
|
47
47
|
>
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
48
|
+
<!-- Read at each render, so a `#title` added later (or one that
|
|
49
|
+
renders nothing: the name stays screen-reader only) counts. -->
|
|
50
|
+
<SlotContent
|
|
51
|
+
v-slot="{ nodes: titleNodes }"
|
|
52
|
+
:of="slots.title"
|
|
53
|
+
:props="{ ...slotProps, text: title }"
|
|
53
54
|
>
|
|
54
|
-
<
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
55
|
+
<p
|
|
56
|
+
:id="titleId"
|
|
57
|
+
class="bb-gallery__title"
|
|
58
|
+
:class="{ 'bb-sr-only': !title && !titleNodes }"
|
|
59
|
+
v-bind="passthrough.title"
|
|
60
|
+
>
|
|
61
|
+
<SlotNodes v-if="titleNodes" :nodes="titleNodes" />
|
|
62
|
+
<template v-else>{{ name }}</template>
|
|
63
|
+
</p>
|
|
64
|
+
</SlotContent>
|
|
58
65
|
<CloseButton
|
|
59
66
|
:aria-label="t('dialog.closeLabel').value"
|
|
60
67
|
class="bb-gallery__close"
|
|
@@ -163,54 +170,64 @@
|
|
|
163
170
|
<p aria-live="polite" class="bb-sr-only">{{ announcement }}</p>
|
|
164
171
|
</div>
|
|
165
172
|
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
v-
|
|
173
|
+
<!-- `#footer` rendered once here: one that renders nothing for this
|
|
174
|
+
photo (a `v-if` false) is no footer, and the counter stays. -->
|
|
175
|
+
<SlotContent
|
|
176
|
+
v-slot="{ nodes: footer }"
|
|
177
|
+
:of="slots.footer"
|
|
178
|
+
:props="slotProps"
|
|
170
179
|
>
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
v-if="captionOverflows || captionOpen"
|
|
191
|
-
:aria-controls="captionId"
|
|
192
|
-
:aria-expanded="captionOpen"
|
|
193
|
-
class="bb-gallery__more"
|
|
194
|
-
type="button"
|
|
195
|
-
v-bind="passthrough.more"
|
|
196
|
-
@click="captionOpen = !captionOpen"
|
|
180
|
+
<div
|
|
181
|
+
v-if="footer || items.length > 1 || anyCaption"
|
|
182
|
+
class="bb-gallery__footer"
|
|
183
|
+
v-bind="passthrough.footer"
|
|
184
|
+
>
|
|
185
|
+
<!-- One line, always the same height: the caption centred (equal
|
|
186
|
+
side columns, so the counter's width never moves it), the
|
|
187
|
+
counter at the end. With a `#footer` slot this row keeps
|
|
188
|
+
the caption — there whenever any photo has one — and the
|
|
189
|
+
slot owns the row below it. Read in full, the caption runs
|
|
190
|
+
on upward from the same line, on the viewer's own plate. -->
|
|
191
|
+
<div v-if="!footer || anyCaption" class="bb-gallery__bar">
|
|
192
|
+
<p
|
|
193
|
+
v-if="currentCaption"
|
|
194
|
+
:id="captionId"
|
|
195
|
+
class="bb-gallery__caption"
|
|
196
|
+
:class="{ 'bb-gallery__caption--open': captionOpen }"
|
|
197
|
+
:tabindex="captionOpen ? 0 : undefined"
|
|
198
|
+
v-bind="passthrough.caption"
|
|
197
199
|
>
|
|
198
|
-
{{
|
|
199
|
-
|
|
200
|
-
}}
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
200
|
+
<span ref="captionEl" class="bb-gallery__caption-text">{{
|
|
201
|
+
currentCaption
|
|
202
|
+
}}</span>
|
|
203
|
+
<button
|
|
204
|
+
v-if="captionOverflows || captionOpen"
|
|
205
|
+
:aria-controls="captionId"
|
|
206
|
+
:aria-expanded="captionOpen"
|
|
207
|
+
class="bb-gallery__more"
|
|
208
|
+
type="button"
|
|
209
|
+
v-bind="passthrough.more"
|
|
210
|
+
@click="captionOpen = !captionOpen"
|
|
211
|
+
>
|
|
212
|
+
{{
|
|
213
|
+
captionOpen
|
|
214
|
+
? t('gallery.less').value
|
|
215
|
+
: t('gallery.more').value
|
|
216
|
+
}}
|
|
217
|
+
</button>
|
|
218
|
+
</p>
|
|
219
|
+
<p
|
|
220
|
+
v-if="!footer && items.length > 1"
|
|
221
|
+
aria-hidden="true"
|
|
222
|
+
class="bb-gallery__counter"
|
|
223
|
+
v-bind="passthrough.counter"
|
|
224
|
+
>
|
|
225
|
+
{{ index + 1 }} / {{ items.length }}
|
|
226
|
+
</p>
|
|
227
|
+
</div>
|
|
228
|
+
<SlotNodes v-if="footer" :nodes="footer" />
|
|
211
229
|
</div>
|
|
212
|
-
|
|
213
|
-
</div>
|
|
230
|
+
</SlotContent>
|
|
214
231
|
</template>
|
|
215
232
|
</dialog>
|
|
216
233
|
</template>
|
|
@@ -249,6 +266,7 @@ import {
|
|
|
249
266
|
} from '@/directives/bbGallery';
|
|
250
267
|
import { animationsSettled } from '@/utilities/functions/animationsSettled';
|
|
251
268
|
import { wait } from '@/utilities/functions/wait';
|
|
269
|
+
import { SlotContent, SlotNodes } from '@/utilities/functions/slotContent';
|
|
252
270
|
import { pageText } from '@/utilities/misc/pageText';
|
|
253
271
|
import { transitions } from '@/utilities/misc/transitions';
|
|
254
272
|
import {
|
|
@@ -307,7 +325,6 @@ const index = computed(() =>
|
|
|
307
325
|
const looping = computed(() => !!props.loop && count.value > 1);
|
|
308
326
|
const atStart = computed(() => !looping.value && index.value === 0);
|
|
309
327
|
const atEnd = computed(() => !looping.value && index.value === count.value - 1);
|
|
310
|
-
const hasTitle = computed(() => !!props.title || !!slots.title);
|
|
311
328
|
const name = computed(() => props.title || t('gallery.label').value);
|
|
312
329
|
const position = (i: number) => t('gallery.position', i + 1, count.value).value;
|
|
313
330
|
|
|
@@ -593,6 +610,10 @@ const onScroll = () => {
|
|
|
593
610
|
frame = requestAnimationFrame(() => {
|
|
594
611
|
frame = 0;
|
|
595
612
|
if (!track.value || !isOpen.value || !width() || !shown) return;
|
|
613
|
+
// A width the resize observer has not seen yet is a relayout, not a
|
|
614
|
+
// swipe: WebKit re-snaps the track by pixels before the observer puts
|
|
615
|
+
// it back on the photo shown, which would land on a neighbour.
|
|
616
|
+
if (resize && width() !== lastWidth) return;
|
|
596
617
|
const p = nearest();
|
|
597
618
|
if (target !== null) {
|
|
598
619
|
if (p === target) target = null;
|
package/dist/ai/source/BbHost.md
CHANGED
|
@@ -65,6 +65,18 @@ import BbToast from '../BbToast/BbToast.vue';
|
|
|
65
65
|
defineOptions({ name: 'BbHost' });
|
|
66
66
|
|
|
67
67
|
const instance = getCurrentInstance()!;
|
|
68
|
+
// The plugin's host is a render root of its own, and Vue's `useId()` counts
|
|
69
|
+
// per root: its children would restart at the page's `v-0`. A per-host
|
|
70
|
+
// prefix with a letter in it can't meet the page's ids (digits and dashes
|
|
71
|
+
// after the app's `idPrefix`); its children inherit it. The uid is safe: the
|
|
72
|
+
// plugin's host is never server-rendered nor hydrated.
|
|
73
|
+
// `ids` is a Vue internal, pinned in BbHost.onDemand.test.ts ('Vue internals').
|
|
74
|
+
if (isAutoHost(instance))
|
|
75
|
+
(instance as unknown as { ids: [string, number, number] }).ids = [
|
|
76
|
+
`h${instance.uid}-`,
|
|
77
|
+
0,
|
|
78
|
+
0,
|
|
79
|
+
];
|
|
68
80
|
const state = hostStateOf(instance.appContext);
|
|
69
81
|
const mountedHere = shallowRef(false);
|
|
70
82
|
const owns = computed(
|
|
@@ -945,6 +945,13 @@ export type BbHoverCardPortalSlotProps<P = any> = {
|
|
|
945
945
|
/** Closes the card. */
|
|
946
946
|
close: () => void;
|
|
947
947
|
};
|
|
948
|
+
|
|
949
|
+
/** BbHoverCardPortal's slots; index it for one slot's type: `BbHoverCardPortalSlots<MyData>['default']`. */
|
|
950
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- `P` defaults to `any` as on BbHoverCardPortalSlotProps
|
|
951
|
+
export type BbHoverCardPortalSlots<P = any> = {
|
|
952
|
+
/** The card's body. `data` is the directive's `data`; `close` closes the card. */
|
|
953
|
+
default?: (scope: BbHoverCardPortalSlotProps<P>) => any;
|
|
954
|
+
};
|
|
948
955
|
```
|
|
949
956
|
|
|
950
957
|
## Styles
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
<template><!-- registers content; renders nothing of its own --></template>
|
|
9
9
|
<script setup lang="ts">
|
|
10
10
|
import { watchEffect } from 'vue';
|
|
11
|
-
import type {
|
|
11
|
+
import type { BbHoverCardPortalSlots } from './types';
|
|
12
12
|
import {
|
|
13
13
|
hoverCardPortals,
|
|
14
14
|
useDirectivePortal,
|
|
@@ -23,10 +23,7 @@ const props = defineProps<{
|
|
|
23
23
|
/** The name a `v-bb-hover-card` passes as its value (`"'name'"`) or as `portal: 'name'`. */
|
|
24
24
|
name: string;
|
|
25
25
|
}>();
|
|
26
|
-
const slots = defineSlots<
|
|
27
|
-
/** The card's body. `data` is the directive's `data`; `close` closes the card. */
|
|
28
|
-
default?: (scope: BbHoverCardPortalSlotProps) => any;
|
|
29
|
-
}>();
|
|
26
|
+
const slots = defineSlots<BbHoverCardPortalSlots>();
|
|
30
27
|
|
|
31
28
|
watchEffect(
|
|
32
29
|
useDirectivePortal(
|
|
@@ -249,6 +246,13 @@ export type BbHoverCardPortalSlotProps<P = any> = {
|
|
|
249
246
|
/** Closes the card. */
|
|
250
247
|
close: () => void;
|
|
251
248
|
};
|
|
249
|
+
|
|
250
|
+
/** BbHoverCardPortal's slots; index it for one slot's type: `BbHoverCardPortalSlots<MyData>['default']`. */
|
|
251
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- `P` defaults to `any` as on BbHoverCardPortalSlotProps
|
|
252
|
+
export type BbHoverCardPortalSlots<P = any> = {
|
|
253
|
+
/** The card's body. `data` is the directive's `data`; `close` closes the card. */
|
|
254
|
+
default?: (scope: BbHoverCardPortalSlotProps<P>) => any;
|
|
255
|
+
};
|
|
252
256
|
```
|
|
253
257
|
|
|
254
258
|
## Styles
|
|
@@ -337,9 +337,7 @@ const affix = computed(() =>
|
|
|
337
337
|
);
|
|
338
338
|
/** The currency's own fraction digits (2 for EUR, 0 for JPY); `null` without one. */
|
|
339
339
|
const currencyDigits = computed(() =>
|
|
340
|
-
affix.value?.kind === 'currency'
|
|
341
|
-
? currencyDigitsOf(affix.value.code, affix.value.tag)
|
|
342
|
-
: null
|
|
340
|
+
affix.value?.kind === 'currency' ? currencyDigitsOf(affix.value.code) : null
|
|
343
341
|
);
|
|
344
342
|
/** An explicit prop wins; else the currency's digits; else 8 (and at least `minPrecision`). */
|
|
345
343
|
const maxPrecision = computed(
|
|
@@ -945,29 +943,36 @@ const normalizeNumericValue = (value: number, withMin = true): number => {
|
|
|
945
943
|
};
|
|
946
944
|
|
|
947
945
|
/**
|
|
948
|
-
* On blur and on Enter, raises a value
|
|
949
|
-
*
|
|
950
|
-
*
|
|
946
|
+
* On blur and on Enter, raises a value below `min` to `min`, in the field and
|
|
947
|
+
* in the model. Never while typing: the live clamp ignores `min`, or "15"
|
|
948
|
+
* with min 10 could not be typed through its "1". A value above `max` (the
|
|
949
|
+
* app set it: typing clamps at once) comes down to `max` the same way, so a
|
|
950
|
+
* user who focused and left the field holds a coherent value; a value the
|
|
951
|
+
* app sets is never moved while nobody touches the field.
|
|
951
952
|
*/
|
|
952
953
|
const applyMin = () => {
|
|
953
954
|
// A locked field never moves its value, not even up to `min`.
|
|
954
955
|
if (locked.value) return;
|
|
956
|
+
const bounded = (value: number) =>
|
|
957
|
+
value < props.min ? props.min : value > props.max ? props.max : value;
|
|
955
958
|
if (!legacy.value) {
|
|
956
959
|
// Enter re-reads an outside text first, as blur does (PANEL § 2.7).
|
|
957
960
|
reconcile();
|
|
958
961
|
const typed = valueOfRaw(edit.raw);
|
|
959
|
-
if (typeof typed !== 'number' || typed
|
|
960
|
-
|
|
961
|
-
|
|
962
|
+
if (typeof typed !== 'number' || bounded(typed) === typed) return;
|
|
963
|
+
const next = bounded(typed);
|
|
964
|
+
setRaw(rawOfNumber(next, maxPrecision.value));
|
|
965
|
+
committed.value = next;
|
|
962
966
|
paint(isFocused() ? edit.raw.length : undefined);
|
|
963
|
-
emit('update:modelValue',
|
|
967
|
+
emit('update:modelValue', next);
|
|
964
968
|
return;
|
|
965
969
|
}
|
|
966
970
|
if (!input.value?.value) return;
|
|
967
971
|
const typed = Number(makeValidNumberString(input.value.value));
|
|
968
|
-
if (!Number.isFinite(typed) || typed
|
|
969
|
-
|
|
970
|
-
|
|
972
|
+
if (!Number.isFinite(typed) || bounded(typed) === typed) return;
|
|
973
|
+
const next = bounded(typed);
|
|
974
|
+
input.value.value = next.toString();
|
|
975
|
+
emit('update:modelValue', next);
|
|
971
976
|
};
|
|
972
977
|
|
|
973
978
|
/**
|
|
@@ -1688,9 +1693,10 @@ export type BbNumberInputProps = BbNumberInputPtProps & {
|
|
|
1688
1693
|
max?: number;
|
|
1689
1694
|
|
|
1690
1695
|
/**
|
|
1691
|
-
* Maximum
|
|
1692
|
-
*
|
|
1693
|
-
*
|
|
1696
|
+
* Maximum fraction digits the user can TYPE (more are refused, never
|
|
1697
|
+
* rounded); a model with more still shows them all. With `currency`, the
|
|
1698
|
+
* currency's own digits (`2` EUR, `0` JPY and HUF, `3` KWD), or
|
|
1699
|
+
* `minPrecision` when that is larger.
|
|
1694
1700
|
*
|
|
1695
1701
|
* @defaultValue `8`
|
|
1696
1702
|
*/
|
|
@@ -239,6 +239,11 @@ import { useUntil } from '../../composables/useUntil';
|
|
|
239
239
|
import { removedPropsFor } from '@/deprecation/removedProps';
|
|
240
240
|
import { warnRemovedAttrs } from '@/utilities/functions/warnRemovedAttrs';
|
|
241
241
|
import { wait } from '@/utilities/functions/wait';
|
|
242
|
+
import {
|
|
243
|
+
leaveAsGhost,
|
|
244
|
+
surfaceGone,
|
|
245
|
+
surfaceShown,
|
|
246
|
+
} from '../BbDialog/leaveGhost';
|
|
242
247
|
import { animationsSettled } from '@/utilities/functions/animationsSettled';
|
|
243
248
|
import { transitions } from '@/utilities/misc/transitions';
|
|
244
249
|
import { pageText } from '@/utilities/misc/pageText';
|
|
@@ -448,6 +453,7 @@ const footerActions = useOverlayActions({
|
|
|
448
453
|
complete: overlay.complete,
|
|
449
454
|
data: () => overlay.data.value,
|
|
450
455
|
close: () => requestClose(),
|
|
456
|
+
closeLocked: () => isLocked.value,
|
|
451
457
|
block: 'bb-offcanvas',
|
|
452
458
|
});
|
|
453
459
|
const FooterActions = () => footerActions.render();
|
|
@@ -618,6 +624,10 @@ const handleKeyDown = (e: KeyboardEvent) => {
|
|
|
618
624
|
// (CommonPopover/floating-text.css), read at each open.
|
|
619
625
|
const pageStyle = ref<Record<string, string>>();
|
|
620
626
|
let releaseTopLayer: (() => void) | null = null;
|
|
627
|
+
/** When the current close started, `null` while open. */
|
|
628
|
+
let closingSince: number | null = null;
|
|
629
|
+
/** What had focus when it opened. */
|
|
630
|
+
let opener: Element | null = null;
|
|
621
631
|
const toggleDialog = async (value: boolean) => {
|
|
622
632
|
if (value) {
|
|
623
633
|
side.value = resolveOpeningSide();
|
|
@@ -630,7 +640,12 @@ const toggleDialog = async (value: boolean) => {
|
|
|
630
640
|
// Guard against double-open: a reopen during the close transition (below)
|
|
631
641
|
// resumes here while still natively open, and showModal() throws on an
|
|
632
642
|
// already-open dialog. enterStack/registerTopLayerHost dedupe.
|
|
633
|
-
if (dialog.value && !dialog.value.open)
|
|
643
|
+
if (dialog.value && !dialog.value.open) {
|
|
644
|
+
opener = document.activeElement;
|
|
645
|
+
dialog.value.showModal();
|
|
646
|
+
}
|
|
647
|
+
closingSince = null;
|
|
648
|
+
surfaceShown(stackId);
|
|
634
649
|
// Register after showModal so the panel can be measured at full size.
|
|
635
650
|
enterStack();
|
|
636
651
|
setClosing(stackId, false);
|
|
@@ -647,6 +662,7 @@ const toggleDialog = async (value: boolean) => {
|
|
|
647
662
|
} else {
|
|
648
663
|
// the opening's result, the object its promise settles with.
|
|
649
664
|
emit('hide', overlay.closingResult());
|
|
665
|
+
closingSince = performance.now();
|
|
650
666
|
// Leave the stack NOW, not after the slide-out. The parents' push offsets
|
|
651
667
|
// derive from the stack registry, so releasing it here lets them slide
|
|
652
668
|
// back in lockstep with this panel leaving — instead of staying pushed
|
|
@@ -664,6 +680,7 @@ const toggleDialog = async (value: boolean) => {
|
|
|
664
680
|
if (currentOpenedTimes !== openedTimes.value) return;
|
|
665
681
|
removeEscapeListener();
|
|
666
682
|
dialog.value?.close();
|
|
683
|
+
surfaceGone(stackId);
|
|
667
684
|
// Release the top-layer host only after close(): releasing at close-start
|
|
668
685
|
// would re-home body toasts under a still-modal panel, freezing them for
|
|
669
686
|
// the whole transition.
|
|
@@ -731,6 +748,14 @@ onBeforeUnmount(() => {
|
|
|
731
748
|
// Torn down while open (a route change, a `v-if`): close natively so the
|
|
732
749
|
// browser hands focus back to the opener, as a normal close does. Nothing
|
|
733
750
|
// listens for the native `close` event, so this emits nothing.
|
|
751
|
+
// the close still plays, on a copy (leaveGhost.ts).
|
|
752
|
+
leaveAsGhost(dialog.value, {
|
|
753
|
+
id: stackId,
|
|
754
|
+
openClass: 'bb-offcanvas--open',
|
|
755
|
+
duration: props.transitionDuration,
|
|
756
|
+
closingSince,
|
|
757
|
+
opener,
|
|
758
|
+
});
|
|
734
759
|
if (dialog.value?.open) dialog.value.close();
|
|
735
760
|
releaseTopLayer?.();
|
|
736
761
|
releaseTopLayer = null;
|
|
@@ -1774,7 +1799,20 @@ onBeforeUnmount(() => {
|
|
|
1774
1799
|
// document (a modal <dialog> loses its top-layer state, a flyout its anchor)
|
|
1775
1800
|
// and its document listeners would otherwise keep firing for a cached, unseen
|
|
1776
1801
|
// node. Reactivating shows it closed; the consumer reopens it as usual.
|
|
1777
|
-
|
|
1802
|
+
// its close still plays, on a copy, as for an unmount:
|
|
1803
|
+
// the hook runs once KeepAlive has moved it out, so the copy is of the
|
|
1804
|
+
// detached node (leaveGhost.ts).
|
|
1805
|
+
onDeactivated(() => {
|
|
1806
|
+
if (isVisible.value)
|
|
1807
|
+
leaveAsGhost(dialog.value, {
|
|
1808
|
+
id: stackId,
|
|
1809
|
+
openClass: 'bb-offcanvas--open',
|
|
1810
|
+
duration: props.transitionDuration,
|
|
1811
|
+
closingSince,
|
|
1812
|
+
opener,
|
|
1813
|
+
});
|
|
1814
|
+
closeWith('unmounted');
|
|
1815
|
+
});
|
|
1778
1816
|
</script>
|
|
1779
1817
|
|
|
1780
1818
|
<style lang="postcss">
|
|
@@ -3104,4 +3142,12 @@ body:has(.bb-offcanvas--visible) {
|
|
|
3104
3142
|
transform: scaleY(1);
|
|
3105
3143
|
}
|
|
3106
3144
|
}
|
|
3145
|
+
|
|
3146
|
+
/* the copy that plays the close of a panel unmounted
|
|
3147
|
+
while open (BbDialog/leaveGhost.ts): its open frame as is, no entry. */
|
|
3148
|
+
.bb-offcanvas.bb-overlay-ghost,
|
|
3149
|
+
.bb-offcanvas.bb-overlay-ghost::backdrop,
|
|
3150
|
+
.bb-offcanvas.bb-overlay-ghost * {
|
|
3151
|
+
transition: none !important;
|
|
3152
|
+
}
|
|
3107
3153
|
```
|
|
@@ -1192,6 +1192,13 @@ export type BbPopoverPortalSlotProps<P = any> = {
|
|
|
1192
1192
|
/** Closes the popover. */
|
|
1193
1193
|
close: () => void;
|
|
1194
1194
|
};
|
|
1195
|
+
|
|
1196
|
+
/** BbPopoverPortal's slots; index it for one slot's type: `BbPopoverPortalSlots<MyData>['default']`. */
|
|
1197
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- `P` defaults to `any` as on BbPopoverPortalSlotProps
|
|
1198
|
+
export type BbPopoverPortalSlots<P = any> = {
|
|
1199
|
+
/** The popover body. `data` is the directive's `data`; `close` closes the popover. */
|
|
1200
|
+
default?: (scope: BbPopoverPortalSlotProps<P>) => any;
|
|
1201
|
+
};
|
|
1195
1202
|
```
|
|
1196
1203
|
|
|
1197
1204
|
## Styles
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
<template><!-- registers content; renders nothing of its own --></template>
|
|
9
9
|
<script setup lang="ts">
|
|
10
10
|
import { watchEffect } from 'vue';
|
|
11
|
-
import type {
|
|
11
|
+
import type { BbPopoverPortalSlots } from './types';
|
|
12
12
|
import {
|
|
13
13
|
popoverPortals,
|
|
14
14
|
useDirectivePortal,
|
|
@@ -23,10 +23,7 @@ const props = defineProps<{
|
|
|
23
23
|
/** The name a `v-bb-popover` passes as its value (`"'name'"`) or as `portal: 'name'`. */
|
|
24
24
|
name: string;
|
|
25
25
|
}>();
|
|
26
|
-
const slots = defineSlots<
|
|
27
|
-
/** The popover body. `data` is the directive's `data`; `close` closes the popover. */
|
|
28
|
-
default?: (scope: BbPopoverPortalSlotProps) => any;
|
|
29
|
-
}>();
|
|
26
|
+
const slots = defineSlots<BbPopoverPortalSlots>();
|
|
30
27
|
|
|
31
28
|
watchEffect(
|
|
32
29
|
useDirectivePortal(
|
|
@@ -283,6 +280,13 @@ export type BbPopoverPortalSlotProps<P = any> = {
|
|
|
283
280
|
/** Closes the popover. */
|
|
284
281
|
close: () => void;
|
|
285
282
|
};
|
|
283
|
+
|
|
284
|
+
/** BbPopoverPortal's slots; index it for one slot's type: `BbPopoverPortalSlots<MyData>['default']`. */
|
|
285
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- `P` defaults to `any` as on BbPopoverPortalSlotProps
|
|
286
|
+
export type BbPopoverPortalSlots<P = any> = {
|
|
287
|
+
/** The popover body. `data` is the directive's `data`; `close` closes the popover. */
|
|
288
|
+
default?: (scope: BbPopoverPortalSlotProps<P>) => any;
|
|
289
|
+
};
|
|
286
290
|
```
|
|
287
291
|
|
|
288
292
|
## Styles
|
|
@@ -596,14 +596,15 @@ export type BbRadioIconSlotProps = {
|
|
|
596
596
|
*/
|
|
597
597
|
hasWarnings: boolean;
|
|
598
598
|
/**
|
|
599
|
-
* The `id` attribute of the underlying input
|
|
599
|
+
* The `id` attribute of the underlying input (always set: generated when
|
|
600
|
+
* no `id` is passed).
|
|
600
601
|
*/
|
|
601
|
-
id:
|
|
602
|
+
id: string;
|
|
602
603
|
/**
|
|
603
604
|
* The `name` attribute of the underlying input (the generated fallback when
|
|
604
605
|
* no `name` is passed).
|
|
605
606
|
*/
|
|
606
|
-
name:
|
|
607
|
+
name: string;
|
|
607
608
|
/**
|
|
608
609
|
* The radio value serialized to a string for form submission.
|
|
609
610
|
*/
|
|
@@ -76,6 +76,7 @@
|
|
|
76
76
|
:role="hasLegend() ? 'radiogroup' : undefined"
|
|
77
77
|
:variant="variant"
|
|
78
78
|
@mousedown.capture="clicks.onPress"
|
|
79
|
+
@retry="runRetry($event, retryLoad, () => optionsElement)"
|
|
79
80
|
>
|
|
80
81
|
<template #prepend>
|
|
81
82
|
<!-- The `variant` indicators: first in the list, so the
|
|
@@ -164,6 +165,7 @@ import type { FallthroughAttrs } from '@/types/fallthrough';
|
|
|
164
165
|
import { vAutofocus } from '@/utilities/misc/autofocus';
|
|
165
166
|
import CommonField from '../CommonField/CommonField.vue';
|
|
166
167
|
import OptionsContainer from '../OptionsContainer/OptionsContainer.vue';
|
|
168
|
+
import { runRetry } from '@/utils/loadRetry';
|
|
167
169
|
import BbBaseRadioIcon from '../BbBaseRadioIcon/BbBaseRadioIcon.vue';
|
|
168
170
|
import {
|
|
169
171
|
aliasParts,
|
|
@@ -370,6 +372,7 @@ const {
|
|
|
370
372
|
items: internalItems,
|
|
371
373
|
loading,
|
|
372
374
|
error: itemsError,
|
|
375
|
+
retry,
|
|
373
376
|
ssrMarker,
|
|
374
377
|
} = useItemsGetter({ items, marker: true });
|
|
375
378
|
|
|
@@ -379,6 +382,11 @@ const alignToCoherenceSettings = () => {
|
|
|
379
382
|
}
|
|
380
383
|
};
|
|
381
384
|
|
|
385
|
+
/** The failure row's "Try again": the failed load again, then coherence on rows it applied. */
|
|
386
|
+
const retryLoad = async () => {
|
|
387
|
+
if ((await retry()) === 'applied') alignToCoherenceSettings();
|
|
388
|
+
};
|
|
389
|
+
|
|
382
390
|
const { hasPrefilled, whenPrefilled } = usePrefill({
|
|
383
391
|
alreadyLoaded: hydratedFromSsr,
|
|
384
392
|
clientReproducible,
|
|
@@ -516,10 +524,12 @@ const containerPassthrough = aliasParts(passthrough, { label: 'legend' });
|
|
|
516
524
|
/** Each row's radio input focus — the glyph's `focused` / `focusVisible`. */
|
|
517
525
|
const rowFocus = useToggleListFocus();
|
|
518
526
|
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
527
|
+
/** A row's input id: the field's id plus the row's hash. */
|
|
528
|
+
const rowIdIn = (option: Option, fieldId: string): string =>
|
|
529
|
+
[fieldId, option.valueHash].filter(Boolean).join('-');
|
|
530
|
+
|
|
531
|
+
const rowId = (option: Option, fieldId: string | undefined) =>
|
|
532
|
+
fieldId ? rowIdIn(option, fieldId) : undefined;
|
|
523
533
|
|
|
524
534
|
/** Every row's native radio back to its option's `selected` (rows render in option order). */
|
|
525
535
|
const syncRowsToData = () => {
|
|
@@ -632,7 +642,7 @@ const rowIconSlotProps = (
|
|
|
632
642
|
focusVisible: rowFocus.focusVisible(option.valueHash),
|
|
633
643
|
hasErrors: !!fieldHasErrors,
|
|
634
644
|
hasWarnings: Boolean(fieldHasWarnings) && !fieldHasErrors,
|
|
635
|
-
id:
|
|
645
|
+
id: rowIdIn(option, fieldId),
|
|
636
646
|
name: resolvedName.value,
|
|
637
647
|
parsedValue: toggleInputValue('radio', option.value),
|
|
638
648
|
readonly: !!props.readonly,
|
|
@@ -877,7 +887,7 @@ export type BbRadioGroupProps<T> = BbRadioGroupPtProps & {
|
|
|
877
887
|
* The options: an array, or a provider called with a
|
|
878
888
|
* `BbRadioGroupItemsContext` (`reason`, `modelValue`, `signal`), sync or
|
|
879
889
|
* async. A provider fails by THROWING, never by returning `[]`: the rows
|
|
880
|
-
* clear and
|
|
890
|
+
* clear and the failure row shows `failed-text` with "Try again".
|
|
881
891
|
*/
|
|
882
892
|
items: T[] | ((context: BbRadioGroupItemsContext) => T[] | Promise<T[]>);
|
|
883
893
|
|
|
@@ -1174,11 +1184,10 @@ export type BbRadioGroupSlots<T> = {
|
|
|
1174
1184
|
loading?: (props: object) => any;
|
|
1175
1185
|
/**
|
|
1176
1186
|
* Content shown when no options are available (replaces the default "no
|
|
1177
|
-
* data" text).
|
|
1178
|
-
*
|
|
1179
|
-
* rows, so this slot is where it shows.
|
|
1187
|
+
* data" text). Empty only: a failed load shows the library's failure row
|
|
1188
|
+
* instead (its message is `failed-text`, and it ends with "Try again").
|
|
1180
1189
|
*/
|
|
1181
|
-
empty?: (props:
|
|
1190
|
+
empty?: (props: object) => any;
|
|
1182
1191
|
/**
|
|
1183
1192
|
* Replaces the default radio dot icon for each option. Receives the radio
|
|
1184
1193
|
* state plus the source item and its display text.
|