bitboss-ui 3.0.0-beta.70 → 3.0.0-beta.72
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 +2 -2
- package/bin/cli.mjs +6 -1
- package/dist/ai/BbAccordion.md +38 -19
- package/dist/ai/BbBadge.md +25 -22
- package/dist/ai/BbBreadcrumbs.md +4 -1
- package/dist/ai/BbButton.md +32 -27
- package/dist/ai/BbCalendar.md +1 -0
- package/dist/ai/BbCarousel.md +6 -4
- package/dist/ai/BbCheckbox.md +5 -6
- package/dist/ai/BbCheckboxGroup.md +27 -27
- package/dist/ai/BbColorInput.md +4 -5
- package/dist/ai/BbConfirm.md +65 -81
- package/dist/ai/BbConfirmPortal.md +2 -2
- package/dist/ai/BbDatePicker.md +1 -6
- package/dist/ai/BbDatePickerInput.md +5 -6
- package/dist/ai/BbDialog.md +230 -164
- package/dist/ai/BbDropdown.md +87 -17
- package/dist/ai/BbDropdownButton.md +15 -15
- package/dist/ai/BbDropzone.md +12 -8
- package/dist/ai/BbForm.md +93 -7
- package/dist/ai/BbHost.md +2 -2
- package/dist/ai/BbHoverCardPortal.md +1 -1
- package/dist/ai/BbIcon.md +1 -1
- package/dist/ai/BbIndicator.md +17 -15
- package/dist/ai/BbNumberInput.md +10 -9
- package/dist/ai/BbOffCanvas.md +29 -7
- package/dist/ai/BbPagination.md +2 -2
- package/dist/ai/BbPopover.md +15 -9
- package/dist/ai/BbPopoverPortal.md +1 -1
- package/dist/ai/BbRadio.md +5 -6
- package/dist/ai/BbRadioGroup.md +53 -37
- package/dist/ai/BbRating.md +11 -16
- package/dist/ai/BbSelect.md +25 -5
- package/dist/ai/BbSelectPopover.md +9 -3
- package/dist/ai/BbSlider.md +15 -17
- package/dist/ai/BbSpinner.md +3 -2
- package/dist/ai/BbSwitch.md +9 -9
- package/dist/ai/BbSwitchGroup.md +11 -13
- package/dist/ai/BbTable.md +205 -82
- package/dist/ai/BbTabs.md +29 -4
- package/dist/ai/BbTag.md +4 -5
- package/dist/ai/BbTextInput.md +18 -16
- package/dist/ai/BbTextarea.md +12 -11
- package/dist/ai/BbTimePickerInput.md +4 -5
- package/dist/ai/BbToast.md +3 -2
- package/dist/ai/BbTooltip.md +39 -30
- package/dist/ai/BbTree.md +49 -24
- package/dist/ai/CommonField.md +2 -10
- package/dist/ai/CommonFieldInput.md +1 -1
- package/dist/ai/OptionsContainer.md +5 -13
- package/dist/ai/changelog.json +278 -10
- package/dist/ai/components.json +59 -58
- package/dist/ai/composables/useBbDialog.md +5 -8
- package/dist/ai/composables/useBbForm.md +3 -0
- package/dist/ai/composables/useConfirm.md +65 -56
- package/dist/ai/composables/useToast.md +2 -1
- package/dist/ai/guides/agent-contract.md +3 -3
- package/dist/ai/guides/app-layout.md +3 -2
- package/dist/ai/guides/eslint-rules.md +3 -1
- package/dist/ai/guides/fetch-items-playbook.md +1 -1
- package/dist/ai/guides/floating-bottom-panel.md +3 -2
- package/dist/ai/guides/icons-policy.md +7 -5
- package/dist/ai/guides/inertia-helpers.md +35 -30
- package/dist/ai/guides/installation-and-plugin-setup.md +17 -14
- package/dist/ai/guides/migration/adoption-checklist.md +2 -2
- package/dist/ai/guides/migration/components/bb-badge.md +12 -1
- package/dist/ai/guides/migration/components/bb-button.md +24 -0
- package/dist/ai/guides/migration/components/bb-dropdown-button.md +11 -0
- package/dist/ai/guides/migration/components/bb-tabs.md +2 -2
- package/dist/ai/guides/migration/components/bb-toast.md +11 -0
- package/dist/ai/guides/migration/components/use-confirm.md +69 -26
- package/dist/ai/guides/migration/v2-to-v3.md +78 -12
- package/dist/ai/guides/migration/v3-beta-css-classes.md +1 -1
- package/dist/ai/guides/options-items-playbook.md +4 -3
- package/dist/ai/guides/passthrough.md +2 -2
- package/dist/ai/guides/preset-components.md +35 -10
- package/dist/ai/helpers/definePreset.json +8 -1
- package/dist/ai/helpers/definePreset.ts +35 -10
- package/dist/ai/helpers/inertia/manifest.json +28 -15
- package/dist/ai/helpers/inertia/messages.ts +3 -3
- package/dist/ai/helpers/inertia/useConfirmOnRouteLeave.ts +10 -10
- package/dist/ai/helpers/inertia/usePromiseForm.ts +1 -1
- package/dist/ai/helpers/inertia/usePromiseRouter.ts +7 -2
- package/dist/ai/index.md +3 -3
- package/dist/ai/manifest/common.json +5 -5
- package/dist/ai/manifest/components/BbAccordion.json +8 -5
- package/dist/ai/manifest/components/BbAccordion.tree.json +1 -0
- package/dist/ai/manifest/components/BbBadge.json +8 -7
- package/dist/ai/manifest/components/BbBadge.removed.json +3 -1
- package/dist/ai/manifest/components/BbBadge.tree.json +73 -0
- package/dist/ai/manifest/components/BbBreadcrumbs.json +2 -2
- package/dist/ai/manifest/components/BbButton.json +5 -6
- package/dist/ai/manifest/components/BbButton.removed.json +3 -1
- package/dist/ai/manifest/components/BbButton.tree.json +24 -7
- package/dist/ai/manifest/components/BbCalendar.json +2 -1
- package/dist/ai/manifest/components/BbCheckbox.json +2 -2
- package/dist/ai/manifest/components/BbCheckbox.tree.json +1 -1
- package/dist/ai/manifest/components/BbCheckboxGroup.json +2 -2
- package/dist/ai/manifest/components/BbCheckboxGroup.tree.json +9 -19
- package/dist/ai/manifest/components/BbColorInput.json +3 -3
- package/dist/ai/manifest/components/BbColorInput.tree.json +2 -2
- package/dist/ai/manifest/components/BbConfirm.json +2 -2
- package/dist/ai/manifest/components/BbConfirm.removed.json +9 -0
- package/dist/ai/manifest/components/BbConfirm.tree.json +4 -5
- package/dist/ai/manifest/components/BbConfirmPortal.json +3 -3
- package/dist/ai/manifest/components/BbConfirmPortal.removed.json +7 -0
- package/dist/ai/manifest/components/BbDatePicker.json +2 -1
- package/dist/ai/manifest/components/BbDatePicker.tree.json +0 -6
- package/dist/ai/manifest/components/BbDatePickerInput.json +2 -2
- package/dist/ai/manifest/components/BbDatePickerInput.tree.json +2 -2
- package/dist/ai/manifest/components/BbDialog.json +6 -1
- package/dist/ai/manifest/components/BbDialog.tree.json +41 -1
- package/dist/ai/manifest/components/BbDropdown.json +10 -9
- package/dist/ai/manifest/components/BbDropdown.tree.json +4 -0
- package/dist/ai/manifest/components/BbDropdownButton.json +9 -10
- package/dist/ai/manifest/components/BbDropdownButton.removed.json +3 -1
- package/dist/ai/manifest/components/BbForm.json +3 -1
- package/dist/ai/manifest/components/BbNumberInput.json +1 -1
- package/dist/ai/manifest/components/BbNumberInput.tree.json +2 -2
- package/dist/ai/manifest/components/BbOffCanvas.json +6 -1
- package/dist/ai/manifest/components/BbOffCanvas.tree.json +40 -0
- package/dist/ai/manifest/components/BbPagination.json +1 -1
- package/dist/ai/manifest/components/BbRadio.tree.json +1 -1
- package/dist/ai/manifest/components/BbRadioGroup.json +4 -3
- package/dist/ai/manifest/components/BbRadioGroup.tree.json +8 -18
- package/dist/ai/manifest/components/BbRating.json +2 -2
- package/dist/ai/manifest/components/BbRating.tree.json +1 -1
- package/dist/ai/manifest/components/BbSelect.json +2 -1
- package/dist/ai/manifest/components/BbSelect.tree.json +2 -2
- package/dist/ai/manifest/components/BbSelectPopover.json +1 -0
- package/dist/ai/manifest/components/BbSlider.tree.json +1 -1
- package/dist/ai/manifest/components/BbSwitch.json +4 -4
- package/dist/ai/manifest/components/BbSwitch.tree.json +1 -1
- package/dist/ai/manifest/components/BbSwitchGroup.json +7 -7
- package/dist/ai/manifest/components/BbSwitchGroup.tree.json +2 -2
- package/dist/ai/manifest/components/BbTable.json +15 -14
- package/dist/ai/manifest/components/BbTable.tree.json +2 -0
- package/dist/ai/manifest/components/BbTabs.json +3 -3
- package/dist/ai/manifest/components/BbTabsList.json +1 -1
- package/dist/ai/manifest/components/BbTabsRoot.json +1 -1
- package/dist/ai/manifest/components/BbTag.json +1 -1
- package/dist/ai/manifest/components/BbTag.tree.json +2 -2
- package/dist/ai/manifest/components/BbTextInput.json +1 -1
- package/dist/ai/manifest/components/BbTextInput.tree.json +2 -2
- package/dist/ai/manifest/components/BbTextarea.json +1 -1
- package/dist/ai/manifest/components/BbTextarea.tree.json +2 -2
- package/dist/ai/manifest/components/BbTimePicker.json +1 -1
- package/dist/ai/manifest/components/BbTimePickerInput.json +1 -1
- package/dist/ai/manifest/components/BbTimePickerInput.tree.json +2 -2
- package/dist/ai/manifest/components/BbToast.removed.json +2 -1
- package/dist/ai/manifest/components/BbTooltip.json +1 -1
- package/dist/ai/manifest/components/BbTooltip.tree.json +2 -2
- package/dist/ai/manifest/components/BbTree.json +2 -2
- package/dist/ai/manifest/components/CommonField.tree.json +5 -10
- package/dist/ai/manifest/components/CommonFieldInput.tree.json +3 -3
- package/dist/ai/manifest/components/OptionsContainer.tree.json +5 -13
- package/dist/ai/manifest/index.json +4 -4
- package/dist/ai/manifest/meta.json +5 -1
- package/dist/ai/manifest/types.advanced.json +9 -9
- package/dist/ai/manifest/types.api.json +7 -6
- package/dist/ai/recipes/inertia/approvals-inbox.md +23 -16
- package/dist/ai/recipes/inertia/inline-edit-workspace.md +12 -5
- package/dist/ai/recipes/inertia/layout-scaffold.md +5 -3
- package/dist/ai/recipes/inertia/onboarding.md +23 -12
- package/dist/ai/recipes/inertia/ownership-atlas.md +34 -18
- package/dist/ai/recipes/inertia/record-form.md +12 -8
- package/dist/ai/recipes/inertia/records-workspace.md +14 -7
- package/dist/ai/recipes/inertia/settings-workspace.md +75 -60
- package/dist/ai/recipes/inertia/upload-center.md +17 -9
- package/dist/ai/recipes/inertia/wizard-form.md +2 -2
- package/dist/ai/recipes/nuxt/approvals-inbox.md +23 -16
- package/dist/ai/recipes/nuxt/inline-edit-workspace.md +12 -5
- package/dist/ai/recipes/nuxt/layout-scaffold.md +5 -3
- package/dist/ai/recipes/nuxt/onboarding.md +5 -4
- package/dist/ai/recipes/nuxt/ownership-atlas.md +34 -18
- package/dist/ai/recipes/nuxt/record-form.md +14 -10
- package/dist/ai/recipes/nuxt/records-workspace.md +14 -7
- package/dist/ai/recipes/nuxt/settings-workspace.md +70 -60
- package/dist/ai/recipes/nuxt/upload-center.md +17 -9
- package/dist/ai/recipes/nuxt/wizard-form.md +4 -4
- package/dist/ai/recipes/vue/approvals-inbox.md +23 -16
- package/dist/ai/recipes/vue/inline-edit-workspace.md +12 -5
- package/dist/ai/recipes/vue/layout-scaffold.md +5 -3
- package/dist/ai/recipes/vue/onboarding.md +5 -4
- package/dist/ai/recipes/vue/ownership-atlas.md +34 -18
- package/dist/ai/recipes/vue/record-form.md +14 -10
- package/dist/ai/recipes/vue/records-workspace.md +14 -7
- package/dist/ai/recipes/vue/settings-workspace.md +70 -60
- package/dist/ai/recipes/vue/upload-center.md +17 -9
- package/dist/ai/recipes/vue/wizard-form.md +4 -4
- package/dist/ai/source/BbAccordion.md +50 -16
- package/dist/ai/source/BbBadge.md +420 -26
- package/dist/ai/source/BbBadgeButton.md +378 -12
- package/dist/ai/source/BbBreadcrumbs.md +31 -12
- package/dist/ai/source/BbButton.md +205 -55
- package/dist/ai/source/BbCalendar.md +5 -0
- package/dist/ai/source/BbCheckbox.md +36 -42
- package/dist/ai/source/BbCheckboxGroup.md +40 -17
- package/dist/ai/source/BbColorInput.md +2 -4
- package/dist/ai/source/BbConfigScope.md +19 -2
- package/dist/ai/source/BbConfirm.md +74 -80
- package/dist/ai/source/BbConfirmPortal.md +6 -6
- package/dist/ai/source/BbDatePicker.md +9 -2
- package/dist/ai/source/BbDatePickerInput.md +5 -5
- package/dist/ai/source/BbDialog.md +53 -2
- package/dist/ai/source/BbDropdown.md +360 -99
- package/dist/ai/source/BbDropdownButton.md +24 -13
- package/dist/ai/source/BbDropdownGroup.md +145 -60
- package/dist/ai/source/BbForm.md +144 -10
- package/dist/ai/source/BbNumberInput.md +2 -4
- package/dist/ai/source/BbOffCanvas.md +53 -2
- package/dist/ai/source/BbPagination.md +1 -1
- package/dist/ai/source/BbRadio.md +36 -42
- package/dist/ai/source/BbRadioGroup.md +74 -14
- package/dist/ai/source/BbRating.md +32 -36
- package/dist/ai/source/BbSelect.md +40 -13
- package/dist/ai/source/BbSelectPopover.md +105 -34
- package/dist/ai/source/BbSlider.md +2 -4
- package/dist/ai/source/BbSwitch.md +57 -46
- package/dist/ai/source/BbSwitchGroup.md +67 -21
- package/dist/ai/source/BbTable.md +363 -49
- package/dist/ai/source/BbTabs.md +6 -0
- package/dist/ai/source/BbTabsList.md +10 -0
- package/dist/ai/source/BbTabsPanels.md +6 -0
- package/dist/ai/source/BbTabsRoot.md +6 -0
- package/dist/ai/source/BbTag.md +2 -4
- package/dist/ai/source/BbTextInput.md +2 -4
- package/dist/ai/source/BbTextarea.md +2 -4
- package/dist/ai/source/BbTimePickerInput.md +2 -4
- package/dist/ai/source/BbTooltip.md +9 -3
- package/dist/ai/source/BbTree.md +14 -4
- package/dist/ai/source/CommonField.md +17 -106
- package/dist/ai/source/CommonFieldInput.md +2 -1
- package/dist/ai/source/GuidesComponent.md +3 -0
- package/dist/components/BbAccordion/BbAccordion.vue.d.ts +7 -3
- package/dist/components/BbAccordion/BbAccordion.vue_vue_type_script_setup_true_lang.js +52 -38
- package/dist/components/BbAccordion/ptKeys.generated.d.ts +20 -0
- package/dist/components/BbAccordion/types.d.ts +21 -7
- package/dist/components/BbAccordion/types.js +1 -1
- package/dist/components/BbAlert/BbAlert.vue.d.ts +1 -1
- package/dist/components/BbBadge/BadgeBodyContent.vue_vue_type_script_setup_true_lang.js +5 -5
- package/dist/components/BbBadge/BbBadge.vue.d.ts +1 -1
- package/dist/components/BbBadge/BbBadge.vue_vue_type_script_setup_true_lang.js +65 -42
- package/dist/components/BbBadge/types.d.ts +15 -12
- package/dist/components/BbBreadcrumbs/BbBreadcrumbs.vue_vue_type_script_setup_true_lang.js +106 -106
- package/dist/components/BbBreadcrumbs/types.d.ts +6 -0
- package/dist/components/BbButton/BbButton.vue_vue_type_script_setup_true_lang.js +79 -73
- package/dist/components/BbButton/types.d.ts +7 -6
- package/dist/components/BbCalendar/BbCalendar.vue.d.ts +2 -1
- package/dist/components/BbCalendar/BbCalendar.vue_vue_type_script_setup_true_lang.js +2 -1
- package/dist/components/BbCalendar/types.d.ts +5 -0
- package/dist/components/BbCalendar/useCalendarGrid.js +1 -1
- package/dist/components/BbCalendar/useDayGrid.js +1 -1
- package/dist/components/BbCheckbox/types.d.ts +2 -4
- package/dist/components/BbCheckboxGroup/BbCheckboxGroup.vue.d.ts +10 -4
- package/dist/components/BbCheckboxGroup/BbCheckboxGroup.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/components/BbCheckboxGroup/types.d.ts +4 -6
- package/dist/components/BbColorInput/types.d.ts +2 -4
- package/dist/components/BbConfigScope/BbConfigScope.vue_vue_type_script_setup_true_lang.js +8 -8
- package/dist/components/BbConfirm/BbConfirm.vue_vue_type_script_setup_true_lang.js +71 -132
- package/dist/components/BbConfirm/ptKeys.generated.d.ts +5 -5
- package/dist/components/BbConfirm/types.d.ts +5 -5
- package/dist/components/BbDatePicker/BbDatePicker.vue.d.ts +2 -1
- package/dist/components/BbDatePicker/BbDatePicker.vue_vue_type_script_setup_true_lang.js +3 -0
- package/dist/components/BbDatePicker/types.d.ts +5 -0
- package/dist/components/BbDatePickerInput/BbDatePickerInput.vue.d.ts +1 -1
- package/dist/components/BbDatePickerInput/BbDatePickerInput.vue_vue_type_script_setup_true_lang.js +2 -0
- package/dist/components/BbDatePickerInput/types.d.ts +4 -5
- package/dist/components/BbDialog/BbDialog.vue.d.ts +3 -0
- package/dist/components/BbDialog/BbDialog.vue_vue_type_script_setup_true_lang.js +263 -235
- package/dist/components/BbDialog/overlayActions.js +94 -0
- package/dist/components/BbDialog/types.d.ts +24 -0
- package/dist/components/BbDropdown/AdaptiveDropdown.vue_vue_type_script_setup_true_lang.js +4 -3
- package/dist/components/BbDropdown/BbDropdown.vue_vue_type_script_setup_true_lang.js +384 -332
- package/dist/components/BbDropdown/DropdownPipelineResolver.vue_vue_type_script_setup_true_lang.js +121 -120
- package/dist/components/BbDropdown/dropdownHandle.js +6 -0
- package/dist/components/BbDropdown/normalizeGroups.js +58 -44
- package/dist/components/BbDropdown/types.d.ts +116 -50
- package/dist/components/BbDropdown/types.js +2 -2
- package/dist/components/BbDropdownButton/BbDropdownButton.vue_vue_type_script_setup_true_lang.js +105 -104
- package/dist/components/BbDropdownButton/types.d.ts +2 -4
- package/dist/components/BbForm/BbForm.vue.d.ts +2 -1
- package/dist/components/BbForm/BbForm.vue_vue_type_script_setup_true_lang.js +240 -198
- package/dist/components/BbForm/recognizeValidation.d.ts +9 -0
- package/dist/components/BbForm/recognizeValidation.js +55 -0
- package/dist/components/BbForm/validationError.d.ts +10 -0
- package/dist/components/BbForm/validationError.js +11 -0
- package/dist/components/BbNumberInput/types.d.ts +2 -4
- package/dist/components/BbOffCanvas/BbOffCanvas.vue.d.ts +3 -0
- package/dist/components/BbOffCanvas/BbOffCanvas.vue_vue_type_script_setup_true_lang.js +414 -389
- package/dist/components/BbOffCanvas/sheetAttrs.js +5 -5
- package/dist/components/BbOffCanvas/types.d.ts +24 -0
- package/dist/components/BbPagination/BbPagination.vue_vue_type_script_setup_true_lang.js +3 -3
- package/dist/components/BbRadio/types.d.ts +2 -4
- package/dist/components/BbRadioGroup/BbRadioGroup.vue.d.ts +10 -4
- package/dist/components/BbRadioGroup/BbRadioGroup.vue_vue_type_script_setup_true_lang.js +173 -157
- package/dist/components/BbRadioGroup/types.d.ts +11 -7
- package/dist/components/BbRating/BbRating.vue_vue_type_script_setup_true_lang.js +126 -119
- package/dist/components/BbRating/types.d.ts +5 -6
- package/dist/components/BbSelect/BbSelect.vue.d.ts +17 -10
- package/dist/components/BbSelect/BbSelect.vue_vue_type_script_setup_true_lang.js +3 -1
- package/dist/components/BbSelect/types.d.ts +12 -6
- package/dist/components/BbSelectPopover/BbSelectPopover.vue.d.ts +11 -4
- package/dist/components/BbSelectPopover/BbSelectPopover.vue_vue_type_script_setup_true_lang.js +513 -502
- package/dist/components/BbSelectPopover/types.d.ts +10 -2
- package/dist/components/BbSlider/types.d.ts +2 -4
- package/dist/components/BbSwitch/BbSwitch.vue.d.ts +2 -0
- package/dist/components/BbSwitch/BbSwitch.vue_vue_type_script_setup_true_lang.js +85 -73
- package/dist/components/BbSwitchGroup/BbSwitchGroup.vue.d.ts +10 -4
- package/dist/components/BbSwitchGroup/BbSwitchGroup.vue_vue_type_script_setup_true_lang.js +171 -152
- package/dist/components/BbSwitchGroup/types.d.ts +1 -1
- package/dist/components/BbTable/BbTable.vue.d.ts +36 -25
- package/dist/components/BbTable/BbTable.vue_vue_type_script_setup_true_lang.js +1338 -1215
- package/dist/components/BbTable/BbTableDataRow.js +2 -1
- package/dist/components/BbTable/BbTableRowMenu.js +36 -0
- package/dist/components/BbTable/types.d.ts +33 -18
- package/dist/components/BbTabs/BbTabsList.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/components/BbTabs/types.d.ts +6 -0
- package/dist/components/BbTag/types.d.ts +2 -4
- package/dist/components/BbTextInput/BbTextInput.vue.d.ts +1 -1
- package/dist/components/BbTextInput/types.d.ts +2 -4
- package/dist/components/BbTextarea/BbTextarea.vue.d.ts +1 -1
- package/dist/components/BbTextarea/types.d.ts +2 -4
- package/dist/components/BbTimePickerInput/BbTimePickerInput.vue.d.ts +1 -1
- package/dist/components/BbTimePickerInput/types.d.ts +2 -4
- package/dist/components/BbToast/BbToastMessage.vue_vue_type_script_setup_true_lang.js +88 -94
- package/dist/components/BbTooltip/ptKeys.generated.d.ts +4 -4
- package/dist/components/BbTooltip/types.d.ts +3 -1
- package/dist/components/BbTree/BbTree.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/BbTree/BbTreeLevel.vue_vue_type_script_setup_true_lang.js +9 -9
- package/dist/components/BbTree/types.d.ts +8 -2
- package/dist/components/CommonField/types.d.ts +2 -4
- package/dist/components/CommonFieldInput/CommonFieldInput.vue_vue_type_script_setup_true_lang.js +39 -39
- package/dist/composables/formSubmitLock.js +15 -8
- package/dist/composables/overlayRegistry.d.ts +5 -0
- package/dist/composables/overlayRegistry.js +154 -148
- package/dist/composables/useBbDropdown.d.ts +8 -0
- package/dist/composables/useBbDropdown.js +3 -1
- package/dist/composables/useBbTabs.js +138 -138
- package/dist/composables/useChoiceIndicator.js +67 -64
- package/dist/composables/useConfirm.d.ts +63 -52
- package/dist/composables/useConfirm.js +22 -18
- package/dist/deprecation/ai-deprecations.json.js +1 -1
- package/dist/directives/bbDropdown.d.ts +7 -7
- package/dist/directives/bbDropdown.js +22 -15
- package/dist/directives/bbTooltip.d.ts +3 -3
- package/dist/directives/createPopoverDirective.js +57 -35
- package/dist/i18n/locales/ar.json +5 -1
- package/dist/i18n/locales/cs.json +5 -1
- package/dist/i18n/locales/da.json +5 -1
- package/dist/i18n/locales/de-CH.json +5 -1
- package/dist/i18n/locales/de.json +5 -1
- package/dist/i18n/locales/el.json +5 -1
- package/dist/i18n/locales/en-GB.json +5 -1
- package/dist/i18n/locales/en.json +5 -1
- package/dist/i18n/locales/es-MX.json +5 -1
- package/dist/i18n/locales/es.json +5 -1
- package/dist/i18n/locales/fa.json +5 -1
- package/dist/i18n/locales/fi.json +5 -1
- package/dist/i18n/locales/fr.json +5 -1
- package/dist/i18n/locales/he.json +5 -1
- package/dist/i18n/locales/hu.json +5 -1
- package/dist/i18n/locales/it.json +5 -1
- package/dist/i18n/locales/ja.json +5 -1
- package/dist/i18n/locales/ko.json +5 -1
- package/dist/i18n/locales/nb.json +5 -1
- package/dist/i18n/locales/nl.json +5 -1
- package/dist/i18n/locales/pl.json +5 -1
- package/dist/i18n/locales/pt-BR.json +5 -1
- package/dist/i18n/locales/pt-PT.json +5 -1
- package/dist/i18n/locales/ro.json +5 -1
- package/dist/i18n/locales/ru.json +5 -1
- package/dist/i18n/locales/sv.json +5 -1
- package/dist/i18n/locales/tr.json +5 -1
- package/dist/i18n/locales/uk.json +5 -1
- package/dist/i18n/locales/zh-CN.json +5 -1
- package/dist/i18n/locales/zh-HK.json +5 -1
- package/dist/i18n/locales/zh-TW.json +5 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +4 -3
- package/dist/llms-full.txt +2216 -1332
- package/dist/llms-medium.txt +21 -18
- package/dist/llms.txt +2 -2
- package/dist/locale-blueprint.json +5 -1
- package/dist/plugin.js +17 -40
- package/dist/pluginCore.js +30 -0
- package/dist/styles.css +2 -2
- package/dist/types/ActionButton.d.ts +26 -5
- package/dist/types/ActionButton.js +11 -0
- package/dist/types/ConfigDefaults.d.ts +34 -3
- package/dist/types/ConfigDefaults.js +14 -8
- package/dist/types/FieldLayout.d.ts +4 -1
- package/dist/types/ItemAccessor.d.ts +3 -1
- package/dist/types/ItemPath.d.ts +62 -0
- package/dist/types/ptComponentMap.d.ts +1 -1
- package/dist/utilities/functions/clickCount.js +14 -0
- package/dist/utils/versionCheck.js +1 -1
- package/llms.txt +2 -2
- package/package.json +16 -4
- package/scripts/README.md +35 -29
- package/scripts/lib/adoption-checklist.json +2 -2
- package/scripts/lib/define-preset-copy.mjs +1 -1
- package/scripts/lib/eslint-disable.mjs +5 -3
- package/scripts/lib/eslint-plugin.d.ts +2 -0
- package/scripts/lib/eslint-plugin.mjs +213 -1
- package/scripts/lib/redundant-item-accessor.mjs +4 -1
- package/scripts/lib/release-results.mjs +32 -1
- package/scripts/lib/renamed-item-field.mjs +4 -1
- package/scripts/lib/setup.mjs +8 -0
- package/scripts/lib/tab-links.mjs +4 -1
- package/scripts/lib/toolchain-check.mjs +125 -7
- package/scripts/lib/tree-default-expandable.mjs +53 -0
- package/scripts/lib/validate-bb-markup.mjs +537 -53
|
@@ -75,6 +75,7 @@
|
|
|
75
75
|
:passthrough="passthrough"
|
|
76
76
|
:role="hasLegend() ? 'radiogroup' : undefined"
|
|
77
77
|
:variant="variant"
|
|
78
|
+
@mousedown.capture="clicks.onPress"
|
|
78
79
|
>
|
|
79
80
|
<template #prepend>
|
|
80
81
|
<!-- The `variant` indicators: first in the list, so the
|
|
@@ -88,6 +89,9 @@
|
|
|
88
89
|
:style="indicatorStyle(box)"
|
|
89
90
|
v-bind="passthrough.indicator"
|
|
90
91
|
></span>
|
|
92
|
+
<span v-if="showClearHint" :id="clearHintId" hidden>{{
|
|
93
|
+
clearHintText
|
|
94
|
+
}}</span>
|
|
91
95
|
<slot name="prepend"></slot>
|
|
92
96
|
</template>
|
|
93
97
|
<template #loading><slot name="loading"></slot></template>
|
|
@@ -144,7 +148,17 @@
|
|
|
144
148
|
</CommonField>
|
|
145
149
|
</template>
|
|
146
150
|
|
|
147
|
-
<script
|
|
151
|
+
<script
|
|
152
|
+
setup
|
|
153
|
+
lang="ts"
|
|
154
|
+
generic="
|
|
155
|
+
const T = any,
|
|
156
|
+
A extends string | ((...args: never[]) => unknown) | undefined = undefined,
|
|
157
|
+
Tx extends string | undefined = undefined
|
|
158
|
+
"
|
|
159
|
+
>
|
|
160
|
+
import type { ItemGetter } from '@/types/ItemAccessor';
|
|
161
|
+
import type { ItemKeyInput, OptionValueOf } from '@/types/ItemPath';
|
|
148
162
|
import { useConfigDefaults } from '@/composables/useConfigDefaults';
|
|
149
163
|
import type { FallthroughAttrs } from '@/types/fallthrough';
|
|
150
164
|
import { vAutofocus } from '@/utilities/misc/autofocus';
|
|
@@ -169,9 +183,11 @@ import {
|
|
|
169
183
|
} from 'vue';
|
|
170
184
|
import type { Option } from '@/types/Option';
|
|
171
185
|
import { useId } from '@/composables/useId';
|
|
186
|
+
import { useLocale } from '@/composables/useLocale';
|
|
172
187
|
import { isNotEmpty } from '@/utilities/functions/isNotEmpty';
|
|
173
188
|
import { withItemDescribedby } from '@/utilities/functions/itemProps';
|
|
174
189
|
import { hash } from '@/utilities/functions/hash';
|
|
190
|
+
import { createClickCount } from '@/utilities/functions/clickCount';
|
|
175
191
|
import {
|
|
176
192
|
preventReadonlyClick,
|
|
177
193
|
preventReadonlyKeydown,
|
|
@@ -209,8 +225,11 @@ defineOptions({
|
|
|
209
225
|
});
|
|
210
226
|
const declaredProps = withDefaults(
|
|
211
227
|
defineProps<
|
|
212
|
-
BbRadioGroupProps<T> &
|
|
213
|
-
|
|
228
|
+
BbRadioGroupProps<T> & /* @vue-ignore */ {
|
|
229
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- a getter returns any value; `A` reads which
|
|
230
|
+
itemValue?: ItemKeyInput<T, A> | ItemGetter<T, any>;
|
|
231
|
+
itemText?: ItemKeyInput<T, Tx> | ItemGetter<T, string>;
|
|
232
|
+
} & /* @vue-ignore */ FallthroughAttrs<
|
|
214
233
|
'div',
|
|
215
234
|
BbRadioGroupProps<T>,
|
|
216
235
|
BbRadioGroupEvents
|
|
@@ -229,7 +248,7 @@ const declaredProps = withDefaults(
|
|
|
229
248
|
block: undefined,
|
|
230
249
|
}
|
|
231
250
|
);
|
|
232
|
-
const declaredEmit = defineEmits<BbRadioGroupEvents
|
|
251
|
+
const declaredEmit = defineEmits<BbRadioGroupEvents<OptionValueOf<T, A>>>();
|
|
233
252
|
|
|
234
253
|
const slots = defineSlots<BbRadioGroupSlots<T>>();
|
|
235
254
|
|
|
@@ -301,6 +320,17 @@ if (process.env.NODE_ENV !== 'production')
|
|
|
301
320
|
const fallbackName = useId().id;
|
|
302
321
|
const resolvedName = computed(() => props.name || fallbackName.value);
|
|
303
322
|
|
|
323
|
+
/**
|
|
324
|
+
* `clearable`: a hidden "press Space to clear" hint, last on every
|
|
325
|
+
* radio's describedby while a clear can happen (BbRating's `clearHint`).
|
|
326
|
+
*/
|
|
327
|
+
const { t } = useLocale();
|
|
328
|
+
const clearHintId = useId().id;
|
|
329
|
+
const clearHintText = t('radioGroup.clearHint');
|
|
330
|
+
const showClearHint = computed(
|
|
331
|
+
() => props.clearable && !props.disabled && !props.readonly
|
|
332
|
+
);
|
|
333
|
+
|
|
304
334
|
/**
|
|
305
335
|
* Undocumented fallbacks for props left `undefined`, applied where they are
|
|
306
336
|
* read (the manifest documents no default for them): no items, no debounce,
|
|
@@ -345,7 +375,7 @@ const {
|
|
|
345
375
|
|
|
346
376
|
const alignToCoherenceSettings = () => {
|
|
347
377
|
if (props.enforceCoherence && !coherent.value) {
|
|
348
|
-
emit('update:modelValue', null);
|
|
378
|
+
emit('update:modelValue', null as never);
|
|
349
379
|
}
|
|
350
380
|
};
|
|
351
381
|
|
|
@@ -503,6 +533,18 @@ const syncRowsToData = () => {
|
|
|
503
533
|
});
|
|
504
534
|
};
|
|
505
535
|
|
|
536
|
+
const clicks = createClickCount();
|
|
537
|
+
|
|
538
|
+
/** `clearable`: the checked row back to `null`; true when it cleared. */
|
|
539
|
+
const clearRow = (option: Option) => {
|
|
540
|
+
if (!props.clearable || props.readonly) return false;
|
|
541
|
+
if (option.disabled || !option.selected) return false;
|
|
542
|
+
emit('update:modelValue', null as never);
|
|
543
|
+
// The clicked radio stays natively checked: re-sync once the parent answered.
|
|
544
|
+
nextTick(syncRowsToData);
|
|
545
|
+
return true;
|
|
546
|
+
};
|
|
547
|
+
|
|
506
548
|
const rowListeners = (option: Option) => ({
|
|
507
549
|
onBlur: (event: FocusEvent) => {
|
|
508
550
|
rowFocus.onBlur(option.valueHash);
|
|
@@ -525,6 +567,8 @@ const rowListeners = (option: Option) => ({
|
|
|
525
567
|
onClick: (event: MouseEvent) => {
|
|
526
568
|
preventReadonlyClick(event, props.readonly);
|
|
527
569
|
emit('click', event);
|
|
570
|
+
// A double-click's second click must not undo its first.
|
|
571
|
+
if (clicks.count(event) <= 1) clearRow(option);
|
|
528
572
|
},
|
|
529
573
|
onFocus: (event: FocusEvent) => {
|
|
530
574
|
rowFocus.onFocus(option.valueHash, event);
|
|
@@ -536,6 +580,11 @@ const rowListeners = (option: Option) => ({
|
|
|
536
580
|
preventReadonlyKeydown(event, props.readonly);
|
|
537
581
|
emit('keydown', event);
|
|
538
582
|
},
|
|
583
|
+
// Chromium fires no click for Space on a checked radio, so the key clears
|
|
584
|
+
// here; preventDefault stops an engine that does fire one clearing twice.
|
|
585
|
+
onKeyup: (event: KeyboardEvent) => {
|
|
586
|
+
if (event.key === ' ' && clearRow(option)) event.preventDefault();
|
|
587
|
+
},
|
|
539
588
|
onMousedown: (event: MouseEvent) => emit('mousedown', event),
|
|
540
589
|
onMouseup: (event: MouseEvent) => emit('mouseup', event),
|
|
541
590
|
});
|
|
@@ -550,7 +599,13 @@ const rowInputAttrs = (
|
|
|
550
599
|
descriptionId: string | undefined
|
|
551
600
|
) => ({
|
|
552
601
|
...toggleInputAttrs('radio', {
|
|
553
|
-
ariaDescribedby:
|
|
602
|
+
ariaDescribedby:
|
|
603
|
+
[
|
|
604
|
+
withItemDescribedby(ariaDescribedby, descriptionId),
|
|
605
|
+
showClearHint.value ? clearHintId.value : undefined,
|
|
606
|
+
]
|
|
607
|
+
.filter(Boolean)
|
|
608
|
+
.join(' ') || undefined,
|
|
554
609
|
ariaLabelledby: labelId,
|
|
555
610
|
autofocus: props.autofocus && !index,
|
|
556
611
|
checked: !!option.selected,
|
|
@@ -699,6 +754,12 @@ export type BbRadioGroupProps<T> = BbRadioGroupPtProps & {
|
|
|
699
754
|
*/
|
|
700
755
|
autofocus?: InputHTMLAttributes['autofocus'];
|
|
701
756
|
|
|
757
|
+
/**
|
|
758
|
+
* Clicking the checked option (or Space on it) clears the value to `null`.
|
|
759
|
+
* Off: a radio group can't be emptied.
|
|
760
|
+
*/
|
|
761
|
+
clearable?: boolean;
|
|
762
|
+
|
|
702
763
|
/**
|
|
703
764
|
* Compact density. Swaps `--bb-label-spacing-y` for
|
|
704
765
|
* `--bb-label-spacing-y-compact`, so tune a compact group's label gap with
|
|
@@ -732,15 +793,13 @@ export type BbRadioGroupProps<T> = BbRadioGroupPtProps & {
|
|
|
732
793
|
|
|
733
794
|
/**
|
|
734
795
|
* Vertical position of the label block in a side-by-side row; not
|
|
735
|
-
* `labelPosition`, the horizontal one. Omitted,
|
|
736
|
-
* meets the control's.
|
|
796
|
+
* `labelPosition`, the horizontal one. Omitted, `'top'`.
|
|
737
797
|
*/
|
|
738
798
|
labelAlign?: FieldCrossAlign;
|
|
739
799
|
|
|
740
800
|
/**
|
|
741
801
|
* Vertical position of the control in a side-by-side row; not
|
|
742
|
-
* `inputPosition`, the horizontal one. Omitted,
|
|
743
|
-
* meets the label's.
|
|
802
|
+
* `inputPosition`, the horizontal one. Omitted, `'top'`.
|
|
744
803
|
*/
|
|
745
804
|
inputAlign?: FieldCrossAlign;
|
|
746
805
|
|
|
@@ -988,7 +1047,8 @@ export type BbRadioGroupProps<T> = BbRadioGroupPtProps & {
|
|
|
988
1047
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- `rules` take the model's type (see `modelValue`), so a rule annotated with the app's value type fits
|
|
989
1048
|
} & FormFieldProps<any>;
|
|
990
1049
|
|
|
991
|
-
|
|
1050
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- untyped unless the component supplies the value
|
|
1051
|
+
export type BbRadioGroupEvents<V = any> = {
|
|
992
1052
|
/**
|
|
993
1053
|
* Emitted when one of the generated radio inputs loses focus.
|
|
994
1054
|
* Forwards the original DOM `FocusEvent`.
|
|
@@ -1037,10 +1097,10 @@ export type BbRadioGroupEvents = {
|
|
|
1037
1097
|
*/
|
|
1038
1098
|
(e: 'mouseup', event: MouseEvent): void;
|
|
1039
1099
|
/**
|
|
1040
|
-
* Emitted with the newly selected value when the selection changes
|
|
1100
|
+
* Emitted with the newly selected value when the selection changes; `null`
|
|
1101
|
+
* when a `clearable` group is cleared.
|
|
1041
1102
|
*/
|
|
1042
|
-
|
|
1043
|
-
(e: 'update:modelValue', value: any): void;
|
|
1103
|
+
(e: 'update:modelValue', value: V): void;
|
|
1044
1104
|
};
|
|
1045
1105
|
|
|
1046
1106
|
/**
|
|
@@ -31,7 +31,6 @@
|
|
|
31
31
|
:reverse="configDefaults.reverse"
|
|
32
32
|
:show-asterisk="showAsterisk"
|
|
33
33
|
:show-hint="showHint"
|
|
34
|
-
:style="rootStyle"
|
|
35
34
|
tag="fieldset"
|
|
36
35
|
:warnings="warnings"
|
|
37
36
|
v-bind="passthrough.forwardAttrs"
|
|
@@ -64,6 +63,7 @@
|
|
|
64
63
|
}"
|
|
65
64
|
data-bb-no-drag
|
|
66
65
|
:style="starsStyle"
|
|
66
|
+
@mousedown.capture="clicks.onPress"
|
|
67
67
|
@pointermove="onContainerPointerMove"
|
|
68
68
|
>
|
|
69
69
|
<span
|
|
@@ -156,6 +156,7 @@ import { useOnFalsy } from '@/composables/useOnFalsy';
|
|
|
156
156
|
import { useOnTruthy } from '@/composables/useOnTruthy';
|
|
157
157
|
import { removedPropsFor } from '@/deprecation/removedProps';
|
|
158
158
|
import { parseSize } from '@/utilities/functions/parseSize';
|
|
159
|
+
import { createClickCount } from '@/utilities/functions/clickCount';
|
|
159
160
|
import type { CssSize } from '@/types/CommonProps';
|
|
160
161
|
import { warnRemovedAttrs } from '@/utilities/functions/warnRemovedAttrs';
|
|
161
162
|
import { computed, ref, useAttrs, useTemplateRef } from 'vue';
|
|
@@ -333,20 +334,35 @@ const onInputChange = (event: Event) => {
|
|
|
333
334
|
}
|
|
334
335
|
};
|
|
335
336
|
|
|
337
|
+
const clicks = createClickCount();
|
|
338
|
+
|
|
339
|
+
/** `clearable`: the selected star back to `null`; true when it cleared. */
|
|
340
|
+
const clearStar = (event: Event) => {
|
|
341
|
+
if (props.readonly || !props.clearable) return false;
|
|
342
|
+
const input = event.target;
|
|
343
|
+
if (!(input instanceof HTMLInputElement) || !input.checked) return false;
|
|
344
|
+
if (+input.value !== props.modelValue) return false;
|
|
345
|
+
suppressHoverPreview.value = true;
|
|
346
|
+
emit('update:modelValue', null);
|
|
347
|
+
return true;
|
|
348
|
+
};
|
|
349
|
+
|
|
336
350
|
const onInputClick = (event: MouseEvent) => {
|
|
337
351
|
if (props.readonly) {
|
|
338
352
|
event.preventDefault();
|
|
339
353
|
}
|
|
340
354
|
emit('click', event);
|
|
341
|
-
|
|
342
|
-
if (event
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
355
|
+
// A double-click's second click must not undo its first.
|
|
356
|
+
if (clicks.count(event) <= 1) clearStar(event);
|
|
357
|
+
};
|
|
358
|
+
|
|
359
|
+
/**
|
|
360
|
+
* Space on the selected star clears. Chromium fires no click for
|
|
361
|
+
* Space on a checked radio, so the key clears here; preventDefault stops an
|
|
362
|
+
* engine that does fire one from clearing twice.
|
|
363
|
+
*/
|
|
364
|
+
const onInputKeyup = (event: KeyboardEvent) => {
|
|
365
|
+
if (event.key === ' ' && clearStar(event)) event.preventDefault();
|
|
350
366
|
};
|
|
351
367
|
|
|
352
368
|
const onContainerPointerMove = () => {
|
|
@@ -364,17 +380,6 @@ const eventListeners = {
|
|
|
364
380
|
},
|
|
365
381
|
onInput: (event: Event) => emit('input', event),
|
|
366
382
|
onKeydown: (event: KeyboardEvent) => {
|
|
367
|
-
if (
|
|
368
|
-
!props.readonly &&
|
|
369
|
-
props.clearable &&
|
|
370
|
-
['Delete', 'Backspace'].includes(event.key) &&
|
|
371
|
-
event.target instanceof HTMLInputElement &&
|
|
372
|
-
+event.target.value === props.modelValue
|
|
373
|
-
) {
|
|
374
|
-
event.preventDefault();
|
|
375
|
-
emit('update:modelValue', null);
|
|
376
|
-
}
|
|
377
|
-
|
|
378
383
|
if (
|
|
379
384
|
props.readonly &&
|
|
380
385
|
[
|
|
@@ -395,6 +400,7 @@ const eventListeners = {
|
|
|
395
400
|
}
|
|
396
401
|
emit('keydown', event);
|
|
397
402
|
},
|
|
403
|
+
onKeyup: onInputKeyup,
|
|
398
404
|
onMousedown: (event: MouseEvent) => emit('mousedown', event),
|
|
399
405
|
onMouseup: (event: MouseEvent) => emit('mouseup', event),
|
|
400
406
|
};
|
|
@@ -440,15 +446,6 @@ const options = computed(() => {
|
|
|
440
446
|
);
|
|
441
447
|
});
|
|
442
448
|
|
|
443
|
-
/**
|
|
444
|
-
* The star size again on the field root, as `--star`: the label lines its
|
|
445
|
-
* first line up with the stars from there, and the label cannot read
|
|
446
|
-
* a variable declared further down, on `__stars`.
|
|
447
|
-
*/
|
|
448
|
-
const rootStyle = computed(() =>
|
|
449
|
-
parsedSize.value ? { '--star': parsedSize.value } : undefined
|
|
450
|
-
);
|
|
451
|
-
|
|
452
449
|
/** `--size` from the `size` prop, on the `__stars` span that declares it. */
|
|
453
450
|
const starsStyle = computed(() => {
|
|
454
451
|
const style: Record<string, string> = {};
|
|
@@ -594,7 +591,7 @@ export type BbRatingProps = BbRatingPtProps & {
|
|
|
594
591
|
disabled?: boolean;
|
|
595
592
|
|
|
596
593
|
/**
|
|
597
|
-
* Allows clearing the selected rating
|
|
594
|
+
* Allows clearing the selected rating: click the selected star, or Space on it.
|
|
598
595
|
* @defaultValue `false`
|
|
599
596
|
*/
|
|
600
597
|
clearable?: boolean;
|
|
@@ -608,15 +605,13 @@ export type BbRatingProps = BbRatingPtProps & {
|
|
|
608
605
|
|
|
609
606
|
/**
|
|
610
607
|
* Vertical position of the label block in a side-by-side row; not
|
|
611
|
-
* `labelPosition`, the horizontal one. Omitted,
|
|
612
|
-
* meets the control's.
|
|
608
|
+
* `labelPosition`, the horizontal one. Omitted, `'top'`.
|
|
613
609
|
*/
|
|
614
610
|
labelAlign?: FieldCrossAlign;
|
|
615
611
|
|
|
616
612
|
/**
|
|
617
613
|
* Vertical position of the control in a side-by-side row; not
|
|
618
|
-
* `inputPosition`, the horizontal one. Omitted,
|
|
619
|
-
* meets the label's.
|
|
614
|
+
* `inputPosition`, the horizontal one. Omitted, `'top'`.
|
|
620
615
|
*/
|
|
621
616
|
inputAlign?: FieldCrossAlign;
|
|
622
617
|
|
|
@@ -777,7 +772,8 @@ export type BbRatingEvents = {
|
|
|
777
772
|
(e: 'mouseup', event: MouseEvent): void;
|
|
778
773
|
/**
|
|
779
774
|
* Emitted with the selected rating (1 to `stars`) when clicked. Emits `null`
|
|
780
|
-
* only when `clearable` is enabled and the already-selected star is clicked
|
|
775
|
+
* only when `clearable` is enabled and the already-selected star is clicked
|
|
776
|
+
* (or gets Space).
|
|
781
777
|
*/
|
|
782
778
|
(e: 'update:modelValue', value: number | null): void;
|
|
783
779
|
};
|
|
@@ -77,6 +77,7 @@
|
|
|
77
77
|
:loading="loading"
|
|
78
78
|
:loading-text="loadingText"
|
|
79
79
|
:max="max"
|
|
80
|
+
:min-query-length="minQueryLength"
|
|
80
81
|
:model-value="fieldModel"
|
|
81
82
|
:model-value-debounce-time="modelValueDebounceTime"
|
|
82
83
|
:multiple="multiple"
|
|
@@ -325,7 +326,13 @@
|
|
|
325
326
|
<script
|
|
326
327
|
setup
|
|
327
328
|
lang="ts"
|
|
328
|
-
generic="
|
|
329
|
+
generic="
|
|
330
|
+
const T = any,
|
|
331
|
+
Known extends BbSelectKnownItems | undefined = undefined,
|
|
332
|
+
A extends string | ((...args: never[]) => unknown) | undefined = undefined,
|
|
333
|
+
Tx extends string | undefined = undefined,
|
|
334
|
+
M extends boolean = false
|
|
335
|
+
"
|
|
329
336
|
>
|
|
330
337
|
import type { ControlAttrs, FallthroughAttrs } from '@/types/fallthrough';
|
|
331
338
|
import { vAutofocus } from '@/utilities/misc/autofocus';
|
|
@@ -344,6 +351,13 @@ import CommonField from '../CommonField/CommonField.vue';
|
|
|
344
351
|
import CommonFieldInput from '../CommonFieldInput/CommonFieldInput.vue';
|
|
345
352
|
import BbBadge from '../BbBadge/BbBadge.vue';
|
|
346
353
|
import BbSelectPopover from '../BbSelectPopover/BbSelectPopover.vue';
|
|
354
|
+
import type { ItemGetter } from '@/types/ItemAccessor';
|
|
355
|
+
import type {
|
|
356
|
+
ItemKeyInput,
|
|
357
|
+
MultipleInput,
|
|
358
|
+
OptionValueOf,
|
|
359
|
+
SelectModelOf,
|
|
360
|
+
} from '@/types/ItemPath';
|
|
347
361
|
import {
|
|
348
362
|
BB_SELECT_POPOVER_PT,
|
|
349
363
|
type BbSelectKnownItems,
|
|
@@ -391,8 +405,12 @@ defineOptions({
|
|
|
391
405
|
});
|
|
392
406
|
const declaredProps = withDefaults(
|
|
393
407
|
defineProps<
|
|
394
|
-
BbSelectProps<T, Known> &
|
|
395
|
-
|
|
408
|
+
BbSelectProps<T, Known> & /* @vue-ignore */ {
|
|
409
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- a getter returns any value; `A` reads which
|
|
410
|
+
itemValue?: ItemKeyInput<T, A> | ItemGetter<T, any>;
|
|
411
|
+
itemText?: ItemKeyInput<T, Tx> | ItemGetter<T, string>;
|
|
412
|
+
multiple?: MultipleInput<M>;
|
|
413
|
+
} & /* @vue-ignore */ FallthroughAttrs<
|
|
396
414
|
'div',
|
|
397
415
|
BbSelectProps<T, Known>,
|
|
398
416
|
BbSelectEvents
|
|
@@ -432,7 +450,8 @@ const declaredProps = withDefaults(
|
|
|
432
450
|
}
|
|
433
451
|
);
|
|
434
452
|
|
|
435
|
-
const declaredEmit =
|
|
453
|
+
const declaredEmit =
|
|
454
|
+
defineEmits<BbSelectEvents<SelectModelOf<OptionValueOf<T, A>, M>>>();
|
|
436
455
|
|
|
437
456
|
defineSlots<BbSelectSlots<T, Known>>();
|
|
438
457
|
// Inside a BbForm the field joins it: `props` / `emit` are bound.
|
|
@@ -640,9 +659,9 @@ const onChipUnselected = (option: BbSelectResolvedOption) => {
|
|
|
640
659
|
knownItemsSource.userUnpick?.([option.value]);
|
|
641
660
|
if (props.multiple) {
|
|
642
661
|
const valueToEmit = reject(props.modelValue, option.value);
|
|
643
|
-
emit('update:modelValue', valueToEmit);
|
|
662
|
+
emit('update:modelValue', valueToEmit as never);
|
|
644
663
|
} else {
|
|
645
|
-
emit('update:modelValue', null);
|
|
664
|
+
emit('update:modelValue', null as never);
|
|
646
665
|
}
|
|
647
666
|
};
|
|
648
667
|
|
|
@@ -1294,15 +1313,13 @@ export type BbSelectProps<
|
|
|
1294
1313
|
|
|
1295
1314
|
/**
|
|
1296
1315
|
* Vertical position of the label block in a side-by-side row; not
|
|
1297
|
-
* `labelPosition`, the horizontal one. Omitted,
|
|
1298
|
-
* meets the control's.
|
|
1316
|
+
* `labelPosition`, the horizontal one. Omitted, `'top'`.
|
|
1299
1317
|
*/
|
|
1300
1318
|
labelAlign?: FieldCrossAlign;
|
|
1301
1319
|
|
|
1302
1320
|
/**
|
|
1303
1321
|
* Vertical position of the control in a side-by-side row; not
|
|
1304
|
-
* `inputPosition`, the horizontal one. Omitted,
|
|
1305
|
-
* meets the label's.
|
|
1322
|
+
* `inputPosition`, the horizontal one. Omitted, `'top'`.
|
|
1306
1323
|
*/
|
|
1307
1324
|
inputAlign?: FieldCrossAlign;
|
|
1308
1325
|
|
|
@@ -1482,6 +1499,15 @@ export type BbSelectProps<
|
|
|
1482
1499
|
*/
|
|
1483
1500
|
maxSelectedLabels?: number;
|
|
1484
1501
|
|
|
1502
|
+
/**
|
|
1503
|
+
* Characters to type (trimmed) before the query searches. Below it the
|
|
1504
|
+
* query counts as empty: no `'search'` call, no filtering, and the panel
|
|
1505
|
+
* says how many characters to type. Slots still get the typed `query`.
|
|
1506
|
+
*
|
|
1507
|
+
* @defaultValue `0`
|
|
1508
|
+
*/
|
|
1509
|
+
minQueryLength?: number;
|
|
1510
|
+
|
|
1485
1511
|
/**
|
|
1486
1512
|
* Used by v-model. Can be any serializable type.
|
|
1487
1513
|
*/
|
|
@@ -1601,7 +1627,8 @@ export type BbSelectProps<
|
|
|
1601
1627
|
} & FormFieldProps<any>;
|
|
1602
1628
|
|
|
1603
1629
|
/** Re-export for consumers importing events type from BbSelect. */
|
|
1604
|
-
|
|
1630
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- untyped unless the component supplies the value
|
|
1631
|
+
export type BbSelectEvents<V = any> = {
|
|
1605
1632
|
/** Emitted as soon as the options surface starts to open (the popover, or the sheet on a phone). */
|
|
1606
1633
|
(e: 'show'): void;
|
|
1607
1634
|
/** Emitted once the options surface is open and its open transition has finished. */
|
|
@@ -1624,8 +1651,8 @@ export type BbSelectEvents = {
|
|
|
1624
1651
|
(e: 'inactive'): void;
|
|
1625
1652
|
/** Emitted on native `input` events from the search field. Forwards the DOM `Event`. */
|
|
1626
1653
|
(e: 'input', event: Event): void;
|
|
1627
|
-
|
|
1628
|
-
(e: 'update:modelValue', value:
|
|
1654
|
+
|
|
1655
|
+
(e: 'update:modelValue', value: V): void;
|
|
1629
1656
|
/**
|
|
1630
1657
|
* Emitted with the typed text when the user confirms a value that is not in
|
|
1631
1658
|
* the list (Enter in the search field). Binding it keeps the search field
|