bitboss-ui 3.0.0-beta.71 → 3.0.0-beta.73
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/bin/cli.mjs +9 -3
- package/dist/ai/BbAccordion.md +38 -19
- package/dist/ai/BbBadge.md +25 -22
- package/dist/ai/BbBreadcrumbs.md +1 -1
- package/dist/ai/BbButton.md +32 -27
- package/dist/ai/BbCalendar.md +1 -0
- package/dist/ai/BbCarousel.md +6 -4
- package/dist/ai/BbCheckboxGroup.md +2 -1
- package/dist/ai/BbColorInput.md +1 -1
- package/dist/ai/BbConfirm.md +65 -81
- package/dist/ai/BbConfirmPortal.md +2 -2
- package/dist/ai/BbDatePicker.md +1 -6
- package/dist/ai/BbDatePickerInput.md +2 -2
- package/dist/ai/BbDialog.md +233 -164
- package/dist/ai/BbDropdown.md +52 -16
- package/dist/ai/BbDropdownButton.md +11 -12
- package/dist/ai/BbDropzone.md +12 -8
- package/dist/ai/BbForm.md +100 -13
- package/dist/ai/BbHost.md +2 -2
- package/dist/ai/BbHoverCardPortal.md +1 -1
- package/dist/ai/BbIcon.md +1 -1
- package/dist/ai/BbIndicator.md +17 -15
- package/dist/ai/BbNumberInput.md +7 -5
- package/dist/ai/BbOffCanvas.md +29 -7
- package/dist/ai/BbPagination.md +2 -2
- package/dist/ai/BbPopover.md +15 -9
- package/dist/ai/BbPopoverPortal.md +1 -1
- package/dist/ai/BbRadioGroup.md +29 -7
- package/dist/ai/BbRating.md +8 -7
- package/dist/ai/BbSelect.md +29 -8
- package/dist/ai/BbSelectPopover.md +9 -3
- package/dist/ai/BbSlider.md +12 -8
- package/dist/ai/BbSpinner.md +3 -2
- package/dist/ai/BbSwitch.md +3 -3
- package/dist/ai/BbSwitchGroup.md +7 -6
- package/dist/ai/BbTable.md +205 -82
- package/dist/ai/BbTabs.md +29 -4
- package/dist/ai/BbTag.md +1 -1
- package/dist/ai/BbTextInput.md +7 -5
- package/dist/ai/BbTextarea.md +4 -3
- package/dist/ai/BbTimePickerInput.md +1 -1
- package/dist/ai/BbToast.md +3 -2
- package/dist/ai/BbTooltip.md +22 -17
- package/dist/ai/BbTree.md +49 -24
- package/dist/ai/CommonFieldInput.md +1 -1
- package/dist/ai/changelog.json +242 -9
- package/dist/ai/components.json +52 -51
- package/dist/ai/composables/useBbDialog.md +5 -8
- package/dist/ai/composables/useBbForm.md +3 -0
- package/dist/ai/composables/useConfirm.md +65 -56
- package/dist/ai/composables/useToast.md +2 -1
- package/dist/ai/guides/agent-contract.md +3 -3
- package/dist/ai/guides/app-layout.md +3 -2
- package/dist/ai/guides/eslint-rules.md +3 -1
- package/dist/ai/guides/fetch-items-playbook.md +1 -1
- package/dist/ai/guides/floating-bottom-panel.md +3 -2
- package/dist/ai/guides/icons-policy.md +7 -5
- package/dist/ai/guides/inertia-helpers.md +35 -30
- package/dist/ai/guides/installation-and-plugin-setup.md +17 -14
- package/dist/ai/guides/migration/adoption-checklist.md +2 -2
- package/dist/ai/guides/migration/components/bb-badge.md +12 -1
- package/dist/ai/guides/migration/components/bb-button.md +24 -0
- package/dist/ai/guides/migration/components/bb-dropdown-button.md +11 -0
- package/dist/ai/guides/migration/components/bb-tabs.md +2 -2
- package/dist/ai/guides/migration/components/bb-toast.md +11 -0
- package/dist/ai/guides/migration/components/use-confirm.md +72 -26
- package/dist/ai/guides/migration/v2-to-v3.md +52 -10
- package/dist/ai/guides/migration/v3-beta-css-classes.md +1 -1
- package/dist/ai/guides/options-items-playbook.md +4 -3
- package/dist/ai/guides/passthrough.md +2 -2
- package/dist/ai/helpers/inertia/manifest.json +28 -15
- package/dist/ai/helpers/inertia/messages.ts +3 -3
- package/dist/ai/helpers/inertia/useConfirmOnRouteLeave.ts +10 -10
- package/dist/ai/helpers/inertia/usePromiseForm.ts +1 -1
- package/dist/ai/helpers/inertia/usePromiseRouter.ts +7 -2
- package/dist/ai/index.md +3 -3
- package/dist/ai/manifest/common.json +3 -3
- package/dist/ai/manifest/components/BbAccordion.json +8 -5
- package/dist/ai/manifest/components/BbAccordion.tree.json +1 -0
- package/dist/ai/manifest/components/BbBadge.json +8 -7
- package/dist/ai/manifest/components/BbBadge.removed.json +3 -1
- package/dist/ai/manifest/components/BbBadge.tree.json +73 -0
- package/dist/ai/manifest/components/BbBreadcrumbs.json +1 -1
- package/dist/ai/manifest/components/BbButton.json +5 -6
- package/dist/ai/manifest/components/BbButton.removed.json +3 -1
- package/dist/ai/manifest/components/BbButton.tree.json +24 -7
- package/dist/ai/manifest/components/BbCalendar.json +2 -1
- package/dist/ai/manifest/components/BbCheckboxGroup.json +2 -2
- package/dist/ai/manifest/components/BbColorInput.json +1 -1
- package/dist/ai/manifest/components/BbColorInput.tree.json +1 -1
- package/dist/ai/manifest/components/BbConfirm.json +2 -2
- package/dist/ai/manifest/components/BbConfirm.removed.json +9 -0
- package/dist/ai/manifest/components/BbConfirm.tree.json +4 -5
- package/dist/ai/manifest/components/BbConfirmPortal.json +3 -3
- package/dist/ai/manifest/components/BbConfirmPortal.removed.json +7 -0
- package/dist/ai/manifest/components/BbDatePicker.json +2 -1
- package/dist/ai/manifest/components/BbDatePicker.tree.json +0 -6
- package/dist/ai/manifest/components/BbDatePickerInput.json +2 -2
- package/dist/ai/manifest/components/BbDatePickerInput.tree.json +1 -1
- package/dist/ai/manifest/components/BbDialog.json +6 -1
- package/dist/ai/manifest/components/BbDialog.tree.json +41 -1
- package/dist/ai/manifest/components/BbDropdown.json +9 -8
- package/dist/ai/manifest/components/BbDropdown.tree.json +4 -0
- package/dist/ai/manifest/components/BbDropdownButton.json +8 -9
- package/dist/ai/manifest/components/BbDropdownButton.removed.json +3 -1
- package/dist/ai/manifest/components/BbForm.json +3 -1
- package/dist/ai/manifest/components/BbNumberInput.json +1 -1
- package/dist/ai/manifest/components/BbNumberInput.tree.json +1 -1
- package/dist/ai/manifest/components/BbOffCanvas.json +6 -1
- package/dist/ai/manifest/components/BbOffCanvas.tree.json +40 -0
- package/dist/ai/manifest/components/BbPagination.json +1 -1
- package/dist/ai/manifest/components/BbRadioGroup.json +4 -3
- package/dist/ai/manifest/components/BbRating.json +2 -2
- package/dist/ai/manifest/components/BbSelect.json +16 -15
- package/dist/ai/manifest/components/BbSelect.tree.json +1 -1
- package/dist/ai/manifest/components/BbSelectPopover.json +1 -0
- package/dist/ai/manifest/components/BbSwitch.json +4 -4
- package/dist/ai/manifest/components/BbSwitchGroup.json +7 -7
- package/dist/ai/manifest/components/BbTable.json +15 -14
- package/dist/ai/manifest/components/BbTable.tree.json +2 -0
- package/dist/ai/manifest/components/BbTabs.json +3 -3
- package/dist/ai/manifest/components/BbTabsList.json +1 -1
- package/dist/ai/manifest/components/BbTabsRoot.json +1 -1
- package/dist/ai/manifest/components/BbTag.json +1 -1
- package/dist/ai/manifest/components/BbTag.tree.json +1 -1
- package/dist/ai/manifest/components/BbTextInput.json +1 -1
- package/dist/ai/manifest/components/BbTextInput.tree.json +1 -1
- package/dist/ai/manifest/components/BbTextarea.json +1 -1
- package/dist/ai/manifest/components/BbTextarea.tree.json +1 -1
- package/dist/ai/manifest/components/BbTimePicker.json +1 -1
- package/dist/ai/manifest/components/BbTimePickerInput.json +1 -1
- package/dist/ai/manifest/components/BbTimePickerInput.tree.json +1 -1
- package/dist/ai/manifest/components/BbToast.removed.json +2 -1
- package/dist/ai/manifest/components/BbTree.json +2 -2
- package/dist/ai/manifest/components/CommonFieldInput.tree.json +3 -3
- package/dist/ai/manifest/index.json +4 -4
- package/dist/ai/manifest/meta.json +5 -1
- package/dist/ai/manifest/types.advanced.json +9 -9
- package/dist/ai/manifest/types.api.json +6 -5
- package/dist/ai/recipes/inertia/approvals-inbox.md +23 -16
- package/dist/ai/recipes/inertia/inline-edit-workspace.md +12 -5
- package/dist/ai/recipes/inertia/layout-scaffold.md +5 -3
- package/dist/ai/recipes/inertia/onboarding.md +23 -12
- package/dist/ai/recipes/inertia/ownership-atlas.md +34 -18
- package/dist/ai/recipes/inertia/record-form.md +12 -8
- package/dist/ai/recipes/inertia/records-workspace.md +14 -7
- package/dist/ai/recipes/inertia/settings-workspace.md +75 -60
- package/dist/ai/recipes/inertia/upload-center.md +17 -9
- package/dist/ai/recipes/inertia/wizard-form.md +2 -2
- package/dist/ai/recipes/nuxt/approvals-inbox.md +23 -16
- package/dist/ai/recipes/nuxt/inline-edit-workspace.md +12 -5
- package/dist/ai/recipes/nuxt/layout-scaffold.md +5 -3
- package/dist/ai/recipes/nuxt/onboarding.md +5 -4
- package/dist/ai/recipes/nuxt/ownership-atlas.md +34 -18
- package/dist/ai/recipes/nuxt/record-form.md +14 -10
- package/dist/ai/recipes/nuxt/records-workspace.md +14 -7
- package/dist/ai/recipes/nuxt/settings-workspace.md +70 -60
- package/dist/ai/recipes/nuxt/upload-center.md +17 -9
- package/dist/ai/recipes/nuxt/wizard-form.md +4 -4
- package/dist/ai/recipes/vue/approvals-inbox.md +23 -16
- package/dist/ai/recipes/vue/inline-edit-workspace.md +12 -5
- package/dist/ai/recipes/vue/layout-scaffold.md +5 -3
- package/dist/ai/recipes/vue/onboarding.md +5 -4
- package/dist/ai/recipes/vue/ownership-atlas.md +34 -18
- package/dist/ai/recipes/vue/record-form.md +14 -10
- package/dist/ai/recipes/vue/records-workspace.md +14 -7
- package/dist/ai/recipes/vue/settings-workspace.md +70 -60
- package/dist/ai/recipes/vue/upload-center.md +17 -9
- package/dist/ai/recipes/vue/wizard-form.md +4 -4
- package/dist/ai/source/BbAccordion.md +50 -16
- package/dist/ai/source/BbBadge.md +420 -26
- package/dist/ai/source/BbBadgeButton.md +378 -12
- package/dist/ai/source/BbButton.md +205 -55
- package/dist/ai/source/BbCalendar.md +5 -0
- package/dist/ai/source/BbCheckboxGroup.md +38 -13
- package/dist/ai/source/BbConfigScope.md +19 -2
- package/dist/ai/source/BbConfirm.md +74 -80
- package/dist/ai/source/BbConfirmPortal.md +6 -6
- package/dist/ai/source/BbDatePicker.md +9 -2
- package/dist/ai/source/BbDatePickerInput.md +3 -1
- package/dist/ai/source/BbDialog.md +53 -2
- package/dist/ai/source/BbDropdown.md +350 -98
- package/dist/ai/source/BbDropdownButton.md +20 -12
- package/dist/ai/source/BbDropdownGroup.md +136 -58
- package/dist/ai/source/BbForm.md +152 -11
- package/dist/ai/source/BbOffCanvas.md +53 -2
- package/dist/ai/source/BbPagination.md +1 -1
- package/dist/ai/source/BbRadioGroup.md +72 -10
- package/dist/ai/source/BbRating.md +30 -22
- package/dist/ai/source/BbSelect.md +11 -1
- package/dist/ai/source/BbSelectPopover.md +105 -34
- package/dist/ai/source/BbSwitch.md +23 -8
- package/dist/ai/source/BbSwitchGroup.md +67 -21
- package/dist/ai/source/BbTable.md +359 -48
- package/dist/ai/source/BbTabs.md +6 -0
- package/dist/ai/source/BbTabsList.md +10 -0
- package/dist/ai/source/BbTabsPanels.md +6 -0
- package/dist/ai/source/BbTabsRoot.md +6 -0
- package/dist/ai/source/BbTree.md +14 -4
- package/dist/ai/source/CommonFieldInput.md +2 -1
- package/dist/components/BbAccordion/BbAccordion.vue.d.ts +7 -3
- package/dist/components/BbAccordion/BbAccordion.vue_vue_type_script_setup_true_lang.js +52 -38
- package/dist/components/BbAccordion/ptKeys.generated.d.ts +20 -0
- package/dist/components/BbAccordion/types.d.ts +21 -7
- package/dist/components/BbAccordion/types.js +1 -1
- package/dist/components/BbAlert/BbAlert.vue.d.ts +1 -1
- package/dist/components/BbBadge/BadgeBodyContent.vue_vue_type_script_setup_true_lang.js +5 -5
- package/dist/components/BbBadge/BbBadge.vue.d.ts +1 -1
- package/dist/components/BbBadge/BbBadge.vue_vue_type_script_setup_true_lang.js +65 -42
- package/dist/components/BbBadge/types.d.ts +15 -12
- package/dist/components/BbButton/BbButton.vue_vue_type_script_setup_true_lang.js +79 -73
- package/dist/components/BbButton/types.d.ts +7 -6
- package/dist/components/BbCalendar/BbCalendar.vue.d.ts +2 -1
- package/dist/components/BbCalendar/BbCalendar.vue_vue_type_script_setup_true_lang.js +2 -1
- package/dist/components/BbCalendar/types.d.ts +5 -0
- package/dist/components/BbCalendar/useCalendarGrid.js +1 -1
- package/dist/components/BbCalendar/useDayGrid.js +1 -1
- package/dist/components/BbCheckboxGroup/BbCheckboxGroup.vue.d.ts +10 -4
- package/dist/components/BbCheckboxGroup/BbCheckboxGroup.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/components/BbCheckboxGroup/types.d.ts +2 -2
- package/dist/components/BbConfigScope/BbConfigScope.vue_vue_type_script_setup_true_lang.js +8 -8
- package/dist/components/BbConfirm/BbConfirm.vue_vue_type_script_setup_true_lang.js +71 -132
- package/dist/components/BbConfirm/ptKeys.generated.d.ts +5 -5
- package/dist/components/BbConfirm/types.d.ts +5 -5
- package/dist/components/BbDatePicker/BbDatePicker.vue.d.ts +2 -1
- package/dist/components/BbDatePicker/BbDatePicker.vue_vue_type_script_setup_true_lang.js +3 -0
- package/dist/components/BbDatePicker/types.d.ts +5 -0
- package/dist/components/BbDatePickerInput/BbDatePickerInput.vue.d.ts +1 -1
- package/dist/components/BbDatePickerInput/BbDatePickerInput.vue_vue_type_script_setup_true_lang.js +2 -0
- package/dist/components/BbDatePickerInput/types.d.ts +2 -1
- package/dist/components/BbDialog/BbDialog.vue.d.ts +3 -0
- package/dist/components/BbDialog/BbDialog.vue_vue_type_script_setup_true_lang.js +263 -235
- package/dist/components/BbDialog/overlayActions.js +94 -0
- package/dist/components/BbDialog/types.d.ts +24 -0
- package/dist/components/BbDropdown/AdaptiveDropdown.vue_vue_type_script_setup_true_lang.js +4 -3
- package/dist/components/BbDropdown/BbDropdown.vue_vue_type_script_setup_true_lang.js +382 -332
- package/dist/components/BbDropdown/dropdownHandle.js +6 -0
- package/dist/components/BbDropdown/normalizeGroups.js +58 -48
- package/dist/components/BbDropdown/types.d.ts +107 -48
- package/dist/components/BbDropdown/types.js +2 -2
- package/dist/components/BbDropdownButton/BbDropdownButton.vue_vue_type_script_setup_true_lang.js +71 -71
- package/dist/components/BbDropdownButton/types.d.ts +2 -4
- package/dist/components/BbForm/BbForm.vue.d.ts +2 -1
- package/dist/components/BbForm/BbForm.vue_vue_type_script_setup_true_lang.js +241 -199
- package/dist/components/BbForm/recognizeValidation.d.ts +9 -0
- package/dist/components/BbForm/recognizeValidation.js +55 -0
- package/dist/components/BbForm/validationError.d.ts +10 -0
- package/dist/components/BbForm/validationError.js +11 -0
- package/dist/components/BbOffCanvas/BbOffCanvas.vue.d.ts +3 -0
- package/dist/components/BbOffCanvas/BbOffCanvas.vue_vue_type_script_setup_true_lang.js +414 -389
- package/dist/components/BbOffCanvas/sheetAttrs.js +5 -5
- package/dist/components/BbOffCanvas/types.d.ts +24 -0
- package/dist/components/BbPagination/BbPagination.vue_vue_type_script_setup_true_lang.js +3 -3
- package/dist/components/BbRadioGroup/BbRadioGroup.vue.d.ts +10 -4
- package/dist/components/BbRadioGroup/BbRadioGroup.vue_vue_type_script_setup_true_lang.js +173 -157
- package/dist/components/BbRadioGroup/types.d.ts +9 -3
- package/dist/components/BbRating/BbRating.vue_vue_type_script_setup_true_lang.js +112 -103
- package/dist/components/BbRating/types.d.ts +3 -2
- package/dist/components/BbSelect/BbSelect.vue.d.ts +9 -8
- package/dist/components/BbSelect/BbSelect.vue_vue_type_script_setup_true_lang.js +3 -1
- package/dist/components/BbSelect/types.d.ts +8 -0
- package/dist/components/BbSelectPopover/BbSelectPopover.vue.d.ts +11 -4
- package/dist/components/BbSelectPopover/BbSelectPopover.vue_vue_type_script_setup_true_lang.js +513 -502
- package/dist/components/BbSelectPopover/types.d.ts +10 -2
- package/dist/components/BbSwitch/BbSwitch.vue.d.ts +2 -0
- package/dist/components/BbSwitch/BbSwitch.vue_vue_type_script_setup_true_lang.js +85 -73
- package/dist/components/BbSwitchGroup/BbSwitchGroup.vue.d.ts +10 -4
- package/dist/components/BbSwitchGroup/BbSwitchGroup.vue_vue_type_script_setup_true_lang.js +171 -152
- package/dist/components/BbSwitchGroup/types.d.ts +1 -1
- package/dist/components/BbTable/BbTable.vue.d.ts +36 -25
- package/dist/components/BbTable/BbTable.vue_vue_type_script_setup_true_lang.js +1338 -1215
- package/dist/components/BbTable/BbTableDataRow.js +2 -1
- package/dist/components/BbTable/BbTableRowMenu.js +36 -0
- package/dist/components/BbTable/types.d.ts +32 -17
- package/dist/components/BbTabs/BbTabsList.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/components/BbTabs/types.d.ts +6 -0
- package/dist/components/BbTextInput/BbTextInput.vue.d.ts +1 -1
- package/dist/components/BbTextarea/BbTextarea.vue.d.ts +1 -1
- package/dist/components/BbTimePickerInput/BbTimePickerInput.vue.d.ts +1 -1
- package/dist/components/BbToast/BbToastMessage.vue_vue_type_script_setup_true_lang.js +88 -94
- package/dist/components/BbTree/BbTree.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/BbTree/BbTreeLevel.vue_vue_type_script_setup_true_lang.js +9 -9
- package/dist/components/BbTree/types.d.ts +8 -2
- package/dist/components/CommonFieldInput/CommonFieldInput.vue_vue_type_script_setup_true_lang.js +39 -39
- package/dist/composables/formSubmitLock.js +15 -8
- package/dist/composables/overlayRegistry.d.ts +5 -0
- package/dist/composables/overlayRegistry.js +154 -148
- package/dist/composables/useBbDropdown.d.ts +8 -0
- package/dist/composables/useBbDropdown.js +3 -1
- package/dist/composables/useBbTabs.js +138 -138
- package/dist/composables/useConfirm.d.ts +63 -52
- package/dist/composables/useConfirm.js +22 -18
- package/dist/deprecation/ai-deprecations.json.js +1 -1
- package/dist/directives/bbDropdown.d.ts +7 -7
- package/dist/directives/bbDropdown.js +21 -14
- package/dist/directives/bbTooltip.d.ts +3 -3
- package/dist/directives/createPopoverDirective.js +57 -35
- package/dist/i18n/locales/ar.json +5 -1
- package/dist/i18n/locales/cs.json +5 -1
- package/dist/i18n/locales/da.json +5 -1
- package/dist/i18n/locales/de-CH.json +5 -1
- package/dist/i18n/locales/de.json +5 -1
- package/dist/i18n/locales/el.json +5 -1
- package/dist/i18n/locales/en-GB.json +5 -1
- package/dist/i18n/locales/en.json +5 -1
- package/dist/i18n/locales/es-MX.json +5 -1
- package/dist/i18n/locales/es.json +5 -1
- package/dist/i18n/locales/fa.json +5 -1
- package/dist/i18n/locales/fi.json +5 -1
- package/dist/i18n/locales/fr.json +5 -1
- package/dist/i18n/locales/he.json +5 -1
- package/dist/i18n/locales/hu.json +5 -1
- package/dist/i18n/locales/it.json +5 -1
- package/dist/i18n/locales/ja.json +5 -1
- package/dist/i18n/locales/ko.json +5 -1
- package/dist/i18n/locales/nb.json +5 -1
- package/dist/i18n/locales/nl.json +5 -1
- package/dist/i18n/locales/pl.json +5 -1
- package/dist/i18n/locales/pt-BR.json +5 -1
- package/dist/i18n/locales/pt-PT.json +5 -1
- package/dist/i18n/locales/ro.json +5 -1
- package/dist/i18n/locales/ru.json +5 -1
- package/dist/i18n/locales/sv.json +5 -1
- package/dist/i18n/locales/tr.json +5 -1
- package/dist/i18n/locales/uk.json +5 -1
- package/dist/i18n/locales/zh-CN.json +5 -1
- package/dist/i18n/locales/zh-HK.json +5 -1
- package/dist/i18n/locales/zh-TW.json +5 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +4 -3
- package/dist/llms-full.txt +1997 -1151
- package/dist/llms-medium.txt +21 -18
- package/dist/llms.txt +2 -2
- package/dist/locale-blueprint.json +5 -1
- package/dist/plugin.js +17 -40
- package/dist/pluginCore.js +30 -0
- package/dist/styles.css +2 -2
- package/dist/types/ActionButton.d.ts +26 -5
- package/dist/types/ActionButton.js +11 -0
- package/dist/types/ConfigDefaults.d.ts +34 -3
- package/dist/types/ConfigDefaults.js +14 -8
- package/dist/types/ItemPath.d.ts +33 -4
- package/dist/types/ptComponentMap.d.ts +1 -1
- package/dist/utilities/functions/clickCount.js +14 -0
- package/dist/utilities/functions/hash.js +90 -3
- package/dist/utilities/functions/isEqual.js +61 -3
- package/dist/utils/versionCheck.js +1 -1
- package/dist/vite.js +0 -1
- package/llms.txt +2 -2
- package/package.json +12 -2
- package/scripts/README.md +43 -39
- package/scripts/lib/adoption-checklist.json +2 -2
- package/scripts/lib/eslint-disable.mjs +5 -3
- package/scripts/lib/eslint-plugin.d.ts +2 -0
- package/scripts/lib/eslint-plugin.mjs +213 -1
- package/scripts/lib/helpers-add.mjs +21 -2
- package/scripts/lib/redundant-item-accessor.mjs +4 -1
- package/scripts/lib/release-results.mjs +180 -5
- package/scripts/lib/renamed-item-field.mjs +4 -1
- package/scripts/lib/tab-links.mjs +4 -1
- package/scripts/lib/tree-default-expandable.mjs +53 -0
- package/scripts/lib/validate-bb-markup.mjs +536 -52
package/dist/ai/BbDialog.md
CHANGED
|
@@ -74,8 +74,9 @@ With a `v-model`, the model owns visibility: bind a boolean and flip it.
|
|
|
74
74
|
Without one, the dialog keeps its own open state, and you open it by its
|
|
75
75
|
`id` instead (next section). The dialog dismisses itself on the header close button, the `Escape`
|
|
76
76
|
key, and a backdrop click. The `default`, `header` and `footer` slots also
|
|
77
|
-
receive a `close` callback
|
|
78
|
-
|
|
77
|
+
receive a `close` callback. The Cancel button is one prop, `cancel` (see
|
|
78
|
+
[Footer buttons](#footer-buttons-ok-cancel-actions)); its click is a
|
|
79
|
+
**user** close, like the slots' `close`. That `close` is a
|
|
79
80
|
**user** close, exactly like the ✕: a `persistent` dialog still closes on it,
|
|
80
81
|
and `prevent-close` refuses it with the deny nudge. Setting the model to
|
|
81
82
|
`false` is the forceful close and always works: close through the model
|
|
@@ -225,8 +226,8 @@ reads `data` in two places:
|
|
|
225
226
|
`data` stays set until the close transition has run, so the content never
|
|
226
227
|
flashes empty while the dialog fades out. The edit-record example in
|
|
227
228
|
[Header, footer and body](#header-footer-and-body) below works this way: each
|
|
228
|
-
row's Edit button passes its contact, the slots read it as `data`, and
|
|
229
|
-
closes with
|
|
229
|
+
row's Edit button passes its contact, the slots read it as `data`, and the
|
|
230
|
+
`ok` button closes with the edited copy, handing it to the row's
|
|
230
231
|
`onComplete`.
|
|
231
232
|
|
|
232
233
|
The rules:
|
|
@@ -293,7 +294,8 @@ turn it off. The directive's `onComplete` never spins.
|
|
|
293
294
|
|
|
294
295
|
The tersest form, a trigger that hears the result itself. The form binds the
|
|
295
296
|
opening's `data` directly: it is a copy (see [The data is a copy](#the-data-is-a-copy)),
|
|
296
|
-
so Cancel throws the edits away and
|
|
297
|
+
so Cancel throws the edits away. `ok` submits the form, and the record the
|
|
298
|
+
save resolves is the result:
|
|
297
299
|
|
|
298
300
|
```vue
|
|
299
301
|
<script setup lang="ts">
|
|
@@ -320,18 +322,25 @@ const replace = (saved: Member) => {
|
|
|
320
322
|
</BbButton>
|
|
321
323
|
</li>
|
|
322
324
|
</ul>
|
|
323
|
-
<BbDialog
|
|
324
|
-
|
|
325
|
+
<BbDialog
|
|
326
|
+
id="edit-member"
|
|
327
|
+
v-slot="{ data }"
|
|
328
|
+
cancel
|
|
329
|
+
ok="Save"
|
|
330
|
+
title="Edit member"
|
|
331
|
+
>
|
|
332
|
+
<BbForm :model="data" @submit="() => save(data)">
|
|
325
333
|
<BbTextInput label="Name" name="name" />
|
|
326
|
-
<BbButton type="submit">Save</BbButton>
|
|
327
334
|
</BbForm>
|
|
328
335
|
</BbDialog>
|
|
329
336
|
</template>
|
|
330
337
|
```
|
|
331
338
|
|
|
332
|
-
- `
|
|
333
|
-
|
|
334
|
-
`
|
|
339
|
+
- `ok` completes for you: with what the form's save resolved (else the
|
|
340
|
+
form's values), or with `data` when there is no form.
|
|
341
|
+
`complete(value)` (the `default`, `header` and `footer` slots, and
|
|
342
|
+
`useBbDialog(id).complete`) does the same from code. It wins over
|
|
343
|
+
`prevent-close`, like `hide()`.
|
|
335
344
|
- Every other close is a dismissal, `{ completed: false, reason }`:
|
|
336
345
|
|
|
337
346
|
| `reason` | When |
|
|
@@ -359,91 +368,98 @@ const replace = (saved: Member) => {
|
|
|
359
368
|
#### The page saves: a promise from `onComplete`
|
|
360
369
|
|
|
361
370
|
When the page owns the save (it knows the endpoint, the list to update),
|
|
362
|
-
`onComplete` returns the request's promise.
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
settles `{ completed: true, value }`; rejected, it stays open with its data
|
|
367
|
-
and `complete()` rejects with the same error, so the dialog can show it.
|
|
371
|
+
`onComplete` returns the request's promise. Completing calls it first, and
|
|
372
|
+
the dialog stays open and **locked** until it settles: the ✕, Cancel, Escape
|
|
373
|
+
and the backdrop are refused, and the `ok` button spins. Resolved, the
|
|
374
|
+
dialog closes and the opening settles `{ completed: true, value }`.
|
|
368
375
|
|
|
369
376
|
```vue
|
|
370
377
|
<template>
|
|
371
378
|
<BbButton v-bb-dialog="{ id: 'rename', data: row, onComplete: save }">
|
|
372
379
|
Rename
|
|
373
380
|
</BbButton>
|
|
374
|
-
<BbDialog id="rename" v-slot="{ data
|
|
375
|
-
<BbForm :model="data"
|
|
381
|
+
<BbDialog id="rename" v-slot="{ data }" cancel ok="Save" title="Rename">
|
|
382
|
+
<BbForm :model="data">
|
|
376
383
|
<BbTextInput label="Name" name="name" />
|
|
377
|
-
<BbButton type="submit">Save</BbButton>
|
|
378
384
|
</BbForm>
|
|
379
385
|
</BbDialog>
|
|
380
386
|
</template>
|
|
381
387
|
```
|
|
382
388
|
|
|
389
|
+
- **`false` keeps it open.** A handler that returns (or resolves) `false`
|
|
390
|
+
leaves the dialog open with its data, and nothing is reported: the handler
|
|
391
|
+
already showed why.
|
|
392
|
+
- **A throw keeps it open too**, and the error is reported once (to
|
|
393
|
+
`app.config.errorHandler`), never as a validation answer.
|
|
394
|
+
- **One handler owns the save.** The other one only reacts (a toast, a
|
|
395
|
+
refresh).
|
|
396
|
+
|
|
383
397
|
From code: `edit.show(row, { onComplete: save })` (both the id and the
|
|
384
|
-
component handle).
|
|
385
|
-
|
|
398
|
+
component handle). `onComplete` is just a function. A trigger inside a
|
|
399
|
+
child component gets the page's save the way your app already shares
|
|
400
|
+
things: a function prop (`:save="saveMember"`), a page `provide` / `inject`,
|
|
401
|
+
or a store action. Not an emit: an emit cannot return the promise.
|
|
386
402
|
|
|
387
|
-
|
|
388
|
-
page's save the way your app already shares things: a function prop
|
|
389
|
-
(`:save="saveMember"`), a page `provide` / `inject`, or a store action. Not an
|
|
390
|
-
emit: an emit cannot return the promise.
|
|
403
|
+
#### The dialog's own `@complete`
|
|
391
404
|
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
405
|
+
A dialog written in the page has no opener to hear it. `@complete` is the
|
|
406
|
+
same hook on the dialog itself: it gets the same value, runs **before** the
|
|
407
|
+
opener's `onComplete`, and both are awaited; the dialog closes only when both
|
|
408
|
+
succeed.
|
|
396
409
|
|
|
397
410
|
```vue
|
|
398
|
-
<
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
() =>
|
|
411
|
-
complete(data).catch((error) => {
|
|
412
|
-
// Your save's rejection. With the Inertia helpers it IS the
|
|
413
|
-
// error bag (messages by field path); an Error has no bag.
|
|
414
|
-
fieldErrors = error instanceof Error ? {} : error;
|
|
415
|
-
})
|
|
416
|
-
"
|
|
417
|
-
>
|
|
418
|
-
<BbTextInput label="Name" name="name" />
|
|
419
|
-
<BbButton type="submit">Save</BbButton>
|
|
420
|
-
</BbForm>
|
|
421
|
-
</BbDialog>
|
|
422
|
-
</template>
|
|
411
|
+
<BbDialog
|
|
412
|
+
id="rename-session"
|
|
413
|
+
v-slot="{ data }"
|
|
414
|
+
cancel="Chiudi"
|
|
415
|
+
ok="Rinomina"
|
|
416
|
+
title="Rinomina sessione"
|
|
417
|
+
@complete="reloadSessions"
|
|
418
|
+
>
|
|
419
|
+
<BbForm :model="data" @submit="() => put(`/sessions/${data.id}`, data)">
|
|
420
|
+
<BbTextInput label="Nome" name="name" />
|
|
421
|
+
</BbForm>
|
|
422
|
+
</BbDialog>
|
|
423
423
|
```
|
|
424
424
|
|
|
425
|
-
|
|
426
|
-
record-form recipe (`ai/recipes/inertia/record-form.md`) binds
|
|
427
|
-
`<BbForm :field-errors="form.errors">` the same way.
|
|
425
|
+
#### A save the server refuses
|
|
428
426
|
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
the rejection as it is. Anything else (an error page, a network error)
|
|
436
|
-
rejects with an `Error`, which has no bag.
|
|
427
|
+
Let the save reject; the form reads the answer (BbForm § What the save's
|
|
428
|
+
answer means). A validation answer (a `BbValidationError`, or a 422 from
|
|
429
|
+
axios / `$fetch` in Laravel, FastAPI or API Platform shape) puts each
|
|
430
|
+
message under its field and keeps the dialog open, with nothing reported.
|
|
431
|
+
Any other failure keeps it open too and reaches `@submit-error` on the form,
|
|
432
|
+
else the app's error handler, once.
|
|
437
433
|
|
|
438
|
-
|
|
439
|
-
|
|
434
|
+
With Inertia, `usePromiseForm` (Inertia helpers guide) rejects with a
|
|
435
|
+
`BbValidationError` on a 422, and the page's `form.errors` binds as
|
|
436
|
+
`field-errors`. The dialog is all markup:
|
|
440
437
|
|
|
441
|
-
|
|
438
|
+
```vue
|
|
439
|
+
<BbDialog
|
|
440
|
+
id="platform-user-edit"
|
|
441
|
+
:title="title"
|
|
442
|
+
cancel="Chiudi"
|
|
443
|
+
:ok="isEditMode ? 'Salva modifiche' : 'Crea utente'"
|
|
444
|
+
@complete="refreshUsers"
|
|
445
|
+
>
|
|
446
|
+
<BbForm :model="form" :field-errors="form.errors" @submit="onSubmit">
|
|
447
|
+
<BbTextInput label="Email" name="email" type="email" />
|
|
448
|
+
</BbForm>
|
|
449
|
+
</BbDialog>
|
|
450
|
+
```
|
|
442
451
|
|
|
443
|
-
|
|
444
|
-
const
|
|
452
|
+
```ts
|
|
453
|
+
const { form, post, put } = usePromiseForm({ name: '', email: '' });
|
|
454
|
+
// Return the visit: no try/catch, no complete().
|
|
455
|
+
const onSubmit = () =>
|
|
456
|
+
user
|
|
457
|
+
? put(route('users.update', { id: user.id }))
|
|
458
|
+
: post(route('users.store'));
|
|
445
459
|
```
|
|
446
460
|
|
|
461
|
+
A cancelled visit resolves `false`: the dialog stays open, nothing fires.
|
|
462
|
+
|
|
447
463
|
#### The data is a copy
|
|
448
464
|
|
|
449
465
|
Every opening holds its own **reactive copy** of the `data` it was given
|
|
@@ -457,9 +473,9 @@ a `File`, a `Map`) is the same object you passed. So:
|
|
|
457
473
|
- **Cancel discards.** Every close but `complete` throws the copy away;
|
|
458
474
|
reopening the same row starts from a fresh copy, with nothing to reset on
|
|
459
475
|
`@show`.
|
|
460
|
-
- **`
|
|
461
|
-
|
|
462
|
-
|
|
476
|
+
- **`ok` hands back what the server saved** (the save's resolved value). A
|
|
477
|
+
dialog with no round trip (a local filters panel) has no form save, and
|
|
478
|
+
`ok` returns the edit itself.
|
|
463
479
|
- `data` is not the object you passed (`data !== row`), so compare by id, never
|
|
464
480
|
by identity. The slots' `data` and `useBbDialog(id).data` are the
|
|
465
481
|
same copy, and it is reactive: a title bound to `data.name` follows the
|
|
@@ -605,7 +621,7 @@ template too. Opened without data, the form starts from its own defaults:
|
|
|
605
621
|
```vue
|
|
606
622
|
<!-- UserCreateDialog.vue -->
|
|
607
623
|
<script setup lang="ts">
|
|
608
|
-
import {
|
|
624
|
+
import { BbDialog, BbForm, BbTextInput } from 'bitboss-ui';
|
|
609
625
|
|
|
610
626
|
type User = { id: number; name: string; team: string };
|
|
611
627
|
|
|
@@ -618,14 +634,16 @@ const save = async (values: Record<string, unknown>): Promise<User> => ({
|
|
|
618
634
|
</script>
|
|
619
635
|
|
|
620
636
|
<template>
|
|
621
|
-
<BbDialog
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
637
|
+
<BbDialog
|
|
638
|
+
id="user-create"
|
|
639
|
+
v-slot="{ data }"
|
|
640
|
+
cancel
|
|
641
|
+
ok="Create"
|
|
642
|
+
title="New user"
|
|
643
|
+
>
|
|
644
|
+
<BbForm :model="data" @submit="save">
|
|
626
645
|
<BbTextInput label="Name" name="name" />
|
|
627
646
|
<BbTextInput label="Team" name="team" />
|
|
628
|
-
<BbButton type="submit">Create</BbButton>
|
|
629
647
|
</BbForm>
|
|
630
648
|
</BbDialog>
|
|
631
649
|
</template>
|
|
@@ -675,8 +693,8 @@ const createForDesign = async () => {
|
|
|
675
693
|
renders every confirm and toast too): nothing to mount. Without the plugin
|
|
676
694
|
there is no host, and the opening waits a second, then settles
|
|
677
695
|
`'unmounted'` with a dev warning.
|
|
678
|
-
- **Results** are the dialog's own, as in the section above: `
|
|
679
|
-
resolves `{ completed: true, value }`, every other close a dismissal, at
|
|
696
|
+
- **Results** are the dialog's own, as in the section above: `ok` (or
|
|
697
|
+
`complete(value)`) resolves `{ completed: true, value }`, every other close a dismissal, at
|
|
680
698
|
close start. The instance unmounts after the close transition.
|
|
681
699
|
- **It injects like its opener.** The directive's dialog takes the trigger's
|
|
682
700
|
surroundings (a row's `provide`, a `<BbConfigScope>` around the button, an
|
|
@@ -713,19 +731,93 @@ const createForDesign = async () => {
|
|
|
713
731
|
- **The server** opens nothing: a `show()` during a server render settles
|
|
714
732
|
`'server'` at once, and the host renders empty, so it hydrates clean.
|
|
715
733
|
|
|
734
|
+
### Footer buttons: `ok`, `cancel`, `actions`
|
|
735
|
+
|
|
736
|
+
Write the buttons as props; none render unless written, so an info dialog
|
|
737
|
+
grows no footer.
|
|
738
|
+
|
|
739
|
+
```vue
|
|
740
|
+
<BbDialog
|
|
741
|
+
id="archive"
|
|
742
|
+
cancel="Keep"
|
|
743
|
+
:ok="{ text: 'Archive', variant: 'destructive' }"
|
|
744
|
+
title="Archive project?"
|
|
745
|
+
@complete="archive"
|
|
746
|
+
>
|
|
747
|
+
<template #default="{ data }">{{ data.name }} will be archived.</template>
|
|
748
|
+
</BbDialog>
|
|
749
|
+
```
|
|
750
|
+
|
|
751
|
+
- **`cancel`, then `ok`**, in that order. Each takes `true` (the locale's
|
|
752
|
+
Cancel / OK: a bare `cancel` attribute), a label, or a button config
|
|
753
|
+
`{ text, variant, size, 'prepend:icon', 'append:icon', iconOnly, block,
|
|
754
|
+
onClick }`.
|
|
755
|
+
- **`ok`** runs its `onClick` when written, then completes. Without one, it
|
|
756
|
+
submits the `BbForm` inside (validation first; an invalid form stays
|
|
757
|
+
open), and a successful save completes with what it resolved, else the
|
|
758
|
+
form's values. Enter in a field completes the same way. No form, or two or
|
|
759
|
+
more: it completes with `data`.
|
|
760
|
+
- **`cancel`** runs its `onClick`, then closes as a dismissal
|
|
761
|
+
(`reason: 'close'`); refused while a save locks the dialog.
|
|
762
|
+
- **`actions`** replaces both: an array of button configs, each running its
|
|
763
|
+
`onClick`, then completing with `data`. `false`: none.
|
|
764
|
+
- **`false` from an `onClick`** keeps the dialog open; a throw keeps it open
|
|
765
|
+
and is reported once (a `BbValidationError` never is).
|
|
766
|
+
- **`ok` is never disabled until the form is valid**: the user submits, the
|
|
767
|
+
form shows what they missed. A dialog that needs another footer writes its
|
|
768
|
+
own `#footer`.
|
|
769
|
+
- **The `footer` slot replaces them all**, for a footer of your own.
|
|
770
|
+
- **Config styles them app-wide**:
|
|
771
|
+
`components: { BbDialog: { okProps: { variant: 'primary' }, cancelProps: { variant: 'outline' } } }`
|
|
772
|
+
(and `BbOffCanvas`, `BbConfirm`) takes the button config minus `onClick`,
|
|
773
|
+
merged under what a dialog writes; it never adds a button.
|
|
774
|
+
- **The phone sheet** renders the same buttons.
|
|
775
|
+
|
|
776
|
+
#### Steps in one dialog
|
|
777
|
+
|
|
778
|
+
`ok` belongs to the last step. Before it, hand `ok` a Next button whose
|
|
779
|
+
`onClick` moves on and returns `false` (the dialog stays open); on the last
|
|
780
|
+
step it is a plain label again, so it submits the form and completes:
|
|
781
|
+
|
|
782
|
+
```vue
|
|
783
|
+
<BbDialog
|
|
784
|
+
id="wizard"
|
|
785
|
+
cancel
|
|
786
|
+
:ok="step < 3 ? { text: 'Next', onClick: next } : 'Finish'"
|
|
787
|
+
>
|
|
788
|
+
```
|
|
789
|
+
|
|
790
|
+
```ts
|
|
791
|
+
const step = ref(1);
|
|
792
|
+
const next = () => {
|
|
793
|
+
step.value++;
|
|
794
|
+
return false;
|
|
795
|
+
};
|
|
796
|
+
```
|
|
797
|
+
|
|
798
|
+
- **Give the form `keep-values-on-unmount`**: steps shown with `v-if` unmount
|
|
799
|
+
their fields, and without it each field's value leaves `data` as its step
|
|
800
|
+
goes, so Back finds it empty and the result holds only the last step.
|
|
801
|
+
- **Each step's first field gets `autofocus`**: it fires when the field
|
|
802
|
+
mounts, so focus follows the step with no watcher (`focus-target` picks only
|
|
803
|
+
where the opening starts).
|
|
804
|
+
- **A final success step with no field is a status region**
|
|
805
|
+
(`role="status"`), announced as it appears, not a focus target.
|
|
806
|
+
|
|
716
807
|
### Header, footer and body
|
|
717
808
|
|
|
718
809
|
A `title` prop renders the standard header (title text + close button) and wires
|
|
719
|
-
`aria-labelledby` for you. Put form fields in the `default` slot
|
|
720
|
-
the `footer` slot — keep exactly one
|
|
810
|
+
`aria-labelledby` for you. Put form fields in the `default` slot. Buttons are
|
|
811
|
+
the props above; the `footer` slot is for anything else — keep exactly one
|
|
812
|
+
primary action there. Slot the buttons
|
|
721
813
|
straight in: the footer is a row that sits them at the end, 8px apart, and
|
|
722
814
|
wraps on a narrow sheet; `class="me-auto"` on one pushes it to the start (a
|
|
723
815
|
"Delete" opposite "Cancel / Save"). A single wrapping `<div>` of your own
|
|
724
816
|
stretches to the full width and keeps whatever layout you give it. The body area scrolls internally when content overflows; header and
|
|
725
817
|
footer stay pinned. This edit-record dialog is opened by id from each row
|
|
726
818
|
with that row's `data` and edits it in place: `data` is the opening's own
|
|
727
|
-
copy, so a canceled edit never reaches the row, and
|
|
728
|
-
|
|
819
|
+
copy, so a canceled edit never reaches the row, and `ok` hands the copy back
|
|
820
|
+
for the row's `onComplete`.
|
|
729
821
|
|
|
730
822
|
**Edit-record dialog with a footer action**
|
|
731
823
|
|
|
@@ -758,8 +850,15 @@ with `complete(data)` for the row's `onComplete`.
|
|
|
758
850
|
</li>
|
|
759
851
|
</ul>
|
|
760
852
|
<!-- `data` is this opening's own copy of the contact: the fields edit it
|
|
761
|
-
directly, Cancel throws it away, Save
|
|
762
|
-
|
|
853
|
+
directly, Cancel throws it away, Save hands it back (no form inside,
|
|
854
|
+
so ok completes with `data`). -->
|
|
855
|
+
<BbDialog
|
|
856
|
+
id="edit-contact"
|
|
857
|
+
cancel
|
|
858
|
+
ok="Save changes"
|
|
859
|
+
size="md"
|
|
860
|
+
title="Edit contact"
|
|
861
|
+
>
|
|
763
862
|
<template #default="{ data }">
|
|
764
863
|
<div class="grid gap-3">
|
|
765
864
|
<BbTextInput v-model="data.name" compact label="Full name" />
|
|
@@ -774,12 +873,6 @@ with `complete(data)` for the row's `onComplete`.
|
|
|
774
873
|
<BbSwitch v-model="data.subscribed" label="Subscribed to updates" />
|
|
775
874
|
</div>
|
|
776
875
|
</template>
|
|
777
|
-
<template #footer="{ data, close, complete }">
|
|
778
|
-
<BbButton variant="ghost" @click="close">Cancel</BbButton>
|
|
779
|
-
<BbButton variant="primary" @click="complete(data)">
|
|
780
|
-
Save changes
|
|
781
|
-
</BbButton>
|
|
782
|
-
</template>
|
|
783
876
|
</BbDialog>
|
|
784
877
|
</template>
|
|
785
878
|
|
|
@@ -906,12 +999,11 @@ the `title` slot, which receives `data` like the other slots (so does the
|
|
|
906
999
|
<BbButton v-bb-dialog="{ id: 'rename', data: { name: 'Roadmap' } }">
|
|
907
1000
|
Rename
|
|
908
1001
|
</BbButton>
|
|
909
|
-
<BbDialog id="rename">
|
|
1002
|
+
<BbDialog id="rename" ok="Rename">
|
|
910
1003
|
<template #title="{ data }">Rename “{{ data.name }}”</template>
|
|
911
|
-
<template #default="{ data
|
|
912
|
-
<BbForm :model="data"
|
|
1004
|
+
<template #default="{ data }">
|
|
1005
|
+
<BbForm :model="data">
|
|
913
1006
|
<BbTextInput label="Name" name="name" />
|
|
914
|
-
<BbButton type="submit">Rename</BbButton>
|
|
915
1007
|
</BbForm>
|
|
916
1008
|
</template>
|
|
917
1009
|
</BbDialog>
|
|
@@ -1020,77 +1112,53 @@ Two rules keep dialog forms honest:
|
|
|
1020
1112
|
one: then only a `<BbForm :model="data">` starts blank, and anything reading
|
|
1021
1113
|
`data.x` needs `default-data` (see
|
|
1022
1114
|
[Create and edit in one dialog](#create-and-edit-in-one-dialog-default-data)).
|
|
1023
|
-
-
|
|
1024
|
-
|
|
1025
|
-
set to `false`) closes with no result.
|
|
1026
|
-
your toast/refresh happens.
|
|
1115
|
+
- `ok` does the work, then closes: it submits the form, and the save's
|
|
1116
|
+
resolved record is the opener's result. Never call `complete` in a form
|
|
1117
|
+
dialog; `hide()` (or the model set to `false`) closes with no result.
|
|
1027
1118
|
|
|
1028
1119
|
#### A failed save stays open
|
|
1029
1120
|
|
|
1030
|
-
Close only when the save worked
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
under its field and focus on the first one. The user fixes it and submits
|
|
1034
|
-
again; Cancel still throws the copy away.
|
|
1121
|
+
Close only when the save worked, and that is the default: `ok` completes
|
|
1122
|
+
only on a successful submit. Return the request from `@submit` and let it
|
|
1123
|
+
reject (see [A save the server refuses](#a-save-the-server-refuses)):
|
|
1035
1124
|
|
|
1036
1125
|
```vue
|
|
1037
1126
|
<script setup lang="ts">
|
|
1038
|
-
import {
|
|
1039
|
-
|
|
1040
|
-
type
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
: { email: ['Use your work address.'] };
|
|
1048
|
-
|
|
1049
|
-
const form = useBbForm('edit-member-form');
|
|
1127
|
+
import { BbDialog, BbForm, BbTextInput } from 'bitboss-ui';
|
|
1128
|
+
|
|
1129
|
+
type Role = { id?: number; name: string };
|
|
1130
|
+
const props = defineProps<{ role?: Role }>();
|
|
1131
|
+
// A 422 rejects with the field errors; the form shows them.
|
|
1132
|
+
const save = (values: Role) =>
|
|
1133
|
+
props.role
|
|
1134
|
+
? api.put(`/roles/${props.role.id}`, values)
|
|
1135
|
+
: api.post('/roles', values);
|
|
1050
1136
|
</script>
|
|
1051
1137
|
|
|
1052
1138
|
<template>
|
|
1053
|
-
<BbDialog
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
}
|
|
1063
|
-
"
|
|
1064
|
-
>
|
|
1139
|
+
<BbDialog
|
|
1140
|
+
id="role-edit"
|
|
1141
|
+
v-slot="{ data }"
|
|
1142
|
+
cancel
|
|
1143
|
+
:ok="role ? 'Save' : 'Create role'"
|
|
1144
|
+
:default-data="{ name: '' }"
|
|
1145
|
+
title="Role"
|
|
1146
|
+
>
|
|
1147
|
+
<BbForm :model="data" @submit="save">
|
|
1065
1148
|
<BbTextInput label="Name" name="name" />
|
|
1066
|
-
<BbTextInput label="Email" name="email" type="email" />
|
|
1067
|
-
<BbButton type="submit">Save</BbButton>
|
|
1068
1149
|
</BbForm>
|
|
1069
1150
|
</BbDialog>
|
|
1070
1151
|
</template>
|
|
1071
1152
|
```
|
|
1072
1153
|
|
|
1073
|
-
- **While it saves, the dialog refuses every user close** (the ✕, Cancel
|
|
1074
|
-
|
|
1075
|
-
|
|
1154
|
+
- **While it saves, the dialog refuses every user close** (the ✕, Cancel,
|
|
1155
|
+
Escape, the backdrop): the form locks it until the promise settles, so the
|
|
1156
|
+
answer never lands on a closed dialog.
|
|
1076
1157
|
- **The opener sees nothing until it completes.** A failed attempt settles
|
|
1077
|
-
no result; `onComplete` (or `await show()`) gets the saved
|
|
1078
|
-
later attempt
|
|
1079
|
-
- A message with no field (Laravel's `message
|
|
1080
|
-
|
|
1081
|
-
the form's `unmatchedErrors` (see BbForm § Server errors).
|
|
1082
|
-
|
|
1083
|
-
#### Steps in one dialog
|
|
1084
|
-
|
|
1085
|
-
- **Each step's first field gets `autofocus`**: it fires when the field
|
|
1086
|
-
mounts, so focus follows the step with no watcher (`focus-target` picks only
|
|
1087
|
-
where the opening starts).
|
|
1088
|
-
- **A final success step with no field is a status region**
|
|
1089
|
-
(`role="status"`), announced as it appears, not a focus target.
|
|
1090
|
-
- **A footer button that changes type in place** (Next, `type="button"`,
|
|
1091
|
-
becoming Accept, `type="submit"`, during its own click): give each its own
|
|
1092
|
-
`key`. Unkeyed, Vue reuses the element, its type flips mid-click, and the
|
|
1093
|
-
click on Next submits the form.
|
|
1158
|
+
no result; `onComplete` (or `await show()`) gets the saved record once a
|
|
1159
|
+
later attempt succeeds, or a dismissal if the user gives up.
|
|
1160
|
+
- A message with no field (Laravel's `message`) goes to the form's
|
|
1161
|
+
`unmatchedErrors` (see BbForm § Server errors).
|
|
1094
1162
|
|
|
1095
1163
|
### Lifecycle events and lazy content
|
|
1096
1164
|
|
|
@@ -1107,10 +1175,10 @@ Every way to close, side by side:
|
|
|
1107
1175
|
|
|
1108
1176
|
| What | Who calls it | Can it be refused? | Result it settles | When it happens |
|
|
1109
1177
|
| ------------------------------------------------------- | ------------ | ------------------------------------- | --------------------------------------------- | ----------------------------------------------------------------------------------- |
|
|
1110
|
-
| the ✕,
|
|
1178
|
+
| the ✕, `cancel`, `close()` | the user | yes: `prevent-close`, a saving form | `{ completed: false, reason: 'close' }` | on the click |
|
|
1111
1179
|
| Escape, Back on a URL dialog, a backdrop click, a swipe | the user | yes: `persistent` too | `reason: 'escape'` / `'backdrop'` / `'swipe'` | on the key, Back, click or swipe |
|
|
1112
1180
|
| `hide()` (handle), the model set to `false` | your code | no | `{ completed: false, reason: 'hide' }` | at once |
|
|
1113
|
-
| `complete(value)`
|
|
1181
|
+
| `ok`, `complete(value)` | your code | no | `{ completed: true, value }` | at once |
|
|
1114
1182
|
| `@hide` | the dialog | it reports a close, it can't stop one | emits it (the same object) | as any close above **starts** |
|
|
1115
1183
|
| `@hidden` | the dialog | it reports a close, it can't stop one | already settled | after the close transition; focus returns, `data` clears and the body unmounts then |
|
|
1116
1184
|
|
|
@@ -1282,10 +1350,9 @@ import { BbButton, BbDialog, BbTextInput } from 'bitboss-ui';
|
|
|
1282
1350
|
The busy case in practice: put the fields in a `BbForm` and return the save's
|
|
1283
1351
|
promise from `@submit`. While it runs the form makes its fields read-only, its
|
|
1284
1352
|
submit button spins, and the dialog refuses the backdrop, `Escape`, the ✕ and
|
|
1285
|
-
Cancel
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
user's close, still refused while the save runs. `disable-submit-lock` on the form keeps the
|
|
1353
|
+
Cancel; no `saving` ref, no `prevent-close`, no `:disabled`. `ok` closes
|
|
1354
|
+
once the save resolves (or `hide()` when nobody needs the result); Cancel is
|
|
1355
|
+
the user's close, still refused while the save runs. `disable-submit-lock` on the form keeps the
|
|
1289
1356
|
fields editable and the dialog closable. The lock is the nearest surface's: a
|
|
1290
1357
|
form in a popover inside the dialog does not lock the dialog.
|
|
1291
1358
|
|
|
@@ -1737,10 +1804,8 @@ A `pt` value written in `<script>` (a constant, a preset, a wrapper's
|
|
|
1737
1804
|
`href`/`to` to the button.
|
|
1738
1805
|
- **Don't toggle `v-model` from `@hide`/`@hidden` handlers** to "cancel" a
|
|
1739
1806
|
close — use `persistent` instead; the close paths already guard correctly.
|
|
1740
|
-
- **
|
|
1741
|
-
|
|
1742
|
-
saves). Uncaught, the rejection travels through the form's `@submit` and
|
|
1743
|
-
reaches `app.config.errorHandler`.
|
|
1807
|
+
- **Don't call `complete()` in a form dialog** — `ok` submits the form and
|
|
1808
|
+
completes on success; a failed save stays open by itself.
|
|
1744
1809
|
- **Don't leave the `header` slot without a close control** — it replaces the
|
|
1745
1810
|
default ×, so you must render your own wired to `close`.
|
|
1746
1811
|
- **Don't query dialog content before it has opened, or after it has closed**,
|
|
@@ -1785,7 +1850,9 @@ A `pt` value written in `<script>` (a constant, a preset, a wrapper's
|
|
|
1785
1850
|
| Prop | Type | Default | Required | Description |
|
|
1786
1851
|
| --- | --- | --- | --- | --- |
|
|
1787
1852
|
| `pt:<part>`, `pt:<part>:<state>`, `pt` | `PtValue` | | | Passthrough — a class list, or `{ class, style, attrs }`, bound to one named part of the component; the state form applies only while that state is on. Parts: `close`, `content`, `description`, `footer`, `header`, `root`, `sheet`, `title`. States: `fullscreen`, `open`. What each one is: _Passthrough parts and states_ below. `pt` is the object form with the same keys minus the prefix (`{ icon: '…', 'icon:loading': '…' }`). See `guides/passthrough.md`. In `<script>` a `pt` value is typed `BbDialogProps['pt']` (`PtValue` is not exported): § Typing `pt` in `<script>`. |
|
|
1853
|
+
| `actions` | `false \| readonly ActionButtonConfig[] \| undefined` | `undefined` | | Footer buttons replacing `ok` / `cancel`, in order: each runs its `onClick`, then completes the dialog with `data`. `false`: none. |
|
|
1788
1854
|
| `adaptive` | `boolean \| undefined` | ``all.adaptive` (`true`)` | | On mobile, renders as a `BbOffCanvas` drawer instead of a centred dialog; the surface is chosen when the dialog opens and kept until it closes. Unset: the global `all.adaptive`. |
|
|
1855
|
+
| `cancel` | `BbAction \| undefined` | | | The dismiss button, before `ok`: `true` (the locale's Cancel), a label, or a button config. Clicked: its `onClick`, then the dialog closes as a dismissal (`reason: 'close'`). Unset: no button. |
|
|
1789
1856
|
| `defaultData` | `Record<string, any> \| undefined` | | | What `data` is when an opening passes none (a create): an object, copied at once, so inputs bind `data.x` with no guard. An opening's data lays over it (`{ ...defaultData, ...row }`, one level). `reset()` restores its keys but keeps an edit's `id`; a close restores it. |
|
|
1790
1857
|
| `description` | `string \| undefined` | | | One short line under the title, muted (the shadcn `DialogDescription` shape), and the only element `aria-describedby` points at. Keep it to a sentence; anything longer belongs in the body. |
|
|
1791
1858
|
| `eager` | `boolean \| undefined` | `false` | | Keep the body mounted while closed, from before the first opening. Without it the body mounts per opening and unmounts after `@hidden`. `data` still clears while closed, so an eager body guards its reads. |
|
|
@@ -1796,6 +1863,7 @@ A `pt` value written in `<script>` (a constant, a preset, a wrapper's
|
|
|
1796
1863
|
| `modelValue` | `boolean \| undefined` | `false` | | Used by v-model to open / close the dialog. A dialog with no `v-model` starts closed. |
|
|
1797
1864
|
| `navigation` | `boolean \| undefined` | `false` | | Syncs the open state with the URL: opening writes `?<queryKey>=true`, closing removes it, a URL with the key opens the dialog on load, and Back closes it (refused whenever Escape is). Template dialogs only; keep a record id in your own query. |
|
|
1798
1865
|
| `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). |
|
|
1866
|
+
| `ok` | `BbAction \| undefined` | | | The primary footer button: `true` (the locale's OK), a label, or a button config. Clicked: its `onClick`, else it submits the one `BbForm` inside, else `complete(data)`. Unset: no button. Config sets its look. |
|
|
1799
1867
|
| `persistent` | `boolean \| undefined` | `false` | | Blocks closing by outside click or Escape. The header close (×) STILL closes a persistent dialog, the documented escape hatch: add `hideClose` to remove it, or use `preventClose` to block every dismissal. Programmatic close still works. |
|
|
1800
1868
|
| `preventClose` | `boolean \| undefined` | ``undefined` (follows a saving form inside)` | | Refuses every user close (backdrop, Escape, the ✕, the slots' `close`) with the deny nudge; `v-model` still closes. Unset: locked while a `BbForm` inside saves (an async `@submit`). `true`: always; `false`: never, not even mid-save. Beside a form: `busy \|\| undefined`. |
|
|
1801
1869
|
| `queryKey` | `string \| undefined` | `"dialog"` | | The query key `navigation` writes. |
|
|
@@ -1831,6 +1899,7 @@ States are listed in precedence order: when two are on at once and their entries
|
|
|
1831
1899
|
|
|
1832
1900
|
## Events
|
|
1833
1901
|
|
|
1902
|
+
- `complete` — `(value: any): void` — The dialog completes (`ok`, `complete(value)`): the same value as the opener's `onComplete`, before it. Return a promise to keep the dialog open and locked until it settles; `false` or a throw keeps it open.
|
|
1834
1903
|
- `hidden` — `(): void` — Emitted after the close transition completes and the dialog is fully dismissed.
|
|
1835
1904
|
- `hide` — `(result: BbDialogResult): void` — Emitted as soon as the dialog starts to close (model becomes false), with the opening's result: the same object its promise settles with, `{ completed: true, value }` or `{ completed: false, reason }`.
|
|
1836
1905
|
- `show` — `(): void` — Emitted as soon as the dialog starts to open (model becomes true).
|