bitboss-ui 3.0.0-beta.63 → 3.0.0-beta.65
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 +25 -20
- package/bin/bitboss-ui.mjs +73 -7
- package/dist/ai/BbAlert.md +10 -1
- package/dist/ai/BbBadge.md +35 -3
- package/dist/ai/BbBadgeButton.md +4 -2
- package/dist/ai/BbBaseButton.md +9 -3
- package/dist/ai/BbBreadcrumbs.md +2 -2
- package/dist/ai/BbButton.md +113 -8
- package/dist/ai/BbCheckbox.md +1 -1
- package/dist/ai/BbCheckboxGroup.md +94 -6
- package/dist/ai/BbColorInput.md +4 -1
- package/dist/ai/BbColorPalette.md +2 -1
- package/dist/ai/BbConfirm.md +7 -3
- package/dist/ai/BbDatePicker.md +2 -1
- package/dist/ai/BbDatePickerInput.md +4 -1
- package/dist/ai/BbDialog.md +12 -11
- package/dist/ai/BbDropdown.md +189 -38
- package/dist/ai/BbDropdownButton.md +27 -7
- package/dist/ai/BbForm.md +55 -22
- package/dist/ai/BbHost.md +2 -2
- package/dist/ai/BbHoverCard.md +7 -3
- package/dist/ai/BbIcon.md +12 -6
- package/dist/ai/BbIndicator.md +11 -1
- package/dist/ai/BbNumberInput.md +4 -1
- package/dist/ai/BbOffCanvas.md +37 -3
- package/dist/ai/BbPopover.md +2 -1
- package/dist/ai/BbRadio.md +1 -1
- package/dist/ai/BbRadioGroup.md +102 -10
- package/dist/ai/BbSelect.md +52 -17
- package/dist/ai/BbSelectPopover.md +93 -26
- package/dist/ai/BbSwitch.md +1 -1
- package/dist/ai/BbSwitchGroup.md +30 -3
- package/dist/ai/BbTable.md +17 -10
- package/dist/ai/BbTabs.md +8 -3
- package/dist/ai/BbTabsList.md +4 -1
- package/dist/ai/BbTag.md +5 -2
- package/dist/ai/BbTextInput.md +4 -1
- package/dist/ai/BbTextarea.md +4 -1
- package/dist/ai/BbTimePicker.md +2 -1
- package/dist/ai/BbTimePickerInput.md +4 -1
- package/dist/ai/BbToast.md +9 -3
- package/dist/ai/BbTooltip.md +71 -9
- package/dist/ai/ChipsBox.md +1 -1
- package/dist/ai/CommonField.md +1 -1
- package/dist/ai/OptionsContainer.md +42 -0
- package/dist/ai/changelog.json +494 -6
- package/dist/ai/components.json +50 -48
- package/dist/ai/composables/useBbConfig.md +8 -1
- package/dist/ai/composables/useConfirm.md +39 -1
- package/dist/ai/design-tokens.json +6 -6
- package/dist/ai/guides/agent-contract.md +2 -2
- package/dist/ai/guides/ai-router.md +24 -23
- package/dist/ai/guides/app-layout.md +5 -0
- package/dist/ai/guides/component-picker.md +9 -2
- package/dist/ai/guides/design-language.md +24 -24
- package/dist/ai/guides/design-tokens.md +15 -8
- package/dist/ai/guides/icons-policy.md +9 -2
- package/dist/ai/guides/inertia-helpers.md +1183 -301
- package/dist/ai/guides/installation-and-plugin-setup.md +12 -2
- package/dist/ai/guides/migration/adoption-checklist.md +235 -0
- package/dist/ai/guides/migration/components/bb-checkbox-group.md +16 -15
- package/dist/ai/guides/migration/components/bb-dialog.md +9 -9
- package/dist/ai/guides/migration/components/bb-dropdown.md +7 -2
- package/dist/ai/guides/migration/components/bb-popover.md +4 -2
- package/dist/ai/guides/migration/components/bb-select.md +19 -0
- package/dist/ai/guides/migration/components/bb-table.md +1 -0
- package/dist/ai/guides/migration/components/bb-toast.md +4 -0
- package/dist/ai/guides/migration/components/bb-tooltip.md +15 -12
- package/dist/ai/guides/migration/components/use-confirm.md +25 -2
- package/dist/ai/guides/migration/v2-to-v3.md +211 -9
- package/dist/ai/guides/migration/v3-beta-css-classes.md +7 -3
- package/dist/ai/guides/options-items-playbook.md +2 -1
- package/dist/ai/guides/passthrough.md +149 -85
- package/dist/ai/guides/preset-components.md +140 -15
- package/dist/ai/helpers/definePreset.json +7 -0
- package/dist/ai/helpers/definePreset.ts +123 -11
- package/dist/ai/helpers/inertia/manifest.json +151 -62
- package/dist/ai/helpers/inertia/messages.ts +33 -0
- package/dist/ai/helpers/inertia/useConfirmOnRouteLeave.ts +120 -20
- package/dist/ai/helpers/inertia/useHasChanged.ts +34 -16
- package/dist/ai/helpers/inertia/useLazyProp.ts +102 -36
- package/dist/ai/helpers/inertia/useLazyPropGetter.ts +3 -1
- package/dist/ai/helpers/inertia/usePaginatedResponseContext.ts +154 -34
- package/dist/ai/helpers/inertia/usePromiseForm.ts +121 -14
- package/dist/ai/helpers/inertia/useQuery.ts +133 -11
- package/dist/ai/helpers/inertia/useQueryObject.ts +74 -67
- package/dist/ai/helpers/inertia/useResourceContext.ts +60 -14
- package/dist/ai/helpers/inertia/useRouteQuery.ts +38 -27
- package/dist/ai/helpers/inertia/useScreenSizes.ts +9 -7
- package/dist/ai/helpers/inertia/useTableContext.ts +5 -2
- package/dist/ai/helpers/inertia/utils.ts +14 -0
- package/dist/ai/index.md +1 -0
- package/dist/ai/manifest/common.json +0 -1
- package/dist/ai/manifest/components/BbAlert.json +7 -2
- package/dist/ai/manifest/components/BbBadge.json +13 -4
- package/dist/ai/manifest/components/BbBadge.tree.json +2 -0
- package/dist/ai/manifest/components/BbBadgeButton.json +4 -2
- package/dist/ai/manifest/components/BbBaseButton.json +4 -2
- package/dist/ai/manifest/components/BbBreadcrumbs.tree.json +1 -1
- package/dist/ai/manifest/components/BbButton.json +14 -3
- package/dist/ai/manifest/components/BbButton.tree.json +5 -1
- package/dist/ai/manifest/components/BbCheckboxGroup.json +13 -8
- package/dist/ai/manifest/components/BbCheckboxGroup.tree.json +11 -1
- package/dist/ai/manifest/components/BbColorInput.json +18 -15
- package/dist/ai/manifest/components/BbColorPalette.json +1 -1
- package/dist/ai/manifest/components/BbConfirm.json +4 -2
- package/dist/ai/manifest/components/BbConfirm.tree.json +1 -1
- package/dist/ai/manifest/components/BbDatePicker.json +1 -1
- package/dist/ai/manifest/components/BbDatePickerInput.json +17 -14
- package/dist/ai/manifest/components/BbDialog.tree.json +2 -1
- package/dist/ai/manifest/components/BbDropdown.json +24 -19
- package/dist/ai/manifest/components/BbDropdown.tree.json +9 -2
- package/dist/ai/manifest/components/BbDropdownButton.json +33 -20
- package/dist/ai/manifest/components/BbDropdownButton.tree.json +2 -2
- package/dist/ai/manifest/components/BbForm.json +2 -2
- package/dist/ai/manifest/components/BbHost.tree.json +1 -1
- package/dist/ai/manifest/components/BbHoverCard.json +1 -1
- package/dist/ai/manifest/components/BbIndicator.json +8 -2
- package/dist/ai/manifest/components/BbNumberInput.json +5 -2
- package/dist/ai/manifest/components/BbOffCanvas.json +2 -2
- package/dist/ai/manifest/components/BbOffCanvas.tree.json +1 -1
- package/dist/ai/manifest/components/BbPopover.json +1 -1
- package/dist/ai/manifest/components/BbRadioGroup.json +17 -12
- package/dist/ai/manifest/components/BbRadioGroup.tree.json +8 -1
- package/dist/ai/manifest/components/BbSelect.json +21 -18
- package/dist/ai/manifest/components/BbSelect.tree.json +2 -2
- package/dist/ai/manifest/components/BbSelectPopover.json +10 -10
- package/dist/ai/manifest/components/BbSelectPopover.tree.json +3 -2
- package/dist/ai/manifest/components/BbSwitchGroup.json +1 -1
- package/dist/ai/manifest/components/BbSwitchGroup.tree.json +3 -1
- package/dist/ai/manifest/components/BbTable.tree.json +14 -1
- package/dist/ai/manifest/components/BbTabs.json +9 -6
- package/dist/ai/manifest/components/BbTabs.tree.json +1 -1
- package/dist/ai/manifest/components/BbTabsList.json +6 -3
- package/dist/ai/manifest/components/BbTag.json +19 -16
- package/dist/ai/manifest/components/BbTag.tree.json +1 -1
- package/dist/ai/manifest/components/BbTextInput.json +6 -3
- package/dist/ai/manifest/components/BbTextarea.json +6 -3
- package/dist/ai/manifest/components/BbTimePicker.json +1 -1
- package/dist/ai/manifest/components/BbTimePickerInput.json +10 -7
- package/dist/ai/manifest/components/BbToast.json +7 -2
- package/dist/ai/manifest/components/BbToast.tree.json +4 -2
- package/dist/ai/manifest/components/BbTooltip.json +6 -5
- package/dist/ai/manifest/components/ChipsBox.tree.json +1 -1
- package/dist/ai/manifest/components/CommonField.json +1 -1
- package/dist/ai/manifest/components/OptionsContainer.json +3 -1
- package/dist/ai/manifest/components/OptionsContainer.tree.json +38 -0
- package/dist/ai/manifest/index.json +3 -3
- package/dist/ai/manifest/meta.json +5 -3
- package/dist/ai/manifest/types.advanced.json +5 -2
- package/dist/ai/manifest/types.api.json +9 -7
- package/dist/ai/recipes/inertia/approvals-inbox.md +1 -1
- package/dist/ai/recipes/inertia/inline-edit-workspace.md +1 -1
- package/dist/ai/recipes/inertia/layout-scaffold.md +19 -6
- package/dist/ai/recipes/inertia/ownership-atlas.md +1 -1
- package/dist/ai/recipes/inertia/records-workspace.md +50 -14
- package/dist/ai/recipes/inertia/upload-center.md +1 -1
- package/dist/ai/recipes/nuxt/layout-scaffold.md +19 -6
- package/dist/ai/recipes/nuxt/records-workspace.md +42 -12
- package/dist/ai/recipes/vue/layout-scaffold.md +19 -6
- package/dist/ai/recipes/vue/records-workspace.md +42 -12
- package/dist/ai/source/BbAlert.md +94 -76
- package/dist/ai/source/BbBadge.md +174 -72
- package/dist/ai/source/BbBadgeButton.md +130 -65
- package/dist/ai/source/BbBaseButton.md +46 -124
- package/dist/ai/source/BbBaseCheckboxIcon.md +38 -0
- package/dist/ai/source/BbBaseRadioIcon.md +18 -0
- package/dist/ai/source/BbBaseSwitchIcon.md +51 -0
- package/dist/ai/source/BbButton.md +153 -36
- package/dist/ai/source/BbCheckboxGroup.md +142 -18
- package/dist/ai/source/BbColorInput.md +240 -204
- package/dist/ai/source/BbColorPalette.md +7 -4
- package/dist/ai/source/BbConfirm.md +34 -11
- package/dist/ai/source/BbConfirmPortal.md +24 -9
- package/dist/ai/source/BbDatePicker.md +11 -7
- package/dist/ai/source/BbDatePickerInput.md +306 -269
- package/dist/ai/source/BbDialog.md +49 -14
- package/dist/ai/source/BbDropdown.md +314 -197
- package/dist/ai/source/BbDropdownButton.md +197 -31
- package/dist/ai/source/BbDropdownGroup.md +274 -176
- package/dist/ai/source/BbForm.md +50 -6
- package/dist/ai/source/BbHoverCard.md +12 -5
- package/dist/ai/source/BbIcon.md +4 -3
- package/dist/ai/source/BbIndicator.md +73 -52
- package/dist/ai/source/BbNumberInput.md +293 -257
- package/dist/ai/source/BbOffCanvas.md +55 -29
- package/dist/ai/source/BbPopover.md +14 -10
- package/dist/ai/source/BbRadioGroup.md +413 -297
- package/dist/ai/source/BbSelect.md +549 -435
- package/dist/ai/source/BbSelectPopover.md +153 -34
- package/dist/ai/source/BbSwitchGroup.md +70 -10
- package/dist/ai/source/BbTable.md +369 -37
- package/dist/ai/source/BbTabs.md +115 -39
- package/dist/ai/source/BbTabsList.md +106 -38
- package/dist/ai/source/BbTabsPanels.md +96 -36
- package/dist/ai/source/BbTabsRoot.md +96 -36
- package/dist/ai/source/BbTag.md +267 -233
- package/dist/ai/source/BbTextInput.md +261 -225
- package/dist/ai/source/BbTextarea.md +251 -215
- package/dist/ai/source/BbTimePicker.md +11 -7
- package/dist/ai/source/BbTimePickerInput.md +257 -220
- package/dist/ai/source/BbToast.md +73 -32
- package/dist/ai/source/BbToastPortal.md +65 -30
- package/dist/ai/source/BbTooltip.md +148 -113
- package/dist/ai/source/CommonPopover.md +6 -1
- package/dist/ai/source/FlatListBox.md +19 -9
- package/dist/ai/source/GroupedListBox.md +19 -9
- package/dist/ai/source/OptionsContainer.md +25 -9
- package/dist/components/BbAlert/BbAlert.vue_vue_type_script_setup_true_lang.js +61 -36
- package/dist/components/BbAlert/types.d.ts +9 -5
- package/dist/components/BbAlert/types.js +8 -3
- package/dist/components/BbBadge/BadgeBodyContent.vue.d.ts +3 -3
- package/dist/components/BbBadge/BadgeBodyContent.vue_vue_type_script_setup_true_lang.js +26 -17
- package/dist/components/BbBadge/BbBadge.vue_vue_type_script_setup_true_lang.js +103 -50
- package/dist/components/BbBadge/BbBadgeButton.vue_vue_type_script_setup_true_lang.js +20 -15
- package/dist/components/BbBadge/badgeButtonContext.d.ts +12 -1
- package/dist/components/BbBadge/types.d.ts +45 -15
- package/dist/components/BbBadge/types.js +12 -3
- package/dist/components/BbBaseButton/BbBaseButton.vue_vue_type_script_setup_true_lang.js +89 -126
- package/dist/components/BbBaseButton/types.d.ts +23 -4
- package/dist/components/BbBaseButton/types.js +7 -1
- package/dist/components/BbBaseButton/useLinkState.d.ts +41 -0
- package/dist/components/BbBaseButton/useLinkState.js +70 -0
- package/dist/components/BbButton/BbButton.vue_vue_type_script_setup_true_lang.js +130 -74
- package/dist/components/BbButton/types.d.ts +50 -13
- package/dist/components/BbButton/types.js +10 -3
- package/dist/components/BbCheckboxGroup/BbCheckboxGroup.vue_vue_type_script_setup_true_lang.js +148 -95
- package/dist/components/BbCheckboxGroup/types.d.ts +34 -11
- package/dist/components/BbCheckboxGroup/types.js +9 -4
- package/dist/components/BbCollapsible/BbCollapsible.vue.d.ts +1 -1
- package/dist/components/BbColorInput/BbColorInput.vue_vue_type_script_setup_true_lang.js +134 -93
- package/dist/components/BbColorInput/types.d.ts +11 -4
- package/dist/components/BbColorInput/types.js +9 -3
- package/dist/components/BbConfirm/BbConfirm.vue_vue_type_script_setup_true_lang.js +82 -59
- package/dist/components/BbConfirm/types.d.ts +9 -4
- package/dist/components/BbConfirm/types.js +8 -3
- package/dist/components/BbDatePicker/BbDatePicker.vue.d.ts +1 -1
- package/dist/components/BbDatePicker/BbDatePicker.vue_vue_type_script_setup_true_lang.js +68 -67
- package/dist/components/BbDatePickerInput/BbDatePickerInput.vue.d.ts +1 -1
- package/dist/components/BbDatePickerInput/BbDatePickerInput.vue_vue_type_script_setup_true_lang.js +259 -215
- package/dist/components/BbDatePickerInput/types.d.ts +12 -5
- package/dist/components/BbDatePickerInput/types.js +9 -3
- package/dist/components/BbDialog/BbDialog.vue_vue_type_script_setup_true_lang.js +223 -219
- package/dist/components/BbDialog/useDialogStack.d.ts +1 -1
- package/dist/components/BbDropdown/AdaptiveDropdown.vue_vue_type_script_setup_true_lang.js +104 -89
- package/dist/components/BbDropdown/BbDropdown.vue.d.ts +1 -0
- package/dist/components/BbDropdown/BbDropdown.vue_vue_type_script_setup_true_lang.js +323 -285
- package/dist/components/BbDropdown/BbDropdownList.vue.d.ts +1 -0
- package/dist/components/BbDropdown/BbDropdownList.vue_vue_type_script_setup_true_lang.js +411 -319
- package/dist/components/BbDropdown/DropdownPipelineResolver.vue_vue_type_script_setup_true_lang.js +100 -98
- package/dist/components/BbDropdown/DropdownRow.vue.d.ts +4 -3
- package/dist/components/BbDropdown/DropdownRow.vue_vue_type_script_setup_true_lang.js +49 -28
- package/dist/components/BbDropdown/normalizeGroups.d.ts +6 -0
- package/dist/components/BbDropdown/normalizeGroups.js +21 -15
- package/dist/components/BbDropdown/types.d.ts +59 -12
- package/dist/components/BbDropdown/types.js +16 -3
- package/dist/components/BbDropdown/useDropdownContext.d.ts +6 -0
- package/dist/components/BbDropdownButton/BbDropdownButton.vue.d.ts +2 -1
- package/dist/components/BbDropdownButton/BbDropdownButton.vue_vue_type_script_setup_true_lang.js +179 -68
- package/dist/components/BbDropdownButton/types.d.ts +44 -16
- package/dist/components/BbDropdownButton/types.js +28 -3
- package/dist/components/BbForm/BbForm.vue_vue_type_script_setup_true_lang.js +111 -89
- package/dist/components/BbForm/formSchema.d.ts +13 -0
- package/dist/components/BbHoverCard/BbHoverCard.vue_vue_type_script_setup_true_lang.js +100 -100
- package/dist/components/BbIndicator/BbIndicator.vue_vue_type_script_setup_true_lang.js +40 -25
- package/dist/components/BbIndicator/types.d.ts +9 -5
- package/dist/components/BbIndicator/types.js +8 -3
- package/dist/components/BbNumberInput/BbNumberInput.vue_vue_type_script_setup_true_lang.js +243 -202
- package/dist/components/BbNumberInput/types.d.ts +12 -5
- package/dist/components/BbNumberInput/types.js +9 -3
- package/dist/components/BbOffCanvas/BbOffCanvas.vue.d.ts +1 -1
- package/dist/components/BbOffCanvas/BbOffCanvas.vue_vue_type_script_setup_true_lang.js +401 -399
- package/dist/components/BbOffCanvas/types.d.ts +6 -2
- package/dist/components/BbPopover/BbPopover.vue_vue_type_script_setup_true_lang.js +81 -80
- package/dist/components/BbRadioGroup/BbRadioGroup.vue_vue_type_script_setup_true_lang.js +158 -105
- package/dist/components/BbRadioGroup/types.d.ts +21 -7
- package/dist/components/BbRadioGroup/types.js +9 -4
- package/dist/components/BbSelect/BbSelect.vue.d.ts +4 -3
- package/dist/components/BbSelect/BbSelect.vue_vue_type_script_setup_true_lang.js +181 -137
- package/dist/components/BbSelect/types.d.ts +36 -22
- package/dist/components/BbSelect/types.js +22 -3
- package/dist/components/BbSelectPopover/BbSelectPopover.vue.d.ts +4 -4
- package/dist/components/BbSelectPopover/BbSelectPopover.vue_vue_type_script_setup_true_lang.js +600 -577
- package/dist/components/BbSelectPopover/knownItems.d.ts +5 -0
- package/dist/components/BbSelectPopover/types.d.ts +46 -12
- package/dist/components/BbSmoothHeight/BbSmoothHeight.vue.d.ts +1 -1
- package/dist/components/BbSwitchGroup/BbSwitchGroup.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/components/BbSwitchGroup/types.d.ts +14 -4
- package/dist/components/BbSwitchGroup/types.js +8 -3
- package/dist/components/BbTable/BbTable.vue_vue_type_script_setup_true_lang.js +1102 -995
- package/dist/components/BbTable/estimatedFloors.golden.d.ts +25 -0
- package/dist/components/BbTable/measuredFloors.d.ts +46 -0
- package/dist/components/BbTable/measuredFloors.js +322 -0
- package/dist/components/BbTable/measuredFloorsTestKit.d.ts +27 -0
- package/dist/components/BbTable/textRuler.d.ts +71 -0
- package/dist/components/BbTable/textRuler.js +121 -0
- package/dist/components/BbTable/utils.d.ts +113 -6
- package/dist/components/BbTable/utils.js +118 -65
- package/dist/components/BbTabs/BbTabs.vue_vue_type_script_setup_true_lang.js +53 -35
- package/dist/components/BbTabs/BbTabsList.vue_vue_type_script_setup_true_lang.js +62 -45
- package/dist/components/BbTabs/types.d.ts +26 -11
- package/dist/components/BbTabs/types.js +23 -8
- package/dist/components/BbTag/BbTag.vue_vue_type_script_setup_true_lang.js +205 -164
- package/dist/components/BbTag/types.d.ts +11 -4
- package/dist/components/BbTag/types.js +9 -3
- package/dist/components/BbTextInput/BbTextInput.vue_vue_type_script_setup_true_lang.js +98 -57
- package/dist/components/BbTextInput/types.d.ts +12 -5
- package/dist/components/BbTextInput/types.js +9 -3
- package/dist/components/BbTextarea/BbTextarea.vue_vue_type_script_setup_true_lang.js +137 -96
- package/dist/components/BbTextarea/types.d.ts +12 -5
- package/dist/components/BbTextarea/types.js +9 -3
- package/dist/components/BbTimePicker/BbTimePicker.vue_vue_type_script_setup_true_lang.js +105 -104
- package/dist/components/BbTimePickerInput/BbTimePickerInput.vue_vue_type_script_setup_true_lang.js +241 -197
- package/dist/components/BbTimePickerInput/types.d.ts +12 -5
- package/dist/components/BbTimePickerInput/types.js +9 -3
- package/dist/components/BbToast/BbToast.vue_vue_type_script_setup_true_lang.js +74 -32
- package/dist/components/BbToast/BbToastMessage.vue_vue_type_script_setup_true_lang.js +47 -47
- package/dist/components/BbToast/types.d.ts +10 -5
- package/dist/components/BbToast/types.js +18 -3
- package/dist/components/BbTooltip/BbTooltip.vue_vue_type_script_setup_true_lang.js +85 -71
- package/dist/components/BbTooltip/types.d.ts +13 -8
- package/dist/components/BbTooltip/types.js +8 -3
- package/dist/components/CommonField/CommonField.vue.d.ts +1 -1
- package/dist/components/CommonPopover/CommonPopover.vue.d.ts +1 -1
- package/dist/components/CommonPopover/CommonPopover.vue_vue_type_script_setup_true_lang.js +69 -69
- package/dist/components/FlatListBox/FlatListBox.vue_vue_type_script_setup_true_lang.js +53 -50
- package/dist/components/GroupedListBox/GroupedListBox.vue_vue_type_script_setup_true_lang.js +146 -143
- package/dist/components/OptionsContainer/OptionsContainer.vue_vue_type_script_setup_true_lang.js +7 -2
- package/dist/components/OptionsContainer/types.d.ts +14 -3
- package/dist/composables/useBbConfig.d.ts +1 -0
- package/dist/composables/useBbConfig.js +11 -7
- package/dist/composables/useBbFormContext.d.ts +4 -3
- package/dist/composables/useBbTabsContext.js +99 -85
- package/dist/composables/useChoiceIndicator.d.ts +58 -0
- package/dist/composables/useChoiceIndicator.js +197 -0
- package/dist/composables/useConfirm.d.ts +4 -4
- package/dist/composables/usePassthrough.d.ts +54 -1
- package/dist/composables/usePassthrough.js +100 -71
- package/dist/directives/bbTooltip.d.ts +12 -6
- package/dist/directives/createPopoverDirective.js +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/llms-full.txt +3467 -801
- package/dist/llms-medium.txt +71 -53
- package/dist/llms.txt +2 -1
- package/dist/passthrough-deduper.js +6 -3
- package/dist/project-dts.d.ts +24 -0
- package/dist/project-dts.js +43 -17
- package/dist/styles.css +2 -2
- package/dist/types/AlertVariant.d.ts +14 -0
- package/dist/types/AlertVariant.js +9 -0
- package/dist/types/BadgeVariant.d.ts +14 -0
- package/dist/types/BadgeVariant.js +9 -0
- package/dist/types/ButtonVariant.d.ts +16 -0
- package/dist/types/ButtonVariant.js +11 -0
- package/dist/types/CheckboxVariant.d.ts +38 -0
- package/dist/types/CheckboxVariant.js +4 -0
- package/dist/types/CommonProps.d.ts +4 -3
- package/dist/types/Config.d.ts +7 -0
- package/dist/types/ConfirmVariant.d.ts +12 -0
- package/dist/types/ConfirmVariant.js +4 -0
- package/dist/types/DropdownItemVariant.d.ts +12 -0
- package/dist/types/DropdownItemVariant.js +4 -0
- package/dist/types/IndicatorVariant.d.ts +15 -0
- package/dist/types/IndicatorVariant.js +10 -0
- package/dist/types/InputVariant.d.ts +13 -0
- package/dist/types/InputVariant.js +8 -0
- package/dist/types/RadioVariant.d.ts +38 -0
- package/dist/types/RadioVariant.js +4 -0
- package/dist/types/TabsVariant.d.ts +13 -0
- package/dist/types/TabsVariant.js +8 -0
- package/dist/types/ToastVariant.d.ts +15 -0
- package/dist/types/ToastVariant.js +10 -0
- package/dist/types/TooltipVariant.d.ts +12 -0
- package/dist/types/TooltipVariant.js +4 -0
- package/dist/types/passthrough.d.ts +83 -15
- package/dist/types/passthrough.js +2 -2
- package/dist/types/ptComponentMap.d.ts +35 -23
- package/dist/utilities/functions/extractDomContainer.d.ts +20 -1
- package/dist/utilities/functions/extractDomContainer.js +8 -3
- package/dist/utils/focusVisibility.d.ts +6 -0
- package/dist/utils/focusVisibility.js +4 -1
- package/dist/utils/passthroughDeduper.d.ts +14 -0
- package/dist/utils/versionCheck.js +1 -1
- package/dist/vite-plugin.d.ts +64 -7
- package/dist/vite.js +385 -259
- package/llms.txt +2 -1
- package/package.json +5 -4
- package/scripts/lib/adoption-checklist.json +312 -0
- package/scripts/lib/eslint-plugin.d.ts +13 -0
- package/scripts/lib/eslint-plugin.mjs +75 -11
- package/scripts/lib/helpers-add.mjs +26 -2
- package/scripts/lib/idiom-scan.mjs +65 -0
- package/scripts/lib/mcp-config.mjs +203 -9
- package/scripts/lib/migrate-fix.mjs +42 -1
- package/scripts/lib/project-variant-dts.mjs +18 -0
- package/scripts/lib/validate-bb-markup.mjs +99 -2
|
@@ -214,10 +214,10 @@
|
|
|
214
214
|
<slot
|
|
215
215
|
:deselect="() => onChipUnselected(item)"
|
|
216
216
|
:disabled="!canDeselectChips"
|
|
217
|
-
:item="item.item"
|
|
218
217
|
name="chip"
|
|
219
218
|
:text="item.text"
|
|
220
219
|
:value="item.value"
|
|
220
|
+
v-bind="slotRow(item.item)"
|
|
221
221
|
>
|
|
222
222
|
<BbBadge
|
|
223
223
|
class="bb-select__badge"
|
|
@@ -322,7 +322,11 @@
|
|
|
322
322
|
</CommonField>
|
|
323
323
|
</template>
|
|
324
324
|
|
|
325
|
-
<script
|
|
325
|
+
<script
|
|
326
|
+
setup
|
|
327
|
+
lang="ts"
|
|
328
|
+
generic="T = any, Known extends BbSelectKnownItems | undefined = undefined"
|
|
329
|
+
>
|
|
326
330
|
import { vAutofocus } from '@/utilities/misc/autofocus';
|
|
327
331
|
import {
|
|
328
332
|
computed,
|
|
@@ -341,7 +345,9 @@ import BbBadge from '../BbBadge/BbBadge.vue';
|
|
|
341
345
|
import BbSelectPopover from '../BbSelectPopover/BbSelectPopover.vue';
|
|
342
346
|
import {
|
|
343
347
|
BB_SELECT_POPOVER_PT,
|
|
348
|
+
type BbSelectKnownItems,
|
|
344
349
|
type BbSelectResolvedOption,
|
|
350
|
+
type BbSelectSlotRow,
|
|
345
351
|
} from '../BbSelectPopover/types';
|
|
346
352
|
import { useMobile } from '@/composables/useMobile';
|
|
347
353
|
import { useConfig } from '@/composables/useConfig';
|
|
@@ -351,6 +357,7 @@ import {
|
|
|
351
357
|
formControlPtActive,
|
|
352
358
|
SELECT_CONTROL_NATIVE_ATTRS,
|
|
353
359
|
usePassthrough,
|
|
360
|
+
variantPt,
|
|
354
361
|
} from '@/composables/usePassthrough';
|
|
355
362
|
import { removedPropsFor } from '@/deprecation/removedProps';
|
|
356
363
|
import { warnRemovedAttrs } from '@/utilities/functions/warnRemovedAttrs';
|
|
@@ -375,8 +382,12 @@ import {
|
|
|
375
382
|
type BbSelectSlots,
|
|
376
383
|
} from './types';
|
|
377
384
|
|
|
378
|
-
defineOptions({
|
|
379
|
-
|
|
385
|
+
defineOptions({
|
|
386
|
+
// An app's own variants as declared `pt:<part>:<name>` props (Q76.7).
|
|
387
|
+
mixins: [variantPt(BB_SELECT_PT)],
|
|
388
|
+
inheritAttrs: false,
|
|
389
|
+
});
|
|
390
|
+
const declaredProps = withDefaults(defineProps<BbSelectProps<T, Known>>(), {
|
|
380
391
|
// `undefined` (declared, not omitted) keeps `adaptive` three-state all the
|
|
381
392
|
// way to BbSelectPopover: it disables Vue's absent→`false` Boolean cast
|
|
382
393
|
// (which would pass an explicit `false` and defeat the global
|
|
@@ -403,7 +414,7 @@ const declaredProps = withDefaults(defineProps<BbSelectProps<T>>(), {
|
|
|
403
414
|
|
|
404
415
|
const declaredEmit = defineEmits<BbSelectEvents>();
|
|
405
416
|
|
|
406
|
-
defineSlots<BbSelectSlots<T>>();
|
|
417
|
+
defineSlots<BbSelectSlots<T, Known>>();
|
|
407
418
|
// Inside a BbForm the field joins it (Q54.4): `props` / `emit` are bound.
|
|
408
419
|
const {
|
|
409
420
|
props,
|
|
@@ -461,6 +472,11 @@ const passthrough = usePassthrough({
|
|
|
461
472
|
...formControlPtActive(props, () => hasValue.value),
|
|
462
473
|
open: () => open.value,
|
|
463
474
|
},
|
|
475
|
+
variant: {
|
|
476
|
+
...BB_SELECT_PT.variant,
|
|
477
|
+
// CommonFieldInput's default.
|
|
478
|
+
current: () => props.variant ?? 'outline',
|
|
479
|
+
},
|
|
464
480
|
});
|
|
465
481
|
|
|
466
482
|
/**
|
|
@@ -541,6 +557,17 @@ const knownItemsSource: KnownItemsSource = {
|
|
|
541
557
|
rows: () => props.knownItems,
|
|
542
558
|
prefill: () => props.prefill,
|
|
543
559
|
};
|
|
560
|
+
/**
|
|
561
|
+
* The `item` / `known` pair a chip slot gets (Q77.7); the popover reports
|
|
562
|
+
* which rows are known. Typed by whether this select binds `known-items`
|
|
563
|
+
* (`Known`), which runtime cannot see, so the one cast lives here.
|
|
564
|
+
*/
|
|
565
|
+
const slotRow = (item: T) =>
|
|
566
|
+
({
|
|
567
|
+
known: !!knownItemsSource.isKnown?.(item),
|
|
568
|
+
item,
|
|
569
|
+
}) as BbSelectSlotRow<T, Known>;
|
|
570
|
+
|
|
544
571
|
const knownCoversModel = computed(() =>
|
|
545
572
|
knownRowsCover(
|
|
546
573
|
indexKnownRows(props.knownItems),
|
|
@@ -785,7 +812,12 @@ const popoverListeners = () =>
|
|
|
785
812
|
```ts
|
|
786
813
|
import type { Responsive } from '@/types/ResponsiveSize';
|
|
787
814
|
import type { BbSelectItemProps } from '@/types/ItemProps';
|
|
788
|
-
import
|
|
815
|
+
import {
|
|
816
|
+
INPUT_VARIANTS,
|
|
817
|
+
type InputVariantBuiltIn,
|
|
818
|
+
type InputVariantRegistry,
|
|
819
|
+
type InputVariantType,
|
|
820
|
+
} from '@/types/InputVariant';
|
|
789
821
|
import type {
|
|
790
822
|
PtNoInfer,
|
|
791
823
|
FormControlPtState,
|
|
@@ -793,6 +825,7 @@ import type {
|
|
|
793
825
|
PtItemMap,
|
|
794
826
|
PtItemResult,
|
|
795
827
|
PtValue,
|
|
828
|
+
PtVariantAttrs,
|
|
796
829
|
} from '@/types/passthrough';
|
|
797
830
|
import type { HTMLAttributes, InputHTMLAttributes } from 'vue';
|
|
798
831
|
import type { FieldCrossAlign, FieldLayout } from '@/types/FieldLayout';
|
|
@@ -800,8 +833,9 @@ import type { ItemAccessor } from '@/types/ItemAccessor';
|
|
|
800
833
|
import type { BbSelectItemsContext } from '@/types/ItemsProvider';
|
|
801
834
|
import type { IconType } from '@/types/Icon';
|
|
802
835
|
import type {
|
|
803
|
-
|
|
836
|
+
BbSelectKnownItems,
|
|
804
837
|
BbSelectResolvedOption,
|
|
838
|
+
BbSelectSlotRow,
|
|
805
839
|
} from '../BbSelectPopover/types';
|
|
806
840
|
import type { BbOffCanvasProps } from '../BbOffCanvas/types';
|
|
807
841
|
import type { FormFieldProps } from '@/composables/useFormBinding';
|
|
@@ -911,6 +945,23 @@ export type BbSelectOptionPtPart =
|
|
|
911
945
|
*/
|
|
912
946
|
export type BbSelectPtState = FormControlPtState | 'open' | 'selected';
|
|
913
947
|
/** The runtime lists the resolver is wired with — kept next to the types so the two cannot drift. */
|
|
948
|
+
/**
|
|
949
|
+
* The parts the input `variant` styles (Q76.7): the field, not the options
|
|
950
|
+
* surface — `input` is the search field there. Spelled flat (T20).
|
|
951
|
+
*/
|
|
952
|
+
export type BbSelectVariantPtPart =
|
|
953
|
+
| 'root'
|
|
954
|
+
| 'label'
|
|
955
|
+
| 'description'
|
|
956
|
+
| 'message'
|
|
957
|
+
| 'hint'
|
|
958
|
+
| 'box'
|
|
959
|
+
| 'activator'
|
|
960
|
+
| 'icon'
|
|
961
|
+
| 'spinner'
|
|
962
|
+
| 'prefix'
|
|
963
|
+
| 'suffix'
|
|
964
|
+
| 'clear';
|
|
914
965
|
export const BB_SELECT_PT = {
|
|
915
966
|
parts: [
|
|
916
967
|
// The family's words with `activator` where the text controls say
|
|
@@ -951,436 +1002,489 @@ export const BB_SELECT_PT = {
|
|
|
951
1002
|
'open',
|
|
952
1003
|
'loading',
|
|
953
1004
|
],
|
|
1005
|
+
// The input `variant` is a state on the field's parts (Q76.7), below
|
|
1006
|
+
// the real states; a picker's panel and rows are not the field's.
|
|
1007
|
+
variant: {
|
|
1008
|
+
names: INPUT_VARIANTS,
|
|
1009
|
+
option: 'inputVariants',
|
|
1010
|
+
parts: [
|
|
1011
|
+
'root',
|
|
1012
|
+
'label',
|
|
1013
|
+
'description',
|
|
1014
|
+
'message',
|
|
1015
|
+
'hint',
|
|
1016
|
+
'box',
|
|
1017
|
+
'activator',
|
|
1018
|
+
'icon',
|
|
1019
|
+
'spinner',
|
|
1020
|
+
'prefix',
|
|
1021
|
+
'suffix',
|
|
1022
|
+
'clear',
|
|
1023
|
+
],
|
|
1024
|
+
},
|
|
954
1025
|
} as const satisfies {
|
|
1026
|
+
variant: {
|
|
1027
|
+
names: readonly InputVariantBuiltIn[];
|
|
1028
|
+
option: string;
|
|
1029
|
+
parts: readonly BbSelectVariantPtPart[];
|
|
1030
|
+
};
|
|
955
1031
|
parts: readonly BbSelectPtPart[];
|
|
956
1032
|
states: readonly BbSelectPtState[];
|
|
957
1033
|
};
|
|
958
1034
|
|
|
959
|
-
export type {
|
|
1035
|
+
export type {
|
|
1036
|
+
BbSelectKnownItem,
|
|
1037
|
+
BbSelectKnownItems,
|
|
1038
|
+
BbSelectSlotRow,
|
|
1039
|
+
} from '../BbSelectPopover/types';
|
|
960
1040
|
|
|
961
1041
|
// Spelled INLINE with this component's own unions (Vue's SFC type resolver
|
|
962
1042
|
// does not substitute a generic alias's type parameters — PASSTHROUGH.md T20).
|
|
963
1043
|
// Two mapped types, never `Partial<Record<…>>`: the lint autofix rewrites one
|
|
964
1044
|
// into the other and the SFC resolver reads only the mapped spelling (T23).
|
|
965
1045
|
/* eslint-disable @typescript-eslint/consistent-indexed-object-style */
|
|
966
|
-
export type BbSelectProps<
|
|
1046
|
+
export type BbSelectProps<
|
|
1047
|
+
T,
|
|
1048
|
+
// The type alone (a wrapper's, a `pt` const's) is the bound case, as
|
|
1049
|
+
// `BbSelectSlotRow<Row>` is: it cannot know where it lands (Q77.7). The
|
|
1050
|
+
// component's own default is `undefined`.
|
|
1051
|
+
Known extends BbSelectKnownItems | undefined = BbSelectKnownItems,
|
|
1052
|
+
> = {
|
|
967
1053
|
[K in
|
|
968
1054
|
| `pt:${BbSelectFieldPtPart}`
|
|
969
|
-
| `pt:${BbSelectPtPart}:${BbSelectPtState}`
|
|
970
|
-
}
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1055
|
+
| `pt:${BbSelectPtPart}:${BbSelectPtState}`
|
|
1056
|
+
| `pt:${BbSelectVariantPtPart}:${InputVariantBuiltIn}`]?: PtValue;
|
|
1057
|
+
} & /* @vue-ignore */ PtVariantAttrs<
|
|
1058
|
+
BbSelectVariantPtPart,
|
|
1059
|
+
keyof InputVariantRegistry
|
|
1060
|
+
> & {
|
|
1061
|
+
// The option parts also take a per-item function, typed on this select's
|
|
1062
|
+
// item — a literal function type, not `PtItemFn` (T23).
|
|
1063
|
+
[K in `pt:${BbSelectOptionPtPart}`]?:
|
|
1064
|
+
| PtValue
|
|
1065
|
+
| ((
|
|
1066
|
+
ctx: PtItemCtx<
|
|
1067
|
+
PtNoInfer<T>,
|
|
1068
|
+
BbSelectPtState,
|
|
1069
|
+
never,
|
|
1070
|
+
BbSelectSlotRow<PtNoInfer<T>, PtNoInfer<Known>>
|
|
1071
|
+
>
|
|
1072
|
+
) => PtItemResult);
|
|
1073
|
+
} & {
|
|
1074
|
+
/* eslint-enable @typescript-eslint/consistent-indexed-object-style */
|
|
1075
|
+
/**
|
|
1076
|
+
* Passthrough, object form: the same keys as the `pt:*` attributes
|
|
1077
|
+
* without the prefix. See the `pt:<part>` row.
|
|
1078
|
+
*/
|
|
1079
|
+
/* eslint-disable @typescript-eslint/consistent-indexed-object-style -- mapped, never Record (T23) */
|
|
1080
|
+
pt?: PtItemMap<
|
|
1081
|
+
BbSelectPtPart,
|
|
1082
|
+
BbSelectOptionPtPart,
|
|
1083
|
+
BbSelectPtState,
|
|
1084
|
+
PtNoInfer<T>,
|
|
1085
|
+
never,
|
|
1086
|
+
BbSelectSlotRow<PtNoInfer<T>, PtNoInfer<Known>>
|
|
1087
|
+
> & {
|
|
1088
|
+
[K in `${BbSelectVariantPtPart}:${InputVariantBuiltIn | keyof InputVariantRegistry}`]?: PtValue;
|
|
1089
|
+
};
|
|
1090
|
+
/* eslint-enable @typescript-eslint/consistent-indexed-object-style */
|
|
1091
|
+
/**
|
|
1092
|
+
* When `true`, the options panel opens as a bottom off-canvas sheet on mobile
|
|
1093
|
+
* viewports instead of a floating popover; on desktop it stays a popover.
|
|
1094
|
+
*
|
|
1095
|
+
* When unset, falls back to the global `config.adaptive`.
|
|
1096
|
+
* @defaultValue `config.adaptive` (`true`)
|
|
1097
|
+
*/
|
|
1098
|
+
adaptive?: boolean;
|
|
1099
|
+
|
|
1100
|
+
/**
|
|
1101
|
+
* Text between the label and the input. Unlike the hint it is always
|
|
1102
|
+
* visible; it joins the input's `aria-describedby` after any `errors` /
|
|
1103
|
+
* `warnings`, before the `hint`.
|
|
1104
|
+
*/
|
|
1105
|
+
description?: string;
|
|
1106
|
+
|
|
1107
|
+
/**
|
|
1108
|
+
* Props for the phone sheet (the `BbOffCanvas` that `adaptive` renders on
|
|
1109
|
+
* mobile), spread over its defaults. A `pt` inside it styles only the sheet
|
|
1110
|
+
* (passthrough guide § Inside the sheet).
|
|
1111
|
+
*/
|
|
1112
|
+
offCanvasProps?: Partial<BbOffCanvasProps>;
|
|
1113
|
+
|
|
1114
|
+
/**
|
|
1115
|
+
* Hides the panel's search field: `true` everywhere, `'mobile'` /
|
|
1116
|
+
* `'desktop'` on that platform only. `'auto'` hides it, per open, for an
|
|
1117
|
+
* array `items` shorter than the plugin's `autoDisableWritingThreshold`
|
|
1118
|
+
* (6); never for a provider or with an `option:add` listener.
|
|
1119
|
+
*
|
|
1120
|
+
* @defaultValue `'auto'`
|
|
1121
|
+
*/
|
|
1122
|
+
disableWriting?: boolean | 'mobile' | 'desktop' | 'auto';
|
|
1123
|
+
|
|
1124
|
+
/**
|
|
1125
|
+
* Name of the icon to be added at the end of the input.
|
|
1126
|
+
*
|
|
1127
|
+
* @defaultValue the chevron-down glyph
|
|
1128
|
+
*/
|
|
1129
|
+
'append:icon'?: IconType;
|
|
1130
|
+
|
|
1131
|
+
/**
|
|
1132
|
+
* Guides to the browser as to the type of information expected in the field.
|
|
1133
|
+
*/
|
|
1134
|
+
autocomplete?: InputHTMLAttributes['autocomplete'];
|
|
1135
|
+
|
|
1136
|
+
/**
|
|
1137
|
+
* Focuses the field when it mounts (a dialog already open included), unless the user is typing in another field.
|
|
1138
|
+
*/
|
|
1139
|
+
autofocus?: InputHTMLAttributes['autofocus'];
|
|
1140
|
+
|
|
1141
|
+
/**
|
|
1142
|
+
* Displays a clear button when the input has a value and is being interacted with.
|
|
1143
|
+
*/
|
|
1144
|
+
clearable?: boolean;
|
|
1145
|
+
|
|
1146
|
+
/**
|
|
1147
|
+
* Sets the display model for selected values to a list of comma separated string.
|
|
1148
|
+
* In this mode the user cannot deselect an option by pressing the close button.
|
|
1149
|
+
*/
|
|
1150
|
+
comma?: boolean;
|
|
1151
|
+
|
|
1152
|
+
/**
|
|
1153
|
+
* Compact density: the field uses the `-compact` twins of `--bb-input-h`,
|
|
1154
|
+
* `--bb-input-py` and `--bb-label-spacing-y`, so a `--bb-input-h` set on
|
|
1155
|
+
* the component is ignored while it is on. Size a compact field with
|
|
1156
|
+
* `--bb-input-h-compact` (and `--bb-input-py-compact`).
|
|
1157
|
+
*/
|
|
1158
|
+
compact?: boolean;
|
|
1159
|
+
|
|
1160
|
+
/**
|
|
1161
|
+
* The field box's look, with `BbButton`'s names and tokens. Colours only,
|
|
1162
|
+
* so a form never reflows; `'ghost'` has no border in any state, `'none'`
|
|
1163
|
+
* no look at all (you own hover, focus and the states). Register more with
|
|
1164
|
+
* the plugin's `inputVariants`.
|
|
1165
|
+
*
|
|
1166
|
+
* @defaultValue `'outline'`
|
|
1167
|
+
*/
|
|
1168
|
+
variant?: InputVariantType;
|
|
1169
|
+
|
|
1170
|
+
/**
|
|
1171
|
+
* Defines an array of dependencies that will trigger actions in the component upon change.
|
|
1172
|
+
*/
|
|
1173
|
+
dependencies?: unknown[];
|
|
1174
|
+
|
|
1175
|
+
/**
|
|
1176
|
+
* Timeout used to debounce response to changes to dependencies.
|
|
1177
|
+
*
|
|
1178
|
+
* @defaultValue `0`
|
|
1179
|
+
*/
|
|
1180
|
+
depsDebounceTime?: number;
|
|
1181
|
+
|
|
1182
|
+
/**
|
|
1183
|
+
* How label and input sit together: `'vertical'`, `'horizontal'` (50/50),
|
|
1184
|
+
* `'auto'`, `'label-fill'`, `'input-fill'`, a ratio like `'xx xxxxx'`, or a
|
|
1185
|
+
* per-breakpoint map (`{ default: 'vertical', md: 'xx xxxxx' }`).
|
|
1186
|
+
*/
|
|
1187
|
+
layout?: Responsive<FieldLayout>;
|
|
1188
|
+
|
|
1189
|
+
/**
|
|
1190
|
+
* Vertical position of the label block in a side-by-side row; not
|
|
1191
|
+
* `labelPosition`, the horizontal one. Omitted, the label's first line
|
|
1192
|
+
* meets the control's.
|
|
1193
|
+
*/
|
|
1194
|
+
labelAlign?: FieldCrossAlign;
|
|
1195
|
+
|
|
1196
|
+
/**
|
|
1197
|
+
* Vertical position of the control in a side-by-side row; not
|
|
1198
|
+
* `inputPosition`, the horizontal one. Omitted, the control's first line
|
|
1199
|
+
* meets the label's.
|
|
1200
|
+
*/
|
|
1201
|
+
inputAlign?: FieldCrossAlign;
|
|
1202
|
+
|
|
1203
|
+
/**
|
|
1204
|
+
* Disables the component.
|
|
1205
|
+
*/
|
|
1206
|
+
disabled?: boolean;
|
|
1207
|
+
|
|
1208
|
+
/**
|
|
1209
|
+
* After every successful load that is not a search, removes the picks the
|
|
1210
|
+
* fetched rows do not contain (a single model resets to `null`). A `stash`
|
|
1211
|
+
* does not count, `known-items` vouch until a parent change; a search or a
|
|
1212
|
+
* failed load never prunes.
|
|
1213
|
+
*/
|
|
1214
|
+
enforceCoherence?: boolean;
|
|
1215
|
+
|
|
1216
|
+
/**
|
|
1217
|
+
* Error messages under the field, a string or array, in an
|
|
1218
|
+
* `aria-live="polite"` region and first in the control's
|
|
1219
|
+
* `aria-describedby`, so they are re-read when it regains focus.
|
|
1220
|
+
*/
|
|
1221
|
+
errors?: string | string[];
|
|
1222
|
+
|
|
1223
|
+
/**
|
|
1224
|
+
* What typing filters on: empty = the display text and description; item
|
|
1225
|
+
* paths = those fields (`['name', 'email']`); `false` = no filtering.
|
|
1226
|
+
* Use `false` when the provider matched the query on the server, or its
|
|
1227
|
+
* email/accent matches show as "No results".
|
|
1228
|
+
*
|
|
1229
|
+
* @defaultValue `[]`
|
|
1230
|
+
*/
|
|
1231
|
+
filterBy?: string[] | false;
|
|
1232
|
+
|
|
1233
|
+
/**
|
|
1234
|
+
* Path to item property for grouping options.
|
|
1235
|
+
*/
|
|
1236
|
+
groupBy?: string | ((item: T) => string | number | symbol);
|
|
1237
|
+
|
|
1238
|
+
/**
|
|
1239
|
+
* Define if the component should be in an error state.
|
|
1240
|
+
* It usually attaches a CSS class for styling purposes.
|
|
1241
|
+
*/
|
|
1242
|
+
hasErrors?: boolean;
|
|
1243
|
+
|
|
1244
|
+
/**
|
|
1245
|
+
* Warning messages under the field, a string or array: amber, in their own
|
|
1246
|
+
* `aria-live` region and in the control's `aria-describedby` after the
|
|
1247
|
+
* errors. Non-empty turns on the warning state; errors win when both are
|
|
1248
|
+
* set.
|
|
1249
|
+
*/
|
|
1250
|
+
warnings?: string | string[];
|
|
1251
|
+
|
|
1252
|
+
/**
|
|
1253
|
+
* Define if the component should be in a warning state.
|
|
1254
|
+
* Same chrome as errors with `--bb-warn`; errors take priority.
|
|
1255
|
+
*/
|
|
1256
|
+
hasWarnings?: boolean;
|
|
1257
|
+
|
|
1258
|
+
/**
|
|
1259
|
+
* Visually hides the label of the input while maintaining accessibility.
|
|
1260
|
+
*/
|
|
1261
|
+
hideLabel?: boolean;
|
|
1262
|
+
|
|
1263
|
+
/**
|
|
1264
|
+
* Text box to be displayed near the input, usually to indicate instructions.
|
|
1265
|
+
*/
|
|
1266
|
+
hint?: string;
|
|
1267
|
+
|
|
1268
|
+
/**
|
|
1269
|
+
* The `id` of the native control; the label's `for` and the description
|
|
1270
|
+
* and message ids derive from it. Generated when omitted.
|
|
1271
|
+
*/
|
|
1272
|
+
id?: HTMLAttributes['id'];
|
|
1273
|
+
|
|
1274
|
+
/**
|
|
1275
|
+
* The options: an array, or a provider called with a
|
|
1276
|
+
* `BbSelectItemsContext` (`query`, `reason`, `modelValue`, `signal`),
|
|
1277
|
+
* sync or async. Branch on `reason !== 'search'` to resolve the selection
|
|
1278
|
+
* by id. A provider fails by THROWING, never by returning `[]`.
|
|
1279
|
+
*/
|
|
1280
|
+
items: T[] | ((context: BbSelectItemsContext) => T[] | Promise<T[]>);
|
|
1281
|
+
|
|
1282
|
+
/**
|
|
1283
|
+
* Height of group headers in the listbox (px). Defaults to 32px (24px
|
|
1284
|
+
* compact; 36px / 32px on mobile viewports). Only applies when `groupBy`
|
|
1285
|
+
* is set. An explicit value wins on every viewport.
|
|
1286
|
+
*/
|
|
1287
|
+
headerHeight?: number;
|
|
1288
|
+
|
|
1289
|
+
/**
|
|
1290
|
+
* Height of the options in the listbox (px). Defaults to 28px (24px
|
|
1291
|
+
* compact; 44px / 36px on mobile viewports). An explicit value wins on
|
|
1292
|
+
* every viewport.
|
|
1293
|
+
*
|
|
1294
|
+
* @defaultValue `28`
|
|
1295
|
+
*/
|
|
1296
|
+
itemHeight?: number;
|
|
1297
|
+
|
|
1298
|
+
/**
|
|
1299
|
+
* Defines a path that returns a property of the object to use as text or a function
|
|
1300
|
+
* that returns a string.
|
|
1301
|
+
*
|
|
1302
|
+
* Unset: own `label`, else `text` (`{ label, value }` needs no accessor).
|
|
1303
|
+
*
|
|
1304
|
+
* @defaultValue own `label`, else `text`, else `JSON.stringify(item)`
|
|
1305
|
+
*/
|
|
1306
|
+
itemText?: ItemAccessor<T, string>;
|
|
1307
|
+
|
|
1308
|
+
/**
|
|
1309
|
+
* ADDITIONAL row fields, never the text or value: `description` (a muted
|
|
1310
|
+
* line under the label), `prepend:icon`, `append:icon`. An object of paths
|
|
1311
|
+
* or getters per field, or a function of the item. Nothing is read
|
|
1312
|
+
* implicitly; none shows in the trigger or the chips.
|
|
1313
|
+
*/
|
|
1314
|
+
itemProps?: BbSelectItemProps<T>;
|
|
1315
|
+
|
|
1316
|
+
/**
|
|
1317
|
+
* Defines a path that returns a property of the object to use as value or a function
|
|
1318
|
+
* that returns any value.
|
|
1319
|
+
*
|
|
1320
|
+
* Unset: own `value`, even `null`.
|
|
1321
|
+
*
|
|
1322
|
+
* @defaultValue own `value`, else the whole item
|
|
1323
|
+
*/
|
|
1324
|
+
itemValue?: ItemAccessor<T>;
|
|
1325
|
+
|
|
1326
|
+
/**
|
|
1327
|
+
* `{ value, label }` rows naming the value the app already holds, whatever
|
|
1328
|
+
* the options' shape: no request until the first open (`prefill: true`
|
|
1329
|
+
* still loads). Not options; the options' accessors never run on them;
|
|
1330
|
+
* slots get the row as `item`, with `known: true`, until the list brings
|
|
1331
|
+
* its own.
|
|
1332
|
+
*/
|
|
1333
|
+
knownItems?: [Known] extends [undefined] ? BbSelectKnownItems : Known;
|
|
1334
|
+
|
|
1335
|
+
/**
|
|
1336
|
+
* Text content of the label of the element.
|
|
1337
|
+
*/
|
|
1338
|
+
label: string;
|
|
1339
|
+
|
|
1340
|
+
/**
|
|
1341
|
+
* Sets the text alignment of the label.
|
|
1342
|
+
*/
|
|
1343
|
+
labelPosition?: 'left' | 'center' | 'right';
|
|
1344
|
+
|
|
1345
|
+
/**
|
|
1346
|
+
* Label rendering mode.
|
|
1347
|
+
*/
|
|
1348
|
+
labelMode?: 'outside' | 'floating' | 'inside';
|
|
1349
|
+
|
|
1350
|
+
/**
|
|
1351
|
+
* Sets the component in a loading state, usually triggering some visual styles.
|
|
1352
|
+
*/
|
|
1353
|
+
loading?: boolean;
|
|
1354
|
+
|
|
1355
|
+
/**
|
|
1356
|
+
* String displayed while items are being loaded.
|
|
1357
|
+
*/
|
|
1358
|
+
loadingText?: string;
|
|
1359
|
+
|
|
1360
|
+
/**
|
|
1361
|
+
* Maximum number of selectable items when the multiple flag is set.
|
|
1362
|
+
*/
|
|
1363
|
+
max?: number;
|
|
1364
|
+
|
|
1365
|
+
/**
|
|
1366
|
+
* Maximum number of labels shown before collapsing to a count summary.
|
|
1367
|
+
* Unset, the labels collapse only when they overflow the field.
|
|
1368
|
+
*
|
|
1369
|
+
* @defaultValue `Infinity`
|
|
1370
|
+
*/
|
|
1371
|
+
maxSelectedLabels?: number;
|
|
1372
|
+
|
|
1373
|
+
/**
|
|
1374
|
+
* Used by v-model. Can be any serializable type.
|
|
1375
|
+
*/
|
|
1376
|
+
modelValue?: any;
|
|
1377
|
+
|
|
1378
|
+
/**
|
|
1379
|
+
* Timeout used to debounce response to changes to modelValue.
|
|
1380
|
+
*
|
|
1381
|
+
* @defaultValue `0`
|
|
1382
|
+
*/
|
|
1383
|
+
modelValueDebounceTime?: number;
|
|
1384
|
+
|
|
1385
|
+
/**
|
|
1386
|
+
* Allows the selection of multiple items.
|
|
1387
|
+
*/
|
|
1388
|
+
multiple?: boolean;
|
|
1389
|
+
|
|
1390
|
+
/**
|
|
1391
|
+
* Defines the name of the input.
|
|
1392
|
+
*/
|
|
1393
|
+
name?: InputHTMLAttributes['name'];
|
|
1394
|
+
|
|
1395
|
+
/**
|
|
1396
|
+
* String displayed when there are no items to display.
|
|
1397
|
+
*/
|
|
1398
|
+
emptyText?: string;
|
|
1399
|
+
|
|
1400
|
+
/**
|
|
1401
|
+
* String displayed in the empty state while the latest load FAILED (the
|
|
1402
|
+
* provider threw): the twin of `emptyText` for that case.
|
|
1403
|
+
*
|
|
1404
|
+
* @defaultValue the localized `common.failedText` ("Couldn't load items")
|
|
1405
|
+
*/
|
|
1406
|
+
failedText?: string;
|
|
1407
|
+
|
|
1408
|
+
/**
|
|
1409
|
+
* Keeps the hint displayed.
|
|
1410
|
+
*/
|
|
1411
|
+
persistentHint?: boolean;
|
|
1412
|
+
|
|
1413
|
+
/**
|
|
1414
|
+
* Text shown in the field while nothing is picked (an empty list has
|
|
1415
|
+
* `emptyText`).
|
|
1416
|
+
*/
|
|
1417
|
+
placeholder?: InputHTMLAttributes['placeholder'];
|
|
1418
|
+
|
|
1419
|
+
/**
|
|
1420
|
+
* When the options first load: `'interaction'` on first open, `true` on
|
|
1421
|
+
* mount, `false` only once the user types (on open with
|
|
1422
|
+
* `disable-writing`). An array `items` or a seeded model always loads at
|
|
1423
|
+
* once.
|
|
1424
|
+
*
|
|
1425
|
+
* @defaultValue `'interaction'`
|
|
1426
|
+
*/
|
|
1427
|
+
prefill?: boolean | 'interaction';
|
|
1428
|
+
|
|
1429
|
+
/**
|
|
1430
|
+
* Name of the icon to be added at the start of the input.
|
|
1431
|
+
*/
|
|
1432
|
+
|
|
1433
|
+
'prepend:icon'?: IconType;
|
|
1434
|
+
|
|
1435
|
+
/**
|
|
1436
|
+
* Sets the input as required.
|
|
1437
|
+
*/
|
|
1438
|
+
required?: boolean;
|
|
1439
|
+
|
|
1440
|
+
/**
|
|
1441
|
+
* Time to wait when the user stops writing in the input before querying data.
|
|
1442
|
+
*
|
|
1443
|
+
* @defaultValue `500`
|
|
1444
|
+
*/
|
|
1445
|
+
queryDebounceTime?: number;
|
|
1446
|
+
|
|
1447
|
+
/**
|
|
1448
|
+
* Sets the input in a readonly state.
|
|
1449
|
+
*/
|
|
1450
|
+
readonly?: boolean;
|
|
1451
|
+
|
|
1452
|
+
/**
|
|
1453
|
+
* Reverses the layout. Applicable in every direction the order of the label and
|
|
1454
|
+
* the input is swapped.
|
|
1455
|
+
*/
|
|
1456
|
+
reverse?: boolean;
|
|
1457
|
+
|
|
1458
|
+
/**
|
|
1459
|
+
* Defines whether options are selectable.
|
|
1460
|
+
* Can be a global boolean that affects all options or a function
|
|
1461
|
+
* that accepts an item and returns a boolean that only affects that item.
|
|
1462
|
+
* Non-selectable options are rendered disabled.
|
|
1463
|
+
* @defaultValue `true`
|
|
1464
|
+
*/
|
|
1465
|
+
selectable?: boolean | ((item: T) => boolean);
|
|
1466
|
+
|
|
1467
|
+
/**
|
|
1468
|
+
* Function that returns a string to be displayed when the number of selected labels
|
|
1469
|
+
* is greater than `maxSelectedLabels`.
|
|
1470
|
+
*/
|
|
1471
|
+
selectedLabelsFn?: (count: number) => string;
|
|
1472
|
+
|
|
1473
|
+
/**
|
|
1474
|
+
* Keeps picked options named across searches: a pick stays resolvable (its
|
|
1475
|
+
* chip keeps its text) when a later search or a failed load no longer
|
|
1476
|
+
* returns it. It follows the model, and does not keep a pick valid:
|
|
1477
|
+
* `enforce-coherence` still prunes it.
|
|
1478
|
+
*/
|
|
1479
|
+
stash?: boolean;
|
|
1480
|
+
|
|
1481
|
+
/**
|
|
1482
|
+
* How long the transition has to last in milliseconds.
|
|
1483
|
+
*
|
|
1484
|
+
* @defaultValue `250`
|
|
1485
|
+
*/
|
|
1486
|
+
transitionDuration?: number;
|
|
1487
|
+
} & FormFieldProps<any>;
|
|
1384
1488
|
|
|
1385
1489
|
/** Re-export for consumers importing events type from BbSelect. */
|
|
1386
1490
|
export type BbSelectEvents = {
|
|
@@ -1436,7 +1540,10 @@ export type BbSelectLabelSlotProps = CommonFieldAsteriskSlotProps & {
|
|
|
1436
1540
|
};
|
|
1437
1541
|
|
|
1438
1542
|
/** Props exposed by the `option` slot. */
|
|
1439
|
-
export type BbSelectOptionSlotProps<
|
|
1543
|
+
export type BbSelectOptionSlotProps<
|
|
1544
|
+
T,
|
|
1545
|
+
Known extends BbSelectKnownItems | undefined = undefined,
|
|
1546
|
+
> = BbSelectSlotRow<T, Known> & {
|
|
1440
1547
|
/** Whether this option is disabled. */
|
|
1441
1548
|
disabled: boolean;
|
|
1442
1549
|
/** Whether this option currently has keyboard focus. */
|
|
@@ -1445,8 +1552,6 @@ export type BbSelectOptionSlotProps<T> = {
|
|
|
1445
1552
|
index: number;
|
|
1446
1553
|
/** Whether the select is in an error state. */
|
|
1447
1554
|
hasErrors?: boolean;
|
|
1448
|
-
/** The raw item from the `items` prop. */
|
|
1449
|
-
item: T;
|
|
1450
1555
|
/** Whether items are still being fetched. */
|
|
1451
1556
|
loading: boolean;
|
|
1452
1557
|
/** Whether this option is currently selected. */
|
|
@@ -1477,9 +1582,10 @@ export type BbSelectGroupSlotProps<T> = {
|
|
|
1477
1582
|
* Props exposed by the `chip` slot — called once per selected value in
|
|
1478
1583
|
* `multiple` mode, in place of the default badge.
|
|
1479
1584
|
*/
|
|
1480
|
-
export type BbSelectChipSlotProps<
|
|
1481
|
-
|
|
1482
|
-
|
|
1585
|
+
export type BbSelectChipSlotProps<
|
|
1586
|
+
T,
|
|
1587
|
+
Known extends BbSelectKnownItems | undefined = undefined,
|
|
1588
|
+
> = BbSelectSlotRow<T, Known> & {
|
|
1483
1589
|
/** The item's resolved display text (what the default badge prints). */
|
|
1484
1590
|
text: string;
|
|
1485
1591
|
/** The item's resolved value — what sits in the v-model. */
|
|
@@ -1510,7 +1616,10 @@ export type BbSelectPanelSlotProps = {
|
|
|
1510
1616
|
selectedOptions: BbSelectResolvedOption[];
|
|
1511
1617
|
};
|
|
1512
1618
|
|
|
1513
|
-
export type BbSelectSlots<
|
|
1619
|
+
export type BbSelectSlots<
|
|
1620
|
+
T,
|
|
1621
|
+
Known extends BbSelectKnownItems | undefined = undefined,
|
|
1622
|
+
> = {
|
|
1514
1623
|
/**
|
|
1515
1624
|
* Content pinned to the top of the options panel, above the search field.
|
|
1516
1625
|
* Rendered in both the desktop popover and the adaptive sheet.
|
|
@@ -1556,9 +1665,12 @@ export type BbSelectSlots<T> = {
|
|
|
1556
1665
|
*/
|
|
1557
1666
|
empty?: (props: { query: string; focus: () => void; error: unknown }) => any;
|
|
1558
1667
|
/**
|
|
1559
|
-
* Replaces the default rendering of each option row in the dropdown.
|
|
1668
|
+
* Replaces the default rendering of each option row in the dropdown. With
|
|
1669
|
+
* `known-items` bound, a row the list has not brought yet is the known
|
|
1670
|
+
* `{ value, label }` row, `known: true`: check `known` before reading an
|
|
1671
|
+
* option field off `item`.
|
|
1560
1672
|
*/
|
|
1561
|
-
option?: (props: BbSelectOptionSlotProps<T>) => any;
|
|
1673
|
+
option?: (props: BbSelectOptionSlotProps<T, Known>) => any;
|
|
1562
1674
|
/**
|
|
1563
1675
|
* Replaces the default group header rendered above grouped options.
|
|
1564
1676
|
* Not called for rows with no group (`group-by` gives `null`/`undefined`,
|
|
@@ -1567,9 +1679,11 @@ export type BbSelectSlots<T> = {
|
|
|
1567
1679
|
group?: (props: BbSelectGroupSlotProps<T>) => any;
|
|
1568
1680
|
/**
|
|
1569
1681
|
* Replaces the default badge rendered for each selection in `multiple` mode.
|
|
1570
|
-
* Not called in `comma` mode, nor for the collapsed "+N" summary.
|
|
1682
|
+
* Not called in `comma` mode, nor for the collapsed "+N" summary. With
|
|
1683
|
+
* `known-items` bound, `item` is the known `{ value, label }` row
|
|
1684
|
+
* (`known: true`) until the list brings the real one.
|
|
1571
1685
|
*/
|
|
1572
|
-
chip?: (props: BbSelectChipSlotProps<T>) => any;
|
|
1686
|
+
chip?: (props: BbSelectChipSlotProps<T, Known>) => any;
|
|
1573
1687
|
/**
|
|
1574
1688
|
* Content rendered as an inline prefix inside the input field.
|
|
1575
1689
|
*/
|