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
|
@@ -142,7 +142,7 @@
|
|
|
142
142
|
:described="described"
|
|
143
143
|
:empty-text="computedNoDataText"
|
|
144
144
|
:failed-text="itemsError !== null ? computedNoDataText : undefined"
|
|
145
|
-
:groups="groupBy ?
|
|
145
|
+
:groups="groupBy ? listGroups : undefined"
|
|
146
146
|
:header-height="headerHeight"
|
|
147
147
|
:list-label="useOffcanvas ? activatorName : listLabel"
|
|
148
148
|
:list-labelledby="useOffcanvas ? undefined : listLabelledby"
|
|
@@ -152,12 +152,13 @@
|
|
|
152
152
|
:multiple="multiple"
|
|
153
153
|
:open="shown"
|
|
154
154
|
:option-height="itemHeight"
|
|
155
|
-
:options="groupBy ? undefined :
|
|
155
|
+
:options="groupBy ? undefined : listOptions"
|
|
156
156
|
:passthrough="passthrough"
|
|
157
157
|
@focused:change="onListboxFocusedChange"
|
|
158
158
|
@option:selected="onOptionSelected"
|
|
159
159
|
@option:unselected="onOptionUnselected"
|
|
160
160
|
@pointerdown="keepUserOffset"
|
|
161
|
+
@retry="runRetry($event, retryLoad, focusPopoverContentEl)"
|
|
161
162
|
@touchmove.passive="keepUserOffset"
|
|
162
163
|
@wheel.passive="keepUserOffset"
|
|
163
164
|
>
|
|
@@ -165,7 +166,6 @@
|
|
|
165
166
|
<template #empty
|
|
166
167
|
><slot
|
|
167
168
|
:close="close"
|
|
168
|
-
:error="itemsError"
|
|
169
169
|
:focus="focusPopoverContent"
|
|
170
170
|
name="empty"
|
|
171
171
|
:query="query"
|
|
@@ -408,6 +408,8 @@ import {
|
|
|
408
408
|
import { useUntil } from '../../composables/useUntil';
|
|
409
409
|
import { useClosingInert } from '@/composables/useClosingInert';
|
|
410
410
|
import { wait } from '@/utilities/functions/wait';
|
|
411
|
+
import { useOpenModel } from '@/composables/useOpenModel';
|
|
412
|
+
import { useOwnModel } from '@/composables/useOwnModel';
|
|
411
413
|
import BbBadge from '../BbBadge/BbBadge.vue';
|
|
412
414
|
import BbIcon from '../BbIcon/BbIcon.vue';
|
|
413
415
|
import BbOffCanvas from '../BbOffCanvas/BbOffCanvas.vue';
|
|
@@ -415,7 +417,7 @@ import ClearableButton from '../ClearableButton/ClearableButton.vue';
|
|
|
415
417
|
import CommonPopover from '../CommonPopover/CommonPopover.vue';
|
|
416
418
|
import ErrorIcon from '../ErrorIcon/ErrorIcon.vue';
|
|
417
419
|
import WarningIcon from '../WarningIcon/WarningIcon.vue';
|
|
418
|
-
import
|
|
420
|
+
import searchIconBuiltin from '@/assets/svgs/search.svg?raw';
|
|
419
421
|
import ListBox from '../ListBox/ListBox.vue';
|
|
420
422
|
import { waitFor } from '@/utilities/functions/waitFor';
|
|
421
423
|
import type {
|
|
@@ -435,6 +437,8 @@ import { transitions } from '@/utilities/misc/transitions';
|
|
|
435
437
|
import { removedPropsFor } from '@/deprecation/removedProps';
|
|
436
438
|
import { warnRemovedAttrs } from '@/utilities/functions/warnRemovedAttrs';
|
|
437
439
|
import { hasVnodeListener } from '@/utilities/functions/hasVnodeListener';
|
|
440
|
+
import { runRetry } from '@/utils/loadRetry';
|
|
441
|
+
import { useInternalIcon } from '@/composables/useInternalIcon';
|
|
438
442
|
|
|
439
443
|
// The element(s) the fall-through attributes reach, as typed below.
|
|
440
444
|
// @attrTargets span dialog
|
|
@@ -488,6 +492,7 @@ const props = withDefaults(
|
|
|
488
492
|
compact: undefined,
|
|
489
493
|
}
|
|
490
494
|
);
|
|
495
|
+
|
|
491
496
|
const emit =
|
|
492
497
|
defineEmits<
|
|
493
498
|
BbSelectPopoverEvents<SelectModelOf<OptionValueOf<Item, A>, M>>
|
|
@@ -495,6 +500,8 @@ const emit =
|
|
|
495
500
|
|
|
496
501
|
defineSlots<BbSelectPopoverSlots<Item, Known>>();
|
|
497
502
|
|
|
503
|
+
const searchIcon = useInternalIcon('search', searchIconBuiltin);
|
|
504
|
+
|
|
498
505
|
/** `all.popoverOffset`: the app's or the scope's gap, read per render. */
|
|
499
506
|
const popoverOffset = useConfigSetting<number>(null, 'popoverOffset');
|
|
500
507
|
|
|
@@ -704,7 +711,7 @@ const computedAriaDescribedby = computed(() => {
|
|
|
704
711
|
// While the latest load FAILED and the panel is open, the combobox is also
|
|
705
712
|
// described by the listbox's failure footer, so a reader landing
|
|
706
713
|
// on the field hears why the list is what it is.
|
|
707
|
-
if (shown.value && itemsError.value !== null)
|
|
714
|
+
if (shown.value && itemsError.value !== null && !computedLoading.value)
|
|
708
715
|
own.push(`${id}_listbox_failed`);
|
|
709
716
|
// Below `min-query-length` the search box says how much to type.
|
|
710
717
|
if (shown.value && belowMinQuery.value && computedAllowWriting.value)
|
|
@@ -875,6 +882,16 @@ const onPopoverFocusProxyFocus = (_event: FocusEvent) => {
|
|
|
875
882
|
*/
|
|
876
883
|
const onSearchInputInput = (event: Event) => {
|
|
877
884
|
emit('input', event);
|
|
885
|
+
search(false);
|
|
886
|
+
};
|
|
887
|
+
|
|
888
|
+
/**
|
|
889
|
+
* The ONE search path, for typing and for a query the app
|
|
890
|
+
* writes. Typing goes through the debounce; an app write is one deliberate
|
|
891
|
+
* value: it drops a scheduled keystroke search and loads now (the request in
|
|
892
|
+
* flight is superseded and aborted, as by any newer load).
|
|
893
|
+
*/
|
|
894
|
+
const search = (immediate: boolean) => {
|
|
878
895
|
if (belowMinQuery.value && !sentQuery) return;
|
|
879
896
|
sentQuery = searchQuery.value;
|
|
880
897
|
// A user search is a first load like any other, so unlock `canLoad` — without
|
|
@@ -889,11 +906,13 @@ const onSearchInputInput = (event: Event) => {
|
|
|
889
906
|
// A thunk: the model is read when the debounced call fires, so a pick made
|
|
890
907
|
// between the keystroke and the fire is what the provider sees (E14).
|
|
891
908
|
let generation = depsGeneration;
|
|
909
|
+
const args = (): [string, 'search', unknown] => {
|
|
910
|
+
generation = depsGeneration;
|
|
911
|
+
return [searchQuery.value, 'search', props.modelValue];
|
|
912
|
+
};
|
|
913
|
+
if (immediate) discardScheduledRequests();
|
|
892
914
|
void Promise.resolve(
|
|
893
|
-
|
|
894
|
-
generation = depsGeneration;
|
|
895
|
-
return [searchQuery.value, 'search', props.modelValue];
|
|
896
|
-
})
|
|
915
|
+
immediate ? getter(...args()) : debouncedGetter(args)
|
|
897
916
|
).then((outcome) => settleUnderParent(generation, 'search', outcome));
|
|
898
917
|
};
|
|
899
918
|
|
|
@@ -1140,6 +1159,11 @@ const onEnter = async () => {
|
|
|
1140
1159
|
if (!computedAllowWriting.value || belowMinQuery.value) return;
|
|
1141
1160
|
const text = query.value.trim();
|
|
1142
1161
|
if (isItemSelected(text)) return;
|
|
1162
|
+
addOption(text);
|
|
1163
|
+
};
|
|
1164
|
+
|
|
1165
|
+
/** `option:add` with the typed text, the field emptied: Enter and the create row. */
|
|
1166
|
+
const addOption = (text: string) => {
|
|
1143
1167
|
emit('option:add', text);
|
|
1144
1168
|
query.value = '';
|
|
1145
1169
|
};
|
|
@@ -1243,6 +1267,7 @@ const {
|
|
|
1243
1267
|
settledArgs,
|
|
1244
1268
|
settledCount,
|
|
1245
1269
|
inFlight,
|
|
1270
|
+
failedArgs,
|
|
1246
1271
|
discard: discardRequests,
|
|
1247
1272
|
discardScheduled: discardScheduledRequests,
|
|
1248
1273
|
} = useItemsGetter({
|
|
@@ -2120,6 +2145,26 @@ async function load(
|
|
|
2120
2145
|
return outcome;
|
|
2121
2146
|
}
|
|
2122
2147
|
|
|
2148
|
+
/**
|
|
2149
|
+
* The failure row's "Try again": the failed call again, with its own query and
|
|
2150
|
+
* reason, and the follow-up that reason's load runs (a non-search load prunes).
|
|
2151
|
+
*/
|
|
2152
|
+
const retryLoad = () => {
|
|
2153
|
+
const args = failedArgs();
|
|
2154
|
+
if (!args) return;
|
|
2155
|
+
const [text, reason] = args;
|
|
2156
|
+
void load(
|
|
2157
|
+
text ?? '',
|
|
2158
|
+
reason as Parameters<typeof load>[1],
|
|
2159
|
+
props.modelValue
|
|
2160
|
+
).then((outcome) => {
|
|
2161
|
+
if (outcome === 'applied' && reason !== 'search') pruneAgainstFetchedRows();
|
|
2162
|
+
});
|
|
2163
|
+
};
|
|
2164
|
+
/** Where focus goes when the retry takes the button away: the search field, else the panel's combobox. */
|
|
2165
|
+
const focusPopoverContentEl = () =>
|
|
2166
|
+
computedAllowWriting.value ? searchInput.value : popoverFocusProxy.value;
|
|
2167
|
+
|
|
2123
2168
|
/** The source became an array: no load will lift a mask or serve a stale-list reload. */
|
|
2124
2169
|
function releaseForArray() {
|
|
2125
2170
|
listStale = false;
|
|
@@ -2372,6 +2417,8 @@ useHashedWatcher(
|
|
|
2372
2417
|
);
|
|
2373
2418
|
|
|
2374
2419
|
const onOptionSelected = async (option: BaseOption) => {
|
|
2420
|
+
// The create row adds what was typed, as Enter does; it is never picked.
|
|
2421
|
+
if (option.create) return addOption(option.create.query);
|
|
2375
2422
|
// Sampled before anything awaits: the question is where focus was when the
|
|
2376
2423
|
// user acted, not where it drifted to while the model settled.
|
|
2377
2424
|
const mayRestoreSearchFocus = canHandOffFocusToSearchInput();
|
|
@@ -2574,6 +2621,56 @@ const groupedOptions = computed<GroupedOptions[]>(() => {
|
|
|
2574
2621
|
.filter((g) => g.options.length);
|
|
2575
2622
|
});
|
|
2576
2623
|
|
|
2624
|
+
/**
|
|
2625
|
+
* "Create «query»": with `option:add` wired, a typed query
|
|
2626
|
+
* (trimmed, past `min-query-length`) that no listed option matches exactly
|
|
2627
|
+
* (case aside) gets a real option row, LAST after the matches or alone in
|
|
2628
|
+
* place of the no-results text. No icon; the query is emphasised. Not while
|
|
2629
|
+
* the list loads or failed: a match may be on its way.
|
|
2630
|
+
*/
|
|
2631
|
+
const CREATE_HASH = '__bb-create__';
|
|
2632
|
+
const createOption = computed<BaseOption<Item> | null>(() => {
|
|
2633
|
+
if (!computedAllowWriting.value || belowMinQuery.value) return null;
|
|
2634
|
+
if (computedLoading.value || itemsError.value !== null) return null;
|
|
2635
|
+
if (!hasVnodeListener(instance, 'option:add')) return null;
|
|
2636
|
+
const text = query.value.trim();
|
|
2637
|
+
if (!text || isItemSelected(text)) return null;
|
|
2638
|
+
const key = text.toLocaleLowerCase();
|
|
2639
|
+
if (
|
|
2640
|
+
filteredOptions.value.some(
|
|
2641
|
+
(option) => option.text.trim().toLocaleLowerCase() === key
|
|
2642
|
+
)
|
|
2643
|
+
)
|
|
2644
|
+
return null;
|
|
2645
|
+
const marker = '\u0000';
|
|
2646
|
+
const [before = '', after = ''] = t(
|
|
2647
|
+
'select.createOption',
|
|
2648
|
+
marker
|
|
2649
|
+
).value.split(marker);
|
|
2650
|
+
return {
|
|
2651
|
+
text: `${before}${text}${after}`,
|
|
2652
|
+
value: undefined,
|
|
2653
|
+
item: undefined as Item,
|
|
2654
|
+
valueHash: CREATE_HASH,
|
|
2655
|
+
create: { before, query: text, after },
|
|
2656
|
+
};
|
|
2657
|
+
});
|
|
2658
|
+
/** What the list shows: the options, then the create row. */
|
|
2659
|
+
const listOptions = computed(() =>
|
|
2660
|
+
createOption.value
|
|
2661
|
+
? [...filteredOptions.value, createOption.value]
|
|
2662
|
+
: filteredOptions.value
|
|
2663
|
+
);
|
|
2664
|
+
/** The same for the grouped list: the create row is a last, headerless group. */
|
|
2665
|
+
const listGroups = computed<GroupedOptions[]>(() =>
|
|
2666
|
+
createOption.value
|
|
2667
|
+
? [
|
|
2668
|
+
...groupedOptions.value,
|
|
2669
|
+
{ id: CREATE_HASH, data: null, options: [createOption.value] },
|
|
2670
|
+
]
|
|
2671
|
+
: groupedOptions.value
|
|
2672
|
+
);
|
|
2673
|
+
|
|
2577
2674
|
/**
|
|
2578
2675
|
* START POPOVER STATE
|
|
2579
2676
|
*/
|
|
@@ -2831,7 +2928,7 @@ const settleListOnClose = () => {
|
|
|
2831
2928
|
};
|
|
2832
2929
|
|
|
2833
2930
|
/** Runs before the panel shows: the old rows must not paint for a frame. */
|
|
2834
|
-
const refreshDirtyList = () => {
|
|
2931
|
+
const refreshDirtyList = (heldQuery = false) => {
|
|
2835
2932
|
if (!listDirty && !listStale) return;
|
|
2836
2933
|
// A new record since the last open reloads its page as a first load
|
|
2837
2934
|
// (R11), even while a dropped mount load is still out; a dirty list
|
|
@@ -2841,7 +2938,8 @@ const refreshDirtyList = () => {
|
|
|
2841
2938
|
listStale = false;
|
|
2842
2939
|
markPrefilled();
|
|
2843
2940
|
listMasked.value = true;
|
|
2844
|
-
|
|
2941
|
+
// The open's own search replaces the reload.
|
|
2942
|
+
if (isSearchFirst.value || heldQuery) return;
|
|
2845
2943
|
// A reopen is "initial after closing": its
|
|
2846
2944
|
// applied result prunes like every other non-search load.
|
|
2847
2945
|
void load('', reason, props.modelValue).then((outcome) => {
|
|
@@ -2852,14 +2950,21 @@ const refreshDirtyList = () => {
|
|
|
2852
2950
|
const open = async ({
|
|
2853
2951
|
focusPopoverContent = true,
|
|
2854
2952
|
}: { focusPopoverContent?: boolean } = {}) => {
|
|
2855
|
-
if (props.disabled || props.readonly) return;
|
|
2953
|
+
if (props.disabled || props.readonly) return dropHeldQuery();
|
|
2856
2954
|
if (shown.value) return;
|
|
2857
2955
|
// Latch the surface and the `auto` search decision for this open cycle
|
|
2858
2956
|
// before anything reads them.
|
|
2859
2957
|
surface.value = resolveSurface();
|
|
2860
2958
|
autoHidesSearch.value = resolveAutoHidesSearch();
|
|
2861
2959
|
hasInteracted.value = true;
|
|
2862
|
-
|
|
2960
|
+
// a query the app wrote for this open (`query = x;
|
|
2961
|
+
// open = true`, in either order) is this open's search: read before the
|
|
2962
|
+
// list refreshes, so ONE request goes out, for it.
|
|
2963
|
+
takeQueryModel();
|
|
2964
|
+
if (query.value && !computedAllowWriting.value) dropHeldQuery();
|
|
2965
|
+
// Below `min-query-length` it searches nothing: the open goes as usual.
|
|
2966
|
+
const heldQuery = !!searchQuery.value;
|
|
2967
|
+
refreshDirtyList(heldQuery);
|
|
2863
2968
|
pinOutsideRows();
|
|
2864
2969
|
placeOnLoad =
|
|
2865
2970
|
typeof props.items === 'function' &&
|
|
@@ -2871,9 +2976,13 @@ const open = async ({
|
|
|
2871
2976
|
// opening must not perform it — this is the only thing separating
|
|
2872
2977
|
// `prefill: false` from `'interaction'`.
|
|
2873
2978
|
const firstLoad =
|
|
2874
|
-
!
|
|
2979
|
+
!heldQuery &&
|
|
2980
|
+
!hasPrefilled.value &&
|
|
2981
|
+
!isPrefilling.value &&
|
|
2982
|
+
!isSearchFirst.value
|
|
2875
2983
|
? prefillItems()
|
|
2876
2984
|
: undefined;
|
|
2985
|
+
if (heldQuery) search(true);
|
|
2877
2986
|
// The panel does not wait for that load: it opens on its loading
|
|
2878
2987
|
// state and takes focus now. Waiting left focus on the activator for the
|
|
2879
2988
|
// whole fetch, so keys typed right after the click were lost and a space
|
|
@@ -2979,7 +3088,8 @@ const close = async () => {
|
|
|
2979
3088
|
const onOffcanvasHidden = () => {
|
|
2980
3089
|
optionsContainer.value?.blur();
|
|
2981
3090
|
activeDescendantId.value = undefined;
|
|
2982
|
-
query
|
|
3091
|
+
// The query was cleared when the close began (the `shown` watcher below),
|
|
3092
|
+
// so a query the app writes during the slide-out survives.
|
|
2983
3093
|
// The sheet can close itself without `close()` (backdrop, drag, Escape).
|
|
2984
3094
|
placeOnLoad = false;
|
|
2985
3095
|
settleListOnClose();
|
|
@@ -2996,6 +3106,58 @@ const toggle = () => {
|
|
|
2996
3106
|
if (shown.value) return close();
|
|
2997
3107
|
return open();
|
|
2998
3108
|
};
|
|
3109
|
+
|
|
3110
|
+
// `v-model:open`: the same open and close the activator
|
|
3111
|
+
// makes; every close (a pick, Escape, outside, the sheet's own) writes back.
|
|
3112
|
+
useOpenModel(props, emit, { isOpen: () => shown.value, open, close });
|
|
3113
|
+
|
|
3114
|
+
/**
|
|
3115
|
+
* `v-model:query`. The model mirrors the field: every change of
|
|
3116
|
+
* `query` is emitted raw (Vue's `v-model` on the field holds it during an IME
|
|
3117
|
+
* composition, so the composed text comes once), and `''` when the component
|
|
3118
|
+
* empties it. An app write is a search the user didn't type (the one search
|
|
3119
|
+
* path, at once); closed, it is held for the next open; it never opens the
|
|
3120
|
+
* panel or moves focus, and is never echoed back.
|
|
3121
|
+
*/
|
|
3122
|
+
const { model: queryModel, set: setQueryModel } = useOwnModel<'query', string>(
|
|
3123
|
+
props,
|
|
3124
|
+
'query',
|
|
3125
|
+
emit,
|
|
3126
|
+
() => ''
|
|
3127
|
+
);
|
|
3128
|
+
watch(
|
|
3129
|
+
query,
|
|
3130
|
+
(next) => {
|
|
3131
|
+
if (next !== queryModel.value) setQueryModel(next);
|
|
3132
|
+
},
|
|
3133
|
+
{ flush: 'sync' }
|
|
3134
|
+
);
|
|
3135
|
+
/** The app's query, when it differs: closed, held; open, searched. */
|
|
3136
|
+
const takeQueryModel = () => {
|
|
3137
|
+
if (queryModel.value !== query.value) query.value = queryModel.value;
|
|
3138
|
+
};
|
|
3139
|
+
/** A held query that can't land: dropped, and `''` written back. */
|
|
3140
|
+
const dropHeldQuery = () => {
|
|
3141
|
+
if (query.value) query.value = '';
|
|
3142
|
+
else if (queryModel.value) setQueryModel('');
|
|
3143
|
+
};
|
|
3144
|
+
watch(queryModel, (next) => {
|
|
3145
|
+
if (next === query.value) return;
|
|
3146
|
+
if (props.disabled || props.readonly) return dropHeldQuery();
|
|
3147
|
+
query.value = next;
|
|
3148
|
+
if (!shown.value) return;
|
|
3149
|
+
if (!computedAllowWriting.value) return dropHeldQuery();
|
|
3150
|
+
search(true);
|
|
3151
|
+
});
|
|
3152
|
+
// The query ends when the close begins, on both surfaces: the sheet's own
|
|
3153
|
+
// dismiss (backdrop, drag, Escape) flips `shown` without `close()`.
|
|
3154
|
+
watch(
|
|
3155
|
+
shown,
|
|
3156
|
+
(value) => {
|
|
3157
|
+
if (!value && query.value) query.value = '';
|
|
3158
|
+
},
|
|
3159
|
+
{ flush: 'sync' }
|
|
3160
|
+
);
|
|
2999
3161
|
/**
|
|
3000
3162
|
* END POPOVER STATE
|
|
3001
3163
|
*/
|
|
@@ -3460,10 +3622,11 @@ export type BbSelectResolvedOption<Item = any> = {
|
|
|
3460
3622
|
* `BbOffCanvas` root) — never the desktop surface. Applied after `panel`, so it wins a conflict there.
|
|
3461
3623
|
* @part input - The search field.
|
|
3462
3624
|
* @part clear - The ✕ that empties the search field.
|
|
3463
|
-
* @part list - The `role="listbox"` node
|
|
3464
|
-
*
|
|
3465
|
-
*
|
|
3466
|
-
*
|
|
3625
|
+
* @part list - The `role="listbox"` node holding the options. Virtualised:
|
|
3626
|
+
* the list writes its height and places its rows, which limits layout
|
|
3627
|
+
* utilities there. A group's box and the chips are not parts.
|
|
3628
|
+
* @part groupHeader - Every `groupBy` heading (sticky). `#group` replaces its
|
|
3629
|
+
* content.
|
|
3467
3630
|
* @part option - One listbox option — a broadcast resolved per option. Also
|
|
3468
3631
|
* takes a per-item function, called with the option's raw item.
|
|
3469
3632
|
* @part itemText - An option's label — resolved with that option's states. A
|
|
@@ -3473,10 +3636,9 @@ export type BbSelectResolvedOption<Item = any> = {
|
|
|
3473
3636
|
* @part itemDescription - An option's second line (its description) —
|
|
3474
3637
|
* resolved with that option's states. A custom `#option` slot replaces it.
|
|
3475
3638
|
* Also takes a per-item function.
|
|
3476
|
-
* @part check - The tick
|
|
3477
|
-
*
|
|
3478
|
-
*
|
|
3479
|
-
* alone. Also takes a per-item function.
|
|
3639
|
+
* @part check - The tick at a chosen option's end (on every option, drawn on
|
|
3640
|
+
* the chosen). A custom `#option` slot keeps it; `pt:check="hidden"`
|
|
3641
|
+
* removes it, sparing your slot's glyph. Also takes a per-item function.
|
|
3480
3642
|
* @part header - The flyout's header band.
|
|
3481
3643
|
* @part footer - The flyout's footer band.
|
|
3482
3644
|
*/
|
|
@@ -3487,6 +3649,7 @@ export type BbSelectPopoverPtPart =
|
|
|
3487
3649
|
| 'input'
|
|
3488
3650
|
| 'clear'
|
|
3489
3651
|
| 'list'
|
|
3652
|
+
| 'groupHeader'
|
|
3490
3653
|
| 'option'
|
|
3491
3654
|
| 'itemText'
|
|
3492
3655
|
| 'itemIcon'
|
|
@@ -3502,6 +3665,7 @@ export type BbSelectPopoverSurfacePtPart =
|
|
|
3502
3665
|
| 'input'
|
|
3503
3666
|
| 'clear'
|
|
3504
3667
|
| 'list'
|
|
3668
|
+
| 'groupHeader'
|
|
3505
3669
|
| 'header'
|
|
3506
3670
|
| 'footer';
|
|
3507
3671
|
/** The option parts — broadcasts resolved per option; their base key also takes a per-item function. Spelled flat (T20). */
|
|
@@ -3517,7 +3681,7 @@ export type BbSelectPopoverOptionPtPart =
|
|
|
3517
3681
|
* @state selected - Per node, on `option`, its `item-*` parts and `check`: a
|
|
3518
3682
|
* chosen option.
|
|
3519
3683
|
* @state disabled - Per node, on `option`, its `item-*` parts and `check`: an
|
|
3520
|
-
* option that is disabled.
|
|
3684
|
+
* option that is disabled; on `groupHeader`: every option of its group is.
|
|
3521
3685
|
* @state open - Component-wide: the options surface is showing.
|
|
3522
3686
|
*/
|
|
3523
3687
|
export type BbSelectPopoverPtState = 'open' | 'selected' | 'disabled';
|
|
@@ -3528,7 +3692,8 @@ export type BbSelectPopoverPtState = 'open' | 'selected' | 'disabled';
|
|
|
3528
3692
|
export type BbSelectPopoverPtKey =
|
|
3529
3693
|
| BbSelectPopoverPtPart
|
|
3530
3694
|
| `${BbSelectPopoverPtPart}:open`
|
|
3531
|
-
| `${BbSelectPopoverOptionPtPart}:${'selected' | 'disabled'}
|
|
3695
|
+
| `${BbSelectPopoverOptionPtPart}:${'selected' | 'disabled'}`
|
|
3696
|
+
| 'groupHeader:disabled';
|
|
3532
3697
|
/** The runtime lists the resolver is wired with — kept next to the types so the two cannot drift. */
|
|
3533
3698
|
export const BB_SELECT_POPOVER_PT = {
|
|
3534
3699
|
parts: [
|
|
@@ -3538,6 +3703,7 @@ export const BB_SELECT_POPOVER_PT = {
|
|
|
3538
3703
|
'input',
|
|
3539
3704
|
'clear',
|
|
3540
3705
|
'list',
|
|
3706
|
+
'groupHeader',
|
|
3541
3707
|
'option',
|
|
3542
3708
|
'itemText',
|
|
3543
3709
|
'itemIcon',
|
|
@@ -3556,6 +3722,7 @@ export const BB_SELECT_POPOVER_PT = {
|
|
|
3556
3722
|
itemIcon: ['selected', 'disabled'],
|
|
3557
3723
|
itemDescription: ['selected', 'disabled'],
|
|
3558
3724
|
check: ['selected', 'disabled'],
|
|
3725
|
+
groupHeader: ['disabled'],
|
|
3559
3726
|
},
|
|
3560
3727
|
} as const satisfies {
|
|
3561
3728
|
parts: readonly BbSelectPopoverPtPart[];
|
|
@@ -3601,6 +3768,17 @@ export type BbSelectPopoverProps<
|
|
|
3601
3768
|
) => PtItemResult);
|
|
3602
3769
|
} & {
|
|
3603
3770
|
/* eslint-enable @typescript-eslint/consistent-indexed-object-style */
|
|
3771
|
+
/**
|
|
3772
|
+
* Whether the panel is open (`v-model:open`; `v-model` stays the value).
|
|
3773
|
+
* Bound, the app opens and closes it; unbound, the initial state.
|
|
3774
|
+
*/
|
|
3775
|
+
open?: boolean;
|
|
3776
|
+
/**
|
|
3777
|
+
* The search field's text (`v-model:query`): raw per keystroke, `''`
|
|
3778
|
+
* when the component empties it; a write searches at once (guide §
|
|
3779
|
+
* Reading and restoring the search).
|
|
3780
|
+
*/
|
|
3781
|
+
query?: string;
|
|
3604
3782
|
/**
|
|
3605
3783
|
* Passthrough, object form: the same keys as the `pt:*` attributes
|
|
3606
3784
|
* without the prefix. See the `pt:<part>` row.
|
|
@@ -3928,6 +4106,10 @@ export type BbSelectPopoverEvents<V = any> = {
|
|
|
3928
4106
|
(e: 'shown'): void;
|
|
3929
4107
|
/** Emitted as soon as the options surface starts to close. */
|
|
3930
4108
|
(e: 'hide'): void;
|
|
4109
|
+
/** The panel opened or closed (`v-model:open`). */
|
|
4110
|
+
(e: 'update:open', value: boolean): void;
|
|
4111
|
+
/** `v-model:query`: the search field's text. */
|
|
4112
|
+
(e: 'update:query', value: string): void;
|
|
3931
4113
|
/** Emitted once the options surface has finished closing. */
|
|
3932
4114
|
(e: 'hidden'): void;
|
|
3933
4115
|
/**
|
|
@@ -4098,15 +4280,14 @@ export type BbSelectPopoverSlots<
|
|
|
4098
4280
|
loading?: (props: { query: string }) => any;
|
|
4099
4281
|
/**
|
|
4100
4282
|
* Content shown when no options match the query or the list is empty.
|
|
4101
|
-
*
|
|
4102
|
-
*
|
|
4103
|
-
* focus out of it.
|
|
4283
|
+
* Empty only: a failed load shows the library's failure row instead (its
|
|
4284
|
+
* message is `failed-text`, and it ends with "Try again"). `close()` closes
|
|
4285
|
+
* the panel, for an action that does not move focus out of it.
|
|
4104
4286
|
*/
|
|
4105
4287
|
empty?: (props: {
|
|
4106
4288
|
query: string;
|
|
4107
4289
|
focus: () => void;
|
|
4108
4290
|
close: () => Promise<void>;
|
|
4109
|
-
error: unknown;
|
|
4110
4291
|
}) => any;
|
|
4111
4292
|
/**
|
|
4112
4293
|
* Replaces the default rendering of each option row in the dropdown. With
|
|
@@ -4415,6 +4596,10 @@ export type BbSelectPopoverSlots<
|
|
|
4415
4596
|
calc(round(down, calc(100dvh - 130px), var(--option-h)) - 1px)
|
|
4416
4597
|
);
|
|
4417
4598
|
overflow: auto;
|
|
4599
|
+
/* The windowed groups are placed by `top` (sticky headers need
|
|
4600
|
+
layout positions): the browser's scroll anchoring would nudge
|
|
4601
|
+
the list as they mount. The list places itself. */
|
|
4602
|
+
overflow-anchor: none;
|
|
4418
4603
|
overflow-x: clip;
|
|
4419
4604
|
padding: 0.25rem;
|
|
4420
4605
|
text-align: start;
|
|
@@ -4441,12 +4626,21 @@ export type BbSelectPopoverSlots<
|
|
|
4441
4626
|
width: 100%;
|
|
4442
4627
|
}
|
|
4443
4628
|
|
|
4629
|
+
/* Sticky: the scrolled group's header stays
|
|
4630
|
+
pinned at the top while its options pass under it, and
|
|
4631
|
+
leaves with its group's last row. Opaque, on the panel, and
|
|
4632
|
+
pinned over the scroll area's block padding (sticky insets
|
|
4633
|
+
by it) so no row peeks above it. */
|
|
4444
4634
|
.bb-listbox__group-header {
|
|
4445
4635
|
align-items: center;
|
|
4636
|
+
background-color: var(--bg);
|
|
4446
4637
|
display: flex;
|
|
4447
4638
|
height: var(--group-header-height, 32px);
|
|
4448
4639
|
padding: 0 0.5rem;
|
|
4640
|
+
position: sticky;
|
|
4641
|
+
top: -0.25rem;
|
|
4449
4642
|
user-select: none;
|
|
4643
|
+
z-index: 1;
|
|
4450
4644
|
|
|
4451
4645
|
.bb-listbox__group-header-label {
|
|
4452
4646
|
/* Muted, like BbDropdown's group titles (parity): faint fails
|
|
@@ -4561,6 +4755,18 @@ export type BbSelectPopoverSlots<
|
|
|
4561
4755
|
transition: stroke-dashoffset var(--bb-transition-medium)
|
|
4562
4756
|
var(--bb-ease);
|
|
4563
4757
|
}
|
|
4758
|
+
|
|
4759
|
+
/* An app's own check glyph (any set, stroked or filled)
|
|
4760
|
+
has no draw-in: it simply appears on the selected row. */
|
|
4761
|
+
&--own {
|
|
4762
|
+
visibility: hidden;
|
|
4763
|
+
|
|
4764
|
+
path {
|
|
4765
|
+
stroke-dasharray: none;
|
|
4766
|
+
stroke-dashoffset: 0;
|
|
4767
|
+
transition: none;
|
|
4768
|
+
}
|
|
4769
|
+
}
|
|
4564
4770
|
}
|
|
4565
4771
|
|
|
4566
4772
|
&--selected {
|
|
@@ -4575,6 +4781,10 @@ export type BbSelectPopoverSlots<
|
|
|
4575
4781
|
stroke-dashoffset: 0;
|
|
4576
4782
|
}
|
|
4577
4783
|
}
|
|
4784
|
+
|
|
4785
|
+
.bb-listbox__option-check--own {
|
|
4786
|
+
visibility: visible;
|
|
4787
|
+
}
|
|
4578
4788
|
}
|
|
4579
4789
|
}
|
|
4580
4790
|
|
|
@@ -4588,6 +4798,11 @@ export type BbSelectPopoverSlots<
|
|
|
4588
4798
|
white-space: nowrap;
|
|
4589
4799
|
}
|
|
4590
4800
|
|
|
4801
|
+
/* "Create «query»": the typed query stands out in the label. */
|
|
4802
|
+
.bb-listbox__create-query {
|
|
4803
|
+
font-weight: 600;
|
|
4804
|
+
}
|
|
4805
|
+
|
|
4591
4806
|
.bb-listbox__item-description {
|
|
4592
4807
|
color: var(--bb-text-muted);
|
|
4593
4808
|
font-size: calc(var(--option-font-size, var(--bb-fs)) - 2px);
|
|
@@ -69,6 +69,7 @@
|
|
|
69
69
|
:loading-text="loadingText"
|
|
70
70
|
:options="options"
|
|
71
71
|
:passthrough="passthrough"
|
|
72
|
+
@retry="runRetry($event, retryLoad, () => optionsElement)"
|
|
72
73
|
>
|
|
73
74
|
<template #prepend><slot name="prepend"></slot></template>
|
|
74
75
|
<template #loading><slot name="loading"></slot></template>
|
|
@@ -147,6 +148,7 @@ import type { FallthroughAttrs } from '@/types/fallthrough';
|
|
|
147
148
|
import { vAutofocus } from '@/utilities/misc/autofocus';
|
|
148
149
|
import CommonField from '../CommonField/CommonField.vue';
|
|
149
150
|
import OptionsContainer from '../OptionsContainer/OptionsContainer.vue';
|
|
151
|
+
import { runRetry } from '@/utils/loadRetry';
|
|
150
152
|
import BbBaseSwitchIcon from '../BbBaseSwitchIcon/BbBaseSwitchIcon.vue';
|
|
151
153
|
import {
|
|
152
154
|
aliasParts,
|
|
@@ -318,6 +320,7 @@ const {
|
|
|
318
320
|
items: internalItems,
|
|
319
321
|
loading,
|
|
320
322
|
error: itemsError,
|
|
323
|
+
retry,
|
|
321
324
|
ssrMarker,
|
|
322
325
|
} = useItemsGetter({ items, marker: true });
|
|
323
326
|
|
|
@@ -327,6 +330,11 @@ const alignToCoherenceSettings = () => {
|
|
|
327
330
|
}
|
|
328
331
|
};
|
|
329
332
|
|
|
333
|
+
/** The failure row's "Try again": the failed load again, then coherence on rows it applied. */
|
|
334
|
+
const retryLoad = async () => {
|
|
335
|
+
if ((await retry()) === 'applied') alignToCoherenceSettings();
|
|
336
|
+
};
|
|
337
|
+
|
|
330
338
|
const { hasPrefilled, whenPrefilled } = usePrefill({
|
|
331
339
|
alreadyLoaded: hydratedFromSsr,
|
|
332
340
|
clientReproducible,
|
|
@@ -707,11 +715,10 @@ export type BbSwitchGroupSlots<T> = {
|
|
|
707
715
|
loading?: (props: object) => any;
|
|
708
716
|
/**
|
|
709
717
|
* Content shown when no options are available (replaces the default "no
|
|
710
|
-
* data" text).
|
|
711
|
-
*
|
|
712
|
-
* rows, so this slot is where it shows.
|
|
718
|
+
* data" text). Empty only: a failed load shows the library's failure row
|
|
719
|
+
* instead (its message is `failed-text`, and it ends with "Try again").
|
|
713
720
|
*/
|
|
714
|
-
empty?: (props:
|
|
721
|
+
empty?: (props: object) => any;
|
|
715
722
|
/**
|
|
716
723
|
* Replaces the default switch track visual for each option. Receives the
|
|
717
724
|
* switch state plus the source item and its display text.
|