bitboss-ui 3.0.0-beta.48 → 3.0.0-beta.49
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 +24 -7
- package/bin/bitboss-ui-mcp.mjs +15 -3
- package/bin/bitboss-ui.mjs +115 -13
- package/dist/ai/BbAvatar.md +1 -1
- package/dist/ai/BbBreadcrumbs.md +65 -65
- package/dist/ai/BbButton.md +16 -5
- package/dist/ai/BbCheckbox.md +0 -2
- package/dist/ai/BbCheckboxGroup.md +13 -20
- package/dist/ai/BbDatePickerInput.md +4 -2
- package/dist/ai/BbDialog.md +1 -8
- package/dist/ai/BbDropdown.md +231 -220
- package/dist/ai/BbDropdownButton.md +65 -65
- package/dist/ai/BbDropdownGroup.md +2 -2
- package/dist/ai/BbDropzone.md +10 -10
- package/dist/ai/BbForm.md +43 -52
- package/dist/ai/BbHoverCard.md +4 -2
- package/dist/ai/BbNumberInput.md +88 -21
- package/dist/ai/BbPopover.md +29 -23
- package/dist/ai/BbProgress.md +48 -22
- package/dist/ai/BbRadioGroup.md +13 -19
- package/dist/ai/BbSelect.md +16 -36
- package/dist/ai/BbSelectPopover.md +14 -30
- package/dist/ai/BbSmoothHeight.md +0 -2
- package/dist/ai/BbSwitchGroup.md +13 -20
- package/dist/ai/BbTable.md +11 -10
- package/dist/ai/BbTabs.md +106 -105
- package/dist/ai/BbTabsList.md +2 -2
- package/dist/ai/BbTabsPanels.md +1 -1
- package/dist/ai/BbTabsRoot.md +2 -2
- package/dist/ai/BbTooltip.md +24 -10
- package/dist/ai/BbTree.md +14 -11
- package/dist/ai/changelog.json +256 -5
- package/dist/ai/components.json +36 -34
- package/dist/ai/composables/useBbDropdownContext.md +16 -16
- package/dist/ai/composables/useBbFormField.md +5 -1
- package/dist/ai/composables/useBbTabsContext.md +14 -14
- package/dist/ai/guides/agent-contract.md +27 -27
- package/dist/ai/guides/ai-router.md +1 -1
- package/dist/ai/guides/component-picker.md +3 -3
- package/dist/ai/guides/fetch-items-playbook.md +1 -1
- package/dist/ai/guides/icons-policy.md +10 -10
- package/dist/ai/guides/inertia-helpers.md +120 -67
- package/dist/ai/guides/installation-and-plugin-setup.md +43 -15
- package/dist/ai/guides/migration/components/bb-breadcrumbs.md +3 -2
- package/dist/ai/guides/migration/components/bb-checkbox-group.md +16 -16
- package/dist/ai/guides/migration/components/bb-dropdown-button.md +9 -8
- package/dist/ai/guides/migration/components/bb-dropdown.md +15 -14
- package/dist/ai/guides/migration/components/bb-radio-group.md +2 -1
- package/dist/ai/guides/migration/components/bb-select-popover.md +6 -1
- package/dist/ai/guides/migration/components/bb-select.md +10 -2
- package/dist/ai/guides/migration/components/bb-switch-group.md +2 -1
- package/dist/ai/guides/migration/components/bb-tabs.md +9 -8
- package/dist/ai/guides/migration/components/bb-tooltip.md +1 -1
- package/dist/ai/guides/migration/v2-to-v3.md +114 -17
- package/dist/ai/guides/migration/v3-beta-tooling.md +11 -0
- package/dist/ai/guides/options-items-playbook.md +30 -24
- package/dist/ai/guides/passthrough.md +2 -2
- package/dist/ai/guides/preset-components.md +18 -3
- package/dist/ai/guides/typescript-generic-components.md +1 -1
- package/dist/ai/guides/validated-forms.md +11 -22
- package/dist/ai/guides/validation-providers.md +4 -3
- package/dist/ai/helpers/inertia/manifest.json +636 -0
- package/dist/ai/helpers/inertia/types.ts +15 -0
- package/dist/ai/helpers/inertia/useAsyncFn.ts +110 -0
- package/dist/ai/helpers/inertia/useConfirmOnRouteLeave.ts +102 -0
- package/dist/ai/helpers/inertia/useDeleteCmd.ts +30 -0
- package/dist/ai/helpers/inertia/useHasChanged.ts +36 -0
- package/dist/ai/helpers/inertia/useIndexById.ts +23 -0
- package/dist/ai/helpers/inertia/useLazyProp.ts +148 -0
- package/dist/ai/helpers/inertia/useLazyPropGetter.ts +50 -0
- package/dist/ai/helpers/inertia/useLoading.ts +20 -0
- package/dist/ai/helpers/inertia/usePaginatedResponseContext.ts +88 -0
- package/dist/ai/helpers/inertia/usePromiseForm.ts +62 -0
- package/dist/ai/helpers/inertia/useProp.ts +63 -0
- package/dist/ai/helpers/inertia/useQuery.ts +19 -0
- package/dist/ai/helpers/inertia/useQueryObject.ts +116 -0
- package/dist/ai/helpers/inertia/useResourceContext.ts +69 -0
- package/dist/ai/helpers/inertia/useRouteQuery.ts +54 -0
- package/dist/ai/helpers/inertia/useScreenSizes.ts +23 -0
- package/dist/ai/helpers/inertia/useTableContext.ts +34 -0
- package/dist/ai/helpers/inertia/useTableSelectionContext.ts +48 -0
- package/dist/ai/helpers/inertia/useUntil.ts +33 -0
- package/dist/ai/helpers/inertia/utils.ts +24 -0
- package/dist/ai/index.md +6 -6
- package/dist/ai/manifest/components/BbBreadcrumbs.json +10 -6
- package/dist/ai/manifest/components/BbBreadcrumbs.tree.json +1 -1
- package/dist/ai/manifest/components/BbButton.json +1 -1
- package/dist/ai/manifest/components/BbCheckboxGroup.json +2 -2
- package/dist/ai/manifest/components/BbDropdown.json +23 -20
- package/dist/ai/manifest/components/BbDropdown.tree.json +2 -2
- package/dist/ai/manifest/components/BbDropdownButton.json +22 -19
- package/dist/ai/manifest/components/BbDropdownButton.tree.json +1 -1
- package/dist/ai/manifest/components/BbDropdownGroup.json +2 -2
- package/dist/ai/manifest/components/BbForm.json +1 -0
- package/dist/ai/manifest/components/BbNumberInput.json +6 -1
- package/dist/ai/manifest/components/BbNumberInput.tree.json +2 -1
- package/dist/ai/manifest/components/BbPopover.json +1 -0
- package/dist/ai/manifest/components/BbProgress.json +6 -6
- package/dist/ai/manifest/components/BbProgress.tree.json +1 -0
- package/dist/ai/manifest/components/BbRadioGroup.json +2 -2
- package/dist/ai/manifest/components/BbSelect.json +2 -2
- package/dist/ai/manifest/components/BbSelectPopover.json +2 -2
- package/dist/ai/manifest/components/BbSwitchGroup.json +2 -2
- package/dist/ai/manifest/components/BbTabs.json +7 -6
- package/dist/ai/manifest/components/BbTabsList.json +3 -3
- package/dist/ai/manifest/components/BbTabsPanels.json +1 -1
- package/dist/ai/manifest/components/BbTabsRoot.json +5 -4
- package/dist/ai/manifest/components/BbTooltip.json +1 -1
- package/dist/ai/manifest/index.json +2 -2
- package/dist/ai/manifest/meta.json +2 -0
- package/dist/ai/manifest/types.advanced.json +10 -9
- package/dist/ai/manifest/types.api.json +5 -4
- package/dist/ai/recipes/inertia/approvals-inbox.md +16 -18
- package/dist/ai/recipes/inertia/inline-edit-workspace.md +23 -33
- package/dist/ai/recipes/inertia/layout-scaffold.md +16 -16
- package/dist/ai/recipes/inertia/onboarding.md +6 -10
- package/dist/ai/recipes/inertia/ownership-atlas.md +15 -18
- package/dist/ai/recipes/inertia/record-form.md +11 -11
- package/dist/ai/recipes/inertia/records-workspace.md +38 -41
- package/dist/ai/recipes/inertia/settings-workspace.md +26 -38
- package/dist/ai/recipes/inertia/upload-center.md +31 -39
- package/dist/ai/recipes/inertia/wizard-form.md +10 -19
- package/dist/ai/recipes/nuxt/approvals-inbox.md +7 -8
- package/dist/ai/recipes/nuxt/inline-edit-workspace.md +14 -24
- package/dist/ai/recipes/nuxt/layout-scaffold.md +16 -16
- package/dist/ai/recipes/nuxt/onboarding.md +2 -6
- package/dist/ai/recipes/nuxt/ownership-atlas.md +7 -9
- package/dist/ai/recipes/nuxt/record-form.md +5 -5
- package/dist/ai/recipes/nuxt/records-workspace.md +29 -31
- package/dist/ai/recipes/nuxt/settings-workspace.md +22 -34
- package/dist/ai/recipes/nuxt/upload-center.md +22 -29
- package/dist/ai/recipes/nuxt/wizard-form.md +3 -11
- package/dist/ai/recipes/vue/approvals-inbox.md +7 -8
- package/dist/ai/recipes/vue/inline-edit-workspace.md +14 -24
- package/dist/ai/recipes/vue/layout-scaffold.md +16 -16
- package/dist/ai/recipes/vue/onboarding.md +2 -6
- package/dist/ai/recipes/vue/ownership-atlas.md +7 -9
- package/dist/ai/recipes/vue/record-form.md +5 -5
- package/dist/ai/recipes/vue/records-workspace.md +29 -31
- package/dist/ai/recipes/vue/settings-workspace.md +22 -34
- package/dist/ai/recipes/vue/upload-center.md +22 -29
- package/dist/ai/recipes/vue/wizard-form.md +3 -11
- package/dist/ai/source/BbAccordion.md +1 -1
- package/dist/ai/source/BbAlert.md +3 -3
- package/dist/ai/source/BbBadge.md +2 -2
- package/dist/ai/source/BbBadgeButton.md +5 -4
- package/dist/ai/source/BbBaseButton.md +1 -1
- package/dist/ai/source/BbBaseRadioIcon.md +1 -0
- package/dist/ai/source/BbBaseSwitchIcon.md +1 -0
- package/dist/ai/source/BbBreadcrumbs.md +63 -42
- package/dist/ai/source/BbButton.md +71 -33
- package/dist/ai/source/BbCalendar.md +17 -16
- package/dist/ai/source/BbCheckbox.md +3 -2
- package/dist/ai/source/BbCheckboxGroup.md +11 -4
- package/dist/ai/source/BbColorInput.md +10 -9
- package/dist/ai/source/BbConfirm.md +1 -1
- package/dist/ai/source/BbConfirmPortal.md +1 -1
- package/dist/ai/source/BbDatePicker.md +2 -2
- package/dist/ai/source/BbDatePickerInput.md +47 -20
- package/dist/ai/source/BbDialog.md +5 -5
- package/dist/ai/source/BbDropdown.md +230 -158
- package/dist/ai/source/BbDropdownButton.md +19 -12
- package/dist/ai/source/BbDropdownGroup.md +126 -93
- package/dist/ai/source/BbForm.md +25 -1
- package/dist/ai/source/BbIndicator.md +4 -0
- package/dist/ai/source/BbNumberInput.md +855 -19
- package/dist/ai/source/BbOffCanvas.md +27 -11
- package/dist/ai/source/BbPagination.md +3 -3
- package/dist/ai/source/BbPopover.md +152 -8
- package/dist/ai/source/BbPopoverPortal.md +11 -0
- package/dist/ai/source/BbProgress.md +82 -18
- package/dist/ai/source/BbRadioGroup.md +12 -5
- package/dist/ai/source/BbRating.md +11 -9
- package/dist/ai/source/BbSelect.md +16 -10
- package/dist/ai/source/BbSelectPopover.md +29 -23
- package/dist/ai/source/BbSlider.md +12 -6
- package/dist/ai/source/BbSwitch.md +3 -2
- package/dist/ai/source/BbSwitchGroup.md +5 -2
- package/dist/ai/source/BbTable.md +102 -18
- package/dist/ai/source/BbTabs.md +27 -23
- package/dist/ai/source/BbTabsList.md +26 -22
- package/dist/ai/source/BbTabsPanels.md +26 -22
- package/dist/ai/source/BbTabsRoot.md +25 -21
- package/dist/ai/source/BbTag.md +10 -9
- package/dist/ai/source/BbTextInput.md +5 -4
- package/dist/ai/source/BbTextarea.md +6 -5
- package/dist/ai/source/BbTimePicker.md +1 -1
- package/dist/ai/source/BbTimePickerInput.md +46 -9
- package/dist/ai/source/BbToast.md +10 -7
- package/dist/ai/source/BbToastPortal.md +10 -7
- package/dist/ai/source/BbTooltip.md +54 -8
- package/dist/ai/source/BbTree.md +21 -3
- package/dist/ai/source/CommonField.md +6 -4
- package/dist/ai/source/CommonFieldInput.md +15 -10
- package/dist/ai/source/CommonPopover.md +6 -0
- package/dist/ai/source/CommonTimeSelector.md +5 -4
- package/dist/components/BbBadge/BbBadgeButton.vue_vue_type_script_setup_true_lang.js +10 -8
- package/dist/components/BbBaseButton/BbBaseButton.vue_vue_type_script_setup_true_lang.js +8 -8
- package/dist/components/BbBreadcrumbs/BbBreadcrumbs.vue_vue_type_script_setup_true_lang.js +45 -45
- package/dist/components/BbBreadcrumbs/types.d.ts +25 -17
- package/dist/components/BbButton/BbButton.vue_vue_type_script_setup_true_lang.js +84 -71
- package/dist/components/BbButton/toggleRoving.d.ts +6 -0
- package/dist/components/BbButton/toggleRoving.js +45 -0
- package/dist/components/BbButton/types.d.ts +4 -1
- package/dist/components/BbCalendar/BbCalendar.vue_vue_type_script_setup_true_lang.js +178 -178
- package/dist/components/BbCalendar/CalendarMonthPanel.vue_vue_type_script_setup_true_lang.js +15 -15
- package/dist/components/BbCalendar/CalendarYearPanel.vue_vue_type_script_setup_true_lang.js +28 -28
- package/dist/components/BbCalendar/useCalendarGrid.js +141 -139
- package/dist/components/BbCalendar/useDayjsLocale.d.ts +38 -15
- package/dist/components/BbCalendar/useDayjsLocale.js +31 -30
- package/dist/components/BbCheckbox/BbCheckbox.vue_vue_type_script_setup_true_lang.js +48 -48
- package/dist/components/BbCheckboxGroup/BbCheckboxGroup.vue_vue_type_script_setup_true_lang.js +81 -80
- package/dist/components/BbCheckboxGroup/types.d.ts +6 -2
- package/dist/components/BbColorInput/BbColorInput.vue_vue_type_script_setup_true_lang.js +69 -69
- package/dist/components/BbDatePickerInput/BbDatePickerInput.vue_vue_type_script_setup_true_lang.js +363 -349
- package/dist/components/BbDropdown/AdaptiveDropdown.vue_vue_type_script_setup_true_lang.js +91 -86
- package/dist/components/BbDropdown/BbDropdown.vue_vue_type_script_setup_true_lang.js +298 -289
- package/dist/components/BbDropdown/BbDropdownList.vue_vue_type_script_setup_true_lang.js +322 -356
- package/dist/components/BbDropdown/DropdownPipelineResolver.vue_vue_type_script_setup_true_lang.js +17 -15
- package/dist/components/BbDropdown/DropdownRow.vue.d.ts +40 -0
- package/dist/components/BbDropdown/DropdownRow.vue.js +5 -0
- package/dist/components/BbDropdown/DropdownRow.vue_vue_type_script_setup_true_lang.js +60 -0
- package/dist/components/BbDropdown/normalizeGroups.d.ts +8 -2
- package/dist/components/BbDropdown/normalizeGroups.js +60 -46
- package/dist/components/BbDropdown/types.d.ts +119 -88
- package/dist/components/BbDropdownButton/BbDropdownButton.vue_vue_type_script_setup_true_lang.js +11 -2
- package/dist/components/BbDropdownButton/types.d.ts +2 -2
- package/dist/components/BbForm/BbForm.vue.d.ts +9 -0
- package/dist/components/BbForm/BbForm.vue_vue_type_script_setup_true_lang.js +114 -105
- package/dist/components/BbForm/BbFormCustomField.js +1 -1
- package/dist/components/BbForm/bindFormField.js +2 -1
- package/dist/components/BbForm/formFields.d.ts +5 -0
- package/dist/components/BbNumberInput/BbNumberInput.vue.d.ts +0 -1
- package/dist/components/BbNumberInput/BbNumberInput.vue_vue_type_script_setup_true_lang.js +452 -125
- package/dist/components/BbNumberInput/numberDisplay.d.ts +256 -0
- package/dist/components/BbNumberInput/numberDisplay.js +499 -0
- package/dist/components/BbNumberInput/types.d.ts +54 -1
- package/dist/components/BbNumberInput/warroom/corpus.d.ts +58 -0
- package/dist/components/BbNumberInput/warroom/currency-verify.rows.d.ts +28 -0
- package/dist/components/BbNumberInput/warroom/currency.rows.d.ts +2 -0
- package/dist/components/BbNumberInput/warroom/harness.d.ts +217 -0
- package/dist/components/BbNumberInput/warroom/oracle.d.ts +150 -0
- package/dist/components/BbPagination/BbPagination.vue_vue_type_script_setup_true_lang.js +7 -7
- package/dist/components/BbPopover/BbPopover.vue.d.ts +1 -0
- package/dist/components/BbPopover/BbPopover.vue_vue_type_script_setup_true_lang.js +207 -164
- package/dist/components/BbPopover/types.d.ts +11 -0
- package/dist/components/BbProgress/BbProgress.vue_vue_type_script_setup_true_lang.js +15 -7
- package/dist/components/BbProgress/types.d.ts +23 -7
- package/dist/components/BbProgress/types.js +1 -1
- package/dist/components/BbRadioGroup/BbRadioGroup.vue_vue_type_script_setup_true_lang.js +102 -101
- package/dist/components/BbRadioGroup/types.d.ts +6 -2
- package/dist/components/BbRating/BbRating.vue_vue_type_script_setup_true_lang.js +63 -63
- package/dist/components/BbSelect/BbSelect.vue_vue_type_script_setup_true_lang.js +156 -154
- package/dist/components/BbSelect/types.d.ts +6 -2
- package/dist/components/BbSelectPopover/BbSelectPopover.vue_vue_type_script_setup_true_lang.js +2 -1
- package/dist/components/BbSelectPopover/types.d.ts +6 -2
- package/dist/components/BbSlider/BbSlider.vue_vue_type_script_setup_true_lang.js +153 -153
- package/dist/components/BbSwitch/BbSwitch.vue_vue_type_script_setup_true_lang.js +62 -62
- package/dist/components/BbSwitchGroup/BbSwitchGroup.vue_vue_type_script_setup_true_lang.js +131 -130
- package/dist/components/BbTable/BbTable.vue_vue_type_script_setup_true_lang.js +711 -676
- package/dist/components/BbTabs/BbTabs.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/BbTabs/BbTabsList.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/BbTabs/types.d.ts +25 -21
- package/dist/components/BbTag/BbTag.vue_vue_type_script_setup_true_lang.js +76 -76
- package/dist/components/BbTextInput/BbTextInput.vue_vue_type_script_setup_true_lang.js +58 -58
- package/dist/components/BbTextarea/BbTextarea.vue_vue_type_script_setup_true_lang.js +82 -82
- package/dist/components/BbTimePickerInput/BbTimePickerInput.vue_vue_type_script_setup_true_lang.js +246 -236
- package/dist/components/BbTooltip/BbTooltip.vue_vue_type_script_setup_true_lang.js +102 -97
- package/dist/components/BbTooltip/tooltipWarmup.d.ts +23 -0
- package/dist/components/BbTooltip/tooltipWarmup.js +7 -0
- package/dist/components/BbTooltip/types.d.ts +7 -2
- package/dist/components/BbTree/BbTree.vue_vue_type_script_setup_true_lang.js +29 -21
- package/dist/components/BbTree/BbTreeLevel.vue_vue_type_script_setup_true_lang.js +10 -7
- package/dist/components/CommonFieldInput/CommonFieldInput.vue_vue_type_script_setup_true_lang.js +37 -36
- package/dist/components/CommonTimeSelector/CommonTimeSelector.vue_vue_type_script_setup_true_lang.js +9 -9
- package/dist/composables/formSubmitLock.d.ts +6 -0
- package/dist/composables/formSubmitLock.js +4 -0
- package/dist/composables/useBaseOptions.d.ts +7 -1
- package/dist/composables/useBaseOptions.js +32 -32
- package/dist/composables/useBbDropdownContext.d.ts +8 -8
- package/dist/composables/useBbFormField.d.ts +9 -0
- package/dist/composables/useBbFormField.js +5 -3
- package/dist/composables/useBbTabsContext.d.ts +10 -10
- package/dist/composables/useBbTabsContext.js +18 -18
- package/dist/composables/useFormBinding.d.ts +11 -0
- package/dist/composables/useFormBinding.js +15 -13
- package/dist/composables/useItemText.d.ts +5 -1
- package/dist/composables/useItemText.js +8 -3
- package/dist/composables/useItemValue.d.ts +5 -1
- package/dist/composables/useItemValue.js +8 -3
- package/dist/composables/useLocale.js +10 -9
- package/dist/deprecation/ai-deprecations.json.d.ts +130 -0
- package/dist/deprecation/ai-deprecations.json.js +1 -1
- package/dist/deprecation/removedProps.js +1 -1
- package/dist/directives/bbDropdown.js +1 -1
- package/dist/i18n/index.d.ts +7 -12
- package/dist/i18n/locales/cs.json +11 -14
- package/dist/i18n/locales/da.json +13 -16
- package/dist/i18n/locales/de-CH.json +137 -0
- package/dist/i18n/locales/de.json +14 -17
- package/dist/i18n/locales/el.json +10 -13
- package/dist/i18n/locales/en-GB.json +137 -0
- package/dist/i18n/locales/en.json +8 -11
- package/dist/i18n/locales/es-MX.json +137 -0
- package/dist/i18n/locales/es.json +16 -19
- package/dist/i18n/locales/fi.json +8 -11
- package/dist/i18n/locales/fr.json +23 -26
- package/dist/i18n/locales/hu.json +8 -11
- package/dist/i18n/locales/it.json +12 -15
- package/dist/i18n/locales/ja.json +13 -16
- package/dist/i18n/locales/ko.json +10 -13
- package/dist/i18n/locales/nb.json +13 -16
- package/dist/i18n/locales/nl.json +21 -24
- package/dist/i18n/locales/pl.json +10 -13
- package/dist/i18n/locales/{pt.json → pt-BR.json} +19 -22
- package/dist/i18n/locales/pt-PT.json +137 -0
- package/dist/i18n/locales/ro.json +22 -25
- package/dist/i18n/locales/ru.json +11 -14
- package/dist/i18n/locales/sv.json +16 -19
- package/dist/i18n/locales/tr.json +14 -17
- package/dist/i18n/locales/uk.json +11 -14
- package/dist/i18n/locales/{zh-cn.json → zh-CN.json} +10 -13
- package/dist/i18n/locales/zh-HK.json +137 -0
- package/dist/i18n/locales/zh-TW.json +137 -0
- package/dist/i18n/regionHints.d.ts +16 -0
- package/dist/i18n/regionHints.js +49 -0
- package/dist/i18n/regions.d.ts +286 -0
- package/dist/i18n/regions.js +265 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +4 -4
- package/dist/llms-full.txt +1785 -1637
- package/dist/llms-medium.txt +74 -46
- package/dist/llms.txt +7 -7
- package/dist/locale-blueprint.json +16 -13
- package/dist/styles.css +2 -2
- package/dist/types/ptComponentMap.d.ts +1 -1
- package/dist/utilities/functions/slotKey.d.ts +2 -2
- package/dist/utils/versionCheck.js +1 -1
- package/dist/vite-plugin.d.ts +22 -19
- package/dist/vite.js +309 -297
- package/llms.txt +7 -7
- package/package.json +5 -3
- package/scripts/lib/agent-manifest.mjs +2 -1
- package/scripts/lib/eslint-disable.mjs +12 -4
- package/scripts/lib/eslint-plugin.d.ts +5 -1
- package/scripts/lib/eslint-plugin.mjs +187 -6
- package/scripts/lib/helper-canon.mjs +176 -0
- package/scripts/lib/helpers-add.mjs +1303 -0
- package/scripts/lib/local-components.mjs +33 -4
- package/scripts/lib/locale-check.mjs +165 -0
- package/scripts/lib/redundant-item-accessor.mjs +398 -0
- package/scripts/lib/renamed-item-field.mjs +343 -0
- package/scripts/lib/slot-key.mjs +2 -2
- package/scripts/lib/slot-renames.mjs +1 -1
- package/scripts/lib/validate-bb-markup.mjs +123 -56
- package/dist/i18n/index.js +0 -27
|
@@ -2,15 +2,15 @@ import { useLogger as e } from "../../composables/useLogger.js";
|
|
|
2
2
|
import { usePassthrough as t } from "../../composables/usePassthrough.js";
|
|
3
3
|
import { removedPropsFor as n } from "../../deprecation/removedProps.js";
|
|
4
4
|
import { slotKey as r } from "../../utilities/functions/slotKey.js";
|
|
5
|
-
import { warnRemovedAttrs as
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import { estimateBreadcrumbItemWidth as
|
|
12
|
-
import { BB_BREADCRUMBS_PT as
|
|
13
|
-
import { Fragment as
|
|
5
|
+
import { warnRemovedAttrs as ee } from "../../utilities/functions/warnRemovedAttrs.js";
|
|
6
|
+
import { useLocale as i } from "../../composables/useLocale.js";
|
|
7
|
+
import a from "../BbIcon/BbIcon.vue.js";
|
|
8
|
+
import o from "../BbBaseButton/BbBaseButton.vue.js";
|
|
9
|
+
import s from "../../assets/svgs/chevron_right.svg_raw.js";
|
|
10
|
+
import c from "../BbDropdown/BbDropdown.vue.js";
|
|
11
|
+
import { estimateBreadcrumbItemWidth as te, estimateEllipsisWidth as ne } from "./estimateBreadcrumbItemWidth.js";
|
|
12
|
+
import { BB_BREADCRUMBS_PT as l } from "./types.js";
|
|
13
|
+
import { Fragment as u, computed as d, createBlock as f, createCommentVNode as p, createElementBlock as m, createElementVNode as h, createSlots as re, createTextVNode as ie, createVNode as g, defineComponent as _, guardReactiveProps as v, mergeProps as y, normalizeProps as b, onBeforeUnmount as ae, openBlock as x, ref as S, renderList as C, renderSlot as w, toDisplayString as oe, unref as T, useAttrs as se, useSlots as ce, watch as le, withCtx as E } from "vue";
|
|
14
14
|
import { useResizeObserver as ue } from "@vueuse/core";
|
|
15
15
|
//#region src/components/BbBreadcrumbs/BbBreadcrumbs.vue?vue&type=script&setup=true&lang.ts
|
|
16
16
|
var de = ["aria-label"], fe = { class: "bb-breadcrumbs__container" }, pe = {
|
|
@@ -54,15 +54,15 @@ var de = ["aria-label"], fe = { class: "bb-breadcrumbs__container" }, pe = {
|
|
|
54
54
|
},
|
|
55
55
|
setup(_) {
|
|
56
56
|
let k = _;
|
|
57
|
-
process.env.NODE_ENV !== "production" &&
|
|
57
|
+
process.env.NODE_ENV !== "production" && ee("BbBreadcrumbs", n("BbBreadcrumbs"), { slotKeys: () => k.items.map((e) => e.value) });
|
|
58
58
|
let A = t({
|
|
59
59
|
component: "BbBreadcrumbs",
|
|
60
60
|
attrs: se(),
|
|
61
61
|
props: k,
|
|
62
|
-
parts:
|
|
63
|
-
states:
|
|
62
|
+
parts: l.parts,
|
|
63
|
+
states: l.states,
|
|
64
64
|
active: { disabled: () => !!k.disabled }
|
|
65
|
-
}), { t: j } =
|
|
65
|
+
}), { t: j } = i();
|
|
66
66
|
e();
|
|
67
67
|
let M = ce(), we = /* @__PURE__ */ new Set([
|
|
68
68
|
"prepend",
|
|
@@ -70,12 +70,12 @@ var de = ["aria-label"], fe = { class: "bb-breadcrumbs__container" }, pe = {
|
|
|
70
70
|
"ellipsis",
|
|
71
71
|
"divider",
|
|
72
72
|
"activator"
|
|
73
|
-
]), N = (e) => e.
|
|
74
|
-
let { "prepend:icon": n, "append:icon": r,
|
|
73
|
+
]), N = (e) => e.value == null || e.value === "" ? ":keyless" : r(String(e.value)), P = (e, t) => t === k.items.length - 1 && !e.href && !e.to && !e.onClick, Te = (e, t) => {
|
|
74
|
+
let { "prepend:icon": n, "append:icon": r, value: ee, label: i, ...a } = e;
|
|
75
75
|
return P(e, t) ? {
|
|
76
|
-
...
|
|
76
|
+
...a,
|
|
77
77
|
"aria-current": "page"
|
|
78
|
-
} :
|
|
78
|
+
} : a;
|
|
79
79
|
}, F = (e, t) => {
|
|
80
80
|
let n = `${N(e)}:${t}`;
|
|
81
81
|
return M[n] ? {
|
|
@@ -88,10 +88,10 @@ var de = ["aria-label"], fe = { class: "bb-breadcrumbs__container" }, pe = {
|
|
|
88
88
|
name: n,
|
|
89
89
|
exists: !1
|
|
90
90
|
};
|
|
91
|
-
}, Ee =
|
|
91
|
+
}, Ee = d(() => Object.keys(M).filter((e) => !we.has(e))), I = S(null), L = S(0), R = d(() => k.gapWidth), z = d(() => Math.max(0, k.offsetWidth)), De = d(() => k.estimationBias), B = d(() => k.ellipsisWidth ?? ne(O)), Oe = d(() => j("breadcrumbs.label").value), ke = d(() => j("breadcrumbs.openHiddenLabelCount", L.value).value), V = (e) => te(e.label ?? "", {
|
|
92
92
|
estimationBias: De.value,
|
|
93
93
|
fontWidth: O
|
|
94
|
-
}), Ae =
|
|
94
|
+
}), Ae = d(() => {
|
|
95
95
|
let e = k.items.length;
|
|
96
96
|
if (e === 0) return 0;
|
|
97
97
|
let t = k.dividerWidth, n = R.value;
|
|
@@ -101,7 +101,7 @@ var de = ["aria-label"], fe = { class: "bb-breadcrumbs__container" }, pe = {
|
|
|
101
101
|
if (!e) return;
|
|
102
102
|
let t = getComputedStyle(e);
|
|
103
103
|
H.value = t.display.includes("flex") && t.flexDirection.startsWith("column");
|
|
104
|
-
}, je =
|
|
104
|
+
}, je = d(() => ({
|
|
105
105
|
"--flex-basis": H.value ? "auto" : `${Math.ceil(Ae.value)}px`,
|
|
106
106
|
"--flex-grow": L.value > 0 ? "1" : "0",
|
|
107
107
|
"--gap": `${R.value}px`
|
|
@@ -111,11 +111,11 @@ var de = ["aria-label"], fe = { class: "bb-breadcrumbs__container" }, pe = {
|
|
|
111
111
|
L.value = 0;
|
|
112
112
|
return;
|
|
113
113
|
}
|
|
114
|
-
let n = Math.max(0, e - be - z.value - D), r = k.dividerWidth,
|
|
115
|
-
for (let e = t - 1; e >= 0; e--)
|
|
116
|
-
let
|
|
117
|
-
if (
|
|
118
|
-
if (t > 1 && c
|
|
114
|
+
let n = Math.max(0, e - be - z.value - D), r = k.dividerWidth, ee = B.value, i = R.value, a = k.items.map(V), o = Array.from({ length: t + 1 }, () => 0);
|
|
115
|
+
for (let e = t - 1; e >= 0; e--) o[e] = o[e + 1] + a[e];
|
|
116
|
+
let s = (e) => n - e <= D / 2, c = o[0] + (t > 1 ? (t - 1) * (r + 2 * i) : 0);
|
|
117
|
+
if (c <= n) {
|
|
118
|
+
if (t > 1 && s(c)) {
|
|
119
119
|
L.value = 1;
|
|
120
120
|
return;
|
|
121
121
|
}
|
|
@@ -123,9 +123,9 @@ var de = ["aria-label"], fe = { class: "bb-breadcrumbs__container" }, pe = {
|
|
|
123
123
|
return;
|
|
124
124
|
}
|
|
125
125
|
for (let e = t - 1; e >= 1; e--) {
|
|
126
|
-
let
|
|
127
|
-
if (
|
|
128
|
-
if (e > 0 && c
|
|
126
|
+
let a = o[t - e], c = ee + e * (r + 2 * i) + a;
|
|
127
|
+
if (c <= n) {
|
|
128
|
+
if (e > 0 && s(c)) {
|
|
129
129
|
L.value = t - (e - 1);
|
|
130
130
|
return;
|
|
131
131
|
}
|
|
@@ -134,7 +134,7 @@ var de = ["aria-label"], fe = { class: "bb-breadcrumbs__container" }, pe = {
|
|
|
134
134
|
}
|
|
135
135
|
}
|
|
136
136
|
L.value = t - 1;
|
|
137
|
-
}, W =
|
|
137
|
+
}, W = d(() => I.value), Ne = d(() => k.items.map((e) => `${String(e.value)}::${e.label ?? ""}`).join("|")), G = null, K = null, q = null, J = null, Y = 0, X = null, Z = (e, t) => Math.abs(e - t) <= xe, Q = () => {
|
|
138
138
|
X != null && clearTimeout(X), X = setTimeout(() => {
|
|
139
139
|
X = null, Y = 0;
|
|
140
140
|
}, Ce);
|
|
@@ -168,9 +168,9 @@ var de = ["aria-label"], fe = { class: "bb-breadcrumbs__container" }, pe = {
|
|
|
168
168
|
}, { immediate: !0 }), ae(() => {
|
|
169
169
|
K != null && cancelAnimationFrame(K), X != null && clearTimeout(X);
|
|
170
170
|
});
|
|
171
|
-
let Fe =
|
|
171
|
+
let Fe = d(() => k.items.slice(0, L.value).map((e) => ({
|
|
172
172
|
...e,
|
|
173
|
-
|
|
173
|
+
label: e.label ?? ""
|
|
174
174
|
})));
|
|
175
175
|
return (e, t) => (x(), m("nav", y({
|
|
176
176
|
ref_key: "navRef",
|
|
@@ -183,7 +183,7 @@ var de = ["aria-label"], fe = { class: "bb-breadcrumbs__container" }, pe = {
|
|
|
183
183
|
h("ol", me, [L.value > 0 ? (x(), m("li", y({
|
|
184
184
|
key: 0,
|
|
185
185
|
class: "bb-breadcrumbs__item"
|
|
186
|
-
}, T(A).part("item", { disabled: e.disabled || void 0 })), [g(
|
|
186
|
+
}, T(A).part("item", { disabled: e.disabled || void 0 })), [g(c, {
|
|
187
187
|
items: Fe.value,
|
|
188
188
|
padding: 0,
|
|
189
189
|
placement: "bottom-start"
|
|
@@ -203,10 +203,10 @@ var de = ["aria-label"], fe = { class: "bb-breadcrumbs__container" }, pe = {
|
|
|
203
203
|
}, [C(Ee.value, (t) => ({
|
|
204
204
|
name: t,
|
|
205
205
|
fn: E((n) => [w(e.$slots, t, b(v(n)))])
|
|
206
|
-
}))]), 1032, ["items"]), L.value < e.items.length ? (x(), m("span", ge, [w(e.$slots, "divider", {}, () => [g(
|
|
207
|
-
icon: T(
|
|
206
|
+
}))]), 1032, ["items"]), L.value < e.items.length ? (x(), m("span", ge, [w(e.$slots, "divider", {}, () => [g(a, {
|
|
207
|
+
icon: T(s),
|
|
208
208
|
size: "14"
|
|
209
|
-
}, null, 8, ["icon"])])])) : p("", !0)], 16)) : p("", !0), (x(!0), m(
|
|
209
|
+
}, null, 8, ["icon"])])])) : p("", !0)], 16)) : p("", !0), (x(!0), m(u, null, C(e.items, (t, n) => (x(), m(u, { key: t.value ?? `:keyless-${n}` }, [n >= L.value ? (x(), m("li", y({
|
|
210
210
|
key: 0,
|
|
211
211
|
class: ["bb-breadcrumbs__item", {
|
|
212
212
|
"bb-breadcrumbs__item--active": P(t, n),
|
|
@@ -216,7 +216,7 @@ var de = ["aria-label"], fe = { class: "bb-breadcrumbs__container" }, pe = {
|
|
|
216
216
|
}, T(A).part("item", {
|
|
217
217
|
active: P(t, n),
|
|
218
218
|
disabled: t.disabled || e.disabled || void 0
|
|
219
|
-
})), [g(
|
|
219
|
+
})), [g(o, y({ ref_for: !0 }, Te(t, n), {
|
|
220
220
|
class: "bb-breadcrumbs__breadcrumb",
|
|
221
221
|
disabled: t.disabled || e.disabled,
|
|
222
222
|
tag: P(t, n) ? "span" : void 0
|
|
@@ -226,9 +226,9 @@ var de = ["aria-label"], fe = { class: "bb-breadcrumbs__container" }, pe = {
|
|
|
226
226
|
disabled: !!(t.disabled || e.disabled),
|
|
227
227
|
index: n,
|
|
228
228
|
item: t,
|
|
229
|
-
|
|
229
|
+
label: t.label
|
|
230
230
|
}),
|
|
231
|
-
!F(t, "prepend").exists && t["prepend:icon"] ? (x(),
|
|
231
|
+
!F(t, "prepend").exists && t["prepend:icon"] ? (x(), f(a, y({
|
|
232
232
|
key: 0,
|
|
233
233
|
class: "bb-breadcrumbs__item-icon bb-breadcrumbs__item-icon--prepend",
|
|
234
234
|
icon: t["prepend:icon"],
|
|
@@ -240,7 +240,7 @@ var de = ["aria-label"], fe = { class: "bb-breadcrumbs__container" }, pe = {
|
|
|
240
240
|
})), null, 16, ["icon"])) : p("", !0),
|
|
241
241
|
h("span", y({
|
|
242
242
|
class: "bb-breadcrumbs__text",
|
|
243
|
-
title: e.items.length > 1 && L.value === e.items.length - 1 ? t.
|
|
243
|
+
title: e.items.length > 1 && L.value === e.items.length - 1 ? t.label : void 0,
|
|
244
244
|
ref_for: !0
|
|
245
245
|
}, T(A).part("text", {
|
|
246
246
|
active: P(t, n),
|
|
@@ -249,15 +249,15 @@ var de = ["aria-label"], fe = { class: "bb-breadcrumbs__container" }, pe = {
|
|
|
249
249
|
disabled: !!(t.disabled || e.disabled),
|
|
250
250
|
index: n,
|
|
251
251
|
item: t,
|
|
252
|
-
|
|
253
|
-
}, () => [ie(oe(t.
|
|
252
|
+
label: t.label
|
|
253
|
+
}, () => [ie(oe(t.label), 1)])], 16, _e),
|
|
254
254
|
w(e.$slots, F(t, "append").name, {
|
|
255
255
|
disabled: !!(t.disabled || e.disabled),
|
|
256
256
|
index: n,
|
|
257
257
|
item: t,
|
|
258
|
-
|
|
258
|
+
label: t.label
|
|
259
259
|
}),
|
|
260
|
-
!F(t, "append").exists && t["append:icon"] ? (x(),
|
|
260
|
+
!F(t, "append").exists && t["append:icon"] ? (x(), f(a, y({
|
|
261
261
|
key: 1,
|
|
262
262
|
class: "bb-breadcrumbs__item-icon bb-breadcrumbs__item-icon--append",
|
|
263
263
|
icon: t["append:icon"],
|
|
@@ -269,8 +269,8 @@ var de = ["aria-label"], fe = { class: "bb-breadcrumbs__container" }, pe = {
|
|
|
269
269
|
})), null, 16, ["icon"])) : p("", !0)
|
|
270
270
|
]),
|
|
271
271
|
_: 2
|
|
272
|
-
}, 1040, ["disabled", "tag"]), n < e.items.length - 1 ? (x(), m("span", ve, [w(e.$slots, "divider", {}, () => [g(
|
|
273
|
-
icon: T(
|
|
272
|
+
}, 1040, ["disabled", "tag"]), n < e.items.length - 1 ? (x(), m("span", ve, [w(e.$slots, "divider", {}, () => [g(a, {
|
|
273
|
+
icon: T(s),
|
|
274
274
|
size: "14"
|
|
275
275
|
}, null, 8, ["icon"])])])) : p("", !0)], 16)) : p("", !0)], 64))), 128))]),
|
|
276
276
|
e.$slots.append ? (x(), m("div", ye, [w(e.$slots, "append", { disabled: e.disabled })])) : p("", !0)
|
|
@@ -1,27 +1,35 @@
|
|
|
1
1
|
import { BbBaseButtonProps } from '../BbBaseButton/types';
|
|
2
2
|
import { PtMap, PtValue } from '../../types/passthrough';
|
|
3
3
|
import { IconType } from '../../types/Icon';
|
|
4
|
-
export type Item = Omit<BbBaseButtonProps, 'block' | 'tag' | 'type'> & {
|
|
4
|
+
export type Item = Omit<BbBaseButtonProps, 'block' | 'tag' | 'type' | 'text'> & {
|
|
5
5
|
/**
|
|
6
6
|
* Click handler of the button.
|
|
7
7
|
*/
|
|
8
8
|
onClick?: (event: MouseEvent) => void | Promise<void>;
|
|
9
|
-
/**
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
|
|
15
|
-
|
|
9
|
+
/** The crumb's text. */
|
|
10
|
+
label?: string;
|
|
11
|
+
/**
|
|
12
|
+
* Identifies the crumb, and names its own slots (`slotKey(value)`,
|
|
13
|
+
* kebab-case: `#<value>`, `#<value>:prepend`, `#<value>:append`). Optional
|
|
14
|
+
* unless the crumb has a slot of its own: a crumb without one renders with
|
|
15
|
+
* the generic slots only (Q53.17 — slot names are written, never derived
|
|
16
|
+
* from the label). A crumb hidden in the overflow menu is a dropdown row with
|
|
17
|
+
* the same `label` and `value`.
|
|
18
|
+
*/
|
|
19
|
+
value?: string;
|
|
20
|
+
/** Crumbs have no `key` (that is `value`). Guards against the old shape. */
|
|
21
|
+
key?: never;
|
|
22
|
+
/** Crumbs have no `text` (that is `label`). Guards against the old shape. */
|
|
23
|
+
text?: never;
|
|
16
24
|
/**
|
|
17
25
|
* Icon rendered before the breadcrumb label, in the leading edge region
|
|
18
26
|
* (outside the link, so it never inherits the link's text styling). Acts as
|
|
19
|
-
* the fallback when no `<
|
|
27
|
+
* the fallback when no `<value>:prepend` / `item:prepend` slot is provided.
|
|
20
28
|
*/
|
|
21
29
|
'prepend:icon'?: IconType;
|
|
22
30
|
/**
|
|
23
31
|
* Icon rendered after the breadcrumb label, in the trailing edge region.
|
|
24
|
-
* Fallback when no `<
|
|
32
|
+
* Fallback when no `<value>:append` / `item:append` slot is provided.
|
|
25
33
|
*/
|
|
26
34
|
'append:icon'?: IconType;
|
|
27
35
|
};
|
|
@@ -111,8 +119,8 @@ export type BbBreadcrumbsItemSlotProps = {
|
|
|
111
119
|
index: number;
|
|
112
120
|
/** The raw item object from the `items` prop. */
|
|
113
121
|
item: Item;
|
|
114
|
-
/** The
|
|
115
|
-
|
|
122
|
+
/** The crumb's label. */
|
|
123
|
+
label?: string;
|
|
116
124
|
};
|
|
117
125
|
/** Props exposed by the `ellipsis` slot. */
|
|
118
126
|
export type BbBreadcrumbsEllipsisSlotProps = {
|
|
@@ -129,9 +137,9 @@ export type BbBreadcrumbsEllipsisSlotProps = {
|
|
|
129
137
|
ellipsisWidth: number;
|
|
130
138
|
};
|
|
131
139
|
/**
|
|
132
|
-
* @dynamicSlot `<
|
|
133
|
-
* @dynamicSlot `<
|
|
134
|
-
* @dynamicSlot `<
|
|
140
|
+
* @dynamicSlot `<value>` {BbBreadcrumbsItemSlotProps} - One crumb's label, by its `value` through `slotKey`; falls back to `item.label`. A crumb folded into the overflow menu follows BbDropdown's slot rules instead (the same `#<value>` names).
|
|
141
|
+
* @dynamicSlot `<value>:prepend` {BbBreadcrumbsItemSlotProps} - The glyph before one crumb's label; beats `item:prepend`, which beats its `prepend:icon`.
|
|
142
|
+
* @dynamicSlot `<value>:append` {BbBreadcrumbsItemSlotProps} - The glyph after one crumb's label; beats `item:append`, which beats its `append:icon`.
|
|
135
143
|
*/
|
|
136
144
|
export type BbBreadcrumbsSlots = {
|
|
137
145
|
/**
|
|
@@ -144,14 +152,14 @@ export type BbBreadcrumbsSlots = {
|
|
|
144
152
|
append?: (props: BbBreadcrumbsEdgeSlotProps) => any;
|
|
145
153
|
/**
|
|
146
154
|
* Content rendered before **every** breadcrumb item's link/button, in the
|
|
147
|
-
* leading edge region. Generic fallback: a per-item `<
|
|
155
|
+
* leading edge region. Generic fallback: a per-item `<value>:prepend` slot
|
|
148
156
|
* takes precedence, and the item's `prepend:icon` is used when neither slot
|
|
149
157
|
* is present.
|
|
150
158
|
*/
|
|
151
159
|
'item:prepend'?: (props: BbBreadcrumbsItemSlotProps) => any;
|
|
152
160
|
/**
|
|
153
161
|
* Content rendered after **every** breadcrumb item's link/button. Generic
|
|
154
|
-
* fallback below a per-item `<
|
|
162
|
+
* fallback below a per-item `<value>:append` slot and above the item's
|
|
155
163
|
* `append:icon`.
|
|
156
164
|
*/
|
|
157
165
|
'item:append'?: (props: BbBreadcrumbsItemSlotProps) => any;
|
|
@@ -4,23 +4,25 @@ import { useUntil as n } from "../../composables/useUntil.js";
|
|
|
4
4
|
import { removedPropsFor as r } from "../../deprecation/removedProps.js";
|
|
5
5
|
import { warnRemovedAttrs as i } from "../../utilities/functions/warnRemovedAttrs.js";
|
|
6
6
|
import { extractDomContainer as a } from "../../utilities/functions/extractDomContainer.js";
|
|
7
|
-
import o from "
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
7
|
+
import { useLocale as o } from "../../composables/useLocale.js";
|
|
8
|
+
import s from "../BbIcon/BbIcon.vue.js";
|
|
9
|
+
import ee from "../BbSpinner/BbSpinner.vue.js";
|
|
10
|
+
import c from "../BbBaseButton/BbBaseButton.vue.js";
|
|
11
|
+
import { BB_FORM_SUBMIT_LOCK as l } from "../../composables/formSubmitLock.js";
|
|
11
12
|
import { pickBy as u } from "../../utilities/functions/pickBy.js";
|
|
12
13
|
import { noop as d } from "../../utilities/functions/noop.js";
|
|
13
14
|
import { isEqual as f } from "../../utilities/functions/isEqual.js";
|
|
14
15
|
import { BB_BUTTON_PT as p } from "./types.js";
|
|
15
|
-
import {
|
|
16
|
+
import { useToggleRoving as m } from "./toggleRoving.js";
|
|
17
|
+
import { Transition as h, computed as g, createBlock as _, createCommentVNode as v, createElementBlock as y, createElementVNode as b, createTextVNode as te, defineComponent as x, inject as S, mergeModels as C, mergeProps as w, openBlock as T, ref as E, renderSlot as D, toDisplayString as O, unref as k, useAttrs as A, useModel as j, watchEffect as M, withCtx as N } from "vue";
|
|
16
18
|
//#region src/components/BbButton/BbButton.vue?vue&type=script&setup=true&lang.ts
|
|
17
|
-
var
|
|
19
|
+
var P = {
|
|
18
20
|
key: 3,
|
|
19
21
|
class: "bb-button__loading-label bb-sr-only"
|
|
20
|
-
},
|
|
22
|
+
}, F = /*@__PURE__*/ x({
|
|
21
23
|
inheritAttrs: !1,
|
|
22
24
|
__name: "BbButton",
|
|
23
|
-
props: /*@__PURE__*/
|
|
25
|
+
props: /*@__PURE__*/ C({
|
|
24
26
|
"pt:root": {},
|
|
25
27
|
"pt:icon": {},
|
|
26
28
|
"pt:spinner": {},
|
|
@@ -103,61 +105,61 @@ var N = {
|
|
|
103
105
|
modelModifiers: {}
|
|
104
106
|
}),
|
|
105
107
|
emits: ["update:modelValue"],
|
|
106
|
-
setup(x, { expose:
|
|
107
|
-
let
|
|
108
|
+
setup(x, { expose: C }) {
|
|
109
|
+
let F = j(x, "modelValue"), I = x;
|
|
108
110
|
process.env.NODE_ENV !== "production" && i("BbButton", r("BbButton"));
|
|
109
|
-
let
|
|
111
|
+
let L = [
|
|
110
112
|
"xs",
|
|
111
113
|
"sm",
|
|
112
114
|
"md",
|
|
113
115
|
"lg",
|
|
114
116
|
"xl",
|
|
115
117
|
"2xl"
|
|
116
|
-
],
|
|
117
|
-
process.env.NODE_ENV !== "production" &&
|
|
118
|
-
|
|
118
|
+
], R = e(), z = g(() => F.value !== void 0), B = g(() => f(F.value, I.trueValue)), { t: V } = o(), H = A(), U = E();
|
|
119
|
+
process.env.NODE_ENV !== "production" && M(() => {
|
|
120
|
+
z.value || "aria-pressed" in H && R.warn("BbButton: `aria-pressed` is managed by the component and your binding is ignored. Bind `v-model` (with `true-value`/`false-value` when the state is not boolean) — that sets `aria-pressed`, applies `bb-button--pressed`, and flips the value on click.");
|
|
119
121
|
});
|
|
120
|
-
let
|
|
121
|
-
|
|
122
|
-
},
|
|
123
|
-
let { onClick: e, class: t, ...n } =
|
|
122
|
+
let W = (e) => {
|
|
123
|
+
U.value = a(e) ?? void 0;
|
|
124
|
+
}, G = g(() => {
|
|
125
|
+
let { onClick: e, class: t, ...n } = H;
|
|
124
126
|
return n;
|
|
125
|
-
}),
|
|
127
|
+
}), K = E(0), q = S(l, null), J = g(() => I.loading || !!K.value && !I.disableAutoLoading || I.type === "submit" && !!q?.locked()), Y = n(J), X = t({
|
|
126
128
|
component: "BbButton",
|
|
127
|
-
attrs:
|
|
128
|
-
props:
|
|
129
|
+
attrs: H,
|
|
130
|
+
props: I,
|
|
129
131
|
parts: p.parts,
|
|
130
132
|
states: p.states,
|
|
131
133
|
active: {
|
|
132
|
-
loading: () =>
|
|
133
|
-
disabled: () => !!
|
|
134
|
-
pressed: () =>
|
|
134
|
+
loading: () => J.value,
|
|
135
|
+
disabled: () => !!I.disabled,
|
|
136
|
+
pressed: () => z.value && B.value
|
|
135
137
|
}
|
|
136
|
-
}),
|
|
137
|
-
if (
|
|
138
|
-
if (
|
|
139
|
-
let e =
|
|
140
|
-
|
|
138
|
+
}), Z = async (e) => {
|
|
139
|
+
if (J.value && !I.interactiveWhileLoading) return (I.type === "submit" || I.href || I.to) && e.preventDefault(), null;
|
|
140
|
+
if (z.value) {
|
|
141
|
+
let e = I.trueValue, t = I.falseValue;
|
|
142
|
+
F.value = f(F.value, e) ? t : e;
|
|
141
143
|
}
|
|
142
|
-
let t = [
|
|
144
|
+
let t = [H.onClick ?? d].flat(), n = t.map((t) => t(e)), r = n.filter((e) => e && typeof e.then == "function");
|
|
143
145
|
if (!r.length) return n[0];
|
|
144
146
|
let i = t.length === 1 ? n[0] : Promise.all(r).then(() => {});
|
|
145
|
-
|
|
147
|
+
K.value++;
|
|
146
148
|
try {
|
|
147
149
|
return await i;
|
|
148
150
|
} finally {
|
|
149
|
-
|
|
151
|
+
K.value--;
|
|
150
152
|
}
|
|
151
|
-
},
|
|
152
|
-
let e = typeof
|
|
153
|
+
}, ne = g(() => {
|
|
154
|
+
let e = typeof I.size == "string" ? { default: I.size } : {
|
|
153
155
|
default: "md",
|
|
154
|
-
...
|
|
156
|
+
...I.size
|
|
155
157
|
};
|
|
156
158
|
return Object.fromEntries(Object.entries(e).map(([e, t]) => {
|
|
157
159
|
let n = t;
|
|
158
|
-
return
|
|
160
|
+
return L.includes(t) || (R.warn(`Invalid size: "${t}" in BbButton. Expected one of: ${L.join(", ")}. Falling back to "md".`), n = "md"), [e === "default" ? `bb-button--${n}` : `bb-button--${e}-${n}`, !0];
|
|
159
161
|
}));
|
|
160
|
-
}),
|
|
162
|
+
}), re = /* @__PURE__ */ new Set([
|
|
161
163
|
"append:icon",
|
|
162
164
|
"disableAutoLoading",
|
|
163
165
|
"disabled",
|
|
@@ -171,61 +173,72 @@ var N = {
|
|
|
171
173
|
"size",
|
|
172
174
|
"trueValue",
|
|
173
175
|
"variant"
|
|
174
|
-
]),
|
|
175
|
-
...
|
|
176
|
-
...u(
|
|
177
|
-
})),
|
|
178
|
-
|
|
179
|
-
|
|
176
|
+
]), ie = g(() => ({
|
|
177
|
+
...G.value,
|
|
178
|
+
...u(I, (e, t) => !re.has(t) && t !== "pt" && !t.startsWith("pt:"))
|
|
179
|
+
})), Q = g(() => J.value && !I.interactiveWhileLoading), $ = m(U, g(() => !!I.group && z.value && !("tabindex" in H)), () => [
|
|
180
|
+
B.value,
|
|
181
|
+
I.disabled,
|
|
182
|
+
Q.value
|
|
183
|
+
]), ae = g(() => {
|
|
184
|
+
let e = Q.value ? -1 : $.tabindex.value;
|
|
185
|
+
return {
|
|
186
|
+
...Q.value ? { "aria-disabled": !0 } : {},
|
|
187
|
+
...e === void 0 ? {} : { tabindex: e }
|
|
188
|
+
};
|
|
189
|
+
}), oe = g(() => w(ie.value, {
|
|
190
|
+
...ae.value,
|
|
191
|
+
"aria-pressed": z.value ? B.value : void 0,
|
|
180
192
|
class: [
|
|
181
193
|
"bb-button",
|
|
182
|
-
|
|
194
|
+
ne.value,
|
|
183
195
|
{
|
|
184
|
-
"bb-button--loading":
|
|
185
|
-
"bb-button--soft-disabled":
|
|
186
|
-
"bb-button--group":
|
|
187
|
-
"bb-button--icon": !!
|
|
188
|
-
"bb-button--pressed":
|
|
189
|
-
[`bb-button--${
|
|
196
|
+
"bb-button--loading": J.value,
|
|
197
|
+
"bb-button--soft-disabled": Q.value,
|
|
198
|
+
"bb-button--group": I.group,
|
|
199
|
+
"bb-button--icon": !!I.icon,
|
|
200
|
+
"bb-button--pressed": z.value && B.value,
|
|
201
|
+
[`bb-button--${I.variant}`]: I.variant !== "none"
|
|
190
202
|
}
|
|
191
203
|
],
|
|
192
|
-
disabled:
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
204
|
+
disabled: I.disabled,
|
|
205
|
+
onClick: Z,
|
|
206
|
+
onFocusin: $.onFocusin,
|
|
207
|
+
onKeydown: $.onKeydown
|
|
208
|
+
}, X.root));
|
|
209
|
+
return C({ $el: U }), (e, t) => (T(), _(k(c), w({ ref: W }, oe.value), {
|
|
210
|
+
default: N(() => [
|
|
211
|
+
k(Y) ? (T(), _(h, {
|
|
199
212
|
key: 0,
|
|
200
213
|
appear: "",
|
|
201
214
|
name: "bb-button-spinner"
|
|
202
215
|
}, {
|
|
203
|
-
default:
|
|
216
|
+
default: N(() => [J.value ? (T(), _(k(ee), w({
|
|
204
217
|
key: 0,
|
|
205
218
|
class: "bb-button__spinner"
|
|
206
|
-
},
|
|
219
|
+
}, k(X).spinner), null, 16)) : v("", !0)]),
|
|
207
220
|
_: 1
|
|
208
|
-
})) :
|
|
209
|
-
|
|
221
|
+
})) : v("", !0),
|
|
222
|
+
I.icon ? (T(), _(s, w({
|
|
210
223
|
key: 1,
|
|
211
224
|
class: "bb-button__icon",
|
|
212
|
-
icon:
|
|
213
|
-
},
|
|
225
|
+
icon: I.icon
|
|
226
|
+
}, k(X).icon), null, 16, ["icon"])) : I["prepend:icon"] ? (T(), _(s, w({
|
|
214
227
|
key: 2,
|
|
215
228
|
class: "bb-button__prepend-icon",
|
|
216
|
-
icon:
|
|
217
|
-
},
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
!e.icon &&
|
|
229
|
+
icon: I["prepend:icon"]
|
|
230
|
+
}, k(X).icon), null, 16, ["icon"])) : v("", !0),
|
|
231
|
+
b("span", w({ class: ["bb-button__text", { "bb-sr-only": !!e.icon }] }, k(X).text), [D(e.$slots, "default", {}, () => [te(O(e.text), 1)])], 16),
|
|
232
|
+
J.value ? (T(), y("span", P, O(k(V)("common.loadingText")), 1)) : v("", !0),
|
|
233
|
+
!e.icon && I["append:icon"] ? (T(), _(s, w({
|
|
221
234
|
key: 4,
|
|
222
235
|
class: "bb-button__append-icon",
|
|
223
|
-
icon:
|
|
224
|
-
},
|
|
236
|
+
icon: I["append:icon"]
|
|
237
|
+
}, k(X).icon), null, 16, ["icon"])) : v("", !0)
|
|
225
238
|
]),
|
|
226
239
|
_: 3
|
|
227
240
|
}, 16));
|
|
228
241
|
}
|
|
229
242
|
});
|
|
230
243
|
//#endregion
|
|
231
|
-
export {
|
|
244
|
+
export { F as default };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
export declare function useToggleRoving(el: Ref<HTMLElement | undefined>, engaged: Ref<boolean>, deps: () => unknown): {
|
|
3
|
+
tabindex: import('vue').ComputedRef<0 | -1 | undefined>;
|
|
4
|
+
onFocusin: () => void;
|
|
5
|
+
onKeydown: (event: KeyboardEvent) => void;
|
|
6
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { computed as e, nextTick as t, onBeforeUnmount as n, onMounted as r, shallowRef as i, watch as a } from "vue";
|
|
2
|
+
//#region src/components/BbButton/toggleRoving.ts
|
|
3
|
+
var o = ".bb-button--group[aria-pressed]", s = i(0), c = () => t(() => s.value++), l = /* @__PURE__ */ new WeakMap(), u = (e) => {
|
|
4
|
+
if (!e.matches(o)) return [];
|
|
5
|
+
let t = [e];
|
|
6
|
+
for (let n = e.previousElementSibling; n?.matches(o); n = n.previousElementSibling) t.unshift(n);
|
|
7
|
+
for (let n = e.nextElementSibling; n?.matches(o); n = n.nextElementSibling) t.push(n);
|
|
8
|
+
return t;
|
|
9
|
+
}, d = (e) => !e.disabled && e.getAttribute("aria-disabled") !== "true", f = (e) => {
|
|
10
|
+
let t = e.filter(d), n = document.activeElement, r = e[0]?.parentElement && l.get(e[0].parentElement);
|
|
11
|
+
return t.find((e) => e === n) ?? t.find((e) => e === r) ?? t.find((e) => e.getAttribute("aria-pressed") === "true") ?? t[0];
|
|
12
|
+
};
|
|
13
|
+
function p(t, i, o) {
|
|
14
|
+
return a(i, c), a(o, () => i.value && c()), r(() => i.value && c()), n(() => i.value && c()), {
|
|
15
|
+
tabindex: e(() => {
|
|
16
|
+
if (!i.value) return;
|
|
17
|
+
s.value;
|
|
18
|
+
let e = t.value;
|
|
19
|
+
if (!e) return;
|
|
20
|
+
let n = u(e);
|
|
21
|
+
if (!(n.length < 2 || !d(e))) return f(n) === e ? 0 : -1;
|
|
22
|
+
}),
|
|
23
|
+
onFocusin: () => {
|
|
24
|
+
let e = t.value;
|
|
25
|
+
!i.value || !e?.parentElement || (l.set(e.parentElement, e), s.value++);
|
|
26
|
+
},
|
|
27
|
+
onKeydown: (e) => {
|
|
28
|
+
let n = t.value;
|
|
29
|
+
if (!i.value || !n || e.altKey || e.ctrlKey || e.metaKey || e.shiftKey || ![
|
|
30
|
+
"ArrowLeft",
|
|
31
|
+
"ArrowRight",
|
|
32
|
+
"Home",
|
|
33
|
+
"End"
|
|
34
|
+
].includes(e.key)) return;
|
|
35
|
+
let r = u(n);
|
|
36
|
+
if (r.length < 2) return;
|
|
37
|
+
let a = r.filter(d), o = a.indexOf(n);
|
|
38
|
+
if (o === -1) return;
|
|
39
|
+
let s = getComputedStyle(n).direction === "rtl", c = e.key === (s ? "ArrowLeft" : "ArrowRight"), l = e.key === "Home" ? a[0] : e.key === "End" ? a[a.length - 1] : a[(o + (c ? 1 : -1) + a.length) % a.length];
|
|
40
|
+
e.preventDefault(), l?.focus();
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
//#endregion
|
|
45
|
+
export { p as useToggleRoving };
|
|
@@ -99,7 +99,10 @@ export type BbButtonProps = {
|
|
|
99
99
|
*/
|
|
100
100
|
exactActiveClass?: string;
|
|
101
101
|
/**
|
|
102
|
-
* Identifies the button as part of a button group
|
|
102
|
+
* Identifies the button as part of a button group: adjacent `group`
|
|
103
|
+
* buttons fuse into one segment (shared borders and radius). Adjacent
|
|
104
|
+
* `group` toggles (each with a `v-model`) are also one Tab stop, with
|
|
105
|
+
* ArrowLeft / ArrowRight / Home / End moving between them.
|
|
103
106
|
*/
|
|
104
107
|
group?: boolean;
|
|
105
108
|
/**
|