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
|
@@ -7,13 +7,14 @@
|
|
|
7
7
|
```vue
|
|
8
8
|
<template>
|
|
9
9
|
<slot
|
|
10
|
-
v-if="!hasExternalActivator"
|
|
10
|
+
v-if="!hasExternalActivator && showsActivator"
|
|
11
11
|
name="activator"
|
|
12
12
|
v-bind="{
|
|
13
13
|
props: {
|
|
14
14
|
ref: setActivatorRef,
|
|
15
15
|
},
|
|
16
16
|
disabled,
|
|
17
|
+
empty,
|
|
17
18
|
loading: anyLoading,
|
|
18
19
|
open,
|
|
19
20
|
placement,
|
|
@@ -121,6 +122,7 @@ import {
|
|
|
121
122
|
mergeProps,
|
|
122
123
|
onBeforeUnmount,
|
|
123
124
|
onDeactivated,
|
|
125
|
+
onMounted,
|
|
124
126
|
reactive,
|
|
125
127
|
ref,
|
|
126
128
|
useSlots,
|
|
@@ -147,6 +149,8 @@ import {
|
|
|
147
149
|
useConfigSetting,
|
|
148
150
|
} from '@/composables/useConfigDefaults';
|
|
149
151
|
import { wait } from '@/utilities/functions/wait';
|
|
152
|
+
import type { VirtualAnchor } from '@/types/CommonProps';
|
|
153
|
+
import { registerDropdownHandle } from './dropdownHandle';
|
|
150
154
|
import { focusQuietly } from '@/utils/focusVisibility';
|
|
151
155
|
import CommonPopover from '../CommonPopover/CommonPopover.vue';
|
|
152
156
|
import type { CommonPopoverAvailableSpace } from '../CommonPopover/types';
|
|
@@ -174,7 +178,12 @@ import {
|
|
|
174
178
|
type DropdownGroupDescriptor,
|
|
175
179
|
type DropdownGroupRequest,
|
|
176
180
|
} from './useDropdownGroupRegistry';
|
|
177
|
-
import {
|
|
181
|
+
import {
|
|
182
|
+
groupItemsAsArray,
|
|
183
|
+
isGroup,
|
|
184
|
+
isPrimitiveRow,
|
|
185
|
+
isSelectableGroup,
|
|
186
|
+
} from './types';
|
|
178
187
|
import type {
|
|
179
188
|
BbDropdownProps,
|
|
180
189
|
BbDropdownEvents,
|
|
@@ -182,7 +191,7 @@ import type {
|
|
|
182
191
|
InternalGroup,
|
|
183
192
|
InternalItem,
|
|
184
193
|
KeyedItem,
|
|
185
|
-
|
|
194
|
+
ItemEntry,
|
|
186
195
|
MappedItem,
|
|
187
196
|
NormalizedGroup,
|
|
188
197
|
DropdownTrigger,
|
|
@@ -434,7 +443,7 @@ const createVirtualElement = (x: number, y: number) => {
|
|
|
434
443
|
};
|
|
435
444
|
};
|
|
436
445
|
|
|
437
|
-
const cursorAnchor = ref<
|
|
446
|
+
const cursorAnchor = ref<VirtualAnchor | null>(null);
|
|
438
447
|
|
|
439
448
|
/**
|
|
440
449
|
* What the panel positions against: the `anchor` prop when given (so the menu can
|
|
@@ -513,10 +522,11 @@ const requestChange = (key: string, change: DropdownGroupRequest) =>
|
|
|
513
522
|
controllers.get(key)?.request(change);
|
|
514
523
|
|
|
515
524
|
const findGroupById = (
|
|
516
|
-
items:
|
|
525
|
+
items: ItemEntry[],
|
|
517
526
|
groupId: string
|
|
518
527
|
): InternalGroup | undefined => {
|
|
519
528
|
for (const entry of items) {
|
|
529
|
+
if (isPrimitiveRow(entry)) continue;
|
|
520
530
|
if (isGroup(entry)) {
|
|
521
531
|
if (entry.id === groupId) return entry;
|
|
522
532
|
for (const child of groupItemsAsArray(entry.items)) {
|
|
@@ -552,10 +562,14 @@ const findGroupById = (
|
|
|
552
562
|
* doesn't exist at all", so the thrown error can name the real problem.
|
|
553
563
|
*/
|
|
554
564
|
const findEntryKindById = (
|
|
555
|
-
items:
|
|
565
|
+
items: ItemEntry[],
|
|
556
566
|
key: string
|
|
557
567
|
): 'group' | 'item' | undefined => {
|
|
558
568
|
for (const entry of items) {
|
|
569
|
+
if (isPrimitiveRow(entry)) {
|
|
570
|
+
if (entry === key) return 'item';
|
|
571
|
+
continue;
|
|
572
|
+
}
|
|
559
573
|
if (Array.isArray(entry)) {
|
|
560
574
|
const found = findEntryKindById(entry, key);
|
|
561
575
|
if (found) return found;
|
|
@@ -601,23 +615,26 @@ const companionGroups = computed<DropdownGroupDescriptor[]>(() =>
|
|
|
601
615
|
const mergeCompanionGroup = (
|
|
602
616
|
inline: InternalGroup,
|
|
603
617
|
companion: Partial<InternalGroup>
|
|
604
|
-
): InternalGroup =>
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
618
|
+
): InternalGroup =>
|
|
619
|
+
({
|
|
620
|
+
...inline,
|
|
621
|
+
group: true,
|
|
622
|
+
id: inline.id,
|
|
623
|
+
// Propagate the raw values; the selectable/non-selectable decision is made
|
|
624
|
+
// once in `normalizeGroups` (a group is selectable only when `selectable` or
|
|
625
|
+
// `multiple` is explicitly set).
|
|
626
|
+
selectable: companion.selectable ?? inline.selectable,
|
|
627
|
+
multiple: companion.multiple ?? inline.multiple,
|
|
628
|
+
label: companion.label ?? inline.label,
|
|
629
|
+
hideLabel: companion.hideLabel ?? inline.hideLabel,
|
|
630
|
+
hidden: companion.hidden ?? inline.hidden,
|
|
631
|
+
items: companion.items ?? inline.items,
|
|
632
|
+
'prepend:icon': companion['prepend:icon'] ?? inline['prepend:icon'],
|
|
633
|
+
'append:icon': companion['append:icon'] ?? inline['append:icon'],
|
|
634
|
+
variant: companion.variant ?? inline.variant,
|
|
635
|
+
onClick: companion.onClick ?? inline.onClick,
|
|
636
|
+
// The merged `items` / `searchable` pair is checked where each side was written.
|
|
637
|
+
}) as InternalGroup;
|
|
621
638
|
|
|
622
639
|
const toGroupFromCompanion = (
|
|
623
640
|
companion: DropdownGroupDescriptor,
|
|
@@ -628,6 +645,7 @@ const toGroupFromCompanion = (
|
|
|
628
645
|
id: companion.key,
|
|
629
646
|
label: companion.label ?? baseline?.label,
|
|
630
647
|
hideLabel: companion.hideLabel ?? baseline?.hideLabel,
|
|
648
|
+
hidden: companion.hidden ?? baseline?.hidden,
|
|
631
649
|
items: companion.items ?? baseline?.items ?? [],
|
|
632
650
|
// Raw values only — `normalizeGroups` decides whether the group is
|
|
633
651
|
// selectable (both unset ⇒ non-selectable). No `?? true`/`?? false` here.
|
|
@@ -637,13 +655,13 @@ const toGroupFromCompanion = (
|
|
|
637
655
|
'append:icon': companion['append:icon'] ?? baseline?.['append:icon'],
|
|
638
656
|
variant: companion.variant ?? baseline?.variant,
|
|
639
657
|
onClick: companion.onClick ?? baseline?.onClick,
|
|
640
|
-
};
|
|
658
|
+
} as InternalGroup;
|
|
641
659
|
};
|
|
642
660
|
|
|
643
661
|
const applyCompanionToItems = (
|
|
644
|
-
items:
|
|
662
|
+
items: ItemEntry[],
|
|
645
663
|
group: InternalGroup
|
|
646
|
-
): { items:
|
|
664
|
+
): { items: ItemEntry[]; found: boolean } => {
|
|
647
665
|
let found = false;
|
|
648
666
|
|
|
649
667
|
const applyToItem = (item: InternalItem): InternalItem => {
|
|
@@ -679,7 +697,7 @@ const applyCompanionToItems = (
|
|
|
679
697
|
return applied.items;
|
|
680
698
|
}
|
|
681
699
|
|
|
682
|
-
return applyToItem(entry);
|
|
700
|
+
return isPrimitiveRow(entry) ? entry : applyToItem(entry);
|
|
683
701
|
});
|
|
684
702
|
|
|
685
703
|
return { items: nextItems, found };
|
|
@@ -690,8 +708,8 @@ const applyCompanionToItems = (
|
|
|
690
708
|
* inline group sharing its `id` (inheriting any fields it doesn't declare),
|
|
691
709
|
* otherwise it is appended.
|
|
692
710
|
*/
|
|
693
|
-
const mergedItems = computed<
|
|
694
|
-
let base:
|
|
711
|
+
const mergedItems = computed<ItemEntry[]>(() => {
|
|
712
|
+
let base: ItemEntry[] = [...(props.items ?? [])];
|
|
695
713
|
|
|
696
714
|
for (const companion of companionGroups.value) {
|
|
697
715
|
const baseline = findGroupById(base, companion.key);
|
|
@@ -807,8 +825,12 @@ const isPipelineGroup = (group: InternalGroup) =>
|
|
|
807
825
|
group.max != null;
|
|
808
826
|
|
|
809
827
|
/** Ids of every pipeline group declared in `items`, at any nesting depth. */
|
|
810
|
-
const collectPipelineKeys = (
|
|
828
|
+
const collectPipelineKeys = (
|
|
829
|
+
items: ItemEntry[],
|
|
830
|
+
acc: string[] = []
|
|
831
|
+
): string[] => {
|
|
811
832
|
for (const entry of items) {
|
|
833
|
+
if (isPrimitiveRow(entry)) continue;
|
|
812
834
|
if (isGroup(entry)) {
|
|
813
835
|
if (entry.id && isPipelineGroup(entry)) acc.push(entry.id);
|
|
814
836
|
for (const child of groupItemsAsArray(entry.items)) {
|
|
@@ -898,7 +920,7 @@ const groupFlagsFor = (key: string) => {
|
|
|
898
920
|
|
|
899
921
|
/** A normalized group (with resolved items) by id at any nesting depth. */
|
|
900
922
|
const findRenderGroupDeep = (key: string): NormalizedGroup | undefined => {
|
|
901
|
-
const walk = (items:
|
|
923
|
+
const walk = (items: ItemEntry[]): NormalizedGroup | undefined => {
|
|
902
924
|
for (const group of normalizeGroups(items)) {
|
|
903
925
|
if (group.id === key) return group;
|
|
904
926
|
for (const item of group.items) {
|
|
@@ -1004,11 +1026,116 @@ provideDropdownGroupRegistry({
|
|
|
1004
1026
|
multipleFor: (key) => groupFlagsFor(key)?.multiple,
|
|
1005
1027
|
});
|
|
1006
1028
|
|
|
1029
|
+
// --- no visible row ----------------------------
|
|
1030
|
+
|
|
1031
|
+
/**
|
|
1032
|
+
* Whether a pipeline group has not handed its rows over yet: its resolver
|
|
1033
|
+
* mounts as a child, so on the first render (the server's only one) the
|
|
1034
|
+
* group is still a getter. Unknown is not empty.
|
|
1035
|
+
*/
|
|
1036
|
+
/**
|
|
1037
|
+
* `<BbDropdownGroup>` companions register from the default slot, which renders
|
|
1038
|
+
* after the activator: until mount (on the server, for good) the groups they
|
|
1039
|
+
* bring are not known yet.
|
|
1040
|
+
*/
|
|
1041
|
+
const companionsPending = ref(!!useSlots().default);
|
|
1042
|
+
onMounted(() => (companionsPending.value = false));
|
|
1043
|
+
|
|
1044
|
+
const pipelinePending = computed(() =>
|
|
1045
|
+
pipelineGroupKeys.value.some(
|
|
1046
|
+
(key) =>
|
|
1047
|
+
!companionGroups.value.some(
|
|
1048
|
+
(group) => group.key === key && Array.isArray(group.items)
|
|
1049
|
+
)
|
|
1050
|
+
)
|
|
1051
|
+
);
|
|
1052
|
+
|
|
1053
|
+
/**
|
|
1054
|
+
* No visible row: the render groups (every `hidden` row, companion group and
|
|
1055
|
+
* fetched row already dropped) hold none. A group still loading or fetched
|
|
1056
|
+
* to nothing shows a placeholder row, so it is not empty; neither is a search
|
|
1057
|
+
* that matches nothing.
|
|
1058
|
+
*/
|
|
1059
|
+
const empty = computed(
|
|
1060
|
+
() =>
|
|
1061
|
+
!companionsPending.value &&
|
|
1062
|
+
!pipelinePending.value &&
|
|
1063
|
+
!normalizedGroups.value.length
|
|
1064
|
+
);
|
|
1065
|
+
|
|
1066
|
+
/** A `contextMenu` trigger is a surface (a row, a card), never hidden. */
|
|
1067
|
+
const keepsActivator = computed(
|
|
1068
|
+
() => !!props.keepActivator || triggers.value.has('contextMenu')
|
|
1069
|
+
);
|
|
1070
|
+
|
|
1071
|
+
/**
|
|
1072
|
+
* The trigger held focus when the menu emptied: it stays, inert, until it
|
|
1073
|
+
* loses focus, so the keyboard user is not dropped onto the page.
|
|
1074
|
+
*/
|
|
1075
|
+
const heldForFocus = ref(false);
|
|
1076
|
+
|
|
1077
|
+
/** Whether the trigger shows (the slot renders, an external one is not hidden). */
|
|
1078
|
+
const showsActivator = computed(
|
|
1079
|
+
() => !empty.value || keepsActivator.value || heldForFocus.value
|
|
1080
|
+
);
|
|
1081
|
+
|
|
1082
|
+
watch(empty, (isEmpty) => {
|
|
1083
|
+
if (!isEmpty) {
|
|
1084
|
+
heldForFocus.value = false;
|
|
1085
|
+
return;
|
|
1086
|
+
}
|
|
1087
|
+
if (open.value) {
|
|
1088
|
+
const focusInPanel = !!document.activeElement?.closest(
|
|
1089
|
+
`[data-bb-dropdown-surface="${CSS.escape(id)}"]`
|
|
1090
|
+
);
|
|
1091
|
+
void closeDropdown();
|
|
1092
|
+
if (focusInPanel) focusActivator();
|
|
1093
|
+
}
|
|
1094
|
+
const el = activatorDom.value;
|
|
1095
|
+
if (keepsActivator.value || !(el instanceof HTMLElement)) return;
|
|
1096
|
+
if (!el.contains(document.activeElement)) return;
|
|
1097
|
+
heldForFocus.value = true;
|
|
1098
|
+
const release = (event: FocusEvent) => {
|
|
1099
|
+
if (el.contains(event.relatedTarget as Node | null)) return;
|
|
1100
|
+
el.removeEventListener('focusout', release);
|
|
1101
|
+
heldForFocus.value = false;
|
|
1102
|
+
};
|
|
1103
|
+
el.addEventListener('focusout', release);
|
|
1104
|
+
});
|
|
1105
|
+
|
|
1106
|
+
/**
|
|
1107
|
+
* An external activator (the `activator` prop, `v-bb-dropdown`) is the app's
|
|
1108
|
+
* element: hidden with an inline `display: none`, the way its id and ARIA are
|
|
1109
|
+
* stamped, and given back its own inline `display` when rows return or the
|
|
1110
|
+
* dropdown goes.
|
|
1111
|
+
*/
|
|
1112
|
+
watch(
|
|
1113
|
+
[activator, () => hasExternalActivator.value && !showsActivator.value],
|
|
1114
|
+
([el, hide], _, onCleanup) => {
|
|
1115
|
+
if (!hide || !el) return;
|
|
1116
|
+
const { style } = el as HTMLElement;
|
|
1117
|
+
if (!style) return;
|
|
1118
|
+
const before = style.getPropertyValue('display');
|
|
1119
|
+
const priority = style.getPropertyPriority('display');
|
|
1120
|
+
style.setProperty('display', 'none');
|
|
1121
|
+
onCleanup(() => {
|
|
1122
|
+
if (style.getPropertyValue('display') !== 'none') return;
|
|
1123
|
+
if (before) style.setProperty('display', before, priority);
|
|
1124
|
+
else style.removeProperty('display');
|
|
1125
|
+
});
|
|
1126
|
+
},
|
|
1127
|
+
{ immediate: true }
|
|
1128
|
+
);
|
|
1129
|
+
|
|
1007
1130
|
// --- public read-only context (`useBbDropdown`) -------------------
|
|
1008
1131
|
|
|
1009
1132
|
/** Ids of every selectable group declared in `items`, at any nesting depth. */
|
|
1010
|
-
const collectSelectableKeys = (
|
|
1133
|
+
const collectSelectableKeys = (
|
|
1134
|
+
items: ItemEntry[],
|
|
1135
|
+
acc: string[] = []
|
|
1136
|
+
): string[] => {
|
|
1011
1137
|
for (const entry of items) {
|
|
1138
|
+
if (isPrimitiveRow(entry)) continue;
|
|
1012
1139
|
if (isGroup(entry)) {
|
|
1013
1140
|
if (entry.id && isSelectableGroup(entry)) acc.push(entry.id);
|
|
1014
1141
|
for (const child of groupItemsAsArray(entry.items)) {
|
|
@@ -1080,6 +1207,7 @@ const contextGroups = computed<Record<string, BbDropdownGroupState>>(() => {
|
|
|
1080
1207
|
// by `useBbDropdown`, so it never registers (no wasted node).
|
|
1081
1208
|
useBbDropdownHost(() => props.id, {
|
|
1082
1209
|
open: () => open.value,
|
|
1210
|
+
empty: () => empty.value,
|
|
1083
1211
|
groups: () => contextGroups.value,
|
|
1084
1212
|
});
|
|
1085
1213
|
|
|
@@ -1227,9 +1355,12 @@ const focusActivator = () => {
|
|
|
1227
1355
|
// its own id (see the adoption watch), so an id lookup would no-op.
|
|
1228
1356
|
const button =
|
|
1229
1357
|
activator.value ??
|
|
1230
|
-
(activatorId.value ? document.getElementById(activatorId.value) : null)
|
|
1358
|
+
(activatorId.value ? document.getElementById(activatorId.value) : null) ??
|
|
1359
|
+
returnFocusTo;
|
|
1231
1360
|
button?.focus();
|
|
1232
1361
|
};
|
|
1362
|
+
/** A menu opened from code has no activator: focus goes back where it was. */
|
|
1363
|
+
let returnFocusTo: HTMLElement | null = null;
|
|
1233
1364
|
|
|
1234
1365
|
provideDropdownContext({
|
|
1235
1366
|
passthrough,
|
|
@@ -1301,7 +1432,8 @@ provideDropdownContext({
|
|
|
1301
1432
|
});
|
|
1302
1433
|
|
|
1303
1434
|
const onClick = (event: MouseEvent) => {
|
|
1304
|
-
|
|
1435
|
+
// Empty: inert, and the click goes on to the app's own handlers.
|
|
1436
|
+
if (props.disabled || empty.value) return;
|
|
1305
1437
|
if (longPressTriggered) {
|
|
1306
1438
|
longPressTriggered = false;
|
|
1307
1439
|
event.preventDefault();
|
|
@@ -1336,7 +1468,8 @@ const focusPressedActivator = (event: MouseEvent) => {
|
|
|
1336
1468
|
};
|
|
1337
1469
|
|
|
1338
1470
|
const onContextMenu = async (event: MouseEvent) => {
|
|
1339
|
-
|
|
1471
|
+
// Empty: the browser's own menu comes back (no preventDefault).
|
|
1472
|
+
if (props.disabled || empty.value) return;
|
|
1340
1473
|
event.preventDefault();
|
|
1341
1474
|
event.stopPropagation();
|
|
1342
1475
|
if (props.placement === 'cursor') {
|
|
@@ -1367,7 +1500,7 @@ const clearLongPress = () => {
|
|
|
1367
1500
|
};
|
|
1368
1501
|
|
|
1369
1502
|
const onPointerDown = (event: PointerEvent) => {
|
|
1370
|
-
if (props.disabled || event.pointerType === 'mouse') return;
|
|
1503
|
+
if (props.disabled || empty.value || event.pointerType === 'mouse') return;
|
|
1371
1504
|
longPressTriggered = false;
|
|
1372
1505
|
longPressOrigin = { x: event.clientX, y: event.clientY };
|
|
1373
1506
|
longPressTimer = setTimeout(() => {
|
|
@@ -1397,8 +1530,20 @@ const onPointerUp = () => {
|
|
|
1397
1530
|
clearLongPress();
|
|
1398
1531
|
};
|
|
1399
1532
|
|
|
1533
|
+
/**
|
|
1534
|
+
* The finger lifting after a long press opened the menu: no mouse events
|
|
1535
|
+
* follow. The tap's mousedown / click would otherwise land
|
|
1536
|
+
* on the activator, or on a sheet opened under the finger, and close the
|
|
1537
|
+
* menu the press just opened. With no click coming, the swallow is done too.
|
|
1538
|
+
*/
|
|
1539
|
+
const onTouchEnd = (event: TouchEvent) => {
|
|
1540
|
+
if (!longPressTriggered || !event.cancelable) return;
|
|
1541
|
+
event.preventDefault();
|
|
1542
|
+
longPressTriggered = false;
|
|
1543
|
+
};
|
|
1544
|
+
|
|
1400
1545
|
const onKeydown = async (event: KeyboardEvent) => {
|
|
1401
|
-
if (props.disabled) return;
|
|
1546
|
+
if (props.disabled || empty.value) return;
|
|
1402
1547
|
|
|
1403
1548
|
// The row is focused a task after the key: `focusVisible`, or Firefox
|
|
1404
1549
|
// draws no ring after a click-open (it grants one only inside the handler).
|
|
@@ -1514,6 +1659,8 @@ const onEsc = (event: KeyboardEvent) => {
|
|
|
1514
1659
|
closeDropdown();
|
|
1515
1660
|
};
|
|
1516
1661
|
const openDropdown = async () => {
|
|
1662
|
+
// No visible row: nothing opens, whatever asked.
|
|
1663
|
+
if (empty.value) return;
|
|
1517
1664
|
// Latch the surface for this open cycle before anything reads it.
|
|
1518
1665
|
surface.value = resolveSurface();
|
|
1519
1666
|
ignoreNextIntersection = true;
|
|
@@ -1554,6 +1701,26 @@ const closeDropdown = async () => {
|
|
|
1554
1701
|
pause();
|
|
1555
1702
|
};
|
|
1556
1703
|
|
|
1704
|
+
// An owner opening this menu from code: at a point, as a
|
|
1705
|
+
// right-click (`'pointer'`) or Shift+F10 (`'keyboard'`, first row focused) would.
|
|
1706
|
+
registerDropdownHandle({
|
|
1707
|
+
open: async (at, modality, returnTo) => {
|
|
1708
|
+
if (open.value) {
|
|
1709
|
+
await closeDropdown();
|
|
1710
|
+
await wait(props.transitionDuration);
|
|
1711
|
+
}
|
|
1712
|
+
cursorAnchor.value = at;
|
|
1713
|
+
returnFocusTo = returnTo ?? null;
|
|
1714
|
+
openModality = modality;
|
|
1715
|
+
await openDropdown();
|
|
1716
|
+
if (modality !== 'keyboard' || !open.value) return;
|
|
1717
|
+
await wait(0);
|
|
1718
|
+
rootList.value?.focusFirst(true);
|
|
1719
|
+
},
|
|
1720
|
+
close: closeDropdown,
|
|
1721
|
+
isOpen: () => open.value,
|
|
1722
|
+
});
|
|
1723
|
+
|
|
1557
1724
|
const removeDocumentListeners = () => {
|
|
1558
1725
|
removeEscapeEntry(escapeKey);
|
|
1559
1726
|
document.removeEventListener('click', onOutsideInteraction);
|
|
@@ -1635,12 +1802,14 @@ watch(
|
|
|
1635
1802
|
el.addEventListener('pointermove', onPointerMove);
|
|
1636
1803
|
el.addEventListener('pointerup', onPointerUp);
|
|
1637
1804
|
el.addEventListener('pointercancel', onPointerUp);
|
|
1805
|
+
el.addEventListener('touchend', onTouchEnd);
|
|
1638
1806
|
removers.push(() => {
|
|
1639
1807
|
el.removeEventListener('contextmenu', onContextMenu);
|
|
1640
1808
|
el.removeEventListener('pointerdown', onPointerDown);
|
|
1641
1809
|
el.removeEventListener('pointermove', onPointerMove);
|
|
1642
1810
|
el.removeEventListener('pointerup', onPointerUp);
|
|
1643
1811
|
el.removeEventListener('pointercancel', onPointerUp);
|
|
1812
|
+
el.removeEventListener('touchend', onTouchEnd);
|
|
1644
1813
|
clearLongPress();
|
|
1645
1814
|
});
|
|
1646
1815
|
}
|
|
@@ -1661,9 +1830,16 @@ watch(
|
|
|
1661
1830
|
|
|
1662
1831
|
// Update reactive ARIA attributes
|
|
1663
1832
|
watch(
|
|
1664
|
-
[activator, open, hasOpenedOnce, popupRole, controlsId] as const,
|
|
1665
|
-
([el, isOpen, opened, role, controls]) => {
|
|
1833
|
+
[activator, open, hasOpenedOnce, popupRole, controlsId, empty] as const,
|
|
1834
|
+
([el, isOpen, opened, role, controls, isEmpty]) => {
|
|
1666
1835
|
if (!el) return;
|
|
1836
|
+
// No visible row: no popup to announce.
|
|
1837
|
+
if (isEmpty) {
|
|
1838
|
+
el.removeAttribute('aria-haspopup');
|
|
1839
|
+
el.removeAttribute('aria-expanded');
|
|
1840
|
+
el.removeAttribute('aria-controls');
|
|
1841
|
+
return;
|
|
1842
|
+
}
|
|
1667
1843
|
|
|
1668
1844
|
el.setAttribute('aria-haspopup', role);
|
|
1669
1845
|
el.setAttribute('aria-expanded', opened ? String(isOpen) : 'false');
|
|
@@ -1783,6 +1959,13 @@ type DropdownEntryBase = {
|
|
|
1783
1959
|
* group (the check is), or when an append slot fills the region.
|
|
1784
1960
|
*/
|
|
1785
1961
|
'append:icon'?: IconType;
|
|
1962
|
+
/**
|
|
1963
|
+
* Leaves the entry out: not rendered, not reachable by keyboard or
|
|
1964
|
+
* search. A row takes its submenu with it, a group all its rows; a group
|
|
1965
|
+
* left with no visible row drops with its divider and label. A selected
|
|
1966
|
+
* value stays in the model.
|
|
1967
|
+
*/
|
|
1968
|
+
hidden?: boolean;
|
|
1786
1969
|
/**
|
|
1787
1970
|
* Your own data for this entry, carried untouched to its slots (as
|
|
1788
1971
|
* `item.meta`) and to per-item `pt` functions. The dropdown never reads it
|
|
@@ -1849,7 +2032,7 @@ export type BbDropdownItemProps<T = any> = ItemProps<T, DropdownItemFields>;
|
|
|
1849
2032
|
*/
|
|
1850
2033
|
type SubmenuExclusive =
|
|
1851
2034
|
| {
|
|
1852
|
-
items:
|
|
2035
|
+
items: ItemEntry[];
|
|
1853
2036
|
/** A submenu row opens its submenu; it cannot also run an action. */
|
|
1854
2037
|
onClick?: never;
|
|
1855
2038
|
/** A submenu row opens its submenu; it cannot also navigate. */
|
|
@@ -1865,6 +2048,8 @@ export type InternalItem = Omit<
|
|
|
1865
2048
|
> &
|
|
1866
2049
|
SubmenuExclusive &
|
|
1867
2050
|
DropdownEntryBase & {
|
|
2051
|
+
/** Rows have no search box (a group has); declared so a group's `searchable` discriminates. */
|
|
2052
|
+
searchable?: never;
|
|
1868
2053
|
/** The row's text. */
|
|
1869
2054
|
label: string;
|
|
1870
2055
|
/**
|
|
@@ -1926,27 +2111,32 @@ export type InternalItem = Omit<
|
|
|
1926
2111
|
* when its latest load FAILED (`'failed'`: the footer under whatever rows a
|
|
1927
2112
|
* `stash` keeps listed). Rendered as a non-interactive row that
|
|
1928
2113
|
* shows `label` or, when provided, the dropdown's `loading` / `empty` slot.
|
|
1929
|
-
*
|
|
2114
|
+
*
|
|
2115
|
+
* @internal Set by `BbDropdownGroup`.
|
|
1930
2116
|
*/
|
|
1931
2117
|
placeholder?: 'loading' | 'empty' | 'failed';
|
|
1932
2118
|
/**
|
|
1933
2119
|
* On a `'failed'` placeholder: what the group's `items` load rejected
|
|
1934
|
-
* with
|
|
1935
|
-
*
|
|
2120
|
+
* with, handed to the `empty` slot as `error`.
|
|
2121
|
+
*
|
|
2122
|
+
* @internal Set by the pipeline resolver.
|
|
1936
2123
|
*/
|
|
1937
2124
|
error?: unknown;
|
|
1938
2125
|
/**
|
|
1939
2126
|
* Marks a row built by the pipeline resolver from a fetched item. Its
|
|
1940
2127
|
* `selectable` predicate already ran against the RAW item there, so
|
|
1941
2128
|
* `normalizeGroups` must not run it again against this row object.
|
|
1942
|
-
*
|
|
2129
|
+
*
|
|
2130
|
+
* @internal
|
|
1943
2131
|
*/
|
|
1944
2132
|
fetched?: true;
|
|
1945
2133
|
/**
|
|
1946
2134
|
* Optional slot token used to resolve per-item named slots. Primarily set
|
|
1947
2135
|
* by the pipeline resolver so slot names can be derived from the resolved
|
|
1948
2136
|
* `itemValue` (readable), while `rowKey` remains the hash-based selection
|
|
1949
|
-
* id.
|
|
2137
|
+
* id.
|
|
2138
|
+
*
|
|
2139
|
+
* @internal
|
|
1950
2140
|
*/
|
|
1951
2141
|
slotKey?: string;
|
|
1952
2142
|
};
|
|
@@ -1977,16 +2167,24 @@ export type InternalItem = Omit<
|
|
|
1977
2167
|
*
|
|
1978
2168
|
* A provider signals a failure by THROWING, never by returning `[]`: the
|
|
1979
2169
|
* rows are cleared, nothing is pruned, and the `empty` placeholder shows
|
|
1980
|
-
* `failedText` with the error. Zero-argument providers keep working.
|
|
1981
|
-
*
|
|
2170
|
+
* `failedText` with the error. Zero-argument providers keep working. An
|
|
2171
|
+
* unannotated getter reads its context typed (`query` a string on a
|
|
2172
|
+
* `searchable` group); a provider shared with other components is annotated
|
|
2173
|
+
* `BbDropdownGroupItemsContext`.
|
|
1982
2174
|
*/
|
|
1983
|
-
export type DropdownGroupItemsGetter =
|
|
2175
|
+
export type DropdownGroupItemsGetter = PlainGetter | SearchGetter;
|
|
2176
|
+
|
|
2177
|
+
/** A group without a search box: no `query` arrives. */
|
|
2178
|
+
type PlainGetter = (
|
|
2179
|
+
context: BbDropdownGroupItemsContext
|
|
1984
2180
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- a fetched group's rows are the API's records: the dropdown is not generic, so their type cannot reach the accessors
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
2181
|
+
) => any[] | Promise<any[]>;
|
|
2182
|
+
|
|
2183
|
+
/** A `searchable` group: `query` always arrives, `''` until typed. */
|
|
2184
|
+
type SearchGetter = (
|
|
2185
|
+
context: BbDropdownGroupItemsContext & { query: string }
|
|
2186
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- a fetched group's rows are the API's records: the dropdown is not generic, so their type cannot reach the accessors
|
|
2187
|
+
) => any[] | Promise<any[]>;
|
|
1990
2188
|
|
|
1991
2189
|
export type InternalGroup = DropdownEntryBase & {
|
|
1992
2190
|
/**
|
|
@@ -2026,23 +2224,9 @@ export type InternalGroup = DropdownEntryBase & {
|
|
|
2026
2224
|
*/
|
|
2027
2225
|
group?: true;
|
|
2028
2226
|
/**
|
|
2029
|
-
*
|
|
2030
|
-
*
|
|
2031
|
-
*
|
|
2032
|
-
* `({ reason, modelValue, signal }) => Item[] | Promise<Item[]>` (plus
|
|
2033
|
-
* `query` when the group is `searchable`; see {@link DropdownGroupItemsGetter})
|
|
2034
|
-
* and pair it with `itemText`/`itemValue`. A `<BbDropdownGroup :id v-model>`
|
|
2035
|
-
* companion resolves such a group and surfaces the selected `itemValue`(s)
|
|
2036
|
-
* through `v-model`.
|
|
2037
|
-
*/
|
|
2038
|
-
items:
|
|
2039
|
-
| Array<InternalItem | InternalItem[]>
|
|
2040
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- a fetched group's raw records, before normalisation (see `itemText`)
|
|
2041
|
-
| any[]
|
|
2042
|
-
| DropdownGroupItemsGetter;
|
|
2043
|
-
/**
|
|
2044
|
-
* Pipeline groups only. Path/getter producing each item's display text
|
|
2045
|
-
* (a primitive item is its own text; a getter still maps it).
|
|
2227
|
+
* Pipeline groups only. Path/getter producing each item's display text.
|
|
2228
|
+
* A string or number row needs none, fetched or written: it is its own
|
|
2229
|
+
* text and value (a getter here still maps a fetched one).
|
|
2046
2230
|
*
|
|
2047
2231
|
* Unset: own `label`, else `text` (`{ label, value }` needs no accessor).
|
|
2048
2232
|
*
|
|
@@ -2139,17 +2323,6 @@ export type InternalGroup = DropdownEntryBase & {
|
|
|
2139
2323
|
* @defaultValue `'interaction'`
|
|
2140
2324
|
*/
|
|
2141
2325
|
prefill?: boolean | 'interaction';
|
|
2142
|
-
/**
|
|
2143
|
-
* Renders a search field at the top of THIS group (so, inside its submenu when
|
|
2144
|
-
* the group is one), scoped to this group alone — the nested "category ›
|
|
2145
|
-
* searchable options" pattern. Typing narrows this group's rows by
|
|
2146
|
-
* the ranked search (see `filterBy`) and, for an async group, passes
|
|
2147
|
-
* the typed text to its getter as the context's `query` (a user search arrives
|
|
2148
|
-
* with `reason: 'search'`, as on `BbSelect`; see
|
|
2149
|
-
* `BbDropdownGroupItemsContext`). Each searchable group owns its own query,
|
|
2150
|
-
* independent of its siblings.
|
|
2151
|
-
*/
|
|
2152
|
-
searchable?: boolean;
|
|
2153
2326
|
/** Placeholder for this group's search field. Defaults to the localized label. */
|
|
2154
2327
|
searchPlaceholder?: string;
|
|
2155
2328
|
/**
|
|
@@ -2206,7 +2379,65 @@ export type InternalGroup = DropdownEntryBase & {
|
|
|
2206
2379
|
* category, yet still wants a label for chips.
|
|
2207
2380
|
*/
|
|
2208
2381
|
hideLabel?: boolean;
|
|
2209
|
-
};
|
|
2382
|
+
} & GroupSource;
|
|
2383
|
+
|
|
2384
|
+
// `searchable` picks the getter's context: a searchable group's getter always
|
|
2385
|
+
// gets `query`, any other group's none. Each side has one signature, so an
|
|
2386
|
+
// unannotated getter reads its context typed (a union of the two did not).
|
|
2387
|
+
type GroupSource =
|
|
2388
|
+
| {
|
|
2389
|
+
/**
|
|
2390
|
+
* Renders a search field at the top of THIS group (so, inside its submenu when
|
|
2391
|
+
* the group is one), scoped to this group alone — the nested "category ›
|
|
2392
|
+
* searchable options" pattern. Typing narrows this group's rows by
|
|
2393
|
+
* the ranked search (see `filterBy`) and, for an async group, passes
|
|
2394
|
+
* the typed text to its getter as the context's `query` (a user search arrives
|
|
2395
|
+
* with `reason: 'search'`, as on `BbSelect`; see
|
|
2396
|
+
* `BbDropdownGroupItemsContext`). Each searchable group owns its own query,
|
|
2397
|
+
* independent of its siblings.
|
|
2398
|
+
*/
|
|
2399
|
+
searchable: true;
|
|
2400
|
+
/**
|
|
2401
|
+
* Items of the group. Plain arrays are flattened.
|
|
2402
|
+
*
|
|
2403
|
+
* For a **pipeline group**, pass raw objects (`any[]`) or an (async) getter
|
|
2404
|
+
* `({ reason, modelValue, signal }) => Item[] | Promise<Item[]>` (plus
|
|
2405
|
+
* `query` when the group is `searchable`; see {@link DropdownGroupItemsGetter})
|
|
2406
|
+
* and pair it with `itemText`/`itemValue`. A `<BbDropdownGroup :id v-model>`
|
|
2407
|
+
* companion resolves such a group and surfaces the selected `itemValue`(s)
|
|
2408
|
+
* through `v-model`.
|
|
2409
|
+
*/
|
|
2410
|
+
items: GroupRows | SearchGetter;
|
|
2411
|
+
}
|
|
2412
|
+
| {
|
|
2413
|
+
/**
|
|
2414
|
+
* Renders a search field at the top of THIS group (so, inside its submenu when
|
|
2415
|
+
* the group is one), scoped to this group alone — the nested "category ›
|
|
2416
|
+
* searchable options" pattern. Typing narrows this group's rows by
|
|
2417
|
+
* the ranked search (see `filterBy`) and, for an async group, passes
|
|
2418
|
+
* the typed text to its getter as the context's `query` (a user search arrives
|
|
2419
|
+
* with `reason: 'search'`, as on `BbSelect`; see
|
|
2420
|
+
* `BbDropdownGroupItemsContext`). Each searchable group owns its own query,
|
|
2421
|
+
* independent of its siblings.
|
|
2422
|
+
*/
|
|
2423
|
+
searchable?: false;
|
|
2424
|
+
/**
|
|
2425
|
+
* Items of the group. Plain arrays are flattened.
|
|
2426
|
+
*
|
|
2427
|
+
* For a **pipeline group**, pass raw objects (`any[]`) or an (async) getter
|
|
2428
|
+
* `({ reason, modelValue, signal }) => Item[] | Promise<Item[]>` (plus
|
|
2429
|
+
* `query` when the group is `searchable`; see {@link DropdownGroupItemsGetter})
|
|
2430
|
+
* and pair it with `itemText`/`itemValue`. A `<BbDropdownGroup :id v-model>`
|
|
2431
|
+
* companion resolves such a group and surfaces the selected `itemValue`(s)
|
|
2432
|
+
* through `v-model`.
|
|
2433
|
+
*/
|
|
2434
|
+
items: GroupRows | PlainGetter;
|
|
2435
|
+
};
|
|
2436
|
+
|
|
2437
|
+
type GroupRows =
|
|
2438
|
+
| Array<InternalItem | InternalItem[]>
|
|
2439
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- a fetched group's raw records, before normalisation (see `itemText`)
|
|
2440
|
+
| any[];
|
|
2210
2441
|
|
|
2211
2442
|
/**
|
|
2212
2443
|
* A group's items as a raw array, or `[]` when the items are still an
|
|
@@ -2219,6 +2450,17 @@ export const groupItemsAsArray = (
|
|
|
2219
2450
|
): Array<InternalItem | InternalItem[]> =>
|
|
2220
2451
|
Array.isArray(items) ? (items as Array<InternalItem | InternalItem[]>) : [];
|
|
2221
2452
|
|
|
2453
|
+
/**
|
|
2454
|
+
* A string or number row: its own text and value (`'Google'` reads "Google"
|
|
2455
|
+
* and picks `'Google'`), loose, in a section, in a group's `items` or in a
|
|
2456
|
+
* submenu's `items`. It declares `searchable` like every entry, so a group
|
|
2457
|
+
* literal beside it still picks its plain or searchable getter.
|
|
2458
|
+
*/
|
|
2459
|
+
export type PrimitiveRow = (string | number) & { searchable?: never };
|
|
2460
|
+
|
|
2461
|
+
/** One entry of an `items` array: an {@link Item} or a {@link PrimitiveRow}. */
|
|
2462
|
+
export type ItemEntry = Item | PrimitiveRow;
|
|
2463
|
+
|
|
2222
2464
|
/**
|
|
2223
2465
|
* Items accepted by the dropdown. Entries can be:
|
|
2224
2466
|
* - a single {@link InternalItem};
|
|
@@ -2227,7 +2469,12 @@ export const groupItemsAsArray = (
|
|
|
2227
2469
|
*
|
|
2228
2470
|
* The shapes can be mixed, e.g. `[item, [item, item], { id, label, items }]`.
|
|
2229
2471
|
*/
|
|
2230
|
-
export type Item =
|
|
2472
|
+
export type Item =
|
|
2473
|
+
| InternalItem
|
|
2474
|
+
| InternalGroup
|
|
2475
|
+
// The `searchable` guard lets an unwritten `searchable` pick a group's
|
|
2476
|
+
// plain getter: every member of the union has to declare the property.
|
|
2477
|
+
| (ItemEntry[] & { searchable?: never });
|
|
2231
2478
|
|
|
2232
2479
|
/** Unwraps the item type out of the (possibly nested) {@link Items} shape. */
|
|
2233
2480
|
export type FlatItem<T> = T extends Array<infer U> ? U : T;
|
|
@@ -2258,7 +2505,17 @@ export const selectablePredicateOf = (
|
|
|
2258
2505
|
): ((item: any) => boolean) | undefined =>
|
|
2259
2506
|
typeof entry.selectable === 'function' ? entry.selectable : undefined;
|
|
2260
2507
|
|
|
2261
|
-
|
|
2508
|
+
/** A string or number row: its own text and value (normalizeGroups maps it). */
|
|
2509
|
+
export const isPrimitiveRow = (
|
|
2510
|
+
entry: ItemEntry | InternalItem | InternalItem[]
|
|
2511
|
+
): entry is PrimitiveRow =>
|
|
2512
|
+
typeof entry === 'string' || typeof entry === 'number';
|
|
2513
|
+
|
|
2514
|
+
// A primitive row (`'Google'`, `3`) is its own text and value: never a group,
|
|
2515
|
+
// and `in` throws on it, so the object check comes first.
|
|
2516
|
+
export const isGroup = (entry: ItemEntry): entry is InternalGroup =>
|
|
2517
|
+
typeof entry === 'object' &&
|
|
2518
|
+
entry !== null &&
|
|
2262
2519
|
!Array.isArray(entry) &&
|
|
2263
2520
|
((entry as InternalGroup).group === true ||
|
|
2264
2521
|
'selectable' in entry ||
|
|
@@ -2603,7 +2860,13 @@ export type BbDropdownProps = BbDropdownPtProps & {
|
|
|
2603
2860
|
*
|
|
2604
2861
|
* @defaultValue `[]`
|
|
2605
2862
|
*/
|
|
2606
|
-
items: Item
|
|
2863
|
+
items: Array<Item | PrimitiveRow>;
|
|
2864
|
+
/**
|
|
2865
|
+
* Keeps the trigger when no row is visible (by default it is hidden):
|
|
2866
|
+
* inert, no popup ARIA, `empty` in the activator slot. A `contextMenu`
|
|
2867
|
+
* trigger always stays.
|
|
2868
|
+
*/
|
|
2869
|
+
keepActivator?: boolean;
|
|
2607
2870
|
/**
|
|
2608
2871
|
* Default placeholder text shown while a pipeline group's async items load.
|
|
2609
2872
|
* A group's own `loadingText` overrides this; both fall back to the localized
|
|
@@ -2642,9 +2905,8 @@ export type BbDropdownProps = BbDropdownPtProps & {
|
|
|
2642
2905
|
*/
|
|
2643
2906
|
padding?: number;
|
|
2644
2907
|
/**
|
|
2645
|
-
* Position
|
|
2646
|
-
*
|
|
2647
|
-
* (No arrow is drawn either way — arrows are tooltip-only in v3.)
|
|
2908
|
+
* Position relative to the activator; `'cursor'` anchors at the
|
|
2909
|
+
* mouse/touch point. No arrow (tooltips only).
|
|
2648
2910
|
*
|
|
2649
2911
|
* @defaultValue `'bottom'`
|
|
2650
2912
|
*/
|
|
@@ -2658,8 +2920,8 @@ export type BbDropdownProps = BbDropdownPtProps & {
|
|
|
2658
2920
|
queryDebounceTime?: number;
|
|
2659
2921
|
/**
|
|
2660
2922
|
* The open / close transition in milliseconds. Menus take the fast one
|
|
2661
|
-
* (150), not the popovers' medium 250: a menu is
|
|
2662
|
-
*
|
|
2923
|
+
* (150), not the popovers' medium 250: a menu is picked from and gone, so
|
|
2924
|
+
* it answers faster than a panel you read or edit in.
|
|
2663
2925
|
*
|
|
2664
2926
|
* @defaultValue `150`
|
|
2665
2927
|
*/
|
|
@@ -2693,8 +2955,7 @@ export type BbDropdownEvents = {
|
|
|
2693
2955
|
/**
|
|
2694
2956
|
* The user selected a row in a selectable group, at the click — also when a
|
|
2695
2957
|
* controlled companion's app then refuses the value. The payload is the
|
|
2696
|
-
* row's value (its `item-value` for pipeline groups, else its `value`)
|
|
2697
|
-
* symmetric with `BbTable`'s `item:selected`.
|
|
2958
|
+
* row's value (its `item-value` for pipeline groups, else its `value`).
|
|
2698
2959
|
*/
|
|
2699
2960
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- the row's resolved value, whatever a fetched group's `item-value` returns: the dropdown is not generic, and `unknown` would reject a handler annotated `(id: number)`
|
|
2700
2961
|
(e: 'item:selected', value: any): void;
|
|
@@ -2717,6 +2978,8 @@ export type BbDropdownActivatorProps = {
|
|
|
2717
2978
|
export type BbDropdownActivatorSlotProps = {
|
|
2718
2979
|
/** Whether the dropdown is globally disabled. */
|
|
2719
2980
|
disabled?: boolean;
|
|
2981
|
+
/** No row is visible: the trigger is inert. */
|
|
2982
|
+
empty: boolean;
|
|
2720
2983
|
/**
|
|
2721
2984
|
* Whether any item's async `onClick` is currently in flight. Use to reflect a
|
|
2722
2985
|
* global busy state on the trigger.
|
|
@@ -2870,9 +3133,8 @@ export type BbDropdownSlots = {
|
|
|
2870
3133
|
*/
|
|
2871
3134
|
activator?: (props: BbDropdownActivatorSlotProps) => any;
|
|
2872
3135
|
/**
|
|
2873
|
-
*
|
|
2874
|
-
*
|
|
2875
|
-
* divider — for a title or a filter field.
|
|
3136
|
+
* Pinned above the rows, outside their scroll, with a divider — for a
|
|
3137
|
+
* title or a filter field.
|
|
2876
3138
|
*/
|
|
2877
3139
|
header?: (props: BbDropdownEdgeSlotProps) => any;
|
|
2878
3140
|
/**
|
|
@@ -2887,9 +3149,8 @@ export type BbDropdownSlots = {
|
|
|
2887
3149
|
*/
|
|
2888
3150
|
'item:append'?: (props: BbDropdownItemSlotProps) => any;
|
|
2889
3151
|
/**
|
|
2890
|
-
*
|
|
2891
|
-
*
|
|
2892
|
-
* divider — for action buttons.
|
|
3152
|
+
* Pinned below the rows, outside their scroll, with a divider — for
|
|
3153
|
+
* action buttons.
|
|
2893
3154
|
*/
|
|
2894
3155
|
footer?: (props: BbDropdownEdgeSlotProps) => any;
|
|
2895
3156
|
} & Record<string, (props: BbDropdownItemSlotProps) => any>;
|
|
@@ -3828,7 +4089,7 @@ export type BbDropdownGroupEvents = {
|
|
|
3828
4089
|
/* Same chevron_right asset the submenu rows use, pointed back:
|
|
3829
4090
|
toward the inline start, which is already where it points in
|
|
3830
4091
|
rtl. */
|
|
3831
|
-
.bb-
|
|
4092
|
+
.bb-button__prepend-icon {
|
|
3832
4093
|
transform: rotate(180deg);
|
|
3833
4094
|
|
|
3834
4095
|
&:dir(rtl) {
|