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
package/dist/ai/BbDropdown.md
CHANGED
|
@@ -50,13 +50,13 @@ An `items` entry is one of three shapes, and you can mix them freely:
|
|
|
50
50
|
|
|
51
51
|
- a **menu item** — an object with a `value` and a `label`; a string or
|
|
52
52
|
number row is its own text and value (`items: ['Google', 'Bing']`);
|
|
53
|
-
- a **
|
|
54
|
-
|
|
53
|
+
- a **divider run** — a nested `[ … ]` array: its rows, with a divider before
|
|
54
|
+
and after, and nothing else (no title, no value of its own);
|
|
55
55
|
- a **group object** — `{ id, label?, items, selectable?, … }`, a titled and/or
|
|
56
|
-
selectable
|
|
56
|
+
selectable group (described below). A group with plain rows and no
|
|
57
57
|
`selectable` needs `group: true` to be a group rather than a submenu row;
|
|
58
|
-
[
|
|
59
|
-
`groupBy`, which
|
|
58
|
+
[Headings](#headings-group-true-or-groupby) compares it with
|
|
59
|
+
`groupBy`, which puts the rows of one group under headings. A group's heading is its `label` too;
|
|
60
60
|
add `hideLabel` to keep the `label` for the adaptive sheet title / chips /
|
|
61
61
|
`useBbDropdown` while rendering no heading in the menu.
|
|
62
62
|
|
|
@@ -165,7 +165,7 @@ const items: BbDropdownItem[] = [
|
|
|
165
165
|
href: '#preview',
|
|
166
166
|
target: '_blank',
|
|
167
167
|
},
|
|
168
|
-
// A nested array becomes its own divider
|
|
168
|
+
// A nested array becomes its own divider run. A destructive
|
|
169
169
|
// item never acts directly: its onClick awaits useConfirm and only
|
|
170
170
|
// proceeds on a yes.
|
|
171
171
|
[
|
|
@@ -462,8 +462,9 @@ Behavior you can rely on:
|
|
|
462
462
|
- a change in a **single** group closes the menu and puts focus back on the
|
|
463
463
|
trigger: a pick (the same value included) or a `clearable` group's clear,
|
|
464
464
|
wherever the group sits (inside a submenu too) and whatever else the menu
|
|
465
|
-
holds — a filter menu with a "Role" list and a "Deleted"
|
|
466
|
-
closes after either
|
|
465
|
+
holds — a filter menu with a "Role" list and a "Deleted" entry made a
|
|
466
|
+
`clearable` single group closes after either (which on/off recipe to pick:
|
|
467
|
+
see [Gotchas and anti-patterns](#gotchas-and-anti-patterns));
|
|
467
468
|
- a **multiple** group keeps the menu open while you toggle;
|
|
468
469
|
- `close-on-select` overrides both: `true` closes after every selection
|
|
469
470
|
change (a multiple pick included), `false` never closes on a selection.
|
|
@@ -673,20 +674,21 @@ rows distinct values when it matters:
|
|
|
673
674
|
- **Submenu parents.** A row that opens a submenu needs a value unique in the
|
|
674
675
|
whole menu; the flyout is addressed by it.
|
|
675
676
|
|
|
676
|
-
###
|
|
677
|
+
### Headings: `group: true` or `groupBy`
|
|
677
678
|
|
|
678
679
|
Two ways to put headings in a menu, for two different needs:
|
|
679
680
|
|
|
680
|
-
- **Independent
|
|
681
|
-
with `group: true` is
|
|
682
|
-
|
|
681
|
+
- **Independent groups, each its own chooser: `group: true`.** A group object
|
|
682
|
+
with `group: true` is titled (its `label` is the heading) without being
|
|
683
|
+
selectable; give it `selectable` and it becomes its own chooser. Each
|
|
683
684
|
group keeps **its own** value (its own companion and `v-model`) and, when
|
|
684
|
-
`searchable`, its own search field. Use it for
|
|
685
|
+
`searchable`, its own search field. Use it for groups that answer
|
|
685
686
|
different questions ("Sort by" / "Show").
|
|
686
687
|
- **One choice, sorted under headings: `groupBy` on one group.** The rows of a
|
|
687
|
-
single group are listed under
|
|
688
|
+
single group are listed under headings, and it stays one group:
|
|
688
689
|
**one** `v-model`, **one** search field. Use it when the headings only
|
|
689
690
|
organise the options of one question (categories under their sector).
|
|
691
|
+
Its headings are sticky, as `BbSelect`'s group headers are.
|
|
690
692
|
|
|
691
693
|
```vue
|
|
692
694
|
<BbDropdown
|
|
@@ -712,14 +714,23 @@ Two ways to put headings in a menu, for two different needs:
|
|
|
712
714
|
- `groupBy` is a field path (`'sector'`, `'owner.team'`) read off each row,
|
|
713
715
|
or a function `(row) => string | null | undefined`. On a fetched group it
|
|
714
716
|
reads the **raw item**, so `items: ({ query }) => …` groups the same way.
|
|
715
|
-
-
|
|
716
|
-
`null`, `undefined` or `''` have no
|
|
717
|
+
- Headings keep the order of their first row. Rows whose `groupBy` gives
|
|
718
|
+
`null`, `undefined` or `''` have no heading: they are listed **first**,
|
|
717
719
|
before every heading — the same rule as `BbSelect`'s `group-by`.
|
|
718
720
|
- A heading is not a row: the arrows and typeahead skip it, and it is never
|
|
719
|
-
selected. A search hides a
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
721
|
+
selected. A search hides a heading left without a matching row.
|
|
722
|
+
- The rows under each heading are a `role="group"` labelled by it, with the
|
|
723
|
+
look of a group title. The adaptive sheet shows the same headings.
|
|
724
|
+
- `#group` replaces every heading's content, `#<groupId>:group` one group's,
|
|
725
|
+
with `BbSelect`'s `#group` scope: `{ text, item, index, length, disabled }`
|
|
726
|
+
(`item` is the raw `groupBy` value, `length` the rows under it, `disabled`
|
|
727
|
+
whether all of them are). A count and a divider, for example:
|
|
728
|
+
|
|
729
|
+
```vue
|
|
730
|
+
<template #category:group="{ text, length }">
|
|
731
|
+
{{ text }} <span class="ms-auto text-xs">{{ length }}</span>
|
|
732
|
+
</template>
|
|
733
|
+
```
|
|
723
734
|
|
|
724
735
|
### Loading options on demand
|
|
725
736
|
|
|
@@ -742,8 +753,10 @@ The full grammar:
|
|
|
742
753
|
need the mapping. On a **`searchable`** group the context also carries
|
|
743
754
|
`query` (what the user typed, and `reason: 'search'` when they did) —
|
|
744
755
|
the same shape `BbSelect` passes, which is why one provider drops into both.
|
|
745
|
-
A getter **throws** to fail: the
|
|
746
|
-
|
|
756
|
+
A getter **throws** to fail: the panel shows the group's failure row (an
|
|
757
|
+
error icon, `failedText` and a "Try again" button that runs the failed call
|
|
758
|
+
again with the same query) next to the menu, instead of "no data", even
|
|
759
|
+
when `#empty` is slotted: `#empty` means empty.
|
|
747
760
|
- `itemText` / `itemValue` — a path string or getter producing each raw item's
|
|
748
761
|
label and value; without them a row reads its own `label` (else `text`) and
|
|
749
762
|
`value`. `v-model` on the companion surfaces the selected value(s);
|
|
@@ -756,7 +769,7 @@ The full grammar:
|
|
|
756
769
|
- `loadingText` / `emptyText` / `failedText` — placeholder row text per
|
|
757
770
|
group; the dropdown-level `loading-text` / `empty-text` / `failed-text` props
|
|
758
771
|
set the default for all groups, and the `#loading` / `#empty` slots (payload:
|
|
759
|
-
`{ text, groupId, query }
|
|
772
|
+
`{ text, groupId, query }`) replace the loading and empty placeholder
|
|
760
773
|
rows entirely. `query` is the group's search text (`''` without one), like
|
|
761
774
|
`BbSelect`'s `#empty="{ query }"`.
|
|
762
775
|
- `dependencies: [...]` + `depsDebounceTime` — re-run the getter (debounced)
|
|
@@ -1221,7 +1234,7 @@ What each knob does:
|
|
|
1221
1234
|
ranked search (case and accents ignored; exact, then starts-with, then word
|
|
1222
1235
|
starts, then contains, then a code typed without separators; one typo per
|
|
1223
1236
|
word of 5+ letters only when nothing else matched; ranked inside each
|
|
1224
|
-
`groupBy`
|
|
1237
|
+
`groupBy` heading), and on an async group passes the typed text to the getter as
|
|
1225
1238
|
`query` in its context object (`reason: 'search'`), the same shape
|
|
1226
1239
|
`BbSelect` uses, so one provider serves both.
|
|
1227
1240
|
- **`filterBy`** picks which raw fields the local search reads. Empty
|
|
@@ -1239,9 +1252,11 @@ What each knob does:
|
|
|
1239
1252
|
`searchable`, which is the one place the three-state `prefill` differs from a
|
|
1240
1253
|
plain menu group (`'interaction'`, the default, fetches when the group is
|
|
1241
1254
|
first reached; `true` fetches on mount).
|
|
1242
|
-
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1255
|
+
- **`minQueryLength`** (as on `BbSelect`): below that many characters
|
|
1256
|
+
(trimmed) the query counts as empty, so no `'search'` call and no filtering
|
|
1257
|
+
run, and the field says how many characters to type (on a search-first
|
|
1258
|
+
group, its hint row too: "Type at least 2 characters"). Slots still get the
|
|
1259
|
+
typed `query`. No guard in the getter:
|
|
1245
1260
|
|
|
1246
1261
|
```vue
|
|
1247
1262
|
<BbDropdown
|
|
@@ -1252,15 +1267,12 @@ What each knob does:
|
|
|
1252
1267
|
searchable: true,
|
|
1253
1268
|
selectable: true,
|
|
1254
1269
|
prefill: false,
|
|
1270
|
+
minQueryLength: 2,
|
|
1255
1271
|
filterBy: false,
|
|
1256
|
-
items: ({ query }) =>
|
|
1272
|
+
items: ({ query }) => api.zones({ q: query }),
|
|
1257
1273
|
},
|
|
1258
1274
|
]"
|
|
1259
|
-
|
|
1260
|
-
<template #empty="{ query, text }">
|
|
1261
|
-
{{ query.length < 2 ? 'Type at least 2 characters' : text }}
|
|
1262
|
-
</template>
|
|
1263
|
-
</BbDropdown>
|
|
1275
|
+
/>
|
|
1264
1276
|
```
|
|
1265
1277
|
|
|
1266
1278
|
- **`stash`** accumulates the items behind _selected_ keys so they stay
|
|
@@ -1335,12 +1347,13 @@ and `"deleteFile"` all → `#delete-file`. For a value with accents, non-Latin l
|
|
|
1335
1347
|
when unsure, write `#[slotKey('Qualità')]` (`import { slotKey } from
|
|
1336
1348
|
'bitboss-ui'`) instead of spelling it by hand.
|
|
1337
1349
|
|
|
1338
|
-
| Slot | Renders for
|
|
1339
|
-
| ------------------------------------------------------------- |
|
|
1340
|
-
| `#<value>`, `#<value>:prepend`, `#<value>:append` | one row — its content, leading or trailing region
|
|
1341
|
-
| `#<groupId>:item`, `#<groupId>:item:prepend`, `…:item:append` | **every row of that group**, and nothing else
|
|
1342
|
-
| `#<groupId
|
|
1343
|
-
|
|
|
1350
|
+
| Slot | Renders for |
|
|
1351
|
+
| ------------------------------------------------------------- | ---------------------------------------------------------- |
|
|
1352
|
+
| `#<value>`, `#<value>:prepend`, `#<value>:append` | one row — its content, leading or trailing region |
|
|
1353
|
+
| `#<groupId>:item`, `#<groupId>:item:prepend`, `…:item:append` | **every row of that group**, and nothing else |
|
|
1354
|
+
| `#<groupId>:label`, `#<groupId>:prepend`, `#<groupId>:append` | that group's title line — its content, leading or trailing |
|
|
1355
|
+
| `#group`, `#<groupId>:group` | the `groupBy` headings — every group's, or one group's |
|
|
1356
|
+
| `item:prepend`, `item:append` | every row **and** every group title line, across the menu |
|
|
1344
1357
|
|
|
1345
1358
|
Each edge of a row has **one occupant** — nothing renders side by side. From
|
|
1346
1359
|
strongest to weakest:
|
|
@@ -1354,7 +1367,9 @@ strongest to weakest:
|
|
|
1354
1367
|
| `item:prepend` | `item:append` |
|
|
1355
1368
|
| `prepend:icon` | `append:icon` |
|
|
1356
1369
|
|
|
1357
|
-
So a slot
|
|
1370
|
+
So a slot replaces the row's icon and the most specific slot wins. A slot
|
|
1371
|
+
that renders nothing for a row (its content behind a `v-if` that is false
|
|
1372
|
+
there) is skipped: the next one down draws, down to the row's own icon. A
|
|
1358
1373
|
row's own `#<value>:append` is written for that one row, so it may replace its
|
|
1359
1374
|
submenu chevron; the group-wide and shared append slots never do, so a submenu
|
|
1360
1375
|
row keeps its chevron unless you name it. The check beats everything — as in
|
|
@@ -1620,8 +1635,9 @@ Two things this replaces, both seen in real apps:
|
|
|
1620
1635
|
`v-else-if="clinicsById.get(item.value)"`) to tell a record row from an action
|
|
1621
1636
|
row, and a lookup map rebuilt from the fetch to get the record back. The
|
|
1622
1637
|
group row slot is the "which rows" answer; `item.meta` is the record.
|
|
1623
|
-
- **Re-drawing the other rows' icons
|
|
1624
|
-
|
|
1638
|
+
- **Re-drawing the other rows' icons** in a shared `item:prepend`. A shared
|
|
1639
|
+
slot that renders nothing for a row leaves that row its `prepend:icon`, but
|
|
1640
|
+
the group row slot never has to ask.
|
|
1625
1641
|
|
|
1626
1642
|
### Header and footer
|
|
1627
1643
|
|
|
@@ -1629,7 +1645,19 @@ Two things this replaces, both seen in real apps:
|
|
|
1629
1645
|
content above and below the scrolling items, each separated by a divider. Use
|
|
1630
1646
|
the header for a title or a filter field and the footer for a persistent
|
|
1631
1647
|
action — they stay put while the list scrolls. On the mobile sheet they become
|
|
1632
|
-
the sheet's pinned header and footer
|
|
1648
|
+
the sheet's pinned header and footer, and the footer takes the sheet's footer
|
|
1649
|
+
layout (BbOffCanvas § Header, footer and body): what you slot straight in is
|
|
1650
|
+
laid out as a row of buttons at the end, 8px apart, wrapping. To keep your own
|
|
1651
|
+
layout there (a full-width button, a hint beside an action), wrap the footer
|
|
1652
|
+
in one `<div>`: a single wrapping element stretches across the sheet and lays
|
|
1653
|
+
out its children itself. The example below does that, so the button spans the
|
|
1654
|
+
footer on both surfaces.
|
|
1655
|
+
|
|
1656
|
+
A note in the footer (a sentence, not a button) is text like any other: with
|
|
1657
|
+
the default `width="auto"` the menu grows to fit it, and it wraps only once
|
|
1658
|
+
the menu reaches the space it has, so a long note makes a wide menu over short
|
|
1659
|
+
rows. Set `width` on the dropdown (`:width="240"`) and the note wraps at that
|
|
1660
|
+
width instead. No zero-width wrapper or `nowrap` override is needed.
|
|
1633
1661
|
|
|
1634
1662
|
**Pinned header and footer**
|
|
1635
1663
|
|
|
@@ -1744,6 +1772,66 @@ const items: BbDropdownItem[] = [
|
|
|
1744
1772
|
</script>
|
|
1745
1773
|
```
|
|
1746
1774
|
|
|
1775
|
+
### Opening from code: `v-model`
|
|
1776
|
+
|
|
1777
|
+
`v-model` is whether the menu is open, as on `BbDialog` and `BbOffCanvas`.
|
|
1778
|
+
Bound, your flag controls it: set it to `true` and the menu opens at its
|
|
1779
|
+
activator (or at `anchor`, when there is no activator to open it), with focus
|
|
1780
|
+
on its first row, as a keyboard open; set it to `false` and it closes, focus
|
|
1781
|
+
going back to the activator (or to where it was). The user's opens and closes
|
|
1782
|
+
update the flag. A static `:model-value` with no listener is only the initial
|
|
1783
|
+
state: `:model-value="false"` starts closed, and the activator still opens it.
|
|
1784
|
+
|
|
1785
|
+
The case it is for: one menu's row opens another menu at the same place — a
|
|
1786
|
+
row menu's "Delegate to…" that opens a searchable people menu under the same
|
|
1787
|
+
button, or a dialog header action that opens a menu anchored to it:
|
|
1788
|
+
|
|
1789
|
+
```vue
|
|
1790
|
+
<script setup lang="ts">
|
|
1791
|
+
import { ref, useTemplateRef } from 'vue';
|
|
1792
|
+
const delegating = ref(false);
|
|
1793
|
+
const rowMenu = useTemplateRef('rowMenu');
|
|
1794
|
+
</script>
|
|
1795
|
+
|
|
1796
|
+
<template>
|
|
1797
|
+
<BbDropdown
|
|
1798
|
+
:items="[
|
|
1799
|
+
{ value: 'edit', label: 'Edit' },
|
|
1800
|
+
{
|
|
1801
|
+
value: 'delegate',
|
|
1802
|
+
label: 'Delegate to…',
|
|
1803
|
+
onClick: () => (delegating = true),
|
|
1804
|
+
},
|
|
1805
|
+
]"
|
|
1806
|
+
>
|
|
1807
|
+
<template #activator="{ props }">
|
|
1808
|
+
<BbButton ref="rowMenu" v-bind="props" icon-only prepend:icon="dots"
|
|
1809
|
+
>More</BbButton
|
|
1810
|
+
>
|
|
1811
|
+
</template>
|
|
1812
|
+
</BbDropdown>
|
|
1813
|
+
<BbDropdown
|
|
1814
|
+
v-model="delegating"
|
|
1815
|
+
:anchor="rowMenu"
|
|
1816
|
+
:items="[
|
|
1817
|
+
{
|
|
1818
|
+
id: 'people',
|
|
1819
|
+
label: 'People',
|
|
1820
|
+
selectable: true,
|
|
1821
|
+
searchable: true,
|
|
1822
|
+
items: searchPeople,
|
|
1823
|
+
},
|
|
1824
|
+
]"
|
|
1825
|
+
>
|
|
1826
|
+
<BbDropdownGroup id="people" v-model="assignee" />
|
|
1827
|
+
</BbDropdown>
|
|
1828
|
+
</template>
|
|
1829
|
+
```
|
|
1830
|
+
|
|
1831
|
+
The first menu closes as its row runs, and the second opens under the same
|
|
1832
|
+
button with focus inside it; Escape, an outside press or a pick closes it and
|
|
1833
|
+
sets `delegating` back to `false`.
|
|
1834
|
+
|
|
1747
1835
|
### Placement, width and boundaries
|
|
1748
1836
|
|
|
1749
1837
|
- `placement` (default `'bottom'`) accepts every floating-UI placement
|
|
@@ -1765,7 +1853,11 @@ const items: BbDropdownItem[] = [
|
|
|
1765
1853
|
edge away from the trigger, and only the viewport flips it) tune positioning.
|
|
1766
1854
|
Pass `boundary` a `useTemplateRef` or a selector, not `$refs.x`: `$refs` is
|
|
1767
1855
|
not reactive, so a menu in a table cell rendered before the ref was set keeps
|
|
1768
|
-
no boundary until that row happens to re-render. `
|
|
1856
|
+
no boundary until that row happens to re-render. Inside a `BbTable` (a row
|
|
1857
|
+
menu, a cell's ⋯) the default keeps the menu within the table's left and
|
|
1858
|
+
right edges only: it still opens below its trigger, or flips above at the
|
|
1859
|
+
viewport, never at the table's bottom. A `boundary` replaces that default
|
|
1860
|
+
entirely. `eager` pre-renders the panel
|
|
1769
1861
|
before first open; `transitionDuration` controls the open/close animation.
|
|
1770
1862
|
- The menu closes itself on outside click/focus, on `Escape`, when another
|
|
1771
1863
|
dropdown opens, and when the activator scrolls out of view. `disabled`
|
|
@@ -1946,8 +2038,11 @@ object form, a style and attributes — optionally only while a state is on.
|
|
|
1946
2038
|
Parts: `root` (the flyout — an invisible positioning wrapper, no node on
|
|
1947
2039
|
mobile), `panel` (the menu surface you see — background, border, radius and
|
|
1948
2040
|
shadow live here; the sheet itself on mobile), `sheet` (the bottom sheet the surface becomes on a phone — only that sheet, never the desktop surface; applied after `panel`, so it wins a conflict there),
|
|
1949
|
-
`header`, `footer`, `
|
|
1950
|
-
|
|
2041
|
+
`header`, `footer`, `box` (every `searchable` group's search box, around the
|
|
2042
|
+
field and its magnifier: what `box` is on a field — border, background and
|
|
2043
|
+
radius go here; on the flyout and the phone sheet alike), `input` (every
|
|
2044
|
+
`searchable` group's search field — a broadcast, on the flyout and the phone
|
|
2045
|
+
sheet alike; its magnifier is chrome),
|
|
1951
2046
|
`list` (the top-level entries container between the bands
|
|
1952
2047
|
— a flex column with a 1px gap; a submenu's list is not reached), `item` — every entry, submenus included, a broadcast
|
|
1953
2048
|
resolved per entry — and `itemText` / `itemIcon` / `itemDescription`, that
|
|
@@ -2284,11 +2379,10 @@ own sizes.
|
|
|
2284
2379
|
`<BbDropdownGroup>` companions; a button there opens nothing. Use
|
|
2285
2380
|
`<template #activator="{ props }">` + `v-bind="props"`, or `v-bb-dropdown`
|
|
2286
2381
|
(`bitboss-ui/dropdown-default-slot` and `check` report it).
|
|
2287
|
-
- **
|
|
2288
|
-
(
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
fight in a loop.
|
|
2382
|
+
- **Open it from code with `v-model`, never with a hidden activator's
|
|
2383
|
+
`.click()`** (§ Opening from code). Don't reopen it from a `@focus` handler
|
|
2384
|
+
on the activator — closing returns focus there, and the two fight in a
|
|
2385
|
+
loop.
|
|
2292
2386
|
- **Don't navigate from `onClick`** (`router.push`, `window.location`) — give
|
|
2293
2387
|
the item `href`/`to` and let it render a real link.
|
|
2294
2388
|
- **Don't rebuild selection** with `onClick` + your own state — mark the group
|
|
@@ -2307,8 +2401,13 @@ own sizes.
|
|
|
2307
2401
|
- **An on/off entry ("Show deleted") is a selectable group too**, never an
|
|
2308
2402
|
action row with a check icon drawn in: a screen reader hears that as a plain
|
|
2309
2403
|
`menuitem`, with no state. Make it a `multiple` group of one row (a
|
|
2310
|
-
`menuitemcheckbox` with `aria-checked`), bound to a one-value array
|
|
2311
|
-
|
|
2404
|
+
`menuitemcheckbox` with `aria-checked`), bound to a one-value array. It
|
|
2405
|
+
stays open after the toggle, as checkbox items do. To close the menu after
|
|
2406
|
+
it, add `close-on-select` only when no other `multiple` group shares the
|
|
2407
|
+
menu: the prop is menu-wide, so every multiple group would close too. With
|
|
2408
|
+
one there, make the entry a `clearable` single group of one row instead
|
|
2409
|
+
(a change closes the menu, a second click clears it); it reads as a radio
|
|
2410
|
+
item, the one cost.
|
|
2312
2411
|
- **A server-searched group needs `filterBy: false`.** The default local
|
|
2313
2412
|
match runs on the getter's answer too, so a row the server matched on a field
|
|
2314
2413
|
the menu doesn't show (an email, a fiscal code) is fetched and then hidden.
|
|
@@ -2395,26 +2494,31 @@ uses `ArrowRight` / `ArrowLeft` and its back control; `Escape` on a drilled-in
|
|
|
2395
2494
|
level (row or search box) goes back one level, focus on the row that opened
|
|
2396
2495
|
it, and at the top level closes the sheet.
|
|
2397
2496
|
|
|
2497
|
+
## v-model
|
|
2498
|
+
|
|
2499
|
+
- `v-model` — type: `boolean \| undefined`
|
|
2500
|
+
|
|
2398
2501
|
## Props
|
|
2399
2502
|
|
|
2400
2503
|
| Prop | Type | Default | Required | Description |
|
|
2401
2504
|
| --- | --- | --- | --- | --- |
|
|
2402
|
-
| `pt:<part>`, `pt:<part>:<state>`, `pt` | `PtValue` | | | Passthrough — a class list, or `{ class, style, attrs }`, bound to one named part of the component; the state form applies only while that state is on. Parts: `check`, `footer`, `header`, `input`, `item`, `itemDescription`, `itemIcon`, `itemText`, `list`, `panel`, `root`, `sheet`, `submenu`. States: `activeLink`, `default`, `destructive`, `disabled`, `exactActiveLink`, `
|
|
2505
|
+
| `pt:<part>`, `pt:<part>:<state>`, `pt` | `PtValue` | | | Passthrough — a class list, or `{ class, style, attrs }`, bound to one named part of the component; the state form applies only while that state is on. Parts: `box`, `check`, `footer`, `header`, `input`, `item`, `itemDescription`, `itemIcon`, `itemText`, `list`, `panel`, `root`, `sheet`, `submenu`. States: `open`, `activeLink`, `default`, `destructive`, `disabled`, `exactActiveLink`, `selected`. What each one is: _Passthrough parts and states_ below. `pt` is the object form with the same keys minus the prefix (`{ icon: '…', 'icon:loading': '…' }`). See `guides/passthrough.md`. In `<script>` a `pt` value is typed `BbDropdownProps['pt']` (`PtValue` is not exported): § Typing `pt` in `<script>`. |
|
|
2403
2506
|
| `activator` | `ElementOrComponentRef \| undefined` | | | An external activator (element or component ref): the slot isn't rendered; the listeners and ARIA (`aria-haspopup` / `aria-expanded` / `aria-controls`) go on it, so don't add your own. |
|
|
2404
2507
|
| `adaptive` | `boolean \| undefined` | ``all.adaptive` (`true`)` | | On mobile (below `config.mobileMaxWidth`), renders the menu as a bottom sheet that drills into submenus one level at a time instead of hover flyouts; slots and selection are unchanged. Unset: the global `all.adaptive`. |
|
|
2405
2508
|
| `anchor` | `ElementOrComponentRef \| VirtualAnchor \| undefined` | `the activator element` | | What the panel positions against instead of the activator (e.g. a wrapper around it): an element, a component ref or a virtual box. It also sets a percentage `width`. Ignored with `placement="cursor"`. |
|
|
2406
|
-
| `boundary` | `string \| ElementOrComponentRef \| undefined` | | | Keeps the panel inside this element beside its trigger (sideways
|
|
2509
|
+
| `boundary` | `string \| ElementOrComponentRef \| undefined` | | | Keeps the panel inside this element beside its trigger (sideways under a menu); away from it only the viewport flips it. An element, component ref or CSS selector (a `useTemplateRef`, not `$refs.x`). Default in a `BbTable`: the table's left and right edges. |
|
|
2407
2510
|
| `closeOnSelect` | `boolean \| undefined` | `unset (close after a single-choice change)` | | Whether a selection closes the menu. Unset: a change in a single-choice group closes it (an untick too, at any depth); a `multiple` group stays open. `true`: every selection change closes it. `false`: none does. |
|
|
2408
2511
|
| `compact` | `boolean \| undefined` | `undefined` | | Compact density, the `BbSelect` ladder: flyout rows 28px → 24px, sheet rows 44px → 36px (a sheet row stays a touch target). The label size does not change. |
|
|
2409
2512
|
| `disabled` | `boolean \| undefined` | `false` | | Disables the component |
|
|
2410
2513
|
| `eager` | `boolean \| undefined` | `false` | | Renders the menu panel at mount instead of on the first open (the phone sheet's too), and keeps its rows after a close. Without it the rows mount on each open and go once the menu has closed. |
|
|
2411
|
-
| `emptyText` | `string \| undefined` | | |
|
|
2514
|
+
| `emptyText` | `string \| undefined` | | | A pipeline group's no-items row; its own `emptyText` wins. Default: `common.emptyText`. |
|
|
2412
2515
|
| `enforceCoherence` | `boolean \| undefined` | `false` | | Default for pipeline groups: drop selections that are no longer present in a group's current items (e.g. after a `dependencies` re-fetch) from the selection and `v-model`. A group's own `enforceCoherence` overrides this. |
|
|
2413
|
-
| `failedText` | `string \| undefined` | | |
|
|
2516
|
+
| `failedText` | `string \| undefined` | | | A pipeline group's failed-load row (its getter threw); its own `failedText` wins. Default: `common.failedText`. |
|
|
2414
2517
|
| `id` | `string \| undefined` | | | Names this dropdown: the activator's id (unless it already has one), the menu's `menu_<id>`, and the key `useBbDropdown(id)` and a companion `BbDropdownGroup` pair by. Generated when omitted. |
|
|
2415
|
-
| `items` | `(BbDropdownItem \| PrimitiveRow)[]` | `[]` | yes | The menu rows, each a `BbBaseButton` (`button`, `a` or `router-link`): a flat array for one group, nested arrays for divider-separated groups, or `InternalGroup` objects for titled / selectable
|
|
2518
|
+
| `items` | `(BbDropdownItem \| PrimitiveRow)[]` | `[]` | yes | The menu rows, each a `BbBaseButton` (`button`, `a` or `router-link`): a flat array for one group, nested arrays for divider-separated groups, or `InternalGroup` objects for titled / selectable groups. A row's own `items` opens a submenu. |
|
|
2416
2519
|
| `keepActivator` | `boolean \| undefined` | `false` | | Keeps the trigger when no row is visible (by default it is hidden): inert, no popup ARIA, `empty` in the activator slot. A `contextMenu` trigger always stays. |
|
|
2417
|
-
| `loadingText` | `string \| undefined` | | |
|
|
2520
|
+
| `loadingText` | `string \| undefined` | | | A pipeline group's loading row; its own `loadingText` wins. Default: `common.loadingText`. |
|
|
2521
|
+
| `modelValue` | `boolean \| undefined` | `undefined` | | Whether the menu is open (`v-model`): `true` opens it from code at its activator or `anchor`. Unbound: the initial state. |
|
|
2418
2522
|
| `offCanvasProps` | `Partial<BbOffCanvasProps> \| undefined` | | | Props for the phone sheet (the `BbOffCanvas` that `adaptive` renders on mobile), spread over its defaults. A `pt` inside it styles only the sheet (passthrough guide § Inside the sheet). The sheet hides its ✕; `{ hideClose: false }` brings it back. |
|
|
2419
2523
|
| `offset` | `number \| undefined` | `4` | | Space the floating container will maintain from the activator. |
|
|
2420
2524
|
| `padding` | `number \| undefined` | `10` | | Minimum empty space to keep from the edge of the page |
|
|
@@ -2435,6 +2539,7 @@ it, and at the top level closes the sheet.
|
|
|
2435
2539
|
| `sheet` | The bottom sheet the menu becomes on a phone (the `BbOffCanvas` root) — never the desktop surface. Applied after `panel`, so it wins a conflict there. |
|
|
2436
2540
|
| `header` | The menu's header band. |
|
|
2437
2541
|
| `footer` | The menu's footer band. |
|
|
2542
|
+
| `box` | Every searchable group's search box (field and magnifier), as `box` on a field; desktop and phone. |
|
|
2438
2543
|
| `input` | A searchable group's search field — a broadcast: it lands on every searchable group's field, desktop and phone alike. Its magnifier glyph is chrome. |
|
|
2439
2544
|
| `list` | The top-level items container between the bands — the node that lays the entries out (a flex column with a 1px gap; on a phone, the sheet's items container). A submenu's list is not reached. Groups, headings and dividers are not parts. |
|
|
2440
2545
|
| `item` | One menu entry, submenus included — a broadcast resolved per entry. Also takes a per-item function, called with the entry. |
|
|
@@ -2464,26 +2569,29 @@ States are listed in precedence order: when two are on at once and their entries
|
|
|
2464
2569
|
- `item:unselected` — `(value: any): void` — The user unselected a row (a multiple toggle, a `clearable` re-click, a chip ×, or the old value a single pick replaces). Payload is the item's resolved value, matching `item:selected`.
|
|
2465
2570
|
- `show` — `(): void` — Emitted as soon as the menu (the popover, or the sheet on a phone) starts to open.
|
|
2466
2571
|
- `shown` — `(): void` — Emitted once the menu is open and its open transition has finished.
|
|
2572
|
+
- `update:modelValue` — `(value: boolean): void` — The menu opened or closed (`v-model`): `true` on open, `false` on close.
|
|
2467
2573
|
|
|
2468
2574
|
## Slots
|
|
2469
2575
|
|
|
2470
2576
|
- `activator` — scope: `BbDropdownActivatorSlotProps` `{ disabled?: boolean; empty: boolean; loading: boolean; open: boolean; placement: Placement \| "cursor"; props: BbDropdownActivatorProps }` — The element that triggers the dropdown to open. Spread `props` onto your trigger element.
|
|
2471
2577
|
- `default` — scope: `any` — Hosts `<BbDropdownGroup>` companions. They register their group with the dropdown and render nothing themselves.
|
|
2472
|
-
- `empty` — scope: `BbDropdownPlaceholderSlotProps` `{ groupId?: string; query: string; text: string
|
|
2578
|
+
- `empty` — scope: `BbDropdownPlaceholderSlotProps` `{ groupId?: string; query: string; text: string }` — Replaces the default "no data" placeholder row shown in a pipeline group that resolved to no items. Rendered once per empty group. A failed load is not empty: it keeps its own row (the error icon and `failedText`).
|
|
2473
2579
|
- `footer` — scope: `BbDropdownEdgeSlotProps` `{ disabled?: boolean; open: boolean; placement: Placement \| "cursor" }` — Pinned below the rows, outside their scroll, with a divider — for action buttons.
|
|
2580
|
+
- `group` — scope: `BbDropdownGroupSlotProps` `{ text: string; item: unknown; index: number; length: number; disabled: boolean }` — Every group's `groupBy` headings (`BbSelect`'s `#group` scope); `#<groupId>:group` beats it.
|
|
2474
2581
|
- `header` — scope: `BbDropdownEdgeSlotProps` `{ disabled?: boolean; open: boolean; placement: Placement \| "cursor" }` — Pinned above the rows, outside their scroll, with a divider — for a title or a filter field.
|
|
2475
|
-
- `item:append` — scope: `BbDropdownItemSlotProps` `{ description?: string; disabled?: boolean; group: BbDropdownSlotGroup; groupTitle: boolean; level: number; index: number; item: InternalItem; loading: boolean; open: boolean; placement: Placement \| "cursor"; selected: boolean; label: string; activeLink?: boolean; exactActiveLink?: boolean }` — The trailing region of every row (and group title line), replacing its `append:icon
|
|
2476
|
-
- `item:prepend` — scope: `BbDropdownItemSlotProps` `{ description?: string; disabled?: boolean; group: BbDropdownSlotGroup; groupTitle: boolean; level: number; index: number; item: InternalItem; loading: boolean; open: boolean; placement: Placement \| "cursor"; selected: boolean; label: string; activeLink?: boolean; exactActiveLink?: boolean }` — The leading region of every row (and group title line), replacing its `prepend:icon
|
|
2477
|
-
- `loading` — scope: `BbDropdownPlaceholderSlotProps` `{ groupId?: string; query: string; text: string
|
|
2478
|
-
- `#<value>` (named from data) — scope: `BbDropdownItemSlotProps` — One row's content (label and description), by its value; in a fetched group, by its resolved `itemValue`. Reserved names (their slot is one of this component's own, so an item value or column key spelled like them is an error): `activator`, `default`, `empty`, `footer`, `header`, `item`, `loading`.
|
|
2582
|
+
- `item:append` — scope: `BbDropdownItemSlotProps` `{ description?: string; disabled?: boolean; group: BbDropdownSlotGroup; groupTitle: boolean; level: number; index: number; item: InternalItem; loading: boolean; open: boolean; placement: Placement \| "cursor"; selected: boolean; label: string; activeLink?: boolean; exactActiveLink?: boolean }` — The trailing region of every row (and group title line), replacing its `append:icon` wherever it renders. A named slot wins; the submenu chevron and the check on a selected row take its place.
|
|
2583
|
+
- `item:prepend` — scope: `BbDropdownItemSlotProps` `{ description?: string; disabled?: boolean; group: BbDropdownSlotGroup; groupTitle: boolean; level: number; index: number; item: InternalItem; loading: boolean; open: boolean; placement: Placement \| "cursor"; selected: boolean; label: string; activeLink?: boolean; exactActiveLink?: boolean }` — The leading region of every row (and group title line), replacing its `prepend:icon` wherever it renders. A named slot wins.
|
|
2584
|
+
- `loading` — scope: `BbDropdownPlaceholderSlotProps` `{ groupId?: string; query: string; text: string }` — Replaces the default loading placeholder row shown in a pipeline group while its async items load. Rendered once per loading group.
|
|
2585
|
+
- `#<value>` (named from data) — scope: `BbDropdownItemSlotProps` — One row's content (label and description), by its value; in a fetched group, by its resolved `itemValue`. Reserved names (their slot is one of this component's own, so an item value or column key spelled like them is an error): `activator`, `default`, `empty`, `footer`, `group`, `header`, `item`, `loading`.
|
|
2479
2586
|
- `#<value>:prepend` (named from data) — scope: `BbDropdownItemSlotProps` — One row's leading region; replaces its `prepend:icon`.
|
|
2480
2587
|
- `#<value>:append` (named from data) — scope: `BbDropdownItemSlotProps` — One row's trailing region; replaces its `append:icon` and its submenu chevron. The check takes its place on the selected row.
|
|
2481
2588
|
- `#<groupId>:item` (named from data) — scope: `BbDropdownItemSlotProps` — The content of every row of that group, and no other; a row's own `#<value>` still wins.
|
|
2482
2589
|
- `#<groupId>:item:prepend` (named from data) — scope: `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`.
|
|
2483
2590
|
- `#<groupId>:item:append` (named from data) — scope: `BbDropdownItemSlotProps` — The trailing region of every row of that group; replaces their `append:icon`. The check takes its place on the selected row.
|
|
2484
|
-
- `#<groupId
|
|
2591
|
+
- `#<groupId>:label` (named from data) — scope: `BbDropdownItemSlotProps` — That group's title content (`item` is the group, `groupTitle` is `true`).
|
|
2485
2592
|
- `#<groupId>:prepend` (named from data) — scope: `BbDropdownItemSlotProps` — The leading region of that group's title line.
|
|
2486
2593
|
- `#<groupId>:append` (named from data) — scope: `BbDropdownItemSlotProps` — The trailing region of that group's title line.
|
|
2594
|
+
- `#<groupId>:group` (named from data) — scope: `BbDropdownGroupSlotProps` — That group's `groupBy` headings; beats `group`.
|
|
2487
2595
|
|
|
2488
2596
|
## CSS custom properties
|
|
2489
2597
|
|
|
@@ -2506,12 +2614,12 @@ Set these on the element, or on a class you put on it, to retune this component
|
|
|
2506
2614
|
- `BbDropdown` _(this component)_ — its own template binds: `panel` → `CommonPopover`, `root` → `CommonPopover`, `header` → `div.bb-dropdown__header`, `list` → `span.bb-dropdown__list`, `footer` → `div.bb-dropdown__footer`
|
|
2507
2615
|
- `BbDropdownList` _(internal — not importable, reach it through `BbDropdown`)_ — also mounts `BbIcon`, `ErrorIcon`, `CommonPopover`, `BbDropdownList`
|
|
2508
2616
|
- `BbBadge` _(public — [contract](./BbBadge.md))_ — its own pt parts (`BbBadge`): `spinner` → `BbSpinner`, `icon` → `span.bb-badge__append-icon`, `icon` → `BbIcon`, `clear` → `button.bb-badge__clear`; documented CSS variables: `--bg`, `--fg`, `--bw`, `--ring-color`, `--ring-size`, `--min-size-md`, `--min-size`, `--elev`, `--r`, `--fs`, `--icon-size`, `--gap`, `--px`, `--clear-size`, `--bg-disabled`, `--fg-disabled`, `--border-disabled`, `--pad-left`; also mounts `BbIcon`, `BbSpinner`, `BadgeBodyContent`
|
|
2509
|
-
- `AdaptiveDropdown` _(internal — not importable, reach it through `BbDropdown`)_ — hands `BbOffCanvas` the pt map `{ header: 'header', footer: 'footer', panel: 'root', sheet: 'root' }` (ours → theirs); also mounts `BbSmoothHeight`, `BbDropdownList`
|
|
2617
|
+
- `AdaptiveDropdown` _(internal — not importable, reach it through `BbDropdown`)_ — hands `BbOffCanvas` the pt map `{ header: 'header', footer: 'footer', panel: 'root', sheet: 'root' }` (ours → theirs); also mounts `BbSmoothHeight`, `BbDropdownList`, `DropdownFailures`
|
|
2510
2618
|
- `BbOffCanvas` _(public — [contract](./BbOffCanvas.md))_ — its own pt parts (`BbOffCanvas`): `header` → `div.bb-offcanvas__header`, `title` → `span.bb-offcanvas__title`, `description` → `p.bb-offcanvas__description`, `close` → `CloseButton`, `content` → `div.bb-offcanvas__content`, `footer` → `div.bb-offcanvas__footer`; documented CSS variables: `--stack-x`, `--snap-y`, `--stack-fill`, `--stack-transition-duration`, `--px`, `--handle-w`, `--handle-h`, `--handle-bg`, `--safe-top`, `--close-size`
|
|
2511
2619
|
- `CloseButton` _(internal — not importable, reach it through `BbOffCanvas`)_ — documented CSS variables: `--size`, `--p`, `--icon-size`; also mounts `BbIcon`
|
|
2512
2620
|
- `BbButton` _(public — [contract](./BbButton.md))_ — its own pt parts (`BbButton`): `root` → `BbBaseButton`, `spinner` → `BbSpinner`, `icon` → `span.bb-button__prepend-icon`, `icon` → `BbIcon`, `text` → `span.bb-button__text`, `icon` → `span.bb-button__append-icon`; documented CSS variables: `--h-xs`, `--h`, `--icon-size`, `--px`, `--ipx`, `--fs`, `--r`, `--gap`, `--bg`, `--bg-hover`, `--bg-pressed`, `--fg`, `--border-color`, `--ring-color`, `--ring-size`, `--bw`, `--fg-hover`, `--border-hover`, `--fg-pressed`, `--border-pressed`, `--bg-disabled`, `--fg-disabled`, `--border-disabled`, `--opacity-disabled`, `--elev-tier`, `--elev`; also mounts `BbSpinner`, `BbIcon`
|
|
2513
2621
|
- `BbBaseButton` _(public — [contract](./BbBaseButton.md))_ — its own pt parts (`BbBaseButton`): `root` → `RouterComponent`, `root` → `a`, `root` → `component`; also mounts `RouterComponent`
|
|
2514
|
-
- Also mounts `CommonPopover`, `DropdownPipelineResolver`
|
|
2622
|
+
- Also mounts `CommonPopover`, `DropdownFailures`, `DropdownPipelineResolver`
|
|
2515
2623
|
|
|
2516
2624
|
## See Also
|
|
2517
2625
|
|
|
@@ -498,8 +498,9 @@ style and attributes — optionally only while a state is on. Parts: `root`
|
|
|
498
498
|
(the group), `main` and `toggle` (the two halves, each handed to its button as
|
|
499
499
|
its `pt:root`), `icon`, `spinner` and `text` (the main button's — handed to it
|
|
500
500
|
as its own `pt`; the toggle's chevron is chrome), `panel` (the menu), `sheet` (the bottom sheet
|
|
501
|
-
the menu becomes on a phone, only), `input` (every `searchable`
|
|
502
|
-
search field), `
|
|
501
|
+
the menu becomes on a phone, only), `box` and `input` (every `searchable`
|
|
502
|
+
group's search box, and the field in it), `list` (the top-level entries
|
|
503
|
+
container), `item` (every entry), and `itemText` /
|
|
503
504
|
`itemIcon` / `itemDescription` / `check` (an entry's label, its icons, its muted
|
|
504
505
|
second line and a checked entry's tick), and `submenu` (every submenu's flyout
|
|
505
506
|
box) — all handed to the `BbDropdown` under the same words, so
|
|
@@ -596,6 +597,15 @@ A `pt` value written in `<script>` (a constant, a preset, a wrapper's
|
|
|
596
597
|
`pt` prop) is typed as `BbDropdownButtonProps['pt']`, never an imported `PtValue`: see
|
|
597
598
|
[passthrough § Typing `pt` in `<script>`](./guides/passthrough.md#typing-pt-in-script).
|
|
598
599
|
|
|
600
|
+
### Opening from code: `v-model:open`
|
|
601
|
+
|
|
602
|
+
`v-model` is the value; `v-model:open` is whether the menu is open. Bound,
|
|
603
|
+
your ref opens and closes it, and every open and close the user makes is
|
|
604
|
+
written back: a pick, Escape, a click outside. A static `:open` with no
|
|
605
|
+
listener is only the initial state. An open from code is the same open a
|
|
606
|
+
click makes (focus moves to the first row, and back on close), and `disabled` / `readonly` refuse it (the ref is set back
|
|
607
|
+
to `false`).
|
|
608
|
+
|
|
599
609
|
### Works well with
|
|
600
610
|
|
|
601
611
|
- [useConfirm](./composables/useConfirm.md) — gate a destructive alternate
|
|
@@ -635,11 +645,15 @@ A `pt` value written in `<script>` (a constant, a preset, a wrapper's
|
|
|
635
645
|
- While an async action runs, the busy half blocks re-entry automatically;
|
|
636
646
|
don't disable the other half yourself.
|
|
637
647
|
|
|
648
|
+
## v-model
|
|
649
|
+
|
|
650
|
+
- `v-model:open` — type: `boolean \| undefined`
|
|
651
|
+
|
|
638
652
|
## Props
|
|
639
653
|
|
|
640
654
|
| Prop | Type | Default | Required | Description |
|
|
641
655
|
| --- | --- | --- | --- | --- |
|
|
642
|
-
| `pt:<part>`, `pt:<part>:<state>`, `pt` | `PtValue` | | | Passthrough — a class list, or `{ class, style, attrs }`, bound to one named part of the component; the state form applies only while that state is on. Parts: `check`, `footer`, `header`, `icon`, `input`, `item`, `itemDescription`, `itemIcon`, `itemText`, `main`, `panel`, `root`, `sheet`, `spinner`, `submenu`, `text`, `toggle`. States: `activeLink`, `
|
|
656
|
+
| `pt:<part>`, `pt:<part>:<state>`, `pt` | `PtValue` | | | Passthrough — a class list, or `{ class, style, attrs }`, bound to one named part of the component; the state form applies only while that state is on. Parts: `box`, `check`, `footer`, `header`, `icon`, `input`, `item`, `itemDescription`, `itemIcon`, `itemText`, `list`, `main`, `panel`, `root`, `sheet`, `spinner`, `submenu`, `text`, `toggle`. States: `activeLink`, `disabled`, `exactActiveLink`, `loading`, `open`, `default`, `destructive`, `selected`, `ghost`, `link`, `outline`, `primary`, `secondary`. What each one is: _Passthrough parts and states_ below. `pt` is the object form with the same keys minus the prefix (`{ icon: '…', 'icon:loading': '…' }`). See `guides/passthrough.md`. In `<script>` a `pt` value is typed `BbDropdownButtonProps['pt']` (`PtValue` is not exported): § Typing `pt` in `<script>`. |
|
|
643
657
|
| `activeClass` | `string \| undefined` | | | Class to apply when the link is active. |
|
|
644
658
|
| `adaptive` | `boolean \| undefined` | ``all.adaptive` (`true`)` | | On mobile (below `config.mobileMaxWidth`), renders the menu as a bottom sheet that drills into submenus one level at a time instead of hover flyouts; slots and selection are unchanged. Unset: the global `all.adaptive`. |
|
|
645
659
|
| `append:icon` | `string \| undefined` | | | Icon to be added on the right of the text. |
|
|
@@ -682,6 +696,7 @@ A `pt` value written in `<script>` (a constant, a preset, a wrapper's
|
|
|
682
696
|
| `onProgress` | `((progress: { percentage: number \| undefined; }) => void) \| undefined` | | | Progress callback invoked by Inertia with the upload/download percentage when available. |
|
|
683
697
|
| `onStart` | `(() => void) \| undefined` | | | Lifecycle hook invoked by Inertia when a request starts. |
|
|
684
698
|
| `onSuccess` | `(() => void) \| undefined` | | | Lifecycle hook invoked by Inertia when a request succeeds. |
|
|
699
|
+
| `open` | `boolean \| undefined` | `false` | | Whether the panel is open (`v-model:open`; `v-model` stays the value). Bound, the app opens and closes it; unbound, the initial state. |
|
|
685
700
|
| `padding` | `number \| undefined` | `10` | | Minimum empty space to keep from the edge of the page |
|
|
686
701
|
| `pageProps` | `Record<string, unknown> \| ((currentProps: Record<string, unknown>, sharedProps: Record<string, unknown>) => Record<string, unknown>) \| null \| undefined` | | | Inertia: props to merge into the next page optimistically, before the server responds. Either an object or a function of the current props. Typed platform-agnostically (matching BbButton) so the library's types never require `@inertiajs/vue3` to be installed. |
|
|
687
702
|
| `placement` | `'start'` \| `'end'` \| `'top'` \| `'bottom'` \| `'left'` \| `'right'` \| `'top-start'` \| `'top-end'` \| `'right-start'` \| `'right-end'` \| `'bottom-start'` \| `'bottom-end'` \| `'left-start'` \| `'left-end'` \| `'start-start'` \| `'start-end'` \| `'end-start'` \| `'end-end'` \| `'cursor'` | `'bottom'` | | Position relative to the activator; `'cursor'` anchors at the mouse/touch point. No arrow (tooltips only). |
|
|
@@ -720,7 +735,9 @@ A `pt` value written in `<script>` (a constant, a preset, a wrapper's
|
|
|
720
735
|
| `sheet` | The bottom sheet the menu becomes on a phone only. |
|
|
721
736
|
| `header` | The band around your `#header` slot: at the top of the menu on desktop, the sheet's header on a phone — handed to the `BbDropdown`. |
|
|
722
737
|
| `footer` | The band around your `#footer` slot: at the bottom of the menu on desktop, the sheet's footer on a phone — handed to the `BbDropdown`. |
|
|
738
|
+
| `box` | A searchable group's search box in the menu (field and magnifier) — handed to the `BbDropdown` as its own `pt:box`. |
|
|
723
739
|
| `input` | A searchable group's search field in the menu — a broadcast, every searchable group's field — handed to the `BbDropdown` as its own `pt:input`. |
|
|
740
|
+
| `list` | The menu's top-level items container — handed to the `BbDropdown` as its own `pt:list`. |
|
|
724
741
|
| `item` | One menu entry, submenus included — a broadcast resolved per entry. Also takes a per-item function, called with the entry. |
|
|
725
742
|
| `itemText` | An entry's label (its `label`) — resolved with that entry's states. A per-entry `#<value>` slot replaces it. Also takes a per-item function. |
|
|
726
743
|
| `itemIcon` | An entry's prepend / append icons — resolved with that entry's states. Also takes a per-item function. |
|
|
@@ -754,18 +771,19 @@ States are listed in precedence order: when two are on at once and their entries
|
|
|
754
771
|
- `item:unselected` — `(value: any): void` — A row of a selectable group was unselected (same payload as above).
|
|
755
772
|
- `show` — `(): void` — Emitted as soon as the menu (the popover, or the sheet on a phone) starts to open.
|
|
756
773
|
- `shown` — `(): void` — Emitted once the menu is open and its open transition has finished.
|
|
774
|
+
- `update:open` — `(value: boolean): void` — The panel opened or closed (`v-model:open`).
|
|
757
775
|
|
|
758
776
|
## Slots
|
|
759
777
|
|
|
760
778
|
- `append:icon` — scope: `BbButtonIconSlotProps` `{ activeLink: boolean; exactActiveLink: boolean; pressed: boolean; loading: boolean; disabled: boolean }` — The main button's trailing icon, replacing `append:icon`.
|
|
761
779
|
- `default` — scope: `any` — The main button's label (falls back to `text`).
|
|
762
780
|
- `dropdown` — scope: `any` — Menu companions, forwarded into the dropdown: a `<BbDropdownGroup>` binding a group of `items` by id. A `#dropdown` slot keeps the toggle even with no `items`.
|
|
763
|
-
- `empty` — scope: `BbDropdownPlaceholderSlotProps` `{ groupId?: string; query: string; text: string
|
|
781
|
+
- `empty` — scope: `BbDropdownPlaceholderSlotProps` `{ groupId?: string; query: string; text: string }` — Replaces the default "no data" placeholder row shown in a pipeline group that resolved to no items. Rendered once per empty group. Forwarded to the underlying `BbDropdown`.
|
|
764
782
|
- `footer` — scope: `BbDropdownButtonEdgeSlotProps` `{ disabled?: boolean; open: boolean; placement: Placement \| "cursor" }` — Content pinned to the bottom of the dropdown panel, outside the scroll area.
|
|
765
783
|
- `header` — scope: `BbDropdownButtonEdgeSlotProps` `{ disabled?: boolean; open: boolean; placement: Placement \| "cursor" }` — Content pinned to the top of the dropdown panel, outside the scroll area.
|
|
766
784
|
- `item:append` — scope: `BbDropdownButtonItemSlotProps` `{ disabled?: boolean; index: number; item: InternalItem; open: boolean; placement: Placement \| "cursor"; label: string }` — The trailing region of every menu row, replacing its `append:icon`; the submenu chevron and the check on a selected row take its place (BbDropdown's rules).
|
|
767
785
|
- `item:prepend` — scope: `BbDropdownButtonItemSlotProps` `{ disabled?: boolean; index: number; item: InternalItem; open: boolean; placement: Placement \| "cursor"; label: string }` — The leading region of every menu row, replacing its `prepend:icon` (BbDropdown's rules).
|
|
768
|
-
- `loading` — scope: `BbDropdownPlaceholderSlotProps` `{ groupId?: string; query: string; text: string
|
|
786
|
+
- `loading` — scope: `BbDropdownPlaceholderSlotProps` `{ groupId?: string; query: string; text: string }` — Replaces the default loading placeholder row shown in a pipeline group while its async items load. Rendered once per loading group. Forwarded to the underlying `BbDropdown`.
|
|
769
787
|
- `prepend:icon` — scope: `BbButtonIconSlotProps` `{ activeLink: boolean; exactActiveLink: boolean; pressed: boolean; loading: boolean; disabled: boolean }` — The main button's leading icon, replacing `prepend:icon` (the one `icon-only` shows); inside its `icon` part, with its states.
|
|
770
788
|
- `#<value>` (named from data) — scope: `BbDropdownItemSlotProps` — One row's content (label and description), by its value; in a fetched group, by its resolved `itemValue`. Reserved names (their slot is one of this component's own, so an item value or column key spelled like them is an error): `default`, `dropdown`, `empty`, `footer`, `header`, `item`, `loading`.
|
|
771
789
|
- `#<value>:prepend` (named from data) — scope: `BbDropdownItemSlotProps` — One row's leading region; replaces its `prepend:icon`.
|
|
@@ -773,9 +791,10 @@ States are listed in precedence order: when two are on at once and their entries
|
|
|
773
791
|
- `#<groupId>:item` (named from data) — scope: `BbDropdownItemSlotProps` — The content of every row of that group, and no other; a row's own `#<value>` still wins.
|
|
774
792
|
- `#<groupId>:item:prepend` (named from data) — scope: `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`.
|
|
775
793
|
- `#<groupId>:item:append` (named from data) — scope: `BbDropdownItemSlotProps` — The trailing region of every row of that group; replaces their `append:icon`. The check takes its place on the selected row.
|
|
776
|
-
- `#<groupId
|
|
794
|
+
- `#<groupId>:label` (named from data) — scope: `BbDropdownItemSlotProps` — That group's title content (`item` is the group, `groupTitle` is `true`).
|
|
777
795
|
- `#<groupId>:prepend` (named from data) — scope: `BbDropdownItemSlotProps` — The leading region of that group's title line.
|
|
778
796
|
- `#<groupId>:append` (named from data) — scope: `BbDropdownItemSlotProps` — The trailing region of that group's title line.
|
|
797
|
+
- `#<groupId>:group` (named from data) — scope: `BbDropdownGroupSlotProps` — That group's `groupBy` headings; beats `group`.
|
|
779
798
|
|
|
780
799
|
## Component tree
|
|
781
800
|
|
|
@@ -789,10 +808,10 @@ States are listed in precedence order: when two are on at once and their entries
|
|
|
789
808
|
- `BbDropdownButton` _(this component)_ — hands `BbButton` the pt map `{ main: 'root', icon: 'icon', spinner: 'spinner', text: 'text' }` (ours → theirs); hands `BbDropdown` the pt map `{ item: 'item', itemText: 'itemText', itemIcon: 'itemIcon', itemDescription: 'itemDescription', check: 'check' }` (ours → theirs); hands `BbButton` the pt map `{ toggle: 'root' }` (ours → theirs)
|
|
790
809
|
- `BbButton` _(public — [contract](./BbButton.md))_ — its own pt parts (`BbButton`): `root` → `BbBaseButton`, `spinner` → `BbSpinner`, `icon` → `span.bb-button__prepend-icon`, `icon` → `BbIcon`, `text` → `span.bb-button__text`, `icon` → `span.bb-button__append-icon`; documented CSS variables: `--h-xs`, `--h`, `--icon-size`, `--px`, `--ipx`, `--fs`, `--r`, `--gap`, `--bg`, `--bg-hover`, `--bg-pressed`, `--fg`, `--border-color`, `--ring-color`, `--ring-size`, `--bw`, `--fg-hover`, `--border-hover`, `--fg-pressed`, `--border-pressed`, `--bg-disabled`, `--fg-disabled`, `--border-disabled`, `--opacity-disabled`, `--elev-tier`, `--elev`; also mounts `BbSpinner`, `BbIcon`
|
|
791
810
|
- `BbBaseButton` _(public — [contract](./BbBaseButton.md))_ — its own pt parts (`BbBaseButton`): `root` → `RouterComponent`, `root` → `a`, `root` → `component`; also mounts `RouterComponent`
|
|
792
|
-
- `BbDropdown` _(public — [contract](./BbDropdown.md))_ — its own pt parts (`BbDropdown`): `panel` → `CommonPopover`, `root` → `CommonPopover`, `header` → `div.bb-dropdown__header`, `list` → `span.bb-dropdown__list`, `footer` → `div.bb-dropdown__footer`; documented CSS variables: `--menu-inset`; also mounts `CommonPopover`, `DropdownPipelineResolver`
|
|
811
|
+
- `BbDropdown` _(public — [contract](./BbDropdown.md))_ — its own pt parts (`BbDropdown`): `panel` → `CommonPopover`, `root` → `CommonPopover`, `header` → `div.bb-dropdown__header`, `list` → `span.bb-dropdown__list`, `footer` → `div.bb-dropdown__footer`; documented CSS variables: `--menu-inset`; also mounts `CommonPopover`, `DropdownFailures`, `DropdownPipelineResolver`
|
|
793
812
|
- `BbDropdownList` _(internal — not importable, reach it through `BbDropdown`)_ — also mounts `BbIcon`, `ErrorIcon`, `CommonPopover`, `BbDropdownList`
|
|
794
813
|
- `BbBadge` _(public — [contract](./BbBadge.md))_ — its own pt parts (`BbBadge`): `spinner` → `BbSpinner`, `icon` → `span.bb-badge__append-icon`, `icon` → `BbIcon`, `clear` → `button.bb-badge__clear`; documented CSS variables: `--bg`, `--fg`, `--bw`, `--ring-color`, `--ring-size`, `--min-size-md`, `--min-size`, `--elev`, `--r`, `--fs`, `--icon-size`, `--gap`, `--px`, `--clear-size`, `--bg-disabled`, `--fg-disabled`, `--border-disabled`, `--pad-left`; also mounts `BbIcon`, `BbSpinner`, `BadgeBodyContent`
|
|
795
|
-
- `AdaptiveDropdown` _(internal — not importable, reach it through `BbDropdown`)_ — hands `BbOffCanvas` the pt map `{ header: 'header', footer: 'footer', panel: 'root', sheet: 'root' }` (ours → theirs); also mounts `BbSmoothHeight`, `BbButton`, `BbDropdownList`
|
|
814
|
+
- `AdaptiveDropdown` _(internal — not importable, reach it through `BbDropdown`)_ — hands `BbOffCanvas` the pt map `{ header: 'header', footer: 'footer', panel: 'root', sheet: 'root' }` (ours → theirs); also mounts `BbSmoothHeight`, `BbButton`, `BbDropdownList`, `DropdownFailures`
|
|
796
815
|
- `BbOffCanvas` _(public — [contract](./BbOffCanvas.md))_ — its own pt parts (`BbOffCanvas`): `header` → `div.bb-offcanvas__header`, `title` → `span.bb-offcanvas__title`, `description` → `p.bb-offcanvas__description`, `close` → `CloseButton`, `content` → `div.bb-offcanvas__content`, `footer` → `div.bb-offcanvas__footer`; documented CSS variables: `--stack-x`, `--snap-y`, `--stack-fill`, `--stack-transition-duration`, `--px`, `--handle-w`, `--handle-h`, `--handle-bg`, `--safe-top`, `--close-size`
|
|
797
816
|
- `CloseButton` _(internal — not importable, reach it through `BbOffCanvas`)_ — documented CSS variables: `--size`, `--p`, `--icon-size`; also mounts `BbIcon`
|
|
798
817
|
|
package/dist/ai/BbForm.md
CHANGED
|
@@ -1154,6 +1154,9 @@ While it runs:
|
|
|
1154
1154
|
(`disable-auto-loading` opts out). A submit from code
|
|
1155
1155
|
(`useBbForm(id).submit()`) spins no submit button: the button whose
|
|
1156
1156
|
click calls it spins on its own, since its click returns the promise.
|
|
1157
|
+
- **Another submit is dropped**: Enter, a submit button or `submit()` while
|
|
1158
|
+
the save runs starts no second save and is not queued (`submit()` resolves
|
|
1159
|
+
`false`), with `disable-submit-lock` too.
|
|
1157
1160
|
- **A `BbDialog` / `BbOffCanvas` around the form refuses every user close**
|
|
1158
1161
|
(the ✕, Cancel's `close()`, `Escape`, the backdrop, a swipe) until the save
|
|
1159
1162
|
settles; code still closes it (`hide()`, the model). Its `prevent-close`
|
|
@@ -1988,7 +1991,7 @@ marker stays consistent with the rules.
|
|
|
1988
1991
|
|
|
1989
1992
|
## Slots
|
|
1990
1993
|
|
|
1991
|
-
- `default` — scope: `{
|
|
1994
|
+
- `default` — scope: `FormMeta<GenericObject> & { errors: Record<string, string[]>; fields: Record<string, BbFormFieldEntry>; isSubmitting: boolean; removeField: (path: string) => vo…` — The form's fields, with its state and actions in scope: the meta (`valid`, `dirty`…), `values`, `errors`, `fields`, `unmatchedErrors`, `isSubmitting`, `submitCount`, `validate`, `resetForm`, `setErrors`, `snapshot`, `removeField`.
|
|
1992
1995
|
|
|
1993
1996
|
## Exposed (template ref)
|
|
1994
1997
|
|