bitboss-ui 3.0.0-beta.70 → 3.0.0-beta.72
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/bin/cli.mjs +6 -1
- package/dist/ai/BbAccordion.md +38 -19
- package/dist/ai/BbBadge.md +25 -22
- package/dist/ai/BbBreadcrumbs.md +4 -1
- package/dist/ai/BbButton.md +32 -27
- package/dist/ai/BbCalendar.md +1 -0
- package/dist/ai/BbCarousel.md +6 -4
- package/dist/ai/BbCheckbox.md +5 -6
- package/dist/ai/BbCheckboxGroup.md +27 -27
- package/dist/ai/BbColorInput.md +4 -5
- package/dist/ai/BbConfirm.md +65 -81
- package/dist/ai/BbConfirmPortal.md +2 -2
- package/dist/ai/BbDatePicker.md +1 -6
- package/dist/ai/BbDatePickerInput.md +5 -6
- package/dist/ai/BbDialog.md +230 -164
- package/dist/ai/BbDropdown.md +87 -17
- package/dist/ai/BbDropdownButton.md +15 -15
- package/dist/ai/BbDropzone.md +12 -8
- package/dist/ai/BbForm.md +93 -7
- package/dist/ai/BbHost.md +2 -2
- package/dist/ai/BbHoverCardPortal.md +1 -1
- package/dist/ai/BbIcon.md +1 -1
- package/dist/ai/BbIndicator.md +17 -15
- package/dist/ai/BbNumberInput.md +10 -9
- package/dist/ai/BbOffCanvas.md +29 -7
- package/dist/ai/BbPagination.md +2 -2
- package/dist/ai/BbPopover.md +15 -9
- package/dist/ai/BbPopoverPortal.md +1 -1
- package/dist/ai/BbRadio.md +5 -6
- package/dist/ai/BbRadioGroup.md +53 -37
- package/dist/ai/BbRating.md +11 -16
- package/dist/ai/BbSelect.md +25 -5
- package/dist/ai/BbSelectPopover.md +9 -3
- package/dist/ai/BbSlider.md +15 -17
- package/dist/ai/BbSpinner.md +3 -2
- package/dist/ai/BbSwitch.md +9 -9
- package/dist/ai/BbSwitchGroup.md +11 -13
- package/dist/ai/BbTable.md +205 -82
- package/dist/ai/BbTabs.md +29 -4
- package/dist/ai/BbTag.md +4 -5
- package/dist/ai/BbTextInput.md +18 -16
- package/dist/ai/BbTextarea.md +12 -11
- package/dist/ai/BbTimePickerInput.md +4 -5
- package/dist/ai/BbToast.md +3 -2
- package/dist/ai/BbTooltip.md +39 -30
- package/dist/ai/BbTree.md +49 -24
- package/dist/ai/CommonField.md +2 -10
- package/dist/ai/CommonFieldInput.md +1 -1
- package/dist/ai/OptionsContainer.md +5 -13
- package/dist/ai/changelog.json +278 -10
- package/dist/ai/components.json +59 -58
- package/dist/ai/composables/useBbDialog.md +5 -8
- package/dist/ai/composables/useBbForm.md +3 -0
- package/dist/ai/composables/useConfirm.md +65 -56
- package/dist/ai/composables/useToast.md +2 -1
- package/dist/ai/guides/agent-contract.md +3 -3
- package/dist/ai/guides/app-layout.md +3 -2
- package/dist/ai/guides/eslint-rules.md +3 -1
- package/dist/ai/guides/fetch-items-playbook.md +1 -1
- package/dist/ai/guides/floating-bottom-panel.md +3 -2
- package/dist/ai/guides/icons-policy.md +7 -5
- package/dist/ai/guides/inertia-helpers.md +35 -30
- package/dist/ai/guides/installation-and-plugin-setup.md +17 -14
- package/dist/ai/guides/migration/adoption-checklist.md +2 -2
- package/dist/ai/guides/migration/components/bb-badge.md +12 -1
- package/dist/ai/guides/migration/components/bb-button.md +24 -0
- package/dist/ai/guides/migration/components/bb-dropdown-button.md +11 -0
- package/dist/ai/guides/migration/components/bb-tabs.md +2 -2
- package/dist/ai/guides/migration/components/bb-toast.md +11 -0
- package/dist/ai/guides/migration/components/use-confirm.md +69 -26
- package/dist/ai/guides/migration/v2-to-v3.md +78 -12
- package/dist/ai/guides/migration/v3-beta-css-classes.md +1 -1
- package/dist/ai/guides/options-items-playbook.md +4 -3
- package/dist/ai/guides/passthrough.md +2 -2
- package/dist/ai/guides/preset-components.md +35 -10
- package/dist/ai/helpers/definePreset.json +8 -1
- package/dist/ai/helpers/definePreset.ts +35 -10
- package/dist/ai/helpers/inertia/manifest.json +28 -15
- package/dist/ai/helpers/inertia/messages.ts +3 -3
- package/dist/ai/helpers/inertia/useConfirmOnRouteLeave.ts +10 -10
- package/dist/ai/helpers/inertia/usePromiseForm.ts +1 -1
- package/dist/ai/helpers/inertia/usePromiseRouter.ts +7 -2
- package/dist/ai/index.md +3 -3
- package/dist/ai/manifest/common.json +5 -5
- package/dist/ai/manifest/components/BbAccordion.json +8 -5
- package/dist/ai/manifest/components/BbAccordion.tree.json +1 -0
- package/dist/ai/manifest/components/BbBadge.json +8 -7
- package/dist/ai/manifest/components/BbBadge.removed.json +3 -1
- package/dist/ai/manifest/components/BbBadge.tree.json +73 -0
- package/dist/ai/manifest/components/BbBreadcrumbs.json +2 -2
- package/dist/ai/manifest/components/BbButton.json +5 -6
- package/dist/ai/manifest/components/BbButton.removed.json +3 -1
- package/dist/ai/manifest/components/BbButton.tree.json +24 -7
- package/dist/ai/manifest/components/BbCalendar.json +2 -1
- package/dist/ai/manifest/components/BbCheckbox.json +2 -2
- package/dist/ai/manifest/components/BbCheckbox.tree.json +1 -1
- package/dist/ai/manifest/components/BbCheckboxGroup.json +2 -2
- package/dist/ai/manifest/components/BbCheckboxGroup.tree.json +9 -19
- package/dist/ai/manifest/components/BbColorInput.json +3 -3
- package/dist/ai/manifest/components/BbColorInput.tree.json +2 -2
- package/dist/ai/manifest/components/BbConfirm.json +2 -2
- package/dist/ai/manifest/components/BbConfirm.removed.json +9 -0
- package/dist/ai/manifest/components/BbConfirm.tree.json +4 -5
- package/dist/ai/manifest/components/BbConfirmPortal.json +3 -3
- package/dist/ai/manifest/components/BbConfirmPortal.removed.json +7 -0
- package/dist/ai/manifest/components/BbDatePicker.json +2 -1
- package/dist/ai/manifest/components/BbDatePicker.tree.json +0 -6
- package/dist/ai/manifest/components/BbDatePickerInput.json +2 -2
- package/dist/ai/manifest/components/BbDatePickerInput.tree.json +2 -2
- package/dist/ai/manifest/components/BbDialog.json +6 -1
- package/dist/ai/manifest/components/BbDialog.tree.json +41 -1
- package/dist/ai/manifest/components/BbDropdown.json +10 -9
- package/dist/ai/manifest/components/BbDropdown.tree.json +4 -0
- package/dist/ai/manifest/components/BbDropdownButton.json +9 -10
- package/dist/ai/manifest/components/BbDropdownButton.removed.json +3 -1
- package/dist/ai/manifest/components/BbForm.json +3 -1
- package/dist/ai/manifest/components/BbNumberInput.json +1 -1
- package/dist/ai/manifest/components/BbNumberInput.tree.json +2 -2
- package/dist/ai/manifest/components/BbOffCanvas.json +6 -1
- package/dist/ai/manifest/components/BbOffCanvas.tree.json +40 -0
- package/dist/ai/manifest/components/BbPagination.json +1 -1
- package/dist/ai/manifest/components/BbRadio.tree.json +1 -1
- package/dist/ai/manifest/components/BbRadioGroup.json +4 -3
- package/dist/ai/manifest/components/BbRadioGroup.tree.json +8 -18
- package/dist/ai/manifest/components/BbRating.json +2 -2
- package/dist/ai/manifest/components/BbRating.tree.json +1 -1
- package/dist/ai/manifest/components/BbSelect.json +2 -1
- package/dist/ai/manifest/components/BbSelect.tree.json +2 -2
- package/dist/ai/manifest/components/BbSelectPopover.json +1 -0
- package/dist/ai/manifest/components/BbSlider.tree.json +1 -1
- package/dist/ai/manifest/components/BbSwitch.json +4 -4
- package/dist/ai/manifest/components/BbSwitch.tree.json +1 -1
- package/dist/ai/manifest/components/BbSwitchGroup.json +7 -7
- package/dist/ai/manifest/components/BbSwitchGroup.tree.json +2 -2
- package/dist/ai/manifest/components/BbTable.json +15 -14
- package/dist/ai/manifest/components/BbTable.tree.json +2 -0
- package/dist/ai/manifest/components/BbTabs.json +3 -3
- package/dist/ai/manifest/components/BbTabsList.json +1 -1
- package/dist/ai/manifest/components/BbTabsRoot.json +1 -1
- package/dist/ai/manifest/components/BbTag.json +1 -1
- package/dist/ai/manifest/components/BbTag.tree.json +2 -2
- package/dist/ai/manifest/components/BbTextInput.json +1 -1
- package/dist/ai/manifest/components/BbTextInput.tree.json +2 -2
- package/dist/ai/manifest/components/BbTextarea.json +1 -1
- package/dist/ai/manifest/components/BbTextarea.tree.json +2 -2
- package/dist/ai/manifest/components/BbTimePicker.json +1 -1
- package/dist/ai/manifest/components/BbTimePickerInput.json +1 -1
- package/dist/ai/manifest/components/BbTimePickerInput.tree.json +2 -2
- package/dist/ai/manifest/components/BbToast.removed.json +2 -1
- package/dist/ai/manifest/components/BbTooltip.json +1 -1
- package/dist/ai/manifest/components/BbTooltip.tree.json +2 -2
- package/dist/ai/manifest/components/BbTree.json +2 -2
- package/dist/ai/manifest/components/CommonField.tree.json +5 -10
- package/dist/ai/manifest/components/CommonFieldInput.tree.json +3 -3
- package/dist/ai/manifest/components/OptionsContainer.tree.json +5 -13
- package/dist/ai/manifest/index.json +4 -4
- package/dist/ai/manifest/meta.json +5 -1
- package/dist/ai/manifest/types.advanced.json +9 -9
- package/dist/ai/manifest/types.api.json +7 -6
- package/dist/ai/recipes/inertia/approvals-inbox.md +23 -16
- package/dist/ai/recipes/inertia/inline-edit-workspace.md +12 -5
- package/dist/ai/recipes/inertia/layout-scaffold.md +5 -3
- package/dist/ai/recipes/inertia/onboarding.md +23 -12
- package/dist/ai/recipes/inertia/ownership-atlas.md +34 -18
- package/dist/ai/recipes/inertia/record-form.md +12 -8
- package/dist/ai/recipes/inertia/records-workspace.md +14 -7
- package/dist/ai/recipes/inertia/settings-workspace.md +75 -60
- package/dist/ai/recipes/inertia/upload-center.md +17 -9
- package/dist/ai/recipes/inertia/wizard-form.md +2 -2
- package/dist/ai/recipes/nuxt/approvals-inbox.md +23 -16
- package/dist/ai/recipes/nuxt/inline-edit-workspace.md +12 -5
- package/dist/ai/recipes/nuxt/layout-scaffold.md +5 -3
- package/dist/ai/recipes/nuxt/onboarding.md +5 -4
- package/dist/ai/recipes/nuxt/ownership-atlas.md +34 -18
- package/dist/ai/recipes/nuxt/record-form.md +14 -10
- package/dist/ai/recipes/nuxt/records-workspace.md +14 -7
- package/dist/ai/recipes/nuxt/settings-workspace.md +70 -60
- package/dist/ai/recipes/nuxt/upload-center.md +17 -9
- package/dist/ai/recipes/nuxt/wizard-form.md +4 -4
- package/dist/ai/recipes/vue/approvals-inbox.md +23 -16
- package/dist/ai/recipes/vue/inline-edit-workspace.md +12 -5
- package/dist/ai/recipes/vue/layout-scaffold.md +5 -3
- package/dist/ai/recipes/vue/onboarding.md +5 -4
- package/dist/ai/recipes/vue/ownership-atlas.md +34 -18
- package/dist/ai/recipes/vue/record-form.md +14 -10
- package/dist/ai/recipes/vue/records-workspace.md +14 -7
- package/dist/ai/recipes/vue/settings-workspace.md +70 -60
- package/dist/ai/recipes/vue/upload-center.md +17 -9
- package/dist/ai/recipes/vue/wizard-form.md +4 -4
- package/dist/ai/source/BbAccordion.md +50 -16
- package/dist/ai/source/BbBadge.md +420 -26
- package/dist/ai/source/BbBadgeButton.md +378 -12
- package/dist/ai/source/BbBreadcrumbs.md +31 -12
- package/dist/ai/source/BbButton.md +205 -55
- package/dist/ai/source/BbCalendar.md +5 -0
- package/dist/ai/source/BbCheckbox.md +36 -42
- package/dist/ai/source/BbCheckboxGroup.md +40 -17
- package/dist/ai/source/BbColorInput.md +2 -4
- package/dist/ai/source/BbConfigScope.md +19 -2
- package/dist/ai/source/BbConfirm.md +74 -80
- package/dist/ai/source/BbConfirmPortal.md +6 -6
- package/dist/ai/source/BbDatePicker.md +9 -2
- package/dist/ai/source/BbDatePickerInput.md +5 -5
- package/dist/ai/source/BbDialog.md +53 -2
- package/dist/ai/source/BbDropdown.md +360 -99
- package/dist/ai/source/BbDropdownButton.md +24 -13
- package/dist/ai/source/BbDropdownGroup.md +145 -60
- package/dist/ai/source/BbForm.md +144 -10
- package/dist/ai/source/BbNumberInput.md +2 -4
- package/dist/ai/source/BbOffCanvas.md +53 -2
- package/dist/ai/source/BbPagination.md +1 -1
- package/dist/ai/source/BbRadio.md +36 -42
- package/dist/ai/source/BbRadioGroup.md +74 -14
- package/dist/ai/source/BbRating.md +32 -36
- package/dist/ai/source/BbSelect.md +40 -13
- package/dist/ai/source/BbSelectPopover.md +105 -34
- package/dist/ai/source/BbSlider.md +2 -4
- package/dist/ai/source/BbSwitch.md +57 -46
- package/dist/ai/source/BbSwitchGroup.md +67 -21
- package/dist/ai/source/BbTable.md +363 -49
- package/dist/ai/source/BbTabs.md +6 -0
- package/dist/ai/source/BbTabsList.md +10 -0
- package/dist/ai/source/BbTabsPanels.md +6 -0
- package/dist/ai/source/BbTabsRoot.md +6 -0
- package/dist/ai/source/BbTag.md +2 -4
- package/dist/ai/source/BbTextInput.md +2 -4
- package/dist/ai/source/BbTextarea.md +2 -4
- package/dist/ai/source/BbTimePickerInput.md +2 -4
- package/dist/ai/source/BbTooltip.md +9 -3
- package/dist/ai/source/BbTree.md +14 -4
- package/dist/ai/source/CommonField.md +17 -106
- package/dist/ai/source/CommonFieldInput.md +2 -1
- package/dist/ai/source/GuidesComponent.md +3 -0
- package/dist/components/BbAccordion/BbAccordion.vue.d.ts +7 -3
- package/dist/components/BbAccordion/BbAccordion.vue_vue_type_script_setup_true_lang.js +52 -38
- package/dist/components/BbAccordion/ptKeys.generated.d.ts +20 -0
- package/dist/components/BbAccordion/types.d.ts +21 -7
- package/dist/components/BbAccordion/types.js +1 -1
- package/dist/components/BbAlert/BbAlert.vue.d.ts +1 -1
- package/dist/components/BbBadge/BadgeBodyContent.vue_vue_type_script_setup_true_lang.js +5 -5
- package/dist/components/BbBadge/BbBadge.vue.d.ts +1 -1
- package/dist/components/BbBadge/BbBadge.vue_vue_type_script_setup_true_lang.js +65 -42
- package/dist/components/BbBadge/types.d.ts +15 -12
- package/dist/components/BbBreadcrumbs/BbBreadcrumbs.vue_vue_type_script_setup_true_lang.js +106 -106
- package/dist/components/BbBreadcrumbs/types.d.ts +6 -0
- package/dist/components/BbButton/BbButton.vue_vue_type_script_setup_true_lang.js +79 -73
- package/dist/components/BbButton/types.d.ts +7 -6
- package/dist/components/BbCalendar/BbCalendar.vue.d.ts +2 -1
- package/dist/components/BbCalendar/BbCalendar.vue_vue_type_script_setup_true_lang.js +2 -1
- package/dist/components/BbCalendar/types.d.ts +5 -0
- package/dist/components/BbCalendar/useCalendarGrid.js +1 -1
- package/dist/components/BbCalendar/useDayGrid.js +1 -1
- package/dist/components/BbCheckbox/types.d.ts +2 -4
- package/dist/components/BbCheckboxGroup/BbCheckboxGroup.vue.d.ts +10 -4
- package/dist/components/BbCheckboxGroup/BbCheckboxGroup.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/components/BbCheckboxGroup/types.d.ts +4 -6
- package/dist/components/BbColorInput/types.d.ts +2 -4
- package/dist/components/BbConfigScope/BbConfigScope.vue_vue_type_script_setup_true_lang.js +8 -8
- package/dist/components/BbConfirm/BbConfirm.vue_vue_type_script_setup_true_lang.js +71 -132
- package/dist/components/BbConfirm/ptKeys.generated.d.ts +5 -5
- package/dist/components/BbConfirm/types.d.ts +5 -5
- package/dist/components/BbDatePicker/BbDatePicker.vue.d.ts +2 -1
- package/dist/components/BbDatePicker/BbDatePicker.vue_vue_type_script_setup_true_lang.js +3 -0
- package/dist/components/BbDatePicker/types.d.ts +5 -0
- package/dist/components/BbDatePickerInput/BbDatePickerInput.vue.d.ts +1 -1
- package/dist/components/BbDatePickerInput/BbDatePickerInput.vue_vue_type_script_setup_true_lang.js +2 -0
- package/dist/components/BbDatePickerInput/types.d.ts +4 -5
- package/dist/components/BbDialog/BbDialog.vue.d.ts +3 -0
- package/dist/components/BbDialog/BbDialog.vue_vue_type_script_setup_true_lang.js +263 -235
- package/dist/components/BbDialog/overlayActions.js +94 -0
- package/dist/components/BbDialog/types.d.ts +24 -0
- package/dist/components/BbDropdown/AdaptiveDropdown.vue_vue_type_script_setup_true_lang.js +4 -3
- package/dist/components/BbDropdown/BbDropdown.vue_vue_type_script_setup_true_lang.js +384 -332
- package/dist/components/BbDropdown/DropdownPipelineResolver.vue_vue_type_script_setup_true_lang.js +121 -120
- package/dist/components/BbDropdown/dropdownHandle.js +6 -0
- package/dist/components/BbDropdown/normalizeGroups.js +58 -44
- package/dist/components/BbDropdown/types.d.ts +116 -50
- package/dist/components/BbDropdown/types.js +2 -2
- package/dist/components/BbDropdownButton/BbDropdownButton.vue_vue_type_script_setup_true_lang.js +105 -104
- package/dist/components/BbDropdownButton/types.d.ts +2 -4
- package/dist/components/BbForm/BbForm.vue.d.ts +2 -1
- package/dist/components/BbForm/BbForm.vue_vue_type_script_setup_true_lang.js +240 -198
- package/dist/components/BbForm/recognizeValidation.d.ts +9 -0
- package/dist/components/BbForm/recognizeValidation.js +55 -0
- package/dist/components/BbForm/validationError.d.ts +10 -0
- package/dist/components/BbForm/validationError.js +11 -0
- package/dist/components/BbNumberInput/types.d.ts +2 -4
- package/dist/components/BbOffCanvas/BbOffCanvas.vue.d.ts +3 -0
- package/dist/components/BbOffCanvas/BbOffCanvas.vue_vue_type_script_setup_true_lang.js +414 -389
- package/dist/components/BbOffCanvas/sheetAttrs.js +5 -5
- package/dist/components/BbOffCanvas/types.d.ts +24 -0
- package/dist/components/BbPagination/BbPagination.vue_vue_type_script_setup_true_lang.js +3 -3
- package/dist/components/BbRadio/types.d.ts +2 -4
- package/dist/components/BbRadioGroup/BbRadioGroup.vue.d.ts +10 -4
- package/dist/components/BbRadioGroup/BbRadioGroup.vue_vue_type_script_setup_true_lang.js +173 -157
- package/dist/components/BbRadioGroup/types.d.ts +11 -7
- package/dist/components/BbRating/BbRating.vue_vue_type_script_setup_true_lang.js +126 -119
- package/dist/components/BbRating/types.d.ts +5 -6
- package/dist/components/BbSelect/BbSelect.vue.d.ts +17 -10
- package/dist/components/BbSelect/BbSelect.vue_vue_type_script_setup_true_lang.js +3 -1
- package/dist/components/BbSelect/types.d.ts +12 -6
- package/dist/components/BbSelectPopover/BbSelectPopover.vue.d.ts +11 -4
- package/dist/components/BbSelectPopover/BbSelectPopover.vue_vue_type_script_setup_true_lang.js +513 -502
- package/dist/components/BbSelectPopover/types.d.ts +10 -2
- package/dist/components/BbSlider/types.d.ts +2 -4
- package/dist/components/BbSwitch/BbSwitch.vue.d.ts +2 -0
- package/dist/components/BbSwitch/BbSwitch.vue_vue_type_script_setup_true_lang.js +85 -73
- package/dist/components/BbSwitchGroup/BbSwitchGroup.vue.d.ts +10 -4
- package/dist/components/BbSwitchGroup/BbSwitchGroup.vue_vue_type_script_setup_true_lang.js +171 -152
- package/dist/components/BbSwitchGroup/types.d.ts +1 -1
- package/dist/components/BbTable/BbTable.vue.d.ts +36 -25
- package/dist/components/BbTable/BbTable.vue_vue_type_script_setup_true_lang.js +1338 -1215
- package/dist/components/BbTable/BbTableDataRow.js +2 -1
- package/dist/components/BbTable/BbTableRowMenu.js +36 -0
- package/dist/components/BbTable/types.d.ts +33 -18
- package/dist/components/BbTabs/BbTabsList.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/components/BbTabs/types.d.ts +6 -0
- package/dist/components/BbTag/types.d.ts +2 -4
- package/dist/components/BbTextInput/BbTextInput.vue.d.ts +1 -1
- package/dist/components/BbTextInput/types.d.ts +2 -4
- package/dist/components/BbTextarea/BbTextarea.vue.d.ts +1 -1
- package/dist/components/BbTextarea/types.d.ts +2 -4
- package/dist/components/BbTimePickerInput/BbTimePickerInput.vue.d.ts +1 -1
- package/dist/components/BbTimePickerInput/types.d.ts +2 -4
- package/dist/components/BbToast/BbToastMessage.vue_vue_type_script_setup_true_lang.js +88 -94
- package/dist/components/BbTooltip/ptKeys.generated.d.ts +4 -4
- package/dist/components/BbTooltip/types.d.ts +3 -1
- package/dist/components/BbTree/BbTree.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/BbTree/BbTreeLevel.vue_vue_type_script_setup_true_lang.js +9 -9
- package/dist/components/BbTree/types.d.ts +8 -2
- package/dist/components/CommonField/types.d.ts +2 -4
- package/dist/components/CommonFieldInput/CommonFieldInput.vue_vue_type_script_setup_true_lang.js +39 -39
- package/dist/composables/formSubmitLock.js +15 -8
- package/dist/composables/overlayRegistry.d.ts +5 -0
- package/dist/composables/overlayRegistry.js +154 -148
- package/dist/composables/useBbDropdown.d.ts +8 -0
- package/dist/composables/useBbDropdown.js +3 -1
- package/dist/composables/useBbTabs.js +138 -138
- package/dist/composables/useChoiceIndicator.js +67 -64
- package/dist/composables/useConfirm.d.ts +63 -52
- package/dist/composables/useConfirm.js +22 -18
- package/dist/deprecation/ai-deprecations.json.js +1 -1
- package/dist/directives/bbDropdown.d.ts +7 -7
- package/dist/directives/bbDropdown.js +22 -15
- package/dist/directives/bbTooltip.d.ts +3 -3
- package/dist/directives/createPopoverDirective.js +57 -35
- package/dist/i18n/locales/ar.json +5 -1
- package/dist/i18n/locales/cs.json +5 -1
- package/dist/i18n/locales/da.json +5 -1
- package/dist/i18n/locales/de-CH.json +5 -1
- package/dist/i18n/locales/de.json +5 -1
- package/dist/i18n/locales/el.json +5 -1
- package/dist/i18n/locales/en-GB.json +5 -1
- package/dist/i18n/locales/en.json +5 -1
- package/dist/i18n/locales/es-MX.json +5 -1
- package/dist/i18n/locales/es.json +5 -1
- package/dist/i18n/locales/fa.json +5 -1
- package/dist/i18n/locales/fi.json +5 -1
- package/dist/i18n/locales/fr.json +5 -1
- package/dist/i18n/locales/he.json +5 -1
- package/dist/i18n/locales/hu.json +5 -1
- package/dist/i18n/locales/it.json +5 -1
- package/dist/i18n/locales/ja.json +5 -1
- package/dist/i18n/locales/ko.json +5 -1
- package/dist/i18n/locales/nb.json +5 -1
- package/dist/i18n/locales/nl.json +5 -1
- package/dist/i18n/locales/pl.json +5 -1
- package/dist/i18n/locales/pt-BR.json +5 -1
- package/dist/i18n/locales/pt-PT.json +5 -1
- package/dist/i18n/locales/ro.json +5 -1
- package/dist/i18n/locales/ru.json +5 -1
- package/dist/i18n/locales/sv.json +5 -1
- package/dist/i18n/locales/tr.json +5 -1
- package/dist/i18n/locales/uk.json +5 -1
- package/dist/i18n/locales/zh-CN.json +5 -1
- package/dist/i18n/locales/zh-HK.json +5 -1
- package/dist/i18n/locales/zh-TW.json +5 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +4 -3
- package/dist/llms-full.txt +2216 -1332
- package/dist/llms-medium.txt +21 -18
- package/dist/llms.txt +2 -2
- package/dist/locale-blueprint.json +5 -1
- package/dist/plugin.js +17 -40
- package/dist/pluginCore.js +30 -0
- package/dist/styles.css +2 -2
- package/dist/types/ActionButton.d.ts +26 -5
- package/dist/types/ActionButton.js +11 -0
- package/dist/types/ConfigDefaults.d.ts +34 -3
- package/dist/types/ConfigDefaults.js +14 -8
- package/dist/types/FieldLayout.d.ts +4 -1
- package/dist/types/ItemAccessor.d.ts +3 -1
- package/dist/types/ItemPath.d.ts +62 -0
- package/dist/types/ptComponentMap.d.ts +1 -1
- package/dist/utilities/functions/clickCount.js +14 -0
- package/dist/utils/versionCheck.js +1 -1
- package/llms.txt +2 -2
- package/package.json +16 -4
- package/scripts/README.md +35 -29
- package/scripts/lib/adoption-checklist.json +2 -2
- package/scripts/lib/define-preset-copy.mjs +1 -1
- package/scripts/lib/eslint-disable.mjs +5 -3
- package/scripts/lib/eslint-plugin.d.ts +2 -0
- package/scripts/lib/eslint-plugin.mjs +213 -1
- package/scripts/lib/redundant-item-accessor.mjs +4 -1
- package/scripts/lib/release-results.mjs +32 -1
- package/scripts/lib/renamed-item-field.mjs +4 -1
- package/scripts/lib/setup.mjs +8 -0
- package/scripts/lib/tab-links.mjs +4 -1
- package/scripts/lib/toolchain-check.mjs +125 -7
- package/scripts/lib/tree-default-expandable.mjs +53 -0
- package/scripts/lib/validate-bb-markup.mjs +537 -53
package/dist/ai/BbDropdown.md
CHANGED
|
@@ -48,7 +48,8 @@ handling in markup — hand `BbDropdown` an `items` array.
|
|
|
48
48
|
|
|
49
49
|
An `items` entry is one of three shapes, and you can mix them freely:
|
|
50
50
|
|
|
51
|
-
- a **menu item** — an object with a `value` and a `label`;
|
|
51
|
+
- a **menu item** — an object with a `value` and a `label`; a string or
|
|
52
|
+
number row is its own text and value (`items: ['Google', 'Bing']`);
|
|
52
53
|
- a **separator section** — a nested `[ … ]` array, rendered as its own
|
|
53
54
|
divider-separated anonymous group;
|
|
54
55
|
- a **group object** — `{ id, label?, items, selectable?, … }`, a titled and/or
|
|
@@ -91,6 +92,7 @@ check` flags both (`missing-value`, `duplicate-row-label`) when the items are
|
|
|
91
92
|
`components.BbDropdown.variants` plugin option registers more typed names, each
|
|
92
93
|
rendering a `bb-dropdown__item--variant-<name>` class hook you style yourself.
|
|
93
94
|
- `disabled` — non-interactive row, skipped by keyboard navigation.
|
|
95
|
+
- `hidden` — leaves the row out entirely (also on a group). See below.
|
|
94
96
|
|
|
95
97
|
Nothing else on an item reaches the row. An attribute for it (a `data-*` test
|
|
96
98
|
hook, an `aria-*`) goes through `pt:item`, per row with the function form:
|
|
@@ -123,9 +125,10 @@ yes (the plugin's `<BbHost />` renders it; nothing to mount).
|
|
|
123
125
|
<template #activator="{ props }">
|
|
124
126
|
<BbButton
|
|
125
127
|
v-bind="props"
|
|
126
|
-
|
|
127
|
-
icon="lucide:ellipsis"
|
|
128
|
+
icon-only
|
|
129
|
+
prepend:icon="lucide:ellipsis"
|
|
128
130
|
size="xs"
|
|
131
|
+
text="File actions"
|
|
129
132
|
variant="ghost"
|
|
130
133
|
/>
|
|
131
134
|
</template>
|
|
@@ -177,8 +180,8 @@ const items: BbDropdownItem[] = [
|
|
|
177
180
|
title: 'Delete "Q3-report.pdf"?',
|
|
178
181
|
text: 'The file will be removed for everyone in the workspace.',
|
|
179
182
|
variant: 'destructive',
|
|
180
|
-
|
|
181
|
-
|
|
183
|
+
ok: { text: 'Delete file', 'prepend:icon': 'lucide:trash-2' },
|
|
184
|
+
cancel: 'Keep file',
|
|
182
185
|
});
|
|
183
186
|
if (ok) last.value = 'Deleted';
|
|
184
187
|
},
|
|
@@ -204,6 +207,71 @@ const items: BbDropdownItem[] = [
|
|
|
204
207
|
</script>
|
|
205
208
|
```
|
|
206
209
|
|
|
210
|
+
#### Rows a user may not see: `hidden`
|
|
211
|
+
|
|
212
|
+
Gate rows by permission or record state with one `hidden` expression per row,
|
|
213
|
+
instead of building the list with `push` or conditional spreads. A hidden row
|
|
214
|
+
is not rendered, not reachable by keyboard or search, and takes its submenu
|
|
215
|
+
with it. A group whose rows are all hidden disappears with its label and
|
|
216
|
+
divider, so a destructive last group never leaves a stray line. A value the
|
|
217
|
+
model holds for a hidden row stays in the model. A fetched row takes it
|
|
218
|
+
through `itemProps`.
|
|
219
|
+
|
|
220
|
+
```ts
|
|
221
|
+
import type { BbDropdownItem } from 'bitboss-ui';
|
|
222
|
+
|
|
223
|
+
declare const can: (privilege: string) => boolean;
|
|
224
|
+
declare const isSigned: boolean;
|
|
225
|
+
|
|
226
|
+
const items: BbDropdownItem[] = [
|
|
227
|
+
{ value: 'edit', label: 'Edit', hidden: !can('edit') || isSigned },
|
|
228
|
+
{ value: 'share', label: 'Share', hidden: !can('share') },
|
|
229
|
+
{
|
|
230
|
+
group: true,
|
|
231
|
+
items: [
|
|
232
|
+
{
|
|
233
|
+
value: 'delete',
|
|
234
|
+
label: 'Delete',
|
|
235
|
+
variant: 'destructive',
|
|
236
|
+
hidden: !can('delete'),
|
|
237
|
+
},
|
|
238
|
+
],
|
|
239
|
+
},
|
|
240
|
+
];
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
#### No visible row: the trigger goes
|
|
244
|
+
|
|
245
|
+
When no row is left (all hidden, or `items` is empty) the dropdown never
|
|
246
|
+
opens and its trigger goes, so no `v-if="items.length"` guard is needed: the
|
|
247
|
+
activator slot is not rendered, and an `activator` element or a
|
|
248
|
+
`v-bb-dropdown` host is hidden. A fetched group counts as rows until it
|
|
249
|
+
resolves. A `contextMenu` surface stays and gets the browser's menu back.
|
|
250
|
+
Where the trigger must stay (a reason to show, a column to keep aligned) add
|
|
251
|
+
`keep-activator`: the trigger stays inert and the slot's `empty` says why.
|
|
252
|
+
|
|
253
|
+
```vue
|
|
254
|
+
<template>
|
|
255
|
+
<BbDropdown :items="items" keep-activator>
|
|
256
|
+
<template #activator="{ props, empty }">
|
|
257
|
+
<BbButton
|
|
258
|
+
v-bind="props"
|
|
259
|
+
v-bb-tooltip="empty ? 'Signed records are locked' : ''"
|
|
260
|
+
:aria-disabled="empty || undefined"
|
|
261
|
+
icon-only
|
|
262
|
+
prepend:icon="lucide:ellipsis"
|
|
263
|
+
variant="ghost"
|
|
264
|
+
>
|
|
265
|
+
Actions
|
|
266
|
+
</BbButton>
|
|
267
|
+
</template>
|
|
268
|
+
</BbDropdown>
|
|
269
|
+
</template>
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
For a column placeholder, the same `keep-activator` with
|
|
273
|
+
`:class="{ invisible: empty }"` on the trigger keeps its width.
|
|
274
|
+
|
|
207
275
|
### Async actions and the loading flag
|
|
208
276
|
|
|
209
277
|
Clicking a plain action closes the menu immediately and returns focus to the
|
|
@@ -1632,9 +1700,10 @@ behaves exactly as with a click menu.
|
|
|
1632
1700
|
<template #activator="{ props }">
|
|
1633
1701
|
<BbButton
|
|
1634
1702
|
v-bind="props"
|
|
1635
|
-
|
|
1636
|
-
icon="lucide:ellipsis"
|
|
1703
|
+
icon-only
|
|
1704
|
+
prepend:icon="lucide:ellipsis"
|
|
1637
1705
|
size="xs"
|
|
1706
|
+
text="Invoice actions"
|
|
1638
1707
|
variant="ghost"
|
|
1639
1708
|
/>
|
|
1640
1709
|
</template>
|
|
@@ -2198,8 +2267,8 @@ own sizes.
|
|
|
2198
2267
|
action dominates.
|
|
2199
2268
|
- [useConfirm](./composables/useConfirm.md) — a `variant: 'destructive'`
|
|
2200
2269
|
item's `onClick` should `await confirm(...)` before acting.
|
|
2201
|
-
- `BbTable` — a per-row overflow "…" menu (icon-only `BbButton` activator)
|
|
2202
|
-
a
|
|
2270
|
+
- `BbTable` — a per-row overflow "…" menu (icon-only `BbButton` activator);
|
|
2271
|
+
a right-click menu on the rows is the table's own `row-menu`.
|
|
2203
2272
|
- `BbAvatar` in the activator for account menus; `BbBadge` in per-item slots
|
|
2204
2273
|
for counts (see the slots example).
|
|
2205
2274
|
- [useToast](./composables/useToast.md) — fire a toast from an item's
|
|
@@ -2343,14 +2412,15 @@ it, and at the top level closes the sheet.
|
|
|
2343
2412
|
| `enforceCoherence` | `boolean \| undefined` | `false` | | Default for pipeline groups: drop selections that are no longer present in a group's current items (e.g. after a `dependencies` re-fetch) from the selection and `v-model`. A group's own `enforceCoherence` overrides this. |
|
|
2344
2413
|
| `failedText` | `string \| undefined` | | | Default placeholder text shown when a pipeline group's latest load FAILED (its `items` getter threw). A group's own `failedText` overrides this; both fall back to the localized `common.failedText` (`"Couldn't load items"`). |
|
|
2345
2414
|
| `id` | `string \| undefined` | | | Names this dropdown: the activator's id (unless it already has one), the menu's `menu_<id>`, and the key `useBbDropdown(id)` and a companion `BbDropdownGroup` pair by. Generated when omitted. |
|
|
2346
|
-
| `items` | `BbDropdownItem[]` | `[]` | yes | The menu rows, each a `BbBaseButton` (`button`, `a` or `router-link`): a flat array for one group, nested arrays for divider-separated groups, or `InternalGroup` objects for titled / selectable sections. A row's own `items` opens a submenu. |
|
|
2415
|
+
| `items` | `(BbDropdownItem \| PrimitiveRow)[]` | `[]` | yes | The menu rows, each a `BbBaseButton` (`button`, `a` or `router-link`): a flat array for one group, nested arrays for divider-separated groups, or `InternalGroup` objects for titled / selectable sections. A row's own `items` opens a submenu. |
|
|
2416
|
+
| `keepActivator` | `boolean \| undefined` | `false` | | Keeps the trigger when no row is visible (by default it is hidden): inert, no popup ARIA, `empty` in the activator slot. A `contextMenu` trigger always stays. |
|
|
2347
2417
|
| `loadingText` | `string \| undefined` | | | Default placeholder text shown while a pipeline group's async items load. A group's own `loadingText` overrides this; both fall back to the localized `common.loadingText` (`'Loading...'`). |
|
|
2348
2418
|
| `offCanvasProps` | `Partial<BbOffCanvasProps> \| undefined` | | | Props for the phone sheet (the `BbOffCanvas` that `adaptive` renders on mobile), spread over its defaults. A `pt` inside it styles only the sheet (passthrough guide § Inside the sheet). The sheet hides its ✕; `{ hideClose: false }` brings it back. |
|
|
2349
2419
|
| `offset` | `number \| undefined` | `4` | | Space the floating container will maintain from the activator. |
|
|
2350
2420
|
| `padding` | `number \| undefined` | `10` | | Minimum empty space to keep from the edge of the page |
|
|
2351
|
-
| `placement` | `'start'` \| `'end'` \| `'top'` \| `'bottom'` \| `'left'` \| `'right'` \| `'top-start'` \| `'top-end'` \| `'right-start'` \| `'right-end'` \| `'bottom-start'` \| `'bottom-end'` \| `'left-start'` \| `'left-end'` \| `'start-start'` \| `'start-end'` \| `'end-start'` \| `'end-end'` \| `'cursor'` | `"bottom"` | | Position
|
|
2421
|
+
| `placement` | `'start'` \| `'end'` \| `'top'` \| `'bottom'` \| `'left'` \| `'right'` \| `'top-start'` \| `'top-end'` \| `'right-start'` \| `'right-end'` \| `'bottom-start'` \| `'bottom-end'` \| `'left-start'` \| `'left-end'` \| `'start-start'` \| `'start-end'` \| `'end-start'` \| `'end-end'` \| `'cursor'` | `"bottom"` | | Position relative to the activator; `'cursor'` anchors at the mouse/touch point. No arrow (tooltips only). |
|
|
2352
2422
|
| `queryDebounceTime` | `number \| undefined` | `300` | | Debounce (ms) applied to the async re-fetch a `searchable` group fires as the user types. Applies to every searchable group in the menu. |
|
|
2353
|
-
| `transitionDuration` | `number \| undefined` | `150` | | The open / close transition in milliseconds. Menus take the fast one (150), not the popovers' medium 250: a menu is
|
|
2423
|
+
| `transitionDuration` | `number \| undefined` | `150` | | The open / close transition in milliseconds. Menus take the fast one (150), not the popovers' medium 250: a menu is picked from and gone, so it answers faster than a panel you read or edit in. |
|
|
2354
2424
|
| `trigger` | `DropdownTrigger \| DropdownTrigger[] \| undefined` | `"click"` | | Interaction(s) that open the dropdown. Accepts a single trigger or an array to combine them. - `'click'` — left-click / tap (default) - `'contextMenu'` — right-click on desktop, long-press on mobile |
|
|
2355
2425
|
| `width` | `string \| number \| undefined` | `"auto"` | | Width of the dropdown in pixels, percentage, or 'auto' to fit content. |
|
|
2356
2426
|
|
|
@@ -2390,18 +2460,18 @@ States are listed in precedence order: when two are on at once and their entries
|
|
|
2390
2460
|
|
|
2391
2461
|
- `hidden` — `(): void` — Emitted once the menu has finished closing.
|
|
2392
2462
|
- `hide` — `(): void` — Emitted as soon as the menu starts to close.
|
|
2393
|
-
- `item:selected` — `(value: any): void` — The user selected a row in a selectable group, at the click — also when a controlled companion's app then refuses the value. The payload is the row's value (its `item-value` for pipeline groups, else its `value`)
|
|
2463
|
+
- `item:selected` — `(value: any): void` — The user selected a row in a selectable group, at the click — also when a controlled companion's app then refuses the value. The payload is the row's value (its `item-value` for pipeline groups, else its `value`).
|
|
2394
2464
|
- `item:unselected` — `(value: any): void` — The user unselected a row (a multiple toggle, a `clearable` re-click, a chip ×, or the old value a single pick replaces). Payload is the item's resolved value, matching `item:selected`.
|
|
2395
2465
|
- `show` — `(): void` — Emitted as soon as the menu (the popover, or the sheet on a phone) starts to open.
|
|
2396
2466
|
- `shown` — `(): void` — Emitted once the menu is open and its open transition has finished.
|
|
2397
2467
|
|
|
2398
2468
|
## Slots
|
|
2399
2469
|
|
|
2400
|
-
- `activator` — scope: `BbDropdownActivatorSlotProps` `{ disabled?: boolean; loading: boolean; open: boolean; placement: Placement \| "cursor"; props: BbDropdownActivatorProps }` — The element that triggers the dropdown to open. Spread `props` onto your trigger element.
|
|
2470
|
+
- `activator` — scope: `BbDropdownActivatorSlotProps` `{ disabled?: boolean; empty: boolean; loading: boolean; open: boolean; placement: Placement \| "cursor"; props: BbDropdownActivatorProps }` — The element that triggers the dropdown to open. Spread `props` onto your trigger element.
|
|
2401
2471
|
- `default` — scope: `any` — Hosts `<BbDropdownGroup>` companions. They register their group with the dropdown and render nothing themselves.
|
|
2402
2472
|
- `empty` — scope: `BbDropdownPlaceholderSlotProps` `{ groupId?: string; query: string; text: string; error?: unknown }` — Replaces the default "no data" placeholder row shown in a pipeline group that resolved to no items. Rendered once per empty group.
|
|
2403
|
-
- `footer` — scope: `BbDropdownEdgeSlotProps` `{ disabled?: boolean; open: boolean; placement: Placement \| "cursor" }` —
|
|
2404
|
-
- `header` — scope: `BbDropdownEdgeSlotProps` `{ disabled?: boolean; open: boolean; placement: Placement \| "cursor" }` —
|
|
2473
|
+
- `footer` — scope: `BbDropdownEdgeSlotProps` `{ disabled?: boolean; open: boolean; placement: Placement \| "cursor" }` — Pinned below the rows, outside their scroll, with a divider — for action buttons.
|
|
2474
|
+
- `header` — scope: `BbDropdownEdgeSlotProps` `{ disabled?: boolean; open: boolean; placement: Placement \| "cursor" }` — Pinned above the rows, outside their scroll, with a divider — for a title or a filter field.
|
|
2405
2475
|
- `item:append` — scope: `BbDropdownItemSlotProps` `{ description?: string; disabled?: boolean; group: BbDropdownSlotGroup; groupTitle: boolean; level: number; index: number; item: InternalItem; loading: boolean; open: boolean; placement: Placement \| "cursor"; selected: boolean; label: string; activeLink?: boolean; exactActiveLink?: boolean }` — The trailing region of every row (and group title line), replacing its `append:icon`. A named slot wins over it; the submenu chevron and the check on a selected row take its place.
|
|
2406
2476
|
- `item:prepend` — scope: `BbDropdownItemSlotProps` `{ description?: string; disabled?: boolean; group: BbDropdownSlotGroup; groupTitle: boolean; level: number; index: number; item: InternalItem; loading: boolean; open: boolean; placement: Placement \| "cursor"; selected: boolean; label: string; activeLink?: boolean; exactActiveLink?: boolean }` — The leading region of every row (and group title line), replacing its `prepend:icon`. A row's own or its group's named slot wins over it.
|
|
2407
2477
|
- `loading` — scope: `BbDropdownPlaceholderSlotProps` `{ groupId?: string; query: string; text: string; error?: unknown }` — Replaces the default loading placeholder row shown in a pipeline group while its async items load. Rendered once per loading group.
|
|
@@ -2439,7 +2509,7 @@ Set these on the element, or on a class you put on it, to retune this component
|
|
|
2439
2509
|
- `AdaptiveDropdown` _(internal — not importable, reach it through `BbDropdown`)_ — hands `BbOffCanvas` the pt map `{ header: 'header', footer: 'footer', panel: 'root', sheet: 'root' }` (ours → theirs); also mounts `BbSmoothHeight`, `BbDropdownList`
|
|
2440
2510
|
- `BbOffCanvas` _(public — [contract](./BbOffCanvas.md))_ — its own pt parts (`BbOffCanvas`): `header` → `div.bb-offcanvas__header`, `title` → `span.bb-offcanvas__title`, `description` → `p.bb-offcanvas__description`, `close` → `CloseButton`, `content` → `div.bb-offcanvas__content`, `footer` → `div.bb-offcanvas__footer`; documented CSS variables: `--stack-x`, `--snap-y`, `--stack-fill`, `--stack-transition-duration`, `--px`, `--handle-w`, `--handle-h`, `--handle-bg`, `--safe-top`, `--close-size`
|
|
2441
2511
|
- `CloseButton` _(internal — not importable, reach it through `BbOffCanvas`)_ — documented CSS variables: `--size`, `--p`, `--icon-size`; also mounts `BbIcon`
|
|
2442
|
-
- `BbButton` _(public — [contract](./BbButton.md))_ — its own pt parts (`BbButton`): `root` → `BbBaseButton`, `spinner` → `BbSpinner`, `icon` → `span.bb-
|
|
2512
|
+
- `BbButton` _(public — [contract](./BbButton.md))_ — its own pt parts (`BbButton`): `root` → `BbBaseButton`, `spinner` → `BbSpinner`, `icon` → `span.bb-button__prepend-icon`, `icon` → `BbIcon`, `text` → `span.bb-button__text`, `icon` → `span.bb-button__append-icon`; documented CSS variables: `--h-xs`, `--h`, `--icon-size`, `--px`, `--ipx`, `--fs`, `--r`, `--gap`, `--bg`, `--bg-hover`, `--bg-pressed`, `--fg`, `--border-color`, `--ring-color`, `--ring-size`, `--bw`, `--fg-hover`, `--border-hover`, `--fg-pressed`, `--border-pressed`, `--bg-disabled`, `--fg-disabled`, `--border-disabled`, `--opacity-disabled`, `--elev-tier`, `--elev`; also mounts `BbSpinner`, `BbIcon`
|
|
2443
2513
|
- `BbBaseButton` _(public — [contract](./BbBaseButton.md))_ — its own pt parts (`BbBaseButton`): `root` → `RouterComponent`, `root` → `a`, `root` → `component`; also mounts `RouterComponent`
|
|
2444
2514
|
- Also mounts `CommonPopover`, `DropdownPipelineResolver`
|
|
2445
2515
|
|
|
@@ -55,8 +55,9 @@ right: every entry is a row, with `BbDropdown`'s item model, so submenus,
|
|
|
55
55
|
links, descriptions and groups all work there.
|
|
56
56
|
|
|
57
57
|
A computed `items` list that comes down to nothing can stay on this
|
|
58
|
-
component: with no items and no `#dropdown` slot there
|
|
59
|
-
goes and the control renders exactly like a
|
|
58
|
+
component: with no items (or only `hidden` ones) and no `#dropdown` slot there
|
|
59
|
+
is no menu, so the chevron goes and the control renders exactly like a
|
|
60
|
+
`BbButton`.
|
|
60
61
|
|
|
61
62
|
**Save / Save as draft**
|
|
62
63
|
|
|
@@ -335,8 +336,8 @@ const items: BbDropdownItem[] = [
|
|
|
335
336
|
title: 'Delete this deployment?',
|
|
336
337
|
text: 'The deployment and its build logs are removed permanently. This cannot be undone.',
|
|
337
338
|
variant: 'destructive',
|
|
338
|
-
|
|
339
|
-
|
|
339
|
+
ok: { text: 'Delete deployment', 'prepend:icon': 'lucide:trash-2' },
|
|
340
|
+
cancel: 'Keep it',
|
|
340
341
|
});
|
|
341
342
|
if (ok) status.value = 'Deployment deleted';
|
|
342
343
|
},
|
|
@@ -370,8 +371,8 @@ activator slot: the toggle button is part of the component's contract.
|
|
|
370
371
|
|
|
371
372
|
### Icons on the main button
|
|
372
373
|
|
|
373
|
-
`icon`, `
|
|
374
|
-
`BbButton`, and so do the slots of the same names: `#prepend:icon="{ loading,
|
|
374
|
+
`prepend:icon`, `append:icon` and `icon-only` belong to the main button, as
|
|
375
|
+
on `BbButton`, and so do the slots of the same names: `#prepend:icon="{ loading,
|
|
375
376
|
activeLink }"` swaps its glyph with its states, inside its `icon` part. The
|
|
376
377
|
toggle keeps its chevron (`toggle:icon` above).
|
|
377
378
|
|
|
@@ -661,11 +662,11 @@ A `pt` value written in `<script>` (a constant, a preset, a wrapper's
|
|
|
661
662
|
| `form` | `string \| undefined` | | | The id of the `BbForm` the main button submits from outside it (the native `form` attribute), with `type="submit"`. |
|
|
662
663
|
| `headers` | `object \| undefined` | | | Additional HTTP headers forwarded to Inertia when navigating via `href` in an Inertia-enabled app. |
|
|
663
664
|
| `href` | `string \| { url: string; method: "get" \| "post" \| "put" \| "patch" \| "delete"; } \| undefined` | | | The link target: renders an anchor (an Inertia `<Link>` under Inertia). Also takes Inertia's `{ url, method }`, a Wayfinder route: Inertia visits with its method; elsewhere the link is its `url`. |
|
|
664
|
-
| `
|
|
665
|
+
| `iconOnly` | `Responsive<boolean> \| undefined` | | | Shows only the button's icon (`prepend:icon` when it has both); the label is hidden but stays its accessible name, so always write it. `true`, or per breakpoint: `{ default: true, md: false }`. |
|
|
665
666
|
| `id` | `string \| undefined` | | | Names this dropdown: the activator's id (unless it already has one), the menu's `menu_<id>`, and the key `useBbDropdown(id)` and a companion `BbDropdownGroup` pair by. Generated when omitted. |
|
|
666
667
|
| `instant` | `boolean \| undefined` | `false` | | Inertia: navigate optimistically on click and reconcile when the response lands, instead of waiting for the round trip. |
|
|
667
668
|
| `interactiveWhileLoading` | `boolean \| undefined` | `false` | | Keeps the button clickable while it is loading. Buttons are disabled while loading by default; this escape hatch exists for toggles that must stay interactive (e.g. the dropdown-button caret). |
|
|
668
|
-
| `items` | `BbDropdownItem[] \| undefined` | | | The menu: every entry is a row (BbDropdown's item model, groups and submenus included). The main action is the component itself (its default slot, `@click`, `href` / `to`, `type`), never an item. Unset or empty with no `#dropdown` slot: no toggle, a plain button. |
|
|
669
|
+
| `items` | `(BbDropdownItem \| PrimitiveRow)[] \| undefined` | | | The menu: every entry is a row (BbDropdown's item model, groups and submenus included). The main action is the component itself (its default slot, `@click`, `href` / `to`, `type`), never an item. Unset or empty with no `#dropdown` slot: no toggle, a plain button. |
|
|
669
670
|
| `loading` | `boolean \| undefined` | `false` | | Triggers a loading indicator. A loading button is soft-disabled on its own (`aria-disabled`, out of the tab order, clicks and navigation blocked) and keeps its variant colours; with `disabled` set too, loading still wins the look. |
|
|
670
671
|
| `method` | `"get" \| "post" \| "put" \| "patch" \| "delete" \| undefined` | | | HTTP method used for Inertia navigation when `href` is provided in an Inertia-enabled app. Ignored otherwise. |
|
|
671
672
|
| `offCanvasProps` | `Partial<BbOffCanvasProps> \| undefined` | | | Props for the phone sheet (the `BbOffCanvas` that `adaptive` renders on mobile), spread over its defaults. A `pt` inside it styles only the sheet (passthrough guide § Inside the sheet). The sheet hides its ✕; `{ hideClose: false }` brings it back. |
|
|
@@ -683,7 +684,7 @@ A `pt` value written in `<script>` (a constant, a preset, a wrapper's
|
|
|
683
684
|
| `onSuccess` | `(() => void) \| undefined` | | | Lifecycle hook invoked by Inertia when a request succeeds. |
|
|
684
685
|
| `padding` | `number \| undefined` | `10` | | Minimum empty space to keep from the edge of the page |
|
|
685
686
|
| `pageProps` | `Record<string, unknown> \| ((currentProps: Record<string, unknown>, sharedProps: Record<string, unknown>) => Record<string, unknown>) \| null \| undefined` | | | Inertia: props to merge into the next page optimistically, before the server responds. Either an object or a function of the current props. Typed platform-agnostically (matching BbButton) so the library's types never require `@inertiajs/vue3` to be installed. |
|
|
686
|
-
| `placement` | `'start'` \| `'end'` \| `'top'` \| `'bottom'` \| `'left'` \| `'right'` \| `'top-start'` \| `'top-end'` \| `'right-start'` \| `'right-end'` \| `'bottom-start'` \| `'bottom-end'` \| `'left-start'` \| `'left-end'` \| `'start-start'` \| `'start-end'` \| `'end-start'` \| `'end-end'` \| `'cursor'` | `'bottom'` | | Position
|
|
687
|
+
| `placement` | `'start'` \| `'end'` \| `'top'` \| `'bottom'` \| `'left'` \| `'right'` \| `'top-start'` \| `'top-end'` \| `'right-start'` \| `'right-end'` \| `'bottom-start'` \| `'bottom-end'` \| `'left-start'` \| `'left-end'` \| `'start-start'` \| `'start-end'` \| `'end-start'` \| `'end-end'` \| `'cursor'` | `'bottom'` | | Position relative to the activator; `'cursor'` anchors at the mouse/touch point. No arrow (tooltips only). |
|
|
687
688
|
| `prefetch` | `string \| boolean \| string[] \| undefined` | | | Inertia: fetch and cache this link's page ahead of the click. `true` uses the default trigger; a string or list of strings picks them (`'mount'`, `'hover'`, `'click'`). |
|
|
688
689
|
| `prepend:icon` | `string \| undefined` | | | Icon to be added on the left of the text. |
|
|
689
690
|
| `preserveScroll` | `boolean \| ((props: Record<string, unknown>) => boolean) \| undefined` | `false` | | Controls whether Inertia should preserve the current scroll position after navigation. Can be a boolean or a predicate receiving the visit props. |
|
|
@@ -697,7 +698,7 @@ A `pt` value written in `<script>` (a constant, a preset, a wrapper's
|
|
|
697
698
|
| `text` | `string \| undefined` | | | Text content of the component. |
|
|
698
699
|
| `to` | `string \| et \| X \| undefined` | | | Route Location the link should navigate to when clicked on. |
|
|
699
700
|
| `toggle:icon` | `string \| undefined` | | | Replaces the chevron shown inside the dropdown toggle button. A constrained alternative to a slot: only the toggle's icon changes, so the button keeps its semantics. Named after the part it sits in (the `toggle`), the way `prepend:icon` / `append:icon` name theirs. |
|
|
700
|
-
| `transitionDuration` | `number \| undefined` | `150` | | The open / close transition in milliseconds. Menus take the fast one (150), not the popovers' medium 250: a menu is
|
|
701
|
+
| `transitionDuration` | `number \| undefined` | `150` | | The open / close transition in milliseconds. Menus take the fast one (150), not the popovers' medium 250: a menu is picked from and gone, so it answers faster than a panel you read or edit in. |
|
|
701
702
|
| `type` | `"button" \| "reset" \| "submit" \| undefined` | | | Gets the classification and default behavior of the button. |
|
|
702
703
|
| `variant` | `'outline'` \| `'primary'` \| `'destructive'` \| `'secondary'` \| `'none'` \| `'ghost'` \| `'link'` | ``components.BbButton.variant`, else `'primary'`` | | Visual variant shared by both buttons of the split control. `'none'` takes no look (you own hover, focus and disabled); register a real one with the plugin's `components.BbButton.variants` and style `.bb-button--<name>`. Unset: `BbButton`'s `components` entry (the app's or a config scope's). |
|
|
703
704
|
| `viewTransition` | `boolean \| undefined` | `false` | | Inertia: run the page swap inside a View Transition, where the browser supports one. |
|
|
@@ -762,18 +763,17 @@ States are listed in precedence order: when two are on at once and their entries
|
|
|
762
763
|
- `empty` — scope: `BbDropdownPlaceholderSlotProps` `{ groupId?: string; query: string; text: string; error?: unknown }` — Replaces the default "no data" placeholder row shown in a pipeline group that resolved to no items. Rendered once per empty group. Forwarded to the underlying `BbDropdown`.
|
|
763
764
|
- `footer` — scope: `BbDropdownButtonEdgeSlotProps` `{ disabled?: boolean; open: boolean; placement: Placement \| "cursor" }` — Content pinned to the bottom of the dropdown panel, outside the scroll area.
|
|
764
765
|
- `header` — scope: `BbDropdownButtonEdgeSlotProps` `{ disabled?: boolean; open: boolean; placement: Placement \| "cursor" }` — Content pinned to the top of the dropdown panel, outside the scroll area.
|
|
765
|
-
- `icon` — scope: `BbButtonIconSlotProps` `{ activeLink: boolean; exactActiveLink: boolean; pressed: boolean; loading: boolean; disabled: boolean }` — The main button's icon, replacing the `icon` prop; inside its `icon` part (`pt:icon`, `--icon-size`, the loading spinner), with its states.
|
|
766
766
|
- `item:append` — scope: `BbDropdownButtonItemSlotProps` `{ disabled?: boolean; index: number; item: InternalItem; open: boolean; placement: Placement \| "cursor"; label: string }` — The trailing region of every menu row, replacing its `append:icon`; the submenu chevron and the check on a selected row take its place (BbDropdown's rules).
|
|
767
767
|
- `item:prepend` — scope: `BbDropdownButtonItemSlotProps` `{ disabled?: boolean; index: number; item: InternalItem; open: boolean; placement: Placement \| "cursor"; label: string }` — The leading region of every menu row, replacing its `prepend:icon` (BbDropdown's rules).
|
|
768
768
|
- `loading` — scope: `BbDropdownPlaceholderSlotProps` `{ groupId?: string; query: string; text: string; error?: unknown }` — Replaces the default loading placeholder row shown in a pipeline group while its async items load. Rendered once per loading group. Forwarded to the underlying `BbDropdown`.
|
|
769
|
-
- `prepend:icon` — scope: `BbButtonIconSlotProps` `{ activeLink: boolean; exactActiveLink: boolean; pressed: boolean; loading: boolean; disabled: boolean }` — The main button's leading icon, replacing `prepend:icon
|
|
770
|
-
- `#<value>` (named from data) — scope: `BbDropdownItemSlotProps` — One row's content (label and description), by its value; in a fetched group, by its resolved `itemValue`. Reserved names (their slot is one of this component's own, so an item value or column key spelled like them is an error): `default`, `dropdown`, `empty`, `footer`, `header`, `
|
|
769
|
+
- `prepend:icon` — scope: `BbButtonIconSlotProps` `{ activeLink: boolean; exactActiveLink: boolean; pressed: boolean; loading: boolean; disabled: boolean }` — The main button's leading icon, replacing `prepend:icon` (the one `icon-only` shows); inside its `icon` part, with its states.
|
|
770
|
+
- `#<value>` (named from data) — scope: `BbDropdownItemSlotProps` — One row's content (label and description), by its value; in a fetched group, by its resolved `itemValue`. Reserved names (their slot is one of this component's own, so an item value or column key spelled like them is an error): `default`, `dropdown`, `empty`, `footer`, `header`, `item`, `loading`.
|
|
771
771
|
- `#<value>:prepend` (named from data) — scope: `BbDropdownItemSlotProps` — One row's leading region; replaces its `prepend:icon`.
|
|
772
772
|
- `#<value>:append` (named from data) — scope: `BbDropdownItemSlotProps` — One row's trailing region; replaces its `append:icon` and its submenu chevron. The check takes its place on the selected row.
|
|
773
773
|
- `#<groupId>:item` (named from data) — scope: `BbDropdownItemSlotProps` — The content of every row of that group, and no other; a row's own `#<value>` still wins.
|
|
774
774
|
- `#<groupId>:item:prepend` (named from data) — scope: `BbDropdownItemSlotProps` — The leading region of every row of that group — e.g. an avatar per record, drawn from `item.meta`, while other rows keep their `prepend:icon`.
|
|
775
775
|
- `#<groupId>:item:append` (named from data) — scope: `BbDropdownItemSlotProps` — The trailing region of every row of that group; replaces their `append:icon`. The check takes its place on the selected row.
|
|
776
|
-
- `#<groupId>` (named from data) — scope: `BbDropdownItemSlotProps` — That group's title line (the group is passed as `item`, `groupTitle` is `true`). Reserved names (their slot is one of this component's own, so an item value or column key spelled like them is an error): `default`, `dropdown`, `empty`, `footer`, `header`, `
|
|
776
|
+
- `#<groupId>` (named from data) — scope: `BbDropdownItemSlotProps` — That group's title line (the group is passed as `item`, `groupTitle` is `true`). Reserved names (their slot is one of this component's own, so an item value or column key spelled like them is an error): `default`, `dropdown`, `empty`, `footer`, `header`, `item`, `loading`.
|
|
777
777
|
- `#<groupId>:prepend` (named from data) — scope: `BbDropdownItemSlotProps` — The leading region of that group's title line.
|
|
778
778
|
- `#<groupId>:append` (named from data) — scope: `BbDropdownItemSlotProps` — The trailing region of that group's title line.
|
|
779
779
|
|
|
@@ -787,7 +787,7 @@ States are listed in precedence order: when two are on at once and their entries
|
|
|
787
787
|
- Listed nodes are the ones `BbDropdownButton`'s API reaches or that declare a documented CSS variable; the rest fold into "also mounts". The complete tree, undocumented locals included, is `manifest/components/BbDropdownButton.tree.json` (a public component in it is a name: its own tree file has the rest).
|
|
788
788
|
|
|
789
789
|
- `BbDropdownButton` _(this component)_ — hands `BbButton` the pt map `{ main: 'root', icon: 'icon', spinner: 'spinner', text: 'text' }` (ours → theirs); hands `BbDropdown` the pt map `{ item: 'item', itemText: 'itemText', itemIcon: 'itemIcon', itemDescription: 'itemDescription', check: 'check' }` (ours → theirs); hands `BbButton` the pt map `{ toggle: 'root' }` (ours → theirs)
|
|
790
|
-
- `BbButton` _(public — [contract](./BbButton.md))_ — its own pt parts (`BbButton`): `root` → `BbBaseButton`, `spinner` → `BbSpinner`, `icon` → `span.bb-
|
|
790
|
+
- `BbButton` _(public — [contract](./BbButton.md))_ — its own pt parts (`BbButton`): `root` → `BbBaseButton`, `spinner` → `BbSpinner`, `icon` → `span.bb-button__prepend-icon`, `icon` → `BbIcon`, `text` → `span.bb-button__text`, `icon` → `span.bb-button__append-icon`; documented CSS variables: `--h-xs`, `--h`, `--icon-size`, `--px`, `--ipx`, `--fs`, `--r`, `--gap`, `--bg`, `--bg-hover`, `--bg-pressed`, `--fg`, `--border-color`, `--ring-color`, `--ring-size`, `--bw`, `--fg-hover`, `--border-hover`, `--fg-pressed`, `--border-pressed`, `--bg-disabled`, `--fg-disabled`, `--border-disabled`, `--opacity-disabled`, `--elev-tier`, `--elev`; also mounts `BbSpinner`, `BbIcon`
|
|
791
791
|
- `BbBaseButton` _(public — [contract](./BbBaseButton.md))_ — its own pt parts (`BbBaseButton`): `root` → `RouterComponent`, `root` → `a`, `root` → `component`; also mounts `RouterComponent`
|
|
792
792
|
- `BbDropdown` _(public — [contract](./BbDropdown.md))_ — its own pt parts (`BbDropdown`): `panel` → `CommonPopover`, `root` → `CommonPopover`, `header` → `div.bb-dropdown__header`, `list` → `span.bb-dropdown__list`, `footer` → `div.bb-dropdown__footer`; documented CSS variables: `--menu-inset`; also mounts `CommonPopover`, `DropdownPipelineResolver`
|
|
793
793
|
- `BbDropdownList` _(internal — not importable, reach it through `BbDropdown`)_ — also mounts `BbIcon`, `ErrorIcon`, `CommonPopover`, `BbDropdownList`
|
package/dist/ai/BbDropzone.md
CHANGED
|
@@ -158,9 +158,10 @@ from the model (revoke the stale one when it changes) handed to
|
|
|
158
158
|
</div>
|
|
159
159
|
<BbButton
|
|
160
160
|
v-if="photo"
|
|
161
|
-
|
|
162
|
-
icon="lucide:trash-2"
|
|
161
|
+
icon-only
|
|
162
|
+
prepend:icon="lucide:trash-2"
|
|
163
163
|
size="sm"
|
|
164
|
+
text="Remove photo"
|
|
164
165
|
variant="ghost"
|
|
165
166
|
@click="photo = null"
|
|
166
167
|
/>
|
|
@@ -362,9 +363,10 @@ there is no separate "selected files" API. Removal is a plain
|
|
|
362
363
|
formatSize(file.size)
|
|
363
364
|
}}</span>
|
|
364
365
|
<BbButton
|
|
365
|
-
|
|
366
|
-
icon="lucide:x"
|
|
366
|
+
icon-only
|
|
367
|
+
prepend:icon="lucide:x"
|
|
367
368
|
size="sm"
|
|
369
|
+
:text="`Remove ${file.name}`"
|
|
368
370
|
variant="ghost"
|
|
369
371
|
@click="remove(file)"
|
|
370
372
|
/>
|
|
@@ -879,9 +881,10 @@ programmatic change still goes through.
|
|
|
879
881
|
<!-- The list is yours: readonly hides the remove buttons here. -->
|
|
880
882
|
<BbButton
|
|
881
883
|
v-if="!locked"
|
|
882
|
-
|
|
883
|
-
icon="lucide:x"
|
|
884
|
+
icon-only
|
|
885
|
+
prepend:icon="lucide:x"
|
|
884
886
|
size="sm"
|
|
887
|
+
:text="`Remove ${file.name}`"
|
|
885
888
|
variant="ghost"
|
|
886
889
|
@click="remove(file)"
|
|
887
890
|
/>
|
|
@@ -1257,9 +1260,10 @@ form library can mark the field touched and run blur-time validation.
|
|
|
1257
1260
|
file.name
|
|
1258
1261
|
}}</span>
|
|
1259
1262
|
<BbButton
|
|
1260
|
-
|
|
1261
|
-
icon="lucide:x"
|
|
1263
|
+
icon-only
|
|
1264
|
+
prepend:icon="lucide:x"
|
|
1262
1265
|
size="sm"
|
|
1266
|
+
:text="`Remove ${file.name}`"
|
|
1263
1267
|
variant="ghost"
|
|
1264
1268
|
@click="remove(file)"
|
|
1265
1269
|
/>
|
package/dist/ai/BbForm.md
CHANGED
|
@@ -250,10 +250,11 @@ The same form in Valibot, with array rows:
|
|
|
250
250
|
:name="`lines[${index}][qty]`"
|
|
251
251
|
/>
|
|
252
252
|
<BbButton
|
|
253
|
-
:aria-label="`Remove line ${index + 1}`"
|
|
254
253
|
class="mt-6"
|
|
255
254
|
:disabled="draft.lines.length === 1"
|
|
256
|
-
icon
|
|
255
|
+
icon-only
|
|
256
|
+
prepend:icon="lucide:x"
|
|
257
|
+
:text="`Remove line ${index + 1}`"
|
|
257
258
|
variant="ghost"
|
|
258
259
|
@click="draft.lines.splice(index, 1)"
|
|
259
260
|
/>
|
|
@@ -1228,16 +1229,97 @@ element, so tell them apart by an attribute you put on it:
|
|
|
1228
1229
|
for anything more than one word.
|
|
1229
1230
|
|
|
1230
1231
|
A synchronous handler never locks. A handler that throws or rejects still ends
|
|
1231
|
-
the save (nothing spins forever)
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
save, for anything else you show meanwhile.
|
|
1232
|
+
the save (nothing spins forever); what the rejection means is the next
|
|
1233
|
+
section's. `isSubmitting` (slot) and `submitting` (`useBbForm`) follow the
|
|
1234
|
+
same save, for anything else you show meanwhile.
|
|
1235
1235
|
|
|
1236
1236
|
To keep the fields editable during the save, set `disable-submit-lock` on the
|
|
1237
1237
|
form. It also leaves the dialog around the form closable. The submit button
|
|
1238
1238
|
still spins while the save is pending: the prop only lifts the locks. A submit
|
|
1239
1239
|
button with `disable-auto-loading` never spins on its own; give it `loading`.
|
|
1240
1240
|
|
|
1241
|
+
### What the save's answer means
|
|
1242
|
+
|
|
1243
|
+
`@submit` does the save; the form reads its answer. Return the request's
|
|
1244
|
+
promise and let a failure reject: no `try`/`catch`, no `setErrors`.
|
|
1245
|
+
|
|
1246
|
+
```vue
|
|
1247
|
+
<script setup lang="ts">
|
|
1248
|
+
import { reactive } from 'vue';
|
|
1249
|
+
import { BbButton, BbForm, BbTextInput } from 'bitboss-ui';
|
|
1250
|
+
|
|
1251
|
+
const model = reactive({ name: '', email: '' });
|
|
1252
|
+
// Laravel + axios; FastAPI + $fetch is the same line.
|
|
1253
|
+
const save = () => api.post('/api/users', model);
|
|
1254
|
+
</script>
|
|
1255
|
+
|
|
1256
|
+
<template>
|
|
1257
|
+
<BbForm :model="model" @submit="save">
|
|
1258
|
+
<BbTextInput label="Name" name="name" />
|
|
1259
|
+
<BbTextInput label="Email" name="email" type="email" />
|
|
1260
|
+
<BbButton type="submit">Create</BbButton>
|
|
1261
|
+
</BbForm>
|
|
1262
|
+
</template>
|
|
1263
|
+
```
|
|
1264
|
+
|
|
1265
|
+
- **Resolves** (anything but `false`): saved. `submit()` resolves `true`; in
|
|
1266
|
+
a dialog, the dialog completes.
|
|
1267
|
+
- **Resolves (or returns) `false`**: not saved, already shown (a cancelled
|
|
1268
|
+
Inertia visit). Nothing fires, nothing is reported.
|
|
1269
|
+
- **Rejects with a validation answer**: the DATA is wrong. The messages land
|
|
1270
|
+
on the fields like `setErrors`, `@invalid` fires once (`source: 'server'`),
|
|
1271
|
+
focus moves, nothing is reported.
|
|
1272
|
+
- **Rejects with anything else, or throws**: the SAVE failed.
|
|
1273
|
+
`@submit-error(error)` gets it when bound (handled), else
|
|
1274
|
+
`app.config.errorHandler`, once.
|
|
1275
|
+
|
|
1276
|
+
**A validation answer** is one of these, and nothing else:
|
|
1277
|
+
|
|
1278
|
+
- a **`BbValidationError`** (`import { BbValidationError } from 'bitboss-ui'`),
|
|
1279
|
+
`throw new BbValidationError({ email: ['Taken.'] })`. The Inertia helpers'
|
|
1280
|
+
`usePromiseForm` / `usePromiseRouter` reject with one on a 422.
|
|
1281
|
+
- by default, a **422** from **axios** (`error.response`) or **ofetch /
|
|
1282
|
+
`$fetch`** (`error.status`, `error.data`) whose body is Laravel's
|
|
1283
|
+
`{ errors: { field: ['…'] } }`, FastAPI's `{ detail: [{ loc, msg }] }`
|
|
1284
|
+
(`loc`'s `body` / `query` / `path` / `header` / `cookie` dropped), or API
|
|
1285
|
+
Platform's `{ violations: [{ propertyPath, message }] }`, every entry of
|
|
1286
|
+
that shape. A 400, a bare object, an unknown envelope, a `fetch` `Response`
|
|
1287
|
+
are real errors.
|
|
1288
|
+
|
|
1289
|
+
A key no field has goes to `unmatchedErrors`, as with `setErrors`. With
|
|
1290
|
+
`field-errors` bound to the same answer (Inertia's `form.errors`), the
|
|
1291
|
+
rejection and the object are one answer: one `@invalid`, each message once.
|
|
1292
|
+
|
|
1293
|
+
**`@submit-error`** is for the real failures only (a 500, offline, a bug).
|
|
1294
|
+
Bound, the failure is yours: nothing reaches the global handler, so a toast
|
|
1295
|
+
there and one here never both show. Rethrow inside it to report it anyway
|
|
1296
|
+
(once).
|
|
1297
|
+
|
|
1298
|
+
```vue
|
|
1299
|
+
<BbForm :model="model" @submit="save" @submit-error="toastSaveFailed">
|
|
1300
|
+
```
|
|
1301
|
+
|
|
1302
|
+
**Another backend's shape** is one line of plugin config,
|
|
1303
|
+
`BbForm.isValidationError`: a function that gets the rejection and returns
|
|
1304
|
+
its messages by field (`true`: a validation failure with nothing to show;
|
|
1305
|
+
anything else: a real error). It replaces the default list. `false` turns
|
|
1306
|
+
the default off, so only a `BbValidationError` counts.
|
|
1307
|
+
|
|
1308
|
+
```ts
|
|
1309
|
+
// Django REST Framework answers 400 with the bag as the body.
|
|
1310
|
+
app.use(bitbossUiPlugin, {
|
|
1311
|
+
components: {
|
|
1312
|
+
BbForm: {
|
|
1313
|
+
isValidationError: (error: any) =>
|
|
1314
|
+
error?.response?.status === 400 ? error.response.data : false,
|
|
1315
|
+
},
|
|
1316
|
+
},
|
|
1317
|
+
});
|
|
1318
|
+
```
|
|
1319
|
+
|
|
1320
|
+
A save with no throwing client (plain `fetch`) answers the same way: read the
|
|
1321
|
+
422 and `throw new BbValidationError(body.errors)`.
|
|
1322
|
+
|
|
1241
1323
|
### Saving in place: `snapshot()`
|
|
1242
1324
|
|
|
1243
1325
|
`dirty` compares against the values the form started with. A page that saves
|
|
@@ -1505,7 +1587,10 @@ Every provider's shape and its one-line bridge (Inertia visits, error bags
|
|
|
1505
1587
|
and `useForm`, a Laravel 422, Precognition, vee-validate, Nuxt UI):
|
|
1506
1588
|
[Error providers](./guides/validation-providers.md).
|
|
1507
1589
|
|
|
1508
|
-
|
|
1590
|
+
An axios or `$fetch` 422 needs nothing: let `@submit` reject (see
|
|
1591
|
+
[What the save's answer means](#what-the-saves-answer-means)). `setErrors` is
|
|
1592
|
+
for a message from anywhere else (a plain `fetch`, a websocket, a check of
|
|
1593
|
+
your own after the save). It takes Laravel's `{ key: string[] }` and Inertia's
|
|
1509
1594
|
`{ key: string }` (a string is read as one message). Keys are field paths,
|
|
1510
1595
|
dots or brackets (`address.city`, `address[city]`), matched against `fields`.
|
|
1511
1596
|
It returns nothing: read the state afterwards.
|
|
@@ -1898,6 +1983,7 @@ marker stays consistent with the rules.
|
|
|
1898
1983
|
|
|
1899
1984
|
- `invalid` — `(payload: BbFormInvalidPayload): void` — Fired when a submit fails validation (`source: 'submit'`) or server errors land (`'server'`: `setErrors()`, a new `field-errors` message), before the form's own focus; a handler that moves focus keeps it. `unmatched`: the paths no field claims.
|
|
1900
1985
|
- `submit` — `(values: BbFormSubmitValues<S>, meta: BbFormSubmitMeta): void` — Fired only when every field passes. Carries the values — with a schema, its parsed OUTPUT (transforms and coercions applied), typed from it.
|
|
1986
|
+
- `submit-error` — `(error: unknown): void` — The save failed for a reason other than the data (a 500, offline, a bug): a `@submit` listener rejected or threw, and the rejection is not a validation answer. Bound, it is handled (nothing reported; rethrow to report it once); unbound, it goes to `app.config.errorHandler`.
|
|
1901
1987
|
|
|
1902
1988
|
## Slots
|
|
1903
1989
|
|
package/dist/ai/BbHost.md
CHANGED
|
@@ -140,12 +140,12 @@ without a mismatch.
|
|
|
140
140
|
- `BbToast` _(internal — not importable, reach it through `BbToast`)_ — documented CSS variables: `--gap`, `--pile-gap`, `--offset`, `--width`, `--lift`, `--stack-y`, `--stack-scale`, `--enter-y`, `--swipe-amount`, `--z`, `--r`, `--ring-size`, `--bg`, `--border-color`, `--bw`, `--fg`, `--icon-color`, `--gap`
|
|
141
141
|
- `BbToastRegion` _(internal — not importable, reach it through `BbToast`)_ — its own pt parts (`BbToast`): `root` → `ol.bb-toast`
|
|
142
142
|
- `BbToastMessage` _(internal — not importable, reach it through `BbToast`)_ — also mounts `BbIcon`, `BbSpinner`
|
|
143
|
-
- `BbButton` _(public — [contract](./BbButton.md))_ — its own pt parts (`BbButton`): `root` → `BbBaseButton`, `spinner` → `BbSpinner`, `icon` → `span.bb-
|
|
143
|
+
- `BbButton` _(public — [contract](./BbButton.md))_ — its own pt parts (`BbButton`): `root` → `BbBaseButton`, `spinner` → `BbSpinner`, `icon` → `span.bb-button__prepend-icon`, `icon` → `BbIcon`, `text` → `span.bb-button__text`, `icon` → `span.bb-button__append-icon`; documented CSS variables: `--h-xs`, `--h`, `--icon-size`, `--px`, `--ipx`, `--fs`, `--r`, `--gap`, `--bg`, `--bg-hover`, `--bg-pressed`, `--fg`, `--border-color`, `--ring-color`, `--ring-size`, `--bw`, `--fg-hover`, `--border-hover`, `--fg-pressed`, `--border-pressed`, `--bg-disabled`, `--fg-disabled`, `--border-disabled`, `--opacity-disabled`, `--elev-tier`, `--elev`; also mounts `BbSpinner`, `BbIcon`
|
|
144
144
|
- `BbBaseButton` _(public — [contract](./BbBaseButton.md))_ — its own pt parts (`BbBaseButton`): `root` → `RouterComponent`, `root` → `a`, `root` → `component`; also mounts `RouterComponent`
|
|
145
145
|
|
|
146
146
|
## See Also
|
|
147
147
|
|
|
148
148
|
- [useConfirm](./composables/useConfirm.md)
|
|
149
149
|
- [useToast](./composables/useToast.md)
|
|
150
|
-
- [BbConfirmPortal](./BbConfirmPortal.md) — Registers named slot content that confirm() renders via `portal`; slot `{ data,
|
|
150
|
+
- [BbConfirmPortal](./BbConfirmPortal.md) — Registers named slot content that confirm() renders via `portal`; slot `{ data, ok, cancel }`.
|
|
151
151
|
- [BbToastPortal](./BbToastPortal.md) — Registers named slot content that toast() renders via `portal`; slot `{ data, close, toast }`.
|
|
@@ -26,4 +26,4 @@
|
|
|
26
26
|
|
|
27
27
|
- [BbHoverCard](./BbHoverCard.md) — A rich preview card that opens on hover or keyboard focus (a person, an event, a link) — BbPopover's panel without the click; may hold commands that also exist elsewhere; also the v-bb-hover-card directive.
|
|
28
28
|
- [BbPopoverPortal](./BbPopoverPortal.md) — Registers named slot content that `v-bb-popover="'name'"` (or `{ portal: 'name' }`) renders in the popover; slot `{ data, close }`.
|
|
29
|
-
- [BbConfirmPortal](./BbConfirmPortal.md) — Registers named slot content that confirm() renders via `portal`; slot `{ data,
|
|
29
|
+
- [BbConfirmPortal](./BbConfirmPortal.md) — Registers named slot content that confirm() renders via `portal`; slot `{ data, ok, cancel }`.
|
package/dist/ai/BbIcon.md
CHANGED
|
@@ -452,7 +452,7 @@ belongs to the `BbButton`/`BbBaseButton` wrapping it.
|
|
|
452
452
|
|
|
453
453
|
An info icon with a tip is therefore a button, not a bare icon: an icon-only
|
|
454
454
|
ghost `BbButton` takes keyboard focus, which opens the tip, and its slot text
|
|
455
|
-
is the name (`<BbButton variant="ghost" icon="lucide:info" v-bb-tooltip="'Prices include VAT'">About prices</BbButton>`).
|
|
455
|
+
is the name (`<BbButton variant="ghost" icon-only prepend:icon="lucide:info" v-bb-tooltip="'Prices include VAT'">About prices</BbButton>`).
|
|
456
456
|
For text that must be readable on touch, use a `BbPopover` toggletip. A
|
|
457
457
|
`v-bb-tooltip` on a bare `BbIcon` is a pointer-only hint: keyboard and touch
|
|
458
458
|
never open it.
|