bitboss-ui 3.0.0-beta.71 → 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 +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 +230 -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 +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 +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 +238 -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 +69 -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 +144 -10
- 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 +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/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 +1984 -1145
- 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/utils/versionCheck.js +1 -1
- package/llms.txt +2 -2
- package/package.json +11 -1
- package/scripts/README.md +31 -27
- 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/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/tab-links.mjs +4 -1
- package/scripts/lib/tree-default-expandable.mjs +53 -0
- package/scripts/lib/validate-bb-markup.mjs +536 -52
|
@@ -610,13 +610,25 @@
|
|
|
610
610
|
</div>
|
|
611
611
|
</div>
|
|
612
612
|
<input v-for="input in hiddenInputs" :key="input.value" v-bind="input" />
|
|
613
|
+
<BbTableRowMenu
|
|
614
|
+
v-if="rowMenu"
|
|
615
|
+
ref="rowMenuEl"
|
|
616
|
+
:items="rowMenuItems"
|
|
617
|
+
:label="actionsText || t('table.actionsText').value"
|
|
618
|
+
@hide="onRowMenuHide"
|
|
619
|
+
/>
|
|
613
620
|
</component>
|
|
614
621
|
</template>
|
|
615
622
|
|
|
616
623
|
<script
|
|
617
624
|
setup
|
|
618
625
|
lang="ts"
|
|
619
|
-
generic="
|
|
626
|
+
generic="
|
|
627
|
+
Item = any,
|
|
628
|
+
T extends ItemKey<Item> = string & {},
|
|
629
|
+
A extends string | ((...args: never[]) => unknown) | undefined = undefined,
|
|
630
|
+
M extends boolean = true
|
|
631
|
+
"
|
|
620
632
|
>
|
|
621
633
|
import BbIcon from '../BbIcon/BbIcon.vue';
|
|
622
634
|
import moveSvg from '@/assets/svgs/move.svg?raw';
|
|
@@ -642,9 +654,11 @@ import {
|
|
|
642
654
|
toRaw,
|
|
643
655
|
toRef,
|
|
644
656
|
useAttrs,
|
|
657
|
+
useModel,
|
|
645
658
|
watch,
|
|
646
659
|
watchEffect,
|
|
647
660
|
type FunctionalComponent,
|
|
661
|
+
type Ref,
|
|
648
662
|
} from 'vue';
|
|
649
663
|
import {
|
|
650
664
|
defaultRangeExtractor,
|
|
@@ -691,6 +705,11 @@ import {
|
|
|
691
705
|
import BbTableDataRow from './BbTableDataRow';
|
|
692
706
|
import BbTableExpandRow from './BbTableExpandRow';
|
|
693
707
|
import BbTableEdgeRow from './BbTableEdgeRow';
|
|
708
|
+
import BbTableRowMenu from './BbTableRowMenu';
|
|
709
|
+
import { hasVisibleRow } from '../BbDropdown/normalizeGroups';
|
|
710
|
+
import type { Item as DropdownItem } from '../BbDropdown/types';
|
|
711
|
+
import type { VirtualAnchor } from '@/types/CommonProps';
|
|
712
|
+
import type { DropdownHandle } from '../BbDropdown/dropdownHandle';
|
|
694
713
|
import { pressedInteractive, useRowReorder } from './useRowReorder';
|
|
695
714
|
import type { RowReorderRowContext } from './useRowReorder';
|
|
696
715
|
import { BB_TABLE_PT } from './types';
|
|
@@ -699,6 +718,16 @@ import type { DataRowContext } from './BbTableDataRow';
|
|
|
699
718
|
import type { EdgeRowContext } from './BbTableEdgeRow';
|
|
700
719
|
import type { Option as BaseOption } from '@/types/Option';
|
|
701
720
|
import type { ColumnName } from '@/types/ColumnName';
|
|
721
|
+
import type {
|
|
722
|
+
ColumnContentOf,
|
|
723
|
+
ColumnKeyInput,
|
|
724
|
+
ItemKeyInput,
|
|
725
|
+
MultipleInput,
|
|
726
|
+
SelectModelOf,
|
|
727
|
+
TableValueOf,
|
|
728
|
+
} from '@/types/ItemPath';
|
|
729
|
+
import type { ItemGetter } from '@/types/ItemAccessor';
|
|
730
|
+
import type { PtNoInfer } from '@/types/passthrough';
|
|
702
731
|
import type {
|
|
703
732
|
BbTableCellSlotProps,
|
|
704
733
|
BbTableColumn,
|
|
@@ -758,6 +787,9 @@ import {
|
|
|
758
787
|
} from './gridWidgets';
|
|
759
788
|
import BbBaseButton from '../BbBaseButton/BbBaseButton.vue';
|
|
760
789
|
|
|
790
|
+
/** A row's value through `item-value`: the whole row when it is unset. */
|
|
791
|
+
type RowValue = TableValueOf<Item, A>;
|
|
792
|
+
|
|
761
793
|
defineOptions({ inheritAttrs: false });
|
|
762
794
|
const selectAll = defineModel<boolean>('selectAll', {
|
|
763
795
|
required: false,
|
|
@@ -776,24 +808,23 @@ const order = defineModel<string[]>('order', {
|
|
|
776
808
|
|
|
777
809
|
// Highlight: documented on `BbTableProps.highlighted` (a JSDoc block here
|
|
778
810
|
// would be appended to the prop's description in the manifest).
|
|
779
|
-
//
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
default: undefined,
|
|
783
|
-
});
|
|
784
|
-
|
|
785
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- internal: the model's values, read through `item-value` (a key, a dot path or a function) and not resolved at the type level, like the public `modelValue`
|
|
786
|
-
const expandedItems = defineModel<any[]>('expandedItems', {
|
|
811
|
+
// Typed by `item-value` on the emit side; the prop stays `any` through
|
|
812
|
+
// `BbTableProps`, so a wider bound model still binds.
|
|
813
|
+
const highlighted = defineModel<RowValue | null>('highlighted', {
|
|
787
814
|
required: false,
|
|
788
|
-
|
|
815
|
+
// Unset (not `null`): bound or not is read off it.
|
|
816
|
+
default: undefined as never,
|
|
789
817
|
});
|
|
790
818
|
|
|
791
819
|
// The element(s) the fall-through attributes reach, as typed below.
|
|
792
820
|
// @attrTargets div fieldset
|
|
793
821
|
const props = withDefaults(
|
|
794
822
|
defineProps<
|
|
795
|
-
InternalProps<T> &
|
|
796
|
-
|
|
823
|
+
InternalProps<T> & /* @vue-ignore */ {
|
|
824
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- a getter returns any value; `A` reads which
|
|
825
|
+
itemValue?: ItemKeyInput<Item, A> | ItemGetter<Item, any>;
|
|
826
|
+
multiple?: MultipleInput<M, true>;
|
|
827
|
+
} & /* @vue-ignore */ FallthroughAttrs<
|
|
797
828
|
'div' | 'fieldset',
|
|
798
829
|
InternalProps<T>,
|
|
799
830
|
BbTableEvents<Item>
|
|
@@ -805,8 +836,10 @@ const props = withDefaults(
|
|
|
805
836
|
dependencies: () => [],
|
|
806
837
|
depsDebounceTime: 0,
|
|
807
838
|
items: () => [],
|
|
839
|
+
expandedItems: () => [],
|
|
808
840
|
max: Infinity,
|
|
809
|
-
multiple
|
|
841
|
+
// `M` reads a written `multiple`; the default stays `true` at run time.
|
|
842
|
+
multiple: true as never,
|
|
810
843
|
modelValue: () => [],
|
|
811
844
|
unselectedItems: () => [],
|
|
812
845
|
// Unset follows the binding: on exactly when `highlighted` is bound.
|
|
@@ -815,12 +848,16 @@ const props = withDefaults(
|
|
|
815
848
|
compact: undefined,
|
|
816
849
|
}
|
|
817
850
|
);
|
|
818
|
-
const emit =
|
|
851
|
+
const emit =
|
|
852
|
+
defineEmits<BbTableEvents<Item, RowValue, SelectModelOf<RowValue, M>>>();
|
|
819
853
|
|
|
820
854
|
const slots = defineSlots<
|
|
821
|
-
BbTableSlots<Item> &
|
|
855
|
+
BbTableSlots<Item, RowValue> &
|
|
822
856
|
Partial<
|
|
823
|
-
Record<
|
|
857
|
+
Record<
|
|
858
|
+
InferredBodySlots,
|
|
859
|
+
(props: BbTableCellSlotProps<Item, RowValue>) => any
|
|
860
|
+
>
|
|
824
861
|
> &
|
|
825
862
|
Partial<
|
|
826
863
|
Record<InferredHeaderSlots, (props: BbTableHeaderSlotProps<Item>) => any>
|
|
@@ -836,6 +873,12 @@ const slots = defineSlots<
|
|
|
836
873
|
>
|
|
837
874
|
>();
|
|
838
875
|
|
|
876
|
+
// `defineModel` would type the prop from the model too; the prop keeps
|
|
877
|
+
// `BbTableProps`' `any[]` (a model of wider values still binds) and
|
|
878
|
+
// `BbTableEvents` types the emit. `useModel` is what `defineModel` compiles to.
|
|
879
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- the expanded rows' values, as the prop
|
|
880
|
+
const expandedItems = useModel(props, 'expandedItems') as Ref<any[]>;
|
|
881
|
+
|
|
839
882
|
const configDefaults = useConfigDefaults('BbTable', props, { compact: false });
|
|
840
883
|
|
|
841
884
|
/**
|
|
@@ -958,8 +1001,32 @@ const randomName = useId().id.value;
|
|
|
958
1001
|
const expandRegionId = (valueHash: string) =>
|
|
959
1002
|
`expanded_${randomName}_${valueHash}`;
|
|
960
1003
|
|
|
961
|
-
|
|
962
|
-
|
|
1004
|
+
// Inline columns infer one literal per key, so each column is checked against
|
|
1005
|
+
// its own key: a field path is walked (a typo past a real field fails), a
|
|
1006
|
+
// reserved key fails, and the formatter reads the field's type. Columns that
|
|
1007
|
+
// arrive typed as `BbTableColumn<Item>` widen `K` and keep the public shape.
|
|
1008
|
+
// The mapped form (not a distributive conditional) keeps `column.key` readable
|
|
1009
|
+
// in here while the key stays generic.
|
|
1010
|
+
type InternalColumn<K extends string> = [string] extends [K]
|
|
1011
|
+
? Omit<BbTableColumn<Item>, 'key'> & { key: K }
|
|
1012
|
+
: { [P in K]: LiteralColumn<P> }[K];
|
|
1013
|
+
|
|
1014
|
+
// What the error shows for a reserved key: the prop that renders that column.
|
|
1015
|
+
type ReservedKeyHint = {
|
|
1016
|
+
actions: 'reserved: the #actions slot adds this column';
|
|
1017
|
+
select: 'reserved: the selectable prop adds this column';
|
|
1018
|
+
};
|
|
1019
|
+
|
|
1020
|
+
type LiteralColumn<K extends string> = Omit<
|
|
1021
|
+
BbTableColumn<Item>,
|
|
1022
|
+
'key' | 'formatter'
|
|
1023
|
+
> & {
|
|
1024
|
+
key: K extends ReservedColumnKey
|
|
1025
|
+
? ReservedKeyHint[K]
|
|
1026
|
+
: ColumnKeyInput<PtNoInfer<Item>, K>;
|
|
1027
|
+
// A method, so a formatter annotated with the non-null field type still fits.
|
|
1028
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- as the public formatter: any return renders
|
|
1029
|
+
formatter?(content: ColumnContentOf<Item, K>, key: string, item: Item): any;
|
|
963
1030
|
};
|
|
964
1031
|
|
|
965
1032
|
type InternalProps<K extends string> = Omit<BbTableProps<Item>, 'columns'> & {
|
|
@@ -1140,8 +1207,231 @@ onBeforeUnmount(rowReorder.stop);
|
|
|
1140
1207
|
/** Row drags are delegated from the body (handle: any pointer; row: mouse / pen). */
|
|
1141
1208
|
const onBodyPointerDown = (event: PointerEvent) => {
|
|
1142
1209
|
if (rowDragActive.value) rowReorder.onBodyPointerDown(event);
|
|
1210
|
+
startLongPress(event);
|
|
1211
|
+
};
|
|
1212
|
+
|
|
1213
|
+
/* --- Row menu ---------------------------------------------
|
|
1214
|
+
* `row-menu`: ONE dropdown shared by every row, opened at the pointer by a
|
|
1215
|
+
* right-click or a touch long press, or under the focused cell by Shift+F10 /
|
|
1216
|
+
* the Menu key. The two the browser does not send everywhere arrive as a
|
|
1217
|
+
* `contextmenu` dispatched on the row, so `contextmenu:row` and the in-row
|
|
1218
|
+
* control rule hold for all of them. The row it is open on is marked with an
|
|
1219
|
+
* internal modifier; `v-model:highlighted` is never written (reflect, never
|
|
1220
|
+
* normalize). No visible item: no `preventDefault`, the browser's menu shows. */
|
|
1221
|
+
|
|
1222
|
+
const rowMenuEl = ref<DropdownHandle | null>(null);
|
|
1223
|
+
const rowMenuItems = shallowRef<DropdownItem[]>([]);
|
|
1224
|
+
/** The marked row: a Set, so a mark moving re-renders only the two rows. */
|
|
1225
|
+
const rowMenuRows = reactive(new Set<string>());
|
|
1226
|
+
/** What the `contextmenu` being dispatched stands for. */
|
|
1227
|
+
let pendingMenuModality: 'keyboard' | 'touch' | null = null;
|
|
1228
|
+
/** When a key or a long press last opened the menu (see `openRowMenu`). */
|
|
1229
|
+
let lastSyntheticOpen = 0;
|
|
1230
|
+
/** A long press opened the menu: the click its release makes is not a row click. */
|
|
1231
|
+
let swallowClick = false;
|
|
1232
|
+
/** The menu is on its way to another row: its closing keeps the new mark. */
|
|
1233
|
+
let reopening = false;
|
|
1234
|
+
const LONG_PRESS_DELAY = 500;
|
|
1235
|
+
const LONG_PRESS_MOVE = 10;
|
|
1236
|
+
let longPress: {
|
|
1237
|
+
timer: ReturnType<typeof setTimeout>;
|
|
1238
|
+
x: number;
|
|
1239
|
+
y: number;
|
|
1240
|
+
} | null = null;
|
|
1241
|
+
|
|
1242
|
+
const cancelLongPress = () => {
|
|
1243
|
+
if (longPress) clearTimeout(longPress.timer);
|
|
1244
|
+
longPress = null;
|
|
1245
|
+
};
|
|
1246
|
+
onBeforeUnmount(cancelLongPress);
|
|
1247
|
+
|
|
1248
|
+
/** A point that stays on the spot of `el` it was taken on while `el` scrolls. */
|
|
1249
|
+
const pointOn = (el: Element, x: number, y: number): VirtualAnchor => {
|
|
1250
|
+
let box = el.getBoundingClientRect();
|
|
1251
|
+
const dx = x - box.left;
|
|
1252
|
+
const dy = y - box.top;
|
|
1253
|
+
return {
|
|
1254
|
+
contextElement: el,
|
|
1255
|
+
getBoundingClientRect: () => {
|
|
1256
|
+
// A virtual window may unmount the row: the menu stays where it was.
|
|
1257
|
+
if (el.isConnected) box = el.getBoundingClientRect();
|
|
1258
|
+
const left = box.left + dx;
|
|
1259
|
+
const top = box.top + dy;
|
|
1260
|
+
return {
|
|
1261
|
+
x: left,
|
|
1262
|
+
y: top,
|
|
1263
|
+
width: 0,
|
|
1264
|
+
height: 0,
|
|
1265
|
+
top,
|
|
1266
|
+
left,
|
|
1267
|
+
right: left,
|
|
1268
|
+
bottom: top,
|
|
1269
|
+
};
|
|
1270
|
+
},
|
|
1271
|
+
};
|
|
1272
|
+
};
|
|
1273
|
+
|
|
1274
|
+
/** The data row of this table's body an event started in, unless it started on an in-row control. */
|
|
1275
|
+
const menuRowOf = (event: Event): Element | null => {
|
|
1276
|
+
const target = event.target;
|
|
1277
|
+
if (!(target instanceof Element)) return null;
|
|
1278
|
+
const row = target.closest('.bb-table__row');
|
|
1279
|
+
if (!row || row.closest('.bb-table__body') !== bodyRef.value) return null;
|
|
1280
|
+
return pressedInteractive(event, row) ? null : row;
|
|
1281
|
+
};
|
|
1282
|
+
|
|
1283
|
+
/** Sends the row a `contextmenu` at a point; whether the menu took it. */
|
|
1284
|
+
const dispatchRowMenu = (
|
|
1285
|
+
target: Element,
|
|
1286
|
+
x: number,
|
|
1287
|
+
y: number,
|
|
1288
|
+
modality: 'keyboard' | 'touch'
|
|
1289
|
+
) => {
|
|
1290
|
+
const event = new MouseEvent('contextmenu', {
|
|
1291
|
+
bubbles: true,
|
|
1292
|
+
cancelable: true,
|
|
1293
|
+
clientX: x,
|
|
1294
|
+
clientY: y,
|
|
1295
|
+
});
|
|
1296
|
+
pendingMenuModality = modality;
|
|
1297
|
+
try {
|
|
1298
|
+
target.dispatchEvent(event);
|
|
1299
|
+
} finally {
|
|
1300
|
+
pendingMenuModality = null;
|
|
1301
|
+
}
|
|
1302
|
+
return event.defaultPrevented;
|
|
1303
|
+
};
|
|
1304
|
+
|
|
1305
|
+
/**
|
|
1306
|
+
* A row's `contextmenu`, after `contextmenu:row` (an app that prevented it
|
|
1307
|
+
* took the gesture): opens the menu when the row has a visible item.
|
|
1308
|
+
*/
|
|
1309
|
+
const openRowMenu = (event: MouseEvent, valueHash: string, item: Item) => {
|
|
1310
|
+
const modality = pendingMenuModality;
|
|
1311
|
+
if (!props.rowMenu || event.defaultPrevented) return;
|
|
1312
|
+
// The browser's own `contextmenu` after a long press (Android) or a key
|
|
1313
|
+
// that already opened the menu here: the same gesture, not a second one.
|
|
1314
|
+
if (
|
|
1315
|
+
event.isTrusted &&
|
|
1316
|
+
rowMenuRows.has(valueHash) &&
|
|
1317
|
+
performance.now() - lastSyntheticOpen < 1000
|
|
1318
|
+
) {
|
|
1319
|
+
event.preventDefault();
|
|
1320
|
+
event.stopPropagation();
|
|
1321
|
+
return;
|
|
1322
|
+
}
|
|
1323
|
+
const items = props.rowMenu(item as PtNoInfer<Item>);
|
|
1324
|
+
if (!hasVisibleRow(items)) return;
|
|
1325
|
+
// Kept from the open menu's outside-click listener, as BbDropdown's own
|
|
1326
|
+
// right-click does: the menu moves to this row itself, closing first.
|
|
1327
|
+
event.preventDefault();
|
|
1328
|
+
event.stopPropagation();
|
|
1329
|
+
if (modality) lastSyntheticOpen = performance.now();
|
|
1330
|
+
const row = event.currentTarget as Element;
|
|
1331
|
+
const focused = document.activeElement;
|
|
1332
|
+
const returnTo =
|
|
1333
|
+
focused instanceof HTMLElement && row.contains(focused) ? focused : null;
|
|
1334
|
+
reopening = true;
|
|
1335
|
+
rowMenuRows.clear();
|
|
1336
|
+
rowMenuRows.add(valueHash);
|
|
1337
|
+
rowMenuItems.value = items;
|
|
1338
|
+
const at = pointOn(row, event.clientX, event.clientY);
|
|
1339
|
+
void nextTick(async () => {
|
|
1340
|
+
await rowMenuEl.value?.open(
|
|
1341
|
+
at,
|
|
1342
|
+
modality === 'keyboard' ? 'keyboard' : 'pointer',
|
|
1343
|
+
returnTo
|
|
1344
|
+
);
|
|
1345
|
+
reopening = false;
|
|
1346
|
+
});
|
|
1347
|
+
};
|
|
1348
|
+
|
|
1349
|
+
/** A close (either end of it): the mark goes unless the menu is open or reopening. */
|
|
1350
|
+
const onRowMenuHide = () => {
|
|
1351
|
+
if (!reopening && !rowMenuEl.value?.isOpen()) rowMenuRows.clear();
|
|
1352
|
+
};
|
|
1353
|
+
|
|
1354
|
+
/** Shift+F10 / the Menu key on a focused row or cell: the menu under it. */
|
|
1355
|
+
const onBodyKeydown = (event: KeyboardEvent) => {
|
|
1356
|
+
if (!props.rowMenu) return;
|
|
1357
|
+
if (event.key !== 'ContextMenu' && !(event.key === 'F10' && event.shiftKey))
|
|
1358
|
+
return;
|
|
1359
|
+
if (!menuRowOf(event)) return;
|
|
1360
|
+
const target = event.target as Element;
|
|
1361
|
+
const box = target.getBoundingClientRect();
|
|
1362
|
+
if (dispatchRowMenu(target, box.left, box.bottom, 'keyboard'))
|
|
1363
|
+
event.preventDefault();
|
|
1364
|
+
};
|
|
1365
|
+
|
|
1366
|
+
/** A touch held still on a row for half a second: the menu at the finger. */
|
|
1367
|
+
const startLongPress = (event: PointerEvent) => {
|
|
1368
|
+
swallowClick = false;
|
|
1369
|
+
cancelLongPress();
|
|
1370
|
+
if (!props.rowMenu || event.pointerType !== 'touch') return;
|
|
1371
|
+
if (!menuRowOf(event)) return;
|
|
1372
|
+
const target = event.target as Element;
|
|
1373
|
+
const { clientX: x, clientY: y } = event;
|
|
1374
|
+
longPress = {
|
|
1375
|
+
x,
|
|
1376
|
+
y,
|
|
1377
|
+
timer: setTimeout(() => {
|
|
1378
|
+
longPress = null;
|
|
1379
|
+
if (target.isConnected && dispatchRowMenu(target, x, y, 'touch'))
|
|
1380
|
+
swallowClick = true;
|
|
1381
|
+
}, LONG_PRESS_DELAY),
|
|
1382
|
+
};
|
|
1143
1383
|
};
|
|
1144
1384
|
|
|
1385
|
+
/** A finger that moves (a scroll, a drag) is no long press. */
|
|
1386
|
+
const onBodyPointerMove = (event: PointerEvent) => {
|
|
1387
|
+
if (!longPress) return;
|
|
1388
|
+
if (
|
|
1389
|
+
Math.hypot(event.clientX - longPress.x, event.clientY - longPress.y) >
|
|
1390
|
+
LONG_PRESS_MOVE
|
|
1391
|
+
)
|
|
1392
|
+
cancelLongPress();
|
|
1393
|
+
};
|
|
1394
|
+
|
|
1395
|
+
/**
|
|
1396
|
+
* The finger lifting after a long press opened the menu: no mouse events
|
|
1397
|
+
* follow. The browser would otherwise send the mousedown / click a tap makes
|
|
1398
|
+
* to whatever is under the finger now: a phone's sheet backdrop, which closes
|
|
1399
|
+
* the menu the press just opened (measured, real CDP touch).
|
|
1400
|
+
*/
|
|
1401
|
+
const onBodyTouchEnd = (event: TouchEvent) => {
|
|
1402
|
+
if (swallowClick && event.cancelable) event.preventDefault();
|
|
1403
|
+
};
|
|
1404
|
+
|
|
1405
|
+
const onBodyClickCapture = (event: MouseEvent) => {
|
|
1406
|
+
if (!swallowClick) return;
|
|
1407
|
+
swallowClick = false;
|
|
1408
|
+
event.preventDefault();
|
|
1409
|
+
event.stopPropagation();
|
|
1410
|
+
};
|
|
1411
|
+
|
|
1412
|
+
/**
|
|
1413
|
+
* Bound natively, not as template `@listeners`: a Vue listener on the body
|
|
1414
|
+
* stamps every keydown / click it sees, and the table's own grid handlers
|
|
1415
|
+
* further out then drop an event fired in the millisecond the table mounted
|
|
1416
|
+
* (Vue's same-ms invoker guard: a cell focused at mount lost its ArrowUp).
|
|
1417
|
+
*/
|
|
1418
|
+
const bodyListeners: Array<[string, (event: Event) => void, boolean]> = [
|
|
1419
|
+
['click', onBodyClickCapture as (event: Event) => void, true],
|
|
1420
|
+
['keydown', onBodyKeydown as (event: Event) => void, false],
|
|
1421
|
+
['pointercancel', cancelLongPress, false],
|
|
1422
|
+
['pointermove', onBodyPointerMove as (event: Event) => void, false],
|
|
1423
|
+
['pointerup', cancelLongPress, false],
|
|
1424
|
+
['touchend', onBodyTouchEnd as (event: Event) => void, false],
|
|
1425
|
+
];
|
|
1426
|
+
onMounted(() => {
|
|
1427
|
+
for (const [type, fn, capture] of bodyListeners)
|
|
1428
|
+
bodyRef.value?.addEventListener(type, fn, { capture });
|
|
1429
|
+
});
|
|
1430
|
+
onBeforeUnmount(() => {
|
|
1431
|
+
for (const [type, fn, capture] of bodyListeners)
|
|
1432
|
+
bodyRef.value?.removeEventListener(type, fn, { capture });
|
|
1433
|
+
});
|
|
1434
|
+
|
|
1145
1435
|
/** What every data row's handle needs, stable until a table-level input moves. */
|
|
1146
1436
|
const rowReorderContext = computed<RowReorderRowContext | null>(() => {
|
|
1147
1437
|
if (!rowDragActive.value) return null;
|
|
@@ -5223,6 +5513,7 @@ const buildProjectedItem = (index: number): ProjectedItem => {
|
|
|
5223
5513
|
const item = liveOptionFor(index, base.valueHash);
|
|
5224
5514
|
if (!item || fromControl(event)) return;
|
|
5225
5515
|
emit('contextmenu:row', event, item.item);
|
|
5516
|
+
openRowMenu(event, item.valueHash, item.item);
|
|
5226
5517
|
},
|
|
5227
5518
|
onRowDblClick: (event: MouseEvent) => {
|
|
5228
5519
|
const item = liveOptionFor(index, base.valueHash);
|
|
@@ -7558,6 +7849,7 @@ const dataRowContext = computed<DataRowContext>(() => ({
|
|
|
7558
7849
|
expandRegionId,
|
|
7559
7850
|
selectRange: selectRangeTo,
|
|
7560
7851
|
rowReorder: rowReorderContext.value,
|
|
7852
|
+
menuRows: rowMenuRows,
|
|
7561
7853
|
}));
|
|
7562
7854
|
|
|
7563
7855
|
/** The edge rows' shared context, stable across window moves. */
|
|
@@ -7847,6 +8139,7 @@ onDeactivated(() => {
|
|
|
7847
8139
|
|
|
7848
8140
|
```ts
|
|
7849
8141
|
import type { Classes } from '@/types/Classes';
|
|
8142
|
+
import type { Item as DropdownItem } from '../BbDropdown/types';
|
|
7850
8143
|
import type {
|
|
7851
8144
|
PtCompoundProps,
|
|
7852
8145
|
PtNoInfer,
|
|
@@ -7958,6 +8251,7 @@ export type BaseColumn<Item> = {
|
|
|
7958
8251
|
|
|
7959
8252
|
/**
|
|
7960
8253
|
* Column definition for BbTable. Controls data extraction, formatting, alignment, and styling.
|
|
8254
|
+
* Declare an array as `[...] satisfies Array<BbTableColumn<Row>>`: an annotation widens the keys and the table stops checking them.
|
|
7961
8255
|
*/
|
|
7962
8256
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- untyped columns read rows freely
|
|
7963
8257
|
export type BbTableColumn<Item = any> = BaseColumn<Item> & {
|
|
@@ -8388,7 +8682,8 @@ export type BbTableProps<Item = any> = BbTablePtProps & {
|
|
|
8388
8682
|
*
|
|
8389
8683
|
* Optional: the component defaults to `[]` (columns can also come entirely
|
|
8390
8684
|
* from slots/virtual keys), so the type no longer demands what the runtime
|
|
8391
|
-
* never required.
|
|
8685
|
+
* never required. In script, `[...] satisfies Array<BbTableColumn<Row>>`
|
|
8686
|
+
* keeps the per-key check an annotation turns off.
|
|
8392
8687
|
*/
|
|
8393
8688
|
columns?: Array<BbTableColumn<Item>>;
|
|
8394
8689
|
/**
|
|
@@ -8496,6 +8791,8 @@ export type BbTableProps<Item = any> = BbTablePtProps & {
|
|
|
8496
8791
|
* details are open), a single item value or `null`. Opt-in: bound,
|
|
8497
8792
|
* a row click highlights; unbound, it only emits `click:row`. The row gets
|
|
8498
8793
|
* `aria-current="true"` and a shipped tint.
|
|
8794
|
+
*
|
|
8795
|
+
* @defaultValue `undefined` (unset: whether it is bound is read off it)
|
|
8499
8796
|
*/
|
|
8500
8797
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- a row's value is read through `item-value` (a key, a dot path or a function), which the table does not resolve at the type level: typing it per path is the nested-key cost the types avoid
|
|
8501
8798
|
highlighted?: any;
|
|
@@ -8657,6 +8954,13 @@ export type BbTableProps<Item = any> = BbTablePtProps & {
|
|
|
8657
8954
|
* Classes for each data row, or a function of the row's item.
|
|
8658
8955
|
*/
|
|
8659
8956
|
rowClass?: RowClasses<Item>;
|
|
8957
|
+
/**
|
|
8958
|
+
* A row's context menu: right-click, a long press on touch, or Shift+F10 /
|
|
8959
|
+
* the Menu key on a focused row open one shared menu with these items.
|
|
8960
|
+
* Never on an in-row control; with no visible item the browser's menu
|
|
8961
|
+
* shows. Reuse it for the visible `#actions` menu.
|
|
8962
|
+
*/
|
|
8963
|
+
rowMenu?: (item: PtNoInfer<Item>) => DropdownItem[];
|
|
8660
8964
|
/**
|
|
8661
8965
|
* Makes rows selectable: a boolean for every row, or a function of the
|
|
8662
8966
|
* row's item deciding for that row.
|
|
@@ -8811,8 +9115,14 @@ export type ExpandControllerProps = {
|
|
|
8811
9115
|
onKeydown: (event: KeyboardEvent) => void;
|
|
8812
9116
|
};
|
|
8813
9117
|
|
|
8814
|
-
|
|
8815
|
-
|
|
9118
|
+
export type BbTableEvents<
|
|
9119
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- the default: an untyped table reads its rows freely, like the component's own `Item = any`
|
|
9120
|
+
Item = any,
|
|
9121
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- a row's value through `item-value`; the component passes the typed one
|
|
9122
|
+
V = any,
|
|
9123
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- the selection model: `V[]`, or `V` with `multiple` off
|
|
9124
|
+
Model = any,
|
|
9125
|
+
> = {
|
|
8816
9126
|
// Row events carry `(event, item)` only, where `item` is the RAW record
|
|
8817
9127
|
// from `items` — not the table's internal row wrapper — typed as the
|
|
8818
9128
|
// table's row (`PtNoInfer`: a handler's annotation never infers `Item`;
|
|
@@ -8827,10 +9137,8 @@ export type BbTableEvents<Item = any> = {
|
|
|
8827
9137
|
(e: 'contextmenu:row', event: MouseEvent, item: PtNoInfer<Item>): void;
|
|
8828
9138
|
/** A body row was double-clicked. Carries the DOM `MouseEvent` and the raw record. */
|
|
8829
9139
|
(e: 'dblclick:row', event: MouseEvent, item: PtNoInfer<Item>): void;
|
|
8830
|
-
|
|
8831
|
-
(e: 'update:
|
|
8832
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- a row's value is read through `item-value` (a key, a dot path or a function), which the table does not resolve at the type level: typing it per path is the nested-key cost the types avoid; `unknown` would reject a handler annotated `(ids: number[])`
|
|
8833
|
-
(e: 'update:modelValue', value: any): void;
|
|
9140
|
+
(e: 'update:highlighted', value: V | null): void;
|
|
9141
|
+
(e: 'update:modelValue', value: Model): void;
|
|
8834
9142
|
(e: 'update:selectAll', value: boolean): void;
|
|
8835
9143
|
(e: 'update:sort', value: BbTableSortEntry[]): void;
|
|
8836
9144
|
(e: 'update:order', value: string[]): void;
|
|
@@ -8853,19 +9161,15 @@ export type BbTableEvents<Item = any> = {
|
|
|
8853
9161
|
* write `hidden: true` into the column definition to persist it.
|
|
8854
9162
|
*/
|
|
8855
9163
|
(e: 'hide:column', key: string): void;
|
|
8856
|
-
|
|
8857
|
-
(e: 'update:
|
|
8858
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- the unselected rows' values (see `unselectedItems`); `unknown[]` would reject a handler annotated `(ids: number[])`
|
|
8859
|
-
(e: 'update:unselectedItems', value: any[]): void;
|
|
9164
|
+
(e: 'update:expandedItems', value: V[]): void;
|
|
9165
|
+
(e: 'update:unselectedItems', value: V[]): void;
|
|
8860
9166
|
/**
|
|
8861
9167
|
* The user selected one row. Carries the row's value (read through
|
|
8862
9168
|
* `itemValue`, the same value the selection v-model holds).
|
|
8863
9169
|
*/
|
|
8864
|
-
|
|
8865
|
-
(e: 'item:selected', value: any): void;
|
|
9170
|
+
(e: 'item:selected', value: V): void;
|
|
8866
9171
|
/** The user unselected one row. Carries the row's value, like `item:selected`. */
|
|
8867
|
-
|
|
8868
|
-
(e: 'item:unselected', value: any): void;
|
|
9172
|
+
(e: 'item:unselected', value: V): void;
|
|
8869
9173
|
};
|
|
8870
9174
|
|
|
8871
9175
|
/**
|
|
@@ -8916,8 +9220,10 @@ export type BbTableEdgeCellSlotProps<Item> = {
|
|
|
8916
9220
|
* Scope of a column's body-cell slot `#<key>`. A data cell always has a row,
|
|
8917
9221
|
* so `item` is required.
|
|
8918
9222
|
*/
|
|
8919
|
-
|
|
9223
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- a row's value through `item-value`; the component passes the typed one
|
|
9224
|
+
export type BbTableCellSlotProps<Item, V = any> = {
|
|
8920
9225
|
classes?: Classes;
|
|
9226
|
+
/** This cell: the value at the column `key`, after its `formatter`. */
|
|
8921
9227
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- a cell's content is read through its column `key`, a dot path into the row the table does not resolve at the type level (the nested-key cost the types avoid)
|
|
8922
9228
|
content?: any;
|
|
8923
9229
|
expanded?: boolean;
|
|
@@ -8929,8 +9235,8 @@ export type BbTableCellSlotProps<Item> = {
|
|
|
8929
9235
|
toggleSelected?: () => void;
|
|
8930
9236
|
sortOrder?: 'asc' | 'desc' | null;
|
|
8931
9237
|
item: Item;
|
|
8932
|
-
|
|
8933
|
-
value?:
|
|
9238
|
+
/** The row's value through `item-value` (its id), not this cell: read the cell from `content`. */
|
|
9239
|
+
value?: V;
|
|
8934
9240
|
};
|
|
8935
9241
|
|
|
8936
9242
|
/** Scope of a column's header slot `#<key>:header`. Headers have no row. */
|
|
@@ -8951,14 +9257,15 @@ export type BbTableHeaderSlotProps<Item> = {
|
|
|
8951
9257
|
* The per-column slots, by name shape. One `Record<string, …>` used to
|
|
8952
9258
|
* type them all, so `#<key>` got an optional `item` and `#<key>:header` the
|
|
8953
9259
|
* body scope wherever the column keys are not literal (a wrapper declaring
|
|
8954
|
-
* `defineSlots<BbTableSlots<Row>>()`, a `BbTableColumn<Row>[]`
|
|
9260
|
+
* `defineSlots<BbTableSlots<Row>>()`, a variable annotated `BbTableColumn<Row>[]`
|
|
9261
|
+
* instead of `[...] satisfies Array<BbTableColumn<Row>>`). A key
|
|
8955
9262
|
* matching a template-literal index signature skips the `string` one, so each
|
|
8956
9263
|
* shape resolves to its own scope. It comes FIRST in {@link BbTableSlots}: vue-tsc
|
|
8957
9264
|
* reads a slot's scope from the last signature, so the named slots win.
|
|
8958
9265
|
*/
|
|
8959
|
-
type BbTableColumnSlots<Item> = Record<
|
|
9266
|
+
type BbTableColumnSlots<Item, V> = Record<
|
|
8960
9267
|
string,
|
|
8961
|
-
(props: BbTableCellSlotProps<Item>) => any
|
|
9268
|
+
(props: BbTableCellSlotProps<Item, V>) => any
|
|
8962
9269
|
> &
|
|
8963
9270
|
Record<
|
|
8964
9271
|
`${string}:${'first' | 'last'}`,
|
|
@@ -8971,15 +9278,15 @@ type BbTableColumnSlots<Item> = Record<
|
|
|
8971
9278
|
>;
|
|
8972
9279
|
|
|
8973
9280
|
/**
|
|
8974
|
-
* @dynamicSlot `<key>` - One column's body cell in every row, by the column `key` through `slotKey`. Scope: `{ item, value, content, selected, expanded, highlighted, classes, sortOrder, toggleSelected, toggleExpanded, toggleHighlighted, expandProps }`.
|
|
9281
|
+
* @dynamicSlot `<key>` - One column's body cell in every row, by the column `key` through `slotKey`. Scope: `{ item, value, content, selected, expanded, highlighted, classes, sortOrder, toggleSelected, toggleExpanded, toggleHighlighted, expandProps }`; `content` is this cell, `value` the row's `item-value`.
|
|
8975
9282
|
* @dynamicSlot `<key>:header` - One column's header content, replacing its label and the built-in sort button. Scope: `{ label, items, sortable, sortOrder, toggleSort, hideColumn, classes }`.
|
|
8976
9283
|
* @dynamicSlot `<key>:header:prepend` {BbTableHeaderAffixSlotProps<Item>} - Content before one column's header, keeping the sort button; beats `header:prepend` (they never stack).
|
|
8977
9284
|
* @dynamicSlot `<key>:header:append` {BbTableHeaderAffixSlotProps<Item>} - Content after one column's header, keeping the sort button; beats `header:append` (they never stack).
|
|
8978
9285
|
* @dynamicSlot `<key>:first` {BbTableEdgeCellSlotProps<Item>} - One column's cell in a row before the data rows; any such slot creates the row, aligned with the columns. Only over rows.
|
|
8979
9286
|
* @dynamicSlot `<key>:last` {BbTableEdgeCellSlotProps<Item>} - One column's cell in a row after the data rows (a totals row); any such slot creates that row, aligned like `<key>:first`.
|
|
8980
9287
|
*/
|
|
8981
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- untyped slot scopes read freely
|
|
8982
|
-
export type BbTableSlots<Item = any> = BbTableColumnSlots<Item> & {
|
|
9288
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- untyped slot scopes read freely; a row's value through `item-value` (the component passes the typed one)
|
|
9289
|
+
export type BbTableSlots<Item = any, V = any> = BbTableColumnSlots<Item, V> & {
|
|
8983
9290
|
/**
|
|
8984
9291
|
* Replaces the header row group's content (`.bb-table__head`). The table is
|
|
8985
9292
|
* a CSS grid: provide `<div role="row">` rows of `<div
|
|
@@ -9086,8 +9393,7 @@ export type BbTableSlots<Item = any> = BbTableColumnSlots<Item> & {
|
|
|
9086
9393
|
selected?: boolean;
|
|
9087
9394
|
toggleSelected?: () => void;
|
|
9088
9395
|
item: Item;
|
|
9089
|
-
|
|
9090
|
-
value: any;
|
|
9396
|
+
value: V;
|
|
9091
9397
|
}) => any;
|
|
9092
9398
|
/**
|
|
9093
9399
|
* Full-width expandable content row rendered below each main row when expanded.
|
|
@@ -9110,8 +9416,7 @@ export type BbTableSlots<Item = any> = BbTableColumnSlots<Item> & {
|
|
|
9110
9416
|
selected?: boolean;
|
|
9111
9417
|
toggleSelected?: () => void;
|
|
9112
9418
|
item: Item;
|
|
9113
|
-
|
|
9114
|
-
value: any;
|
|
9419
|
+
value: V;
|
|
9115
9420
|
}) => any;
|
|
9116
9421
|
/**
|
|
9117
9422
|
* Replaces the default checkbox/radio in the selection cell for each row.
|
|
@@ -9125,8 +9430,7 @@ export type BbTableSlots<Item = any> = BbTableColumnSlots<Item> & {
|
|
|
9125
9430
|
*/
|
|
9126
9431
|
select?: (props: {
|
|
9127
9432
|
item: Item;
|
|
9128
|
-
|
|
9129
|
-
value: any;
|
|
9433
|
+
value: V;
|
|
9130
9434
|
checked: boolean;
|
|
9131
9435
|
disabled: boolean;
|
|
9132
9436
|
inputName: string;
|
|
@@ -10513,6 +10817,13 @@ export type BbTableSlots<Item = any> = BbTableColumnSlots<Item> & {
|
|
|
10513
10817
|
outline-offset: calc(var(--bb-ring-size) * -1);
|
|
10514
10818
|
}
|
|
10515
10819
|
|
|
10820
|
+
/* The row the `row-menu` is open on: the current-row
|
|
10821
|
+
fill without its accent bar, which stays the app's `highlighted`. */
|
|
10822
|
+
&--menu {
|
|
10823
|
+
--row-bg: var(--bb-muted);
|
|
10824
|
+
background-color: var(--row-bg);
|
|
10825
|
+
}
|
|
10826
|
+
|
|
10516
10827
|
/* Default cursor for `v-model:highlighted` / `keyboard-navigation` —
|
|
10517
10828
|
without this, the row only gets `aria-current` and a bare class.
|
|
10518
10829
|
|
package/dist/ai/source/BbTabs.md
CHANGED
|
@@ -291,6 +291,12 @@ export type BbTabsItem<K extends string = string> = BbTabsInertiaOptions & {
|
|
|
291
291
|
* tab is inactive.
|
|
292
292
|
*/
|
|
293
293
|
eager?: boolean;
|
|
294
|
+
/**
|
|
295
|
+
* Leaves the tab out: no trigger, no panel, not reachable by keyboard or
|
|
296
|
+
* by the URL. A `v-model` naming it keeps it, and the strip then shows no
|
|
297
|
+
* active tab and no panel.
|
|
298
|
+
*/
|
|
299
|
+
hidden?: boolean;
|
|
294
300
|
/**
|
|
295
301
|
* The page this tab links to. Any item with `href` or `to` makes the strip
|
|
296
302
|
* a set of links (link mode): a `<nav>` of real `<a>`s with
|