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
|
@@ -46,6 +46,7 @@
|
|
|
46
46
|
v-model="open"
|
|
47
47
|
:anchor="effectiveAnchor"
|
|
48
48
|
:boundary="boundary"
|
|
49
|
+
:boundary-x="boundary ? undefined : tableEdges"
|
|
49
50
|
:bubble-attrs="panelAttrs"
|
|
50
51
|
class="bb-dropdown"
|
|
51
52
|
:class="{
|
|
@@ -95,6 +96,7 @@
|
|
|
95
96
|
reader in menu mode walks items — so the presentational row inside
|
|
96
97
|
is skipped and an empty search would announce nothing. -->
|
|
97
98
|
<span class="bb-sr-only" role="status">{{ statusText }}</span>
|
|
99
|
+
<DropdownFailures />
|
|
98
100
|
<div
|
|
99
101
|
v-if="$slots.footer"
|
|
100
102
|
class="bb-dropdown__footer"
|
|
@@ -119,17 +121,20 @@ import { asSheetAttrs } from '../BbOffCanvas/sheetAttrs';
|
|
|
119
121
|
import type { FallthroughAttrs } from '@/types/fallthrough';
|
|
120
122
|
import {
|
|
121
123
|
computed,
|
|
124
|
+
getCurrentInstance,
|
|
122
125
|
mergeProps,
|
|
123
126
|
onBeforeUnmount,
|
|
124
127
|
onDeactivated,
|
|
125
128
|
onMounted,
|
|
126
129
|
reactive,
|
|
127
130
|
ref,
|
|
131
|
+
shallowRef,
|
|
128
132
|
useSlots,
|
|
129
133
|
useTemplateRef,
|
|
130
134
|
watch,
|
|
131
135
|
} from 'vue';
|
|
132
136
|
import { useId } from '@/composables/useId';
|
|
137
|
+
import { useOwnModel } from '@/composables/useOwnModel';
|
|
133
138
|
import {
|
|
134
139
|
pushEscapeEntry,
|
|
135
140
|
removeEscapeEntry,
|
|
@@ -155,6 +160,8 @@ import { focusQuietly } from '@/utils/focusVisibility';
|
|
|
155
160
|
import CommonPopover from '../CommonPopover/CommonPopover.vue';
|
|
156
161
|
import type { CommonPopoverAvailableSpace } from '../CommonPopover/types';
|
|
157
162
|
import BbDropdownList from './BbDropdownList.vue';
|
|
163
|
+
import DropdownFailures from './DropdownFailures.vue';
|
|
164
|
+
import { runRetry } from '@/utils/loadRetry';
|
|
158
165
|
import AdaptiveDropdown from './AdaptiveDropdown.vue';
|
|
159
166
|
import DropdownPipelineResolver from './DropdownPipelineResolver.vue';
|
|
160
167
|
import { hash } from '@/utilities/functions/hash';
|
|
@@ -236,6 +243,8 @@ const props = withDefaults(
|
|
|
236
243
|
queryDebounceTime: 300,
|
|
237
244
|
// Tri-state: unset lets the components map show through.
|
|
238
245
|
compact: undefined,
|
|
246
|
+
// Unset, not `false`: an absent `v-model` is no initial state.
|
|
247
|
+
modelValue: undefined,
|
|
239
248
|
}
|
|
240
249
|
);
|
|
241
250
|
const emit = defineEmits<BbDropdownEvents>();
|
|
@@ -451,6 +460,21 @@ const cursorAnchor = ref<VirtualAnchor | null>(null);
|
|
|
451
460
|
*/
|
|
452
461
|
const anchorElement = computed(() => props.anchor ?? activator.value);
|
|
453
462
|
const anchorDom = computed(() => extractDomContainer(anchorElement.value));
|
|
463
|
+
/** Where this dropdown sits in the page, for a menu with no element anchor (a row menu at the cursor). */
|
|
464
|
+
const instance = getCurrentInstance();
|
|
465
|
+
const mountedIn = shallowRef<Element | null>(null);
|
|
466
|
+
onMounted(
|
|
467
|
+
() =>
|
|
468
|
+
(mountedIn.value =
|
|
469
|
+
(instance?.vnode.el as Node | null)?.parentElement ?? null)
|
|
470
|
+
);
|
|
471
|
+
/**
|
|
472
|
+
* A menu in a `BbTable` (a row menu, a cell's ⋯) stays within the table's left
|
|
473
|
+
* and right edges by default; up and down it flips at the viewport as anywhere.
|
|
474
|
+
*/
|
|
475
|
+
const tableEdges = computed(
|
|
476
|
+
() => (anchorDom.value ?? mountedIn.value)?.closest('.bb-table') ?? undefined
|
|
477
|
+
);
|
|
454
478
|
|
|
455
479
|
const effectiveAnchor = computed(() =>
|
|
456
480
|
props.placement === 'cursor' && cursorAnchor.value
|
|
@@ -886,6 +910,10 @@ const groupLoading = reactive<Record<string, boolean>>({});
|
|
|
886
910
|
|
|
887
911
|
/** Per-group "any fetch in flight" flag — surfaced to `useBbDropdown`. */
|
|
888
912
|
const groupFetching = reactive<Record<string, boolean>>({});
|
|
913
|
+
/** Failed pipeline groups, by key: the message and the retry (publishFailure). */
|
|
914
|
+
const groupFailures = reactive<
|
|
915
|
+
Record<string, { text: string; retry: () => unknown }>
|
|
916
|
+
>({});
|
|
889
917
|
|
|
890
918
|
/**
|
|
891
919
|
* Resolve a selection key to the row's value — the mapped `item-value` for
|
|
@@ -1003,6 +1031,10 @@ provideDropdownGroupRegistry({
|
|
|
1003
1031
|
if (fetching) groupFetching[key] = true;
|
|
1004
1032
|
else delete groupFetching[key];
|
|
1005
1033
|
},
|
|
1034
|
+
publishFailure: (key, failure) => {
|
|
1035
|
+
if (failure) groupFailures[key] = failure;
|
|
1036
|
+
else delete groupFailures[key];
|
|
1037
|
+
},
|
|
1006
1038
|
publishModel: (key, value) => {
|
|
1007
1039
|
if (value === undefined) companionModels.delete(key);
|
|
1008
1040
|
else companionModels.set(key, value);
|
|
@@ -1353,8 +1385,9 @@ let openModality: 'pointer' | 'keyboard' | undefined;
|
|
|
1353
1385
|
const focusActivator = () => {
|
|
1354
1386
|
// The tracked element, not `#${id}`: an adopted external activator keeps
|
|
1355
1387
|
// its own id (see the adoption watch), so an id lookup would no-op.
|
|
1388
|
+
const tracked = activator.value?.isConnected ? activator.value : undefined;
|
|
1356
1389
|
const button =
|
|
1357
|
-
|
|
1390
|
+
tracked ??
|
|
1358
1391
|
(activatorId.value ? document.getElementById(activatorId.value) : null) ??
|
|
1359
1392
|
returnFocusTo;
|
|
1360
1393
|
button?.focus();
|
|
@@ -1370,6 +1403,26 @@ provideDropdownContext({
|
|
|
1370
1403
|
statusText.value = text;
|
|
1371
1404
|
},
|
|
1372
1405
|
status: statusText,
|
|
1406
|
+
failures: computed(() =>
|
|
1407
|
+
Object.entries(groupFailures)
|
|
1408
|
+
.filter(([key]) => topLevelPipelineKeys.value.includes(key))
|
|
1409
|
+
.map(([key, { text }]) => ({ key, text }))
|
|
1410
|
+
),
|
|
1411
|
+
retryFailure: (key, event) => {
|
|
1412
|
+
const failure = groupFailures[key];
|
|
1413
|
+
if (!failure) return;
|
|
1414
|
+
// The search field the user types in, else the panel itself.
|
|
1415
|
+
const surface = (
|
|
1416
|
+
event.currentTarget as HTMLElement | null
|
|
1417
|
+
)?.closest<HTMLElement>('[data-bb-dropdown-surface], dialog');
|
|
1418
|
+
runRetry(
|
|
1419
|
+
event,
|
|
1420
|
+
failure.retry,
|
|
1421
|
+
() =>
|
|
1422
|
+
surface?.querySelector<HTMLElement>('.bb-dropdown__search-input') ??
|
|
1423
|
+
surface
|
|
1424
|
+
);
|
|
1425
|
+
},
|
|
1373
1426
|
open,
|
|
1374
1427
|
queryFor: (key) => groupQueries[key] ?? '',
|
|
1375
1428
|
setQuery: (key, value) => {
|
|
@@ -1615,7 +1668,28 @@ const onOutsideInteraction = (event: Event) => {
|
|
|
1615
1668
|
) {
|
|
1616
1669
|
return;
|
|
1617
1670
|
}
|
|
1671
|
+
// Heard in the capture phase: the activator's own click
|
|
1672
|
+
// toggles the menu itself.
|
|
1673
|
+
if (event.type !== 'focusin' && activator.value?.contains(target)) return;
|
|
1618
1674
|
closeDropdown();
|
|
1675
|
+
/*
|
|
1676
|
+
* a click on something that takes no focus, inside the
|
|
1677
|
+
* dialog or off-canvas around the menu, parks focus on that surface: hand
|
|
1678
|
+
* it back to the activator, as Escape does. A click on a field or a
|
|
1679
|
+
* button keeps the focus it gave; one on the page (focus on the body)
|
|
1680
|
+
* stays as the browser left it.
|
|
1681
|
+
*/
|
|
1682
|
+
if (event.type === 'focusin') return;
|
|
1683
|
+
const active = document.activeElement;
|
|
1684
|
+
const el = activator.value;
|
|
1685
|
+
if (
|
|
1686
|
+
el?.isConnected &&
|
|
1687
|
+
active &&
|
|
1688
|
+
active !== document.body &&
|
|
1689
|
+
active !== el &&
|
|
1690
|
+
active.contains(el)
|
|
1691
|
+
)
|
|
1692
|
+
el.focus({ preventScroll: true });
|
|
1619
1693
|
};
|
|
1620
1694
|
|
|
1621
1695
|
/**
|
|
@@ -1687,9 +1761,16 @@ const openDropdown = async () => {
|
|
|
1687
1761
|
`[data-bb-dropdown-surface="${CSS.escape(String(id))}"]`
|
|
1688
1762
|
),
|
|
1689
1763
|
});
|
|
1690
|
-
|
|
1764
|
+
// Capture: a dialog or off-canvas around the menu stops
|
|
1765
|
+
// `click` at its root (overlaySurfaceIsolation), so a click elsewhere in it
|
|
1766
|
+
// never bubbles to the document.
|
|
1767
|
+
document.addEventListener('click', onOutsideInteraction, {
|
|
1768
|
+
passive: true,
|
|
1769
|
+
capture: true,
|
|
1770
|
+
});
|
|
1691
1771
|
document.addEventListener('contextmenu', onOutsideInteraction, {
|
|
1692
1772
|
passive: true,
|
|
1773
|
+
capture: true,
|
|
1693
1774
|
});
|
|
1694
1775
|
document.addEventListener('focusin', onOutsideInteraction, { passive: true });
|
|
1695
1776
|
document.addEventListener('keydown', onEsc, { capture: true });
|
|
@@ -1701,6 +1782,59 @@ const closeDropdown = async () => {
|
|
|
1701
1782
|
pause();
|
|
1702
1783
|
};
|
|
1703
1784
|
|
|
1785
|
+
/*
|
|
1786
|
+
* `v-model` = open, the rule of every
|
|
1787
|
+
* `v-model` here (useOwnModel): bound, the app's value is the state and the
|
|
1788
|
+
* user's opens and closes are emitted; a static value with no listener seeds
|
|
1789
|
+
* it. An open from code is a keyboard open at the activator or `anchor`:
|
|
1790
|
+
* focus on the first row, and back to the activator (else where it was) on
|
|
1791
|
+
* close.
|
|
1792
|
+
*/
|
|
1793
|
+
const { model: openModel, set: setOpenModel } = useOwnModel(
|
|
1794
|
+
props,
|
|
1795
|
+
'modelValue',
|
|
1796
|
+
emit,
|
|
1797
|
+
() => false
|
|
1798
|
+
);
|
|
1799
|
+
const openFromModel = async () => {
|
|
1800
|
+
// A task later: a menu whose row set the flag (open this one from another
|
|
1801
|
+
// menu's item) closes and hands focus back to its own activator first, so
|
|
1802
|
+
// that focus is not an outside press that closes this menu at once.
|
|
1803
|
+
await wait(0);
|
|
1804
|
+
if (!openModel.value || open.value) return;
|
|
1805
|
+
const focused = document.activeElement;
|
|
1806
|
+
returnFocusTo = focused instanceof HTMLElement ? focused : null;
|
|
1807
|
+
openModality = 'keyboard';
|
|
1808
|
+
await openDropdown();
|
|
1809
|
+
// Nothing to show (no visible row): the menu stays closed, and says so.
|
|
1810
|
+
if (!open.value) {
|
|
1811
|
+
setOpenModel(false);
|
|
1812
|
+
return;
|
|
1813
|
+
}
|
|
1814
|
+
if (useOffcanvas.value) return;
|
|
1815
|
+
await wait(0);
|
|
1816
|
+
rootList.value?.focusFirst(true);
|
|
1817
|
+
};
|
|
1818
|
+
watch(open, (value) => {
|
|
1819
|
+
if (openModel.value !== value) setOpenModel(value);
|
|
1820
|
+
});
|
|
1821
|
+
/** A close from code: focus inside the menu goes back to the activator. */
|
|
1822
|
+
const closeFromModel = () => {
|
|
1823
|
+
const focusInPanel = !!document.activeElement?.closest(
|
|
1824
|
+
`[data-bb-dropdown-surface="${CSS.escape(id)}"]`
|
|
1825
|
+
);
|
|
1826
|
+
void closeDropdown();
|
|
1827
|
+
if (focusInPanel) focusActivator();
|
|
1828
|
+
};
|
|
1829
|
+
watch(openModel, (value) => {
|
|
1830
|
+
if (value === open.value) return;
|
|
1831
|
+
if (value) void openFromModel();
|
|
1832
|
+
else closeFromModel();
|
|
1833
|
+
});
|
|
1834
|
+
onMounted(() => {
|
|
1835
|
+
if (openModel.value && !open.value) void openFromModel();
|
|
1836
|
+
});
|
|
1837
|
+
|
|
1704
1838
|
// An owner opening this menu from code: at a point, as a
|
|
1705
1839
|
// right-click (`'pointer'`) or Shift+F10 (`'keyboard'`, first row focused) would.
|
|
1706
1840
|
registerDropdownHandle({
|
|
@@ -1723,8 +1857,12 @@ registerDropdownHandle({
|
|
|
1723
1857
|
|
|
1724
1858
|
const removeDocumentListeners = () => {
|
|
1725
1859
|
removeEscapeEntry(escapeKey);
|
|
1726
|
-
document.removeEventListener('click', onOutsideInteraction
|
|
1727
|
-
|
|
1860
|
+
document.removeEventListener('click', onOutsideInteraction, {
|
|
1861
|
+
capture: true,
|
|
1862
|
+
});
|
|
1863
|
+
document.removeEventListener('contextmenu', onOutsideInteraction, {
|
|
1864
|
+
capture: true,
|
|
1865
|
+
});
|
|
1728
1866
|
document.removeEventListener('focusin', onOutsideInteraction);
|
|
1729
1867
|
document.removeEventListener('keydown', onEsc, { capture: true });
|
|
1730
1868
|
document.removeEventListener(DROPDOWN_OPEN_EVENT, onPeerOpen);
|
|
@@ -2110,18 +2248,12 @@ export type InternalItem = Omit<
|
|
|
2110
2248
|
* async items load (`'loading'`), when it resolved empty (`'empty'`), or
|
|
2111
2249
|
* when its latest load FAILED (`'failed'`: the footer under whatever rows a
|
|
2112
2250
|
* `stash` keeps listed). Rendered as a non-interactive row that
|
|
2113
|
-
* shows `label` or, when provided, the dropdown's `loading` / `empty` slot
|
|
2251
|
+
* shows `label` or, when provided, the dropdown's `loading` / `empty` slot (a
|
|
2252
|
+
* `'failed'` row always shows its own).
|
|
2114
2253
|
*
|
|
2115
2254
|
* @internal Set by `BbDropdownGroup`.
|
|
2116
2255
|
*/
|
|
2117
2256
|
placeholder?: 'loading' | 'empty' | 'failed';
|
|
2118
|
-
/**
|
|
2119
|
-
* On a `'failed'` placeholder: what the group's `items` load rejected
|
|
2120
|
-
* with, handed to the `empty` slot as `error`.
|
|
2121
|
-
*
|
|
2122
|
-
* @internal Set by the pipeline resolver.
|
|
2123
|
-
*/
|
|
2124
|
-
error?: unknown;
|
|
2125
2257
|
/**
|
|
2126
2258
|
* Marks a row built by the pipeline resolver from a fetched item. Its
|
|
2127
2259
|
* `selectable` predicate already ran against the RAW item there, so
|
|
@@ -2142,9 +2274,9 @@ export type InternalItem = Omit<
|
|
|
2142
2274
|
};
|
|
2143
2275
|
|
|
2144
2276
|
/**
|
|
2145
|
-
* An optionally titled, optionally selectable
|
|
2146
|
-
* props with {@link InternalItem} but does **not** extend BbBaseButton — it
|
|
2147
|
-
* descriptor, not an individually rendered button.
|
|
2277
|
+
* An optionally titled, optionally selectable group of the menu's rows. Shares
|
|
2278
|
+
* base props with {@link InternalItem} but does **not** extend BbBaseButton — it
|
|
2279
|
+
* is a group descriptor, not an individually rendered button.
|
|
2148
2280
|
*/
|
|
2149
2281
|
/**
|
|
2150
2282
|
* Async/array items getter for a pipeline group, returning the raw items
|
|
@@ -2170,13 +2302,18 @@ export type InternalItem = Omit<
|
|
|
2170
2302
|
* `failedText` with the error. Zero-argument providers keep working. An
|
|
2171
2303
|
* unannotated getter reads its context typed (`query` a string on a
|
|
2172
2304
|
* `searchable` group); a provider shared with other components is annotated
|
|
2173
|
-
* `BbDropdownGroupItemsContext`.
|
|
2305
|
+
* `BbDropdownGroupItemsContext`. A group whose `searchable` is a runtime
|
|
2306
|
+
* boolean takes rows or such a provider; a value typed as this union does
|
|
2307
|
+
* not fit it (its query-only member needs `searchable: true`).
|
|
2174
2308
|
*/
|
|
2175
2309
|
export type DropdownGroupItemsGetter = PlainGetter | SearchGetter;
|
|
2176
2310
|
|
|
2177
|
-
/**
|
|
2311
|
+
/**
|
|
2312
|
+
* A group without a search box: no `query` arrives (`undefined`, so the two
|
|
2313
|
+
* getters' contexts reject each other both ways, whatever the check order).
|
|
2314
|
+
*/
|
|
2178
2315
|
type PlainGetter = (
|
|
2179
|
-
context: BbDropdownGroupItemsContext
|
|
2316
|
+
context: BbDropdownGroupItemsContext & { query?: undefined }
|
|
2180
2317
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- a fetched group's rows are the API's records: the dropdown is not generic, so their type cannot reach the accessors
|
|
2181
2318
|
) => any[] | Promise<any[]>;
|
|
2182
2319
|
|
|
@@ -2326,12 +2463,19 @@ export type InternalGroup = DropdownEntryBase & {
|
|
|
2326
2463
|
/** Placeholder for this group's search field. Defaults to the localized label. */
|
|
2327
2464
|
searchPlaceholder?: string;
|
|
2328
2465
|
/**
|
|
2329
|
-
*
|
|
2466
|
+
* Characters to type before the search runs (`BbSelect`'s rule): below
|
|
2467
|
+
* it the query counts as empty. Requires `searchable`.
|
|
2468
|
+
*
|
|
2469
|
+
* @defaultValue `0`
|
|
2470
|
+
*/
|
|
2471
|
+
minQueryLength?: number;
|
|
2472
|
+
/**
|
|
2473
|
+
* Sorts the group's rows under headings, inside the one group (one
|
|
2330
2474
|
* `v-model`, one search field): a field path read off each row (a fetched
|
|
2331
|
-
* row: its raw item) or a getter returning the
|
|
2332
|
-
* nullish
|
|
2333
|
-
* which their first row appears, like `BbSelect`'s `groupBy`; a
|
|
2334
|
-
* a
|
|
2475
|
+
* row: its raw item) or a getter returning the heading. Rows with a
|
|
2476
|
+
* nullish value are listed first, without a heading. Headings keep the
|
|
2477
|
+
* order in which their first row appears, like `BbSelect`'s `groupBy`; a
|
|
2478
|
+
* search hides a heading with no matching row.
|
|
2335
2479
|
*/
|
|
2336
2480
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- the dropdown is not generic: a fetched row is whatever the getter returned, so an accessor annotated with the app's row type (`(c: Clinic) => c.name`) must fit
|
|
2337
2481
|
groupBy?: string | ((row: any) => string | null | undefined);
|
|
@@ -2367,7 +2511,7 @@ export type InternalGroup = DropdownEntryBase & {
|
|
|
2367
2511
|
stash?: boolean;
|
|
2368
2512
|
/**
|
|
2369
2513
|
* The group's label — rendered as its heading above the items, exposed as the
|
|
2370
|
-
*
|
|
2514
|
+
* group's title in the adaptive sheet, and surfaced on `useBbDropdown`
|
|
2371
2515
|
* (handy for chip prefixes / filter summaries).
|
|
2372
2516
|
*/
|
|
2373
2517
|
label?: string;
|
|
@@ -2452,7 +2596,7 @@ export const groupItemsAsArray = (
|
|
|
2452
2596
|
|
|
2453
2597
|
/**
|
|
2454
2598
|
* A string or number row: its own text and value (`'Google'` reads "Google"
|
|
2455
|
-
* and picks `'Google'`), loose, in a
|
|
2599
|
+
* and picks `'Google'`), loose, in a divider run, in a group's `items` or in a
|
|
2456
2600
|
* submenu's `items`. It declares `searchable` like every entry, so a group
|
|
2457
2601
|
* literal beside it still picks its plain or searchable getter.
|
|
2458
2602
|
*/
|
|
@@ -2465,7 +2609,7 @@ export type ItemEntry = Item | PrimitiveRow;
|
|
|
2465
2609
|
* Items accepted by the dropdown. Entries can be:
|
|
2466
2610
|
* - a single {@link InternalItem};
|
|
2467
2611
|
* - an array of items — rendered as an anonymous divider-separated group;
|
|
2468
|
-
* - a {@link InternalGroup} object — a titled / selectable
|
|
2612
|
+
* - a {@link InternalGroup} object — a titled / selectable group.
|
|
2469
2613
|
*
|
|
2470
2614
|
* The shapes can be mixed, e.g. `[item, [item, item], { id, label, items }]`.
|
|
2471
2615
|
*/
|
|
@@ -2558,7 +2702,9 @@ export type NormalizedGroup = {
|
|
|
2558
2702
|
searchable?: boolean;
|
|
2559
2703
|
/** Placeholder for this group's search field. */
|
|
2560
2704
|
searchPlaceholder?: string;
|
|
2561
|
-
/**
|
|
2705
|
+
/** Characters to type before the search runs (see {@link InternalGroup.minQueryLength}). */
|
|
2706
|
+
minQueryLength?: number;
|
|
2707
|
+
/** Heading per row (see {@link InternalGroup.groupBy}). */
|
|
2562
2708
|
groupBy?: InternalGroup['groupBy'];
|
|
2563
2709
|
selectable: boolean;
|
|
2564
2710
|
/** Selected row keys (`rowKey`; injected by `BbDropdown`; empty for non-selectable groups). */
|
|
@@ -2596,6 +2742,8 @@ export type MappedItem = InternalItem & {
|
|
|
2596
2742
|
* `BbOffCanvas` root) — never the desktop surface. Applied after `panel`, so it wins a conflict there.
|
|
2597
2743
|
* @part header - The menu's header band.
|
|
2598
2744
|
* @part footer - The menu's footer band.
|
|
2745
|
+
* @part box - Every searchable group's search box (field and magnifier),
|
|
2746
|
+
* as `box` on a field; desktop and phone.
|
|
2599
2747
|
* @part input - A searchable group's search field — a broadcast: it lands on
|
|
2600
2748
|
* every searchable group's field, desktop and phone alike. Its magnifier
|
|
2601
2749
|
* glyph is chrome.
|
|
@@ -2624,6 +2772,7 @@ export type BbDropdownPtPart =
|
|
|
2624
2772
|
| 'sheet'
|
|
2625
2773
|
| 'header'
|
|
2626
2774
|
| 'footer'
|
|
2775
|
+
| 'box'
|
|
2627
2776
|
| 'input'
|
|
2628
2777
|
| 'list'
|
|
2629
2778
|
| 'item'
|
|
@@ -2639,6 +2788,7 @@ export type BbDropdownSurfacePtPart =
|
|
|
2639
2788
|
| 'sheet'
|
|
2640
2789
|
| 'header'
|
|
2641
2790
|
| 'footer'
|
|
2791
|
+
| 'box'
|
|
2642
2792
|
| 'input'
|
|
2643
2793
|
| 'list';
|
|
2644
2794
|
/** The entry parts — broadcasts resolved per entry; their base key also takes a per-item function. Spelled flat (T20). */
|
|
@@ -2701,6 +2851,7 @@ export const BB_DROPDOWN_PT = {
|
|
|
2701
2851
|
'sheet',
|
|
2702
2852
|
'header',
|
|
2703
2853
|
'footer',
|
|
2854
|
+
'box',
|
|
2704
2855
|
'input',
|
|
2705
2856
|
'list',
|
|
2706
2857
|
'item',
|
|
@@ -2821,11 +2972,13 @@ export type BbDropdownProps = BbDropdownPtProps & {
|
|
|
2821
2972
|
* @defaultValue the activator element
|
|
2822
2973
|
*/
|
|
2823
2974
|
anchor?: ElementOrComponentRef | VirtualAnchor;
|
|
2975
|
+
/** Whether the menu is open (`v-model`): `true` opens it from code at its activator or `anchor`. Unbound: the initial state. */
|
|
2976
|
+
modelValue?: boolean;
|
|
2824
2977
|
/**
|
|
2825
|
-
* Keeps the panel inside this element beside its trigger (sideways
|
|
2826
|
-
* menu
|
|
2827
|
-
*
|
|
2828
|
-
* `
|
|
2978
|
+
* Keeps the panel inside this element beside its trigger (sideways under a
|
|
2979
|
+
* menu); away from it only the viewport flips it. An element, component ref
|
|
2980
|
+
* or CSS selector (a `useTemplateRef`, not `$refs.x`). Default in a
|
|
2981
|
+
* `BbTable`: the table's left and right edges.
|
|
2829
2982
|
*/
|
|
2830
2983
|
// Spelled out, not `ElementOrComponentRefOrSelector`: one type name
|
|
2831
2984
|
// fewer in the component's agent answer, which sits at its size cap.
|
|
@@ -2855,7 +3008,7 @@ export type BbDropdownProps = BbDropdownPtProps & {
|
|
|
2855
3008
|
/**
|
|
2856
3009
|
* The menu rows, each a `BbBaseButton` (`button`, `a` or `router-link`): a
|
|
2857
3010
|
* flat array for one group, nested arrays for divider-separated groups, or
|
|
2858
|
-
* `InternalGroup` objects for titled / selectable
|
|
3011
|
+
* `InternalGroup` objects for titled / selectable groups. A row's own
|
|
2859
3012
|
* `items` opens a submenu.
|
|
2860
3013
|
*
|
|
2861
3014
|
* @defaultValue `[]`
|
|
@@ -2867,23 +3020,11 @@ export type BbDropdownProps = BbDropdownPtProps & {
|
|
|
2867
3020
|
* trigger always stays.
|
|
2868
3021
|
*/
|
|
2869
3022
|
keepActivator?: boolean;
|
|
2870
|
-
/**
|
|
2871
|
-
* Default placeholder text shown while a pipeline group's async items load.
|
|
2872
|
-
* A group's own `loadingText` overrides this; both fall back to the localized
|
|
2873
|
-
* `common.loadingText` (`'Loading...'`).
|
|
2874
|
-
*/
|
|
3023
|
+
/** A pipeline group's loading row; its own `loadingText` wins. Default: `common.loadingText`. */
|
|
2875
3024
|
loadingText?: string;
|
|
2876
|
-
/**
|
|
2877
|
-
* Default placeholder text shown when a pipeline group resolves to no items.
|
|
2878
|
-
* A group's own `emptyText` overrides this; both fall back to the localized
|
|
2879
|
-
* `common.emptyText` (`'No data to display'`).
|
|
2880
|
-
*/
|
|
3025
|
+
/** A pipeline group's no-items row; its own `emptyText` wins. Default: `common.emptyText`. */
|
|
2881
3026
|
emptyText?: string;
|
|
2882
|
-
/**
|
|
2883
|
-
* Default placeholder text shown when a pipeline group's latest load FAILED
|
|
2884
|
-
* (its `items` getter threw). A group's own `failedText` overrides this; both
|
|
2885
|
-
* fall back to the localized `common.failedText` (`"Couldn't load items"`).
|
|
2886
|
-
*/
|
|
3027
|
+
/** A pipeline group's failed-load row (its getter threw); its own `failedText` wins. Default: `common.failedText`. */
|
|
2887
3028
|
failedText?: string;
|
|
2888
3029
|
/**
|
|
2889
3030
|
* Props for the phone sheet (the `BbOffCanvas` that `adaptive` renders on
|
|
@@ -2944,6 +3085,8 @@ export type BbDropdownProps = BbDropdownPtProps & {
|
|
|
2944
3085
|
};
|
|
2945
3086
|
|
|
2946
3087
|
export type BbDropdownEvents = {
|
|
3088
|
+
/** The menu opened or closed (`v-model`): `true` on open, `false` on close. */
|
|
3089
|
+
(e: 'update:modelValue', value: boolean): void;
|
|
2947
3090
|
/** Emitted as soon as the menu (the popover, or the sheet on a phone) starts to open. */
|
|
2948
3091
|
(e: 'show'): void;
|
|
2949
3092
|
/** Emitted once the menu is open and its open transition has finished. */
|
|
@@ -3021,6 +3164,20 @@ export type BbDropdownSlotGroup = {
|
|
|
3021
3164
|
selectable: boolean;
|
|
3022
3165
|
};
|
|
3023
3166
|
|
|
3167
|
+
/** A `groupBy` heading's slot scope (`BbSelect`'s `#group`). */
|
|
3168
|
+
export type BbDropdownGroupSlotProps = {
|
|
3169
|
+
/** The heading text. */
|
|
3170
|
+
text: string;
|
|
3171
|
+
/** The raw `groupBy` value. */
|
|
3172
|
+
item: unknown;
|
|
3173
|
+
/** The heading's position. */
|
|
3174
|
+
index: number;
|
|
3175
|
+
/** Its row count. */
|
|
3176
|
+
length: number;
|
|
3177
|
+
/** Every row disabled. */
|
|
3178
|
+
disabled: boolean;
|
|
3179
|
+
};
|
|
3180
|
+
|
|
3024
3181
|
/** Props exposed by the `item:prepend` and `item:append` slots, and named item slots. */
|
|
3025
3182
|
export type BbDropdownItemSlotProps = {
|
|
3026
3183
|
/** The item's muted description line, when set. */
|
|
@@ -3082,14 +3239,8 @@ export type BbDropdownPlaceholderSlotProps = {
|
|
|
3082
3239
|
* e.g. for "Type at least 2 characters" under a remote search's minimum.
|
|
3083
3240
|
*/
|
|
3084
3241
|
query: string;
|
|
3085
|
-
/** Resolved placeholder text (group `loadingText`/`emptyText
|
|
3242
|
+
/** Resolved placeholder text (group `loadingText`/`emptyText` → dropdown default). */
|
|
3086
3243
|
text: string;
|
|
3087
|
-
/**
|
|
3088
|
-
* `empty` slot only: what the group's latest failed `items` load rejected
|
|
3089
|
-
* with, untouched (a nullish rejection becomes an `Error`); `null` when the
|
|
3090
|
-
* group is genuinely empty. Absent on the `loading` slot.
|
|
3091
|
-
*/
|
|
3092
|
-
error?: unknown;
|
|
3093
3244
|
};
|
|
3094
3245
|
|
|
3095
3246
|
/**
|
|
@@ -3108,9 +3259,10 @@ export type BbDropdownPlaceholderSlotProps = {
|
|
|
3108
3259
|
* @dynamicSlot `<groupId>:item` {BbDropdownItemSlotProps} - The content of every row of that group, and no other; a row's own `#<value>` still wins.
|
|
3109
3260
|
* @dynamicSlot `<groupId>:item:prepend` {BbDropdownItemSlotProps} - The leading region of every row of that group — e.g. an avatar per record, drawn from `item.meta`, while other rows keep their `prepend:icon`.
|
|
3110
3261
|
* @dynamicSlot `<groupId>:item:append` {BbDropdownItemSlotProps} - The trailing region of every row of that group; replaces their `append:icon`. The check takes its place on the selected row.
|
|
3111
|
-
* @dynamicSlot `<groupId
|
|
3262
|
+
* @dynamicSlot `<groupId>:label` {BbDropdownItemSlotProps} - That group's title content (`item` is the group, `groupTitle` is `true`).
|
|
3112
3263
|
* @dynamicSlot `<groupId>:prepend` {BbDropdownItemSlotProps} - The leading region of that group's title line.
|
|
3113
3264
|
* @dynamicSlot `<groupId>:append` {BbDropdownItemSlotProps} - The trailing region of that group's title line.
|
|
3265
|
+
* @dynamicSlot `<groupId>:group` {BbDropdownGroupSlotProps} - That group's `groupBy` headings; beats `group`.
|
|
3114
3266
|
*/
|
|
3115
3267
|
export type BbDropdownSlots = {
|
|
3116
3268
|
/**
|
|
@@ -3125,7 +3277,8 @@ export type BbDropdownSlots = {
|
|
|
3125
3277
|
loading?: (props: BbDropdownPlaceholderSlotProps) => any;
|
|
3126
3278
|
/**
|
|
3127
3279
|
* Replaces the default "no data" placeholder row shown in a pipeline group
|
|
3128
|
-
* that resolved to no items. Rendered once per empty group.
|
|
3280
|
+
* that resolved to no items. Rendered once per empty group. A failed load
|
|
3281
|
+
* is not empty: it keeps its own row (the error icon and `failedText`).
|
|
3129
3282
|
*/
|
|
3130
3283
|
empty?: (props: BbDropdownPlaceholderSlotProps) => any;
|
|
3131
3284
|
/**
|
|
@@ -3139,13 +3292,13 @@ export type BbDropdownSlots = {
|
|
|
3139
3292
|
header?: (props: BbDropdownEdgeSlotProps) => any;
|
|
3140
3293
|
/**
|
|
3141
3294
|
* The leading region of every row (and group title line), replacing its
|
|
3142
|
-
* `prepend:icon
|
|
3295
|
+
* `prepend:icon` wherever it renders. A named slot wins.
|
|
3143
3296
|
*/
|
|
3144
3297
|
'item:prepend'?: (props: BbDropdownItemSlotProps) => any;
|
|
3145
3298
|
/**
|
|
3146
3299
|
* The trailing region of every row (and group title line), replacing its
|
|
3147
|
-
* `append:icon
|
|
3148
|
-
* check on a selected row take its place.
|
|
3300
|
+
* `append:icon` wherever it renders. A named slot wins; the submenu
|
|
3301
|
+
* chevron and the check on a selected row take its place.
|
|
3149
3302
|
*/
|
|
3150
3303
|
'item:append'?: (props: BbDropdownItemSlotProps) => any;
|
|
3151
3304
|
/**
|
|
@@ -3153,6 +3306,8 @@ export type BbDropdownSlots = {
|
|
|
3153
3306
|
* action buttons.
|
|
3154
3307
|
*/
|
|
3155
3308
|
footer?: (props: BbDropdownEdgeSlotProps) => any;
|
|
3309
|
+
/** Every group's `groupBy` headings (`BbSelect`'s `#group` scope); `#<groupId>:group` beats it. */
|
|
3310
|
+
group?: (props: BbDropdownGroupSlotProps) => unknown;
|
|
3156
3311
|
} & Record<string, (props: BbDropdownItemSlotProps) => any>;
|
|
3157
3312
|
|
|
3158
3313
|
/**
|
|
@@ -3551,6 +3706,21 @@ export type BbDropdownGroupEvents = {
|
|
|
3551
3706
|
}
|
|
3552
3707
|
}
|
|
3553
3708
|
|
|
3709
|
+
/* `groupBy` headings are sticky, as BbSelect's group headers: the
|
|
3710
|
+
scrolled heading stays pinned while its rows pass under it, over the
|
|
3711
|
+
list's own inset so no row peeks above it. A row focused from the
|
|
3712
|
+
keyboard stops below it, never under it. */
|
|
3713
|
+
.bb-dropdown__section-title {
|
|
3714
|
+
background-color: var(--bg);
|
|
3715
|
+
position: sticky;
|
|
3716
|
+
top: calc(-1 * var(--menu-inset));
|
|
3717
|
+
z-index: 1;
|
|
3718
|
+
}
|
|
3719
|
+
|
|
3720
|
+
.bb-dropdown__section .bb-dropdown__item {
|
|
3721
|
+
scroll-margin-top: 1.75rem;
|
|
3722
|
+
}
|
|
3723
|
+
|
|
3554
3724
|
.bb-dropdown__divider {
|
|
3555
3725
|
/* Negative inline margins cancel the container padding so the rule
|
|
3556
3726
|
* spans the full width of the dropdown panel, edge to edge. */
|
|
@@ -3697,10 +3867,12 @@ export type BbDropdownGroupEvents = {
|
|
|
3697
3867
|
* append icon were present. Absolute + pad-only-when-selected lets
|
|
3698
3868
|
* unselected labels use the full row.
|
|
3699
3869
|
*/
|
|
3870
|
+
/* sized by the `--icon-size` knob, like the row's
|
|
3871
|
+
icons: a 14px-icon menu gets a 14px check and a matching clearance. */
|
|
3700
3872
|
.item__check {
|
|
3701
|
-
--size:
|
|
3873
|
+
--size: var(--icon-size);
|
|
3702
3874
|
color: var(--bb-text);
|
|
3703
|
-
font-size:
|
|
3875
|
+
font-size: calc(var(--icon-size) - 1px);
|
|
3704
3876
|
inset-inline-end: 6px;
|
|
3705
3877
|
pointer-events: none;
|
|
3706
3878
|
position: absolute;
|
|
@@ -3717,7 +3889,7 @@ export type BbDropdownGroupEvents = {
|
|
|
3717
3889
|
|
|
3718
3890
|
&.bb-dropdown__item--selected {
|
|
3719
3891
|
/* Keep the label clear of the absolute check. */
|
|
3720
|
-
padding-inline-end: calc(6px +
|
|
3892
|
+
padding-inline-end: calc(6px + var(--check-w, var(--icon-size)) + 4px);
|
|
3721
3893
|
|
|
3722
3894
|
.item__check path {
|
|
3723
3895
|
stroke-dashoffset: 0;
|
|
@@ -3800,6 +3972,9 @@ export type BbDropdownGroupEvents = {
|
|
|
3800
3972
|
and passed it again. Tied to the same constant, a title can no longer end
|
|
3801
3973
|
up smaller than the list beneath it whatever that constant becomes. */
|
|
3802
3974
|
--dialog-title-fs: var(--sheet-option-fs, 1rem);
|
|
3975
|
+
/* The sheet reads no `--icon-size` (its rows size their own glyphs): the
|
|
3976
|
+
check's clearance stays 16px whatever the menu sets. */
|
|
3977
|
+
--check-w: 16px;
|
|
3803
3978
|
|
|
3804
3979
|
/* Root sheet title via `offCanvasProps.title` (no drill nav / custom
|
|
3805
3980
|
`#header`): centre it and tighten the title→divider air like BbSelect.
|
|
@@ -4186,6 +4361,31 @@ export type BbDropdownGroupEvents = {
|
|
|
4186
4361
|
* both apply they agree, so nothing shifts on selection.
|
|
4187
4362
|
*/
|
|
4188
4363
|
.bb-dropdown__panel--reserve-check .bb-dropdown__item:has(.item__check) {
|
|
4189
|
-
padding-inline-end: calc(6px +
|
|
4364
|
+
padding-inline-end: calc(6px + var(--check-w, var(--icon-size)) + 4px);
|
|
4365
|
+
}
|
|
4366
|
+
|
|
4367
|
+
/* A root-level group's failed load, drawn next to
|
|
4368
|
+
the menu by DropdownFailures.vue: the destructive alert's voice, as the
|
|
4369
|
+
in-menu row it replaces, then "Try again". Its own divider only when rows
|
|
4370
|
+
sit above it; otherwise the search field's is the one divider. */
|
|
4371
|
+
.bb-dropdown .bb-dropdown__failed {
|
|
4372
|
+
align-items: center;
|
|
4373
|
+
color: var(--bb-danger);
|
|
4374
|
+
column-gap: 8px;
|
|
4375
|
+
display: flex;
|
|
4376
|
+
line-height: 1.2;
|
|
4377
|
+
min-height: 28px;
|
|
4378
|
+
padding: 2px calc(6px + var(--menu-inset, 4px)) var(--menu-inset, 4px);
|
|
4379
|
+
|
|
4380
|
+
.bb-dropdown__placeholder-icon {
|
|
4381
|
+
--size: 1rem;
|
|
4382
|
+
flex: none;
|
|
4383
|
+
/* The seat measured level against the text (see the listbox footer). */
|
|
4384
|
+
margin-top: -1.5px;
|
|
4385
|
+
}
|
|
4386
|
+
}
|
|
4387
|
+
|
|
4388
|
+
.bb-dropdown .bb-dropdown__list:has(.bb-dropdown__item) ~ .bb-dropdown__failed {
|
|
4389
|
+
border-top: var(--bb-border-w) solid var(--bb-border);
|
|
4190
4390
|
}
|
|
4191
4391
|
```
|