bitboss-ui 3.0.0-beta.74 → 3.0.0-beta.76
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 +5 -5
- package/bin/cli.mjs +16 -10
- package/dist/ai/BbAlert.md +1 -1
- package/dist/ai/BbAvatar.md +86 -58
- package/dist/ai/BbBadge.md +1 -1
- package/dist/ai/BbBreadcrumbs.md +3 -3
- package/dist/ai/BbButton.md +4 -4
- package/dist/ai/BbCalendar.md +5 -2
- package/dist/ai/BbCheckboxGroup.md +5 -4
- package/dist/ai/BbColorInput.md +13 -1
- package/dist/ai/BbColorPalette.md +12 -7
- package/dist/ai/BbConfirm.md +1 -1
- package/dist/ai/BbDatePicker.md +13 -1
- package/dist/ai/BbDatePickerInput.md +18 -2
- package/dist/ai/BbDialog.md +6 -3
- package/dist/ai/BbDropdown.md +174 -77
- package/dist/ai/BbDropdownButton.md +37 -16
- package/dist/ai/BbGallery.md +3 -2
- package/dist/ai/BbIcon.md +10 -10
- package/dist/ai/BbNumberInput.md +3 -1
- package/dist/ai/BbOffCanvas.md +3 -2
- package/dist/ai/BbPopover.md +1 -1
- package/dist/ai/BbRadioGroup.md +4 -4
- package/dist/ai/BbSelect.md +227 -105
- package/dist/ai/BbSelectPopover.md +139 -14
- package/dist/ai/BbSwitchGroup.md +5 -4
- package/dist/ai/BbTable.md +18 -17
- package/dist/ai/BbTimePicker.md +13 -1
- package/dist/ai/BbTimePickerInput.md +16 -2
- package/dist/ai/BbToast.md +3 -2
- package/dist/ai/BbTree.md +5 -1
- package/dist/ai/CommonPopover.md +1 -0
- package/dist/ai/FlatListBox.md +1 -0
- package/dist/ai/GroupedListBox.md +3 -2
- package/dist/ai/ListBox.md +4 -2
- package/dist/ai/OptionsContainer.md +4 -4
- package/dist/ai/changelog.json +310 -7
- package/dist/ai/components.json +33 -35
- package/dist/ai/composables/useToast.md +2 -2
- package/dist/ai/design-tokens.json +60 -0
- package/dist/ai/guides/agent-contract.md +9 -5
- package/dist/ai/guides/calendars-and-digits.md +1 -1
- package/dist/ai/guides/design-tokens.md +13 -0
- package/dist/ai/guides/eslint-rules.md +1 -1
- package/dist/ai/guides/fetch-items-playbook.md +7 -11
- package/dist/ai/guides/icons-policy.md +32 -11
- package/dist/ai/guides/installation-and-plugin-setup.md +24 -23
- package/dist/ai/guides/migration/adoption-checklist.md +1 -1
- package/dist/ai/guides/migration/components/bb-color-palette.md +11 -11
- package/dist/ai/guides/migration/components/bb-dropdown-button.md +1 -0
- package/dist/ai/guides/migration/components/bb-dropdown.md +1 -0
- package/dist/ai/guides/migration/components/bb-icon.md +4 -4
- package/dist/ai/guides/migration/components/bb-table.md +2 -1
- package/dist/ai/guides/migration/components/bb-toast.md +2 -2
- package/dist/ai/guides/migration/v2-to-v3.md +70 -24
- package/dist/ai/guides/migration/v3-beta-css-classes.md +18 -3
- package/dist/ai/guides/migration/v3-beta-tooling.md +1 -0
- package/dist/ai/guides/passthrough.md +58 -58
- package/dist/ai/helpers/inertia/manifest.json +1 -1
- package/dist/ai/index.md +1 -1
- package/dist/ai/manifest/common.json +1 -0
- package/dist/ai/manifest/components/BbAvatar.json +5 -2
- package/dist/ai/manifest/components/BbAvatar.tree.json +32 -2
- package/dist/ai/manifest/components/BbCarousel.json +0 -3
- package/dist/ai/manifest/components/BbCheckboxGroup.json +2 -2
- package/dist/ai/manifest/components/BbCheckboxGroup.tree.json +2 -0
- package/dist/ai/manifest/components/BbColorInput.json +5 -2
- package/dist/ai/manifest/components/BbColorPalette.json +5 -2
- package/dist/ai/manifest/components/BbColorPalette.removed.json +1 -2
- package/dist/ai/manifest/components/BbDatePicker.json +3 -0
- package/dist/ai/manifest/components/BbDatePickerInput.json +3 -0
- package/dist/ai/manifest/components/BbDialog.tree.json +3 -1
- package/dist/ai/manifest/components/BbDropdown.json +36 -28
- package/dist/ai/manifest/components/BbDropdown.removed.json +2 -1
- package/dist/ai/manifest/components/BbDropdown.tree.json +21 -11
- package/dist/ai/manifest/components/BbDropdownButton.json +24 -16
- package/dist/ai/manifest/components/BbDropdownButton.removed.json +2 -1
- package/dist/ai/manifest/components/BbDropdownButton.tree.json +4 -0
- package/dist/ai/manifest/components/BbGallery.tree.json +1 -1
- package/dist/ai/manifest/components/BbOffCanvas.tree.json +3 -1
- package/dist/ai/manifest/components/BbRadioGroup.json +2 -2
- package/dist/ai/manifest/components/BbRadioGroup.tree.json +2 -0
- package/dist/ai/manifest/components/BbSelect.json +47 -40
- package/dist/ai/manifest/components/BbSelect.tree.json +2 -1
- package/dist/ai/manifest/components/BbSelectPopover.json +14 -7
- package/dist/ai/manifest/components/BbSelectPopover.tree.json +9 -2
- package/dist/ai/manifest/components/BbSwitchGroup.json +2 -2
- package/dist/ai/manifest/components/BbSwitchGroup.tree.json +2 -0
- package/dist/ai/manifest/components/BbTable.json +6 -6
- package/dist/ai/manifest/components/BbTable.tree.json +9 -1
- package/dist/ai/manifest/components/BbTimePicker.json +5 -2
- package/dist/ai/manifest/components/BbTimePickerInput.json +5 -2
- package/dist/ai/manifest/components/BbTree.json +1 -1
- package/dist/ai/manifest/components/CommonPopover.json +1 -0
- package/dist/ai/manifest/components/FlatListBox.json +2 -1
- package/dist/ai/manifest/components/GroupedListBox.json +3 -2
- package/dist/ai/manifest/components/GroupedListBox.tree.json +1 -0
- package/dist/ai/manifest/components/ListBox.json +3 -2
- package/dist/ai/manifest/components/ListBox.tree.json +1 -1
- package/dist/ai/manifest/components/OptionsContainer.json +6 -4
- package/dist/ai/manifest/index.json +2 -2
- package/dist/ai/manifest/meta.json +0 -3
- package/dist/ai/manifest/types.advanced.json +6 -6
- package/dist/ai/manifest/types.api.json +1 -3
- package/dist/ai/recipes/inertia/inline-edit-workspace.md +1 -1
- package/dist/ai/recipes/inertia/onboarding.md +1 -1
- package/dist/ai/recipes/nuxt/inline-edit-workspace.md +1 -1
- package/dist/ai/recipes/nuxt/onboarding.md +1 -1
- package/dist/ai/recipes/vue/inline-edit-workspace.md +1 -1
- package/dist/ai/recipes/vue/onboarding.md +2 -2
- package/dist/ai/source/BbAccordion.md +4 -5
- package/dist/ai/source/BbAvatar.md +128 -11
- package/dist/ai/source/BbBadge.md +18 -7
- package/dist/ai/source/BbBreadcrumbs.md +57 -56
- package/dist/ai/source/BbButton.md +41 -25
- package/dist/ai/source/BbCalendar.md +8 -6
- package/dist/ai/source/BbCarousel.md +41 -34
- package/dist/ai/source/BbCheckboxGroup.md +15 -9
- package/dist/ai/source/BbColorInput.md +19 -0
- package/dist/ai/source/BbColorPalette.md +23 -2
- package/dist/ai/source/BbDatePicker.md +18 -0
- package/dist/ai/source/BbDatePickerInput.md +47 -3
- package/dist/ai/source/BbDialog.md +14 -1
- package/dist/ai/source/BbDropdown.md +296 -99
- package/dist/ai/source/BbDropdownButton.md +61 -19
- package/dist/ai/source/BbDropdownGroup.md +189 -98
- package/dist/ai/source/BbGallery.md +82 -60
- package/dist/ai/source/BbHost.md +12 -0
- package/dist/ai/source/BbNumberInput.md +17 -10
- package/dist/ai/source/BbOffCanvas.md +14 -1
- package/dist/ai/source/BbPagination.md +12 -28
- package/dist/ai/source/BbRadioGroup.md +12 -5
- package/dist/ai/source/BbRating.md +4 -4
- package/dist/ai/source/BbSelect.md +151 -112
- package/dist/ai/source/BbSelectPopover.md +244 -29
- package/dist/ai/source/BbSwitchGroup.md +11 -4
- package/dist/ai/source/BbTable.md +114 -35
- package/dist/ai/source/BbTimePicker.md +19 -0
- package/dist/ai/source/BbTimePickerInput.md +21 -2
- package/dist/ai/source/BbToast.md +2 -2
- package/dist/ai/source/BbToastPortal.md +2 -2
- package/dist/ai/source/BbTree.md +1 -1
- package/dist/ai/source/ClearableButton.md +4 -2
- package/dist/ai/source/CommonPopover.md +24 -1
- package/dist/ai/source/ErrorIcon.md +4 -3
- package/dist/ai/source/FlatListBox.md +33 -7
- package/dist/ai/source/GroupedListBox.md +85 -14
- package/dist/ai/source/ListBox.md +11 -1
- package/dist/ai/source/OptionsContainer.md +29 -11
- package/dist/ai/source/WarningIcon.md +4 -3
- package/dist/assets/svgs/close.svg_raw.js +1 -1
- package/dist/components/BbAccordion/BbAccordion.vue.d.ts +1 -1
- package/dist/components/BbAccordion/BbAccordion.vue_vue_type_script_setup_true_lang.js +35 -34
- package/dist/components/BbAvatar/BbAvatar.vue.d.ts +1 -0
- package/dist/components/BbAvatar/BbAvatar.vue_vue_type_script_setup_true_lang.js +62 -43
- package/dist/components/BbAvatar/avatarIdentity.js +25 -0
- package/dist/components/BbAvatar/ptKeys.generated.d.ts +5 -1
- package/dist/components/BbAvatar/types.d.ts +24 -5
- package/dist/components/BbAvatar/types.js +5 -1
- package/dist/components/BbBadge/BadgeBodyContent.vue_vue_type_script_setup_true_lang.js +24 -23
- package/dist/components/BbBadge/BbBadge.vue_vue_type_script_setup_true_lang.js +66 -64
- package/dist/components/BbBreadcrumbs/BbBreadcrumbs.vue_vue_type_script_setup_true_lang.js +141 -146
- package/dist/components/BbButton/BbButton.vue_vue_type_script_setup_true_lang.js +100 -85
- package/dist/components/BbCalendar/BbCalendar.vue.d.ts +1 -1
- package/dist/components/BbCalendar/BbCalendar.vue_vue_type_script_setup_true_lang.js +240 -239
- package/dist/components/BbCalendar/useDayGrid.js +120 -123
- package/dist/components/BbCarousel/BbCarousel.vue_vue_type_script_setup_true_lang.js +503 -502
- package/dist/components/BbCheckboxGroup/BbCheckboxGroup.vue.d.ts +4 -4
- package/dist/components/BbCheckboxGroup/BbCheckboxGroup.vue_vue_type_script_setup_true_lang.js +126 -122
- package/dist/components/BbCheckboxGroup/types.d.ts +7 -11
- package/dist/components/BbColorInput/BbColorInput.vue.d.ts +2 -0
- package/dist/components/BbColorInput/BbColorInput.vue_vue_type_script_setup_true_lang.js +148 -141
- package/dist/components/BbColorInput/types.d.ts +7 -0
- package/dist/components/BbColorPalette/BbColorPalette.vue.d.ts +2 -0
- package/dist/components/BbColorPalette/BbColorPalette.vue_vue_type_script_setup_true_lang.js +208 -196
- package/dist/components/BbColorPalette/types.d.ts +7 -0
- package/dist/components/BbDatePicker/BbDatePicker.vue.d.ts +3 -1
- package/dist/components/BbDatePicker/BbDatePicker.vue_vue_type_script_setup_true_lang.js +84 -73
- package/dist/components/BbDatePicker/types.d.ts +7 -0
- package/dist/components/BbDatePickerInput/BbDatePickerInput.vue.d.ts +4 -2
- package/dist/components/BbDatePickerInput/BbDatePickerInput.vue_vue_type_script_setup_true_lang.js +496 -510
- package/dist/components/BbDatePickerInput/types.d.ts +7 -0
- package/dist/components/BbDialog/BbDialog.vue_vue_type_script_setup_true_lang.js +219 -211
- package/dist/components/BbDialog/leaveGhost.js +22 -17
- package/dist/components/BbDropdown/AdaptiveDropdown.vue_vue_type_script_setup_true_lang.js +106 -100
- package/dist/components/BbDropdown/BbDropdown.vue.d.ts +3 -0
- package/dist/components/BbDropdown/BbDropdown.vue_vue_type_script_setup_true_lang.js +416 -369
- package/dist/components/BbDropdown/BbDropdownList.vue_vue_type_script_setup_true_lang.js +404 -354
- package/dist/components/BbDropdown/DropdownFailures.vue.js +4 -0
- package/dist/components/BbDropdown/DropdownFailures.vue_vue_type_script_setup_true_lang.js +24 -0
- package/dist/components/BbDropdown/DropdownPipelineResolver.vue_vue_type_script_setup_true_lang.js +117 -102
- package/dist/components/BbDropdown/DropdownRow.vue_vue_type_script_setup_true_lang.js +67 -38
- package/dist/components/BbDropdown/normalizeGroups.js +6 -2
- package/dist/components/BbDropdown/ptKeys.generated.d.ts +44 -20
- package/dist/components/BbDropdown/types.d.ts +109 -87
- package/dist/components/BbDropdown/types.js +3 -0
- package/dist/components/BbDropdownButton/BbDropdownButton.vue.d.ts +3 -1
- package/dist/components/BbDropdownButton/BbDropdownButton.vue_vue_type_script_setup_true_lang.js +101 -65
- package/dist/components/BbDropdownButton/ptKeys.generated.d.ts +153 -57
- package/dist/components/BbDropdownButton/types.d.ts +23 -10
- package/dist/components/BbDropdownButton/types.js +4 -0
- package/dist/components/BbDropzone/BbDropzone.vue.d.ts +1 -1
- package/dist/components/BbGallery/BbGallery.vue_vue_type_script_setup_true_lang.js +335 -312
- package/dist/components/BbHost/BbHost.vue_vue_type_script_setup_true_lang.js +7 -1
- package/dist/components/BbIcon/iconCache.js +1 -1
- package/dist/components/BbNumberInput/BbNumberInput.vue.d.ts +1 -1
- package/dist/components/BbNumberInput/BbNumberInput.vue_vue_type_script_setup_true_lang.js +9 -5
- package/dist/components/BbOffCanvas/BbOffCanvas.vue_vue_type_script_setup_true_lang.js +152 -144
- package/dist/components/BbPagination/BbPagination.vue.d.ts +2 -2
- package/dist/components/BbPagination/BbPagination.vue_vue_type_script_setup_true_lang.js +138 -136
- package/dist/components/BbProgress/BbProgress.vue.d.ts +1 -1
- package/dist/components/BbRadioGroup/BbRadioGroup.vue.d.ts +4 -4
- package/dist/components/BbRadioGroup/BbRadioGroup.vue_vue_type_script_setup_true_lang.js +108 -104
- package/dist/components/BbRadioGroup/types.d.ts +4 -7
- package/dist/components/BbRating/BbRating.vue.d.ts +1 -1
- package/dist/components/BbRating/BbRating.vue_vue_type_script_setup_true_lang.js +100 -99
- package/dist/components/BbSelect/BbSelect.vue.d.ts +32 -20
- package/dist/components/BbSelect/BbSelect.vue_vue_type_script_setup_true_lang.js +217 -196
- package/dist/components/BbSelect/ptKeys.generated.d.ts +128 -96
- package/dist/components/BbSelect/types.d.ts +110 -111
- package/dist/components/BbSelect/types.js +1 -27
- package/dist/components/BbSelectPopover/BbSelectPopover.vue.d.ts +8 -3
- package/dist/components/BbSelectPopover/BbSelectPopover.vue_vue_type_script_setup_true_lang.js +728 -653
- package/dist/components/BbSelectPopover/ptKeys.generated.d.ts +22 -10
- package/dist/components/BbSelectPopover/types.d.ts +32 -17
- package/dist/components/BbSelectPopover/types.js +3 -1
- package/dist/components/BbSwitchGroup/BbSwitchGroup.vue.d.ts +1 -1
- package/dist/components/BbSwitchGroup/BbSwitchGroup.vue_vue_type_script_setup_true_lang.js +159 -155
- package/dist/components/BbSwitchGroup/types.d.ts +3 -6
- package/dist/components/BbTable/BbTable.vue.d.ts +2 -4
- package/dist/components/BbTable/BbTable.vue_vue_type_script_setup_true_lang.js +1171 -1152
- package/dist/components/BbTable/BbTableDataRow.js +97 -90
- package/dist/components/BbTable/types.d.ts +11 -10
- package/dist/components/BbTabs/BbTabs.vue.d.ts +3 -3
- package/dist/components/BbTimePicker/BbTimePicker.vue.d.ts +4 -2
- package/dist/components/BbTimePicker/BbTimePicker.vue_vue_type_script_setup_true_lang.js +145 -134
- package/dist/components/BbTimePicker/types.d.ts +7 -0
- package/dist/components/BbTimePickerInput/BbTimePickerInput.vue.d.ts +4 -2
- package/dist/components/BbTimePickerInput/BbTimePickerInput.vue_vue_type_script_setup_true_lang.js +290 -280
- package/dist/components/BbTimePickerInput/types.d.ts +7 -0
- package/dist/components/BbToast/BbToastMessage.vue_vue_type_script_setup_true_lang.js +79 -78
- package/dist/components/BbToast/types.d.ts +2 -2
- package/dist/components/BbTree/BbTreeLevel.vue_vue_type_script_setup_true_lang.js +56 -46
- package/dist/components/BbTree/types.d.ts +1 -1
- package/dist/components/ClearableButton/ClearableButton.vue_vue_type_script_setup_true_lang.js +9 -8
- package/dist/components/CloseIcon/CloseButton.vue.js +1 -1
- package/dist/components/CloseIcon/CloseButton.vue_vue_type_script_setup_true_lang.js +9 -7
- package/dist/components/CommonPopover/CommonPopover.vue_vue_type_script_setup_true_lang.js +13 -1
- package/dist/components/ErrorIcon/ErrorIcon.vue_vue_type_script_setup_true_lang.js +8 -6
- package/dist/components/FlatListBox/FlatListBox.vue_vue_type_script_setup_true_lang.js +122 -102
- package/dist/components/GroupedListBox/GroupedListBox.vue_vue_type_script_setup_true_lang.js +182 -153
- package/dist/components/ListBox/ListBox.vue_vue_type_script_setup_true_lang.js +7 -4
- package/dist/components/OptionsContainer/OptionsContainer.vue_vue_type_script_setup_true_lang.js +86 -77
- package/dist/components/WarningIcon/WarningIcon.vue_vue_type_script_setup_true_lang.js +8 -6
- package/dist/composables/useInternalIcon.js +25 -0
- package/dist/composables/useItemsGetter.js +34 -32
- package/dist/composables/useOpenModel.js +20 -0
- package/dist/deprecation/ai-deprecations.json.js +1 -1
- package/dist/i18n/locales/ar.json +2 -0
- package/dist/i18n/locales/cs.json +2 -0
- package/dist/i18n/locales/da.json +2 -0
- package/dist/i18n/locales/de-CH.json +2 -0
- package/dist/i18n/locales/de.json +2 -0
- package/dist/i18n/locales/el.json +2 -0
- package/dist/i18n/locales/en-GB.json +2 -0
- package/dist/i18n/locales/en.json +2 -0
- package/dist/i18n/locales/es-MX.json +2 -0
- package/dist/i18n/locales/es.json +2 -0
- package/dist/i18n/locales/fa.json +2 -0
- package/dist/i18n/locales/fi.json +2 -0
- package/dist/i18n/locales/fr.json +2 -0
- package/dist/i18n/locales/he.json +2 -0
- package/dist/i18n/locales/hu.json +2 -0
- package/dist/i18n/locales/it.json +2 -0
- package/dist/i18n/locales/ja.json +2 -0
- package/dist/i18n/locales/ko.json +2 -0
- package/dist/i18n/locales/nb.json +2 -0
- package/dist/i18n/locales/nl.json +2 -0
- package/dist/i18n/locales/pl.json +2 -0
- package/dist/i18n/locales/pt-BR.json +2 -0
- package/dist/i18n/locales/pt-PT.json +2 -0
- package/dist/i18n/locales/ro.json +2 -0
- package/dist/i18n/locales/ru.json +2 -0
- package/dist/i18n/locales/sv.json +2 -0
- package/dist/i18n/locales/tr.json +2 -0
- package/dist/i18n/locales/uk.json +2 -0
- package/dist/i18n/locales/zh-CN.json +2 -0
- package/dist/i18n/locales/zh-HK.json +2 -0
- package/dist/i18n/locales/zh-TW.json +2 -0
- package/dist/icon-scan.d.ts +1 -1
- package/dist/icon-scan.js +68 -61
- package/dist/index.d.ts +2 -2
- package/dist/llms-full.txt +1038 -451
- package/dist/llms-medium.txt +33 -28
- package/dist/llms.txt +2 -2
- package/dist/locale-blueprint.json +2 -0
- package/dist/nuxt.js +1 -1
- package/dist/styles.css +2 -2
- package/dist/types/ActionButton.d.ts +2 -3
- package/dist/types/Config.d.ts +8 -1
- package/dist/types/ConfigDefaults.d.ts +10 -2
- package/dist/types/Option.d.ts +10 -0
- package/dist/types/internalIcons.d.ts +89 -0
- package/dist/types/internalIcons.js +158 -0
- package/dist/types/ptComponentMap.d.ts +5 -5
- package/dist/utilities/functions/slotContent.js +19 -0
- package/dist/utils/configDefaults.js +75 -64
- package/dist/utils/iconsOption.js +48 -0
- package/dist/utils/loadRetry.js +8 -0
- package/dist/utils/versionCheck.js +1 -1
- package/dist/vite-plugin.d.ts +10 -16
- package/dist/vite.js +323 -307
- package/llms.txt +2 -2
- package/package.json +3 -1
- package/scripts/README.md +2 -0
- package/scripts/lib/adoption-checklist.json +1 -1
- package/scripts/lib/agent-setup.mjs +44 -26
- package/scripts/lib/update-install.mjs +48 -0
- package/scripts/lib/validate-bb-markup.mjs +93 -12
- package/dist/ai/manifest/components/BbAvatar.removed.json +0 -6
- package/dist/assets/svgs/caret_down.svg_raw.js +0 -3
|
@@ -79,13 +79,20 @@
|
|
|
79
79
|
:aria-labelledby="groupMetaIndexedByIndex[row.index].headerId"
|
|
80
80
|
class="bb-listbox__group"
|
|
81
81
|
role="group"
|
|
82
|
-
:style="{
|
|
82
|
+
:style="{ top: `${row.start}px` }"
|
|
83
83
|
>
|
|
84
84
|
<span
|
|
85
85
|
v-if="groupMetaIndexedByIndex[row.index].headerId"
|
|
86
86
|
:id="groupMetaIndexedByIndex[row.index].headerId"
|
|
87
87
|
class="bb-listbox__group-header"
|
|
88
88
|
role="presentation"
|
|
89
|
+
v-bind="
|
|
90
|
+
passthrough?.part?.('groupHeader', {
|
|
91
|
+
disabled:
|
|
92
|
+
groupMetaIndexedByIndex[row.index].allOptionsAreDisabled ||
|
|
93
|
+
undefined,
|
|
94
|
+
})
|
|
95
|
+
"
|
|
89
96
|
>
|
|
90
97
|
<slot
|
|
91
98
|
:disabled="
|
|
@@ -168,7 +175,17 @@
|
|
|
168
175
|
)
|
|
169
176
|
"
|
|
170
177
|
/>
|
|
178
|
+
<span
|
|
179
|
+
v-if="optionsMetaByGroup[row.index][i].create"
|
|
180
|
+
class="bb-listbox__item-text bb-listbox__create"
|
|
181
|
+
>{{ optionsMetaByGroup[row.index][i].create!.before
|
|
182
|
+
}}<strong class="bb-listbox__create-query">{{
|
|
183
|
+
optionsMetaByGroup[row.index][i].create!.query
|
|
184
|
+
}}</strong
|
|
185
|
+
>{{ optionsMetaByGroup[row.index][i].create!.after }}</span
|
|
186
|
+
>
|
|
171
187
|
<slot
|
|
188
|
+
v-else
|
|
172
189
|
:description="optionsMetaByGroup[row.index][i].description"
|
|
173
190
|
:disabled="!!optionsMetaByGroup[row.index][i].disabled"
|
|
174
191
|
:focused="
|
|
@@ -268,6 +285,10 @@
|
|
|
268
285
|
<BbIcon
|
|
269
286
|
aria-hidden="true"
|
|
270
287
|
class="bb-listbox__option-check"
|
|
288
|
+
:class="{
|
|
289
|
+
'bb-listbox__option-check--own':
|
|
290
|
+
checkIcon !== checkIconBuiltin,
|
|
291
|
+
}"
|
|
271
292
|
:icon="checkIcon"
|
|
272
293
|
v-bind="
|
|
273
294
|
passthrough?.part?.(
|
|
@@ -299,20 +320,28 @@
|
|
|
299
320
|
under whatever is still listed (a `stash` keeps the picks' rows), in the
|
|
300
321
|
destructive alert's voice. It sits OUTSIDE the scroll area and the
|
|
301
322
|
listbox: a reader meets it as a status, never as an option, and the
|
|
302
|
-
combobox is described by
|
|
323
|
+
combobox is described by its message while it lasts. It ends with "Try
|
|
324
|
+
again", which the host runs; `#empty`
|
|
325
|
+
never replaces it (empty means empty). The divider is its own only
|
|
303
326
|
when rows sit above it; with nothing listed the search field's is the
|
|
304
327
|
one divider. -->
|
|
305
328
|
<span
|
|
306
|
-
v-if="failedText"
|
|
307
|
-
:id="`${id}_failed`"
|
|
329
|
+
v-if="failedText && !loading"
|
|
308
330
|
class="bb-listbox__failed"
|
|
309
331
|
:class="{ 'bb-listbox__failed--divided': hasOptions }"
|
|
310
332
|
role="status"
|
|
311
333
|
>
|
|
312
334
|
<ErrorIcon class="bb-listbox__failed-icon" />
|
|
313
|
-
<span class="bb-listbox__failed-text"
|
|
314
|
-
|
|
335
|
+
<span :id="`${id}_failed`" class="bb-listbox__failed-text">{{
|
|
336
|
+
failedText
|
|
337
|
+
}}</span>
|
|
338
|
+
<button
|
|
339
|
+
class="bb-load-retry"
|
|
340
|
+
type="button"
|
|
341
|
+
@click="emit('retry', $event)"
|
|
315
342
|
>
|
|
343
|
+
{{ t('common.retryLabel').value }}
|
|
344
|
+
</button>
|
|
316
345
|
</span>
|
|
317
346
|
</span>
|
|
318
347
|
</template>
|
|
@@ -340,9 +369,9 @@ import {
|
|
|
340
369
|
import { indexBy } from '@/utilities/functions/indexBy';
|
|
341
370
|
import BbIcon from '../BbIcon/BbIcon.vue';
|
|
342
371
|
import ErrorIcon from '../ErrorIcon/ErrorIcon.vue';
|
|
343
|
-
import
|
|
372
|
+
import checkIconBuiltin from '@/assets/svgs/check_stroke.svg?raw';
|
|
344
373
|
import { transitions } from '@/utilities/misc/transitions';
|
|
345
|
-
|
|
374
|
+
import { useInternalIcon } from '@/composables/useInternalIcon';
|
|
346
375
|
const props = withDefaults(defineProps<GroupedListBoxProps>(), {
|
|
347
376
|
transitionDuration: transitions.medium,
|
|
348
377
|
});
|
|
@@ -351,6 +380,8 @@ const emit = defineEmits<GroupedListBoxEvents>();
|
|
|
351
380
|
|
|
352
381
|
const slots = defineSlots<GroupedListBoxSlots<Item>>();
|
|
353
382
|
|
|
383
|
+
const checkIcon = useInternalIcon('check', checkIconBuiltin);
|
|
384
|
+
|
|
354
385
|
const { t } = useLocale();
|
|
355
386
|
|
|
356
387
|
const innerRef = useTemplateRef('inner');
|
|
@@ -474,6 +505,7 @@ const optionsMeta = computed(() => {
|
|
|
474
505
|
value: value,
|
|
475
506
|
valueHash: o.valueHash,
|
|
476
507
|
domId,
|
|
508
|
+
create: o.create,
|
|
477
509
|
};
|
|
478
510
|
})
|
|
479
511
|
);
|
|
@@ -574,17 +606,42 @@ const scrollToFocused = async () => {
|
|
|
574
606
|
// Drive the virtualizer to the option's GROUP first (FlatListBox already
|
|
575
607
|
// does the equivalent), then refine to the exact row once it has mounted.
|
|
576
608
|
// Direct indexing: optionsMeta[i].globalIndex === i (see the note above).
|
|
609
|
+
// A mounted row needs no group scroll first: an `auto` scroll to a group
|
|
610
|
+
// taller than the list jumps to its start, and back.
|
|
611
|
+
const rowEl = () =>
|
|
612
|
+
innerRef.value?.querySelector<HTMLElement>(
|
|
613
|
+
`[data-index="${focusedIndex.value}"]`
|
|
614
|
+
);
|
|
577
615
|
const groupIndex = optionsMeta.value[focusedIndex.value]?.groupIndex;
|
|
578
|
-
if (isNotNil(groupIndex)) {
|
|
616
|
+
if (!rowEl() && isNotNil(groupIndex)) {
|
|
579
617
|
rowVirtualizer.value.scrollToIndex(groupIndex, { align: 'auto' });
|
|
580
618
|
await nextTick();
|
|
581
619
|
}
|
|
582
620
|
|
|
583
|
-
const el =
|
|
584
|
-
`[data-index="${focusedIndex.value}"]`
|
|
585
|
-
);
|
|
621
|
+
const el = rowEl();
|
|
586
622
|
if (el) {
|
|
587
623
|
el.scrollIntoView({ block: 'nearest' });
|
|
624
|
+
uncoverFromHeader(el);
|
|
625
|
+
}
|
|
626
|
+
};
|
|
627
|
+
|
|
628
|
+
/**
|
|
629
|
+
* Group headers are sticky: a row brought in from above
|
|
630
|
+
* lands at the top edge, under its group's pinned header. Scroll it down to
|
|
631
|
+
* sit just below the header instead.
|
|
632
|
+
*/
|
|
633
|
+
const uncoverFromHeader = (el: HTMLElement) => {
|
|
634
|
+
const header = el
|
|
635
|
+
.closest('.bb-listbox__group')
|
|
636
|
+
?.querySelector<HTMLElement>('.bb-listbox__group-header');
|
|
637
|
+
if (!header || !innerRef.value) return;
|
|
638
|
+
// Measured again after each step: a row at its group's end holds the
|
|
639
|
+
// header up with it, so the header only settles once the row moves.
|
|
640
|
+
for (let step = 0; step < 3; step++) {
|
|
641
|
+
const covered =
|
|
642
|
+
header.getBoundingClientRect().bottom - el.getBoundingClientRect().top;
|
|
643
|
+
if (covered <= 0) return;
|
|
644
|
+
innerRef.value.scrollTop -= covered;
|
|
588
645
|
}
|
|
589
646
|
};
|
|
590
647
|
|
|
@@ -610,9 +667,15 @@ const scrollToSelected = () => {
|
|
|
610
667
|
rowVirtualizer.value.getTotalSize();
|
|
611
668
|
const group = rowVirtualizer.value.measurementsCache[selected.groupIndex];
|
|
612
669
|
if (!group) return;
|
|
670
|
+
// Its group's header shows above it: the header is
|
|
671
|
+
// sticky, so the row sits one header lower than its own offset, as long
|
|
672
|
+
// as the two fit the list together.
|
|
673
|
+
const header = headerOf(selected.groupIndex);
|
|
674
|
+
const fits =
|
|
675
|
+
(innerRef.value?.clientHeight ?? 0) >= header + resolvedOptionHeight.value;
|
|
613
676
|
rowVirtualizer.value.scrollToOffset(
|
|
614
677
|
group.start +
|
|
615
|
-
|
|
678
|
+
(fits ? 0 : header) +
|
|
616
679
|
selected.indexInGroup * resolvedOptionHeight.value
|
|
617
680
|
);
|
|
618
681
|
};
|
|
@@ -756,7 +819,13 @@ export type GroupedListBoxProps = {
|
|
|
756
819
|
* node with its own `selected` / `disabled`. Internal.
|
|
757
820
|
*/
|
|
758
821
|
passthrough?: PtBindings<
|
|
759
|
-
|
|
822
|
+
| 'list'
|
|
823
|
+
| 'groupHeader'
|
|
824
|
+
| 'option'
|
|
825
|
+
| 'itemText'
|
|
826
|
+
| 'itemIcon'
|
|
827
|
+
| 'itemDescription'
|
|
828
|
+
| 'check',
|
|
760
829
|
'selected' | 'disabled'
|
|
761
830
|
>;
|
|
762
831
|
|
|
@@ -840,6 +909,8 @@ export type GroupedListBoxProps = {
|
|
|
840
909
|
};
|
|
841
910
|
|
|
842
911
|
export type GroupedListBoxEvents = {
|
|
912
|
+
/** The failure footer's "Try again" was pressed: the host runs the failed load again. */
|
|
913
|
+
(e: 'retry', event: MouseEvent): void;
|
|
843
914
|
/**
|
|
844
915
|
* Emitted when an option is selected by the user.
|
|
845
916
|
* @param option - The selected option.
|
|
@@ -31,6 +31,7 @@
|
|
|
31
31
|
@focused:change="$emit('focused:change', $event)"
|
|
32
32
|
@option:selected="$emit('option:selected', $event)"
|
|
33
33
|
@option:unselected="$emit('option:unselected', $event)"
|
|
34
|
+
@retry="$emit('retry', $event)"
|
|
34
35
|
>
|
|
35
36
|
<template #options:prepend><slot name="options:prepend" /></template>
|
|
36
37
|
<template #loading><slot name="loading" /></template>
|
|
@@ -63,6 +64,7 @@
|
|
|
63
64
|
@focused:change="$emit('focused:change', $event)"
|
|
64
65
|
@option:selected="$emit('option:selected', $event)"
|
|
65
66
|
@option:unselected="$emit('option:unselected', $event)"
|
|
67
|
+
@retry="$emit('retry', $event)"
|
|
66
68
|
>
|
|
67
69
|
<template #options:prepend><slot name="options:prepend" /></template>
|
|
68
70
|
<template #loading><slot name="loading" /></template>
|
|
@@ -152,7 +154,13 @@ export type ListBoxProps<Item> = {
|
|
|
152
154
|
* node with its own `selected` / `disabled`. Internal.
|
|
153
155
|
*/
|
|
154
156
|
passthrough?: PtBindings<
|
|
155
|
-
|
|
157
|
+
| 'list'
|
|
158
|
+
| 'groupHeader'
|
|
159
|
+
| 'option'
|
|
160
|
+
| 'itemText'
|
|
161
|
+
| 'itemIcon'
|
|
162
|
+
| 'itemDescription'
|
|
163
|
+
| 'check',
|
|
156
164
|
'selected' | 'disabled'
|
|
157
165
|
>;
|
|
158
166
|
|
|
@@ -237,6 +245,8 @@ export type ListBoxProps<Item> = {
|
|
|
237
245
|
};
|
|
238
246
|
|
|
239
247
|
export type ListBoxEvents = {
|
|
248
|
+
/** The failure footer's "Try again" was pressed: the host runs the failed load again. */
|
|
249
|
+
(e: 'retry', event: MouseEvent): void;
|
|
240
250
|
/**
|
|
241
251
|
* Emitted when an option is selected by the user.
|
|
242
252
|
* @param option - The selected option.
|
|
@@ -31,11 +31,25 @@
|
|
|
31
31
|
loadingText || t('common.loadingText').value
|
|
32
32
|
}}</slot></span
|
|
33
33
|
>
|
|
34
|
+
<!-- A failed load is the library's row, never `#empty` (empty means
|
|
35
|
+
empty): its message, announced, and "Try again", which the group runs.
|
|
36
|
+
-->
|
|
37
|
+
<span
|
|
38
|
+
v-else-if="!options.length && error != null"
|
|
39
|
+
:class="[classes.empty, `${classes.empty}--failed`]"
|
|
40
|
+
role="status"
|
|
41
|
+
><span>{{ failedText || t('common.failedText').value }}</span>
|
|
42
|
+
<button
|
|
43
|
+
class="bb-load-retry"
|
|
44
|
+
type="button"
|
|
45
|
+
@click="emit('retry', $event)"
|
|
46
|
+
>
|
|
47
|
+
{{ t('common.retryLabel').value }}
|
|
48
|
+
</button></span
|
|
49
|
+
>
|
|
34
50
|
<span v-else-if="!options.length" :class="classes.empty"
|
|
35
|
-
><slot
|
|
36
|
-
|
|
37
|
-
? failedText || t('common.failedText').value
|
|
38
|
-
: emptyText || t('common.emptyText').value
|
|
51
|
+
><slot name="empty">{{
|
|
52
|
+
emptyText || t('common.emptyText').value
|
|
39
53
|
}}</slot></span
|
|
40
54
|
>
|
|
41
55
|
<template
|
|
@@ -129,6 +143,7 @@ import {
|
|
|
129
143
|
import { useLocale } from '@/composables/useLocale';
|
|
130
144
|
import { useId } from '@/composables/useId';
|
|
131
145
|
import type {
|
|
146
|
+
OptionsContainerEvents,
|
|
132
147
|
OptionsContainerProps,
|
|
133
148
|
OptionsContainerSlots,
|
|
134
149
|
RowPtState,
|
|
@@ -142,6 +157,8 @@ const props = defineProps<
|
|
|
142
157
|
/* @vue-ignore */ FallthroughAttrs<'span', OptionsContainerProps<T>>
|
|
143
158
|
>();
|
|
144
159
|
|
|
160
|
+
const emit = defineEmits<OptionsContainerEvents>();
|
|
161
|
+
|
|
145
162
|
defineSlots<OptionsContainerSlots<T>>();
|
|
146
163
|
|
|
147
164
|
/** Warning chrome only when no error is claiming the same modifier. */
|
|
@@ -466,13 +483,13 @@ export type OptionsContainerProps<T> = {
|
|
|
466
483
|
|
|
467
484
|
/**
|
|
468
485
|
* What the owning group's latest failed `items` load rejected with; `null`
|
|
469
|
-
* (or unset) when nothing failed. While set, the
|
|
470
|
-
* `failedText` and
|
|
486
|
+
* (or unset) when nothing failed. While set, the list shows the failure
|
|
487
|
+
* row (`failedText` and "Try again"), never the `empty` slot. Internal.
|
|
471
488
|
*/
|
|
472
489
|
error?: unknown;
|
|
473
490
|
|
|
474
491
|
/**
|
|
475
|
-
*
|
|
492
|
+
* The failure row's message while `error` is set.
|
|
476
493
|
*/
|
|
477
494
|
failedText?: string;
|
|
478
495
|
|
|
@@ -493,7 +510,9 @@ export type OptionsContainerProps<T> = {
|
|
|
493
510
|
options: Array<Option<T>>;
|
|
494
511
|
};
|
|
495
512
|
|
|
496
|
-
export type OptionsContainerEvents =
|
|
513
|
+
export type OptionsContainerEvents =
|
|
514
|
+
/** The failure row's "Try again" was pressed: the group runs the failed load again. */
|
|
515
|
+
(e: 'retry', event: MouseEvent) => void;
|
|
497
516
|
|
|
498
517
|
/** The states one row resolves its parts with. */
|
|
499
518
|
export type RowPtState =
|
|
@@ -551,10 +570,9 @@ export type OptionsContainerSlots<T> = {
|
|
|
551
570
|
loading?: (props: object) => any;
|
|
552
571
|
/**
|
|
553
572
|
* Content shown when no options are available (replaces the default "no
|
|
554
|
-
* data" text).
|
|
555
|
-
* when none.
|
|
573
|
+
* data" text). Empty only: a failed load shows the failure row.
|
|
556
574
|
*/
|
|
557
|
-
empty?: (props:
|
|
575
|
+
empty?: (props: object) => any;
|
|
558
576
|
/**
|
|
559
577
|
* The actual input element for each option (e.g. radio or checkbox).
|
|
560
578
|
*/
|
|
@@ -14,16 +14,17 @@
|
|
|
14
14
|
<script setup lang="ts">
|
|
15
15
|
import BbIcon from '../BbIcon/BbIcon.vue';
|
|
16
16
|
import type { FallthroughAttrs } from '@/types/fallthrough';
|
|
17
|
-
import
|
|
17
|
+
import alertIconBuiltin from '@/assets/svgs/alert.svg?raw';
|
|
18
18
|
import type {
|
|
19
19
|
WarningIconProps,
|
|
20
20
|
WarningIconEvents,
|
|
21
21
|
WarningIconSlots,
|
|
22
22
|
} from './types';
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
import { useInternalIcon } from '@/composables/useInternalIcon';
|
|
25
24
|
// Type only (`Record<never, never>` has no runtime props to resolve).
|
|
26
25
|
defineProps</* @vue-ignore */ FallthroughAttrs<'svg', WarningIconProps>>();
|
|
26
|
+
const alertIcon = useInternalIcon('warning', alertIconBuiltin);
|
|
27
|
+
export type { WarningIconProps, WarningIconEvents, WarningIconSlots };
|
|
27
28
|
</script>
|
|
28
29
|
|
|
29
30
|
<style lang="postcss">
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// src/assets/svgs/close.svg?raw
|
|
2
|
-
var e = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\">\n <path d=\"
|
|
2
|
+
var e = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\">\n <path d=\"M18 6L6 18M6 6l12 12\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-width=\"1.636\" />\n</svg>\n";
|
|
3
3
|
export { e as default };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { FallthroughAttrs } from '../../types/fallthrough.js';
|
|
2
2
|
import { BbAccordionProps, BbAccordionEvents, BbAccordionSlots } from './types.js';
|
|
3
|
-
export type { BbAccordionProps, BbAccordionEvents, BbAccordionSlots };
|
|
4
3
|
type __VLS_Props = BbAccordionProps & FallthroughAttrs<'div', BbAccordionProps>;
|
|
5
4
|
type __VLS_Slots = BbAccordionSlots;
|
|
5
|
+
export type { BbAccordionProps, BbAccordionEvents, BbAccordionSlots };
|
|
6
6
|
type __VLS_ModelProps = {
|
|
7
7
|
/**
|
|
8
8
|
* Open / closed, or with `value` the key a group of accordions shares: open
|
|
@@ -6,12 +6,13 @@ import i from "../BbCollapsible/BbCollapsible.vue.js";
|
|
|
6
6
|
import { BB_ACCORDION_PT as a } from "./types.js";
|
|
7
7
|
import { usePassthrough as o } from "../../composables/usePassthrough.js";
|
|
8
8
|
import { transitions as s } from "../../utilities/misc/transitions.js";
|
|
9
|
-
import {
|
|
9
|
+
import { useInternalIcon as c } from "../../composables/useInternalIcon.js";
|
|
10
|
+
import { computed as l, createElementBlock as u, createElementVNode as d, createTextVNode as f, createVNode as p, defineComponent as m, h, mergeModels as g, mergeProps as _, openBlock as v, renderSlot as y, toDisplayString as b, unref as x, useAttrs as S, useModel as C, withCtx as w } from "vue";
|
|
10
11
|
// src/components/BbAccordion/BbAccordion.vue?vue&type=script&setup=true&lang.ts
|
|
11
|
-
var
|
|
12
|
+
var T = /*@__PURE__*/ m({
|
|
12
13
|
inheritAttrs: !1,
|
|
13
14
|
__name: "BbAccordion",
|
|
14
|
-
props: /*@__PURE__*/
|
|
15
|
+
props: /*@__PURE__*/ g({
|
|
15
16
|
"pt:root": {},
|
|
16
17
|
"pt:root:disabled": {},
|
|
17
18
|
"pt:root:open": {},
|
|
@@ -47,39 +48,39 @@ var w = /*@__PURE__*/ p({
|
|
|
47
48
|
}),
|
|
48
49
|
emits: ["update:modelValue"],
|
|
49
50
|
setup(s) {
|
|
50
|
-
let
|
|
51
|
+
let m = C(s, "modelValue"), g = s, T = c("expandChevron", t), E = o({
|
|
51
52
|
component: "BbAccordion",
|
|
52
|
-
attrs:
|
|
53
|
-
props:
|
|
53
|
+
attrs: S(),
|
|
54
|
+
props: g,
|
|
54
55
|
parts: a.parts,
|
|
55
56
|
states: a.states,
|
|
56
57
|
active: {
|
|
57
|
-
open: () =>
|
|
58
|
-
disabled: () => !!
|
|
58
|
+
open: () => A.value,
|
|
59
|
+
disabled: () => !!g.disabled
|
|
59
60
|
}
|
|
60
|
-
}),
|
|
61
|
-
|
|
61
|
+
}), D = e().id.value, O = g.id || `bba_${D}`, k = (e, { slots: t }) => g.headingLevel ? h(`h${g.headingLevel}`, { class: "bb-accordion__heading" }, t.default?.()) : t.default?.(), A = l(() => g.value === void 0 ? !!m.value : m.value === g.value), j = () => {
|
|
62
|
+
g.disabled || (g.value === void 0 ? m.value = !m.value : m.value = A.value ? null : g.value);
|
|
62
63
|
};
|
|
63
|
-
return (e,
|
|
64
|
-
default:
|
|
65
|
-
id: `${
|
|
66
|
-
"aria-controls":
|
|
64
|
+
return (e, t) => (v(), u("div", _({ class: ["bb-accordion", { "bb-accordion--titled": !e.$slots.header }] }, x(E).rootAttrs), [p(k, null, {
|
|
65
|
+
default: w(() => [p(n, _({
|
|
66
|
+
id: `${x(O)}_header`,
|
|
67
|
+
"aria-controls": x(O),
|
|
67
68
|
"aria-disabled": s.disabled || void 0,
|
|
68
|
-
"aria-expanded":
|
|
69
|
+
"aria-expanded": A.value,
|
|
69
70
|
class: "bb-accordion__header",
|
|
70
|
-
onClick:
|
|
71
|
-
},
|
|
72
|
-
default:
|
|
73
|
-
toggle:
|
|
74
|
-
open:
|
|
75
|
-
}, () => [
|
|
76
|
-
open:
|
|
77
|
-
toggle:
|
|
78
|
-
}, () => [
|
|
71
|
+
onClick: j
|
|
72
|
+
}, x(E).header), {
|
|
73
|
+
default: w(() => [y(e.$slots, "header", {
|
|
74
|
+
toggle: j,
|
|
75
|
+
open: A.value
|
|
76
|
+
}, () => [d("span", _({ class: "bb-accordion__title" }, x(E).title), [y(e.$slots, "title", {
|
|
77
|
+
open: A.value,
|
|
78
|
+
toggle: j
|
|
79
|
+
}, () => [f(b(s.title), 1)])], 16), p(r, _({
|
|
79
80
|
class: "bb-accordion__icon",
|
|
80
|
-
icon:
|
|
81
|
+
icon: x(T),
|
|
81
82
|
size: "16"
|
|
82
|
-
},
|
|
83
|
+
}, x(E).icon), null, 16, ["icon"])])]),
|
|
83
84
|
_: 3
|
|
84
85
|
}, 16, [
|
|
85
86
|
"id",
|
|
@@ -88,18 +89,18 @@ var w = /*@__PURE__*/ p({
|
|
|
88
89
|
"aria-expanded"
|
|
89
90
|
])]),
|
|
90
91
|
_: 3
|
|
91
|
-
}),
|
|
92
|
-
id:
|
|
93
|
-
"aria-labelledby": `${
|
|
92
|
+
}), p(i, {
|
|
93
|
+
id: x(O),
|
|
94
|
+
"aria-labelledby": `${x(O)}_header`,
|
|
94
95
|
eager: s.eager,
|
|
95
|
-
"model-value":
|
|
96
|
+
"model-value": A.value,
|
|
96
97
|
role: "region",
|
|
97
98
|
tag: "div",
|
|
98
99
|
"transition-duration": s.transitionDuration
|
|
99
100
|
}, {
|
|
100
|
-
default:
|
|
101
|
-
open:
|
|
102
|
-
toggle:
|
|
101
|
+
default: w(() => [d("div", _({ class: "bb-accordion__panel" }, x(E).panel), [y(e.$slots, "default", {
|
|
102
|
+
open: A.value,
|
|
103
|
+
toggle: j
|
|
103
104
|
})], 16)]),
|
|
104
105
|
_: 3
|
|
105
106
|
}, 8, [
|
|
@@ -111,4 +112,4 @@ var w = /*@__PURE__*/ p({
|
|
|
111
112
|
])], 16));
|
|
112
113
|
}
|
|
113
114
|
});
|
|
114
|
-
export {
|
|
115
|
+
export { T as default };
|
|
@@ -5,6 +5,7 @@ type __VLS_Slots = BbAvatarSlots;
|
|
|
5
5
|
export type { BbAvatarProps, BbAvatarSlots };
|
|
6
6
|
declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
7
7
|
size: number | import('../../types/CommonProps.js').CssSize | keyof import('../../types/SizeScale.js').Sizes;
|
|
8
|
+
color: boolean | string;
|
|
8
9
|
timeout: number;
|
|
9
10
|
alt: string;
|
|
10
11
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
@@ -9,83 +9,102 @@ import s from "../BbIcon/BbIcon.vue.js";
|
|
|
9
9
|
import c from "../../assets/svgs/user.svg_raw.js";
|
|
10
10
|
import { BB_AVATAR_PT as l } from "./types.js";
|
|
11
11
|
import { usePassthrough as u } from "../../composables/usePassthrough.js";
|
|
12
|
-
import {
|
|
12
|
+
import { useConfig as d } from "../../composables/useConfig.js";
|
|
13
|
+
import { LOCALE_TABLE as f, localeKeyOf as p } from "../../i18n/regions.js";
|
|
14
|
+
import { avatarHue as m, initialsOf as h } from "./avatarIdentity.js";
|
|
15
|
+
import { useInternalIcon as g } from "../../composables/useInternalIcon.js";
|
|
16
|
+
import { computed as _, createBlock as v, createCommentVNode as y, createElementBlock as b, defineComponent as x, mergeProps as S, normalizeClass as C, onMounted as w, openBlock as T, ref as E, renderSlot as D, toDisplayString as O, unref as k, useAttrs as A, watch as j } from "vue";
|
|
13
17
|
// src/components/BbAvatar/BbAvatar.vue?vue&type=script&setup=true&lang.ts
|
|
14
|
-
var
|
|
18
|
+
var M = [
|
|
15
19
|
"alt",
|
|
16
20
|
"aria-hidden",
|
|
17
21
|
"sizes",
|
|
18
22
|
"src",
|
|
19
23
|
"srcset"
|
|
20
|
-
],
|
|
24
|
+
], N = /*@__PURE__*/ x({
|
|
21
25
|
inheritAttrs: !1,
|
|
22
26
|
__name: "BbAvatar",
|
|
23
27
|
props: {
|
|
24
28
|
size: { default: "md" },
|
|
25
29
|
"pt:root": {},
|
|
26
30
|
"pt:icon": {},
|
|
31
|
+
"pt:initials": {},
|
|
27
32
|
pt: {},
|
|
28
33
|
alt: { default: "" },
|
|
34
|
+
name: {},
|
|
35
|
+
color: {
|
|
36
|
+
type: [Boolean, String],
|
|
37
|
+
default: !1
|
|
38
|
+
},
|
|
29
39
|
src: {},
|
|
30
40
|
srcset: {},
|
|
31
41
|
sizes: {},
|
|
32
42
|
timeout: { default: 400 }
|
|
33
43
|
},
|
|
34
|
-
setup(
|
|
35
|
-
let
|
|
44
|
+
setup(x) {
|
|
45
|
+
let N = x, P = g("avatar", c), F = u({
|
|
36
46
|
component: "BbAvatar",
|
|
37
|
-
attrs:
|
|
38
|
-
props:
|
|
47
|
+
attrs: A(),
|
|
48
|
+
props: N,
|
|
39
49
|
parts: l.parts,
|
|
40
50
|
states: l.states,
|
|
41
51
|
active: {}
|
|
42
|
-
}),
|
|
52
|
+
}), I = n("BbAvatar", r);
|
|
43
53
|
process.env.NODE_ENV !== "production" && o("BbAvatar", a("BbAvatar"));
|
|
44
|
-
let
|
|
45
|
-
if (
|
|
46
|
-
return e(
|
|
54
|
+
let L = i(), R = _(() => {
|
|
55
|
+
if (N.size != null) try {
|
|
56
|
+
return e(N.size, I.value);
|
|
47
57
|
} catch {
|
|
48
|
-
return
|
|
58
|
+
return L.warn(`Invalid size: "${N.size}" in BbAvatar. Falling back to "md".`), `${I.value.md}px`;
|
|
49
59
|
}
|
|
50
|
-
}),
|
|
60
|
+
}), z = d(), B = _(() => h(N.name, f[p(z.locale) ?? "en"].tag)), V = _(() => N.alt?.trim() || N.name?.trim() || ""), H = _(() => {
|
|
61
|
+
if (typeof N.color == "string" && N.color) return "bb-avatar--custom";
|
|
62
|
+
let e = N.color === !0 ? m(N.name) : void 0;
|
|
63
|
+
return e ? ["bb-avatar--colored", `bb-avatar--${e}`] : void 0;
|
|
64
|
+
}), U = _(() => {
|
|
51
65
|
let e = {};
|
|
52
|
-
return
|
|
53
|
-
}),
|
|
66
|
+
return R.value && (e["--size"] = R.value), typeof N.color == "string" && N.color && (e["--bg"] = N.color), e;
|
|
67
|
+
}), W = _(() => !!(N.src || N.srcset) && !Z.value), G = _(() => W.value && Q.value && !X.value), K = _(() => !W.value || G.value), q = _(() => !K.value || !V.value ? {} : {
|
|
54
68
|
role: "img",
|
|
55
|
-
"aria-label":
|
|
56
|
-
}),
|
|
57
|
-
|
|
58
|
-
|
|
69
|
+
"aria-label": V.value
|
|
70
|
+
}), J = (e) => !(!e || !e.complete || e.naturalWidth === 0), Y = E(null), X = E(!1), Z = E(!1), Q = E(!1);
|
|
71
|
+
w(async () => {
|
|
72
|
+
W.value && !Z.value && !X.value && Y.value && (await t(N.timeout), Q.value = !J(Y.value));
|
|
59
73
|
});
|
|
60
|
-
let
|
|
61
|
-
|
|
62
|
-
},
|
|
63
|
-
|
|
74
|
+
let $ = () => {
|
|
75
|
+
X.value = !0, Z.value = !1, Q.value = !1;
|
|
76
|
+
}, ee = () => {
|
|
77
|
+
Z.value = !0;
|
|
64
78
|
};
|
|
65
|
-
return
|
|
66
|
-
|
|
67
|
-
}), (e, t) => (
|
|
68
|
-
class: "bb-avatar",
|
|
69
|
-
style:
|
|
70
|
-
},
|
|
79
|
+
return j(() => [N.src, N.srcset], () => {
|
|
80
|
+
X.value = !1, Z.value = !1, Q.value = !1;
|
|
81
|
+
}), (e, t) => (T(), b("span", S({
|
|
82
|
+
class: ["bb-avatar", H.value],
|
|
83
|
+
style: U.value
|
|
84
|
+
}, k(F).rootAttrs), [W.value ? (T(), b("img", {
|
|
71
85
|
key: 0,
|
|
72
86
|
ref_key: "image",
|
|
73
|
-
ref:
|
|
74
|
-
alt:
|
|
75
|
-
"aria-hidden":
|
|
76
|
-
class:
|
|
77
|
-
sizes:
|
|
78
|
-
src:
|
|
79
|
-
srcset:
|
|
80
|
-
onError:
|
|
81
|
-
onLoad:
|
|
82
|
-
}, null, 42,
|
|
87
|
+
ref: Y,
|
|
88
|
+
alt: V.value,
|
|
89
|
+
"aria-hidden": G.value || void 0,
|
|
90
|
+
class: C(["bb-avatar__img", { "bb-avatar__img--hidden": G.value }]),
|
|
91
|
+
sizes: x.sizes,
|
|
92
|
+
src: x.src,
|
|
93
|
+
srcset: x.srcset,
|
|
94
|
+
onError: ee,
|
|
95
|
+
onLoad: $
|
|
96
|
+
}, null, 42, M)) : y("", !0), K.value ? (T(), b("span", S({
|
|
83
97
|
key: 1,
|
|
84
98
|
class: "bb-avatar__fallback"
|
|
85
|
-
},
|
|
99
|
+
}, q.value), [D(e.$slots, "default", {}, () => [B.value ? (T(), b("span", S({
|
|
100
|
+
key: 0,
|
|
101
|
+
"aria-hidden": "true",
|
|
102
|
+
class: "bb-avatar__initials"
|
|
103
|
+
}, k(F).initials), O(B.value), 17)) : (T(), v(s, S({
|
|
104
|
+
key: 1,
|
|
86
105
|
class: "bb-avatar__default-icon",
|
|
87
|
-
icon:
|
|
88
|
-
},
|
|
106
|
+
icon: k(P)
|
|
107
|
+
}, k(F).icon), null, 16, ["icon"]))])], 16)) : y("", !0)], 16));
|
|
89
108
|
}
|
|
90
109
|
});
|
|
91
|
-
export {
|
|
110
|
+
export { N as default };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// src/components/BbAvatar/avatarIdentity.ts
|
|
2
|
+
var e = [
|
|
3
|
+
"coral",
|
|
4
|
+
"tangerine",
|
|
5
|
+
"sunflower",
|
|
6
|
+
"mint",
|
|
7
|
+
"teal",
|
|
8
|
+
"sky",
|
|
9
|
+
"blue",
|
|
10
|
+
"violet",
|
|
11
|
+
"orchid",
|
|
12
|
+
"rose"
|
|
13
|
+
], t = /^\p{L}\p{M}*/u, n = (e, n) => {
|
|
14
|
+
let r = (e ?? "").trim().split(/\s+/).filter((e) => t.test(e));
|
|
15
|
+
if (!r.length) return "";
|
|
16
|
+
let i = (e) => e.match(t)[0];
|
|
17
|
+
return (r.length > 1 ? i(r[0]) + i(r[r.length - 1]) : i(r[0])).toLocaleUpperCase(n);
|
|
18
|
+
}, r = (t) => {
|
|
19
|
+
let n = (t ?? "").trim().replace(/\s+/g, " ").toLowerCase();
|
|
20
|
+
if (!n) return;
|
|
21
|
+
let r = 2166136261;
|
|
22
|
+
for (let e = 0; e < n.length; e++) r ^= n.charCodeAt(e), r = Math.imul(r, 16777619) >>> 0;
|
|
23
|
+
return e[r % e.length];
|
|
24
|
+
};
|
|
25
|
+
export { e as AVATAR_HUES, r as avatarHue, n as initialsOf };
|