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
|
@@ -12,13 +12,19 @@ import { BbConfirmPortalSlotProps } from '../components/BbConfirm/types.js';
|
|
|
12
12
|
* @internal
|
|
13
13
|
*/
|
|
14
14
|
export type ResolvedButtonConfig = {
|
|
15
|
-
/** Label. Always present on
|
|
15
|
+
/** Label. Always present on ok/cancel (locale defaults); optional on custom actions. */
|
|
16
16
|
text?: string;
|
|
17
17
|
variant: ButtonVariantType;
|
|
18
18
|
size: BbButtonProps['size'];
|
|
19
19
|
'prepend:icon'?: IconType;
|
|
20
20
|
'append:icon'?: IconType;
|
|
21
|
-
icon
|
|
21
|
+
/** The icon alone, `text` the accessible name. */
|
|
22
|
+
iconOnly?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* The keys that took the confirm's default, not a written value: where
|
|
25
|
+
* the config's `BbConfirm.okProps` / `.cancelProps` applies.
|
|
26
|
+
*/
|
|
27
|
+
defaulted?: ReadonlyArray<'text' | 'variant' | 'size'>;
|
|
22
28
|
/** Stretch the button to fill all available footer width. */
|
|
23
29
|
block?: boolean;
|
|
24
30
|
/**
|
|
@@ -29,10 +35,10 @@ export type ResolvedButtonConfig = {
|
|
|
29
35
|
};
|
|
30
36
|
/**
|
|
31
37
|
* Configuration for a single action button in a confirm dialog.
|
|
32
|
-
* Passed as `
|
|
38
|
+
* Passed as `ok`, `cancel`, or an `actions` array element on `BbConfirmMessage`.
|
|
33
39
|
*
|
|
34
40
|
* The `onClick` return value feeds the promise when `returning: true`.
|
|
35
|
-
* The
|
|
41
|
+
* The ok button inherits the `'destructive'` variant when the confirm
|
|
36
42
|
* `variant` is `'destructive'`.
|
|
37
43
|
*/
|
|
38
44
|
export type ConfirmButtonConfig = ActionButtonConfig;
|
|
@@ -40,9 +46,9 @@ export type ConfirmButtonConfig = ActionButtonConfig;
|
|
|
40
46
|
* Configuration options for a single `confirm()` call.
|
|
41
47
|
*
|
|
42
48
|
* Defaults applied by `confirm()`:
|
|
43
|
-
* - `
|
|
44
|
-
* - `
|
|
45
|
-
* - `
|
|
49
|
+
* - `ok`: the `confirm.ok` locale string (`'OK'` with the default `'en'` locale)
|
|
50
|
+
* - `cancel`: the `confirm.cancel` locale string (`'Cancel'` with the default `'en'` locale)
|
|
51
|
+
* - `dismissAsCancel: true`
|
|
46
52
|
* - `autoClose: true`
|
|
47
53
|
*
|
|
48
54
|
* **Content** — at least one of `title`, `text`, or `portal` should be set.
|
|
@@ -50,17 +56,17 @@ export type ConfirmButtonConfig = ActionButtonConfig;
|
|
|
50
56
|
*
|
|
51
57
|
* **Portal modes:**
|
|
52
58
|
* - `portal: 'name'` — activates a `<BbConfirmPortal name="name">` already mounted in the
|
|
53
|
-
* template. Its slot receives `{
|
|
59
|
+
* template. Its slot receives `{ ok, cancel, data }` where `data` is the `data` option.
|
|
54
60
|
* - `portal: MyComponent` — renders `MyComponent` directly inside the dialog. `data`'s keys
|
|
55
61
|
* are forwarded as component props via `v-bind`.
|
|
56
62
|
*/
|
|
57
63
|
export type BbConfirmMessage = {
|
|
58
64
|
/**
|
|
59
65
|
* Footer action buttons.
|
|
60
|
-
* - omitted — default
|
|
66
|
+
* - omitted — default Cancel / OK footer.
|
|
61
67
|
* - `false` — hide the footer entirely (e.g. a portal owns the buttons).
|
|
62
|
-
* - `ConfirmButtonConfig[]` — replace
|
|
63
|
-
* `
|
|
68
|
+
* - `ConfirmButtonConfig[]` — replace Cancel / OK with these buttons; `ok`
|
|
69
|
+
* and `cancel` are ignored. Clicking any action resolves the promise with `true`
|
|
64
70
|
* (or the button's `onClick` return value when `returning: true`). Implicit
|
|
65
71
|
* dismissal (backdrop, Escape, X, `duration`) resolves `false` without
|
|
66
72
|
* invoking any callback.
|
|
@@ -75,8 +81,8 @@ export type BbConfirmMessage = {
|
|
|
75
81
|
autoClose?: boolean;
|
|
76
82
|
/**
|
|
77
83
|
* Whether *user-initiated* implicit dismissals (backdrop click, X button,
|
|
78
|
-
* Escape) invoke `
|
|
79
|
-
* `
|
|
84
|
+
* Escape) invoke `cancel.onClick`. Explicit Cancel button clicks always
|
|
85
|
+
* invoke `cancel.onClick` regardless of this flag.
|
|
80
86
|
*
|
|
81
87
|
* *System-initiated* dismissals — `duration` timeout, the owner scope
|
|
82
88
|
* unmounting, `dismissAll()` — always resolve
|
|
@@ -84,23 +90,25 @@ export type BbConfirmMessage = {
|
|
|
84
90
|
*
|
|
85
91
|
* @defaultValue `true`
|
|
86
92
|
*/
|
|
87
|
-
|
|
93
|
+
dismissAsCancel?: boolean;
|
|
88
94
|
/**
|
|
89
|
-
*
|
|
95
|
+
* The dismiss button, before ok.
|
|
90
96
|
* - `false` — hide the button
|
|
97
|
+
* - `true` — the default (the locale's Cancel)
|
|
91
98
|
* - `string` — show with this label, defaults otherwise
|
|
92
99
|
* - `ConfirmButtonConfig` — full control over label, variant, size, icons and click handler
|
|
93
100
|
* @defaultValue the `confirm.cancel` locale string (`'Cancel'` with the default `'en'` locale)
|
|
94
101
|
*/
|
|
95
|
-
|
|
102
|
+
cancel?: boolean | string | ConfirmButtonConfig;
|
|
96
103
|
/**
|
|
97
|
-
*
|
|
104
|
+
* The confirming button.
|
|
98
105
|
* - `false` — hide the button
|
|
106
|
+
* - `true` — the default (the locale's OK)
|
|
99
107
|
* - `string` — show with this label, defaults otherwise
|
|
100
108
|
* - `ConfirmButtonConfig` — full control over label, variant, size, icons and click handler
|
|
101
109
|
* @defaultValue the `confirm.ok` locale string (`'OK'` with the default `'en'` locale)
|
|
102
110
|
*/
|
|
103
|
-
|
|
111
|
+
ok?: boolean | string | ConfirmButtonConfig;
|
|
104
112
|
/**
|
|
105
113
|
* CSS selector of the element to focus after the dialog opens.
|
|
106
114
|
* Defaults to the first tabbable element inside the dialog.
|
|
@@ -112,7 +120,7 @@ export type BbConfirmMessage = {
|
|
|
112
120
|
fullscreen?: boolean | 'mobile';
|
|
113
121
|
/**
|
|
114
122
|
* Hide the X close button. Always hidden while a callback is running (`isBusy`).
|
|
115
|
-
* Combine with `persistent: true` to force users through the
|
|
123
|
+
* Combine with `persistent: true` to force users through the OK / Cancel buttons.
|
|
116
124
|
*/
|
|
117
125
|
hideClose?: boolean;
|
|
118
126
|
/**
|
|
@@ -124,7 +132,7 @@ export type BbConfirmMessage = {
|
|
|
124
132
|
/**
|
|
125
133
|
* Custom dialog content. Two modes:
|
|
126
134
|
* - `string` — name of a `<BbConfirmPortal name="...">` mounted elsewhere in the template.
|
|
127
|
-
* The portal's default slot receives `{
|
|
135
|
+
* The portal's default slot receives `{ ok, cancel, data }`.
|
|
128
136
|
* - `Component` — a Vue component rendered directly inside the dialog body.
|
|
129
137
|
* Receives `data`'s keys as component props via `v-bind`.
|
|
130
138
|
*/
|
|
@@ -144,7 +152,7 @@ export type BbConfirmMessage = {
|
|
|
144
152
|
* Maximum width of the dialog, as one of the named presets (`'xs'` – `'2xl'`)
|
|
145
153
|
* resolved through the plugin config's `components.BbDialog.sizeMap`. Arbitrary CSS
|
|
146
154
|
* values and per-breakpoint maps are not accepted here. Not to be confused
|
|
147
|
-
* with the per-button `size` inside `
|
|
155
|
+
* with the per-button `size` inside `ok` / `cancel` / `actions`. Overrides the
|
|
148
156
|
* plugin config's `BbConfirm.size`, the default for every confirm.
|
|
149
157
|
* @defaultValue `BbConfirm.size`, else `'sm'` (the `BbDialog` default)
|
|
150
158
|
*/
|
|
@@ -162,14 +170,14 @@ export type BbConfirmMessage = {
|
|
|
162
170
|
/**
|
|
163
171
|
* Visual variant applied as a CSS modifier class on the dialog root (e.g. `'destructive'`).
|
|
164
172
|
* Registered variants are typed; any plain string is also accepted for one-off use.
|
|
165
|
-
* When `'destructive'`, the
|
|
173
|
+
* When `'destructive'`, the ok button defaults to the `destructive` button variant.
|
|
166
174
|
* @defaultValue `'default'`
|
|
167
175
|
*/
|
|
168
176
|
variant?: ConfirmVariantType;
|
|
169
177
|
/**
|
|
170
178
|
* Auto-dismiss after this many milliseconds. Resolves the promise as `false`
|
|
171
|
-
* quietly — a system-initiated dismissal, so `
|
|
172
|
-
* and `
|
|
179
|
+
* quietly — a system-initiated dismissal, so `cancel.onClick` is never invoked
|
|
180
|
+
* and `dismissAsCancel` does not apply. Implicitly sets `autoClose: true`.
|
|
173
181
|
*/
|
|
174
182
|
duration?: number;
|
|
175
183
|
/** Header title. If omitted, no header is rendered. */
|
|
@@ -182,12 +190,12 @@ type StrictButton<B> = B extends object ? NoExtraKeys<B, ConfirmButtonConfig> :
|
|
|
182
190
|
* The excess-property check a generic parameter loses: `confirm<T>` infers
|
|
183
191
|
* `T` from the literal itself, so a misspelt option (`titel`, a leftover
|
|
184
192
|
* `portalProps`) would be part of `T` and type-check. Intersected with the
|
|
185
|
-
* parameter, each unknown key, on the message or on `
|
|
193
|
+
* parameter, each unknown key, on the message or on `ok`/`cancel`/an action,
|
|
186
194
|
* must be `never` and errors on itself. `T` still carries the literal for
|
|
187
195
|
* `ReturnedValue`.
|
|
188
196
|
*/
|
|
189
197
|
type StrictConfirmMessage<T> = NoExtraKeys<T, BbConfirmMessage> & {
|
|
190
|
-
[K in keyof T as K extends '
|
|
198
|
+
[K in keyof T as K extends 'ok' | 'cancel' ? K : never]: StrictButton<T[K]>;
|
|
191
199
|
} & (T extends {
|
|
192
200
|
actions: infer A extends readonly unknown[];
|
|
193
201
|
} ? {
|
|
@@ -195,11 +203,11 @@ type StrictConfirmMessage<T> = NoExtraKeys<T, BbConfirmMessage> & {
|
|
|
195
203
|
[I in keyof A]: StrictButton<A[I]>;
|
|
196
204
|
};
|
|
197
205
|
} : unknown);
|
|
198
|
-
type StackMessage = Omit<BbConfirmMessage, '
|
|
199
|
-
/** `false` = hidden footer; array = normalized custom actions; `undefined` = default
|
|
206
|
+
type StackMessage = Omit<BbConfirmMessage, 'ok' | 'cancel' | 'actions'> & {
|
|
207
|
+
/** `false` = hidden footer; array = normalized custom actions; `undefined` = default ok/cancel footer. */
|
|
200
208
|
actions?: false | ResolvedButtonConfig[];
|
|
201
|
-
|
|
202
|
-
|
|
209
|
+
ok: ResolvedButtonConfig | undefined;
|
|
210
|
+
cancel: ResolvedButtonConfig | undefined;
|
|
203
211
|
resolve: (value: unknown) => void;
|
|
204
212
|
reject: (reason?: unknown) => void;
|
|
205
213
|
/** True once the confirm() promise has resolved or rejected — lets close() warn on a still-pending hide. */
|
|
@@ -214,9 +222,9 @@ type StackMessage = Omit<BbConfirmMessage, 'yes' | 'no' | 'actions'> & {
|
|
|
214
222
|
};
|
|
215
223
|
/** The busy state of one confirm's buttons, and whether it shows. */
|
|
216
224
|
export type ConfirmEntryState = {
|
|
217
|
-
|
|
225
|
+
cancelBusy: boolean;
|
|
218
226
|
processing: boolean;
|
|
219
|
-
|
|
227
|
+
okBusy: boolean;
|
|
220
228
|
/** Index of the running custom action button, or `null` when none is running. */
|
|
221
229
|
actionBusy: number | null;
|
|
222
230
|
};
|
|
@@ -249,9 +257,9 @@ export type ConfirmState = ConfirmEntryState & {
|
|
|
249
257
|
current: StackMessage | null;
|
|
250
258
|
};
|
|
251
259
|
export declare const confirmState: import('vue').ComputedRef<{
|
|
252
|
-
readonly
|
|
260
|
+
readonly cancelBusy: boolean;
|
|
253
261
|
readonly processing: boolean;
|
|
254
|
-
readonly
|
|
262
|
+
readonly okBusy: boolean;
|
|
255
263
|
readonly actionBusy: number | null;
|
|
256
264
|
readonly current: {
|
|
257
265
|
readonly fullscreen?: boolean | "mobile" | undefined;
|
|
@@ -260,14 +268,14 @@ export declare const confirmState: import('vue').ComputedRef<{
|
|
|
260
268
|
} | undefined;
|
|
261
269
|
readonly text?: string | undefined;
|
|
262
270
|
readonly size?: keyof DialogSizes | undefined;
|
|
271
|
+
readonly variant?: ConfirmVariantType | undefined;
|
|
263
272
|
readonly title?: string | undefined;
|
|
264
273
|
readonly hideClose?: boolean | undefined;
|
|
265
|
-
readonly variant?: ConfirmVariantType | undefined;
|
|
266
274
|
readonly focusTarget?: string | undefined;
|
|
267
275
|
readonly persistent?: boolean | undefined;
|
|
268
276
|
readonly stack?: string | undefined;
|
|
269
277
|
readonly autoClose?: boolean | undefined;
|
|
270
|
-
readonly
|
|
278
|
+
readonly dismissAsCancel?: boolean | undefined;
|
|
271
279
|
readonly portal?: string | import('vue').FunctionalComponent<any, {}, any, {}> | {
|
|
272
280
|
new (...args: any[]): any;
|
|
273
281
|
__isFragment?: never;
|
|
@@ -452,11 +460,12 @@ export declare const confirmState: import('vue').ComputedRef<{
|
|
|
452
460
|
} | undefined;
|
|
453
461
|
readonly 'prepend:icon'?: IconType | undefined;
|
|
454
462
|
readonly 'append:icon'?: IconType | undefined;
|
|
455
|
-
readonly
|
|
463
|
+
readonly iconOnly?: boolean | undefined;
|
|
464
|
+
readonly defaulted?: ReadonlyArray<"text" | "variant" | "size"> | undefined;
|
|
456
465
|
readonly block?: boolean | undefined;
|
|
457
466
|
readonly onClick: () => unknown | Promise<unknown>;
|
|
458
467
|
}[] | undefined;
|
|
459
|
-
readonly
|
|
468
|
+
readonly ok: {
|
|
460
469
|
readonly text?: string | undefined;
|
|
461
470
|
readonly variant: ButtonVariantType;
|
|
462
471
|
readonly size: ("sm" | "md" | "lg" | "xl" | "2xl" | "xs") | {
|
|
@@ -469,11 +478,12 @@ export declare const confirmState: import('vue').ComputedRef<{
|
|
|
469
478
|
} | undefined;
|
|
470
479
|
readonly 'prepend:icon'?: IconType | undefined;
|
|
471
480
|
readonly 'append:icon'?: IconType | undefined;
|
|
472
|
-
readonly
|
|
481
|
+
readonly iconOnly?: boolean | undefined;
|
|
482
|
+
readonly defaulted?: ReadonlyArray<"text" | "variant" | "size"> | undefined;
|
|
473
483
|
readonly block?: boolean | undefined;
|
|
474
484
|
readonly onClick: () => unknown | Promise<unknown>;
|
|
475
485
|
} | undefined;
|
|
476
|
-
readonly
|
|
486
|
+
readonly cancel: {
|
|
477
487
|
readonly text?: string | undefined;
|
|
478
488
|
readonly variant: ButtonVariantType;
|
|
479
489
|
readonly size: ("sm" | "md" | "lg" | "xl" | "2xl" | "xs") | {
|
|
@@ -486,7 +496,8 @@ export declare const confirmState: import('vue').ComputedRef<{
|
|
|
486
496
|
} | undefined;
|
|
487
497
|
readonly 'prepend:icon'?: IconType | undefined;
|
|
488
498
|
readonly 'append:icon'?: IconType | undefined;
|
|
489
|
-
readonly
|
|
499
|
+
readonly iconOnly?: boolean | undefined;
|
|
500
|
+
readonly defaulted?: ReadonlyArray<"text" | "variant" | "size"> | undefined;
|
|
490
501
|
readonly block?: boolean | undefined;
|
|
491
502
|
readonly onClick: () => unknown | Promise<unknown>;
|
|
492
503
|
} | undefined;
|
|
@@ -503,7 +514,7 @@ type NamedPortalRender = (scope: BbConfirmPortalSlotProps) => VNode[] | undefine
|
|
|
503
514
|
*
|
|
504
515
|
* - Written by `<BbConfirmPortal name="...">` on mount (via `registerNamedPortal`).
|
|
505
516
|
* - Read by each confirm whose `portal` is a string, which calls the slot
|
|
506
|
-
* with its own `{
|
|
517
|
+
* with its own `{ ok, cancel, data }`.
|
|
507
518
|
*
|
|
508
519
|
* Using `reactive` so that an open confirm re-renders when a portal
|
|
509
520
|
* registers or unregisters.
|
|
@@ -568,10 +579,10 @@ export declare const __resetHostTrackingForTest: () => void;
|
|
|
568
579
|
*/
|
|
569
580
|
export declare const removeConfirmEntry: (entry: ConfirmEntry) => void;
|
|
570
581
|
/**
|
|
571
|
-
* Resolves one confirm (default: the one on top) with
|
|
582
|
+
* Resolves one confirm (default: the one on top) with an ok/cancel outcome.
|
|
572
583
|
*
|
|
573
584
|
* Called by:
|
|
574
|
-
* - The `
|
|
585
|
+
* - The `ok()` / `cancel()` helpers exposed via `<BbConfirmPortal>` slot props.
|
|
575
586
|
* - Backdrop / Escape / X close (implicit dismiss).
|
|
576
587
|
*
|
|
577
588
|
* For direct button clicks in `<BbConfirm>`, the normalized `onClick` on each
|
|
@@ -580,9 +591,9 @@ export declare const removeConfirmEntry: (entry: ConfirmEntry) => void;
|
|
|
580
591
|
* `dismissAll()`) bypass this entirely and settle quietly.
|
|
581
592
|
*
|
|
582
593
|
* @param value - `true` for a positive outcome, `false` for negative.
|
|
583
|
-
* @param explicit - `true` only when the user actively clicked
|
|
594
|
+
* @param explicit - `true` only when the user actively clicked Cancel or called `cancel()`
|
|
584
595
|
* from a portal. Implicit dismissals (backdrop, Escape) pass `false` here and only
|
|
585
|
-
* invoke `
|
|
596
|
+
* invoke `cancel.onClick` when `dismissAsCancel` is `true`.
|
|
586
597
|
*/
|
|
587
598
|
export declare const processMessage: (value: boolean, explicit?: boolean, entry?: ConfirmEntry | undefined) => Promise<void>;
|
|
588
599
|
/**
|
|
@@ -635,15 +646,15 @@ export declare const useConfirm: () => {
|
|
|
635
646
|
* - `returning: true` + `actions` array → union of each action's awaited
|
|
636
647
|
* `onClick` return type (actions without `onClick` contribute `true`),
|
|
637
648
|
* plus `false` for dismissal.
|
|
638
|
-
* - `returning: true` + `
|
|
649
|
+
* - `returning: true` + `ok.onClick` + `cancel.onClick` → union of both return
|
|
639
650
|
* types `| false`.
|
|
640
|
-
* - `returning: true` + only `
|
|
641
|
-
* - `returning: true` + only `
|
|
651
|
+
* - `returning: true` + only `ok.onClick` → `ReturnType<onClick> | false`.
|
|
652
|
+
* - `returning: true` + only `cancel.onClick` → `ReturnType<onClick> | boolean`.
|
|
642
653
|
* - Everything else → `boolean`.
|
|
643
654
|
*
|
|
644
655
|
* Under `returning: true` the union always includes `false`: system dismissals
|
|
645
656
|
* (`duration`, `dismissAll()`, an unmounted owner)
|
|
646
|
-
* and implicit dismissals with `
|
|
657
|
+
* and implicit dismissals with `dismissAsCancel: false` resolve `false`.
|
|
647
658
|
*/
|
|
648
659
|
type ExtractOnClick<B> = B extends {
|
|
649
660
|
onClick: infer F extends (...args: never[]) => unknown;
|
|
@@ -662,10 +673,10 @@ type ReturnedValue<T = object> = T extends {
|
|
|
662
673
|
actions: readonly ConfirmButtonConfig[];
|
|
663
674
|
} ? ActionResults<T['actions']> | false : [
|
|
664
675
|
ExtractOnClick<T extends {
|
|
665
|
-
|
|
676
|
+
ok: infer Y;
|
|
666
677
|
} ? Y : never>,
|
|
667
678
|
ExtractOnClick<T extends {
|
|
668
|
-
|
|
679
|
+
cancel: infer N;
|
|
669
680
|
} ? N : never>
|
|
670
681
|
] extends [infer YFn, infer NFn] ? [YFn, NFn] extends [never, never] ? boolean : [YFn] extends [never] ? Awaited<ReturnType<Extract<NFn, (...args: never[]) => unknown>>> | true | false : [NFn] extends [never] ? Awaited<ReturnType<Extract<YFn, (...args: never[]) => unknown>>> | false : Awaited<ReturnType<Extract<YFn, (...args: never[]) => unknown>>> | Awaited<ReturnType<Extract<NFn, (...args: never[]) => unknown>>> | false : boolean : boolean;
|
|
671
682
|
export {};
|
|
@@ -11,8 +11,8 @@ r(() => {
|
|
|
11
11
|
return {
|
|
12
12
|
current: e?.message ?? null,
|
|
13
13
|
processing: e?.state.processing ?? !1,
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
okBusy: e?.state.okBusy ?? !1,
|
|
15
|
+
cancelBusy: e?.state.cancelBusy ?? !1,
|
|
16
16
|
actionBusy: e?.state.actionBusy ?? null
|
|
17
17
|
};
|
|
18
18
|
});
|
|
@@ -42,9 +42,9 @@ var h = s(/* @__PURE__ */ new Map()), g = (e, t) => (h.set(e, t), () => h.delete
|
|
|
42
42
|
}, D = (e) => {
|
|
43
43
|
e.settled || e.resolve(!1);
|
|
44
44
|
}, O = (e) => {
|
|
45
|
-
process.env.NODE_ENV !== "production" && !e.message.settled && u.warn("Confirm: close() was called while the confirm() promise is still pending. The dialog is hidden, but the promise will never settle — resolve it first via the
|
|
46
|
-
|
|
47
|
-
|
|
45
|
+
process.env.NODE_ENV !== "production" && !e.message.settled && u.warn("Confirm: close() was called while the confirm() promise is still pending. The dialog is hidden, but the promise will never settle — resolve it first via the OK/Cancel buttons or the portal ok()/cancel() helpers."), clearTimeout(e.autoCloseTimer), Object.assign(e.state, {
|
|
46
|
+
okBusy: !1,
|
|
47
|
+
cancelBusy: !1,
|
|
48
48
|
actionBusy: null,
|
|
49
49
|
processing: !1
|
|
50
50
|
}), v === 0 && E(e);
|
|
@@ -56,23 +56,27 @@ var h = s(/* @__PURE__ */ new Map()), g = (e, t) => (h.set(e, t), () => h.delete
|
|
|
56
56
|
let t = p((t) => t.state.processing && t.message.owner === e);
|
|
57
57
|
t && O(t);
|
|
58
58
|
}, M = (e, t, n) => {
|
|
59
|
-
typeof t == "number" ? e.state.actionBusy = n ? t : null : t === "
|
|
59
|
+
typeof t == "number" ? e.state.actionBusy = n ? t : null : t === "ok" ? e.state.okBusy = n : e.state.cancelBusy = n;
|
|
60
60
|
}, N = async (e, t = !1, n = m()) => {
|
|
61
61
|
if (!n) return;
|
|
62
62
|
let r = n.message;
|
|
63
|
-
clearTimeout(n.autoCloseTimer), e ? r.
|
|
63
|
+
clearTimeout(n.autoCloseTimer), e ? r.ok ? await r.ok.onClick() : P(n, !0) : (t || r.dismissAsCancel) && r.cancel ? await r.cancel.onClick() : P(n, !1);
|
|
64
64
|
}, P = (e, t) => {
|
|
65
65
|
e.message.resolve(t), e.message.autoClose && O(e);
|
|
66
66
|
}, F = (e, t) => {
|
|
67
67
|
if (t === !1) return;
|
|
68
|
-
|
|
69
|
-
let n = typeof t == "string" ? { text: t } : t;
|
|
68
|
+
let n = t === void 0 || t === !0 || t === "" ? {} : typeof t == "string" ? { text: t } : t;
|
|
70
69
|
return {
|
|
71
70
|
...e,
|
|
72
71
|
...n,
|
|
73
72
|
text: n.text ?? e.text,
|
|
74
73
|
variant: n.variant ?? e.variant,
|
|
75
|
-
size: n.size ?? e.size
|
|
74
|
+
size: n.size ?? e.size,
|
|
75
|
+
defaulted: [
|
|
76
|
+
"text",
|
|
77
|
+
"variant",
|
|
78
|
+
"size"
|
|
79
|
+
].filter((e) => n[e] === void 0)
|
|
76
80
|
};
|
|
77
81
|
}, I = 0, L = (e, t, n = null) => new Promise((r, i) => {
|
|
78
82
|
if (typeof window > "u") {
|
|
@@ -106,25 +110,25 @@ var h = s(/* @__PURE__ */ new Map()), g = (e, t) => (h.set(e, t), () => h.delete
|
|
|
106
110
|
}
|
|
107
111
|
};
|
|
108
112
|
}, h = Array.isArray(e.actions) ? e.actions : void 0;
|
|
109
|
-
process.env.NODE_ENV !== "production" && h && ((e.
|
|
113
|
+
process.env.NODE_ENV !== "production" && h && ((e.ok !== void 0 || e.cancel !== void 0) && u.warn("Confirm: an `actions` array replaces the footer — `ok` / `cancel` are ignored. Remove them."), h.length || u.warn("Confirm: `actions` is an empty array — the footer renders no buttons and the dialog can only be dismissed."));
|
|
110
114
|
let g = {
|
|
111
|
-
|
|
115
|
+
dismissAsCancel: !0,
|
|
112
116
|
...e,
|
|
113
117
|
autoClose: e.duration ? !0 : d,
|
|
114
118
|
actions: h ? h.map((e, t) => m(F({
|
|
115
119
|
size: "md",
|
|
116
120
|
variant: "outline"
|
|
117
121
|
}, e), t, !0)) : e.actions,
|
|
118
|
-
|
|
122
|
+
ok: h ? void 0 : m(F({
|
|
119
123
|
text: l("confirm.ok").value,
|
|
120
124
|
size: "md",
|
|
121
125
|
variant: c
|
|
122
|
-
}, e.
|
|
123
|
-
|
|
126
|
+
}, e.ok), "ok", !0),
|
|
127
|
+
cancel: h ? void 0 : m(F({
|
|
124
128
|
text: l("confirm.cancel").value,
|
|
125
129
|
size: "md",
|
|
126
130
|
variant: "outline"
|
|
127
|
-
}, e.
|
|
131
|
+
}, e.cancel), "cancel", !1),
|
|
128
132
|
resolve: a,
|
|
129
133
|
reject: o,
|
|
130
134
|
settled: !1,
|
|
@@ -135,8 +139,8 @@ var h = s(/* @__PURE__ */ new Map()), g = (e, t) => (h.set(e, t), () => h.delete
|
|
|
135
139
|
provides: n,
|
|
136
140
|
state: s({
|
|
137
141
|
processing: !0,
|
|
138
|
-
|
|
139
|
-
|
|
142
|
+
okBusy: !1,
|
|
143
|
+
cancelBusy: !1,
|
|
140
144
|
actionBusy: null
|
|
141
145
|
})
|
|
142
146
|
};
|