bitboss-ui 3.0.0-beta.71 → 3.0.0-beta.73
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 +9 -3
- package/dist/ai/BbAccordion.md +38 -19
- package/dist/ai/BbBadge.md +25 -22
- package/dist/ai/BbBreadcrumbs.md +1 -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/BbCheckboxGroup.md +2 -1
- package/dist/ai/BbColorInput.md +1 -1
- 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 +2 -2
- package/dist/ai/BbDialog.md +233 -164
- package/dist/ai/BbDropdown.md +52 -16
- package/dist/ai/BbDropdownButton.md +11 -12
- package/dist/ai/BbDropzone.md +12 -8
- package/dist/ai/BbForm.md +100 -13
- 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 +7 -5
- 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/BbRadioGroup.md +29 -7
- package/dist/ai/BbRating.md +8 -7
- package/dist/ai/BbSelect.md +29 -8
- package/dist/ai/BbSelectPopover.md +9 -3
- package/dist/ai/BbSlider.md +12 -8
- package/dist/ai/BbSpinner.md +3 -2
- package/dist/ai/BbSwitch.md +3 -3
- package/dist/ai/BbSwitchGroup.md +7 -6
- package/dist/ai/BbTable.md +205 -82
- package/dist/ai/BbTabs.md +29 -4
- package/dist/ai/BbTag.md +1 -1
- package/dist/ai/BbTextInput.md +7 -5
- package/dist/ai/BbTextarea.md +4 -3
- package/dist/ai/BbTimePickerInput.md +1 -1
- package/dist/ai/BbToast.md +3 -2
- package/dist/ai/BbTooltip.md +22 -17
- package/dist/ai/BbTree.md +49 -24
- package/dist/ai/CommonFieldInput.md +1 -1
- package/dist/ai/changelog.json +242 -9
- package/dist/ai/components.json +52 -51
- 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 +72 -26
- package/dist/ai/guides/migration/v2-to-v3.md +52 -10
- 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/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 +3 -3
- 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 +1 -1
- 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/BbCheckboxGroup.json +2 -2
- package/dist/ai/manifest/components/BbColorInput.json +1 -1
- package/dist/ai/manifest/components/BbColorInput.tree.json +1 -1
- 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 +1 -1
- 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 +9 -8
- package/dist/ai/manifest/components/BbDropdown.tree.json +4 -0
- package/dist/ai/manifest/components/BbDropdownButton.json +8 -9
- 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 +1 -1
- 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/BbRadioGroup.json +4 -3
- package/dist/ai/manifest/components/BbRating.json +2 -2
- package/dist/ai/manifest/components/BbSelect.json +16 -15
- package/dist/ai/manifest/components/BbSelect.tree.json +1 -1
- package/dist/ai/manifest/components/BbSelectPopover.json +1 -0
- package/dist/ai/manifest/components/BbSwitch.json +4 -4
- package/dist/ai/manifest/components/BbSwitchGroup.json +7 -7
- 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 +1 -1
- package/dist/ai/manifest/components/BbTextInput.json +1 -1
- package/dist/ai/manifest/components/BbTextInput.tree.json +1 -1
- package/dist/ai/manifest/components/BbTextarea.json +1 -1
- package/dist/ai/manifest/components/BbTextarea.tree.json +1 -1
- 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 +1 -1
- package/dist/ai/manifest/components/BbToast.removed.json +2 -1
- package/dist/ai/manifest/components/BbTree.json +2 -2
- package/dist/ai/manifest/components/CommonFieldInput.tree.json +3 -3
- 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 +6 -5
- 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/BbButton.md +205 -55
- package/dist/ai/source/BbCalendar.md +5 -0
- package/dist/ai/source/BbCheckboxGroup.md +38 -13
- 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 +3 -1
- package/dist/ai/source/BbDialog.md +53 -2
- package/dist/ai/source/BbDropdown.md +350 -98
- package/dist/ai/source/BbDropdownButton.md +20 -12
- package/dist/ai/source/BbDropdownGroup.md +136 -58
- package/dist/ai/source/BbForm.md +152 -11
- package/dist/ai/source/BbOffCanvas.md +53 -2
- package/dist/ai/source/BbPagination.md +1 -1
- package/dist/ai/source/BbRadioGroup.md +72 -10
- package/dist/ai/source/BbRating.md +30 -22
- package/dist/ai/source/BbSelect.md +11 -1
- package/dist/ai/source/BbSelectPopover.md +105 -34
- package/dist/ai/source/BbSwitch.md +23 -8
- package/dist/ai/source/BbSwitchGroup.md +67 -21
- package/dist/ai/source/BbTable.md +359 -48
- 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/BbTree.md +14 -4
- package/dist/ai/source/CommonFieldInput.md +2 -1
- 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/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/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 +2 -2
- 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 +2 -1
- 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 +382 -332
- package/dist/components/BbDropdown/dropdownHandle.js +6 -0
- package/dist/components/BbDropdown/normalizeGroups.js +58 -48
- package/dist/components/BbDropdown/types.d.ts +107 -48
- package/dist/components/BbDropdown/types.js +2 -2
- package/dist/components/BbDropdownButton/BbDropdownButton.vue_vue_type_script_setup_true_lang.js +71 -71
- 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 +241 -199
- 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/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/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 +9 -3
- package/dist/components/BbRating/BbRating.vue_vue_type_script_setup_true_lang.js +112 -103
- package/dist/components/BbRating/types.d.ts +3 -2
- package/dist/components/BbSelect/BbSelect.vue.d.ts +9 -8
- package/dist/components/BbSelect/BbSelect.vue_vue_type_script_setup_true_lang.js +3 -1
- package/dist/components/BbSelect/types.d.ts +8 -0
- 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/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 +32 -17
- 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/BbTextInput/BbTextInput.vue.d.ts +1 -1
- package/dist/components/BbTextarea/BbTextarea.vue.d.ts +1 -1
- package/dist/components/BbTimePickerInput/BbTimePickerInput.vue.d.ts +1 -1
- package/dist/components/BbToast/BbToastMessage.vue_vue_type_script_setup_true_lang.js +88 -94
- 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/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/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 +21 -14
- 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 +1997 -1151
- 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/ItemPath.d.ts +33 -4
- package/dist/types/ptComponentMap.d.ts +1 -1
- package/dist/utilities/functions/clickCount.js +14 -0
- package/dist/utilities/functions/hash.js +90 -3
- package/dist/utilities/functions/isEqual.js +61 -3
- package/dist/utils/versionCheck.js +1 -1
- package/dist/vite.js +0 -1
- package/llms.txt +2 -2
- package/package.json +12 -2
- package/scripts/README.md +43 -39
- package/scripts/lib/adoption-checklist.json +2 -2
- 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/helpers-add.mjs +21 -2
- package/scripts/lib/redundant-item-accessor.mjs +4 -1
- package/scripts/lib/release-results.mjs +180 -5
- package/scripts/lib/renamed-item-field.mjs +4 -1
- package/scripts/lib/tab-links.mjs +4 -1
- package/scripts/lib/tree-default-expandable.mjs +53 -0
- package/scripts/lib/validate-bb-markup.mjs +536 -52
|
@@ -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,24 +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
|
-
|
|
621
|
-
|
|
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;
|
|
622
638
|
|
|
623
639
|
const toGroupFromCompanion = (
|
|
624
640
|
companion: DropdownGroupDescriptor,
|
|
@@ -639,13 +655,13 @@ const toGroupFromCompanion = (
|
|
|
639
655
|
'append:icon': companion['append:icon'] ?? baseline?.['append:icon'],
|
|
640
656
|
variant: companion.variant ?? baseline?.variant,
|
|
641
657
|
onClick: companion.onClick ?? baseline?.onClick,
|
|
642
|
-
};
|
|
658
|
+
} as InternalGroup;
|
|
643
659
|
};
|
|
644
660
|
|
|
645
661
|
const applyCompanionToItems = (
|
|
646
|
-
items:
|
|
662
|
+
items: ItemEntry[],
|
|
647
663
|
group: InternalGroup
|
|
648
|
-
): { items:
|
|
664
|
+
): { items: ItemEntry[]; found: boolean } => {
|
|
649
665
|
let found = false;
|
|
650
666
|
|
|
651
667
|
const applyToItem = (item: InternalItem): InternalItem => {
|
|
@@ -681,7 +697,7 @@ const applyCompanionToItems = (
|
|
|
681
697
|
return applied.items;
|
|
682
698
|
}
|
|
683
699
|
|
|
684
|
-
return applyToItem(entry);
|
|
700
|
+
return isPrimitiveRow(entry) ? entry : applyToItem(entry);
|
|
685
701
|
});
|
|
686
702
|
|
|
687
703
|
return { items: nextItems, found };
|
|
@@ -692,8 +708,8 @@ const applyCompanionToItems = (
|
|
|
692
708
|
* inline group sharing its `id` (inheriting any fields it doesn't declare),
|
|
693
709
|
* otherwise it is appended.
|
|
694
710
|
*/
|
|
695
|
-
const mergedItems = computed<
|
|
696
|
-
let base:
|
|
711
|
+
const mergedItems = computed<ItemEntry[]>(() => {
|
|
712
|
+
let base: ItemEntry[] = [...(props.items ?? [])];
|
|
697
713
|
|
|
698
714
|
for (const companion of companionGroups.value) {
|
|
699
715
|
const baseline = findGroupById(base, companion.key);
|
|
@@ -809,8 +825,12 @@ const isPipelineGroup = (group: InternalGroup) =>
|
|
|
809
825
|
group.max != null;
|
|
810
826
|
|
|
811
827
|
/** Ids of every pipeline group declared in `items`, at any nesting depth. */
|
|
812
|
-
const collectPipelineKeys = (
|
|
828
|
+
const collectPipelineKeys = (
|
|
829
|
+
items: ItemEntry[],
|
|
830
|
+
acc: string[] = []
|
|
831
|
+
): string[] => {
|
|
813
832
|
for (const entry of items) {
|
|
833
|
+
if (isPrimitiveRow(entry)) continue;
|
|
814
834
|
if (isGroup(entry)) {
|
|
815
835
|
if (entry.id && isPipelineGroup(entry)) acc.push(entry.id);
|
|
816
836
|
for (const child of groupItemsAsArray(entry.items)) {
|
|
@@ -900,7 +920,7 @@ const groupFlagsFor = (key: string) => {
|
|
|
900
920
|
|
|
901
921
|
/** A normalized group (with resolved items) by id at any nesting depth. */
|
|
902
922
|
const findRenderGroupDeep = (key: string): NormalizedGroup | undefined => {
|
|
903
|
-
const walk = (items:
|
|
923
|
+
const walk = (items: ItemEntry[]): NormalizedGroup | undefined => {
|
|
904
924
|
for (const group of normalizeGroups(items)) {
|
|
905
925
|
if (group.id === key) return group;
|
|
906
926
|
for (const item of group.items) {
|
|
@@ -1006,11 +1026,116 @@ provideDropdownGroupRegistry({
|
|
|
1006
1026
|
multipleFor: (key) => groupFlagsFor(key)?.multiple,
|
|
1007
1027
|
});
|
|
1008
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
|
+
|
|
1009
1130
|
// --- public read-only context (`useBbDropdown`) -------------------
|
|
1010
1131
|
|
|
1011
1132
|
/** Ids of every selectable group declared in `items`, at any nesting depth. */
|
|
1012
|
-
const collectSelectableKeys = (
|
|
1133
|
+
const collectSelectableKeys = (
|
|
1134
|
+
items: ItemEntry[],
|
|
1135
|
+
acc: string[] = []
|
|
1136
|
+
): string[] => {
|
|
1013
1137
|
for (const entry of items) {
|
|
1138
|
+
if (isPrimitiveRow(entry)) continue;
|
|
1014
1139
|
if (isGroup(entry)) {
|
|
1015
1140
|
if (entry.id && isSelectableGroup(entry)) acc.push(entry.id);
|
|
1016
1141
|
for (const child of groupItemsAsArray(entry.items)) {
|
|
@@ -1082,6 +1207,7 @@ const contextGroups = computed<Record<string, BbDropdownGroupState>>(() => {
|
|
|
1082
1207
|
// by `useBbDropdown`, so it never registers (no wasted node).
|
|
1083
1208
|
useBbDropdownHost(() => props.id, {
|
|
1084
1209
|
open: () => open.value,
|
|
1210
|
+
empty: () => empty.value,
|
|
1085
1211
|
groups: () => contextGroups.value,
|
|
1086
1212
|
});
|
|
1087
1213
|
|
|
@@ -1229,9 +1355,12 @@ const focusActivator = () => {
|
|
|
1229
1355
|
// its own id (see the adoption watch), so an id lookup would no-op.
|
|
1230
1356
|
const button =
|
|
1231
1357
|
activator.value ??
|
|
1232
|
-
(activatorId.value ? document.getElementById(activatorId.value) : null)
|
|
1358
|
+
(activatorId.value ? document.getElementById(activatorId.value) : null) ??
|
|
1359
|
+
returnFocusTo;
|
|
1233
1360
|
button?.focus();
|
|
1234
1361
|
};
|
|
1362
|
+
/** A menu opened from code has no activator: focus goes back where it was. */
|
|
1363
|
+
let returnFocusTo: HTMLElement | null = null;
|
|
1235
1364
|
|
|
1236
1365
|
provideDropdownContext({
|
|
1237
1366
|
passthrough,
|
|
@@ -1303,7 +1432,8 @@ provideDropdownContext({
|
|
|
1303
1432
|
});
|
|
1304
1433
|
|
|
1305
1434
|
const onClick = (event: MouseEvent) => {
|
|
1306
|
-
|
|
1435
|
+
// Empty: inert, and the click goes on to the app's own handlers.
|
|
1436
|
+
if (props.disabled || empty.value) return;
|
|
1307
1437
|
if (longPressTriggered) {
|
|
1308
1438
|
longPressTriggered = false;
|
|
1309
1439
|
event.preventDefault();
|
|
@@ -1338,7 +1468,8 @@ const focusPressedActivator = (event: MouseEvent) => {
|
|
|
1338
1468
|
};
|
|
1339
1469
|
|
|
1340
1470
|
const onContextMenu = async (event: MouseEvent) => {
|
|
1341
|
-
|
|
1471
|
+
// Empty: the browser's own menu comes back (no preventDefault).
|
|
1472
|
+
if (props.disabled || empty.value) return;
|
|
1342
1473
|
event.preventDefault();
|
|
1343
1474
|
event.stopPropagation();
|
|
1344
1475
|
if (props.placement === 'cursor') {
|
|
@@ -1369,7 +1500,7 @@ const clearLongPress = () => {
|
|
|
1369
1500
|
};
|
|
1370
1501
|
|
|
1371
1502
|
const onPointerDown = (event: PointerEvent) => {
|
|
1372
|
-
if (props.disabled || event.pointerType === 'mouse') return;
|
|
1503
|
+
if (props.disabled || empty.value || event.pointerType === 'mouse') return;
|
|
1373
1504
|
longPressTriggered = false;
|
|
1374
1505
|
longPressOrigin = { x: event.clientX, y: event.clientY };
|
|
1375
1506
|
longPressTimer = setTimeout(() => {
|
|
@@ -1399,8 +1530,20 @@ const onPointerUp = () => {
|
|
|
1399
1530
|
clearLongPress();
|
|
1400
1531
|
};
|
|
1401
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
|
+
|
|
1402
1545
|
const onKeydown = async (event: KeyboardEvent) => {
|
|
1403
|
-
if (props.disabled) return;
|
|
1546
|
+
if (props.disabled || empty.value) return;
|
|
1404
1547
|
|
|
1405
1548
|
// The row is focused a task after the key: `focusVisible`, or Firefox
|
|
1406
1549
|
// draws no ring after a click-open (it grants one only inside the handler).
|
|
@@ -1516,6 +1659,8 @@ const onEsc = (event: KeyboardEvent) => {
|
|
|
1516
1659
|
closeDropdown();
|
|
1517
1660
|
};
|
|
1518
1661
|
const openDropdown = async () => {
|
|
1662
|
+
// No visible row: nothing opens, whatever asked.
|
|
1663
|
+
if (empty.value) return;
|
|
1519
1664
|
// Latch the surface for this open cycle before anything reads it.
|
|
1520
1665
|
surface.value = resolveSurface();
|
|
1521
1666
|
ignoreNextIntersection = true;
|
|
@@ -1556,6 +1701,26 @@ const closeDropdown = async () => {
|
|
|
1556
1701
|
pause();
|
|
1557
1702
|
};
|
|
1558
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
|
+
|
|
1559
1724
|
const removeDocumentListeners = () => {
|
|
1560
1725
|
removeEscapeEntry(escapeKey);
|
|
1561
1726
|
document.removeEventListener('click', onOutsideInteraction);
|
|
@@ -1637,12 +1802,14 @@ watch(
|
|
|
1637
1802
|
el.addEventListener('pointermove', onPointerMove);
|
|
1638
1803
|
el.addEventListener('pointerup', onPointerUp);
|
|
1639
1804
|
el.addEventListener('pointercancel', onPointerUp);
|
|
1805
|
+
el.addEventListener('touchend', onTouchEnd);
|
|
1640
1806
|
removers.push(() => {
|
|
1641
1807
|
el.removeEventListener('contextmenu', onContextMenu);
|
|
1642
1808
|
el.removeEventListener('pointerdown', onPointerDown);
|
|
1643
1809
|
el.removeEventListener('pointermove', onPointerMove);
|
|
1644
1810
|
el.removeEventListener('pointerup', onPointerUp);
|
|
1645
1811
|
el.removeEventListener('pointercancel', onPointerUp);
|
|
1812
|
+
el.removeEventListener('touchend', onTouchEnd);
|
|
1646
1813
|
clearLongPress();
|
|
1647
1814
|
});
|
|
1648
1815
|
}
|
|
@@ -1663,9 +1830,16 @@ watch(
|
|
|
1663
1830
|
|
|
1664
1831
|
// Update reactive ARIA attributes
|
|
1665
1832
|
watch(
|
|
1666
|
-
[activator, open, hasOpenedOnce, popupRole, controlsId] as const,
|
|
1667
|
-
([el, isOpen, opened, role, controls]) => {
|
|
1833
|
+
[activator, open, hasOpenedOnce, popupRole, controlsId, empty] as const,
|
|
1834
|
+
([el, isOpen, opened, role, controls, isEmpty]) => {
|
|
1668
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
|
+
}
|
|
1669
1843
|
|
|
1670
1844
|
el.setAttribute('aria-haspopup', role);
|
|
1671
1845
|
el.setAttribute('aria-expanded', opened ? String(isOpen) : 'false');
|
|
@@ -1858,7 +2032,7 @@ export type BbDropdownItemProps<T = any> = ItemProps<T, DropdownItemFields>;
|
|
|
1858
2032
|
*/
|
|
1859
2033
|
type SubmenuExclusive =
|
|
1860
2034
|
| {
|
|
1861
|
-
items:
|
|
2035
|
+
items: ItemEntry[];
|
|
1862
2036
|
/** A submenu row opens its submenu; it cannot also run an action. */
|
|
1863
2037
|
onClick?: never;
|
|
1864
2038
|
/** A submenu row opens its submenu; it cannot also navigate. */
|
|
@@ -1874,6 +2048,8 @@ export type InternalItem = Omit<
|
|
|
1874
2048
|
> &
|
|
1875
2049
|
SubmenuExclusive &
|
|
1876
2050
|
DropdownEntryBase & {
|
|
2051
|
+
/** Rows have no search box (a group has); declared so a group's `searchable` discriminates. */
|
|
2052
|
+
searchable?: never;
|
|
1877
2053
|
/** The row's text. */
|
|
1878
2054
|
label: string;
|
|
1879
2055
|
/**
|
|
@@ -1935,27 +2111,32 @@ export type InternalItem = Omit<
|
|
|
1935
2111
|
* when its latest load FAILED (`'failed'`: the footer under whatever rows a
|
|
1936
2112
|
* `stash` keeps listed). Rendered as a non-interactive row that
|
|
1937
2113
|
* shows `label` or, when provided, the dropdown's `loading` / `empty` slot.
|
|
1938
|
-
*
|
|
2114
|
+
*
|
|
2115
|
+
* @internal Set by `BbDropdownGroup`.
|
|
1939
2116
|
*/
|
|
1940
2117
|
placeholder?: 'loading' | 'empty' | 'failed';
|
|
1941
2118
|
/**
|
|
1942
2119
|
* On a `'failed'` placeholder: what the group's `items` load rejected
|
|
1943
|
-
* with
|
|
1944
|
-
*
|
|
2120
|
+
* with, handed to the `empty` slot as `error`.
|
|
2121
|
+
*
|
|
2122
|
+
* @internal Set by the pipeline resolver.
|
|
1945
2123
|
*/
|
|
1946
2124
|
error?: unknown;
|
|
1947
2125
|
/**
|
|
1948
2126
|
* Marks a row built by the pipeline resolver from a fetched item. Its
|
|
1949
2127
|
* `selectable` predicate already ran against the RAW item there, so
|
|
1950
2128
|
* `normalizeGroups` must not run it again against this row object.
|
|
1951
|
-
*
|
|
2129
|
+
*
|
|
2130
|
+
* @internal
|
|
1952
2131
|
*/
|
|
1953
2132
|
fetched?: true;
|
|
1954
2133
|
/**
|
|
1955
2134
|
* Optional slot token used to resolve per-item named slots. Primarily set
|
|
1956
2135
|
* by the pipeline resolver so slot names can be derived from the resolved
|
|
1957
2136
|
* `itemValue` (readable), while `rowKey` remains the hash-based selection
|
|
1958
|
-
* id.
|
|
2137
|
+
* id.
|
|
2138
|
+
*
|
|
2139
|
+
* @internal
|
|
1959
2140
|
*/
|
|
1960
2141
|
slotKey?: string;
|
|
1961
2142
|
};
|
|
@@ -1986,16 +2167,24 @@ export type InternalItem = Omit<
|
|
|
1986
2167
|
*
|
|
1987
2168
|
* A provider signals a failure by THROWING, never by returning `[]`: the
|
|
1988
2169
|
* rows are cleared, nothing is pruned, and the `empty` placeholder shows
|
|
1989
|
-
* `failedText` with the error. Zero-argument providers keep working.
|
|
1990
|
-
*
|
|
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`.
|
|
1991
2174
|
*/
|
|
1992
|
-
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
|
|
1993
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
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
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[]>;
|
|
1999
2188
|
|
|
2000
2189
|
export type InternalGroup = DropdownEntryBase & {
|
|
2001
2190
|
/**
|
|
@@ -2035,23 +2224,9 @@ export type InternalGroup = DropdownEntryBase & {
|
|
|
2035
2224
|
*/
|
|
2036
2225
|
group?: true;
|
|
2037
2226
|
/**
|
|
2038
|
-
*
|
|
2039
|
-
*
|
|
2040
|
-
*
|
|
2041
|
-
* `({ reason, modelValue, signal }) => Item[] | Promise<Item[]>` (plus
|
|
2042
|
-
* `query` when the group is `searchable`; see {@link DropdownGroupItemsGetter})
|
|
2043
|
-
* and pair it with `itemText`/`itemValue`. A `<BbDropdownGroup :id v-model>`
|
|
2044
|
-
* companion resolves such a group and surfaces the selected `itemValue`(s)
|
|
2045
|
-
* through `v-model`.
|
|
2046
|
-
*/
|
|
2047
|
-
items:
|
|
2048
|
-
| Array<InternalItem | InternalItem[]>
|
|
2049
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- a fetched group's raw records, before normalisation (see `itemText`)
|
|
2050
|
-
| any[]
|
|
2051
|
-
| DropdownGroupItemsGetter;
|
|
2052
|
-
/**
|
|
2053
|
-
* Pipeline groups only. Path/getter producing each item's display text
|
|
2054
|
-
* (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).
|
|
2055
2230
|
*
|
|
2056
2231
|
* Unset: own `label`, else `text` (`{ label, value }` needs no accessor).
|
|
2057
2232
|
*
|
|
@@ -2148,17 +2323,6 @@ export type InternalGroup = DropdownEntryBase & {
|
|
|
2148
2323
|
* @defaultValue `'interaction'`
|
|
2149
2324
|
*/
|
|
2150
2325
|
prefill?: boolean | 'interaction';
|
|
2151
|
-
/**
|
|
2152
|
-
* Renders a search field at the top of THIS group (so, inside its submenu when
|
|
2153
|
-
* the group is one), scoped to this group alone — the nested "category ›
|
|
2154
|
-
* searchable options" pattern. Typing narrows this group's rows by
|
|
2155
|
-
* the ranked search (see `filterBy`) and, for an async group, passes
|
|
2156
|
-
* the typed text to its getter as the context's `query` (a user search arrives
|
|
2157
|
-
* with `reason: 'search'`, as on `BbSelect`; see
|
|
2158
|
-
* `BbDropdownGroupItemsContext`). Each searchable group owns its own query,
|
|
2159
|
-
* independent of its siblings.
|
|
2160
|
-
*/
|
|
2161
|
-
searchable?: boolean;
|
|
2162
2326
|
/** Placeholder for this group's search field. Defaults to the localized label. */
|
|
2163
2327
|
searchPlaceholder?: string;
|
|
2164
2328
|
/**
|
|
@@ -2215,7 +2379,65 @@ export type InternalGroup = DropdownEntryBase & {
|
|
|
2215
2379
|
* category, yet still wants a label for chips.
|
|
2216
2380
|
*/
|
|
2217
2381
|
hideLabel?: boolean;
|
|
2218
|
-
};
|
|
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[];
|
|
2219
2441
|
|
|
2220
2442
|
/**
|
|
2221
2443
|
* A group's items as a raw array, or `[]` when the items are still an
|
|
@@ -2228,6 +2450,17 @@ export const groupItemsAsArray = (
|
|
|
2228
2450
|
): Array<InternalItem | InternalItem[]> =>
|
|
2229
2451
|
Array.isArray(items) ? (items as Array<InternalItem | InternalItem[]>) : [];
|
|
2230
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
|
+
|
|
2231
2464
|
/**
|
|
2232
2465
|
* Items accepted by the dropdown. Entries can be:
|
|
2233
2466
|
* - a single {@link InternalItem};
|
|
@@ -2236,7 +2469,12 @@ export const groupItemsAsArray = (
|
|
|
2236
2469
|
*
|
|
2237
2470
|
* The shapes can be mixed, e.g. `[item, [item, item], { id, label, items }]`.
|
|
2238
2471
|
*/
|
|
2239
|
-
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 });
|
|
2240
2478
|
|
|
2241
2479
|
/** Unwraps the item type out of the (possibly nested) {@link Items} shape. */
|
|
2242
2480
|
export type FlatItem<T> = T extends Array<infer U> ? U : T;
|
|
@@ -2267,7 +2505,17 @@ export const selectablePredicateOf = (
|
|
|
2267
2505
|
): ((item: any) => boolean) | undefined =>
|
|
2268
2506
|
typeof entry.selectable === 'function' ? entry.selectable : undefined;
|
|
2269
2507
|
|
|
2270
|
-
|
|
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 &&
|
|
2271
2519
|
!Array.isArray(entry) &&
|
|
2272
2520
|
((entry as InternalGroup).group === true ||
|
|
2273
2521
|
'selectable' in entry ||
|
|
@@ -2612,7 +2860,13 @@ export type BbDropdownProps = BbDropdownPtProps & {
|
|
|
2612
2860
|
*
|
|
2613
2861
|
* @defaultValue `[]`
|
|
2614
2862
|
*/
|
|
2615
|
-
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;
|
|
2616
2870
|
/**
|
|
2617
2871
|
* Default placeholder text shown while a pipeline group's async items load.
|
|
2618
2872
|
* A group's own `loadingText` overrides this; both fall back to the localized
|
|
@@ -2651,9 +2905,8 @@ export type BbDropdownProps = BbDropdownPtProps & {
|
|
|
2651
2905
|
*/
|
|
2652
2906
|
padding?: number;
|
|
2653
2907
|
/**
|
|
2654
|
-
* Position
|
|
2655
|
-
*
|
|
2656
|
-
* (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).
|
|
2657
2910
|
*
|
|
2658
2911
|
* @defaultValue `'bottom'`
|
|
2659
2912
|
*/
|
|
@@ -2702,8 +2955,7 @@ export type BbDropdownEvents = {
|
|
|
2702
2955
|
/**
|
|
2703
2956
|
* The user selected a row in a selectable group, at the click — also when a
|
|
2704
2957
|
* controlled companion's app then refuses the value. The payload is the
|
|
2705
|
-
* row's value (its `item-value` for pipeline groups, else its `value`)
|
|
2706
|
-
* symmetric with `BbTable`'s `item:selected`.
|
|
2958
|
+
* row's value (its `item-value` for pipeline groups, else its `value`).
|
|
2707
2959
|
*/
|
|
2708
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)`
|
|
2709
2961
|
(e: 'item:selected', value: any): void;
|
|
@@ -2726,6 +2978,8 @@ export type BbDropdownActivatorProps = {
|
|
|
2726
2978
|
export type BbDropdownActivatorSlotProps = {
|
|
2727
2979
|
/** Whether the dropdown is globally disabled. */
|
|
2728
2980
|
disabled?: boolean;
|
|
2981
|
+
/** No row is visible: the trigger is inert. */
|
|
2982
|
+
empty: boolean;
|
|
2729
2983
|
/**
|
|
2730
2984
|
* Whether any item's async `onClick` is currently in flight. Use to reflect a
|
|
2731
2985
|
* global busy state on the trigger.
|
|
@@ -2879,9 +3133,8 @@ export type BbDropdownSlots = {
|
|
|
2879
3133
|
*/
|
|
2880
3134
|
activator?: (props: BbDropdownActivatorSlotProps) => any;
|
|
2881
3135
|
/**
|
|
2882
|
-
*
|
|
2883
|
-
*
|
|
2884
|
-
* 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.
|
|
2885
3138
|
*/
|
|
2886
3139
|
header?: (props: BbDropdownEdgeSlotProps) => any;
|
|
2887
3140
|
/**
|
|
@@ -2896,9 +3149,8 @@ export type BbDropdownSlots = {
|
|
|
2896
3149
|
*/
|
|
2897
3150
|
'item:append'?: (props: BbDropdownItemSlotProps) => any;
|
|
2898
3151
|
/**
|
|
2899
|
-
*
|
|
2900
|
-
*
|
|
2901
|
-
* divider — for action buttons.
|
|
3152
|
+
* Pinned below the rows, outside their scroll, with a divider — for
|
|
3153
|
+
* action buttons.
|
|
2902
3154
|
*/
|
|
2903
3155
|
footer?: (props: BbDropdownEdgeSlotProps) => any;
|
|
2904
3156
|
} & Record<string, (props: BbDropdownItemSlotProps) => any>;
|
|
@@ -3837,7 +4089,7 @@ export type BbDropdownGroupEvents = {
|
|
|
3837
4089
|
/* Same chevron_right asset the submenu rows use, pointed back:
|
|
3838
4090
|
toward the inline start, which is already where it points in
|
|
3839
4091
|
rtl. */
|
|
3840
|
-
.bb-
|
|
4092
|
+
.bb-button__prepend-icon {
|
|
3841
4093
|
transform: rotate(180deg);
|
|
3842
4094
|
|
|
3843
4095
|
&:dir(rtl) {
|