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/BbSelect.md
CHANGED
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
| `pt:footer` | `pt:footer` of `BbSelectPopover` | `BbSelectPopover` ([contract](./BbSelectPopover.md)) |
|
|
23
23
|
| `pt:input` | `pt:input` of `BbSelectPopover` | `BbSelectPopover` ([contract](./BbSelectPopover.md)) |
|
|
24
24
|
| `pt:list` | `pt:list` of `BbSelectPopover` | `BbSelectPopover` ([contract](./BbSelectPopover.md)) |
|
|
25
|
+
| `pt:groupHeader` | `pt:groupHeader` of `BbSelectPopover` | `BbSelectPopover` ([contract](./BbSelectPopover.md)) |
|
|
25
26
|
| `pt:option` | `pt:option` of `BbSelectPopover` | `BbSelectPopover` ([contract](./BbSelectPopover.md)) |
|
|
26
27
|
| `pt:itemText` | `pt:itemText` of `BbSelectPopover` | `BbSelectPopover` ([contract](./BbSelectPopover.md)) |
|
|
27
28
|
| `pt:itemIcon` | `pt:itemIcon` of `BbSelectPopover` | `BbSelectPopover` ([contract](./BbSelectPopover.md)) |
|
|
@@ -810,8 +811,8 @@ picked someone:
|
|
|
810
811
|
v-model="reviewers"
|
|
811
812
|
clearable
|
|
812
813
|
compact
|
|
813
|
-
:dependencies="[retry]"
|
|
814
814
|
empty-text="No members match your search"
|
|
815
|
+
failed-text="Couldn't load members."
|
|
815
816
|
:filter-by="false"
|
|
816
817
|
hint="Type a name to search"
|
|
817
818
|
item-text="name"
|
|
@@ -824,21 +825,13 @@ picked someone:
|
|
|
824
825
|
:query-debounce-time="300"
|
|
825
826
|
stash
|
|
826
827
|
>
|
|
827
|
-
<template #empty="{
|
|
828
|
-
<template v-if="error">
|
|
829
|
-
Couldn't load members.
|
|
830
|
-
<BbButton size="sm" variant="ghost" @click="retry++">
|
|
831
|
-
Try again
|
|
832
|
-
</BbButton>
|
|
833
|
-
</template>
|
|
834
|
-
<template v-else>No members match “{{ query }}”</template>
|
|
835
|
-
</template>
|
|
828
|
+
<template #empty="{ query }">No members match “{{ query }}”</template>
|
|
836
829
|
</BbSelect>
|
|
837
830
|
</div>
|
|
838
831
|
</template>
|
|
839
832
|
<script setup lang="ts">
|
|
840
833
|
import { ref } from 'vue';
|
|
841
|
-
import {
|
|
834
|
+
import { BbSelect } from 'bitboss-ui';
|
|
842
835
|
import type { BbSelectItemsContext } from 'bitboss-ui';
|
|
843
836
|
|
|
844
837
|
type Member = {
|
|
@@ -906,8 +899,6 @@ const searchMembers = async ({
|
|
|
906
899
|
};
|
|
907
900
|
|
|
908
901
|
const reviewers = ref<string[]>([]);
|
|
909
|
-
// The retry: bumping a dependency reloads with `reason: 'dependencies'`.
|
|
910
|
-
const retry = ref(0);
|
|
911
902
|
</script>
|
|
912
903
|
```
|
|
913
904
|
|
|
@@ -1083,7 +1074,7 @@ much to type.
|
|
|
1083
1074
|
/>
|
|
1084
1075
|
```
|
|
1085
1076
|
|
|
1086
|
-
Below the minimum (
|
|
1077
|
+
Below the minimum (characters after trimming; an emoji is one) the query counts as empty: no
|
|
1087
1078
|
`'search'` call, no filtering of array items, the search-first hint says
|
|
1088
1079
|
"Type at least 3 characters", and a prefilled list stays unfiltered. Loads for
|
|
1089
1080
|
other reasons still run, so a seeded model resolves. Enter does not emit
|
|
@@ -1113,24 +1104,17 @@ nothing to catch.
|
|
|
1113
1104
|
|
|
1114
1105
|
A provider signals a failure by **throwing** — never by returning `[]`, which is
|
|
1115
1106
|
a real, applied result. On a failed call the select clears the rows (stale rows
|
|
1116
|
-
never sit under a new filter), prunes nothing, and shows
|
|
1117
|
-
default "Couldn't load items")
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
own flow (debounced, aborting the call in flight):
|
|
1107
|
+
never sit under a new filter), prunes nothing, and shows its own failure row
|
|
1108
|
+
under the list: `failed-text` (locale default "Couldn't load items"),
|
|
1109
|
+
announced, then a "Try again" button. With `stash` the row sits below the picks
|
|
1110
|
+
the stash still names. "Try again" runs the failed call again with the same
|
|
1111
|
+
query, on click only, and hands focus back to the search field. `#empty` means
|
|
1112
|
+
empty: it never renders for a failure, so write empty copy there and word the
|
|
1113
|
+
failure with `failed-text`:
|
|
1124
1114
|
|
|
1125
1115
|
```vue
|
|
1126
|
-
<BbSelect :items="searchMembers"
|
|
1127
|
-
<template #empty="{
|
|
1128
|
-
<template v-if="error">
|
|
1129
|
-
Couldn't load members.
|
|
1130
|
-
<BbButton size="sm" variant="ghost" @click="retry++">Try again</BbButton>
|
|
1131
|
-
</template>
|
|
1132
|
-
<template v-else>No members match “{{ query }}”</template>
|
|
1133
|
-
</template>
|
|
1116
|
+
<BbSelect :items="searchMembers" failed-text="Couldn't load members." …>
|
|
1117
|
+
<template #empty="{ query }">No members match “{{ query }}”</template>
|
|
1134
1118
|
</BbSelect>
|
|
1135
1119
|
```
|
|
1136
1120
|
|
|
@@ -1146,8 +1130,9 @@ own flow (debounced, aborting the call in flight):
|
|
|
1146
1130
|
- **Panel states**: `loading-text` / `empty-text` / `failed-text` (locale
|
|
1147
1131
|
defaults "Loading..." / "No data to display" / "Couldn't load items") or the
|
|
1148
1132
|
`#loading` / `#empty` slots — both receive `{ query }`, `#empty` also
|
|
1149
|
-
`focus()
|
|
1150
|
-
`
|
|
1133
|
+
`focus()` and `close()` (for an action that keeps focus in the panel). A
|
|
1134
|
+
failed load has its own row (`failed-text` and "Try again"), never
|
|
1135
|
+
`#empty`.
|
|
1151
1136
|
|
|
1152
1137
|
`stash` accumulates picked options across searches: a pick stays named (chips
|
|
1153
1138
|
keep their text) when a later search or a failed load no longer returns it. It
|
|
@@ -1620,6 +1605,13 @@ Pressing Enter in the search field with **no option highlighted** emits
|
|
|
1620
1605
|
does not create anything itself: append the new item to `items` and select it.
|
|
1621
1606
|
This is the idiomatic pattern for closed-but-growable vocabularies.
|
|
1622
1607
|
|
|
1608
|
+
While you listen to `option:add`, a typed query that no option matches
|
|
1609
|
+
exactly (case aside) also gets a **"Create «query»" row**: the last row after
|
|
1610
|
+
the matches, or the only one when nothing matches (in place of the
|
|
1611
|
+
no-results text and `#empty`). It is a real option, clickable and reached
|
|
1612
|
+
with the arrow keys, and activating it does what Enter does. It is not shown
|
|
1613
|
+
while the list loads or after a failed load.
|
|
1614
|
+
|
|
1623
1615
|
**Create a label by pressing Enter**
|
|
1624
1616
|
|
|
1625
1617
|
```vue
|
|
@@ -1677,14 +1669,12 @@ const createLabel = (text: string) => {
|
|
|
1677
1669
|
</script>
|
|
1678
1670
|
```
|
|
1679
1671
|
|
|
1680
|
-
#### A record that needs its own form: open its dialog from
|
|
1672
|
+
#### A record that needs its own form: open its dialog from `option:add`
|
|
1681
1673
|
|
|
1682
1674
|
When creating the missing row takes a real form (a person, a company), the
|
|
1683
|
-
select doesn't create it: its dialog does.
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
`option:add`. Open the dialog from code, seed it with the query, and on
|
|
1687
|
-
`completed` add the row and select it:
|
|
1675
|
+
select doesn't create it: its dialog does. Handle `option:add` (the create
|
|
1676
|
+
row's click and Enter both land there): open the dialog from code, seed it
|
|
1677
|
+
with the query, and on `completed` add the row and select it:
|
|
1688
1678
|
|
|
1689
1679
|
**No results? Create the person in a dialog**
|
|
1690
1680
|
|
|
@@ -1705,17 +1695,7 @@ came up empty, as one line in `#empty` with an inline `BbBaseButton` (not a
|
|
|
1705
1695
|
:items="people"
|
|
1706
1696
|
label="Contact"
|
|
1707
1697
|
@option:add="(query) => query && create(query)"
|
|
1708
|
-
|
|
1709
|
-
<template #empty="{ query }">
|
|
1710
|
-
No results for “{{ query }}”.
|
|
1711
|
-
<BbBaseButton
|
|
1712
|
-
class="font-medium text-(--bb-primary) hover:underline"
|
|
1713
|
-
@click="create(query)"
|
|
1714
|
-
>
|
|
1715
|
-
Create {{ query }}
|
|
1716
|
-
</BbBaseButton>
|
|
1717
|
-
</template>
|
|
1718
|
-
</BbSelect>
|
|
1698
|
+
/>
|
|
1719
1699
|
|
|
1720
1700
|
<!-- In an app this is its own CreatePersonDialog.vue: pass the component
|
|
1721
1701
|
to useBbDialog instead of the id. -->
|
|
@@ -1734,7 +1714,6 @@ came up empty, as one line in `#empty` with an inline `BbBaseButton` (not a
|
|
|
1734
1714
|
<script setup lang="ts">
|
|
1735
1715
|
import { ref } from 'vue';
|
|
1736
1716
|
import {
|
|
1737
|
-
BbBaseButton,
|
|
1738
1717
|
BbButton,
|
|
1739
1718
|
BbDialog,
|
|
1740
1719
|
BbForm,
|
|
@@ -1757,8 +1736,8 @@ const save = async (values: Record<string, unknown>): Promise<Person> => ({
|
|
|
1757
1736
|
name: String(values.name),
|
|
1758
1737
|
});
|
|
1759
1738
|
|
|
1760
|
-
// The handle lives in setup
|
|
1761
|
-
//
|
|
1739
|
+
// The handle lives in setup: the panel closes as the dialog takes focus, and
|
|
1740
|
+
// the create row goes with it.
|
|
1762
1741
|
const personDialog = useBbDialog<{ name: string }, Person>('person-create');
|
|
1763
1742
|
const create = async (name: string) => {
|
|
1764
1743
|
const result = await personDialog.show({ name });
|
|
@@ -1770,13 +1749,11 @@ const create = async (name: string) => {
|
|
|
1770
1749
|
```
|
|
1771
1750
|
|
|
1772
1751
|
- **Open it with a handle from setup**, `useBbDialog(CreatePersonDialog)`
|
|
1773
|
-
(or an id), never `v-bb-dialog` on
|
|
1774
|
-
closes as the dialog takes focus and
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
(
|
|
1778
|
-
works either way. The ESLint rule `bitboss-ui/no-dialog-in-panel` reports
|
|
1779
|
-
the on-demand form ([ESLint rules](./guides/eslint-rules.md)).
|
|
1752
|
+
(or an id), never `v-bb-dialog` on a button inside the panel: the panel
|
|
1753
|
+
closes as the dialog takes focus, and an on-demand opening
|
|
1754
|
+
(`v-bb-dialog="{ component }"`) is dismissed with its trigger. The ESLint
|
|
1755
|
+
rule `bitboss-ui/no-dialog-in-panel` reports the on-demand form
|
|
1756
|
+
([ESLint rules](./guides/eslint-rules.md)).
|
|
1780
1757
|
- **Inside another dialog it just stacks.** The create dialog opens above the
|
|
1781
1758
|
one holding the select, and on close focus comes back to the select, closed,
|
|
1782
1759
|
showing the new pick. Nothing to wire.
|
|
@@ -1784,7 +1761,7 @@ const create = async (name: string) => {
|
|
|
1784
1761
|
`known-items` (`{ value: person.id, label: person.name }`): the provider
|
|
1785
1762
|
returns it on the next load.
|
|
1786
1763
|
- **Keyboard**: Enter in the search field fires `option:add` (no option is
|
|
1787
|
-
highlighted when nothing matched), and
|
|
1764
|
+
highlighted when nothing matched), and the arrow keys reach the create row.
|
|
1788
1765
|
|
|
1789
1766
|
### Group related options
|
|
1790
1767
|
|
|
@@ -1797,6 +1774,11 @@ no group: those rows are listed **first**, before every header, and `#group` is
|
|
|
1797
1774
|
not called for them (a known row is listed the same way). `BbDropdown`'s
|
|
1798
1775
|
`groupBy` follows the same rule.
|
|
1799
1776
|
|
|
1777
|
+
Headers are sticky: the header of the group you are scrolling through stays
|
|
1778
|
+
pinned at the top of the list, and leaves with its group's last option. A list
|
|
1779
|
+
that opens on a selection shows its group's header right above it, and a row
|
|
1780
|
+
reached with the arrow keys always stops below the pinned header.
|
|
1781
|
+
|
|
1800
1782
|
A grouped list virtualizes **whole groups, not rows**: a group mounts only
|
|
1801
1783
|
when it scrolls into range, but all of its rows mount together. Many
|
|
1802
1784
|
small-to-medium groups window just as well as a flat list; one very large
|
|
@@ -2040,11 +2022,96 @@ is all you need.
|
|
|
2040
2022
|
- `clearable` — clear affix when a value exists; emits `null` / `[]`. Single: re-clicking the pick clears too.
|
|
2041
2023
|
- Empty panel — `empty-text` or `#empty`.
|
|
2042
2024
|
|
|
2025
|
+
### Opening from code: `v-model:open`
|
|
2026
|
+
|
|
2027
|
+
`v-model` is the value; `v-model:open` is whether the options panel is open. Bound,
|
|
2028
|
+
your ref opens and closes it, and every open and close the user makes is
|
|
2029
|
+
written back: a pick, Escape, a click outside, the phone sheet's own dismiss. A static `:open` with no
|
|
2030
|
+
listener is only the initial state. An open from code is the same open a
|
|
2031
|
+
click makes (focus moves into the panel), and `disabled` / `readonly` refuse it (the ref is set back
|
|
2032
|
+
to `false`).
|
|
2033
|
+
|
|
2034
|
+
```vue
|
|
2035
|
+
<script setup lang="ts">
|
|
2036
|
+
import { ref } from 'vue';
|
|
2037
|
+
|
|
2038
|
+
const city = ref<string | null>(null);
|
|
2039
|
+
const open = ref(false);
|
|
2040
|
+
</script>
|
|
2041
|
+
|
|
2042
|
+
<template>
|
|
2043
|
+
<BbButton text="Choose a city" @click="open = true" />
|
|
2044
|
+
<BbSelect
|
|
2045
|
+
v-model="city"
|
|
2046
|
+
v-model:open="open"
|
|
2047
|
+
label="City"
|
|
2048
|
+
:items="['Milan', 'Rome', 'Turin']"
|
|
2049
|
+
/>
|
|
2050
|
+
</template>
|
|
2051
|
+
```
|
|
2052
|
+
|
|
2053
|
+
### Reading and restoring the search: `v-model:query`
|
|
2054
|
+
|
|
2055
|
+
`v-model:query` is the search field's text. Bound, your ref reads it and sets
|
|
2056
|
+
it:
|
|
2057
|
+
|
|
2058
|
+
- **It mirrors the field, raw.** Every committed keystroke is written back as
|
|
2059
|
+
typed, spaces included (an IME composition once, when it ends), and `''`
|
|
2060
|
+
whenever the component empties the field itself: closing, a pick that
|
|
2061
|
+
closes, `option:add` (Enter or the create row), the ✕.
|
|
2062
|
+
- **A write is a search the user didn't type.** It runs at once, without
|
|
2063
|
+
the debounce, and supersedes a scheduled or in-flight search (its late
|
|
2064
|
+
answer never lands). Written while closed, it is held for the next open:
|
|
2065
|
+
`query = 'Rossi'; open = true` sends one request, for "Rossi". A write
|
|
2066
|
+
never opens the panel or moves focus, and is never echoed back.
|
|
2067
|
+
- **A write that can't land writes `''` back:** no search field
|
|
2068
|
+
(`disable-writing`), `disabled`, `readonly`, a refused open.
|
|
2069
|
+
- Unbound, a static `:query` seeds the next open.
|
|
2070
|
+
|
|
2071
|
+
The case it is for: bring a search back. The create row hands the query to
|
|
2072
|
+
`option:add` and empties the field; if the user cancels the dialog, put the
|
|
2073
|
+
query back and reopen, and "Create «Rossi»" is there again:
|
|
2074
|
+
|
|
2075
|
+
```vue
|
|
2076
|
+
<script setup lang="ts">
|
|
2077
|
+
import { ref } from 'vue';
|
|
2078
|
+
import { BbSelect, useBbDialog } from 'bitboss-ui';
|
|
2079
|
+
import CreatePersonDialog from './CreatePersonDialog.vue';
|
|
2080
|
+
|
|
2081
|
+
const person = ref<number | null>(null);
|
|
2082
|
+
const open = ref(false);
|
|
2083
|
+
const query = ref('');
|
|
2084
|
+
const createPerson = useBbDialog(CreatePersonDialog);
|
|
2085
|
+
|
|
2086
|
+
const onAdd = async (text: string) => {
|
|
2087
|
+
const result = await createPerson.show({ name: text });
|
|
2088
|
+
if (result.completed) return void (person.value = result.value.id);
|
|
2089
|
+
query.value = text;
|
|
2090
|
+
open.value = true;
|
|
2091
|
+
};
|
|
2092
|
+
</script>
|
|
2093
|
+
|
|
2094
|
+
<template>
|
|
2095
|
+
<BbSelect
|
|
2096
|
+
v-model="person"
|
|
2097
|
+
v-model:open="open"
|
|
2098
|
+
v-model:query="query"
|
|
2099
|
+
item-text="name"
|
|
2100
|
+
item-value="id"
|
|
2101
|
+
:items="searchPeople"
|
|
2102
|
+
label="Person"
|
|
2103
|
+
@option:add="onAdd"
|
|
2104
|
+
/>
|
|
2105
|
+
</template>
|
|
2106
|
+
```
|
|
2107
|
+
|
|
2108
|
+
Every state, with its test: the BbSelectPopover guide, § Reading and restoring the search.
|
|
2109
|
+
|
|
2043
2110
|
### Events and v-model
|
|
2044
2111
|
|
|
2045
2112
|
- `update:modelValue` — the resolved value (single) or array (multiple), on
|
|
2046
2113
|
pick, chip removal, clear and coherence enforcement.
|
|
2047
|
-
- `option:add` — Enter on a query with no highlighted option (see above).
|
|
2114
|
+
- `option:add` — Enter on a query with no highlighted option, or the create row (see above).
|
|
2048
2115
|
- `focus` / `blur` — the control gaining/losing focus; `input` / `change` —
|
|
2049
2116
|
native events from the panel search field.
|
|
2050
2117
|
- `inactive` — focus has fully left the component (control **and** panel).
|
|
@@ -2174,7 +2241,7 @@ the `BbTextInput` guide.
|
|
|
2174
2241
|
|
|
2175
2242
|
`pt` reaches a named part of the control with a class list — or, in the
|
|
2176
2243
|
object form, a style and attributes — optionally only while a state is on.
|
|
2177
|
-
Parts: `root` (the container), `label`, `description`, `message` (the errors / warnings region — one node each, only one ever shows), `hint` (the helper line — shown on focus, or always with `persistent-hint`), `box` (the bordered field box), `activator` (the button that opens the options — BbSelect's control; the text controls call theirs `input`), `input` (the search field in the options surface, when it shows one), `icon` (`prepend:icon` + `append:icon` — a broadcast; the state glyphs are chrome), `spinner` (the spinner shown while `loading`), `prefix`, `suffix`, `clear` (the ✕ that empties the field). Plus `panel` (the options surface you see — the popover's painted bubble on desktop, the sheet itself on a phone), `sheet` (the bottom sheet on a phone only), `option` (one listbox option, a broadcast), `itemText` (that option's label), `itemIcon` (its `itemProps` prepend / append icons — never the field's `icon`) and `itemDescription` (its muted second line from `itemProps.description` — never the field's `description`), and `check` (the tick on a chosen option, at the row's end), all with the option's `selected` / `disabled`; a custom `#option` slot replaces the label and description, never the tick. With `multiple`, the selected values are `badge` (each chip's `BbBadge` root, in the field and on the phone sheet — in the field, not rendered when the `#chip` slot replaces it; the sheet's chips are always badges) or `comma` (each entry in `comma` mode) — the same two words as `BbTag`. The chevron and the clear ✕ are chrome.
|
|
2244
|
+
Parts: `root` (the container), `label`, `description`, `message` (the errors / warnings region — one node each, only one ever shows), `hint` (the helper line — shown on focus, or always with `persistent-hint`), `box` (the bordered field box), `activator` (the button that opens the options — BbSelect's control; the text controls call theirs `input`), `input` (the search field in the options surface, when it shows one), `icon` (`prepend:icon` + `append:icon` — a broadcast; the state glyphs are chrome), `spinner` (the spinner shown while `loading`), `prefix`, `suffix`, `clear` (the ✕ that empties the field). Plus `panel` (the options surface you see — the popover's painted bubble on desktop, the sheet itself on a phone), `sheet` (the bottom sheet on a phone only), `option` (one listbox option, a broadcast), `itemText` (that option's label), `itemIcon` (its `itemProps` prepend / append icons — never the field's `icon`) and `itemDescription` (its muted second line from `itemProps.description` — never the field's `description`), and `check` (the tick on a chosen option, at the row's end), all with the option's `selected` / `disabled`; a custom `#option` slot replaces the label and description, never the tick. `groupHeader` is every `group-by` heading's box (sticky; `#group` replaces its content, never the box), `disabled` while every option of its group is. With `multiple`, the selected values are `badge` (each chip's `BbBadge` root, in the field and on the phone sheet — in the field, not rendered when the `#chip` slot replaces it; the sheet's chips are always badges) or `comma` (each entry in `comma` mode) — the same two words as `BbTag`. The chevron and the clear ✕ are chrome.
|
|
2178
2245
|
States: `errors`, `warnings` (never beside errors), `loading`, `disabled`, `readonly`, `hasValue` (written `pt:box:has-value`). Plus `open` (the options surface is showing) and `selected`, resolved per option. A name outside that list is a type error and an
|
|
2179
2246
|
ESLint error.
|
|
2180
2247
|
|
|
@@ -2245,6 +2312,54 @@ const assignee = ref<string | null>('ada');
|
|
|
2245
2312
|
</script>
|
|
2246
2313
|
```
|
|
2247
2314
|
|
|
2315
|
+
**A heading that reads as a row.** `pt:group-header` styles the `group-by`
|
|
2316
|
+
heading's box; its label is the box's child, so `*:` reaches it: a hairline
|
|
2317
|
+
above each region, and the label in an option's colour, weight and size.
|
|
2318
|
+
|
|
2319
|
+
**pt:group-header — region headings that read as rows**
|
|
2320
|
+
|
|
2321
|
+
```vue
|
|
2322
|
+
<template>
|
|
2323
|
+
<div
|
|
2324
|
+
class="grid max-w-sm gap-3 rounded-(--bb-radius) border border-(--bb-border) p-3"
|
|
2325
|
+
>
|
|
2326
|
+
<div>
|
|
2327
|
+
<h3 class="text-sm font-medium">Ship from</h3>
|
|
2328
|
+
<p class="text-xs text-(--bb-text-muted)">
|
|
2329
|
+
Warehouses by region; each region reads as a row.
|
|
2330
|
+
</p>
|
|
2331
|
+
</div>
|
|
2332
|
+
<BbSelect
|
|
2333
|
+
v-model="warehouse"
|
|
2334
|
+
compact
|
|
2335
|
+
group-by="region"
|
|
2336
|
+
:items="warehouses"
|
|
2337
|
+
label="Warehouse"
|
|
2338
|
+
placeholder="Pick a warehouse"
|
|
2339
|
+
pt:group-header="border-t border-(--bb-border) *:font-normal *:text-(--bb-text) *:text-[length:var(--bb-fs)]"
|
|
2340
|
+
/>
|
|
2341
|
+
</div>
|
|
2342
|
+
</template>
|
|
2343
|
+
|
|
2344
|
+
<script setup lang="ts">
|
|
2345
|
+
import { ref } from 'vue';
|
|
2346
|
+
import { BbSelect } from 'bitboss-ui';
|
|
2347
|
+
|
|
2348
|
+
type Warehouse = { label: string; value: string; region: string };
|
|
2349
|
+
|
|
2350
|
+
// `pt:group-header` is the heading's box: a hairline above it, and through
|
|
2351
|
+
// `*:` its label takes an option's colour, weight and size.
|
|
2352
|
+
const warehouses: Warehouse[] = [
|
|
2353
|
+
{ label: 'Milano Linate', value: 'lin', region: 'North' },
|
|
2354
|
+
{ label: 'Torino Corso Francia', value: 'tor', region: 'North' },
|
|
2355
|
+
{ label: 'Roma Tiburtina', value: 'rom', region: 'Centre' },
|
|
2356
|
+
{ label: 'Firenze Osmannoro', value: 'fir', region: 'Centre' },
|
|
2357
|
+
];
|
|
2358
|
+
|
|
2359
|
+
const warehouse = ref<string | null>(null);
|
|
2360
|
+
</script>
|
|
2361
|
+
```
|
|
2362
|
+
|
|
2248
2363
|
**Chips that look like your app's badges.** Each chip is a `BbBadge` (the
|
|
2249
2364
|
`secondary` one), so `pt:badge` takes the same classes your badges use, or a
|
|
2250
2365
|
badge variant's class: `pt:badge="bb-badge--destructive"`. Mind the cascade:
|
|
@@ -2381,8 +2496,8 @@ it: [passthrough guide § Typing `pt` in `<script>`](./guides/passthrough.md#typ
|
|
|
2381
2496
|
- **A failed load is not an empty one.** A provider throws to fail; returning
|
|
2382
2497
|
`[]` is applied as a real empty result and, with `enforce-coherence`, prunes
|
|
2383
2498
|
every pick. On a failure the rows are cleared, nothing is pruned, and the
|
|
2384
|
-
panel shows `failed-text` (with `stash`,
|
|
2385
|
-
names); `#empty`
|
|
2499
|
+
panel shows its failure row, `failed-text` and "Try again" (with `stash`,
|
|
2500
|
+
below the picks the stash still names); `#empty` stays for empty results.
|
|
2386
2501
|
- `option:add` can fire with an empty string — trim and guard in the handler.
|
|
2387
2502
|
|
|
2388
2503
|
### Anti-patterns
|
|
@@ -2422,44 +2537,46 @@ it: [passthrough guide § Typing `pt` in `<script>`](./guides/passthrough.md#typ
|
|
|
2422
2537
|
## v-model
|
|
2423
2538
|
|
|
2424
2539
|
- `v-model` — type: `any`
|
|
2540
|
+
- `v-model:open` — type: `boolean \| undefined`
|
|
2541
|
+
- `v-model:query` — type: `string \| undefined`
|
|
2425
2542
|
|
|
2426
2543
|
## Props
|
|
2427
2544
|
|
|
2428
2545
|
| Prop | Type | Default | Required | Description |
|
|
2429
2546
|
| --- | --- | --- | --- | --- |
|
|
2430
|
-
| `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: `activator`, `badge`, `box`, `check`, `clear`, `comma`, `description`, `footer`, `header`, `hint`, `icon`, `input`, `itemDescription`, `itemIcon`, `itemText`, `label`, `list`, `message`, `option`, `panel`, `prefix`, `root`, `sheet`, `spinner`, `suffix`. States: `disabled`, `errors`, `ghost`, `hasValue`, `loading`, `open`, `outline`, `readonly`, `secondary`, `warnings`, `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 `BbSelectProps<Row>['pt']` (`BbSelectProps<object>['pt']` for a preset that fits any row type, never `<any>`) (`PtValue` is not exported): § Typing `pt` in `<script>`. |
|
|
2431
|
-
| `adaptive` | `boolean \| undefined` | ``all.adaptive` (`true`)` | |
|
|
2547
|
+
| `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: `activator`, `badge`, `box`, `check`, `clear`, `comma`, `description`, `footer`, `groupHeader`, `header`, `hint`, `icon`, `input`, `itemDescription`, `itemIcon`, `itemText`, `label`, `list`, `message`, `option`, `panel`, `prefix`, `root`, `sheet`, `spinner`, `suffix`. States: `disabled`, `errors`, `ghost`, `hasValue`, `loading`, `open`, `outline`, `readonly`, `secondary`, `warnings`, `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 `BbSelectProps<Row>['pt']` (`BbSelectProps<object>['pt']` for a preset that fits any row type, never `<any>`) (`PtValue` is not exported): § Typing `pt` in `<script>`. |
|
|
2548
|
+
| `adaptive` | `boolean \| undefined` | ``all.adaptive` (`true`)` | | `true`: on mobile viewports the options open in a bottom sheet, not a popover (desktop keeps the popover). Unset: the global `all.adaptive`. |
|
|
2432
2549
|
| `append:icon` | `string \| undefined` | `the chevron-down glyph` | | Name of the icon to be added at the end of the input. |
|
|
2433
2550
|
| `autocomplete` | `string \| undefined` | | | Guides to the browser as to the type of information expected in the field. |
|
|
2434
2551
|
| `autofocus` | `Booleanish \| undefined` | | | Focuses the field when it mounts (a dialog already open included), unless the user is typing in another field. |
|
|
2435
|
-
| `clearable` | `boolean \| undefined` | `false` | |
|
|
2436
|
-
| `comma` | `boolean \| undefined` | `false` | |
|
|
2552
|
+
| `clearable` | `boolean \| undefined` | `false` | | A clear button while the field has a value and is interacted with; a single select also clears when its pick is clicked again. |
|
|
2553
|
+
| `comma` | `boolean \| undefined` | `false` | | Shows the picks as one comma-separated string; no close button to deselect one there. |
|
|
2437
2554
|
| `compact` | `boolean \| undefined` | `undefined` | | Compact density: the field uses the `-compact` twins of `--bb-input-h`, `--bb-input-py` and `--bb-label-spacing-y`, so a `--bb-input-h` set on the component is ignored while it is on. Size a compact field with `--bb-input-h-compact` (and `--bb-input-py-compact`). |
|
|
2438
2555
|
| `dependencies` | `unknown[] \| undefined` | | | Defines an array of dependencies that will trigger actions in the component upon change. |
|
|
2439
2556
|
| `depsDebounceTime` | `number \| undefined` | `0` | | Timeout used to debounce response to changes to dependencies. |
|
|
2440
2557
|
| `description` | `string \| undefined` | | | Text between the label and the input. Unlike the hint it is always visible; it joins the input's `aria-describedby` after any `errors` / `warnings`, before the `hint`. |
|
|
2441
2558
|
| `disabled` | `boolean \| undefined` | `false` | | Disables the component. |
|
|
2442
|
-
| `disableWriting` | `boolean \| "auto" \| "mobile" \| "desktop" \| undefined` | `'auto'` | | Hides the panel's search field: `true` everywhere, `'mobile'` / `'desktop'` on that platform
|
|
2559
|
+
| `disableWriting` | `boolean \| "auto" \| "mobile" \| "desktop" \| undefined` | `'auto'` | | Hides the panel's search field: `true` everywhere, `'mobile'` / `'desktop'` on that platform. `'auto'`, per open: for an array `items` shorter than the plugin's `autoDisableWritingThreshold` (6), never for a provider or with an `option:add` listener. |
|
|
2443
2560
|
| `emptyText` | `string \| undefined` | | | String displayed when there are no items to display. |
|
|
2444
|
-
| `enforceCoherence` | `boolean \| undefined` | `false` | | After
|
|
2561
|
+
| `enforceCoherence` | `boolean \| undefined` | `false` | | After each successful non-search load, drops the picks the fetched rows lack (a single model goes `null`). A `stash` does not count; a `known-items` value stays until a parent change; a search or failed load never prunes. |
|
|
2445
2562
|
| `errors` | `string \| string[] \| undefined` | | | Error messages under the field, a string or array, in an `aria-live="polite"` region and first in the control's `aria-describedby`, so they are re-read when it regains focus. |
|
|
2446
|
-
| `failedText` | `string \| undefined` | `the localized `common.failedText` ("Couldn't load items")` | |
|
|
2447
|
-
| `filterBy` | `false \| string[] \| undefined` | `[]` | | What typing filters on: empty =
|
|
2563
|
+
| `failedText` | `string \| undefined` | `the localized `common.failedText` ("Couldn't load items")` | | The empty state's text while the latest load FAILED (the provider threw): `emptyText`'s twin for that case. |
|
|
2564
|
+
| `filterBy` | `false \| string[] \| undefined` | `[]` | | What typing filters on: empty = display text and description; item paths = those fields (`['name', 'email']`); `false` = none. Ranked, case- and accent-blind (guide § Search). `false` when the provider matched on the server, or its email matches show "No results". |
|
|
2448
2565
|
| `formless` | `boolean \| undefined` | `false` | | Keep this control out of the enclosing `BbForm` entirely: not submitted, not dirty, not reset, not validated. For a control that is not form data (a filter, a "show advanced" switch). |
|
|
2449
2566
|
| `groupBy` | `string \| ((item: T) => string \| number \| symbol) \| undefined` | | | Path to item property for grouping options. |
|
|
2450
2567
|
| `hasErrors` | `boolean \| undefined` | `false` | | Define if the component should be in an error state. It usually attaches a CSS class for styling purposes. |
|
|
2451
2568
|
| `hasWarnings` | `boolean \| undefined` | `false` | | Define if the component should be in a warning state. Same chrome as errors with `--bb-warn`; errors take priority. |
|
|
2452
|
-
| `headerHeight` | `number \| undefined` | | |
|
|
2569
|
+
| `headerHeight` | `number \| undefined` | | | Group header height (px), with `groupBy`: 32 (24 compact; 36 / 32 on mobile viewports). An explicit value wins on every viewport. |
|
|
2453
2570
|
| `hideLabel` | `boolean \| undefined` | `false` | | Visually hides the label of the input while maintaining accessibility. Pair it with a `placeholder`: an empty field otherwise shows nothing saying what it is for. |
|
|
2454
2571
|
| `hint` | `string \| undefined` | | | Text box to be displayed near the input, usually to indicate instructions. |
|
|
2455
2572
|
| `id` | `string \| undefined` | | | The `id` of the native control; the label's `for` and the description and message ids derive from it. Generated when omitted. |
|
|
2456
2573
|
| `inputAlign` | `'center'` \| `'top'` \| `'bottom'` | | | Vertical position of the control in a side-by-side row; not `inputPosition`, the horizontal one. Omitted, `'top'`. |
|
|
2457
|
-
| `itemHeight` | `number \| undefined` | `28` | |
|
|
2458
|
-
| `itemProps` | `BbSelectItemProps<T> \| undefined` | | |
|
|
2459
|
-
| `items` | `T[] \| ((context: BbSelectItemsContext) => T[] \| Promise<T[]>)` | | yes | The options: an array, or a provider called with a `BbSelectItemsContext` (`query`, `reason`, `modelValue`, `signal`)
|
|
2574
|
+
| `itemHeight` | `number \| undefined` | `28` | | Option height (px): 28 (24 compact; 44 / 36 on mobile viewports). An explicit value wins on every viewport. |
|
|
2575
|
+
| `itemProps` | `BbSelectItemProps<T> \| undefined` | | | EXTRA row fields, never text or value: `description` (a muted line under the label), `prepend:icon`, `append:icon`. Paths or getters per field, or a function of the item. Nothing is read implicitly; none shows in the trigger or chips. |
|
|
2576
|
+
| `items` | `T[] \| ((context: BbSelectItemsContext) => T[] \| Promise<T[]>)` | | yes | The options: an array, or a provider (sync or async) called with a `BbSelectItemsContext` (`query`, `reason`, `modelValue`, `signal`). Branch on `reason !== 'search'` to resolve the selection by id. It fails by THROWING, never by returning `[]`. |
|
|
2460
2577
|
| `itemText` | `ItemAccessor<T, string> \| undefined` | `own `label`, else `text`, else `JSON.stringify(item)`` | | Defines a path that returns a property of the object to use as text or a function that returns a string. Unset: own `label`, else `text` (`{ label, value }` needs no accessor). |
|
|
2461
2578
|
| `itemValue` | `ItemAccessor<T> \| undefined` | `own `value`, else the whole item` | | Defines a path that returns a property of the object to use as value or a function that returns any value. Unset: own `value`, even `null`. |
|
|
2462
|
-
| `knownItems` | `([Known] extends [undefined] ? BbSelectKnownItems : Known) \| undefined` | | | `{ value, label }` rows naming the value the app already holds, whatever the options' shape: no request until the first open (`prefill: true` still loads). Not options
|
|
2579
|
+
| `knownItems` | `([Known] extends [undefined] ? BbSelectKnownItems : Known) \| undefined` | | | `{ value, label }` rows naming the value the app already holds, whatever the options' shape: no request until the first open (`prefill: true` still loads). Not options, so no accessor runs on them; slots get the row as `item`, `known: true`, until the list brings its own. |
|
|
2463
2580
|
| `label` | `string` | | yes | Text content of the label of the element. |
|
|
2464
2581
|
| `labelAlign` | `'center'` \| `'top'` \| `'bottom'` | | | Vertical position of the label block in a side-by-side row; not `labelPosition`, the horizontal one. Omitted, `'top'`. |
|
|
2465
2582
|
| `labelMode` | `"outside" \| "floating" \| "inside" \| undefined` | | | Label rendering mode. |
|
|
@@ -2468,29 +2585,31 @@ it: [passthrough guide § Typing `pt` in `<script>`](./guides/passthrough.md#typ
|
|
|
2468
2585
|
| `loading` | `boolean \| undefined` | `false` | | Sets the component in a loading state, usually triggering some visual styles. |
|
|
2469
2586
|
| `loadingText` | `string \| undefined` | | | String displayed while items are being loaded. |
|
|
2470
2587
|
| `max` | `number \| undefined` | | | Maximum number of selectable items when the multiple flag is set. |
|
|
2471
|
-
| `maxSelectedLabels` | `number \| undefined` | `Infinity` | |
|
|
2472
|
-
| `minQueryLength` | `number \| undefined` | `0` | | Characters to type (trimmed) before the query searches. Below it the query counts as empty: no `'search'` call, no filtering
|
|
2588
|
+
| `maxSelectedLabels` | `number \| undefined` | `Infinity` | | Labels shown before collapsing to a count summary. Unset, they collapse only when they overflow the field. |
|
|
2589
|
+
| `minQueryLength` | `number \| undefined` | `0` | | Characters to type (trimmed) before the query searches. Below it the query counts as empty: no `'search'` call, no filtering; the panel says how many to type. Slots still get the typed `query`. |
|
|
2473
2590
|
| `modelValue` | `any` | | | Used by v-model. Can be any serializable type. |
|
|
2474
2591
|
| `modelValueDebounceTime` | `number \| undefined` | `0` | | Timeout used to debounce response to changes to modelValue. |
|
|
2475
2592
|
| `multiple` | `boolean \| undefined` | `false` | | Allows the selection of multiple items. |
|
|
2476
2593
|
| `name` | `string \| undefined` | | | Defines the name of the input. |
|
|
2477
|
-
| `offCanvasProps` | `Partial<BbOffCanvasProps> \| undefined` | | | Props for the phone sheet (the `BbOffCanvas`
|
|
2594
|
+
| `offCanvasProps` | `Partial<BbOffCanvasProps> \| undefined` | | | Props for the phone sheet (the `BbOffCanvas` `adaptive` renders), over its defaults. A `pt` inside styles only the sheet (passthrough guide § Inside the sheet). |
|
|
2595
|
+
| `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. |
|
|
2478
2596
|
| `persistentHint` | `boolean \| undefined` | `false` | | Keeps the hint displayed. |
|
|
2479
2597
|
| `placeholder` | `string \| undefined` | | | Text shown in the field while nothing is picked (an empty list has `emptyText`). |
|
|
2480
|
-
| `prefill` | `boolean \| "interaction" \| undefined` | `'interaction'` | | When the options first load: `'interaction'` on first open, `true` on mount, `false`
|
|
2598
|
+
| `prefill` | `boolean \| "interaction" \| undefined` | `'interaction'` | | When the options first load: `'interaction'` on first open, `true` on mount, `false` once the user types (on open with `disable-writing`). An array `items` or a seeded model loads at once. |
|
|
2481
2599
|
| `prepend:icon` | `string \| undefined` | | | Name of the icon to be added at the start of the input. |
|
|
2600
|
+
| `query` | `string \| undefined` | | | The search field's text (`v-model:query`): raw per keystroke, `''` when the component empties it; a write searches at once (guide § Reading and restoring the search). |
|
|
2482
2601
|
| `queryDebounceTime` | `number \| undefined` | `500` | | Time to wait when the user stops writing in the input before querying data. |
|
|
2483
2602
|
| `readonly` | `boolean \| undefined` | `false` | | Sets the input in a readonly state. |
|
|
2484
2603
|
| `required` | `boolean \| undefined` | `false` | | Sets the input as required. |
|
|
2485
2604
|
| `reverse` | `boolean \| undefined` | `undefined` | | Reverses the layout. Applicable in every direction the order of the label and the input is swapped. |
|
|
2486
2605
|
| `rules` | `RuleExpression<any>` | | | vee-validate rules for this field. Only inside a `BbForm`. |
|
|
2487
2606
|
| `selectable` | `boolean \| ((item: T) => boolean) \| undefined` | `true` | | Defines whether options are selectable. Can be a global boolean that affects all options or a function that accepts an item and returns a boolean that only affects that item. Non-selectable options are rendered disabled. |
|
|
2488
|
-
| `selectedLabelsFn` | `((count: number) => string) \| undefined` | | |
|
|
2489
|
-
| `stash` | `boolean \| undefined` | `false` | | Keeps
|
|
2607
|
+
| `selectedLabelsFn` | `((count: number) => string) \| undefined` | | | The text shown when the selected labels outnumber `maxSelectedLabels`. |
|
|
2608
|
+
| `stash` | `boolean \| undefined` | `false` | | Keeps picks named (chips keep their text) when a later search or failed load stops returning them. It follows the model; it does not keep a pick valid (`enforce-coherence` still prunes it). |
|
|
2490
2609
|
| `transitionDuration` | `number \| undefined` | `250` | | How long the transition has to last in milliseconds. |
|
|
2491
2610
|
| `validationLabel` | `string \| undefined` | | | The field's name in validation messages (`{field}`): "Email is not valid". Defaults to the `label` (or `legend`), then "This field"; never the `name`. Set it when the label is hidden or reads badly in a sentence (icon-only, a question). `BbForm` only. |
|
|
2492
2611
|
| `validationMode` | `'aggressive'` \| `'balanced'` \| `'lazy'` \| `'submit-only'` \| `'submit-live'` | | | When the field validates: `aggressive` (each change), `balanced` (on leave, then live while in error), `lazy` (on leave), `submit-only`, `submit-live`. Unset: the `BbForm`'s `validation-mode`, then `all.validationMode` (`'balanced'`). `BbForm` only. |
|
|
2493
|
-
| `variant` | `'outline'` \| `'secondary'` \| `'none'` \| `'ghost'` | `'outline'` | | The field box's look
|
|
2612
|
+
| `variant` | `'outline'` \| `'secondary'` \| `'none'` \| `'ghost'` | `'outline'` | | The field box's look: `BbButton`'s names and tokens, colours only (a form never reflows). `'ghost'` has no border in any state; `'none'` no look at all (you own hover, focus, states). More via the plugin's `components.BbSelect.variants`. |
|
|
2494
2613
|
| `warnings` | `string \| string[] \| undefined` | | | Warning messages under the field, a string or array: amber, in their own `aria-live` region and in the control's `aria-describedby` after the errors. Non-empty turns on the warning state; errors win when both are set. |
|
|
2495
2614
|
|
|
2496
2615
|
## Passthrough parts and states
|
|
@@ -2499,30 +2618,31 @@ it: [passthrough guide § Typing `pt` in `<script>`](./guides/passthrough.md#typ
|
|
|
2499
2618
|
|
|
2500
2619
|
| Part | What it is |
|
|
2501
2620
|
| --- | --- |
|
|
2502
|
-
| `root` | The field's outer container
|
|
2621
|
+
| `root` | The field's outer container (label, box, the lines under it); a `class` on the component lands here. The options surface is `panel`. |
|
|
2503
2622
|
| `label` | The label text above the box (the `label` prop). |
|
|
2504
2623
|
| `description` | The muted line under the label (the `description` prop). |
|
|
2505
2624
|
| `message` | The errors / warnings line under the box. A node of its own: it can show at the same time as `hint`. |
|
|
2506
2625
|
| `hint` | The helper line (the `hint` prop), shown on focus, or always with `persistent-hint`. |
|
|
2507
2626
|
| `box` | The bordered box around the input — border, background and radius; the `variant` paints here. |
|
|
2508
|
-
| `activator` | The button
|
|
2509
|
-
| `input` | The search field
|
|
2627
|
+
| `activator` | The button that opens the options: the field's control, not a text field (`data-test` fits, `autocomplete` does not). The chevron is chrome. `activator`, not the family's `input`: the field is a button, as the date / time inputs' trigger. |
|
|
2628
|
+
| `input` | The options surface's search field, when shown (see `disable-writing`): the `BbSelectPopover`'s `pt:input`. Its ✕ is chrome. |
|
|
2510
2629
|
| `icon` | The content icons, prepend and append — a broadcast. Chrome (the clear ✕, a chevron, the error / warning glyph) is never in it. |
|
|
2511
2630
|
| `spinner` | The spinner inside the box while `loading`. |
|
|
2512
2631
|
| `prefix` | The `#prefix` slot's wrapper, inside the box before the input. |
|
|
2513
2632
|
| `suffix` | The `#suffix` slot's wrapper, inside the box after the input. |
|
|
2514
|
-
| `clear` | The ✕
|
|
2633
|
+
| `clear` | The field's ✕ that empties the selection (`clearable`): one node, never a chip's ✕. |
|
|
2515
2634
|
| `panel` | The options surface — the popover's painted bubble on desktop, the sheet itself on a phone. |
|
|
2516
2635
|
| `sheet` | The bottom sheet the options open in on a phone only. |
|
|
2517
|
-
| `header` | The band around your `#header` slot:
|
|
2518
|
-
| `footer` | The band around your `#footer` slot:
|
|
2519
|
-
| `list` | The `role="listbox"` node
|
|
2636
|
+
| `header` | The band around your `#header` slot: atop the flyout, the sheet's header on a phone. |
|
|
2637
|
+
| `footer` | The band around your `#footer` slot: under the flyout's list, the sheet's footer on a phone. |
|
|
2638
|
+
| `list` | The `role="listbox"` node holding the options. Virtualised: the list writes its height and places its rows, which limits layout utilities there. A group's box and the chips are not parts. |
|
|
2639
|
+
| `groupHeader` | Every `groupBy` heading (sticky). `#group` replaces its content. |
|
|
2520
2640
|
| `option` | One listbox option — a broadcast resolved per option. Also takes a per-item function, called with the option's raw item. |
|
|
2521
2641
|
| `itemText` | An option's label — resolved with that option's states. A custom `#option` slot replaces it. Also takes a per-item function. |
|
|
2522
2642
|
| `itemIcon` | An option's prepend / append icons (`itemProps`) — resolved with that option's states. Also takes a per-item function. |
|
|
2523
2643
|
| `itemDescription` | An option's second line (its description) — resolved with that option's states. A custom `#option` slot replaces it. Also takes a per-item function. |
|
|
2524
|
-
| `check` | The tick
|
|
2525
|
-
| `badge` | Each selected value's `BbBadge` root with `multiple
|
|
2644
|
+
| `check` | The tick at a chosen option's end (on every option, drawn on the chosen). A custom `#option` slot keeps it; `pt:check="hidden"` removes it, sparing your slot's glyph. Also takes a per-item function. |
|
|
2645
|
+
| `badge` | Each selected value's `BbBadge` root with `multiple`, per value, in the field and on the phone sheet. Its ✕ is chrome, never `clear`. The field has none under `#chip` or `comma`; the sheet's chips are always badges. |
|
|
2526
2646
|
| `comma` | Each selected value with `multiple` and `comma` — a broadcast resolved per value. |
|
|
2527
2647
|
|
|
2528
2648
|
States are listed in precedence order: when two are on at once and their entries conflict, the later one wins.
|
|
@@ -2532,7 +2652,7 @@ States are listed in precedence order: when two are on at once and their entries
|
|
|
2532
2652
|
| `hasValue` | Component-wide: the control holds a value, by its own rule (`0` counts on `BbNumberInput`, `''` on `BbColorInput`). |
|
|
2533
2653
|
| `selected` | Per node, on `option`, its `item-*` parts and `check`: a chosen option. |
|
|
2534
2654
|
| `readonly` | Component-wide: the control is `readonly` — shown, focusable, not editable. |
|
|
2535
|
-
| `disabled` | Component-wide while the select is `disabled`; also per node, on `option`, its `item-*` parts and `check`: an option that is disabled. |
|
|
2655
|
+
| `disabled` | Component-wide while the select is `disabled`; also per node, on `option`, its `item-*` parts and `check`: an option that is disabled; on `groupHeader`: all its group's options are. |
|
|
2536
2656
|
| `warnings` | Component-wide: the control is in its warning state (`warnings` / `has-warnings`) and not in an error state — errors win, so the two are never on together. |
|
|
2537
2657
|
| `errors` | Component-wide: the control is in its error state (`errors` / `has-errors`, or its validation) — the message line and the box turn red. |
|
|
2538
2658
|
| `open` | Component-wide: the options surface is showing. |
|
|
@@ -2552,24 +2672,26 @@ States are listed in precedence order: when two are on at once and their entries
|
|
|
2552
2672
|
- `hide` — `(): void` — Emitted as soon as the options surface starts to close.
|
|
2553
2673
|
- `inactive` — `(): void` — Emitted when focus moves outside the whole select after it was active.
|
|
2554
2674
|
- `input` — `(event: Event): void` — Emitted on native `input` events from the search field. Forwards the DOM `Event`.
|
|
2555
|
-
- `option:add` — `(text: string): void` —
|
|
2675
|
+
- `option:add` — `(text: string): void` — The typed text, when the user confirms a value not in the list (Enter in the search field). Binding it keeps the field writable: the select is creatable.
|
|
2556
2676
|
- `show` — `(): void` — Emitted as soon as the options surface starts to open (the popover, or the sheet on a phone).
|
|
2557
2677
|
- `shown` — `(): void` — Emitted once the options surface is open and its open transition has finished.
|
|
2558
2678
|
- `update:modelValue` — `(value: any): void` — Emitted with the new value whenever `v-model` changes.
|
|
2679
|
+
- `update:open` — `(value: boolean): void` — The panel opened or closed (`v-model:open`).
|
|
2680
|
+
- `update:query` — `(value: string): void` — `v-model:query`: the search field's text.
|
|
2559
2681
|
|
|
2560
2682
|
## Slots
|
|
2561
2683
|
|
|
2562
2684
|
- `append` — scope: `{ query: string; focus: () => void; close: () => Promise<void>; }` — Content appended inside the input field, after the value area.
|
|
2563
2685
|
- `append:outer` — scope: `{ query: string; close: () => Promise<void>; }` — Content appended outside the input field wrapper.
|
|
2564
|
-
- `chip` — scope: `BbSelectChipSlotProps<T, Known>` `{ known: boolean; item: BbSelectKnownItem \| T; text: string; value: any; disabled: boolean; deselect: () => void }` —
|
|
2565
|
-
- `description` — scope: `BbSelectDescriptionSlotProps` `{ text: string; hasErrors: boolean; hasWarnings: boolean }` — Replaces the description text
|
|
2566
|
-
- `empty` — scope: `{ query: string; focus: () => void; close: () => Promise<void>;
|
|
2567
|
-
- `footer` — scope: `BbSelectPanelSlotProps` `{ close: () => Promise<void>; clear: () => void; empty: boolean; focus: () => void; query: string; selectedOptions: BbSelectResolvedOption[] }` —
|
|
2568
|
-
- `group` — scope: `BbSelectGroupSlotProps<T>` `{ text: string; item: T; index: number; length: number; disabled: boolean }` —
|
|
2569
|
-
- `header` — scope: `BbSelectPanelSlotProps` `{ close: () => Promise<void>; clear: () => void; empty: boolean; focus: () => void; query: string; selectedOptions: BbSelectResolvedOption[] }` —
|
|
2686
|
+
- `chip` — scope: `BbSelectChipSlotProps<T, Known>` `{ known: boolean; item: BbSelectKnownItem \| T; text: string; value: any; disabled: boolean; deselect: () => void }` — Each selection's badge with `multiple` (not in `comma` mode, nor the "+N" summary). With `known-items`, `item` is the known `{ value, label }` row (`known: true`) until the list brings the real one.
|
|
2687
|
+
- `description` — scope: `BbSelectDescriptionSlotProps` `{ text: string; hasErrors: boolean; hasWarnings: boolean }` — Replaces the description text; alone (no `description` prop) it still renders the region, wired into `aria-describedby`.
|
|
2688
|
+
- `empty` — scope: `{ query: string; focus: () => void; close: () => Promise<void>; }` — Shown when no option matches the query or the list is empty; a failed load shows the failure row instead (`failed-text`, "Try again"). `close()` closes the panel, for an action that keeps focus in it.
|
|
2689
|
+
- `footer` — scope: `BbSelectPanelSlotProps` `{ close: () => Promise<void>; clear: () => void; empty: boolean; focus: () => void; query: string; selectedOptions: BbSelectResolvedOption[] }` — Pinned under the options list, on the popover and the phone sheet alike.
|
|
2690
|
+
- `group` — scope: `BbSelectGroupSlotProps<T>` `{ text: string; item: T; index: number; length: number; disabled: boolean }` — Each group heading's content (`pt:group-header` styles its box). Not called for rows with no group (`group-by` gives `null`/`undefined`, known rows): they are listed without one.
|
|
2691
|
+
- `header` — scope: `BbSelectPanelSlotProps` `{ close: () => Promise<void>; clear: () => void; empty: boolean; focus: () => void; query: string; selectedOptions: BbSelectResolvedOption[] }` — Pinned atop the options panel, above the search field, on the popover and the phone sheet alike.
|
|
2570
2692
|
- `label` — scope: `BbSelectLabelSlotProps` `{ showAsterisk?: boolean; text: string; hasErrors: boolean; hasWarnings: boolean }` — Replaces the default label text rendered above the input.
|
|
2571
2693
|
- `loading` — scope: `{ query: string; }` — Content shown inside the options dropdown while items are loading.
|
|
2572
|
-
- `option` — scope: `BbSelectOptionSlotProps<T, Known>` `{ known: boolean; item: BbSelectKnownItem \| T; disabled: boolean; focused: boolean; index: number; hasErrors?: boolean; loading: boolean; selected: boolean; text: string; value: any; description: string }` —
|
|
2694
|
+
- `option` — scope: `BbSelectOptionSlotProps<T, Known>` `{ known: boolean; item: BbSelectKnownItem \| T; disabled: boolean; focused: boolean; index: number; hasErrors?: boolean; loading: boolean; selected: boolean; text: string; value: any; description: string }` — Each option row's content. With `known-items`, a row the list has not brought yet is the known `{ value, label }` row (`known: true`): check `known` before reading an option field off `item`.
|
|
2573
2695
|
- `prefix` — scope: `object` — Content rendered as an inline prefix inside the input field.
|
|
2574
2696
|
- `prepend` — scope: `{ query: string; focus: () => void; close: () => Promise<void>; }` — Content prepended inside the input field, before the value area.
|
|
2575
2697
|
- `prepend:outer` — scope: `{ query: string; close: () => Promise<void>; }` — Content prepended outside the input field wrapper.
|
|
@@ -2594,16 +2716,16 @@ Set these on the element, or on a class you put on it, to retune this component
|
|
|
2594
2716
|
- **CSS custom properties** listed on a node are declared on THAT node's root and read by elements inside it. Set one on that node's root or on the element inside it that reads it — the pt part that lands there is how you reach it (`pt:box="[--border-color:…]"` on a text input) — never on `BbSelect`'s root, where the node's own declaration masks it (design-tokens guide, _Overriding one from a consumer app_, rule 0).
|
|
2595
2717
|
- Listed nodes are the ones `BbSelect`'s API reaches or that declare a documented CSS variable; the rest fold into "also mounts". The complete tree, undocumented locals included, is `manifest/components/BbSelect.tree.json` (a public component in it is a name: its own tree file has the rest).
|
|
2596
2718
|
|
|
2597
|
-
- `BbSelect` _(this component)_ — its own template binds: `badge` → `CommonField`, `activator` → `input.bb-select__activator`, `badge` → `input.bb-select__activator`, `comma` → `span.bb-select__comma`, `badge` → `span.bb-select__comma`, `badge` → `BbBadge`, `controlAttrs` → `input`, `badge` → `input`; hands `BbSelectPopover` the pt map `{ panel: 'panel', sheet: 'sheet', header: 'header', footer: 'footer', input: 'input', list: 'list', option: 'option', itemText: 'itemText', itemIcon: 'itemIcon', itemDescription: 'itemDescription', check: 'check' }` (ours → theirs)
|
|
2719
|
+
- `BbSelect` _(this component)_ — its own template binds: `badge` → `CommonField`, `activator` → `input.bb-select__activator`, `badge` → `input.bb-select__activator`, `comma` → `span.bb-select__comma`, `badge` → `span.bb-select__comma`, `badge` → `BbBadge`, `controlAttrs` → `input`, `badge` → `input`; hands `BbSelectPopover` the pt map `{ panel: 'panel', sheet: 'sheet', header: 'header', footer: 'footer', input: 'input', list: 'list', groupHeader: 'groupHeader', option: 'option', itemText: 'itemText', itemIcon: 'itemIcon', itemDescription: 'itemDescription', check: 'check' }` (ours → theirs)
|
|
2598
2720
|
- `CommonField` _(internal — not importable, reach it through `BbSelect`)_ — `BbSelect`'s pt parts land here: `root` → `div.bb-field`, `label` → `component`, `description` → `span.bb-field__description`, `hint` → `span.bb-field__hint`, `counter` → `span.bb-field__counter`, `message` → `div.bb-field__message`; also mounts `BbAsterisk`
|
|
2599
2721
|
- `CommonFieldInput` _(internal — not importable, reach it through `BbSelect`)_ — `BbSelect`'s pt parts land here: `box` → `span.bb-field-input__box`, `prefix` → `span.bb-field-input__prefix`, `icon` → `BbIcon`, `clear` → `ClearableButton`, `spinner` → `BbSpinner`, `suffix` → `span.bb-field-input__suffix`; documented CSS variables: `--bg`, `--bg-hover`, `--bg-focus`, `--bg-disabled`, `--fg-disabled`, `--border-color`, `--border-focus`, `--ring-size`, `--ring-color`, `--elev`, `--frost`, `--ph`, `--inside-label-clearance`; also mounts `BbIcon`, `BbSpinner`, `ErrorIcon`, `WarningIcon`, `ClearableButton`
|
|
2600
2722
|
- `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`
|
|
2601
2723
|
- `BbSelectPopover` _(public — [contract](./BbSelectPopover.md))_ — its own pt parts (`BbSelectPopover`): `input` → `input.bb-select-popover__input`, `clear` → `ClearableButton`, `panel` → `CommonPopover`, `root` → `CommonPopover`, `header` → `div.bb-select-popover__header`, `footer` → `div.bb-select-popover__footer`; hands `BbOffCanvas` the pt map `{ header: 'header', footer: 'footer', panel: 'root', sheet: 'root' }` (ours → theirs); also mounts `BbBadge`, `BbIcon`, `ClearableButton`, `CommonPopover`, `ErrorIcon`, `WarningIcon`, `BbSmoothHeight`
|
|
2602
2724
|
- `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`
|
|
2603
|
-
- `CloseButton` _(internal — not importable, reach it through `BbOffCanvas`)_ — documented CSS variables: `--size`, `--p`, `--icon-size`; also mounts `BbIcon`
|
|
2725
|
+
- `CloseButton` _(internal — not importable, reach it through `BbOffCanvas`)_ — documented CSS variables: `--size`, `--p`, `--icon-size`, `--icon-inset`; also mounts `BbIcon`
|
|
2604
2726
|
- `ListBox` _(internal — not importable, reach it through `BbSelectPopover`)_
|
|
2605
2727
|
- `FlatListBox` _(internal — not importable, reach it through `BbSelectPopover`)_ — its own pt parts (`BbSelectPopover`): `list` → `span.bb-listbox__list`, `option` → `span.bb-listbox__option`, `itemIcon` → `BbIcon`, `itemText` → `span.bb-listbox__item-text`, `itemDescription` → `span.bb-listbox__item-description`, `check` → `BbIcon`; also mounts `BbIcon`, `ErrorIcon`
|
|
2606
|
-
- `GroupedListBox` _(internal — not importable, reach it through `BbSelectPopover`)_ — its own pt parts (`BbSelectPopover`): `list` → `span.bb-listbox__list`, `option` → `span.bb-listbox__option`, `itemIcon` → `BbIcon`, `itemText` → `span.bb-listbox__item-text`, `itemDescription` → `span.bb-listbox__item-description`, `check` → `BbIcon`; also mounts `BbIcon`, `ErrorIcon`
|
|
2728
|
+
- `GroupedListBox` _(internal — not importable, reach it through `BbSelectPopover`)_ — its own pt parts (`BbSelectPopover`): `list` → `span.bb-listbox__list`, `groupHeader` → `span.bb-listbox__group-header`, `option` → `span.bb-listbox__option`, `itemIcon` → `BbIcon`, `itemText` → `span.bb-listbox__item-text`, `itemDescription` → `span.bb-listbox__item-description`, `check` → `BbIcon`; also mounts `BbIcon`, `ErrorIcon`
|
|
2607
2729
|
|
|
2608
2730
|
## See Also
|
|
2609
2731
|
|