bitboss-ui 3.0.0-beta.74 → 3.0.0-beta.76
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -5
- package/bin/cli.mjs +16 -10
- package/dist/ai/BbAlert.md +1 -1
- package/dist/ai/BbAvatar.md +86 -58
- package/dist/ai/BbBadge.md +1 -1
- package/dist/ai/BbBreadcrumbs.md +3 -3
- package/dist/ai/BbButton.md +4 -4
- package/dist/ai/BbCalendar.md +5 -2
- package/dist/ai/BbCheckboxGroup.md +5 -4
- package/dist/ai/BbColorInput.md +13 -1
- package/dist/ai/BbColorPalette.md +12 -7
- package/dist/ai/BbConfirm.md +1 -1
- package/dist/ai/BbDatePicker.md +13 -1
- package/dist/ai/BbDatePickerInput.md +18 -2
- package/dist/ai/BbDialog.md +6 -3
- package/dist/ai/BbDropdown.md +174 -77
- package/dist/ai/BbDropdownButton.md +37 -16
- package/dist/ai/BbGallery.md +3 -2
- package/dist/ai/BbIcon.md +10 -10
- package/dist/ai/BbNumberInput.md +3 -1
- package/dist/ai/BbOffCanvas.md +3 -2
- package/dist/ai/BbPopover.md +1 -1
- package/dist/ai/BbRadioGroup.md +4 -4
- package/dist/ai/BbSelect.md +227 -105
- package/dist/ai/BbSelectPopover.md +139 -14
- package/dist/ai/BbSwitchGroup.md +5 -4
- package/dist/ai/BbTable.md +18 -17
- package/dist/ai/BbTimePicker.md +13 -1
- package/dist/ai/BbTimePickerInput.md +16 -2
- package/dist/ai/BbToast.md +3 -2
- package/dist/ai/BbTree.md +5 -1
- package/dist/ai/CommonPopover.md +1 -0
- package/dist/ai/FlatListBox.md +1 -0
- package/dist/ai/GroupedListBox.md +3 -2
- package/dist/ai/ListBox.md +4 -2
- package/dist/ai/OptionsContainer.md +4 -4
- package/dist/ai/changelog.json +310 -7
- package/dist/ai/components.json +33 -35
- package/dist/ai/composables/useToast.md +2 -2
- package/dist/ai/design-tokens.json +60 -0
- package/dist/ai/guides/agent-contract.md +9 -5
- package/dist/ai/guides/calendars-and-digits.md +1 -1
- package/dist/ai/guides/design-tokens.md +13 -0
- package/dist/ai/guides/eslint-rules.md +1 -1
- package/dist/ai/guides/fetch-items-playbook.md +7 -11
- package/dist/ai/guides/icons-policy.md +32 -11
- package/dist/ai/guides/installation-and-plugin-setup.md +24 -23
- package/dist/ai/guides/migration/adoption-checklist.md +1 -1
- package/dist/ai/guides/migration/components/bb-color-palette.md +11 -11
- package/dist/ai/guides/migration/components/bb-dropdown-button.md +1 -0
- package/dist/ai/guides/migration/components/bb-dropdown.md +1 -0
- package/dist/ai/guides/migration/components/bb-icon.md +4 -4
- package/dist/ai/guides/migration/components/bb-table.md +2 -1
- package/dist/ai/guides/migration/components/bb-toast.md +2 -2
- package/dist/ai/guides/migration/v2-to-v3.md +70 -24
- package/dist/ai/guides/migration/v3-beta-css-classes.md +18 -3
- package/dist/ai/guides/migration/v3-beta-tooling.md +1 -0
- package/dist/ai/guides/passthrough.md +58 -58
- package/dist/ai/helpers/inertia/manifest.json +1 -1
- package/dist/ai/index.md +1 -1
- package/dist/ai/manifest/common.json +1 -0
- package/dist/ai/manifest/components/BbAvatar.json +5 -2
- package/dist/ai/manifest/components/BbAvatar.tree.json +32 -2
- package/dist/ai/manifest/components/BbCarousel.json +0 -3
- package/dist/ai/manifest/components/BbCheckboxGroup.json +2 -2
- package/dist/ai/manifest/components/BbCheckboxGroup.tree.json +2 -0
- package/dist/ai/manifest/components/BbColorInput.json +5 -2
- package/dist/ai/manifest/components/BbColorPalette.json +5 -2
- package/dist/ai/manifest/components/BbColorPalette.removed.json +1 -2
- package/dist/ai/manifest/components/BbDatePicker.json +3 -0
- package/dist/ai/manifest/components/BbDatePickerInput.json +3 -0
- package/dist/ai/manifest/components/BbDialog.tree.json +3 -1
- package/dist/ai/manifest/components/BbDropdown.json +36 -28
- package/dist/ai/manifest/components/BbDropdown.removed.json +2 -1
- package/dist/ai/manifest/components/BbDropdown.tree.json +21 -11
- package/dist/ai/manifest/components/BbDropdownButton.json +24 -16
- package/dist/ai/manifest/components/BbDropdownButton.removed.json +2 -1
- package/dist/ai/manifest/components/BbDropdownButton.tree.json +4 -0
- package/dist/ai/manifest/components/BbGallery.tree.json +1 -1
- package/dist/ai/manifest/components/BbOffCanvas.tree.json +3 -1
- package/dist/ai/manifest/components/BbRadioGroup.json +2 -2
- package/dist/ai/manifest/components/BbRadioGroup.tree.json +2 -0
- package/dist/ai/manifest/components/BbSelect.json +47 -40
- package/dist/ai/manifest/components/BbSelect.tree.json +2 -1
- package/dist/ai/manifest/components/BbSelectPopover.json +14 -7
- package/dist/ai/manifest/components/BbSelectPopover.tree.json +9 -2
- package/dist/ai/manifest/components/BbSwitchGroup.json +2 -2
- package/dist/ai/manifest/components/BbSwitchGroup.tree.json +2 -0
- package/dist/ai/manifest/components/BbTable.json +6 -6
- package/dist/ai/manifest/components/BbTable.tree.json +9 -1
- package/dist/ai/manifest/components/BbTimePicker.json +5 -2
- package/dist/ai/manifest/components/BbTimePickerInput.json +5 -2
- package/dist/ai/manifest/components/BbTree.json +1 -1
- package/dist/ai/manifest/components/CommonPopover.json +1 -0
- package/dist/ai/manifest/components/FlatListBox.json +2 -1
- package/dist/ai/manifest/components/GroupedListBox.json +3 -2
- package/dist/ai/manifest/components/GroupedListBox.tree.json +1 -0
- package/dist/ai/manifest/components/ListBox.json +3 -2
- package/dist/ai/manifest/components/ListBox.tree.json +1 -1
- package/dist/ai/manifest/components/OptionsContainer.json +6 -4
- package/dist/ai/manifest/index.json +2 -2
- package/dist/ai/manifest/meta.json +0 -3
- package/dist/ai/manifest/types.advanced.json +6 -6
- package/dist/ai/manifest/types.api.json +1 -3
- package/dist/ai/recipes/inertia/inline-edit-workspace.md +1 -1
- package/dist/ai/recipes/inertia/onboarding.md +1 -1
- package/dist/ai/recipes/nuxt/inline-edit-workspace.md +1 -1
- package/dist/ai/recipes/nuxt/onboarding.md +1 -1
- package/dist/ai/recipes/vue/inline-edit-workspace.md +1 -1
- package/dist/ai/recipes/vue/onboarding.md +2 -2
- package/dist/ai/source/BbAccordion.md +4 -5
- package/dist/ai/source/BbAvatar.md +128 -11
- package/dist/ai/source/BbBadge.md +18 -7
- package/dist/ai/source/BbBreadcrumbs.md +57 -56
- package/dist/ai/source/BbButton.md +41 -25
- package/dist/ai/source/BbCalendar.md +8 -6
- package/dist/ai/source/BbCarousel.md +41 -34
- package/dist/ai/source/BbCheckboxGroup.md +15 -9
- package/dist/ai/source/BbColorInput.md +19 -0
- package/dist/ai/source/BbColorPalette.md +23 -2
- package/dist/ai/source/BbDatePicker.md +18 -0
- package/dist/ai/source/BbDatePickerInput.md +47 -3
- package/dist/ai/source/BbDialog.md +14 -1
- package/dist/ai/source/BbDropdown.md +296 -99
- package/dist/ai/source/BbDropdownButton.md +61 -19
- package/dist/ai/source/BbDropdownGroup.md +189 -98
- package/dist/ai/source/BbGallery.md +82 -60
- package/dist/ai/source/BbHost.md +12 -0
- package/dist/ai/source/BbNumberInput.md +17 -10
- package/dist/ai/source/BbOffCanvas.md +14 -1
- package/dist/ai/source/BbPagination.md +12 -28
- package/dist/ai/source/BbRadioGroup.md +12 -5
- package/dist/ai/source/BbRating.md +4 -4
- package/dist/ai/source/BbSelect.md +151 -112
- package/dist/ai/source/BbSelectPopover.md +244 -29
- package/dist/ai/source/BbSwitchGroup.md +11 -4
- package/dist/ai/source/BbTable.md +114 -35
- package/dist/ai/source/BbTimePicker.md +19 -0
- package/dist/ai/source/BbTimePickerInput.md +21 -2
- package/dist/ai/source/BbToast.md +2 -2
- package/dist/ai/source/BbToastPortal.md +2 -2
- package/dist/ai/source/BbTree.md +1 -1
- package/dist/ai/source/ClearableButton.md +4 -2
- package/dist/ai/source/CommonPopover.md +24 -1
- package/dist/ai/source/ErrorIcon.md +4 -3
- package/dist/ai/source/FlatListBox.md +33 -7
- package/dist/ai/source/GroupedListBox.md +85 -14
- package/dist/ai/source/ListBox.md +11 -1
- package/dist/ai/source/OptionsContainer.md +29 -11
- package/dist/ai/source/WarningIcon.md +4 -3
- package/dist/assets/svgs/close.svg_raw.js +1 -1
- package/dist/components/BbAccordion/BbAccordion.vue.d.ts +1 -1
- package/dist/components/BbAccordion/BbAccordion.vue_vue_type_script_setup_true_lang.js +35 -34
- package/dist/components/BbAvatar/BbAvatar.vue.d.ts +1 -0
- package/dist/components/BbAvatar/BbAvatar.vue_vue_type_script_setup_true_lang.js +62 -43
- package/dist/components/BbAvatar/avatarIdentity.js +25 -0
- package/dist/components/BbAvatar/ptKeys.generated.d.ts +5 -1
- package/dist/components/BbAvatar/types.d.ts +24 -5
- package/dist/components/BbAvatar/types.js +5 -1
- package/dist/components/BbBadge/BadgeBodyContent.vue_vue_type_script_setup_true_lang.js +24 -23
- package/dist/components/BbBadge/BbBadge.vue_vue_type_script_setup_true_lang.js +66 -64
- package/dist/components/BbBreadcrumbs/BbBreadcrumbs.vue_vue_type_script_setup_true_lang.js +141 -146
- package/dist/components/BbButton/BbButton.vue_vue_type_script_setup_true_lang.js +100 -85
- package/dist/components/BbCalendar/BbCalendar.vue.d.ts +1 -1
- package/dist/components/BbCalendar/BbCalendar.vue_vue_type_script_setup_true_lang.js +240 -239
- package/dist/components/BbCalendar/useDayGrid.js +120 -123
- package/dist/components/BbCarousel/BbCarousel.vue_vue_type_script_setup_true_lang.js +503 -502
- package/dist/components/BbCheckboxGroup/BbCheckboxGroup.vue.d.ts +4 -4
- package/dist/components/BbCheckboxGroup/BbCheckboxGroup.vue_vue_type_script_setup_true_lang.js +126 -122
- package/dist/components/BbCheckboxGroup/types.d.ts +7 -11
- package/dist/components/BbColorInput/BbColorInput.vue.d.ts +2 -0
- package/dist/components/BbColorInput/BbColorInput.vue_vue_type_script_setup_true_lang.js +148 -141
- package/dist/components/BbColorInput/types.d.ts +7 -0
- package/dist/components/BbColorPalette/BbColorPalette.vue.d.ts +2 -0
- package/dist/components/BbColorPalette/BbColorPalette.vue_vue_type_script_setup_true_lang.js +208 -196
- package/dist/components/BbColorPalette/types.d.ts +7 -0
- package/dist/components/BbDatePicker/BbDatePicker.vue.d.ts +3 -1
- package/dist/components/BbDatePicker/BbDatePicker.vue_vue_type_script_setup_true_lang.js +84 -73
- package/dist/components/BbDatePicker/types.d.ts +7 -0
- package/dist/components/BbDatePickerInput/BbDatePickerInput.vue.d.ts +4 -2
- package/dist/components/BbDatePickerInput/BbDatePickerInput.vue_vue_type_script_setup_true_lang.js +496 -510
- package/dist/components/BbDatePickerInput/types.d.ts +7 -0
- package/dist/components/BbDialog/BbDialog.vue_vue_type_script_setup_true_lang.js +219 -211
- package/dist/components/BbDialog/leaveGhost.js +22 -17
- package/dist/components/BbDropdown/AdaptiveDropdown.vue_vue_type_script_setup_true_lang.js +106 -100
- package/dist/components/BbDropdown/BbDropdown.vue.d.ts +3 -0
- package/dist/components/BbDropdown/BbDropdown.vue_vue_type_script_setup_true_lang.js +416 -369
- package/dist/components/BbDropdown/BbDropdownList.vue_vue_type_script_setup_true_lang.js +404 -354
- package/dist/components/BbDropdown/DropdownFailures.vue.js +4 -0
- package/dist/components/BbDropdown/DropdownFailures.vue_vue_type_script_setup_true_lang.js +24 -0
- package/dist/components/BbDropdown/DropdownPipelineResolver.vue_vue_type_script_setup_true_lang.js +117 -102
- package/dist/components/BbDropdown/DropdownRow.vue_vue_type_script_setup_true_lang.js +67 -38
- package/dist/components/BbDropdown/normalizeGroups.js +6 -2
- package/dist/components/BbDropdown/ptKeys.generated.d.ts +44 -20
- package/dist/components/BbDropdown/types.d.ts +109 -87
- package/dist/components/BbDropdown/types.js +3 -0
- package/dist/components/BbDropdownButton/BbDropdownButton.vue.d.ts +3 -1
- package/dist/components/BbDropdownButton/BbDropdownButton.vue_vue_type_script_setup_true_lang.js +101 -65
- package/dist/components/BbDropdownButton/ptKeys.generated.d.ts +153 -57
- package/dist/components/BbDropdownButton/types.d.ts +23 -10
- package/dist/components/BbDropdownButton/types.js +4 -0
- package/dist/components/BbDropzone/BbDropzone.vue.d.ts +1 -1
- package/dist/components/BbGallery/BbGallery.vue_vue_type_script_setup_true_lang.js +335 -312
- package/dist/components/BbHost/BbHost.vue_vue_type_script_setup_true_lang.js +7 -1
- package/dist/components/BbIcon/iconCache.js +1 -1
- package/dist/components/BbNumberInput/BbNumberInput.vue.d.ts +1 -1
- package/dist/components/BbNumberInput/BbNumberInput.vue_vue_type_script_setup_true_lang.js +9 -5
- package/dist/components/BbOffCanvas/BbOffCanvas.vue_vue_type_script_setup_true_lang.js +152 -144
- package/dist/components/BbPagination/BbPagination.vue.d.ts +2 -2
- package/dist/components/BbPagination/BbPagination.vue_vue_type_script_setup_true_lang.js +138 -136
- package/dist/components/BbProgress/BbProgress.vue.d.ts +1 -1
- package/dist/components/BbRadioGroup/BbRadioGroup.vue.d.ts +4 -4
- package/dist/components/BbRadioGroup/BbRadioGroup.vue_vue_type_script_setup_true_lang.js +108 -104
- package/dist/components/BbRadioGroup/types.d.ts +4 -7
- package/dist/components/BbRating/BbRating.vue.d.ts +1 -1
- package/dist/components/BbRating/BbRating.vue_vue_type_script_setup_true_lang.js +100 -99
- package/dist/components/BbSelect/BbSelect.vue.d.ts +32 -20
- package/dist/components/BbSelect/BbSelect.vue_vue_type_script_setup_true_lang.js +217 -196
- package/dist/components/BbSelect/ptKeys.generated.d.ts +128 -96
- package/dist/components/BbSelect/types.d.ts +110 -111
- package/dist/components/BbSelect/types.js +1 -27
- package/dist/components/BbSelectPopover/BbSelectPopover.vue.d.ts +8 -3
- package/dist/components/BbSelectPopover/BbSelectPopover.vue_vue_type_script_setup_true_lang.js +728 -653
- package/dist/components/BbSelectPopover/ptKeys.generated.d.ts +22 -10
- package/dist/components/BbSelectPopover/types.d.ts +32 -17
- package/dist/components/BbSelectPopover/types.js +3 -1
- package/dist/components/BbSwitchGroup/BbSwitchGroup.vue.d.ts +1 -1
- package/dist/components/BbSwitchGroup/BbSwitchGroup.vue_vue_type_script_setup_true_lang.js +159 -155
- package/dist/components/BbSwitchGroup/types.d.ts +3 -6
- package/dist/components/BbTable/BbTable.vue.d.ts +2 -4
- package/dist/components/BbTable/BbTable.vue_vue_type_script_setup_true_lang.js +1171 -1152
- package/dist/components/BbTable/BbTableDataRow.js +97 -90
- package/dist/components/BbTable/types.d.ts +11 -10
- package/dist/components/BbTabs/BbTabs.vue.d.ts +3 -3
- package/dist/components/BbTimePicker/BbTimePicker.vue.d.ts +4 -2
- package/dist/components/BbTimePicker/BbTimePicker.vue_vue_type_script_setup_true_lang.js +145 -134
- package/dist/components/BbTimePicker/types.d.ts +7 -0
- package/dist/components/BbTimePickerInput/BbTimePickerInput.vue.d.ts +4 -2
- package/dist/components/BbTimePickerInput/BbTimePickerInput.vue_vue_type_script_setup_true_lang.js +290 -280
- package/dist/components/BbTimePickerInput/types.d.ts +7 -0
- package/dist/components/BbToast/BbToastMessage.vue_vue_type_script_setup_true_lang.js +79 -78
- package/dist/components/BbToast/types.d.ts +2 -2
- package/dist/components/BbTree/BbTreeLevel.vue_vue_type_script_setup_true_lang.js +56 -46
- package/dist/components/BbTree/types.d.ts +1 -1
- package/dist/components/ClearableButton/ClearableButton.vue_vue_type_script_setup_true_lang.js +9 -8
- package/dist/components/CloseIcon/CloseButton.vue.js +1 -1
- package/dist/components/CloseIcon/CloseButton.vue_vue_type_script_setup_true_lang.js +9 -7
- package/dist/components/CommonPopover/CommonPopover.vue_vue_type_script_setup_true_lang.js +13 -1
- package/dist/components/ErrorIcon/ErrorIcon.vue_vue_type_script_setup_true_lang.js +8 -6
- package/dist/components/FlatListBox/FlatListBox.vue_vue_type_script_setup_true_lang.js +122 -102
- package/dist/components/GroupedListBox/GroupedListBox.vue_vue_type_script_setup_true_lang.js +182 -153
- package/dist/components/ListBox/ListBox.vue_vue_type_script_setup_true_lang.js +7 -4
- package/dist/components/OptionsContainer/OptionsContainer.vue_vue_type_script_setup_true_lang.js +86 -77
- package/dist/components/WarningIcon/WarningIcon.vue_vue_type_script_setup_true_lang.js +8 -6
- package/dist/composables/useInternalIcon.js +25 -0
- package/dist/composables/useItemsGetter.js +34 -32
- package/dist/composables/useOpenModel.js +20 -0
- package/dist/deprecation/ai-deprecations.json.js +1 -1
- package/dist/i18n/locales/ar.json +2 -0
- package/dist/i18n/locales/cs.json +2 -0
- package/dist/i18n/locales/da.json +2 -0
- package/dist/i18n/locales/de-CH.json +2 -0
- package/dist/i18n/locales/de.json +2 -0
- package/dist/i18n/locales/el.json +2 -0
- package/dist/i18n/locales/en-GB.json +2 -0
- package/dist/i18n/locales/en.json +2 -0
- package/dist/i18n/locales/es-MX.json +2 -0
- package/dist/i18n/locales/es.json +2 -0
- package/dist/i18n/locales/fa.json +2 -0
- package/dist/i18n/locales/fi.json +2 -0
- package/dist/i18n/locales/fr.json +2 -0
- package/dist/i18n/locales/he.json +2 -0
- package/dist/i18n/locales/hu.json +2 -0
- package/dist/i18n/locales/it.json +2 -0
- package/dist/i18n/locales/ja.json +2 -0
- package/dist/i18n/locales/ko.json +2 -0
- package/dist/i18n/locales/nb.json +2 -0
- package/dist/i18n/locales/nl.json +2 -0
- package/dist/i18n/locales/pl.json +2 -0
- package/dist/i18n/locales/pt-BR.json +2 -0
- package/dist/i18n/locales/pt-PT.json +2 -0
- package/dist/i18n/locales/ro.json +2 -0
- package/dist/i18n/locales/ru.json +2 -0
- package/dist/i18n/locales/sv.json +2 -0
- package/dist/i18n/locales/tr.json +2 -0
- package/dist/i18n/locales/uk.json +2 -0
- package/dist/i18n/locales/zh-CN.json +2 -0
- package/dist/i18n/locales/zh-HK.json +2 -0
- package/dist/i18n/locales/zh-TW.json +2 -0
- package/dist/icon-scan.d.ts +1 -1
- package/dist/icon-scan.js +68 -61
- package/dist/index.d.ts +2 -2
- package/dist/llms-full.txt +1038 -451
- package/dist/llms-medium.txt +33 -28
- package/dist/llms.txt +2 -2
- package/dist/locale-blueprint.json +2 -0
- package/dist/nuxt.js +1 -1
- package/dist/styles.css +2 -2
- package/dist/types/ActionButton.d.ts +2 -3
- package/dist/types/Config.d.ts +8 -1
- package/dist/types/ConfigDefaults.d.ts +10 -2
- package/dist/types/Option.d.ts +10 -0
- package/dist/types/internalIcons.d.ts +89 -0
- package/dist/types/internalIcons.js +158 -0
- package/dist/types/ptComponentMap.d.ts +5 -5
- package/dist/utilities/functions/slotContent.js +19 -0
- package/dist/utils/configDefaults.js +75 -64
- package/dist/utils/iconsOption.js +48 -0
- package/dist/utils/loadRetry.js +8 -0
- package/dist/utils/versionCheck.js +1 -1
- package/dist/vite-plugin.d.ts +10 -16
- package/dist/vite.js +323 -307
- package/llms.txt +2 -2
- package/package.json +3 -1
- package/scripts/README.md +2 -0
- package/scripts/lib/adoption-checklist.json +1 -1
- package/scripts/lib/agent-setup.mjs +44 -26
- package/scripts/lib/update-install.mjs +48 -0
- package/scripts/lib/validate-bb-markup.mjs +93 -12
- package/dist/ai/manifest/components/BbAvatar.removed.json +0 -6
- package/dist/assets/svgs/caret_down.svg_raw.js +0 -3
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
|
[
|
|
@@ -674,20 +674,21 @@ rows distinct values when it matters:
|
|
|
674
674
|
- **Submenu parents.** A row that opens a submenu needs a value unique in the
|
|
675
675
|
whole menu; the flyout is addressed by it.
|
|
676
676
|
|
|
677
|
-
###
|
|
677
|
+
### Headings: `group: true` or `groupBy`
|
|
678
678
|
|
|
679
679
|
Two ways to put headings in a menu, for two different needs:
|
|
680
680
|
|
|
681
|
-
- **Independent
|
|
682
|
-
with `group: true` is
|
|
683
|
-
|
|
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
|
|
684
684
|
group keeps **its own** value (its own companion and `v-model`) and, when
|
|
685
|
-
`searchable`, its own search field. Use it for
|
|
685
|
+
`searchable`, its own search field. Use it for groups that answer
|
|
686
686
|
different questions ("Sort by" / "Show").
|
|
687
687
|
- **One choice, sorted under headings: `groupBy` on one group.** The rows of a
|
|
688
|
-
single group are listed under
|
|
688
|
+
single group are listed under headings, and it stays one group:
|
|
689
689
|
**one** `v-model`, **one** search field. Use it when the headings only
|
|
690
690
|
organise the options of one question (categories under their sector).
|
|
691
|
+
Its headings are sticky, as `BbSelect`'s group headers are.
|
|
691
692
|
|
|
692
693
|
```vue
|
|
693
694
|
<BbDropdown
|
|
@@ -713,14 +714,23 @@ Two ways to put headings in a menu, for two different needs:
|
|
|
713
714
|
- `groupBy` is a field path (`'sector'`, `'owner.team'`) read off each row,
|
|
714
715
|
or a function `(row) => string | null | undefined`. On a fetched group it
|
|
715
716
|
reads the **raw item**, so `items: ({ query }) => …` groups the same way.
|
|
716
|
-
-
|
|
717
|
-
`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**,
|
|
718
719
|
before every heading — the same rule as `BbSelect`'s `group-by`.
|
|
719
720
|
- A heading is not a row: the arrows and typeahead skip it, and it is never
|
|
720
|
-
selected. A search hides a
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
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
|
+
```
|
|
724
734
|
|
|
725
735
|
### Loading options on demand
|
|
726
736
|
|
|
@@ -743,9 +753,10 @@ The full grammar:
|
|
|
743
753
|
need the mapping. On a **`searchable`** group the context also carries
|
|
744
754
|
`query` (what the user typed, and `reason: 'search'` when they did) —
|
|
745
755
|
the same shape `BbSelect` passes, which is why one provider drops into both.
|
|
746
|
-
A getter **throws** to fail: the
|
|
747
|
-
icon
|
|
748
|
-
|
|
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.
|
|
749
760
|
- `itemText` / `itemValue` — a path string or getter producing each raw item's
|
|
750
761
|
label and value; without them a row reads its own `label` (else `text`) and
|
|
751
762
|
`value`. `v-model` on the companion surfaces the selected value(s);
|
|
@@ -1223,7 +1234,7 @@ What each knob does:
|
|
|
1223
1234
|
ranked search (case and accents ignored; exact, then starts-with, then word
|
|
1224
1235
|
starts, then contains, then a code typed without separators; one typo per
|
|
1225
1236
|
word of 5+ letters only when nothing else matched; ranked inside each
|
|
1226
|
-
`groupBy`
|
|
1237
|
+
`groupBy` heading), and on an async group passes the typed text to the getter as
|
|
1227
1238
|
`query` in its context object (`reason: 'search'`), the same shape
|
|
1228
1239
|
`BbSelect` uses, so one provider serves both.
|
|
1229
1240
|
- **`filterBy`** picks which raw fields the local search reads. Empty
|
|
@@ -1241,9 +1252,11 @@ What each knob does:
|
|
|
1241
1252
|
`searchable`, which is the one place the three-state `prefill` differs from a
|
|
1242
1253
|
plain menu group (`'interaction'`, the default, fetches when the group is
|
|
1243
1254
|
first reached; `true` fetches on mount).
|
|
1244
|
-
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1255
|
+
- **`minQueryLength`** (as on `BbSelect`): below that many characters
|
|
1256
|
+
(after trimming; an emoji is one) 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:
|
|
1247
1260
|
|
|
1248
1261
|
```vue
|
|
1249
1262
|
<BbDropdown
|
|
@@ -1254,15 +1267,12 @@ What each knob does:
|
|
|
1254
1267
|
searchable: true,
|
|
1255
1268
|
selectable: true,
|
|
1256
1269
|
prefill: false,
|
|
1270
|
+
minQueryLength: 2,
|
|
1257
1271
|
filterBy: false,
|
|
1258
|
-
items: ({ query }) =>
|
|
1272
|
+
items: ({ query }) => api.zones({ q: query }),
|
|
1259
1273
|
},
|
|
1260
1274
|
]"
|
|
1261
|
-
|
|
1262
|
-
<template #empty="{ query, text }">
|
|
1263
|
-
{{ query.length < 2 ? 'Type at least 2 characters' : text }}
|
|
1264
|
-
</template>
|
|
1265
|
-
</BbDropdown>
|
|
1275
|
+
/>
|
|
1266
1276
|
```
|
|
1267
1277
|
|
|
1268
1278
|
- **`stash`** accumulates the items behind _selected_ keys so they stay
|
|
@@ -1337,12 +1347,13 @@ and `"deleteFile"` all → `#delete-file`. For a value with accents, non-Latin l
|
|
|
1337
1347
|
when unsure, write `#[slotKey('Qualità')]` (`import { slotKey } from
|
|
1338
1348
|
'bitboss-ui'`) instead of spelling it by hand.
|
|
1339
1349
|
|
|
1340
|
-
| Slot | Renders for
|
|
1341
|
-
| ------------------------------------------------------------- |
|
|
1342
|
-
| `#<value>`, `#<value>:prepend`, `#<value>:append` | one row — its content, leading or trailing region
|
|
1343
|
-
| `#<groupId>:item`, `#<groupId>:item:prepend`, `…:item:append` | **every row of that group**, and nothing else
|
|
1344
|
-
| `#<groupId
|
|
1345
|
-
|
|
|
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 |
|
|
1346
1357
|
|
|
1347
1358
|
Each edge of a row has **one occupant** — nothing renders side by side. From
|
|
1348
1359
|
strongest to weakest:
|
|
@@ -1356,7 +1367,9 @@ strongest to weakest:
|
|
|
1356
1367
|
| `item:prepend` | `item:append` |
|
|
1357
1368
|
| `prepend:icon` | `append:icon` |
|
|
1358
1369
|
|
|
1359
|
-
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
|
|
1360
1373
|
row's own `#<value>:append` is written for that one row, so it may replace its
|
|
1361
1374
|
submenu chevron; the group-wide and shared append slots never do, so a submenu
|
|
1362
1375
|
row keeps its chevron unless you name it. The check beats everything — as in
|
|
@@ -1622,8 +1635,9 @@ Two things this replaces, both seen in real apps:
|
|
|
1622
1635
|
`v-else-if="clinicsById.get(item.value)"`) to tell a record row from an action
|
|
1623
1636
|
row, and a lookup map rebuilt from the fetch to get the record back. The
|
|
1624
1637
|
group row slot is the "which rows" answer; `item.meta` is the record.
|
|
1625
|
-
- **Re-drawing the other rows' icons
|
|
1626
|
-
|
|
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.
|
|
1627
1641
|
|
|
1628
1642
|
### Header and footer
|
|
1629
1643
|
|
|
@@ -1639,6 +1653,12 @@ in one `<div>`: a single wrapping element stretches across the sheet and lays
|
|
|
1639
1653
|
out its children itself. The example below does that, so the button spans the
|
|
1640
1654
|
footer on both surfaces.
|
|
1641
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.
|
|
1661
|
+
|
|
1642
1662
|
**Pinned header and footer**
|
|
1643
1663
|
|
|
1644
1664
|
```vue
|
|
@@ -1752,6 +1772,66 @@ const items: BbDropdownItem[] = [
|
|
|
1752
1772
|
</script>
|
|
1753
1773
|
```
|
|
1754
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
|
+
|
|
1755
1835
|
### Placement, width and boundaries
|
|
1756
1836
|
|
|
1757
1837
|
- `placement` (default `'bottom'`) accepts every floating-UI placement
|
|
@@ -1773,7 +1853,11 @@ const items: BbDropdownItem[] = [
|
|
|
1773
1853
|
edge away from the trigger, and only the viewport flips it) tune positioning.
|
|
1774
1854
|
Pass `boundary` a `useTemplateRef` or a selector, not `$refs.x`: `$refs` is
|
|
1775
1855
|
not reactive, so a menu in a table cell rendered before the ref was set keeps
|
|
1776
|
-
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
|
|
1777
1861
|
before first open; `transitionDuration` controls the open/close animation.
|
|
1778
1862
|
- The menu closes itself on outside click/focus, on `Escape`, when another
|
|
1779
1863
|
dropdown opens, and when the activator scrolls out of view. `disabled`
|
|
@@ -1954,15 +2038,18 @@ object form, a style and attributes — optionally only while a state is on.
|
|
|
1954
2038
|
Parts: `root` (the flyout — an invisible positioning wrapper, no node on
|
|
1955
2039
|
mobile), `panel` (the menu surface you see — background, border, radius and
|
|
1956
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),
|
|
1957
|
-
`header`, `footer`, `
|
|
1958
|
-
|
|
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),
|
|
1959
2046
|
`list` (the top-level entries container between the bands
|
|
1960
2047
|
— a flex column with a 1px gap; a submenu's list is not reached), `item` — every entry, submenus included, a broadcast
|
|
1961
2048
|
resolved per entry — and `itemText` / `itemIcon` / `itemDescription`, that
|
|
1962
2049
|
entry's label, its prepend / append icons and its muted second line (the item's
|
|
1963
2050
|
`label` / `prepend:icon` · `append:icon` / `description`), resolved with the entry's
|
|
1964
|
-
states (a per-entry `#<value>` slot replaces the label and description), and `check`, the tick at the end of a selectable group's checked entry (a row slot never replaces it; `pt:check="hidden"` drops it and leaves a mark your slot draws alone), and `submenu`, every submenu's flyout box at any depth (desktop: a phone sheet drills into submenus in place, so style what you see there with `panel`). States: `open`, and `selected` / `disabled` per entry.
|
|
1965
|
-
|
|
2051
|
+
states (a per-entry `#<value>` slot replaces the label and description), `groupLabel` (every group's label row: its `label` and icons, the row an `onClick` group activates; `#<id>:label` replaces its content) and `groupHeader` (every `groupBy` heading, sticky; `#group` / `#<id>:group` replace its content), and `check`, the tick at the end of a selectable group's checked entry (a row slot never replaces it; `pt:check="hidden"` drops it and leaves a mark your slot draws alone), and `submenu`, every submenu's flyout box at any depth (desktop: a phone sheet drills into submenus in place, so style what you see there with `panel`). States: `open`, and `selected` / `disabled` per entry.
|
|
2052
|
+
A group's items box and the dividers are not parts.
|
|
1966
2053
|
|
|
1967
2054
|
The invoice View menu, restyled through those parts: a muted wash on
|
|
1968
2055
|
`pt:header` and on `pt:item:selected` (per entry), muted
|
|
@@ -2292,11 +2379,10 @@ own sizes.
|
|
|
2292
2379
|
`<BbDropdownGroup>` companions; a button there opens nothing. Use
|
|
2293
2380
|
`<template #activator="{ props }">` + `v-bind="props"`, or `v-bb-dropdown`
|
|
2294
2381
|
(`bitboss-ui/dropdown-default-slot` and `check` report it).
|
|
2295
|
-
- **
|
|
2296
|
-
(
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
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.
|
|
2300
2386
|
- **Don't navigate from `onClick`** (`router.push`, `window.location`) — give
|
|
2301
2387
|
the item `href`/`to` and let it render a real link.
|
|
2302
2388
|
- **Don't rebuild selection** with `onClick` + your own state — mark the group
|
|
@@ -2408,33 +2494,38 @@ uses `ArrowRight` / `ArrowLeft` and its back control; `Escape` on a drilled-in
|
|
|
2408
2494
|
level (row or search box) goes back one level, focus on the row that opened
|
|
2409
2495
|
it, and at the top level closes the sheet.
|
|
2410
2496
|
|
|
2497
|
+
## v-model
|
|
2498
|
+
|
|
2499
|
+
- `v-model` — type: `boolean \| undefined`
|
|
2500
|
+
|
|
2411
2501
|
## Props
|
|
2412
2502
|
|
|
2413
2503
|
| Prop | Type | Default | Required | Description |
|
|
2414
2504
|
| --- | --- | --- | --- | --- |
|
|
2415
|
-
| `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`, `groupHeader`, `groupLabel`, `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>`. |
|
|
2416
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. |
|
|
2417
|
-
| `adaptive` | `boolean \| undefined` | ``all.adaptive` (`true`)` | | On mobile (below `config.mobileMaxWidth`),
|
|
2507
|
+
| `adaptive` | `boolean \| undefined` | ``all.adaptive` (`true`)` | | On mobile (below `config.mobileMaxWidth`), the menu is a bottom sheet drilling into submenus a level at a time, not hover flyouts; slots and selection unchanged. Unset: the global `all.adaptive`. |
|
|
2418
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"`. |
|
|
2419
|
-
| `boundary` | `string \| ElementOrComponentRef \| undefined` | | | Keeps the panel inside this element beside its trigger (sideways
|
|
2420
|
-
| `closeOnSelect` | `boolean \| undefined` | `unset (close after a single-choice change)` | | Whether a selection closes the menu. Unset: a
|
|
2421
|
-
| `compact` | `boolean \| undefined` | `undefined` | | Compact density, the `BbSelect` ladder: flyout rows
|
|
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`). In a `BbTable`: its left and right edges. |
|
|
2510
|
+
| `closeOnSelect` | `boolean \| undefined` | `unset (close after a single-choice change)` | | Whether a selection closes the menu. Unset: a single-choice group's change closes it (an untick too, any depth), a `multiple` group stays open. `true`: every change closes it; `false`: none. |
|
|
2511
|
+
| `compact` | `boolean \| undefined` | `undefined` | | Compact density, the `BbSelect` ladder: flyout rows 28 → 24px, sheet rows 44 → 36px (still a touch target). The label size stays. |
|
|
2422
2512
|
| `disabled` | `boolean \| undefined` | `false` | | Disables the component |
|
|
2423
|
-
| `eager` | `boolean \| undefined` | `false` | | Renders the
|
|
2424
|
-
| `emptyText` | `string \| undefined` | | |
|
|
2513
|
+
| `eager` | `boolean \| undefined` | `false` | | Renders the panel (the phone sheet's too) at mount, not on the first open, and keeps its rows after a close; otherwise rows mount on each open and go after the close. |
|
|
2514
|
+
| `emptyText` | `string \| undefined` | | | A pipeline group's no-items row; its own `emptyText` wins. Default: `common.emptyText`. |
|
|
2425
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. |
|
|
2426
|
-
| `failedText` | `string \| undefined` | | |
|
|
2516
|
+
| `failedText` | `string \| undefined` | | | A pipeline group's failed-load row (its getter threw); its own `failedText` wins. Default: `common.failedText`. |
|
|
2427
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. |
|
|
2428
|
-
| `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. |
|
|
2429
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. |
|
|
2430
|
-
| `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. |
|
|
2431
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. |
|
|
2432
2523
|
| `offset` | `number \| undefined` | `4` | | Space the floating container will maintain from the activator. |
|
|
2433
2524
|
| `padding` | `number \| undefined` | `10` | | Minimum empty space to keep from the edge of the page |
|
|
2434
2525
|
| `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). |
|
|
2435
2526
|
| `queryDebounceTime` | `number \| undefined` | `300` | | Debounce (ms) applied to the async re-fetch a `searchable` group fires as the user types. Applies to every searchable group in the menu. |
|
|
2436
|
-
| `transitionDuration` | `number \| undefined` | `150` | | The open / close transition
|
|
2437
|
-
| `trigger` | `DropdownTrigger \| DropdownTrigger[] \| undefined` | `"click"` | |
|
|
2527
|
+
| `transitionDuration` | `number \| undefined` | `150` | | The open / close transition (ms). Menus take the fast 150, not the popovers' 250: a menu is picked from and gone, quicker than a panel you read or edit. |
|
|
2528
|
+
| `trigger` | `DropdownTrigger \| DropdownTrigger[] \| undefined` | `"click"` | | What opens the menu, one or an array: `'click'` (left-click / tap) or `'contextMenu'` (right-click; long-press on mobile). |
|
|
2438
2529
|
| `width` | `string \| number \| undefined` | `"auto"` | | Width of the dropdown in pixels, percentage, or 'auto' to fit content. |
|
|
2439
2530
|
|
|
2440
2531
|
## Passthrough parts and states
|
|
@@ -2443,17 +2534,20 @@ it, and at the top level closes the sheet.
|
|
|
2443
2534
|
|
|
2444
2535
|
| Part | What it is |
|
|
2445
2536
|
| --- | --- |
|
|
2446
|
-
| `root` | The floating element
|
|
2537
|
+
| `root` | The floating element, an invisible positioning wrapper; a `class` on the component lands here. No node on the phone sheet (style `panel` there). |
|
|
2447
2538
|
| `panel` | The menu surface you see — the bordered flyout box on desktop, the sheet itself on a phone. |
|
|
2448
|
-
| `sheet` | The bottom sheet
|
|
2539
|
+
| `sheet` | The phone's bottom sheet (the `BbOffCanvas` root), never the desktop surface; applied after `panel`, so it wins a conflict. |
|
|
2449
2540
|
| `header` | The menu's header band. |
|
|
2450
2541
|
| `footer` | The menu's footer band. |
|
|
2451
|
-
| `
|
|
2452
|
-
| `
|
|
2542
|
+
| `box` | Every searchable group's search box (field and magnifier), as `box` on a field; desktop and phone. |
|
|
2543
|
+
| `input` | Every searchable group's search field, desktop and phone alike. Its magnifier glyph is chrome. |
|
|
2544
|
+
| `list` | The top-level entries' container between the bands (a flex column, 1px gap; on a phone, the sheet's). A submenu's list is not reached. |
|
|
2545
|
+
| `groupLabel` | Every group's label row (its `label` and icons; the row an `onClick` group activates). `#<id>:label` replaces its content. |
|
|
2546
|
+
| `groupHeader` | Every `groupBy` heading (sticky). `#group` / `#<id>:group` replace its content. |
|
|
2453
2547
|
| `item` | One menu entry, submenus included — a broadcast resolved per entry. Also takes a per-item function, called with the entry. |
|
|
2454
2548
|
| `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. |
|
|
2455
2549
|
| `itemIcon` | An entry's prepend / append icons — resolved with that entry's states. Also takes a per-item function. |
|
|
2456
|
-
| `itemDescription` | An entry's muted second line (its `description`)
|
|
2550
|
+
| `itemDescription` | An entry's muted second line (its `description`), with the entry's states. A per-entry `#<value>` slot replaces it. Also takes a per-item function. |
|
|
2457
2551
|
| `check` | A checked entry's tick, outside the row slots: `pt:check="hidden"` spares your own glyph. Also takes a per-item function. |
|
|
2458
2552
|
| `submenu` | Every submenu's flyout box (desktop only). Also takes a per-item function, called with the entry that opens it. |
|
|
2459
2553
|
|
|
@@ -2461,7 +2555,7 @@ States are listed in precedence order: when two are on at once and their entries
|
|
|
2461
2555
|
|
|
2462
2556
|
| State | When it is on |
|
|
2463
2557
|
| --- | --- |
|
|
2464
|
-
| `activeLink` | Per node, on the entry parts: an entry whose link (`to` / `href`)
|
|
2558
|
+
| `activeLink` | Per node, on the entry parts: an entry whose link (`to` / `href`) is the current page or an ancestor (its `activeClass` is on). The weakest state. |
|
|
2465
2559
|
| `exactActiveLink` | Per node, on the entry parts: an entry whose link points at the current page itself — its `exactActiveClass` is on. |
|
|
2466
2560
|
| `selected` | Per node, on the entry parts: a selectable group's checked entry. |
|
|
2467
2561
|
| `disabled` | Per node, on the entry parts: an entry that is disabled. |
|
|
@@ -2473,30 +2567,33 @@ States are listed in precedence order: when two are on at once and their entries
|
|
|
2473
2567
|
|
|
2474
2568
|
- `hidden` — `(): void` — Emitted once the menu has finished closing.
|
|
2475
2569
|
- `hide` — `(): void` — Emitted as soon as the menu starts to close.
|
|
2476
|
-
- `item:selected` — `(value: any): void` — The user selected a row in a selectable group, at the click
|
|
2570
|
+
- `item:selected` — `(value: any): void` — The user selected a row in a selectable group, at the click, even when a controlled companion's app then refuses it. Payload: the row's value (`item-value` for pipeline groups, else `value`).
|
|
2477
2571
|
- `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`.
|
|
2478
2572
|
- `show` — `(): void` — Emitted as soon as the menu (the popover, or the sheet on a phone) starts to open.
|
|
2479
2573
|
- `shown` — `(): void` — Emitted once the menu is open and its open transition has finished.
|
|
2574
|
+
- `update:modelValue` — `(value: boolean): void` — The menu opened or closed (`v-model`): `true` on open, `false` on close.
|
|
2480
2575
|
|
|
2481
2576
|
## Slots
|
|
2482
2577
|
|
|
2483
2578
|
- `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.
|
|
2484
2579
|
- `default` — scope: `any` — Hosts `<BbDropdownGroup>` companions. They register their group with the dropdown and render nothing themselves.
|
|
2485
|
-
- `empty` — scope: `BbDropdownPlaceholderSlotProps` `{ groupId?: string; query: string; text: string }` — Replaces the
|
|
2580
|
+
- `empty` — scope: `BbDropdownPlaceholderSlotProps` `{ groupId?: string; query: string; text: string }` — Replaces the placeholder row of a pipeline group that resolved to no items, once per empty group. A failed load is not empty: it keeps its own row (error icon, `failedText`).
|
|
2486
2581
|
- `footer` — scope: `BbDropdownEdgeSlotProps` `{ disabled?: boolean; open: boolean; placement: Placement \| "cursor" }` — Pinned below the rows, outside their scroll, with a divider — for action buttons.
|
|
2582
|
+
- `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.
|
|
2487
2583
|
- `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.
|
|
2488
|
-
- `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
|
|
2489
|
-
- `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
|
|
2584
|
+
- `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 label), replacing its `append:icon` wherever it renders. A named slot wins; a submenu chevron or a selected row's check takes its place.
|
|
2585
|
+
- `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.
|
|
2490
2586
|
- `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.
|
|
2491
|
-
- `#<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`.
|
|
2587
|
+
- `#<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`.
|
|
2492
2588
|
- `#<value>:prepend` (named from data) — scope: `BbDropdownItemSlotProps` — One row's leading region; replaces its `prepend:icon`.
|
|
2493
2589
|
- `#<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.
|
|
2494
2590
|
- `#<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.
|
|
2495
2591
|
- `#<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`.
|
|
2496
2592
|
- `#<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.
|
|
2497
|
-
- `#<groupId
|
|
2593
|
+
- `#<groupId>:label` (named from data) — scope: `BbDropdownItemSlotProps` — That group's title content (`item` is the group, `groupTitle` is `true`).
|
|
2498
2594
|
- `#<groupId>:prepend` (named from data) — scope: `BbDropdownItemSlotProps` — The leading region of that group's title line.
|
|
2499
2595
|
- `#<groupId>:append` (named from data) — scope: `BbDropdownItemSlotProps` — The trailing region of that group's title line.
|
|
2596
|
+
- `#<groupId>:group` (named from data) — scope: `BbDropdownGroupSlotProps` — That group's `groupBy` headings; beats `group`.
|
|
2500
2597
|
|
|
2501
2598
|
## CSS custom properties
|
|
2502
2599
|
|
|
@@ -2519,12 +2616,12 @@ Set these on the element, or on a class you put on it, to retune this component
|
|
|
2519
2616
|
- `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`
|
|
2520
2617
|
- `BbDropdownList` _(internal — not importable, reach it through `BbDropdown`)_ — also mounts `BbIcon`, `ErrorIcon`, `CommonPopover`, `BbDropdownList`
|
|
2521
2618
|
- `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`
|
|
2522
|
-
- `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`
|
|
2619
|
+
- `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`
|
|
2523
2620
|
- `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`
|
|
2524
|
-
- `CloseButton` _(internal — not importable, reach it through `BbOffCanvas`)_ — documented CSS variables: `--size`, `--p`, `--icon-size`; also mounts `BbIcon`
|
|
2621
|
+
- `CloseButton` _(internal — not importable, reach it through `BbOffCanvas`)_ — documented CSS variables: `--size`, `--p`, `--icon-size`, `--icon-inset`; also mounts `BbIcon`
|
|
2525
2622
|
- `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`
|
|
2526
2623
|
- `BbBaseButton` _(public — [contract](./BbBaseButton.md))_ — its own pt parts (`BbBaseButton`): `root` → `RouterComponent`, `root` → `a`, `root` → `component`; also mounts `RouterComponent`
|
|
2527
|
-
- Also mounts `CommonPopover`, `DropdownPipelineResolver`
|
|
2624
|
+
- Also mounts `CommonPopover`, `DropdownFailures`, `DropdownPipelineResolver`
|
|
2528
2625
|
|
|
2529
2626
|
## See Also
|
|
2530
2627
|
|