bitboss-ui 3.0.0-beta.73 → 3.0.0-beta.75
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 +4 -2
- package/bin/bitboss-ui-mcp.mjs +101 -3
- package/bin/bitboss-ui.mjs +6 -1
- package/bin/cli.mjs +31 -5
- package/dist/ai/BbAvatar.md +86 -58
- package/dist/ai/BbBadge.md +5 -5
- package/dist/ai/BbBreadcrumbs.md +2 -2
- package/dist/ai/BbButton.md +2 -2
- package/dist/ai/BbCalendar.md +9 -5
- package/dist/ai/BbCheckboxGroup.md +5 -4
- package/dist/ai/BbColorInput.md +12 -0
- package/dist/ai/BbColorPalette.md +19 -15
- package/dist/ai/BbConfirmPortal.md +1 -1
- package/dist/ai/BbDatePicker.md +16 -3
- package/dist/ai/BbDatePickerInput.md +17 -1
- package/dist/ai/BbDialog.md +16 -4
- package/dist/ai/BbDropdown.md +175 -67
- package/dist/ai/BbDropdownButton.md +27 -8
- package/dist/ai/BbForm.md +4 -1
- package/dist/ai/BbHoverCardPortal.md +1 -1
- package/dist/ai/BbNumberInput.md +8 -4
- package/dist/ai/BbPopoverPortal.md +1 -1
- package/dist/ai/BbRadioGroup.md +4 -4
- package/dist/ai/BbSelect.md +79 -67
- package/dist/ai/BbSelectPopover.md +24 -5
- package/dist/ai/BbSwitchGroup.md +5 -4
- package/dist/ai/BbTable.md +59 -34
- package/dist/ai/BbTimePicker.md +16 -3
- package/dist/ai/BbTimePickerInput.md +15 -1
- package/dist/ai/BbToast.md +3 -2
- package/dist/ai/BbToastPortal.md +1 -1
- 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 +1 -0
- package/dist/ai/ListBox.md +1 -0
- package/dist/ai/OptionsContainer.md +4 -4
- package/dist/ai/changelog.json +215 -6
- package/dist/ai/components.json +77 -43
- package/dist/ai/composables/useToast.md +2 -2
- package/dist/ai/design-tokens.json +60 -0
- package/dist/ai/guides/agent-contract.md +8 -4
- package/dist/ai/guides/design-tokens.md +33 -0
- package/dist/ai/guides/eslint-rules.md +1 -1
- package/dist/ai/guides/fetch-items-playbook.md +7 -11
- package/dist/ai/guides/inertia-helpers.md +613 -53
- package/dist/ai/guides/migration/adoption-checklist.md +5 -5
- 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-table.md +2 -1
- package/dist/ai/guides/migration/components/bb-toast.md +2 -2
- package/dist/ai/guides/migration/v2-to-v3.md +46 -5
- package/dist/ai/guides/migration/v3-beta-tooling.md +4 -0
- package/dist/ai/guides/passthrough.md +3 -3
- package/dist/ai/guides/preset-components.md +15 -2
- package/dist/ai/guides/reporting.md +49 -0
- package/dist/ai/helpers/inertia/manifest.json +33 -38
- package/dist/ai/helpers/inertia/useHasChanged.ts +25 -37
- package/dist/ai/helpers/inertia/useQuery.ts +24 -6
- package/dist/ai/helpers/inertia/utils.ts +552 -3
- package/dist/ai/index.md +2 -1
- package/dist/ai/manifest/common.json +1 -0
- package/dist/ai/manifest/components/BbAlert.tree.json +1 -1
- package/dist/ai/manifest/components/BbAvatar.json +5 -2
- package/dist/ai/manifest/components/BbAvatar.tree.json +32 -2
- package/dist/ai/manifest/components/BbCalendar.json +2 -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 +7 -4
- package/dist/ai/manifest/components/BbColorPalette.removed.json +1 -2
- package/dist/ai/manifest/components/BbConfirmPortal.json +1 -1
- package/dist/ai/manifest/components/BbDatePicker.json +6 -3
- package/dist/ai/manifest/components/BbDatePickerInput.json +3 -0
- package/dist/ai/manifest/components/BbDialog.tree.json +7 -1
- package/dist/ai/manifest/components/BbDropdown.json +23 -17
- package/dist/ai/manifest/components/BbDropdown.removed.json +2 -1
- package/dist/ai/manifest/components/BbDropdown.tree.json +16 -5
- package/dist/ai/manifest/components/BbDropdownButton.json +15 -9
- package/dist/ai/manifest/components/BbDropdownButton.removed.json +2 -1
- package/dist/ai/manifest/components/BbDropdownButton.tree.json +2 -0
- package/dist/ai/manifest/components/BbForm.json +1 -1
- package/dist/ai/manifest/components/BbHoverCard.json +1 -1
- package/dist/ai/manifest/components/BbHoverCardPortal.json +1 -1
- package/dist/ai/manifest/components/BbNumberInput.json +1 -1
- package/dist/ai/manifest/components/BbOffCanvas.tree.json +2 -0
- package/dist/ai/manifest/components/BbPopover.json +1 -1
- package/dist/ai/manifest/components/BbPopoverPortal.json +1 -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 +10 -7
- package/dist/ai/manifest/components/BbSelectPopover.json +7 -4
- package/dist/ai/manifest/components/BbSelectPopover.tree.json +5 -1
- 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 +16 -6
- package/dist/ai/manifest/components/BbTimePicker.json +7 -4
- package/dist/ai/manifest/components/BbTimePickerInput.json +5 -2
- package/dist/ai/manifest/components/BbToastPortal.json +1 -1
- package/dist/ai/manifest/components/BbTree.json +1 -1
- package/dist/ai/manifest/components/CommonPopover.json +2 -1
- package/dist/ai/manifest/components/FlatListBox.json +2 -1
- package/dist/ai/manifest/components/GroupedListBox.json +2 -1
- package/dist/ai/manifest/components/ListBox.json +2 -1
- package/dist/ai/manifest/components/OptionsContainer.json +6 -4
- package/dist/ai/manifest/index.json +2 -2
- package/dist/ai/manifest/meta.json +36 -3
- package/dist/ai/manifest/types.advanced.json +81 -80
- package/dist/ai/manifest/types.api.json +64 -65
- package/dist/ai/manifest/types.wrapper.json +155 -118
- package/dist/ai/recipes/inertia/layout-scaffold.md +3 -1
- package/dist/ai/recipes/nuxt/layout-scaffold.md +3 -1
- package/dist/ai/recipes/vue/layout-scaffold.md +3 -1
- package/dist/ai/source/BbAlert.md +16 -4
- package/dist/ai/source/BbAvatar.md +121 -9
- package/dist/ai/source/BbBadge.md +12 -5
- package/dist/ai/source/BbBreadcrumbs.md +56 -55
- package/dist/ai/source/BbButton.md +41 -25
- package/dist/ai/source/BbCalendar.md +22 -12
- package/dist/ai/source/BbCarousel.md +31 -28
- package/dist/ai/source/BbCheckboxGroup.md +15 -9
- package/dist/ai/source/BbColorInput.md +19 -0
- package/dist/ai/source/BbColorPalette.md +59 -12
- package/dist/ai/source/BbConfirm.md +7 -0
- package/dist/ai/source/BbConfirmPortal.md +9 -4
- package/dist/ai/source/BbDatePicker.md +71 -22
- package/dist/ai/source/BbDatePickerInput.md +72 -9
- package/dist/ai/source/BbDialog.md +45 -2
- package/dist/ai/source/BbDropdown.md +263 -63
- package/dist/ai/source/BbDropdownButton.md +27 -2
- package/dist/ai/source/BbDropdownGroup.md +121 -59
- package/dist/ai/source/BbForm.md +73 -6
- package/dist/ai/source/BbGallery.md +76 -55
- package/dist/ai/source/BbHost.md +12 -0
- package/dist/ai/source/BbHoverCard.md +7 -0
- package/dist/ai/source/BbHoverCardPortal.md +9 -5
- package/dist/ai/source/BbNumberInput.md +22 -16
- package/dist/ai/source/BbOffCanvas.md +48 -2
- package/dist/ai/source/BbPopover.md +7 -0
- package/dist/ai/source/BbPopoverPortal.md +9 -5
- package/dist/ai/source/BbRadio.md +4 -3
- package/dist/ai/source/BbRadioGroup.md +19 -10
- package/dist/ai/source/BbSelect.md +35 -20
- package/dist/ai/source/BbSelectPopover.md +116 -8
- package/dist/ai/source/BbSwitchGroup.md +11 -4
- package/dist/ai/source/BbTable.md +126 -32
- package/dist/ai/source/BbTag.md +10 -3
- package/dist/ai/source/BbTimePicker.md +69 -15
- package/dist/ai/source/BbTimePickerInput.md +45 -7
- package/dist/ai/source/BbToast.md +16 -2
- package/dist/ai/source/BbToastPortal.md +18 -6
- package/dist/ai/source/BbTree.md +1 -1
- package/dist/ai/source/CommonFieldInput.md +11 -5
- package/dist/ai/source/CommonPopover.md +28 -2
- package/dist/ai/source/FlatListBox.md +26 -5
- package/dist/ai/source/GroupedListBox.md +63 -11
- package/dist/ai/source/ListBox.md +4 -0
- package/dist/ai/source/OptionsContainer.md +29 -11
- package/dist/components/BbAlert/BbAlert.vue_vue_type_script_setup_true_lang.js +31 -26
- package/dist/components/BbAvatar/BbAvatar.vue.d.ts +1 -0
- package/dist/components/BbAvatar/BbAvatar.vue_vue_type_script_setup_true_lang.js +61 -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 +80 -79
- package/dist/components/BbBreadcrumbs/BbBreadcrumbs.vue_vue_type_script_setup_true_lang.js +152 -158
- 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 +235 -234
- package/dist/components/BbCalendar/types.d.ts +2 -2
- package/dist/components/BbCalendar/useDayGrid.js +120 -123
- package/dist/components/BbCalendar/useDayjsLocale.js +11 -8
- package/dist/components/BbCarousel/BbCarousel.vue_vue_type_script_setup_true_lang.js +7 -7
- 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 +239 -223
- package/dist/components/BbColorPalette/types.d.ts +8 -1
- package/dist/components/BbConfirm/BbConfirmPortal.vue.d.ts +2 -4
- package/dist/components/BbConfirm/types.d.ts +5 -0
- package/dist/components/BbDatePicker/BbDatePicker.vue.d.ts +4 -2
- package/dist/components/BbDatePicker/BbDatePicker.vue_vue_type_script_setup_true_lang.js +160 -143
- package/dist/components/BbDatePicker/types.d.ts +9 -2
- package/dist/components/BbDatePickerInput/BbDatePickerInput.vue.d.ts +3 -1
- package/dist/components/BbDatePickerInput/BbDatePickerInput.vue_vue_type_script_setup_true_lang.js +483 -496
- package/dist/components/BbDatePickerInput/types.d.ts +7 -0
- package/dist/components/BbDialog/BbDialog.vue_vue_type_script_setup_true_lang.js +252 -236
- package/dist/components/BbDialog/leaveGhost.js +38 -0
- package/dist/components/BbDialog/overlayActions.js +34 -20
- package/dist/components/BbDropdown/AdaptiveDropdown.vue_vue_type_script_setup_true_lang.js +92 -87
- package/dist/components/BbDropdown/BbDropdown.vue.d.ts +3 -0
- package/dist/components/BbDropdown/BbDropdown.vue_vue_type_script_setup_true_lang.js +419 -368
- package/dist/components/BbDropdown/BbDropdownList.vue_vue_type_script_setup_true_lang.js +384 -340
- 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 +133 -119
- package/dist/components/BbDropdown/DropdownRow.vue_vue_type_script_setup_true_lang.js +73 -45
- package/dist/components/BbDropdown/normalizeGroups.js +6 -2
- package/dist/components/BbDropdown/ptKeys.generated.d.ts +8 -0
- package/dist/components/BbDropdown/types.d.ts +73 -58
- package/dist/components/BbDropdown/types.js +1 -0
- package/dist/components/BbDropdownButton/BbDropdownButton.vue.d.ts +2 -0
- package/dist/components/BbDropdownButton/BbDropdownButton.vue_vue_type_script_setup_true_lang.js +93 -72
- package/dist/components/BbDropdownButton/ptKeys.generated.d.ts +48 -0
- package/dist/components/BbDropdownButton/types.d.ts +13 -2
- package/dist/components/BbDropdownButton/types.js +2 -0
- package/dist/components/BbForm/BbForm.vue.d.ts +2 -21
- package/dist/components/BbForm/BbForm.vue_vue_type_script_setup_true_lang.js +229 -227
- package/dist/components/BbForm/types.d.ts +31 -0
- package/dist/components/BbGallery/BbGallery.vue_vue_type_script_setup_true_lang.js +318 -296
- package/dist/components/BbHost/BbHost.vue_vue_type_script_setup_true_lang.js +7 -1
- package/dist/components/BbHoverCard/BbHoverCardPortal.vue.d.ts +2 -5
- package/dist/components/BbHoverCard/types.d.ts +5 -0
- package/dist/components/BbNumberInput/BbNumberInput.vue_vue_type_script_setup_true_lang.js +10 -6
- package/dist/components/BbNumberInput/numberDisplay.js +102 -106
- package/dist/components/BbNumberInput/types.d.ts +4 -3
- package/dist/components/BbOffCanvas/BbOffCanvas.vue_vue_type_script_setup_true_lang.js +425 -409
- package/dist/components/BbPopover/BbPopoverPortal.vue.d.ts +2 -5
- package/dist/components/BbPopover/types.d.ts +5 -0
- package/dist/components/BbRadio/types.d.ts +4 -3
- package/dist/components/BbRadioGroup/BbRadioGroup.vue_vue_type_script_setup_true_lang.js +108 -106
- package/dist/components/BbRadioGroup/types.d.ts +4 -7
- package/dist/components/BbSelect/BbSelect.vue.d.ts +3 -1
- package/dist/components/BbSelect/BbSelect.vue_vue_type_script_setup_true_lang.js +167 -163
- package/dist/components/BbSelect/types.d.ts +23 -20
- package/dist/components/BbSelectPopover/BbSelectPopover.vue.d.ts +3 -1
- package/dist/components/BbSelectPopover/BbSelectPopover.vue_vue_type_script_setup_true_lang.js +680 -637
- package/dist/components/BbSelectPopover/types.d.ts +10 -4
- 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 +1 -3
- package/dist/components/BbTable/BbTable.vue_vue_type_script_setup_true_lang.js +1182 -1165
- package/dist/components/BbTable/BbTableDataRow.js +96 -96
- package/dist/components/BbTable/types.d.ts +11 -10
- package/dist/components/BbTag/BbTag.vue_vue_type_script_setup_true_lang.js +9 -3
- package/dist/components/BbTimePicker/BbTimePicker.vue.d.ts +4 -2
- package/dist/components/BbTimePicker/BbTimePicker.vue_vue_type_script_setup_true_lang.js +157 -140
- package/dist/components/BbTimePicker/types.d.ts +9 -2
- package/dist/components/BbTimePickerInput/BbTimePickerInput.vue.d.ts +3 -1
- package/dist/components/BbTimePickerInput/BbTimePickerInput.vue_vue_type_script_setup_true_lang.js +278 -268
- package/dist/components/BbTimePickerInput/types.d.ts +7 -0
- package/dist/components/BbToast/BbToastMessage.vue_vue_type_script_setup_true_lang.js +12 -12
- package/dist/components/BbToast/BbToastPortal.vue.d.ts +2 -4
- package/dist/components/BbToast/types.d.ts +7 -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/CommonFieldInput/CommonFieldInput.vue_vue_type_script_setup_true_lang.js +36 -36
- package/dist/components/CommonPopover/CommonPopover.vue_vue_type_script_setup_true_lang.js +14 -2
- package/dist/components/CommonTimeSelector/useMeridiem.js +6 -6
- package/dist/components/FlatListBox/FlatListBox.vue_vue_type_script_setup_true_lang.js +115 -96
- package/dist/components/GroupedListBox/GroupedListBox.vue_vue_type_script_setup_true_lang.js +194 -166
- 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/composables/formSubmitLock.js +2 -1
- package/dist/composables/overlayRegistry.js +52 -42
- package/dist/composables/useActiveInactiveState.js +8 -4
- package/dist/composables/useBbDialog.js +5 -5
- package/dist/composables/useItemsGetter.js +34 -32
- package/dist/composables/useOpenModel.js +20 -0
- package/dist/composables/useOwnModel.js +16 -0
- package/dist/composables/useSegmentedFields.js +31 -20
- package/dist/deprecation/ai-deprecations.json.js +1 -1
- package/dist/i18n/currencyDigits.js +58 -0
- 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/i18n/regionDates.js +250 -0
- package/dist/i18n/regionHints.js +30 -41
- package/dist/icon-scan.js +68 -61
- package/dist/index.d.ts +35 -31
- package/dist/llms-full.txt +1428 -400
- package/dist/llms-medium.txt +8 -4
- package/dist/llms.txt +4 -2
- package/dist/locale-blueprint.json +2 -0
- package/dist/styles.css +2 -2
- package/dist/types/ActionButton.d.ts +2 -1
- package/dist/types/CommonProps.d.ts +8 -0
- package/dist/types/Option.d.ts +10 -0
- package/dist/types/ptComponentMap.d.ts +3 -3
- package/dist/utilities/functions/hash.js +97 -64
- package/dist/utilities/functions/isEqual.js +33 -25
- package/dist/utilities/functions/slotContent.js +19 -0
- package/dist/utils/loadRetry.js +8 -0
- package/dist/utils/versionCheck.js +1 -1
- package/dist/vite-plugin.d.ts +2 -1
- package/dist/vite.js +11 -4
- package/llms.txt +4 -2
- package/package.json +3 -2
- package/scripts/README.md +3 -1
- package/scripts/lib/adoption-checklist.json +6 -5
- package/scripts/lib/agent-manifest.mjs +33 -6
- package/scripts/lib/agent-setup.mjs +90 -24
- package/scripts/lib/cldr-pins.ts +182 -0
- package/scripts/lib/engines-include.d.mts +5 -0
- package/scripts/lib/engines-include.mjs +40 -0
- package/scripts/lib/eslint-plugin.mjs +8 -2
- package/scripts/lib/hidden-label-placeholder.mjs +25 -5
- package/scripts/lib/idiom-scan.mjs +30 -3
- package/scripts/lib/legacy-agent-files.json +152 -0
- package/scripts/lib/mcp-config.mjs +74 -7
- package/scripts/lib/portal-names.mjs +78 -8
- package/scripts/lib/release-results.mjs +5 -2
- package/scripts/lib/report.mjs +340 -0
- package/scripts/lib/run-beat.mjs +14 -0
- package/scripts/lib/run-records.mjs +313 -0
- package/scripts/lib/selector-log.mjs +98 -0
- package/scripts/lib/ticket-beat.mjs +30 -0
- package/scripts/lib/validate-bb-markup.mjs +37 -2
- package/dist/ai/manifest/components/BbAvatar.removed.json +0 -6
package/dist/llms-full.txt
CHANGED
|
@@ -1423,14 +1423,23 @@ around.
|
|
|
1423
1423
|
The avatar resolves what to show in a fixed order:
|
|
1424
1424
|
|
|
1425
1425
|
1. **Image** — when `src` (or `srcset`) is set and loads correctly.
|
|
1426
|
-
2. **Default slot** — when there is no source or the image fails:
|
|
1427
|
-
|
|
1428
|
-
3. **
|
|
1426
|
+
2. **Default slot** — when there is no source or the image fails: any markup
|
|
1427
|
+
of your own.
|
|
1428
|
+
3. **Initials from `name`** — no slot: the first letters of the first and the
|
|
1429
|
+
last word, uppercased with the locale's rules (`Ada King Lovelace` → `AL`,
|
|
1430
|
+
`Ada` → `A`). Words that don't start with a letter are skipped
|
|
1431
|
+
(`42 Ada` → `A`).
|
|
1432
|
+
4. **Built-in user icon** — no slot, and no `name` (or none of its words
|
|
1433
|
+
starts with a letter).
|
|
1429
1434
|
|
|
1430
1435
|
A failed load flips to the fallback automatically, and changing `src`/`srcset`
|
|
1431
|
-
resets the attempt — so swapping users in place retries the new photo.
|
|
1432
|
-
|
|
1433
|
-
|
|
1436
|
+
resets the attempt — so swapping users in place retries the new photo. Pass
|
|
1437
|
+
`name` for a person: it gives the initials and the accessible name. `alt`
|
|
1438
|
+
describes the photo and wins as the name when written.
|
|
1439
|
+
|
|
1440
|
+
```vue
|
|
1441
|
+
<BbAvatar :src="user.photoUrl" :name="user.fullName" color />
|
|
1442
|
+
```
|
|
1434
1443
|
|
|
1435
1444
|
**Photo, initials, and the built-in fallback**
|
|
1436
1445
|
|
|
@@ -1444,7 +1453,7 @@ accessible name.
|
|
|
1444
1453
|
src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Crect width='64' height='64' fill='%23fde2d4'/%3E%3Ccircle cx='32' cy='25' r='11' fill='%23b45a3c'/%3E%3Cpath d='M11 64c1-13 10-20 21-20s20 7 21 20z' fill='%23b45a3c'/%3E%3C/svg%3E"
|
|
1445
1454
|
alt="Ada Lovelace"
|
|
1446
1455
|
/>
|
|
1447
|
-
<BbAvatar size="56"
|
|
1456
|
+
<BbAvatar size="56" name="Grace Hopper" />
|
|
1448
1457
|
<BbAvatar size="56" alt="Unknown user" />
|
|
1449
1458
|
</div>
|
|
1450
1459
|
```
|
|
@@ -1477,36 +1486,53 @@ Composed demos below use the larger end of that range (and a few explicit px
|
|
|
1477
1486
|
sizes) so faces stay readable in Storybook — `xs`/`sm` are for dense chrome,
|
|
1478
1487
|
not hero examples.
|
|
1479
1488
|
|
|
1480
|
-
|
|
1481
|
-
`--bb-primary` behind, `--bb-primary-fg` for the initials/icon, the same
|
|
1482
|
-
pairing as a primary button — so
|
|
1483
|
-
|
|
1489
|
+
By default the fallback surface is **painted with the primary design token**
|
|
1490
|
+
— `--bb-primary` behind, `--bb-primary-fg` for the initials/icon, the same
|
|
1491
|
+
pairing as a primary button — so it matches your theme in light and dark.
|
|
1492
|
+
|
|
1493
|
+
### Colour per person: `color`
|
|
1494
|
+
|
|
1495
|
+
`color` tells people apart in a list (assignees, a comment thread). It is
|
|
1496
|
+
decoration, never state, so it is off by default:
|
|
1484
1497
|
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1498
|
+
- **`color` (`true`)** — one of ten palette hues, picked from a stable hash
|
|
1499
|
+
of `name`: the same person gets the same colour on every page, render and
|
|
1500
|
+
server render (no hydration repaint), whatever the case or spacing of the
|
|
1501
|
+
name. A soft fill with deep ink in light, a deep fill with light ink in
|
|
1502
|
+
dark; every pair clears 4.5:1. The palette is the `--bb-avatar-*` theme
|
|
1503
|
+
tokens (design-tokens guide § Avatar palette). Without `name` the avatar
|
|
1504
|
+
keeps the default look.
|
|
1505
|
+
- **A string** — any CSS colour or `var()`, used as the fill as is (a
|
|
1506
|
+
tenant's brand colour). The ink is black or white, whichever reads
|
|
1507
|
+
(`contrast-color()` where the browser has it, else picked from the
|
|
1508
|
+
colour's OKLCH lightness).
|
|
1509
|
+
|
|
1510
|
+
**Palette colours from names, and a brand colour**
|
|
1491
1511
|
|
|
1492
1512
|
```vue
|
|
1493
|
-
<
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1513
|
+
<div class="flex items-center gap-3">
|
|
1514
|
+
<BbAvatar size="40" name="Ada Lovelace" color />
|
|
1515
|
+
<BbAvatar size="40" name="Grace Hopper" color />
|
|
1516
|
+
<BbAvatar size="40" name="Alan Turing" color />
|
|
1517
|
+
<BbAvatar size="40" name="Katherine Johnson" color />
|
|
1518
|
+
<BbAvatar size="40" name="Acme Studio" color="#1e293b" />
|
|
1519
|
+
</div>
|
|
1499
1520
|
```
|
|
1500
1521
|
|
|
1522
|
+
The two component locals stay for anything else: `--bg` (fallback surface)
|
|
1523
|
+
and `--fg` (initials and slotted fallback). The built-in person glyph mixes
|
|
1524
|
+
`--fg` over `--bg`, so there is no third local. A pinned ink for a brand
|
|
1525
|
+
colour: `:style="{ '--fg': tenant.fg }"` beside `:color="tenant.color"`.
|
|
1526
|
+
|
|
1501
1527
|
**The size scale**
|
|
1502
1528
|
|
|
1503
1529
|
```vue
|
|
1504
1530
|
<div class="flex items-end gap-3">
|
|
1505
|
-
<BbAvatar size="md"
|
|
1506
|
-
<BbAvatar size="lg"
|
|
1507
|
-
<BbAvatar size="xl"
|
|
1508
|
-
<BbAvatar size="2xl"
|
|
1509
|
-
<BbAvatar size="56"
|
|
1531
|
+
<BbAvatar size="md" name="Joan Clarke" />
|
|
1532
|
+
<BbAvatar size="lg" name="Joan Clarke" />
|
|
1533
|
+
<BbAvatar size="xl" name="Joan Clarke" />
|
|
1534
|
+
<BbAvatar size="2xl" name="Joan Clarke" />
|
|
1535
|
+
<BbAvatar size="56" name="Joan Clarke" />
|
|
1510
1536
|
</div>
|
|
1511
1537
|
```
|
|
1512
1538
|
|
|
@@ -1667,9 +1693,7 @@ list — the row markup stays identical whether a member has a photo or not.
|
|
|
1667
1693
|
"
|
|
1668
1694
|
:variant="member.online ? 'success' : 'default'"
|
|
1669
1695
|
>
|
|
1670
|
-
<BbAvatar :
|
|
1671
|
-
{{ member.initials }}
|
|
1672
|
-
</BbAvatar>
|
|
1696
|
+
<BbAvatar color :name="member.name" size="40" :src="member.src" />
|
|
1673
1697
|
</BbIndicator>
|
|
1674
1698
|
<span class="flex min-w-0 flex-1 flex-col">
|
|
1675
1699
|
<span class="truncate font-medium">{{ member.name }}</span>
|
|
@@ -1703,11 +1727,10 @@ type Member = {
|
|
|
1703
1727
|
role: string;
|
|
1704
1728
|
online: boolean;
|
|
1705
1729
|
src?: string;
|
|
1706
|
-
initials?: string;
|
|
1707
1730
|
};
|
|
1708
1731
|
|
|
1709
|
-
// Some members have a photo; others fall back to initials
|
|
1710
|
-
//
|
|
1732
|
+
// Some members have a photo; the others fall back to the initials from
|
|
1733
|
+
// `name`, each in their own palette colour (`color`) — the same row markup.
|
|
1711
1734
|
const members: Member[] = [
|
|
1712
1735
|
{
|
|
1713
1736
|
name: 'Ada Lovelace',
|
|
@@ -1719,7 +1742,6 @@ const members: Member[] = [
|
|
|
1719
1742
|
name: 'Grace Hopper',
|
|
1720
1743
|
role: 'Design',
|
|
1721
1744
|
online: true,
|
|
1722
|
-
initials: 'GH',
|
|
1723
1745
|
},
|
|
1724
1746
|
{
|
|
1725
1747
|
name: 'Alan Turing',
|
|
@@ -1731,13 +1753,11 @@ const members: Member[] = [
|
|
|
1731
1753
|
name: 'Katherine Johnson',
|
|
1732
1754
|
role: 'Data',
|
|
1733
1755
|
online: true,
|
|
1734
|
-
initials: 'KJ',
|
|
1735
1756
|
},
|
|
1736
1757
|
{
|
|
1737
1758
|
name: 'Linus Torvalds',
|
|
1738
1759
|
role: 'Platform',
|
|
1739
1760
|
online: false,
|
|
1740
|
-
initials: 'LT',
|
|
1741
1761
|
},
|
|
1742
1762
|
];
|
|
1743
1763
|
|
|
@@ -1871,12 +1891,14 @@ keys.
|
|
|
1871
1891
|
### Restyling with passthrough
|
|
1872
1892
|
|
|
1873
1893
|
`pt` reaches each part with a class list — or, in the object form, a
|
|
1874
|
-
style and attributes. Parts: `root` (the avatar frame)
|
|
1875
|
-
user glyph). No states — nothing
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1894
|
+
style and attributes. Parts: `root` (the avatar frame), `initials` (the
|
|
1895
|
+
letters from `name`) and `icon` (the default user glyph). No states — nothing
|
|
1896
|
+
it paints is a state.
|
|
1897
|
+
|
|
1898
|
+
`initials` and `icon` exist only while the fallback shows (no image, or it
|
|
1899
|
+
failed) and the default slot is not overridden — `initials` with a `name`
|
|
1900
|
+
that gives letters, `icon` otherwise; when a photo or your own slot renders,
|
|
1901
|
+
they land nowhere. For the frame, `pt:root` is plain `class` with extra
|
|
1880
1902
|
letters: write `class` / `style` on the tag, as on any element. `pt:root`
|
|
1881
1903
|
stays for uniformity — the global map, the object form and a wrapper that
|
|
1882
1904
|
spreads props address every component the same way.
|
|
@@ -1941,10 +1963,11 @@ A `pt` value written in `<script>` (a constant, a preset, a wrapper's
|
|
|
1941
1963
|
|
|
1942
1964
|
### Gotchas & anti-patterns
|
|
1943
1965
|
|
|
1944
|
-
- **
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1966
|
+
- **Don't hash names into colours yourself** — `color` does it, stable and
|
|
1967
|
+
SSR-safe, from the themed palette. There is no `variant`: the default look
|
|
1968
|
+
follows `--bb-primary` / `--bb-primary-fg`.
|
|
1969
|
+
- **Don't type initials into the slot** when you have the name: `name` does
|
|
1970
|
+
it, locale-aware, and labels the avatar too.
|
|
1948
1971
|
- **Default `timeout` can false-fallback slow images** (see above) — tune it,
|
|
1949
1972
|
don't reimplement image loading around the component.
|
|
1950
1973
|
- Don't hand-position presence dots with absolute CSS — `BbIndicator dot`
|
|
@@ -1958,24 +1981,27 @@ A `pt` value written in `<script>` (a constant, a preset, a wrapper's
|
|
|
1958
1981
|
by the frame, so it follows.
|
|
1959
1982
|
- Don't pre-crop sources to circles — the component center-crops; ship square
|
|
1960
1983
|
or larger originals.
|
|
1961
|
-
- Don't leave `alt` empty for meaningful avatars: fallbacks
|
|
1962
|
-
accessible name entirely.
|
|
1984
|
+
- Don't leave both `name` and `alt` empty for meaningful avatars: fallbacks
|
|
1985
|
+
lose their accessible name entirely.
|
|
1963
1986
|
|
|
1964
1987
|
### Accessibility
|
|
1965
1988
|
|
|
1966
|
-
|
|
1967
|
-
component adds `role="img"` +
|
|
1968
|
-
|
|
1969
|
-
the
|
|
1970
|
-
|
|
1989
|
+
Set `name` (or `alt`). With an image, `alt` labels the photo (`name` when
|
|
1990
|
+
`alt` is empty); with a fallback the component adds `role="img"` +
|
|
1991
|
+
`aria-label` (`alt`, else `name`) to the fallback, so assistive tech
|
|
1992
|
+
announces the person, not the raw initials. With neither, the fallback
|
|
1993
|
+
renders with no role and no name — acceptable only for purely decorative
|
|
1994
|
+
avatars. A presence dot is decorative — make the same status
|
|
1971
1995
|
available in visible text or an adjacent label.
|
|
1972
1996
|
|
|
1973
1997
|
## Props
|
|
1974
1998
|
|
|
1975
1999
|
| Prop | Type | Default | Required | Description |
|
|
1976
2000
|
| --- | --- | --- | --- | --- |
|
|
1977
|
-
| `pt:<part>`, `pt:<part>:<state>`, `pt` | `PtValue` | | | Passthrough — a class list, or `{ class, style, attrs }`, bound to one named part of the component; the state form applies only while that state is on. Parts: `icon`, `root`. States: —. What each one is: _Passthrough parts and states_ below. `pt` is the object form with the same keys minus the prefix (`{ icon: '…', 'icon:loading': '…' }`). See `guides/passthrough.md`. In `<script>` a `pt` value is typed `BbAvatarProps['pt']` (`PtValue` is not exported): § Typing `pt` in `<script>`. |
|
|
1978
|
-
| `alt` | `string \| undefined` | `""` | | Alternative text for the image, used for accessibility. |
|
|
2001
|
+
| `pt:<part>`, `pt:<part>:<state>`, `pt` | `PtValue` | | | Passthrough — a class list, or `{ class, style, attrs }`, bound to one named part of the component; the state form applies only while that state is on. Parts: `icon`, `initials`, `root`. States: —. What each one is: _Passthrough parts and states_ below. `pt` is the object form with the same keys minus the prefix (`{ icon: '…', 'icon:loading': '…' }`). See `guides/passthrough.md`. In `<script>` a `pt` value is typed `BbAvatarProps['pt']` (`PtValue` is not exported): § Typing `pt` in `<script>`. |
|
|
2002
|
+
| `alt` | `string \| undefined` | `""` | | Alternative text for the image, used for accessibility. Without it the avatar is labelled with `name`. |
|
|
2003
|
+
| `color` | `string \| boolean \| undefined` | `false` | | Paints the fallback (initials or icon). `true`: a palette colour picked from `name`, stable across renders and the server. A string: any CSS colour or `var()` as the background, with black or white ink, whichever reads. Unset: the primary colour. |
|
|
2004
|
+
| `name` | `string \| undefined` | | | The person's name. With no image and no default slot, the avatar shows its initials (first letters of the first and last word; none: the person icon). Also the accessible name when `alt` is empty, and the input of `color`. |
|
|
1979
2005
|
| `size` | `number \| CssSize \| keyof Sizes \| undefined` | `"md"` | | Defines the component size. Accepted values: - A key from the provided size map (`keyof T`), e.g. `'sm' \| 'md' \| 'lg'` - A custom CSS size string (e.g. `'20px'`, `'1.5rem'`, `'2em'`) - A number, typically interpreted as pixels by size parsers |
|
|
1980
2006
|
| `sizes` | `string \| undefined` | | | Sizes attribute for the image, used with `srcset`. |
|
|
1981
2007
|
| `src` | `string \| undefined` | | | Source URL of the avatar image. |
|
|
@@ -1989,7 +2015,8 @@ available in visible text or an adjacent label.
|
|
|
1989
2015
|
| Part | What it is |
|
|
1990
2016
|
| --- | --- |
|
|
1991
2017
|
| `root` | The avatar frame, with the image or the fallback inside. |
|
|
1992
|
-
| `icon` | The default user glyph — rendered only while there is no image to show
|
|
2018
|
+
| `icon` | The default user glyph — rendered only while there is no image to show, the default slot is not overridden and `name` gives no initials, so it lands nowhere otherwise. |
|
|
2019
|
+
| `initials` | The initials from `name` — rendered only while there is no image to show and the default slot is not overridden. |
|
|
1993
2020
|
|
|
1994
2021
|
## Events
|
|
1995
2022
|
|
|
@@ -2009,6 +2036,7 @@ Set these on the element, or on a class you put on it, to retune this component
|
|
|
2009
2036
|
| `--fg` | `.bb-avatar` | `var(--bb-primary-fg)` | Initials; the built-in icon is an 80/20 mix of this toward --bg |
|
|
2010
2037
|
| `--default-icon-size` | `.bb-avatar` | `clamp(14px, calc(var(--size) * 0.7), 48px)` | Built-in fallback icon: 70% of the avatar, floored at 14px and capped at 48px. `--size` is the avatar's own box, set inline from the `size` prop. |
|
|
2011
2038
|
| `--fs` | `.bb-avatar` | `max(8px, calc(var(--size) * 0.4))` | Initials: 40% of the avatar, floored at 8px |
|
|
2039
|
+
| `--hue` | `.bb-avatar` | `0` | The palette hue `color` picks (a modifier class sets it). |
|
|
2012
2040
|
| `--elev` | `.bb-avatar` | `var(--bb-elev-sm)` | The theme's resting lift on small chrome, declared here so an ancestor's `--elev` cannot reach in; `--elev: none` flattens one. |
|
|
2013
2041
|
| `--size` | `.bb-avatar__default-icon` | `var(--default-icon-size)` | |
|
|
2014
2042
|
|
|
@@ -2021,7 +2049,7 @@ Set these on the element, or on a class you put on it, to retune this component
|
|
|
2021
2049
|
- **CSS custom properties** listed on a node are declared on THAT node's root and read by elements inside it. Set one on that node's root or on the element inside it that reads it — the pt part that lands there is how you reach it (`pt:box="[--border-color:…]"` on a text input) — never on `BbAvatar`'s root, where the node's own declaration masks it (design-tokens guide, _Overriding one from a consumer app_, rule 0).
|
|
2022
2050
|
- Listed nodes are the ones `BbAvatar`'s API reaches or that declare a documented CSS variable; the rest fold into "also mounts". The complete tree, undocumented locals included, is `manifest/components/BbAvatar.tree.json` (a public component in it is a name: its own tree file has the rest).
|
|
2023
2051
|
|
|
2024
|
-
- `BbAvatar` _(this component)_ — its own template binds: `icon` → `BbIcon`
|
|
2052
|
+
- `BbAvatar` _(this component)_ — its own template binds: `initials` → `span.bb-avatar__initials`, `icon` → `BbIcon`
|
|
2025
2053
|
- Also mounts `BbIcon`
|
|
2026
2054
|
|
|
2027
2055
|
## See Also
|
|
@@ -2064,8 +2092,8 @@ Set these on the element, or on a class you put on it, to retune this component
|
|
|
2064
2092
|
|
|
2065
2093
|
`BbBadge` is a small inline pill. Use it for a status label ("Active", "Beta"),
|
|
2066
2094
|
a short count, a removable token (`clearable`), a clickable chip (slot a
|
|
2067
|
-
`BbBadgeButton`), or all three at once. The label
|
|
2068
|
-
slot
|
|
2095
|
+
`BbBadgeButton`), or all three at once. The label goes in `text` or the
|
|
2096
|
+
**default slot** (the slot wins, as on `BbButton`).
|
|
2069
2097
|
|
|
2070
2098
|
Pick a sibling when the marker should do more:
|
|
2071
2099
|
|
|
@@ -2301,7 +2329,7 @@ hidden accessible name — always write it.
|
|
|
2301
2329
|
```
|
|
2302
2330
|
|
|
2303
2331
|
The slots named after the props (`#prepend:icon`, `#append:icon`)
|
|
2304
|
-
replace them and render inside the `icon` part, so `pt:icon`, `--icon-size`
|
|
2332
|
+
replace them (one that renders nothing falls back to the prop) and render inside the `icon` part, so `pt:icon`, `--icon-size`
|
|
2305
2333
|
and the loading spinner still apply. Their scope is the badge's states,
|
|
2306
2334
|
`{ activeLink, exactActiveLink, loading }`: a filter chip linking to a page
|
|
2307
2335
|
can show a solid glyph while that page is open. What you put in a slot is
|
|
@@ -2887,8 +2915,8 @@ A `pt` value written in `<script>` (a constant, a preset, a wrapper's
|
|
|
2887
2915
|
|
|
2888
2916
|
### Gotchas & anti-patterns
|
|
2889
2917
|
|
|
2890
|
-
- The label
|
|
2891
|
-
|
|
2918
|
+
- The label is `text` or the **default slot** (the slot wins). In button mode
|
|
2919
|
+
it moves to `BbBadgeButton`'s slot; don't write both.
|
|
2892
2920
|
- **`BbBadgeButton` must be a direct child** of the badge's default slot:
|
|
2893
2921
|
inside a wrapper element or your own component, the badge keeps its body —
|
|
2894
2922
|
a duplicated label and a button inside a button. Wrap the whole `BbBadge`
|
|
@@ -5532,10 +5560,10 @@ Set these on the element, or on a class you put on it, to retune this component
|
|
|
5532
5560
|
|
|
5533
5561
|
- `BbBreadcrumbs` _(this component)_ — its own template binds: `item` → `li.bb-breadcrumbs__item`, `icon` → `BbIcon`, `text` → `span.bb-breadcrumbs__text`
|
|
5534
5562
|
- `BbBaseButton` _(public — [contract](https://llms-bitboss-ui.bitboss.it/dist/ai/BbBaseButton.md))_ — its own pt parts (`BbBaseButton`): `root` → `RouterComponent`, `root` → `a`, `root` → `component`; also mounts `RouterComponent`
|
|
5535
|
-
- `BbDropdown` _(public — [contract](https://llms-bitboss-ui.bitboss.it/dist/ai/BbDropdown.md))_ — its own pt parts (`BbDropdown`): `panel` → `CommonPopover`, `root` → `CommonPopover`, `header` → `div.bb-dropdown__header`, `list` → `span.bb-dropdown__list`, `footer` → `div.bb-dropdown__footer`; documented CSS variables: `--menu-inset`; also mounts `CommonPopover`, `DropdownPipelineResolver`
|
|
5563
|
+
- `BbDropdown` _(public — [contract](https://llms-bitboss-ui.bitboss.it/dist/ai/BbDropdown.md))_ — its own pt parts (`BbDropdown`): `panel` → `CommonPopover`, `root` → `CommonPopover`, `header` → `div.bb-dropdown__header`, `list` → `span.bb-dropdown__list`, `footer` → `div.bb-dropdown__footer`; documented CSS variables: `--menu-inset`; also mounts `CommonPopover`, `DropdownFailures`, `DropdownPipelineResolver`
|
|
5536
5564
|
- `BbDropdownList` _(internal — not importable, reach it through `BbDropdown`)_ — also mounts `BbIcon`, `ErrorIcon`, `CommonPopover`, `BbDropdownList`
|
|
5537
5565
|
- `BbBadge` _(public — [contract](https://llms-bitboss-ui.bitboss.it/dist/ai/BbBadge.md))_ — its own pt parts (`BbBadge`): `spinner` → `BbSpinner`, `icon` → `span.bb-badge__append-icon`, `icon` → `BbIcon`, `clear` → `button.bb-badge__clear`; documented CSS variables: `--bg`, `--fg`, `--bw`, `--ring-color`, `--ring-size`, `--min-size-md`, `--min-size`, `--elev`, `--r`, `--fs`, `--icon-size`, `--gap`, `--px`, `--clear-size`, `--bg-disabled`, `--fg-disabled`, `--border-disabled`, `--pad-left`; also mounts `BbIcon`, `BbSpinner`, `BadgeBodyContent`
|
|
5538
|
-
- `AdaptiveDropdown` _(internal — not importable, reach it through `BbDropdown`)_ — hands `BbOffCanvas` the pt map `{ header: 'header', footer: 'footer', panel: 'root', sheet: 'root' }` (ours → theirs); also mounts `BbSmoothHeight`, `BbDropdownList`
|
|
5566
|
+
- `AdaptiveDropdown` _(internal — not importable, reach it through `BbDropdown`)_ — hands `BbOffCanvas` the pt map `{ header: 'header', footer: 'footer', panel: 'root', sheet: 'root' }` (ours → theirs); also mounts `BbSmoothHeight`, `BbDropdownList`, `DropdownFailures`
|
|
5539
5567
|
- `BbOffCanvas` _(public — [contract](https://llms-bitboss-ui.bitboss.it/dist/ai/BbOffCanvas.md))_ — its own pt parts (`BbOffCanvas`): `header` → `div.bb-offcanvas__header`, `title` → `span.bb-offcanvas__title`, `description` → `p.bb-offcanvas__description`, `close` → `CloseButton`, `content` → `div.bb-offcanvas__content`, `footer` → `div.bb-offcanvas__footer`; documented CSS variables: `--stack-x`, `--snap-y`, `--stack-fill`, `--stack-transition-duration`, `--px`, `--handle-w`, `--handle-h`, `--handle-bg`, `--safe-top`, `--close-size`
|
|
5540
5568
|
- `CloseButton` _(internal — not importable, reach it through `BbOffCanvas`)_ — documented CSS variables: `--size`, `--p`, `--icon-size`; also mounts `BbIcon`
|
|
5541
5569
|
- `BbButton` _(public — [contract](https://llms-bitboss-ui.bitboss.it/dist/ai/BbButton.md))_ — its own pt parts (`BbButton`): `root` → `BbBaseButton`, `spinner` → `BbSpinner`, `icon` → `span.bb-button__prepend-icon`, `icon` → `BbIcon`, `text` → `span.bb-button__text`, `icon` → `span.bb-button__append-icon`; documented CSS variables: `--h-xs`, `--h`, `--icon-size`, `--px`, `--ipx`, `--fs`, `--r`, `--gap`, `--bg`, `--bg-hover`, `--bg-pressed`, `--fg`, `--border-color`, `--ring-color`, `--ring-size`, `--bw`, `--fg-hover`, `--border-hover`, `--fg-pressed`, `--border-pressed`, `--bg-disabled`, `--fg-disabled`, `--border-disabled`, `--opacity-disabled`, `--elev-tier`, `--elev`; also mounts `BbBaseButton`, `BbSpinner`, `BbIcon`
|
|
@@ -5979,8 +6007,8 @@ a `local:` file in your `iconDir`, not a hand-made icon component wrapped in a
|
|
|
5979
6007
|
|
|
5980
6008
|
To change the glyph with the button's state (a filled star while a toggle is
|
|
5981
6009
|
on, a solid icon on the current page's link), use the slot named after the
|
|
5982
|
-
prop: `#prepend:icon`, `#append:icon`. The slot replaces the prop
|
|
5983
|
-
renders inside the `icon` part, so `pt:icon`, `--icon-size` and the loading
|
|
6010
|
+
prop: `#prepend:icon`, `#append:icon`. The slot replaces the prop (one that
|
|
6011
|
+
renders nothing falls back to it) and renders inside the `icon` part, so `pt:icon`, `--icon-size` and the loading
|
|
5984
6012
|
spinner work as they do on the prop's glyph. Its scope is the button's states:
|
|
5985
6013
|
`{ activeLink, exactActiveLink, pressed, loading, disabled }`. What you put in
|
|
5986
6014
|
it is yours: a `BbIcon` takes the part's size, anything else you size.
|
|
@@ -7247,7 +7275,8 @@ or a time rail with no single value to edit.
|
|
|
7247
7275
|
|
|
7248
7276
|
The value is typed `string | string[] | null` in every mode. `v-model` needs
|
|
7249
7277
|
nothing: bind a `ref<string | null>` for one date, a `ref<string[]>` for a
|
|
7250
|
-
range or `multiple`.
|
|
7278
|
+
range or `multiple`. With no `v-model` at all the calendar keeps the picked value itself, like a
|
|
7279
|
+
native input, and still emits `update:modelValue`. An explicit `@update:model-value` handler narrows in one
|
|
7251
7280
|
line:
|
|
7252
7281
|
|
|
7253
7282
|
```ts no-check
|
|
@@ -7302,8 +7331,11 @@ const summary = computed(() => {
|
|
|
7302
7331
|
</script>
|
|
7303
7332
|
```
|
|
7304
7333
|
|
|
7305
|
-
With
|
|
7306
|
-
a
|
|
7334
|
+
With one month, the greyed days of the neighbouring months that fill its
|
|
7335
|
+
first and last weeks are ordinary days: a click (or Enter / Space on one)
|
|
7336
|
+
picks it, single, range or multiple alike, and the view moves to its month.
|
|
7337
|
+
`min`, `max` and `selectable` disable them like any other day. With more than
|
|
7338
|
+
one month, those days are left blank: a date belongs to one grid only.
|
|
7307
7339
|
|
|
7308
7340
|
### `type` — what you are picking
|
|
7309
7341
|
|
|
@@ -7809,7 +7841,7 @@ the page is `BbDatePicker`.
|
|
|
7809
7841
|
## v-model
|
|
7810
7842
|
|
|
7811
7843
|
- `v-model:activeSegment` — type: `BbCalendarSegment \| undefined`
|
|
7812
|
-
- `v-model` — type: `string \| string[] \| null`
|
|
7844
|
+
- `v-model` — type: `string \| string[] \| null \| undefined`
|
|
7813
7845
|
- `v-model:time` — type: `string \| string[] \| null \| undefined`
|
|
7814
7846
|
|
|
7815
7847
|
## Props
|
|
@@ -7825,7 +7857,7 @@ the page is `BbDatePicker`.
|
|
|
7825
7857
|
| `floating` | `boolean \| undefined` | `false` | | Emit plain calendar strings instead of zoned ISO instants. Implied (and forced) by `type="week"`, `type="month"` and `type="year"`. |
|
|
7826
7858
|
| `max` | `string \| undefined` | | | Maximum selectable value, in this `type`'s shape (as `min`). A finer bound is ceiled to the unit, with a warning. With `datetime`, on its own day the time rail disables the times after it. |
|
|
7827
7859
|
| `min` | `string \| undefined` | | | Minimum selectable value in this `type`'s shape (`YYYY-MM-DD`, `…THH:mm` with `datetime`, `YYYY-MM` / `YYYY` with `month` / `year`; a week or a date with `week`, whole weeks only). A finer bound is floored to the unit, with a warning. With `datetime` the rail disables the earlier times on its day. |
|
|
7828
|
-
| `modelValue` | `string \| string[] \| null` | |
|
|
7860
|
+
| `modelValue` | `string \| string[] \| null \| undefined` | | | v-model: `null` when empty, a string, a `[start, end]` pair with `range`, or a sorted array with `multiple`. The string is `YYYY-MM-DD` when `floating` (`YYYY-Www` / `YYYY-MM` / `YYYY` for `week` / `month` / `year`), otherwise a zoned ISO instant (carrying the time under `datetime`). |
|
|
7829
7861
|
| `multiple` | `boolean` | `false` | | Multi-selection: each pick toggles a value in a sorted array (days, weeks, months or years). Needs an array `modelValue` (`[]` when empty, never `null`). Throws with `range` or `type="datetime"`. |
|
|
7830
7862
|
| `numberOfMonths` | `number \| undefined` | `1` | | How many months show side by side (day grids only). The keyboard crosses from one month into the next, and the arrows page all of them at once. Too narrow for them all, the months wrap onto the next row. |
|
|
7831
7863
|
| `range` | `boolean` | `false` | | Enables range selection (`[start, end]`). |
|
|
@@ -10674,8 +10706,9 @@ called with one context object — `BbCheckboxGroupItemsContext`: `reason`
|
|
|
10674
10706
|
`'model'` when the model changed from outside and the options cannot resolve
|
|
10675
10707
|
it), `modelValue` and `signal`; a group has no search field, so no `query`.
|
|
10676
10708
|
While it resolves, `loading-text` (or the `#loading` slot) shows; `empty-text`
|
|
10677
|
-
(or `#empty`) covers the empty result, and `failed-text`
|
|
10678
|
-
|
|
10709
|
+
(or `#empty`) covers the empty result, and `failed-text` words the failure
|
|
10710
|
+
row of a load that threw (it ends with a built-in "Try again"; `#empty` never
|
|
10711
|
+
renders for a failure). Loading, cancellation and race protection are
|
|
10679
10712
|
built in — don't wrap the provider in your own `loading` ref or debounce.
|
|
10680
10713
|
|
|
10681
10714
|
Tie the option set to external state with `dependencies` (debounced by
|
|
@@ -10985,7 +11018,7 @@ for a preset that fits any row type (never `<any>`), not an imported
|
|
|
10985
11018
|
| `itemLayout` | `FieldLayout \| undefined` | `'auto'` | | How each row's input and label sit together, in the `layout` keywords: `'auto'`, `'vertical'`, `'horizontal'`, `'label-fill'`, `'input-fill'`, or a two-word ratio pattern like `'xx xxxxx'`. |
|
|
10986
11019
|
| `itemProps` | `BbOptionGroupItemProps<T> \| undefined` | | | ADDITIONAL row fields, never the text or value: `description`, a muted line under the label (it may wrap; announced as the option's description). An object of paths or getters, or a function of the item; nothing is read implicitly. |
|
|
10987
11020
|
| `itemReverse` | `boolean \| undefined` | `undefined` | | Swaps each row's input and label from their natural order (input first), in every `item-layout`. `reverse` swaps the legend and the options instead. |
|
|
10988
|
-
| `items` | `T[] \| ((context: BbCheckboxGroupItemsContext) => T[] \| Promise<T[]>)` | | yes | The options: an array, or a provider called with
|
|
11021
|
+
| `items` | `T[] \| ((context: BbCheckboxGroupItemsContext) => T[] \| Promise<T[]>)` | | yes | The options: an array, or a provider called with `{ reason, modelValue, signal }`, sync or async. A provider fails by THROWING, never by returning `[]`: the rows clear and the failure row shows `failed-text` with "Try again". |
|
|
10989
11022
|
| `itemText` | `ItemAccessor<T, string> \| undefined` | `own `label`, else `text`, else `JSON.stringify(item)`` | | Defines a path that returns a property of the object to use as text or a function that returns a string. Unset: own `label`, else `text` (`{ label, value }` needs no accessor). |
|
|
10990
11023
|
| `itemValue` | `ItemAccessor<T> \| undefined` | `own `value`, else the whole item` | | Defines a path that returns a property of the object to use as value or a function that returns any value. Unset: own `value`, even `null`. |
|
|
10991
11024
|
| `labelAlign` | `'center'` \| `'top'` \| `'bottom'` | | | Vertical position of the label block in a side-by-side row; not `labelPosition`, the horizontal one. Omitted, `'top'`. |
|
|
@@ -11063,7 +11096,7 @@ States are listed in precedence order: when two are on at once and their entries
|
|
|
11063
11096
|
|
|
11064
11097
|
- `append` — scope: `object` — Content rendered after the last option, inside the options container.
|
|
11065
11098
|
- `description` — scope: `BbCheckboxGroupDescriptionSlotProps` `{ text: string; hasErrors: boolean; hasWarnings: boolean }` — Replaces the description text. Provided alone (no `description` prop) it still renders the description region and wires it into `aria-describedby`.
|
|
11066
|
-
- `empty` — scope: `
|
|
11099
|
+
- `empty` — scope: `object` — Content shown when no options are available (replaces the default "no data" text). Empty only: a failed load shows the library's failure row instead (its message is `failed-text`, and it ends with "Try again").
|
|
11067
11100
|
- `icon` — scope: `BbCheckboxGroupIconSlotProps<T>` `{ disabled: boolean; readonly: boolean; checked: boolean; indeterminate?: boolean; focused: boolean; focusVisible: boolean; id: string; name: string; falseValue: any; hasErrors: boolean; hasWarnings: boolean; parsedValue: string; trueValue: any; value: any; item: T; text: string }` — Replaces the default checkmark icon for each checkbox option.
|
|
11068
11101
|
- `label` — scope: `BbCheckboxGroupLabelSlotProps<T>` `{ item: T; text: string; checked: boolean; description: string }` — Replaces the default label text for each option.
|
|
11069
11102
|
- `legend` — scope: `BbCheckboxGroupLegendSlotProps` `{ showAsterisk?: boolean; text: string; hasErrors: boolean; hasWarnings: boolean }` — Replaces the default fieldset legend text for the group.
|
|
@@ -12185,6 +12218,15 @@ styles the sheet's root only. For what is inside it (header, title, ✕, body)
|
|
|
12185
12218
|
no part of the input reaches there, so put a `pt` in `offCanvasProps`
|
|
12186
12219
|
(passthrough guide § Inside the sheet).
|
|
12187
12220
|
|
|
12221
|
+
### Opening from code: `v-model:open`
|
|
12222
|
+
|
|
12223
|
+
`v-model` is the value; `v-model:open` is whether the palette is open. Bound,
|
|
12224
|
+
your ref opens and closes it, and every open and close the user makes is
|
|
12225
|
+
written back: a pick, Escape, a click outside, the phone sheet's own dismiss. A static `:open` with no
|
|
12226
|
+
listener is only the initial state. An open from code is the same open a
|
|
12227
|
+
click makes, and `disabled` / `readonly` refuse it (the ref is set back
|
|
12228
|
+
to `false`).
|
|
12229
|
+
|
|
12188
12230
|
### Events
|
|
12189
12231
|
|
|
12190
12232
|
Beyond `update:modelValue` (see value format above), the native input events are
|
|
@@ -12393,6 +12435,7 @@ A `pt` value written in `<script>` (a constant, a preset, a wrapper's
|
|
|
12393
12435
|
## v-model
|
|
12394
12436
|
|
|
12395
12437
|
- `v-model` — type: `string \| null \| undefined`
|
|
12438
|
+
- `v-model:open` — type: `boolean \| undefined`
|
|
12396
12439
|
|
|
12397
12440
|
## Props
|
|
12398
12441
|
|
|
@@ -12426,6 +12469,7 @@ A `pt` value written in `<script>` (a constant, a preset, a wrapper's
|
|
|
12426
12469
|
| `modelValue` | `string \| null \| undefined` | `null` | | Used by v-model. |
|
|
12427
12470
|
| `name` | `string \| undefined` | | | Defines the name of the input. |
|
|
12428
12471
|
| `offCanvasProps` | `Partial<BbOffCanvasProps> \| undefined` | | | Props for the phone sheet (the `BbOffCanvas` that `adaptive` renders on mobile), spread over its defaults. A `pt` inside it styles only the sheet (passthrough guide § Inside the sheet). The sheet hides its ✕; `{ hideClose: false }` brings it back. |
|
|
12472
|
+
| `open` | `boolean \| undefined` | `false` | | Whether the panel is open (`v-model:open`; `v-model` stays the value). Bound, the app opens and closes it; unbound, the initial state. |
|
|
12429
12473
|
| `persistentHint` | `boolean \| undefined` | `false` | | Keeps the hint displayed. |
|
|
12430
12474
|
| `placeholder` | `string \| undefined` | | | Text shown while the field is empty. |
|
|
12431
12475
|
| `prepend:icon` | `string \| undefined` | | | Name of the icon to be added at the start of the input. |
|
|
@@ -12497,6 +12541,7 @@ States are listed in precedence order: when two are on at once and their entries
|
|
|
12497
12541
|
- `show` — `(): void` — Emitted as soon as the palette (the popover, or the sheet on a phone) starts to open.
|
|
12498
12542
|
- `shown` — `(): void` — Emitted once the palette is open and its open transition has finished.
|
|
12499
12543
|
- `update:modelValue` — `(value: string \| null): void` — Emitted when the value becomes a valid hex color via typing/masking, when the field is cleared, or when the palette selects a color. Emits: - `#RRGGBB` (or `#RRGGBBAA` when `alpha` is enabled) for valid values - `null` when cleared
|
|
12544
|
+
- `update:open` — `(value: boolean): void` — The panel opened or closed (`v-model:open`).
|
|
12500
12545
|
|
|
12501
12546
|
## Slots
|
|
12502
12547
|
|
|
@@ -12606,11 +12651,10 @@ gradient, hue or alpha handle, and once per swatch/eyedropper pick. Treat it
|
|
|
12606
12651
|
like an `input`-frequency event: cheap handlers, or debounce your own
|
|
12607
12652
|
persistence.
|
|
12608
12653
|
|
|
12609
|
-
|
|
12610
|
-
|
|
12611
|
-
|
|
12612
|
-
|
|
12613
|
-
nothing is chosen yet.
|
|
12654
|
+
Seed a bound model as `ref<string | null>(null)`: `null` is the "no color
|
|
12655
|
+
yet" value, and renders an "empty" trigger (nothing painted). With no
|
|
12656
|
+
`v-model` at all the palette keeps the picked color itself, like a native
|
|
12657
|
+
input, and still emits `update:modelValue` on every change.
|
|
12614
12658
|
|
|
12615
12659
|
**The palette never emits `null`** — every selection is a concrete hex — so
|
|
12616
12660
|
`null` is an _inbound_ value only. Once the user picks a colour there is no
|
|
@@ -13083,10 +13127,12 @@ popover ↔ sheet.
|
|
|
13083
13127
|
|
|
13084
13128
|
### Open state, disabled and readonly
|
|
13085
13129
|
|
|
13086
|
-
|
|
13087
|
-
|
|
13088
|
-
|
|
13089
|
-
|
|
13130
|
+
Clicking the activator toggles the palette; a pick, Escape or a click outside
|
|
13131
|
+
closes it, and the slot's `open` flag shows the state for styling (a caret, a
|
|
13132
|
+
highlight). To open it from code, bind `v-model:open` (`v-model` stays the
|
|
13133
|
+
color): your ref opens and closes it, and every close is written back. A
|
|
13134
|
+
static `:open` with no listener is only the initial state. Two props gate
|
|
13135
|
+
interaction:
|
|
13090
13136
|
|
|
13091
13137
|
- `disabled` — blocks the activator entirely (no open). The trigger gets
|
|
13092
13138
|
`disabled` and `aria-disabled="true"` — through the slot's `props`, or set on
|
|
@@ -13278,10 +13324,10 @@ A `pt` value written in `<script>` (a constant, a preset, a wrapper's
|
|
|
13278
13324
|
swatches/gradient as the primary path.
|
|
13279
13325
|
- **Alpha mismatch** — without `alpha`, an incoming `#RRGGBBAA` value can't be
|
|
13280
13326
|
represented; enable `alpha` wherever 8-digit values occur.
|
|
13281
|
-
- **
|
|
13282
|
-
|
|
13283
|
-
- **
|
|
13284
|
-
|
|
13327
|
+
- **Start a bound model at `null`**, not `undefined`: `null` is the empty
|
|
13328
|
+
value the palette reports back.
|
|
13329
|
+
- **Open it from code with `v-model:open`**, not by clicking the activator
|
|
13330
|
+
from a script; `disabled` / `readonly` refuse that open too.
|
|
13285
13331
|
|
|
13286
13332
|
### Accessibility
|
|
13287
13333
|
|
|
@@ -13299,7 +13345,8 @@ A `pt` value written in `<script>` (a constant, a preset, a wrapper's
|
|
|
13299
13345
|
|
|
13300
13346
|
## v-model
|
|
13301
13347
|
|
|
13302
|
-
- `v-model` — type: `string \| null`
|
|
13348
|
+
- `v-model` — type: `string \| null \| undefined`
|
|
13349
|
+
- `v-model:open` — type: `boolean \| undefined`
|
|
13303
13350
|
|
|
13304
13351
|
## Props
|
|
13305
13352
|
|
|
@@ -13316,9 +13363,10 @@ A `pt` value written in `<script>` (a constant, a preset, a wrapper's
|
|
|
13316
13363
|
| `eager` | `boolean \| undefined` | `false` | | Renders the palette panel at mount instead of on the first open (the phone sheet's too). |
|
|
13317
13364
|
| `eyeDropper` | `boolean \| undefined` | `false` | | Show an eyedropper button inside the palette to sample any color on screen. Uses the native EyeDropper API — hidden automatically on unsupported browsers. |
|
|
13318
13365
|
| `label` | `string \| undefined` | | | Accessible label. The activator is named by it followed by the activator's own text, through `aria-labelledby`. Defaults to the locale string for "Open color picker" when omitted. |
|
|
13319
|
-
| `modelValue` | `string \| null` | |
|
|
13366
|
+
| `modelValue` | `string \| null \| undefined` | | | v-model: the current color as a `#RRGGBB` hex string (or `#RRGGBBAA` when `alpha` is enabled), or `null` when empty. |
|
|
13320
13367
|
| `offCanvasProps` | `Partial<BbOffCanvasProps> \| undefined` | | | Props for the phone sheet (the `BbOffCanvas` that `adaptive` renders on mobile), spread over its defaults. A `pt` inside it styles only the sheet (passthrough guide § Inside the sheet). The sheet hides its ✕; `{ hideClose: false }` brings it back. |
|
|
13321
13368
|
| `offset` | `number \| undefined` | `4` | | Space the floating container will maintain from the activator. |
|
|
13369
|
+
| `open` | `boolean \| undefined` | `false` | | Whether the panel is open (`v-model:open`; `v-model` stays the value). Bound, the app opens and closes it; unbound, the initial state. |
|
|
13322
13370
|
| `padding` | `number \| undefined` | `6` | | Minimum empty space to keep from the edge of the page |
|
|
13323
13371
|
| `placement` | `Placement \| undefined` | | | Position of the overlay in respect to the related activator. |
|
|
13324
13372
|
| `readonly` | `boolean \| undefined` | `false` | | Prevent opening the palette while keeping the activator visible. |
|
|
@@ -13350,6 +13398,7 @@ States are listed in precedence order: when two are on at once and their entries
|
|
|
13350
13398
|
- `show` — `(): void` — Emitted as soon as the palette (the popover, or the sheet on a phone) starts to open.
|
|
13351
13399
|
- `shown` — `(): void` — Emitted once the palette is open and its open transition has finished.
|
|
13352
13400
|
- `update:modelValue` — `(value: string): void` — Emitted when a color is picked. Payload is a concrete `#RRGGBB` (or `#RRGGBBAA` when alpha is enabled) — the palette always emits a color, never `null`.
|
|
13401
|
+
- `update:open` — `(value: boolean): void` — The panel opened or closed (`v-model:open`).
|
|
13353
13402
|
|
|
13354
13403
|
## Slots
|
|
13355
13404
|
|
|
@@ -14447,7 +14496,7 @@ States are listed in precedence order: when two are on at once and their entries
|
|
|
14447
14496
|
|
|
14448
14497
|
## Slots
|
|
14449
14498
|
|
|
14450
|
-
- `default` — scope: `BbConfirmPortalSlotProps
|
|
14499
|
+
- `default` — scope: `BbConfirmPortalSlotProps<any>` `{ data: P; ok: () => void; cancel: () => void }` — The confirm's body.
|
|
14451
14500
|
|
|
14452
14501
|
## See Also
|
|
14453
14502
|
|
|
@@ -14533,7 +14582,8 @@ const due = ref<string | null>(null);
|
|
|
14533
14582
|
|
|
14534
14583
|
The value is typed `string | string[] | null` in every mode. `v-model` needs
|
|
14535
14584
|
nothing: bind a `ref<string | null>` for one date, a `ref<string[]>` for a
|
|
14536
|
-
range or `multiple`.
|
|
14585
|
+
range or `multiple`. With no `v-model` at all the picker keeps the picked value itself, like a
|
|
14586
|
+
native input, and still emits `update:modelValue`. An explicit `@update:model-value` handler narrows in one
|
|
14537
14587
|
line:
|
|
14538
14588
|
|
|
14539
14589
|
```ts no-check
|
|
@@ -14812,6 +14862,15 @@ Reach for the **component** (slot or `activator` prop) when you want the
|
|
|
14812
14862
|
the directive is the shortcut for the bare-trigger cell case, not a replacement
|
|
14813
14863
|
for the component's `v-model` in a form.
|
|
14814
14864
|
|
|
14865
|
+
### Opening from code: `v-model:open`
|
|
14866
|
+
|
|
14867
|
+
`v-model` is the value; `v-model:open` is whether the calendar is open. Bound,
|
|
14868
|
+
your ref opens and closes it, and every open and close the user makes is
|
|
14869
|
+
written back: a pick, Escape, a click outside, the phone sheet's own dismiss. A static `:open` with no
|
|
14870
|
+
listener is only the initial state. An open from code is the same open a
|
|
14871
|
+
click makes, and `disabled` / `readonly` refuse it (the ref is set back
|
|
14872
|
+
to `false`).
|
|
14873
|
+
|
|
14815
14874
|
### Relationship to BbDatePickerInput
|
|
14816
14875
|
|
|
14817
14876
|
`BbDatePickerInput` _is_ a `BbDatePicker` with a segmented text field wrapped
|
|
@@ -14923,7 +14982,8 @@ and digit typeahead; the time rail exposes labelled columns. Always pass a
|
|
|
14923
14982
|
## v-model
|
|
14924
14983
|
|
|
14925
14984
|
- `v-model:activeSegment` — type: `BbCalendarSegment \| undefined`
|
|
14926
|
-
- `v-model` — type: `string \| string[] \| null`
|
|
14985
|
+
- `v-model` — type: `string \| string[] \| null \| undefined`
|
|
14986
|
+
- `v-model:open` — type: `boolean \| undefined`
|
|
14927
14987
|
- `v-model:time` — type: `string \| string[] \| null \| undefined`
|
|
14928
14988
|
|
|
14929
14989
|
## Props
|
|
@@ -14946,11 +15006,12 @@ and digit typeahead; the time rail exposes labelled columns. Always pass a
|
|
|
14946
15006
|
| `label` | `string \| undefined` | | | Accessible label. The activator is named by it followed by the activator's own text ("Due date 12 Sep"), through `aria-labelledby`. |
|
|
14947
15007
|
| `max` | `string \| undefined` | | | Maximum selectable value, in this `type`'s shape. A finer bound is accepted and ceiled to the unit, with a warning (`week`: as `min`). |
|
|
14948
15008
|
| `min` | `string \| undefined` | | | Minimum selectable value, in this `type`'s shape — `YYYY-MM-DD` (`YYYY-MM-DDTHH:mm` with `datetime`, `YYYY-MM` with `month`, `YYYY` with `year`; a week or a date with `week`, whole weeks only). A finer bound is accepted and floored to the unit, with a warning. |
|
|
14949
|
-
| `modelValue` | `string \| string[] \| null` | |
|
|
15009
|
+
| `modelValue` | `string \| string[] \| null \| undefined` | | | v-model: `null` when empty, a string, a `[start, end]` pair with `range`, or a sorted array with `multiple`. The string is `YYYY-MM-DD` when `floating` (`YYYY-Www` / `YYYY-MM` / `YYYY` for `week` / `month` / `year`), otherwise a zoned ISO instant (carrying the time under `datetime`). |
|
|
14950
15010
|
| `multiple` | `boolean` | `false` | | Multi-selection: each pick toggles a value in a sorted array (days, weeks, months or years), and the panel stays open until dismissed. Needs an array `modelValue` (`[]` when empty, never `null`). Throws with `range` or `type="datetime"`. |
|
|
14951
15011
|
| `numberOfMonths` | `number \| undefined` | `1` | | How many months the popover shows side by side (day grids only); the phone sheet always shows one. Too narrow for them all, the months wrap. |
|
|
14952
15012
|
| `offCanvasProps` | `Partial<BbOffCanvasProps> \| undefined` | | | Props for the phone sheet (the `BbOffCanvas` that `adaptive` renders on mobile), spread over its defaults. A `pt` inside it styles only the sheet (passthrough guide § Inside the sheet). The sheet hides its ✕; `{ hideClose: false }` brings it back. |
|
|
14953
15013
|
| `offset` | `number \| undefined` | `4` | | Space the popover keeps from the activator. |
|
|
15014
|
+
| `open` | `boolean \| undefined` | `false` | | Whether the panel is open (`v-model:open`; `v-model` stays the value). Bound, the app opens and closes it; unbound, the initial state. |
|
|
14954
15015
|
| `padding` | `number \| undefined` | | | Minimum empty space to keep from the edge of the page. |
|
|
14955
15016
|
| `placement` | `'start'` \| `'end'` \| `'top'` \| `'bottom'` \| `'left'` \| `'right'` \| `'top-start'` \| `'top-end'` \| `'right-start'` \| `'right-end'` \| `'bottom-start'` \| `'bottom-end'` \| `'left-start'` \| `'left-end'` \| `'start-start'` \| `'start-end'` \| `'end-start'` \| `'end-end'` | | | Position of the popover relative to the activator/anchor. |
|
|
14956
15017
|
| `range` | `boolean` | `false` | | Enables range selection (`[start, end]`). |
|
|
@@ -15010,6 +15071,7 @@ States are listed in precedence order: when two are on at once and their entries
|
|
|
15010
15071
|
- `time-pick` — `(payload: { unit: TimeUnit; value: string; }): void` — Relay of the raw time-rail pick. An embedding host binds this to run its own value engine; clean consumers ignore it and use `update:time`.
|
|
15011
15072
|
- `update:activeSegment` — `(value: BbCalendarSegment): void` — The active range end changed (range + `type="datetime"` only).
|
|
15012
15073
|
- `update:modelValue` — `(value: string \| string[] \| null): void` — Emitted when the selected date value changes (single/range/null).
|
|
15074
|
+
- `update:open` — `(value: boolean): void` — The panel opened or closed (`v-model:open`).
|
|
15013
15075
|
- `update:time` — `(value: string \| string[] \| null): void` — Companion time model, alongside every change while `type="datetime"`.
|
|
15014
15076
|
|
|
15015
15077
|
## Slots
|
|
@@ -15247,6 +15309,8 @@ line: `if (!Array.isArray(value)) return;` before treating it as the range.
|
|
|
15247
15309
|
For a window that often crosses the month line, `:number-of-months="2"` shows
|
|
15248
15310
|
two months side by side in the popover (one in the phone sheet). If the
|
|
15249
15311
|
popover doesn't have room for both, the second month wraps under the first.
|
|
15312
|
+
With one month, the greyed days of the previous and next month are pickable
|
|
15313
|
+
too: clicking one picks it and moves the calendar to its month.
|
|
15250
15314
|
|
|
15251
15315
|
**Booking — two months in the popover**
|
|
15252
15316
|
|
|
@@ -15329,7 +15393,9 @@ and parses its own digits. Any other attribute lands on the field root; a
|
|
|
15329
15393
|
|
|
15330
15394
|
`min` and `max` (each a `YYYY-MM-DD` string) constrain the selectable window;
|
|
15331
15395
|
days outside it render disabled in the calendar, and a typed out-of-range date is
|
|
15332
|
-
snapped back on commit.
|
|
15396
|
+
snapped back on commit. A value your app sets past a bound (on mount or later)
|
|
15397
|
+
stays as it is while nobody touches the field; once the user focuses it and
|
|
15398
|
+
leaves, it snaps like a typed one. **Malformed `min`/`max` throw during setup** on purpose,
|
|
15333
15399
|
to catch config mistakes early — always pass the `YYYY-MM-DD` shape.
|
|
15334
15400
|
|
|
15335
15401
|
For non-contiguous rules (no weekends, no holidays, only in-stock slots), pass a
|
|
@@ -15837,6 +15903,15 @@ const from = ref<string | null>('2026-05-01');
|
|
|
15837
15903
|
</script>
|
|
15838
15904
|
```
|
|
15839
15905
|
|
|
15906
|
+
### Opening from code: `v-model:open`
|
|
15907
|
+
|
|
15908
|
+
`v-model` is the value; `v-model:open` is whether the calendar is open. Bound,
|
|
15909
|
+
your ref opens and closes it, and every open and close the user makes is
|
|
15910
|
+
written back: a pick, Escape, a click outside, the phone sheet's own dismiss. A static `:open` with no
|
|
15911
|
+
listener is only the initial state. An open from code is the same open a
|
|
15912
|
+
click makes, and `disabled` / `readonly` refuse it (the ref is set back
|
|
15913
|
+
to `false`).
|
|
15914
|
+
|
|
15840
15915
|
### Events & v-model
|
|
15841
15916
|
|
|
15842
15917
|
Because the control is a composite (segmented fields + calendar + optional
|
|
@@ -16041,6 +16116,7 @@ label>')` matches nothing; query each segment by its own label instead. See
|
|
|
16041
16116
|
## v-model
|
|
16042
16117
|
|
|
16043
16118
|
- `v-model` — type: `string \| string[] \| null \| undefined`
|
|
16119
|
+
- `v-model:open` — type: `boolean \| undefined`
|
|
16044
16120
|
- `v-model:time` — type: `string \| string[] \| null \| undefined`
|
|
16045
16121
|
|
|
16046
16122
|
## Props
|
|
@@ -16081,6 +16157,7 @@ label>')` matches nothing; query each segment by its own label instead. See
|
|
|
16081
16157
|
| `name` | `string \| undefined` | | | Defines the name of the input. |
|
|
16082
16158
|
| `numberOfMonths` | `number \| undefined` | `1` | | How many months the calendar popover shows side by side (day grids only); the phone sheet always shows one. Too narrow for them all, the months wrap. |
|
|
16083
16159
|
| `offCanvasProps` | `Partial<BbOffCanvasProps> \| undefined` | | | Props for the phone sheet (the `BbOffCanvas` that `adaptive` renders on mobile), spread over its defaults. A `pt` inside it styles only the sheet (passthrough guide § Inside the sheet). The sheet hides its ✕; `{ hideClose: false }` brings it back. |
|
|
16160
|
+
| `open` | `boolean \| undefined` | `false` | | Whether the panel is open (`v-model:open`; `v-model` stays the value). Bound, the app opens and closes it; unbound, the initial state. |
|
|
16084
16161
|
| `persistentHint` | `boolean \| undefined` | `false` | | Keeps the hint displayed. |
|
|
16085
16162
|
| `placeholder` | `string \| undefined` | | | Text shown while the field is empty. |
|
|
16086
16163
|
| `prepend:icon` | `string \| undefined` | | | Name of the icon to be added at the start of the input. |
|
|
@@ -16169,6 +16246,7 @@ States are listed in precedence order: when two are on at once and their entries
|
|
|
16169
16246
|
- `show` — `(): void` — Emitted as soon as the calendar surface starts to open (the popover, or the sheet on a phone).
|
|
16170
16247
|
- `shown` — `(): void` — Emitted once the calendar surface is open and its open transition has finished.
|
|
16171
16248
|
- `update:modelValue` — `(value: string \| string[] \| null): void` — Emitted whenever the selected date value changes. Payload is `null` for cleared values, a single string for single-date mode, or a two-element array for range mode.
|
|
16249
|
+
- `update:open` — `(value: boolean): void` — The panel opened or closed (`v-model:open`).
|
|
16172
16250
|
- `update:time` — `(value: string \| string[] \| null): void` — Companion time model (`v-model:time`), emitted alongside every value change while `type="datetime"` is on. Always 24-hour `HH:mm` (or `HH:mm:ss` with `seconds`); `null` when cleared, an array in range mode.
|
|
16173
16251
|
|
|
16174
16252
|
## Slots
|
|
@@ -16583,6 +16661,13 @@ const replace = (saved: Member) => {
|
|
|
16583
16661
|
| `'server'` | `show()` called during a server render: nothing opens there |
|
|
16584
16662
|
|
|
16585
16663
|
- On Android, the system back button closes the top dialog like Escape (it is the browser's close request), so `prevent-close` and a saving form refuse it the same way; iOS swipe-back and the desktop back button are page navigation.
|
|
16664
|
+
- **A dialog removed while open** (a `v-if` on the row its `@complete`
|
|
16665
|
+
deleted, a route change) still plays its close and hands focus back. An
|
|
16666
|
+
async `@complete` that removed it still decides the result: completed
|
|
16667
|
+
when it succeeds, else `'unmounted'`. So `v-if="item"` on the dialog is
|
|
16668
|
+
fine. In your own tests, the page stays inert for that close (its
|
|
16669
|
+
`transition-duration`), as for any close: wait for focus to come back
|
|
16670
|
+
before a `focus()`. Clicks driven by Playwright wait on their own.
|
|
16586
16671
|
- It settles when the close **starts**, together with `@hide`, so a list can
|
|
16587
16672
|
update while the dialog fades out. It never rejects and never hangs. A
|
|
16588
16673
|
refused close settles nothing, and a `complete` after a dismissal is
|
|
@@ -16983,12 +17068,16 @@ onClick }`.
|
|
|
16983
17068
|
- **`ok`** runs its `onClick` when written, then completes. Without one, it
|
|
16984
17069
|
submits the `BbForm` inside (validation first; an invalid form stays
|
|
16985
17070
|
open), and a successful save completes with what it resolved, else the
|
|
16986
|
-
form's values. Enter in a field completes the same way
|
|
16987
|
-
more: it completes with `data`.
|
|
17071
|
+
form's values. Enter in a field completes the same way (`ok` is the form's
|
|
17072
|
+
submit button). No form, or two or more: it completes with `data`.
|
|
16988
17073
|
- **`cancel`** runs its `onClick`, then closes as a dismissal
|
|
16989
17074
|
(`reason: 'close'`); refused while a save locks the dialog.
|
|
16990
17075
|
- **`actions`** replaces both: an array of button configs, each running its
|
|
16991
17076
|
`onClick`, then completing with `data`. `false`: none.
|
|
17077
|
+
- **While one button's `onClick` runs or a form inside saves, the others
|
|
17078
|
+
ignore clicks** without greying out (the running one spins); Cancel is
|
|
17079
|
+
refused like the ✕.
|
|
17080
|
+
Buttons of your own `#footer` are yours to handle.
|
|
16992
17081
|
- **`false` from an `onClick`** keeps the dialog open; a throw keeps it open
|
|
16993
17082
|
and is reported once (a `BbValidationError` never is).
|
|
16994
17083
|
- **`ok` is never disabled until the form is valid**: the user submits, the
|
|
@@ -17356,8 +17445,9 @@ import { BbDialog, BbForm, BbTextInput } from 'bitboss-ui';
|
|
|
17356
17445
|
|
|
17357
17446
|
type Role = { id?: number; name: string };
|
|
17358
17447
|
const props = defineProps<{ role?: Role }>();
|
|
17359
|
-
// A 422 rejects with the field errors; the form shows them.
|
|
17360
|
-
|
|
17448
|
+
// A 422 rejects with the field errors; the form shows them. The slot's
|
|
17449
|
+
// `data` is untyped, so the form hands back a plain record.
|
|
17450
|
+
const save = (values: Record<string, unknown>) =>
|
|
17361
17451
|
props.role
|
|
17362
17452
|
? api.put(`/roles/${props.role.id}`, values)
|
|
17363
17453
|
: api.post('/roles', values);
|
|
@@ -18234,13 +18324,13 @@ An `items` entry is one of three shapes, and you can mix them freely:
|
|
|
18234
18324
|
|
|
18235
18325
|
- a **menu item** — an object with a `value` and a `label`; a string or
|
|
18236
18326
|
number row is its own text and value (`items: ['Google', 'Bing']`);
|
|
18237
|
-
- a **
|
|
18238
|
-
|
|
18327
|
+
- a **divider run** — a nested `[ … ]` array: its rows, with a divider before
|
|
18328
|
+
and after, and nothing else (no title, no value of its own);
|
|
18239
18329
|
- a **group object** — `{ id, label?, items, selectable?, … }`, a titled and/or
|
|
18240
|
-
selectable
|
|
18330
|
+
selectable group (described below). A group with plain rows and no
|
|
18241
18331
|
`selectable` needs `group: true` to be a group rather than a submenu row;
|
|
18242
|
-
[
|
|
18243
|
-
`groupBy`, which
|
|
18332
|
+
[Headings](#headings-group-true-or-groupby) compares it with
|
|
18333
|
+
`groupBy`, which puts the rows of one group under headings. A group's heading is its `label` too;
|
|
18244
18334
|
add `hideLabel` to keep the `label` for the adaptive sheet title / chips /
|
|
18245
18335
|
`useBbDropdown` while rendering no heading in the menu.
|
|
18246
18336
|
|
|
@@ -18349,7 +18439,7 @@ const items: BbDropdownItem[] = [
|
|
|
18349
18439
|
href: '#preview',
|
|
18350
18440
|
target: '_blank',
|
|
18351
18441
|
},
|
|
18352
|
-
// A nested array becomes its own divider
|
|
18442
|
+
// A nested array becomes its own divider run. A destructive
|
|
18353
18443
|
// item never acts directly: its onClick awaits useConfirm and only
|
|
18354
18444
|
// proceeds on a yes.
|
|
18355
18445
|
[
|
|
@@ -18646,8 +18736,9 @@ Behavior you can rely on:
|
|
|
18646
18736
|
- a change in a **single** group closes the menu and puts focus back on the
|
|
18647
18737
|
trigger: a pick (the same value included) or a `clearable` group's clear,
|
|
18648
18738
|
wherever the group sits (inside a submenu too) and whatever else the menu
|
|
18649
|
-
holds — a filter menu with a "Role" list and a "Deleted"
|
|
18650
|
-
closes after either
|
|
18739
|
+
holds — a filter menu with a "Role" list and a "Deleted" entry made a
|
|
18740
|
+
`clearable` single group closes after either (which on/off recipe to pick:
|
|
18741
|
+
see [Gotchas and anti-patterns](#gotchas-and-anti-patterns));
|
|
18651
18742
|
- a **multiple** group keeps the menu open while you toggle;
|
|
18652
18743
|
- `close-on-select` overrides both: `true` closes after every selection
|
|
18653
18744
|
change (a multiple pick included), `false` never closes on a selection.
|
|
@@ -18857,20 +18948,21 @@ rows distinct values when it matters:
|
|
|
18857
18948
|
- **Submenu parents.** A row that opens a submenu needs a value unique in the
|
|
18858
18949
|
whole menu; the flyout is addressed by it.
|
|
18859
18950
|
|
|
18860
|
-
###
|
|
18951
|
+
### Headings: `group: true` or `groupBy`
|
|
18861
18952
|
|
|
18862
18953
|
Two ways to put headings in a menu, for two different needs:
|
|
18863
18954
|
|
|
18864
|
-
- **Independent
|
|
18865
|
-
with `group: true` is
|
|
18866
|
-
|
|
18955
|
+
- **Independent groups, each its own chooser: `group: true`.** A group object
|
|
18956
|
+
with `group: true` is titled (its `label` is the heading) without being
|
|
18957
|
+
selectable; give it `selectable` and it becomes its own chooser. Each
|
|
18867
18958
|
group keeps **its own** value (its own companion and `v-model`) and, when
|
|
18868
|
-
`searchable`, its own search field. Use it for
|
|
18959
|
+
`searchable`, its own search field. Use it for groups that answer
|
|
18869
18960
|
different questions ("Sort by" / "Show").
|
|
18870
18961
|
- **One choice, sorted under headings: `groupBy` on one group.** The rows of a
|
|
18871
|
-
single group are listed under
|
|
18962
|
+
single group are listed under headings, and it stays one group:
|
|
18872
18963
|
**one** `v-model`, **one** search field. Use it when the headings only
|
|
18873
18964
|
organise the options of one question (categories under their sector).
|
|
18965
|
+
Its headings are sticky, as `BbSelect`'s group headers are.
|
|
18874
18966
|
|
|
18875
18967
|
```vue
|
|
18876
18968
|
<BbDropdown
|
|
@@ -18896,14 +18988,23 @@ Two ways to put headings in a menu, for two different needs:
|
|
|
18896
18988
|
- `groupBy` is a field path (`'sector'`, `'owner.team'`) read off each row,
|
|
18897
18989
|
or a function `(row) => string | null | undefined`. On a fetched group it
|
|
18898
18990
|
reads the **raw item**, so `items: ({ query }) => …` groups the same way.
|
|
18899
|
-
-
|
|
18900
|
-
`null`, `undefined` or `''` have no
|
|
18991
|
+
- Headings keep the order of their first row. Rows whose `groupBy` gives
|
|
18992
|
+
`null`, `undefined` or `''` have no heading: they are listed **first**,
|
|
18901
18993
|
before every heading — the same rule as `BbSelect`'s `group-by`.
|
|
18902
18994
|
- A heading is not a row: the arrows and typeahead skip it, and it is never
|
|
18903
|
-
selected. A search hides a
|
|
18904
|
-
|
|
18905
|
-
|
|
18906
|
-
|
|
18995
|
+
selected. A search hides a heading left without a matching row.
|
|
18996
|
+
- The rows under each heading are a `role="group"` labelled by it, with the
|
|
18997
|
+
look of a group title. The adaptive sheet shows the same headings.
|
|
18998
|
+
- `#group` replaces every heading's content, `#<groupId>:group` one group's,
|
|
18999
|
+
with `BbSelect`'s `#group` scope: `{ text, item, index, length, disabled }`
|
|
19000
|
+
(`item` is the raw `groupBy` value, `length` the rows under it, `disabled`
|
|
19001
|
+
whether all of them are). A count and a divider, for example:
|
|
19002
|
+
|
|
19003
|
+
```vue
|
|
19004
|
+
<template #category:group="{ text, length }">
|
|
19005
|
+
{{ text }} <span class="ms-auto text-xs">{{ length }}</span>
|
|
19006
|
+
</template>
|
|
19007
|
+
```
|
|
18907
19008
|
|
|
18908
19009
|
### Loading options on demand
|
|
18909
19010
|
|
|
@@ -18926,8 +19027,10 @@ The full grammar:
|
|
|
18926
19027
|
need the mapping. On a **`searchable`** group the context also carries
|
|
18927
19028
|
`query` (what the user typed, and `reason: 'search'` when they did) —
|
|
18928
19029
|
the same shape `BbSelect` passes, which is why one provider drops into both.
|
|
18929
|
-
A getter **throws** to fail: the
|
|
18930
|
-
|
|
19030
|
+
A getter **throws** to fail: the panel shows the group's failure row (an
|
|
19031
|
+
error icon, `failedText` and a "Try again" button that runs the failed call
|
|
19032
|
+
again with the same query) next to the menu, instead of "no data", even
|
|
19033
|
+
when `#empty` is slotted: `#empty` means empty.
|
|
18931
19034
|
- `itemText` / `itemValue` — a path string or getter producing each raw item's
|
|
18932
19035
|
label and value; without them a row reads its own `label` (else `text`) and
|
|
18933
19036
|
`value`. `v-model` on the companion surfaces the selected value(s);
|
|
@@ -18940,7 +19043,7 @@ The full grammar:
|
|
|
18940
19043
|
- `loadingText` / `emptyText` / `failedText` — placeholder row text per
|
|
18941
19044
|
group; the dropdown-level `loading-text` / `empty-text` / `failed-text` props
|
|
18942
19045
|
set the default for all groups, and the `#loading` / `#empty` slots (payload:
|
|
18943
|
-
`{ text, groupId, query }
|
|
19046
|
+
`{ text, groupId, query }`) replace the loading and empty placeholder
|
|
18944
19047
|
rows entirely. `query` is the group's search text (`''` without one), like
|
|
18945
19048
|
`BbSelect`'s `#empty="{ query }"`.
|
|
18946
19049
|
- `dependencies: [...]` + `depsDebounceTime` — re-run the getter (debounced)
|
|
@@ -19405,7 +19508,7 @@ What each knob does:
|
|
|
19405
19508
|
ranked search (case and accents ignored; exact, then starts-with, then word
|
|
19406
19509
|
starts, then contains, then a code typed without separators; one typo per
|
|
19407
19510
|
word of 5+ letters only when nothing else matched; ranked inside each
|
|
19408
|
-
`groupBy`
|
|
19511
|
+
`groupBy` heading), and on an async group passes the typed text to the getter as
|
|
19409
19512
|
`query` in its context object (`reason: 'search'`), the same shape
|
|
19410
19513
|
`BbSelect` uses, so one provider serves both.
|
|
19411
19514
|
- **`filterBy`** picks which raw fields the local search reads. Empty
|
|
@@ -19423,9 +19526,11 @@ What each knob does:
|
|
|
19423
19526
|
`searchable`, which is the one place the three-state `prefill` differs from a
|
|
19424
19527
|
plain menu group (`'interaction'`, the default, fetches when the group is
|
|
19425
19528
|
first reached; `true` fetches on mount).
|
|
19426
|
-
-
|
|
19427
|
-
|
|
19428
|
-
|
|
19529
|
+
- **`minQueryLength`** (as on `BbSelect`): below that many characters
|
|
19530
|
+
(trimmed) the query counts as empty, so no `'search'` call and no filtering
|
|
19531
|
+
run, and the field says how many characters to type (on a search-first
|
|
19532
|
+
group, its hint row too: "Type at least 2 characters"). Slots still get the
|
|
19533
|
+
typed `query`. No guard in the getter:
|
|
19429
19534
|
|
|
19430
19535
|
```vue
|
|
19431
19536
|
<BbDropdown
|
|
@@ -19436,15 +19541,12 @@ What each knob does:
|
|
|
19436
19541
|
searchable: true,
|
|
19437
19542
|
selectable: true,
|
|
19438
19543
|
prefill: false,
|
|
19544
|
+
minQueryLength: 2,
|
|
19439
19545
|
filterBy: false,
|
|
19440
|
-
items: ({ query }) =>
|
|
19546
|
+
items: ({ query }) => api.zones({ q: query }),
|
|
19441
19547
|
},
|
|
19442
19548
|
]"
|
|
19443
|
-
|
|
19444
|
-
<template #empty="{ query, text }">
|
|
19445
|
-
{{ query.length < 2 ? 'Type at least 2 characters' : text }}
|
|
19446
|
-
</template>
|
|
19447
|
-
</BbDropdown>
|
|
19549
|
+
/>
|
|
19448
19550
|
```
|
|
19449
19551
|
|
|
19450
19552
|
- **`stash`** accumulates the items behind _selected_ keys so they stay
|
|
@@ -19523,7 +19625,8 @@ when unsure, write `#[slotKey('Qualità')]` (`import { slotKey } from
|
|
|
19523
19625
|
| --- | --- |
|
|
19524
19626
|
| `#<value>`, `#<value>:prepend`, `#<value>:append` | one row — its content, leading or trailing region |
|
|
19525
19627
|
| `#<groupId>:item`, `#<groupId>:item:prepend`, `…:item:append` | **every row of that group**, and nothing else |
|
|
19526
|
-
| `#<groupId
|
|
19628
|
+
| `#<groupId>:label`, `#<groupId>:prepend`, `#<groupId>:append` | that group's title line — its content, leading or trailing |
|
|
19629
|
+
| `#group`, `#<groupId>:group` | the `groupBy` headings — every group's, or one group's |
|
|
19527
19630
|
| `item:prepend`, `item:append` | every row **and** every group title line, across the menu |
|
|
19528
19631
|
|
|
19529
19632
|
Each edge of a row has **one occupant** — nothing renders side by side. From
|
|
@@ -19538,7 +19641,9 @@ strongest to weakest:
|
|
|
19538
19641
|
| `item:prepend` | `item:append` |
|
|
19539
19642
|
| `prepend:icon` | `append:icon` |
|
|
19540
19643
|
|
|
19541
|
-
So a slot
|
|
19644
|
+
So a slot replaces the row's icon and the most specific slot wins. A slot
|
|
19645
|
+
that renders nothing for a row (its content behind a `v-if` that is false
|
|
19646
|
+
there) is skipped: the next one down draws, down to the row's own icon. A
|
|
19542
19647
|
row's own `#<value>:append` is written for that one row, so it may replace its
|
|
19543
19648
|
submenu chevron; the group-wide and shared append slots never do, so a submenu
|
|
19544
19649
|
row keeps its chevron unless you name it. The check beats everything — as in
|
|
@@ -19804,8 +19909,9 @@ Two things this replaces, both seen in real apps:
|
|
|
19804
19909
|
`v-else-if="clinicsById.get(item.value)"`) to tell a record row from an action
|
|
19805
19910
|
row, and a lookup map rebuilt from the fetch to get the record back. The
|
|
19806
19911
|
group row slot is the "which rows" answer; `item.meta` is the record.
|
|
19807
|
-
- **Re-drawing the other rows' icons
|
|
19808
|
-
|
|
19912
|
+
- **Re-drawing the other rows' icons** in a shared `item:prepend`. A shared
|
|
19913
|
+
slot that renders nothing for a row leaves that row its `prepend:icon`, but
|
|
19914
|
+
the group row slot never has to ask.
|
|
19809
19915
|
|
|
19810
19916
|
### Header and footer
|
|
19811
19917
|
|
|
@@ -19813,7 +19919,19 @@ Two things this replaces, both seen in real apps:
|
|
|
19813
19919
|
content above and below the scrolling items, each separated by a divider. Use
|
|
19814
19920
|
the header for a title or a filter field and the footer for a persistent
|
|
19815
19921
|
action — they stay put while the list scrolls. On the mobile sheet they become
|
|
19816
|
-
the sheet's pinned header and footer
|
|
19922
|
+
the sheet's pinned header and footer, and the footer takes the sheet's footer
|
|
19923
|
+
layout (BbOffCanvas § Header, footer and body): what you slot straight in is
|
|
19924
|
+
laid out as a row of buttons at the end, 8px apart, wrapping. To keep your own
|
|
19925
|
+
layout there (a full-width button, a hint beside an action), wrap the footer
|
|
19926
|
+
in one `<div>`: a single wrapping element stretches across the sheet and lays
|
|
19927
|
+
out its children itself. The example below does that, so the button spans the
|
|
19928
|
+
footer on both surfaces.
|
|
19929
|
+
|
|
19930
|
+
A note in the footer (a sentence, not a button) is text like any other: with
|
|
19931
|
+
the default `width="auto"` the menu grows to fit it, and it wraps only once
|
|
19932
|
+
the menu reaches the space it has, so a long note makes a wide menu over short
|
|
19933
|
+
rows. Set `width` on the dropdown (`:width="240"`) and the note wraps at that
|
|
19934
|
+
width instead. No zero-width wrapper or `nowrap` override is needed.
|
|
19817
19935
|
|
|
19818
19936
|
**Pinned header and footer**
|
|
19819
19937
|
|
|
@@ -19928,6 +20046,66 @@ const items: BbDropdownItem[] = [
|
|
|
19928
20046
|
</script>
|
|
19929
20047
|
```
|
|
19930
20048
|
|
|
20049
|
+
### Opening from code: `v-model`
|
|
20050
|
+
|
|
20051
|
+
`v-model` is whether the menu is open, as on `BbDialog` and `BbOffCanvas`.
|
|
20052
|
+
Bound, your flag controls it: set it to `true` and the menu opens at its
|
|
20053
|
+
activator (or at `anchor`, when there is no activator to open it), with focus
|
|
20054
|
+
on its first row, as a keyboard open; set it to `false` and it closes, focus
|
|
20055
|
+
going back to the activator (or to where it was). The user's opens and closes
|
|
20056
|
+
update the flag. A static `:model-value` with no listener is only the initial
|
|
20057
|
+
state: `:model-value="false"` starts closed, and the activator still opens it.
|
|
20058
|
+
|
|
20059
|
+
The case it is for: one menu's row opens another menu at the same place — a
|
|
20060
|
+
row menu's "Delegate to…" that opens a searchable people menu under the same
|
|
20061
|
+
button, or a dialog header action that opens a menu anchored to it:
|
|
20062
|
+
|
|
20063
|
+
```vue
|
|
20064
|
+
<script setup lang="ts">
|
|
20065
|
+
import { ref, useTemplateRef } from 'vue';
|
|
20066
|
+
const delegating = ref(false);
|
|
20067
|
+
const rowMenu = useTemplateRef('rowMenu');
|
|
20068
|
+
</script>
|
|
20069
|
+
|
|
20070
|
+
<template>
|
|
20071
|
+
<BbDropdown
|
|
20072
|
+
:items="[
|
|
20073
|
+
{ value: 'edit', label: 'Edit' },
|
|
20074
|
+
{
|
|
20075
|
+
value: 'delegate',
|
|
20076
|
+
label: 'Delegate to…',
|
|
20077
|
+
onClick: () => (delegating = true),
|
|
20078
|
+
},
|
|
20079
|
+
]"
|
|
20080
|
+
>
|
|
20081
|
+
<template #activator="{ props }">
|
|
20082
|
+
<BbButton ref="rowMenu" v-bind="props" icon-only prepend:icon="dots"
|
|
20083
|
+
>More</BbButton
|
|
20084
|
+
>
|
|
20085
|
+
</template>
|
|
20086
|
+
</BbDropdown>
|
|
20087
|
+
<BbDropdown
|
|
20088
|
+
v-model="delegating"
|
|
20089
|
+
:anchor="rowMenu"
|
|
20090
|
+
:items="[
|
|
20091
|
+
{
|
|
20092
|
+
id: 'people',
|
|
20093
|
+
label: 'People',
|
|
20094
|
+
selectable: true,
|
|
20095
|
+
searchable: true,
|
|
20096
|
+
items: searchPeople,
|
|
20097
|
+
},
|
|
20098
|
+
]"
|
|
20099
|
+
>
|
|
20100
|
+
<BbDropdownGroup id="people" v-model="assignee" />
|
|
20101
|
+
</BbDropdown>
|
|
20102
|
+
</template>
|
|
20103
|
+
```
|
|
20104
|
+
|
|
20105
|
+
The first menu closes as its row runs, and the second opens under the same
|
|
20106
|
+
button with focus inside it; Escape, an outside press or a pick closes it and
|
|
20107
|
+
sets `delegating` back to `false`.
|
|
20108
|
+
|
|
19931
20109
|
### Placement, width and boundaries
|
|
19932
20110
|
|
|
19933
20111
|
- `placement` (default `'bottom'`) accepts every floating-UI placement
|
|
@@ -19949,7 +20127,11 @@ const items: BbDropdownItem[] = [
|
|
|
19949
20127
|
edge away from the trigger, and only the viewport flips it) tune positioning.
|
|
19950
20128
|
Pass `boundary` a `useTemplateRef` or a selector, not `$refs.x`: `$refs` is
|
|
19951
20129
|
not reactive, so a menu in a table cell rendered before the ref was set keeps
|
|
19952
|
-
no boundary until that row happens to re-render. `
|
|
20130
|
+
no boundary until that row happens to re-render. Inside a `BbTable` (a row
|
|
20131
|
+
menu, a cell's ⋯) the default keeps the menu within the table's left and
|
|
20132
|
+
right edges only: it still opens below its trigger, or flips above at the
|
|
20133
|
+
viewport, never at the table's bottom. A `boundary` replaces that default
|
|
20134
|
+
entirely. `eager` pre-renders the panel
|
|
19953
20135
|
before first open; `transitionDuration` controls the open/close animation.
|
|
19954
20136
|
- The menu closes itself on outside click/focus, on `Escape`, when another
|
|
19955
20137
|
dropdown opens, and when the activator scrolls out of view. `disabled`
|
|
@@ -20130,8 +20312,11 @@ object form, a style and attributes — optionally only while a state is on.
|
|
|
20130
20312
|
Parts: `root` (the flyout — an invisible positioning wrapper, no node on
|
|
20131
20313
|
mobile), `panel` (the menu surface you see — background, border, radius and
|
|
20132
20314
|
shadow live here; the sheet itself on mobile), `sheet` (the bottom sheet the surface becomes on a phone — only that sheet, never the desktop surface; applied after `panel`, so it wins a conflict there),
|
|
20133
|
-
`header`, `footer`, `
|
|
20134
|
-
|
|
20315
|
+
`header`, `footer`, `box` (every `searchable` group's search box, around the
|
|
20316
|
+
field and its magnifier: what `box` is on a field — border, background and
|
|
20317
|
+
radius go here; on the flyout and the phone sheet alike), `input` (every
|
|
20318
|
+
`searchable` group's search field — a broadcast, on the flyout and the phone
|
|
20319
|
+
sheet alike; its magnifier is chrome),
|
|
20135
20320
|
`list` (the top-level entries container between the bands
|
|
20136
20321
|
— a flex column with a 1px gap; a submenu's list is not reached), `item` — every entry, submenus included, a broadcast
|
|
20137
20322
|
resolved per entry — and `itemText` / `itemIcon` / `itemDescription`, that
|
|
@@ -20468,11 +20653,10 @@ own sizes.
|
|
|
20468
20653
|
`<BbDropdownGroup>` companions; a button there opens nothing. Use
|
|
20469
20654
|
`<template #activator="{ props }">` + `v-bind="props"`, or `v-bb-dropdown`
|
|
20470
20655
|
(`bitboss-ui/dropdown-default-slot` and `check` report it).
|
|
20471
|
-
- **
|
|
20472
|
-
(
|
|
20473
|
-
|
|
20474
|
-
|
|
20475
|
-
fight in a loop.
|
|
20656
|
+
- **Open it from code with `v-model`, never with a hidden activator's
|
|
20657
|
+
`.click()`** (§ Opening from code). Don't reopen it from a `@focus` handler
|
|
20658
|
+
on the activator — closing returns focus there, and the two fight in a
|
|
20659
|
+
loop.
|
|
20476
20660
|
- **Don't navigate from `onClick`** (`router.push`, `window.location`) — give
|
|
20477
20661
|
the item `href`/`to` and let it render a real link.
|
|
20478
20662
|
- **Don't rebuild selection** with `onClick` + your own state — mark the group
|
|
@@ -20491,8 +20675,13 @@ own sizes.
|
|
|
20491
20675
|
- **An on/off entry ("Show deleted") is a selectable group too**, never an
|
|
20492
20676
|
action row with a check icon drawn in: a screen reader hears that as a plain
|
|
20493
20677
|
`menuitem`, with no state. Make it a `multiple` group of one row (a
|
|
20494
|
-
`menuitemcheckbox` with `aria-checked`), bound to a one-value array
|
|
20495
|
-
|
|
20678
|
+
`menuitemcheckbox` with `aria-checked`), bound to a one-value array. It
|
|
20679
|
+
stays open after the toggle, as checkbox items do. To close the menu after
|
|
20680
|
+
it, add `close-on-select` only when no other `multiple` group shares the
|
|
20681
|
+
menu: the prop is menu-wide, so every multiple group would close too. With
|
|
20682
|
+
one there, make the entry a `clearable` single group of one row instead
|
|
20683
|
+
(a change closes the menu, a second click clears it); it reads as a radio
|
|
20684
|
+
item, the one cost.
|
|
20496
20685
|
- **A server-searched group needs `filterBy: false`.** The default local
|
|
20497
20686
|
match runs on the getter's answer too, so a row the server matched on a field
|
|
20498
20687
|
the menu doesn't show (an email, a fiscal code) is fetched and then hidden.
|
|
@@ -20579,26 +20768,31 @@ uses `ArrowRight` / `ArrowLeft` and its back control; `Escape` on a drilled-in
|
|
|
20579
20768
|
level (row or search box) goes back one level, focus on the row that opened
|
|
20580
20769
|
it, and at the top level closes the sheet.
|
|
20581
20770
|
|
|
20771
|
+
## v-model
|
|
20772
|
+
|
|
20773
|
+
- `v-model` — type: `boolean \| undefined`
|
|
20774
|
+
|
|
20582
20775
|
## Props
|
|
20583
20776
|
|
|
20584
20777
|
| Prop | Type | Default | Required | Description |
|
|
20585
20778
|
| --- | --- | --- | --- | --- |
|
|
20586
|
-
| `pt:<part>`, `pt:<part>:<state>`, `pt` | `PtValue` | | | Passthrough — a class list, or `{ class, style, attrs }`, bound to one named part of the component; the state form applies only while that state is on. Parts: `check`, `footer`, `header`, `input`, `item`, `itemDescription`, `itemIcon`, `itemText`, `list`, `panel`, `root`, `sheet`, `submenu`. States: `activeLink`, `default`, `destructive`, `disabled`, `exactActiveLink`, `
|
|
20779
|
+
| `pt:<part>`, `pt:<part>:<state>`, `pt` | `PtValue` | | | Passthrough — a class list, or `{ class, style, attrs }`, bound to one named part of the component; the state form applies only while that state is on. Parts: `box`, `check`, `footer`, `header`, `input`, `item`, `itemDescription`, `itemIcon`, `itemText`, `list`, `panel`, `root`, `sheet`, `submenu`. States: `open`, `activeLink`, `default`, `destructive`, `disabled`, `exactActiveLink`, `selected`. What each one is: _Passthrough parts and states_ below. `pt` is the object form with the same keys minus the prefix (`{ icon: '…', 'icon:loading': '…' }`). See `guides/passthrough.md`. In `<script>` a `pt` value is typed `BbDropdownProps['pt']` (`PtValue` is not exported): § Typing `pt` in `<script>`. |
|
|
20587
20780
|
| `activator` | `ElementOrComponentRef \| undefined` | | | An external activator (element or component ref): the slot isn't rendered; the listeners and ARIA (`aria-haspopup` / `aria-expanded` / `aria-controls`) go on it, so don't add your own. |
|
|
20588
20781
|
| `adaptive` | `boolean \| undefined` | ``all.adaptive` (`true`)` | | On mobile (below `config.mobileMaxWidth`), renders the menu as a bottom sheet that drills into submenus one level at a time instead of hover flyouts; slots and selection are unchanged. Unset: the global `all.adaptive`. |
|
|
20589
20782
|
| `anchor` | `ElementOrComponentRef \| VirtualAnchor \| undefined` | `the activator element` | | What the panel positions against instead of the activator (e.g. a wrapper around it): an element, a component ref or a virtual box. It also sets a percentage `width`. Ignored with `placement="cursor"`. |
|
|
20590
|
-
| `boundary` | `string \| ElementOrComponentRef \| undefined` | | | Keeps the panel inside this element beside its trigger (sideways
|
|
20783
|
+
| `boundary` | `string \| ElementOrComponentRef \| undefined` | | | Keeps the panel inside this element beside its trigger (sideways under a menu); away from it only the viewport flips it. An element, component ref or CSS selector (a `useTemplateRef`, not `$refs.x`). Default in a `BbTable`: the table's left and right edges. |
|
|
20591
20784
|
| `closeOnSelect` | `boolean \| undefined` | `unset (close after a single-choice change)` | | Whether a selection closes the menu. Unset: a change in a single-choice group closes it (an untick too, at any depth); a `multiple` group stays open. `true`: every selection change closes it. `false`: none does. |
|
|
20592
20785
|
| `compact` | `boolean \| undefined` | `undefined` | | Compact density, the `BbSelect` ladder: flyout rows 28px → 24px, sheet rows 44px → 36px (a sheet row stays a touch target). The label size does not change. |
|
|
20593
20786
|
| `disabled` | `boolean \| undefined` | `false` | | Disables the component |
|
|
20594
20787
|
| `eager` | `boolean \| undefined` | `false` | | Renders the menu panel at mount instead of on the first open (the phone sheet's too), and keeps its rows after a close. Without it the rows mount on each open and go once the menu has closed. |
|
|
20595
|
-
| `emptyText` | `string \| undefined` | | |
|
|
20788
|
+
| `emptyText` | `string \| undefined` | | | A pipeline group's no-items row; its own `emptyText` wins. Default: `common.emptyText`. |
|
|
20596
20789
|
| `enforceCoherence` | `boolean \| undefined` | `false` | | Default for pipeline groups: drop selections that are no longer present in a group's current items (e.g. after a `dependencies` re-fetch) from the selection and `v-model`. A group's own `enforceCoherence` overrides this. |
|
|
20597
|
-
| `failedText` | `string \| undefined` | | |
|
|
20790
|
+
| `failedText` | `string \| undefined` | | | A pipeline group's failed-load row (its getter threw); its own `failedText` wins. Default: `common.failedText`. |
|
|
20598
20791
|
| `id` | `string \| undefined` | | | Names this dropdown: the activator's id (unless it already has one), the menu's `menu_<id>`, and the key `useBbDropdown(id)` and a companion `BbDropdownGroup` pair by. Generated when omitted. |
|
|
20599
|
-
| `items` | `(BbDropdownItem \| PrimitiveRow)[]` | `[]` | yes | The menu rows, each a `BbBaseButton` (`button`, `a` or `router-link`): a flat array for one group, nested arrays for divider-separated groups, or `InternalGroup` objects for titled / selectable
|
|
20792
|
+
| `items` | `(BbDropdownItem \| PrimitiveRow)[]` | `[]` | yes | The menu rows, each a `BbBaseButton` (`button`, `a` or `router-link`): a flat array for one group, nested arrays for divider-separated groups, or `InternalGroup` objects for titled / selectable groups. A row's own `items` opens a submenu. |
|
|
20600
20793
|
| `keepActivator` | `boolean \| undefined` | `false` | | Keeps the trigger when no row is visible (by default it is hidden): inert, no popup ARIA, `empty` in the activator slot. A `contextMenu` trigger always stays. |
|
|
20601
|
-
| `loadingText` | `string \| undefined` | | |
|
|
20794
|
+
| `loadingText` | `string \| undefined` | | | A pipeline group's loading row; its own `loadingText` wins. Default: `common.loadingText`. |
|
|
20795
|
+
| `modelValue` | `boolean \| undefined` | `undefined` | | Whether the menu is open (`v-model`): `true` opens it from code at its activator or `anchor`. Unbound: the initial state. |
|
|
20602
20796
|
| `offCanvasProps` | `Partial<BbOffCanvasProps> \| undefined` | | | Props for the phone sheet (the `BbOffCanvas` that `adaptive` renders on mobile), spread over its defaults. A `pt` inside it styles only the sheet (passthrough guide § Inside the sheet). The sheet hides its ✕; `{ hideClose: false }` brings it back. |
|
|
20603
20797
|
| `offset` | `number \| undefined` | `4` | | Space the floating container will maintain from the activator. |
|
|
20604
20798
|
| `padding` | `number \| undefined` | `10` | | Minimum empty space to keep from the edge of the page |
|
|
@@ -20619,6 +20813,7 @@ it, and at the top level closes the sheet.
|
|
|
20619
20813
|
| `sheet` | The bottom sheet the menu becomes on a phone (the `BbOffCanvas` root) — never the desktop surface. Applied after `panel`, so it wins a conflict there. |
|
|
20620
20814
|
| `header` | The menu's header band. |
|
|
20621
20815
|
| `footer` | The menu's footer band. |
|
|
20816
|
+
| `box` | Every searchable group's search box (field and magnifier), as `box` on a field; desktop and phone. |
|
|
20622
20817
|
| `input` | A searchable group's search field — a broadcast: it lands on every searchable group's field, desktop and phone alike. Its magnifier glyph is chrome. |
|
|
20623
20818
|
| `list` | The top-level items container between the bands — the node that lays the entries out (a flex column with a 1px gap; on a phone, the sheet's items container). A submenu's list is not reached. Groups, headings and dividers are not parts. |
|
|
20624
20819
|
| `item` | One menu entry, submenus included — a broadcast resolved per entry. Also takes a per-item function, called with the entry. |
|
|
@@ -20648,26 +20843,29 @@ States are listed in precedence order: when two are on at once and their entries
|
|
|
20648
20843
|
- `item:unselected` — `(value: any): void` — The user unselected a row (a multiple toggle, a `clearable` re-click, a chip ×, or the old value a single pick replaces). Payload is the item's resolved value, matching `item:selected`.
|
|
20649
20844
|
- `show` — `(): void` — Emitted as soon as the menu (the popover, or the sheet on a phone) starts to open.
|
|
20650
20845
|
- `shown` — `(): void` — Emitted once the menu is open and its open transition has finished.
|
|
20846
|
+
- `update:modelValue` — `(value: boolean): void` — The menu opened or closed (`v-model`): `true` on open, `false` on close.
|
|
20651
20847
|
|
|
20652
20848
|
## Slots
|
|
20653
20849
|
|
|
20654
20850
|
- `activator` — scope: `BbDropdownActivatorSlotProps` `{ disabled?: boolean; empty: boolean; loading: boolean; open: boolean; placement: Placement \| "cursor"; props: BbDropdownActivatorProps }` — The element that triggers the dropdown to open. Spread `props` onto your trigger element.
|
|
20655
20851
|
- `default` — scope: `any` — Hosts `<BbDropdownGroup>` companions. They register their group with the dropdown and render nothing themselves.
|
|
20656
|
-
- `empty` — scope: `BbDropdownPlaceholderSlotProps` `{ groupId?: string; query: string; text: string
|
|
20852
|
+
- `empty` — scope: `BbDropdownPlaceholderSlotProps` `{ groupId?: string; query: string; text: string }` — Replaces the default "no data" placeholder row shown in a pipeline group that resolved to no items. Rendered once per empty group. A failed load is not empty: it keeps its own row (the error icon and `failedText`).
|
|
20657
20853
|
- `footer` — scope: `BbDropdownEdgeSlotProps` `{ disabled?: boolean; open: boolean; placement: Placement \| "cursor" }` — Pinned below the rows, outside their scroll, with a divider — for action buttons.
|
|
20854
|
+
- `group` — scope: `BbDropdownGroupSlotProps` `{ text: string; item: unknown; index: number; length: number; disabled: boolean }` — Every group's `groupBy` headings (`BbSelect`'s `#group` scope); `#<groupId>:group` beats it.
|
|
20658
20855
|
- `header` — scope: `BbDropdownEdgeSlotProps` `{ disabled?: boolean; open: boolean; placement: Placement \| "cursor" }` — Pinned above the rows, outside their scroll, with a divider — for a title or a filter field.
|
|
20659
|
-
- `item:append` — scope: `BbDropdownItemSlotProps` `{ description?: string; disabled?: boolean; group: BbDropdownSlotGroup; groupTitle: boolean; level: number; index: number; item: InternalItem; loading: boolean; open: boolean; placement: Placement \| "cursor"; selected: boolean; label: string; activeLink?: boolean; exactActiveLink?: boolean }` — The trailing region of every row (and group title line), replacing its `append:icon
|
|
20660
|
-
- `item:prepend` — scope: `BbDropdownItemSlotProps` `{ description?: string; disabled?: boolean; group: BbDropdownSlotGroup; groupTitle: boolean; level: number; index: number; item: InternalItem; loading: boolean; open: boolean; placement: Placement \| "cursor"; selected: boolean; label: string; activeLink?: boolean; exactActiveLink?: boolean }` — The leading region of every row (and group title line), replacing its `prepend:icon
|
|
20661
|
-
- `loading` — scope: `BbDropdownPlaceholderSlotProps` `{ groupId?: string; query: string; text: string
|
|
20662
|
-
- `#<value>` (named from data) — scope: `BbDropdownItemSlotProps` — One row's content (label and description), by its value; in a fetched group, by its resolved `itemValue`. Reserved names (their slot is one of this component's own, so an item value or column key spelled like them is an error): `activator`, `default`, `empty`, `footer`, `header`, `item`, `loading`.
|
|
20856
|
+
- `item:append` — scope: `BbDropdownItemSlotProps` `{ description?: string; disabled?: boolean; group: BbDropdownSlotGroup; groupTitle: boolean; level: number; index: number; item: InternalItem; loading: boolean; open: boolean; placement: Placement \| "cursor"; selected: boolean; label: string; activeLink?: boolean; exactActiveLink?: boolean }` — The trailing region of every row (and group title line), replacing its `append:icon` wherever it renders. A named slot wins; the submenu chevron and the check on a selected row take its place.
|
|
20857
|
+
- `item:prepend` — scope: `BbDropdownItemSlotProps` `{ description?: string; disabled?: boolean; group: BbDropdownSlotGroup; groupTitle: boolean; level: number; index: number; item: InternalItem; loading: boolean; open: boolean; placement: Placement \| "cursor"; selected: boolean; label: string; activeLink?: boolean; exactActiveLink?: boolean }` — The leading region of every row (and group title line), replacing its `prepend:icon` wherever it renders. A named slot wins.
|
|
20858
|
+
- `loading` — scope: `BbDropdownPlaceholderSlotProps` `{ groupId?: string; query: string; text: string }` — Replaces the default loading placeholder row shown in a pipeline group while its async items load. Rendered once per loading group.
|
|
20859
|
+
- `#<value>` (named from data) — scope: `BbDropdownItemSlotProps` — One row's content (label and description), by its value; in a fetched group, by its resolved `itemValue`. Reserved names (their slot is one of this component's own, so an item value or column key spelled like them is an error): `activator`, `default`, `empty`, `footer`, `group`, `header`, `item`, `loading`.
|
|
20663
20860
|
- `#<value>:prepend` (named from data) — scope: `BbDropdownItemSlotProps` — One row's leading region; replaces its `prepend:icon`.
|
|
20664
20861
|
- `#<value>:append` (named from data) — scope: `BbDropdownItemSlotProps` — One row's trailing region; replaces its `append:icon` and its submenu chevron. The check takes its place on the selected row.
|
|
20665
20862
|
- `#<groupId>:item` (named from data) — scope: `BbDropdownItemSlotProps` — The content of every row of that group, and no other; a row's own `#<value>` still wins.
|
|
20666
20863
|
- `#<groupId>:item:prepend` (named from data) — scope: `BbDropdownItemSlotProps` — The leading region of every row of that group — e.g. an avatar per record, drawn from `item.meta`, while other rows keep their `prepend:icon`.
|
|
20667
20864
|
- `#<groupId>:item:append` (named from data) — scope: `BbDropdownItemSlotProps` — The trailing region of every row of that group; replaces their `append:icon`. The check takes its place on the selected row.
|
|
20668
|
-
- `#<groupId
|
|
20865
|
+
- `#<groupId>:label` (named from data) — scope: `BbDropdownItemSlotProps` — That group's title content (`item` is the group, `groupTitle` is `true`).
|
|
20669
20866
|
- `#<groupId>:prepend` (named from data) — scope: `BbDropdownItemSlotProps` — The leading region of that group's title line.
|
|
20670
20867
|
- `#<groupId>:append` (named from data) — scope: `BbDropdownItemSlotProps` — The trailing region of that group's title line.
|
|
20868
|
+
- `#<groupId>:group` (named from data) — scope: `BbDropdownGroupSlotProps` — That group's `groupBy` headings; beats `group`.
|
|
20671
20869
|
|
|
20672
20870
|
## CSS custom properties
|
|
20673
20871
|
|
|
@@ -20690,12 +20888,12 @@ Set these on the element, or on a class you put on it, to retune this component
|
|
|
20690
20888
|
- `BbDropdown` _(this component)_ — its own template binds: `panel` → `CommonPopover`, `root` → `CommonPopover`, `header` → `div.bb-dropdown__header`, `list` → `span.bb-dropdown__list`, `footer` → `div.bb-dropdown__footer`
|
|
20691
20889
|
- `BbDropdownList` _(internal — not importable, reach it through `BbDropdown`)_ — also mounts `BbIcon`, `ErrorIcon`, `CommonPopover`, `BbDropdownList`
|
|
20692
20890
|
- `BbBadge` _(public — [contract](https://llms-bitboss-ui.bitboss.it/dist/ai/BbBadge.md))_ — its own pt parts (`BbBadge`): `spinner` → `BbSpinner`, `icon` → `span.bb-badge__append-icon`, `icon` → `BbIcon`, `clear` → `button.bb-badge__clear`; documented CSS variables: `--bg`, `--fg`, `--bw`, `--ring-color`, `--ring-size`, `--min-size-md`, `--min-size`, `--elev`, `--r`, `--fs`, `--icon-size`, `--gap`, `--px`, `--clear-size`, `--bg-disabled`, `--fg-disabled`, `--border-disabled`, `--pad-left`; also mounts `BbIcon`, `BbSpinner`, `BadgeBodyContent`
|
|
20693
|
-
- `AdaptiveDropdown` _(internal — not importable, reach it through `BbDropdown`)_ — hands `BbOffCanvas` the pt map `{ header: 'header', footer: 'footer', panel: 'root', sheet: 'root' }` (ours → theirs); also mounts `BbSmoothHeight`, `BbDropdownList`
|
|
20891
|
+
- `AdaptiveDropdown` _(internal — not importable, reach it through `BbDropdown`)_ — hands `BbOffCanvas` the pt map `{ header: 'header', footer: 'footer', panel: 'root', sheet: 'root' }` (ours → theirs); also mounts `BbSmoothHeight`, `BbDropdownList`, `DropdownFailures`
|
|
20694
20892
|
- `BbOffCanvas` _(public — [contract](https://llms-bitboss-ui.bitboss.it/dist/ai/BbOffCanvas.md))_ — its own pt parts (`BbOffCanvas`): `header` → `div.bb-offcanvas__header`, `title` → `span.bb-offcanvas__title`, `description` → `p.bb-offcanvas__description`, `close` → `CloseButton`, `content` → `div.bb-offcanvas__content`, `footer` → `div.bb-offcanvas__footer`; documented CSS variables: `--stack-x`, `--snap-y`, `--stack-fill`, `--stack-transition-duration`, `--px`, `--handle-w`, `--handle-h`, `--handle-bg`, `--safe-top`, `--close-size`
|
|
20695
20893
|
- `CloseButton` _(internal — not importable, reach it through `BbOffCanvas`)_ — documented CSS variables: `--size`, `--p`, `--icon-size`; also mounts `BbIcon`
|
|
20696
20894
|
- `BbButton` _(public — [contract](https://llms-bitboss-ui.bitboss.it/dist/ai/BbButton.md))_ — its own pt parts (`BbButton`): `root` → `BbBaseButton`, `spinner` → `BbSpinner`, `icon` → `span.bb-button__prepend-icon`, `icon` → `BbIcon`, `text` → `span.bb-button__text`, `icon` → `span.bb-button__append-icon`; documented CSS variables: `--h-xs`, `--h`, `--icon-size`, `--px`, `--ipx`, `--fs`, `--r`, `--gap`, `--bg`, `--bg-hover`, `--bg-pressed`, `--fg`, `--border-color`, `--ring-color`, `--ring-size`, `--bw`, `--fg-hover`, `--border-hover`, `--fg-pressed`, `--border-pressed`, `--bg-disabled`, `--fg-disabled`, `--border-disabled`, `--opacity-disabled`, `--elev-tier`, `--elev`; also mounts `BbSpinner`, `BbIcon`
|
|
20697
20895
|
- `BbBaseButton` _(public — [contract](https://llms-bitboss-ui.bitboss.it/dist/ai/BbBaseButton.md))_ — its own pt parts (`BbBaseButton`): `root` → `RouterComponent`, `root` → `a`, `root` → `component`; also mounts `RouterComponent`
|
|
20698
|
-
- Also mounts `CommonPopover`, `DropdownPipelineResolver`
|
|
20896
|
+
- Also mounts `CommonPopover`, `DropdownFailures`, `DropdownPipelineResolver`
|
|
20699
20897
|
|
|
20700
20898
|
## See Also
|
|
20701
20899
|
|
|
@@ -21209,8 +21407,9 @@ style and attributes — optionally only while a state is on. Parts: `root`
|
|
|
21209
21407
|
(the group), `main` and `toggle` (the two halves, each handed to its button as
|
|
21210
21408
|
its `pt:root`), `icon`, `spinner` and `text` (the main button's — handed to it
|
|
21211
21409
|
as its own `pt`; the toggle's chevron is chrome), `panel` (the menu), `sheet` (the bottom sheet
|
|
21212
|
-
the menu becomes on a phone, only), `input` (every `searchable`
|
|
21213
|
-
search field), `
|
|
21410
|
+
the menu becomes on a phone, only), `box` and `input` (every `searchable`
|
|
21411
|
+
group's search box, and the field in it), `list` (the top-level entries
|
|
21412
|
+
container), `item` (every entry), and `itemText` /
|
|
21214
21413
|
`itemIcon` / `itemDescription` / `check` (an entry's label, its icons, its muted
|
|
21215
21414
|
second line and a checked entry's tick), and `submenu` (every submenu's flyout
|
|
21216
21415
|
box) — all handed to the `BbDropdown` under the same words, so
|
|
@@ -21307,6 +21506,15 @@ A `pt` value written in `<script>` (a constant, a preset, a wrapper's
|
|
|
21307
21506
|
`pt` prop) is typed as `BbDropdownButtonProps['pt']`, never an imported `PtValue`: see
|
|
21308
21507
|
[passthrough § Typing `pt` in `<script>`](https://llms-bitboss-ui.bitboss.it/dist/ai/guides/passthrough.md#typing-pt-in-script).
|
|
21309
21508
|
|
|
21509
|
+
### Opening from code: `v-model:open`
|
|
21510
|
+
|
|
21511
|
+
`v-model` is the value; `v-model:open` is whether the menu is open. Bound,
|
|
21512
|
+
your ref opens and closes it, and every open and close the user makes is
|
|
21513
|
+
written back: a pick, Escape, a click outside. A static `:open` with no
|
|
21514
|
+
listener is only the initial state. An open from code is the same open a
|
|
21515
|
+
click makes (focus moves to the first row, and back on close), and `disabled` / `readonly` refuse it (the ref is set back
|
|
21516
|
+
to `false`).
|
|
21517
|
+
|
|
21310
21518
|
### Works well with
|
|
21311
21519
|
|
|
21312
21520
|
- [useConfirm](https://llms-bitboss-ui.bitboss.it/dist/ai/composables/useConfirm.md) — gate a destructive alternate
|
|
@@ -21346,11 +21554,15 @@ A `pt` value written in `<script>` (a constant, a preset, a wrapper's
|
|
|
21346
21554
|
- While an async action runs, the busy half blocks re-entry automatically;
|
|
21347
21555
|
don't disable the other half yourself.
|
|
21348
21556
|
|
|
21557
|
+
## v-model
|
|
21558
|
+
|
|
21559
|
+
- `v-model:open` — type: `boolean \| undefined`
|
|
21560
|
+
|
|
21349
21561
|
## Props
|
|
21350
21562
|
|
|
21351
21563
|
| Prop | Type | Default | Required | Description |
|
|
21352
21564
|
| --- | --- | --- | --- | --- |
|
|
21353
|
-
| `pt:<part>`, `pt:<part>:<state>`, `pt` | `PtValue` | | | Passthrough — a class list, or `{ class, style, attrs }`, bound to one named part of the component; the state form applies only while that state is on. Parts: `check`, `footer`, `header`, `icon`, `input`, `item`, `itemDescription`, `itemIcon`, `itemText`, `main`, `panel`, `root`, `sheet`, `spinner`, `submenu`, `text`, `toggle`. States: `activeLink`, `
|
|
21565
|
+
| `pt:<part>`, `pt:<part>:<state>`, `pt` | `PtValue` | | | Passthrough — a class list, or `{ class, style, attrs }`, bound to one named part of the component; the state form applies only while that state is on. Parts: `box`, `check`, `footer`, `header`, `icon`, `input`, `item`, `itemDescription`, `itemIcon`, `itemText`, `list`, `main`, `panel`, `root`, `sheet`, `spinner`, `submenu`, `text`, `toggle`. States: `activeLink`, `disabled`, `exactActiveLink`, `loading`, `open`, `default`, `destructive`, `selected`, `ghost`, `link`, `outline`, `primary`, `secondary`. What each one is: _Passthrough parts and states_ below. `pt` is the object form with the same keys minus the prefix (`{ icon: '…', 'icon:loading': '…' }`). See `guides/passthrough.md`. In `<script>` a `pt` value is typed `BbDropdownButtonProps['pt']` (`PtValue` is not exported): § Typing `pt` in `<script>`. |
|
|
21354
21566
|
| `activeClass` | `string \| undefined` | | | Class to apply when the link is active. |
|
|
21355
21567
|
| `adaptive` | `boolean \| undefined` | ``all.adaptive` (`true`)` | | On mobile (below `config.mobileMaxWidth`), renders the menu as a bottom sheet that drills into submenus one level at a time instead of hover flyouts; slots and selection are unchanged. Unset: the global `all.adaptive`. |
|
|
21356
21568
|
| `append:icon` | `string \| undefined` | | | Icon to be added on the right of the text. |
|
|
@@ -21393,6 +21605,7 @@ A `pt` value written in `<script>` (a constant, a preset, a wrapper's
|
|
|
21393
21605
|
| `onProgress` | `((progress: { percentage: number \| undefined; }) => void) \| undefined` | | | Progress callback invoked by Inertia with the upload/download percentage when available. |
|
|
21394
21606
|
| `onStart` | `(() => void) \| undefined` | | | Lifecycle hook invoked by Inertia when a request starts. |
|
|
21395
21607
|
| `onSuccess` | `(() => void) \| undefined` | | | Lifecycle hook invoked by Inertia when a request succeeds. |
|
|
21608
|
+
| `open` | `boolean \| undefined` | `false` | | Whether the panel is open (`v-model:open`; `v-model` stays the value). Bound, the app opens and closes it; unbound, the initial state. |
|
|
21396
21609
|
| `padding` | `number \| undefined` | `10` | | Minimum empty space to keep from the edge of the page |
|
|
21397
21610
|
| `pageProps` | `Record<string, unknown> \| ((currentProps: Record<string, unknown>, sharedProps: Record<string, unknown>) => Record<string, unknown>) \| null \| undefined` | | | Inertia: props to merge into the next page optimistically, before the server responds. Either an object or a function of the current props. Typed platform-agnostically (matching BbButton) so the library's types never require `@inertiajs/vue3` to be installed. |
|
|
21398
21611
|
| `placement` | `'start'` \| `'end'` \| `'top'` \| `'bottom'` \| `'left'` \| `'right'` \| `'top-start'` \| `'top-end'` \| `'right-start'` \| `'right-end'` \| `'bottom-start'` \| `'bottom-end'` \| `'left-start'` \| `'left-end'` \| `'start-start'` \| `'start-end'` \| `'end-start'` \| `'end-end'` \| `'cursor'` | `'bottom'` | | Position relative to the activator; `'cursor'` anchors at the mouse/touch point. No arrow (tooltips only). |
|
|
@@ -21431,7 +21644,9 @@ A `pt` value written in `<script>` (a constant, a preset, a wrapper's
|
|
|
21431
21644
|
| `sheet` | The bottom sheet the menu becomes on a phone only. |
|
|
21432
21645
|
| `header` | The band around your `#header` slot: at the top of the menu on desktop, the sheet's header on a phone — handed to the `BbDropdown`. |
|
|
21433
21646
|
| `footer` | The band around your `#footer` slot: at the bottom of the menu on desktop, the sheet's footer on a phone — handed to the `BbDropdown`. |
|
|
21647
|
+
| `box` | A searchable group's search box in the menu (field and magnifier) — handed to the `BbDropdown` as its own `pt:box`. |
|
|
21434
21648
|
| `input` | A searchable group's search field in the menu — a broadcast, every searchable group's field — handed to the `BbDropdown` as its own `pt:input`. |
|
|
21649
|
+
| `list` | The menu's top-level items container — handed to the `BbDropdown` as its own `pt:list`. |
|
|
21435
21650
|
| `item` | One menu entry, submenus included — a broadcast resolved per entry. Also takes a per-item function, called with the entry. |
|
|
21436
21651
|
| `itemText` | An entry's label (its `label`) — resolved with that entry's states. A per-entry `#<value>` slot replaces it. Also takes a per-item function. |
|
|
21437
21652
|
| `itemIcon` | An entry's prepend / append icons — resolved with that entry's states. Also takes a per-item function. |
|
|
@@ -21465,18 +21680,19 @@ States are listed in precedence order: when two are on at once and their entries
|
|
|
21465
21680
|
- `item:unselected` — `(value: any): void` — A row of a selectable group was unselected (same payload as above).
|
|
21466
21681
|
- `show` — `(): void` — Emitted as soon as the menu (the popover, or the sheet on a phone) starts to open.
|
|
21467
21682
|
- `shown` — `(): void` — Emitted once the menu is open and its open transition has finished.
|
|
21683
|
+
- `update:open` — `(value: boolean): void` — The panel opened or closed (`v-model:open`).
|
|
21468
21684
|
|
|
21469
21685
|
## Slots
|
|
21470
21686
|
|
|
21471
21687
|
- `append:icon` — scope: `BbButtonIconSlotProps` `{ activeLink: boolean; exactActiveLink: boolean; pressed: boolean; loading: boolean; disabled: boolean }` — The main button's trailing icon, replacing `append:icon`.
|
|
21472
21688
|
- `default` — scope: `any` — The main button's label (falls back to `text`).
|
|
21473
21689
|
- `dropdown` — scope: `any` — Menu companions, forwarded into the dropdown: a `<BbDropdownGroup>` binding a group of `items` by id. A `#dropdown` slot keeps the toggle even with no `items`.
|
|
21474
|
-
- `empty` — scope: `BbDropdownPlaceholderSlotProps` `{ groupId?: string; query: string; text: string
|
|
21690
|
+
- `empty` — scope: `BbDropdownPlaceholderSlotProps` `{ groupId?: string; query: string; text: string }` — Replaces the default "no data" placeholder row shown in a pipeline group that resolved to no items. Rendered once per empty group. Forwarded to the underlying `BbDropdown`.
|
|
21475
21691
|
- `footer` — scope: `BbDropdownButtonEdgeSlotProps` `{ disabled?: boolean; open: boolean; placement: Placement \| "cursor" }` — Content pinned to the bottom of the dropdown panel, outside the scroll area.
|
|
21476
21692
|
- `header` — scope: `BbDropdownButtonEdgeSlotProps` `{ disabled?: boolean; open: boolean; placement: Placement \| "cursor" }` — Content pinned to the top of the dropdown panel, outside the scroll area.
|
|
21477
21693
|
- `item:append` — scope: `BbDropdownButtonItemSlotProps` `{ disabled?: boolean; index: number; item: InternalItem; open: boolean; placement: Placement \| "cursor"; label: string }` — The trailing region of every menu row, replacing its `append:icon`; the submenu chevron and the check on a selected row take its place (BbDropdown's rules).
|
|
21478
21694
|
- `item:prepend` — scope: `BbDropdownButtonItemSlotProps` `{ disabled?: boolean; index: number; item: InternalItem; open: boolean; placement: Placement \| "cursor"; label: string }` — The leading region of every menu row, replacing its `prepend:icon` (BbDropdown's rules).
|
|
21479
|
-
- `loading` — scope: `BbDropdownPlaceholderSlotProps` `{ groupId?: string; query: string; text: string
|
|
21695
|
+
- `loading` — scope: `BbDropdownPlaceholderSlotProps` `{ groupId?: string; query: string; text: string }` — Replaces the default loading placeholder row shown in a pipeline group while its async items load. Rendered once per loading group. Forwarded to the underlying `BbDropdown`.
|
|
21480
21696
|
- `prepend:icon` — scope: `BbButtonIconSlotProps` `{ activeLink: boolean; exactActiveLink: boolean; pressed: boolean; loading: boolean; disabled: boolean }` — The main button's leading icon, replacing `prepend:icon` (the one `icon-only` shows); inside its `icon` part, with its states.
|
|
21481
21697
|
- `#<value>` (named from data) — scope: `BbDropdownItemSlotProps` — One row's content (label and description), by its value; in a fetched group, by its resolved `itemValue`. Reserved names (their slot is one of this component's own, so an item value or column key spelled like them is an error): `default`, `dropdown`, `empty`, `footer`, `header`, `item`, `loading`.
|
|
21482
21698
|
- `#<value>:prepend` (named from data) — scope: `BbDropdownItemSlotProps` — One row's leading region; replaces its `prepend:icon`.
|
|
@@ -21484,9 +21700,10 @@ States are listed in precedence order: when two are on at once and their entries
|
|
|
21484
21700
|
- `#<groupId>:item` (named from data) — scope: `BbDropdownItemSlotProps` — The content of every row of that group, and no other; a row's own `#<value>` still wins.
|
|
21485
21701
|
- `#<groupId>:item:prepend` (named from data) — scope: `BbDropdownItemSlotProps` — The leading region of every row of that group — e.g. an avatar per record, drawn from `item.meta`, while other rows keep their `prepend:icon`.
|
|
21486
21702
|
- `#<groupId>:item:append` (named from data) — scope: `BbDropdownItemSlotProps` — The trailing region of every row of that group; replaces their `append:icon`. The check takes its place on the selected row.
|
|
21487
|
-
- `#<groupId
|
|
21703
|
+
- `#<groupId>:label` (named from data) — scope: `BbDropdownItemSlotProps` — That group's title content (`item` is the group, `groupTitle` is `true`).
|
|
21488
21704
|
- `#<groupId>:prepend` (named from data) — scope: `BbDropdownItemSlotProps` — The leading region of that group's title line.
|
|
21489
21705
|
- `#<groupId>:append` (named from data) — scope: `BbDropdownItemSlotProps` — The trailing region of that group's title line.
|
|
21706
|
+
- `#<groupId>:group` (named from data) — scope: `BbDropdownGroupSlotProps` — That group's `groupBy` headings; beats `group`.
|
|
21490
21707
|
|
|
21491
21708
|
## Component tree
|
|
21492
21709
|
|
|
@@ -21500,10 +21717,10 @@ States are listed in precedence order: when two are on at once and their entries
|
|
|
21500
21717
|
- `BbDropdownButton` _(this component)_ — hands `BbButton` the pt map `{ main: 'root', icon: 'icon', spinner: 'spinner', text: 'text' }` (ours → theirs); hands `BbDropdown` the pt map `{ item: 'item', itemText: 'itemText', itemIcon: 'itemIcon', itemDescription: 'itemDescription', check: 'check' }` (ours → theirs); hands `BbButton` the pt map `{ toggle: 'root' }` (ours → theirs)
|
|
21501
21718
|
- `BbButton` _(public — [contract](https://llms-bitboss-ui.bitboss.it/dist/ai/BbButton.md))_ — its own pt parts (`BbButton`): `root` → `BbBaseButton`, `spinner` → `BbSpinner`, `icon` → `span.bb-button__prepend-icon`, `icon` → `BbIcon`, `text` → `span.bb-button__text`, `icon` → `span.bb-button__append-icon`; documented CSS variables: `--h-xs`, `--h`, `--icon-size`, `--px`, `--ipx`, `--fs`, `--r`, `--gap`, `--bg`, `--bg-hover`, `--bg-pressed`, `--fg`, `--border-color`, `--ring-color`, `--ring-size`, `--bw`, `--fg-hover`, `--border-hover`, `--fg-pressed`, `--border-pressed`, `--bg-disabled`, `--fg-disabled`, `--border-disabled`, `--opacity-disabled`, `--elev-tier`, `--elev`; also mounts `BbSpinner`, `BbIcon`
|
|
21502
21719
|
- `BbBaseButton` _(public — [contract](https://llms-bitboss-ui.bitboss.it/dist/ai/BbBaseButton.md))_ — its own pt parts (`BbBaseButton`): `root` → `RouterComponent`, `root` → `a`, `root` → `component`; also mounts `RouterComponent`
|
|
21503
|
-
- `BbDropdown` _(public — [contract](https://llms-bitboss-ui.bitboss.it/dist/ai/BbDropdown.md))_ — its own pt parts (`BbDropdown`): `panel` → `CommonPopover`, `root` → `CommonPopover`, `header` → `div.bb-dropdown__header`, `list` → `span.bb-dropdown__list`, `footer` → `div.bb-dropdown__footer`; documented CSS variables: `--menu-inset`; also mounts `CommonPopover`, `DropdownPipelineResolver`
|
|
21720
|
+
- `BbDropdown` _(public — [contract](https://llms-bitboss-ui.bitboss.it/dist/ai/BbDropdown.md))_ — its own pt parts (`BbDropdown`): `panel` → `CommonPopover`, `root` → `CommonPopover`, `header` → `div.bb-dropdown__header`, `list` → `span.bb-dropdown__list`, `footer` → `div.bb-dropdown__footer`; documented CSS variables: `--menu-inset`; also mounts `CommonPopover`, `DropdownFailures`, `DropdownPipelineResolver`
|
|
21504
21721
|
- `BbDropdownList` _(internal — not importable, reach it through `BbDropdown`)_ — also mounts `BbIcon`, `ErrorIcon`, `CommonPopover`, `BbDropdownList`
|
|
21505
21722
|
- `BbBadge` _(public — [contract](https://llms-bitboss-ui.bitboss.it/dist/ai/BbBadge.md))_ — its own pt parts (`BbBadge`): `spinner` → `BbSpinner`, `icon` → `span.bb-badge__append-icon`, `icon` → `BbIcon`, `clear` → `button.bb-badge__clear`; documented CSS variables: `--bg`, `--fg`, `--bw`, `--ring-color`, `--ring-size`, `--min-size-md`, `--min-size`, `--elev`, `--r`, `--fs`, `--icon-size`, `--gap`, `--px`, `--clear-size`, `--bg-disabled`, `--fg-disabled`, `--border-disabled`, `--pad-left`; also mounts `BbIcon`, `BbSpinner`, `BadgeBodyContent`
|
|
21506
|
-
- `AdaptiveDropdown` _(internal — not importable, reach it through `BbDropdown`)_ — hands `BbOffCanvas` the pt map `{ header: 'header', footer: 'footer', panel: 'root', sheet: 'root' }` (ours → theirs); also mounts `BbSmoothHeight`, `BbButton`, `BbDropdownList`
|
|
21723
|
+
- `AdaptiveDropdown` _(internal — not importable, reach it through `BbDropdown`)_ — hands `BbOffCanvas` the pt map `{ header: 'header', footer: 'footer', panel: 'root', sheet: 'root' }` (ours → theirs); also mounts `BbSmoothHeight`, `BbButton`, `BbDropdownList`, `DropdownFailures`
|
|
21507
21724
|
- `BbOffCanvas` _(public — [contract](https://llms-bitboss-ui.bitboss.it/dist/ai/BbOffCanvas.md))_ — its own pt parts (`BbOffCanvas`): `header` → `div.bb-offcanvas__header`, `title` → `span.bb-offcanvas__title`, `description` → `p.bb-offcanvas__description`, `close` → `CloseButton`, `content` → `div.bb-offcanvas__content`, `footer` → `div.bb-offcanvas__footer`; documented CSS variables: `--stack-x`, `--snap-y`, `--stack-fill`, `--stack-transition-duration`, `--px`, `--handle-w`, `--handle-h`, `--handle-bg`, `--safe-top`, `--close-size`
|
|
21508
21725
|
- `CloseButton` _(internal — not importable, reach it through `BbOffCanvas`)_ — documented CSS variables: `--size`, `--p`, `--icon-size`; also mounts `BbIcon`
|
|
21509
21726
|
|
|
@@ -24437,6 +24654,9 @@ While it runs:
|
|
|
24437
24654
|
(`disable-auto-loading` opts out). A submit from code
|
|
24438
24655
|
(`useBbForm(id).submit()`) spins no submit button: the button whose
|
|
24439
24656
|
click calls it spins on its own, since its click returns the promise.
|
|
24657
|
+
- **Another submit is dropped**: Enter, a submit button or `submit()` while
|
|
24658
|
+
the save runs starts no second save and is not queued (`submit()` resolves
|
|
24659
|
+
`false`), with `disable-submit-lock` too.
|
|
24440
24660
|
- **A `BbDialog` / `BbOffCanvas` around the form refuses every user close**
|
|
24441
24661
|
(the ✕, Cancel's `close()`, `Escape`, the backdrop, a swipe) until the save
|
|
24442
24662
|
settles; code still closes it (`hide()`, the model). Its `prevent-close`
|
|
@@ -25271,7 +25491,7 @@ marker stays consistent with the rules.
|
|
|
25271
25491
|
|
|
25272
25492
|
## Slots
|
|
25273
25493
|
|
|
25274
|
-
- `default` — scope: `{
|
|
25494
|
+
- `default` — scope: `FormMeta<GenericObject> & { errors: Record<string, string[]>; fields: Record<string, BbFormFieldEntry>; isSubmitting: boolean; removeField: (path: string) => vo…` — The form's fields, with its state and actions in scope: the meta (`valid`, `dirty`…), `values`, `errors`, `fields`, `unmatchedErrors`, `isSubmitting`, `submitCount`, `validate`, `resetForm`, `setErrors`, `snapshot`, `removeField`.
|
|
25275
25495
|
|
|
25276
25496
|
## Exposed (template ref)
|
|
25277
25497
|
|
|
@@ -28044,7 +28264,7 @@ States are listed in precedence order: when two are on at once and their entries
|
|
|
28044
28264
|
|
|
28045
28265
|
## Slots
|
|
28046
28266
|
|
|
28047
|
-
- `default` — scope: `BbHoverCardPortalSlotProps
|
|
28267
|
+
- `default` — scope: `BbHoverCardPortalSlotProps<any>` `{ data: P; close: () => void }` — The card's body. `data` is the directive's `data`; `close` closes the card.
|
|
28048
28268
|
|
|
28049
28269
|
## See Also
|
|
28050
28270
|
|
|
@@ -29186,12 +29406,15 @@ settles back to `max` at once; `min` waits for blur or Enter, because the
|
|
|
29186
29406
|
digits of a valid number pass through smaller ones (typing `20` into a 16–28
|
|
29187
29407
|
field goes through `2`). Leave the field below `min`, or press Enter in it, and
|
|
29188
29408
|
it rises to `min` — Enter corrects it before a surrounding form submits, so
|
|
29189
|
-
`@submit` never receives a value below `min
|
|
29409
|
+
`@submit` never receives a value below `min`. A value your app sets past
|
|
29410
|
+
either bound stays as it is while nobody touches the field; a focus and a
|
|
29411
|
+
blur bring it inside the bounds, as Enter does (defaults are
|
|
29190
29412
|
the safe-integer bounds, i.e. effectively unbounded). `maxPrecision` caps the number of decimal places (default `8`),
|
|
29191
29413
|
which is how you pin a field to whole numbers (`0`); for money set `currency`,
|
|
29192
29414
|
which brings its own decimals. Extra decimals are refused as typed, never
|
|
29193
29415
|
rounded: with `0`, a typed `,` or `.` stays until blur and the digits after it
|
|
29194
|
-
are refused (`12,5` is 12).
|
|
29416
|
+
are refused (`12,5` is 12). The cap is on typing only: a model set from code
|
|
29417
|
+
with more decimals shows and posts all of them. `minPrecision` (default `0`) is
|
|
29195
29418
|
its twin: with `2` the field always shows two decimals (`1` shows `1,00`),
|
|
29196
29419
|
padding with zeros the user types over, while the model stays the number
|
|
29197
29420
|
(`1.5`).
|
|
@@ -29345,7 +29568,8 @@ const formattedSubtotal = computed(() =>
|
|
|
29345
29568
|
`currency="EUR"` (an ISO 4217 code) shows the amount the locale's way, symbol
|
|
29346
29569
|
included, inside the text: `1.234,56 €` in Italian, `$1,234.56` in English,
|
|
29347
29570
|
`CHF-1’234.56` in Swiss German. The decimals follow the currency (2 for EUR,
|
|
29348
|
-
0 for JPY, 3 for KWD
|
|
29571
|
+
0 for JPY and HUF, 3 for KWD, from a table the library ships, so every browser
|
|
29572
|
+
agrees); `minPrecision` / `maxPrecision` win when you set them.
|
|
29349
29573
|
`unit="kilogram"` does the same for a measure (`20 kg`, any unit
|
|
29350
29574
|
`Intl.NumberFormat` knows); `unit="percent"` holds the number you see, so `15%`
|
|
29351
29575
|
is `15`, not `0.15`. Set one or the other; with both, `currency` wins. The
|
|
@@ -29857,7 +30081,7 @@ A `pt` value written in `<script>` (a constant, a preset, a wrapper's
|
|
|
29857
30081
|
| `layout` | `Responsive<FieldLayout> \| undefined` | | | How label and input sit together: `'vertical'`, `'horizontal'` (50/50), `'auto'`, `'label-fill'`, `'input-fill'`, a ratio like `'xx xxxxx'`, or a per-breakpoint map (`{ default: 'vertical', md: 'xx xxxxx' }`). |
|
|
29858
30082
|
| `loading` | `boolean \| undefined` | `false` | | Sets the component in a loading state, usually triggering some visual styles. |
|
|
29859
30083
|
| `max` | `number \| undefined` | `Number.MAX_SAFE_INTEGER` | | Maximum value cap. |
|
|
29860
|
-
| `maxPrecision` | `number \| undefined` | `8` | | Maximum
|
|
30084
|
+
| `maxPrecision` | `number \| undefined` | `8` | | Maximum fraction digits the user can TYPE (more are refused, never rounded); a model with more still shows them all. With `currency`, the currency's own digits (`2` EUR, `0` JPY and HUF, `3` KWD), or `minPrecision` when that is larger. |
|
|
29861
30085
|
| `min` | `number \| undefined` | `Number.MIN_SAFE_INTEGER` | | Minimum value cap. Applied on blur and on Enter (before a surrounding form submits), not while typing, so a value above a `min` greater than 1 can be typed digit by digit. |
|
|
29862
30086
|
| `minPrecision` | `number \| undefined` | `0` | | Fraction digits always shown (`2`: `1` shows `1,00`), also while typing, where the padding zeros are placeholders; the model stays the number. Above `maxPrecision` it gives way. Applies with `disableFormatting` too. With `currency`: the currency's own digits. |
|
|
29863
30087
|
| `modelValue` | `string \| number \| null \| undefined` | `null` | | Used by v-model. |
|
|
@@ -33245,7 +33469,7 @@ States are listed in precedence order: when two are on at once and their entries
|
|
|
33245
33469
|
|
|
33246
33470
|
## Slots
|
|
33247
33471
|
|
|
33248
|
-
- `default` — scope: `BbPopoverPortalSlotProps
|
|
33472
|
+
- `default` — scope: `BbPopoverPortalSlotProps<any>` `{ data: P; close: () => void }` — The popover body. `data` is the directive's `data`; `close` closes the popover.
|
|
33249
33473
|
|
|
33250
33474
|
## See Also
|
|
33251
33475
|
|
|
@@ -35033,8 +35257,8 @@ Keep the set short enough that arrow-cycling stays quick; past ~6 options prefer
|
|
|
35033
35257
|
|
|
35034
35258
|
`items` accepts a provider function for options fetched from an API;
|
|
35035
35259
|
`loading-text` / `#loading` and `empty-text` / `#empty` cover the loading
|
|
35036
|
-
and empty states, `failed-text`
|
|
35037
|
-
|
|
35260
|
+
and empty states, `failed-text` words the failure row of a load that threw
|
|
35261
|
+
(with a built-in "Try again"; `#empty` is for empty results only), `dependencies` (+ `deps-debounce-time`) trigger re-fetches,
|
|
35038
35262
|
and `enforce-coherence` resets the model to `null` when the current value no
|
|
35039
35263
|
longer matches an available option. See the
|
|
35040
35264
|
[fetch-items](https://llms-bitboss-ui.bitboss.it/ai/guides/fetch-items-playbook.md) and
|
|
@@ -35516,7 +35740,7 @@ for a preset that fits any row type (never `<any>`), not an imported
|
|
|
35516
35740
|
| `itemLayout` | `FieldLayout \| undefined` | `'auto'` | | How each row's input and label sit together, in the `layout` keywords: `'auto'`, `'vertical'`, `'horizontal'`, `'label-fill'`, `'input-fill'`, or a two-word ratio pattern like `'xx xxxxx'`. |
|
|
35517
35741
|
| `itemProps` | `BbOptionGroupItemProps<T> \| undefined` | | | ADDITIONAL row fields, never the text or value: `description`, a muted line under the label (it may wrap; announced as the option's description). An object of paths or getters, or a function of the item; nothing is read implicitly. |
|
|
35518
35742
|
| `itemReverse` | `boolean \| undefined` | `undefined` | | Swaps each row's input and label from their natural order (input first), in every `item-layout`. `reverse` swaps the legend and the options instead. |
|
|
35519
|
-
| `items` | `T[] \| ((context: BbRadioGroupItemsContext) => T[] \| Promise<T[]>)` | | yes | The options: an array, or a provider called with a `BbRadioGroupItemsContext` (`reason`, `modelValue`, `signal`), sync or async. A provider fails by THROWING, never by returning `[]`: the rows clear and
|
|
35743
|
+
| `items` | `T[] \| ((context: BbRadioGroupItemsContext) => T[] \| Promise<T[]>)` | | yes | The options: an array, or a provider called with a `BbRadioGroupItemsContext` (`reason`, `modelValue`, `signal`), sync or async. A provider fails by THROWING, never by returning `[]`: the rows clear and the failure row shows `failed-text` with "Try again". |
|
|
35520
35744
|
| `itemText` | `ItemAccessor<T, string> \| undefined` | `own `label`, else `text`, else `JSON.stringify(item)`` | | Defines a path that returns a property of the object to use as text or a function that returns a string. Unset: own `label`, else `text` (`{ label, value }` needs no accessor). |
|
|
35521
35745
|
| `itemValue` | `ItemAccessor<T> \| undefined` | `own `value`, else the whole item` | | Defines a path that returns a property of the object to use as value or a function that returns any value. Unset: own `value`, even `null`. |
|
|
35522
35746
|
| `labelAlign` | `'center'` \| `'top'` \| `'bottom'` | | | Vertical position of the label block in a side-by-side row; not `labelPosition`, the horizontal one. Omitted, `'top'`. |
|
|
@@ -35593,7 +35817,7 @@ States are listed in precedence order: when two are on at once and their entries
|
|
|
35593
35817
|
|
|
35594
35818
|
- `append` — scope: `object` — Content rendered after the last option, inside the options container.
|
|
35595
35819
|
- `description` — scope: `BbRadioGroupDescriptionSlotProps` `{ text: string; hasErrors: boolean; hasWarnings: boolean }` — Replaces the description text. Provided alone (no `description` prop) it still renders the description region and wires it into `aria-describedby`.
|
|
35596
|
-
- `empty` — scope: `
|
|
35820
|
+
- `empty` — scope: `object` — Content shown when no options are available (replaces the default "no data" text). Empty only: a failed load shows the library's failure row instead (its message is `failed-text`, and it ends with "Try again").
|
|
35597
35821
|
- `icon` — scope: `BbRadioGroupIconSlotProps<T>` `{ disabled: boolean; readonly: boolean; checked: boolean; focused: boolean; focusVisible: boolean; id: string; name: string; hasErrors: boolean; hasWarnings: boolean; parsedValue: string; value: any; item: T; text: string }` — Replaces the default radio dot icon for each option. Receives the radio state plus the source item and its display text.
|
|
35598
35822
|
- `label` — scope: `BbRadioGroupLabelSlotProps<T>` `{ item: T; text: string; checked: boolean; description: string }` — Replaces the default label text for each option.
|
|
35599
35823
|
- `legend` — scope: `BbRadioGroupLegendSlotProps` `{ showAsterisk?: boolean; text: string; hasErrors: boolean; hasWarnings: boolean }` — Replaces the default fieldset legend text for the group.
|
|
@@ -37082,8 +37306,8 @@ picked someone:
|
|
|
37082
37306
|
v-model="reviewers"
|
|
37083
37307
|
clearable
|
|
37084
37308
|
compact
|
|
37085
|
-
:dependencies="[retry]"
|
|
37086
37309
|
empty-text="No members match your search"
|
|
37310
|
+
failed-text="Couldn't load members."
|
|
37087
37311
|
:filter-by="false"
|
|
37088
37312
|
hint="Type a name to search"
|
|
37089
37313
|
item-text="name"
|
|
@@ -37096,21 +37320,13 @@ picked someone:
|
|
|
37096
37320
|
:query-debounce-time="300"
|
|
37097
37321
|
stash
|
|
37098
37322
|
>
|
|
37099
|
-
<template #empty="{
|
|
37100
|
-
<template v-if="error">
|
|
37101
|
-
Couldn't load members.
|
|
37102
|
-
<BbButton size="sm" variant="ghost" @click="retry++">
|
|
37103
|
-
Try again
|
|
37104
|
-
</BbButton>
|
|
37105
|
-
</template>
|
|
37106
|
-
<template v-else>No members match “{{ query }}”</template>
|
|
37107
|
-
</template>
|
|
37323
|
+
<template #empty="{ query }">No members match “{{ query }}”</template>
|
|
37108
37324
|
</BbSelect>
|
|
37109
37325
|
</div>
|
|
37110
37326
|
</template>
|
|
37111
37327
|
<script setup lang="ts">
|
|
37112
37328
|
import { ref } from 'vue';
|
|
37113
|
-
import {
|
|
37329
|
+
import { BbSelect } from 'bitboss-ui';
|
|
37114
37330
|
import type { BbSelectItemsContext } from 'bitboss-ui';
|
|
37115
37331
|
|
|
37116
37332
|
type Member = {
|
|
@@ -37178,8 +37394,6 @@ const searchMembers = async ({
|
|
|
37178
37394
|
};
|
|
37179
37395
|
|
|
37180
37396
|
const reviewers = ref<string[]>([]);
|
|
37181
|
-
// The retry: bumping a dependency reloads with `reason: 'dependencies'`.
|
|
37182
|
-
const retry = ref(0);
|
|
37183
37397
|
</script>
|
|
37184
37398
|
```
|
|
37185
37399
|
|
|
@@ -37385,24 +37599,17 @@ nothing to catch.
|
|
|
37385
37599
|
|
|
37386
37600
|
A provider signals a failure by **throwing** — never by returning `[]`, which is
|
|
37387
37601
|
a real, applied result. On a failed call the select clears the rows (stale rows
|
|
37388
|
-
never sit under a new filter), prunes nothing, and shows
|
|
37389
|
-
default "Couldn't load items")
|
|
37390
|
-
|
|
37391
|
-
|
|
37392
|
-
|
|
37393
|
-
|
|
37394
|
-
|
|
37395
|
-
|
|
37396
|
-
|
|
37397
|
-
|
|
37398
|
-
<
|
|
37399
|
-
<template #empty="{ error, query }">
|
|
37400
|
-
<template v-if="error">
|
|
37401
|
-
Couldn't load members.
|
|
37402
|
-
<BbButton size="sm" variant="ghost" @click="retry++">Try again</BbButton>
|
|
37403
|
-
</template>
|
|
37404
|
-
<template v-else>No members match “{{ query }}”</template>
|
|
37405
|
-
</template>
|
|
37602
|
+
never sit under a new filter), prunes nothing, and shows its own failure row
|
|
37603
|
+
under the list: `failed-text` (locale default "Couldn't load items"),
|
|
37604
|
+
announced, then a "Try again" button. With `stash` the row sits below the picks
|
|
37605
|
+
the stash still names. "Try again" runs the failed call again with the same
|
|
37606
|
+
query, on click only, and hands focus back to the search field. `#empty` means
|
|
37607
|
+
empty: it never renders for a failure, so write empty copy there and word the
|
|
37608
|
+
failure with `failed-text`:
|
|
37609
|
+
|
|
37610
|
+
```vue
|
|
37611
|
+
<BbSelect :items="searchMembers" failed-text="Couldn't load members." …>
|
|
37612
|
+
<template #empty="{ query }">No members match “{{ query }}”</template>
|
|
37406
37613
|
</BbSelect>
|
|
37407
37614
|
```
|
|
37408
37615
|
|
|
@@ -37418,8 +37625,9 @@ own flow (debounced, aborting the call in flight):
|
|
|
37418
37625
|
- **Panel states**: `loading-text` / `empty-text` / `failed-text` (locale
|
|
37419
37626
|
defaults "Loading..." / "No data to display" / "Couldn't load items") or the
|
|
37420
37627
|
`#loading` / `#empty` slots — both receive `{ query }`, `#empty` also
|
|
37421
|
-
`focus()
|
|
37422
|
-
`
|
|
37628
|
+
`focus()` and `close()` (for an action that keeps focus in the panel). A
|
|
37629
|
+
failed load has its own row (`failed-text` and "Try again"), never
|
|
37630
|
+
`#empty`.
|
|
37423
37631
|
|
|
37424
37632
|
`stash` accumulates picked options across searches: a pick stays named (chips
|
|
37425
37633
|
keep their text) when a later search or a failed load no longer returns it. It
|
|
@@ -37892,6 +38100,13 @@ Pressing Enter in the search field with **no option highlighted** emits
|
|
|
37892
38100
|
does not create anything itself: append the new item to `items` and select it.
|
|
37893
38101
|
This is the idiomatic pattern for closed-but-growable vocabularies.
|
|
37894
38102
|
|
|
38103
|
+
While you listen to `option:add`, a typed query that no option matches
|
|
38104
|
+
exactly (case aside) also gets a **"Create «query»" row**: the last row after
|
|
38105
|
+
the matches, or the only one when nothing matches (in place of the
|
|
38106
|
+
no-results text and `#empty`). It is a real option, clickable and reached
|
|
38107
|
+
with the arrow keys, and activating it does what Enter does. It is not shown
|
|
38108
|
+
while the list loads or after a failed load.
|
|
38109
|
+
|
|
37895
38110
|
**Create a label by pressing Enter**
|
|
37896
38111
|
|
|
37897
38112
|
```vue
|
|
@@ -37949,14 +38164,12 @@ const createLabel = (text: string) => {
|
|
|
37949
38164
|
</script>
|
|
37950
38165
|
```
|
|
37951
38166
|
|
|
37952
|
-
#### A record that needs its own form: open its dialog from
|
|
38167
|
+
#### A record that needs its own form: open its dialog from `option:add`
|
|
37953
38168
|
|
|
37954
38169
|
When creating the missing row takes a real form (a person, a company), the
|
|
37955
|
-
select doesn't create it: its dialog does.
|
|
37956
|
-
|
|
37957
|
-
|
|
37958
|
-
`option:add`. Open the dialog from code, seed it with the query, and on
|
|
37959
|
-
`completed` add the row and select it:
|
|
38170
|
+
select doesn't create it: its dialog does. Handle `option:add` (the create
|
|
38171
|
+
row's click and Enter both land there): open the dialog from code, seed it
|
|
38172
|
+
with the query, and on `completed` add the row and select it:
|
|
37960
38173
|
|
|
37961
38174
|
**No results? Create the person in a dialog**
|
|
37962
38175
|
|
|
@@ -37977,17 +38190,7 @@ came up empty, as one line in `#empty` with an inline `BbBaseButton` (not a
|
|
|
37977
38190
|
:items="people"
|
|
37978
38191
|
label="Contact"
|
|
37979
38192
|
@option:add="(query) => query && create(query)"
|
|
37980
|
-
|
|
37981
|
-
<template #empty="{ query }">
|
|
37982
|
-
No results for “{{ query }}”.
|
|
37983
|
-
<BbBaseButton
|
|
37984
|
-
class="font-medium text-(--bb-primary) hover:underline"
|
|
37985
|
-
@click="create(query)"
|
|
37986
|
-
>
|
|
37987
|
-
Create {{ query }}
|
|
37988
|
-
</BbBaseButton>
|
|
37989
|
-
</template>
|
|
37990
|
-
</BbSelect>
|
|
38193
|
+
/>
|
|
37991
38194
|
|
|
37992
38195
|
<!-- In an app this is its own CreatePersonDialog.vue: pass the component
|
|
37993
38196
|
to useBbDialog instead of the id. -->
|
|
@@ -38006,7 +38209,6 @@ came up empty, as one line in `#empty` with an inline `BbBaseButton` (not a
|
|
|
38006
38209
|
<script setup lang="ts">
|
|
38007
38210
|
import { ref } from 'vue';
|
|
38008
38211
|
import {
|
|
38009
|
-
BbBaseButton,
|
|
38010
38212
|
BbButton,
|
|
38011
38213
|
BbDialog,
|
|
38012
38214
|
BbForm,
|
|
@@ -38029,8 +38231,8 @@ const save = async (values: Record<string, unknown>): Promise<Person> => ({
|
|
|
38029
38231
|
name: String(values.name),
|
|
38030
38232
|
});
|
|
38031
38233
|
|
|
38032
|
-
// The handle lives in setup
|
|
38033
|
-
//
|
|
38234
|
+
// The handle lives in setup: the panel closes as the dialog takes focus, and
|
|
38235
|
+
// the create row goes with it.
|
|
38034
38236
|
const personDialog = useBbDialog<{ name: string }, Person>('person-create');
|
|
38035
38237
|
const create = async (name: string) => {
|
|
38036
38238
|
const result = await personDialog.show({ name });
|
|
@@ -38042,13 +38244,11 @@ const create = async (name: string) => {
|
|
|
38042
38244
|
```
|
|
38043
38245
|
|
|
38044
38246
|
- **Open it with a handle from setup**, `useBbDialog(CreatePersonDialog)`
|
|
38045
|
-
(or an id), never `v-bb-dialog` on
|
|
38046
|
-
closes as the dialog takes focus and
|
|
38047
|
-
|
|
38048
|
-
|
|
38049
|
-
(
|
|
38050
|
-
works either way. The ESLint rule `bitboss-ui/no-dialog-in-panel` reports
|
|
38051
|
-
the on-demand form ([ESLint rules](https://llms-bitboss-ui.bitboss.it/dist/ai/guides/eslint-rules.md)).
|
|
38247
|
+
(or an id), never `v-bb-dialog` on a button inside the panel: the panel
|
|
38248
|
+
closes as the dialog takes focus, and an on-demand opening
|
|
38249
|
+
(`v-bb-dialog="{ component }"`) is dismissed with its trigger. The ESLint
|
|
38250
|
+
rule `bitboss-ui/no-dialog-in-panel` reports the on-demand form
|
|
38251
|
+
([ESLint rules](https://llms-bitboss-ui.bitboss.it/dist/ai/guides/eslint-rules.md)).
|
|
38052
38252
|
- **Inside another dialog it just stacks.** The create dialog opens above the
|
|
38053
38253
|
one holding the select, and on close focus comes back to the select, closed,
|
|
38054
38254
|
showing the new pick. Nothing to wire.
|
|
@@ -38056,7 +38256,7 @@ const create = async (name: string) => {
|
|
|
38056
38256
|
`known-items` (`{ value: person.id, label: person.name }`): the provider
|
|
38057
38257
|
returns it on the next load.
|
|
38058
38258
|
- **Keyboard**: Enter in the search field fires `option:add` (no option is
|
|
38059
|
-
highlighted when nothing matched), and
|
|
38259
|
+
highlighted when nothing matched), and the arrow keys reach the create row.
|
|
38060
38260
|
|
|
38061
38261
|
### Group related options
|
|
38062
38262
|
|
|
@@ -38069,6 +38269,11 @@ no group: those rows are listed **first**, before every header, and `#group` is
|
|
|
38069
38269
|
not called for them (a known row is listed the same way). `BbDropdown`'s
|
|
38070
38270
|
`groupBy` follows the same rule.
|
|
38071
38271
|
|
|
38272
|
+
Headers are sticky: the header of the group you are scrolling through stays
|
|
38273
|
+
pinned at the top of the list, and leaves with its group's last option. A list
|
|
38274
|
+
that opens on a selection shows its group's header right above it, and a row
|
|
38275
|
+
reached with the arrow keys always stops below the pinned header.
|
|
38276
|
+
|
|
38072
38277
|
A grouped list virtualizes **whole groups, not rows**: a group mounts only
|
|
38073
38278
|
when it scrolls into range, but all of its rows mount together. Many
|
|
38074
38279
|
small-to-medium groups window just as well as a flat list; one very large
|
|
@@ -38312,11 +38517,39 @@ is all you need.
|
|
|
38312
38517
|
- `clearable` — clear affix when a value exists; emits `null` / `[]`. Single: re-clicking the pick clears too.
|
|
38313
38518
|
- Empty panel — `empty-text` or `#empty`.
|
|
38314
38519
|
|
|
38520
|
+
### Opening from code: `v-model:open`
|
|
38521
|
+
|
|
38522
|
+
`v-model` is the value; `v-model:open` is whether the options panel is open. Bound,
|
|
38523
|
+
your ref opens and closes it, and every open and close the user makes is
|
|
38524
|
+
written back: a pick, Escape, a click outside, the phone sheet's own dismiss. A static `:open` with no
|
|
38525
|
+
listener is only the initial state. An open from code is the same open a
|
|
38526
|
+
click makes (focus moves into the panel), and `disabled` / `readonly` refuse it (the ref is set back
|
|
38527
|
+
to `false`).
|
|
38528
|
+
|
|
38529
|
+
```vue
|
|
38530
|
+
<script setup lang="ts">
|
|
38531
|
+
import { ref } from 'vue';
|
|
38532
|
+
|
|
38533
|
+
const city = ref<string | null>(null);
|
|
38534
|
+
const open = ref(false);
|
|
38535
|
+
</script>
|
|
38536
|
+
|
|
38537
|
+
<template>
|
|
38538
|
+
<BbButton text="Choose a city" @click="open = true" />
|
|
38539
|
+
<BbSelect
|
|
38540
|
+
v-model="city"
|
|
38541
|
+
v-model:open="open"
|
|
38542
|
+
label="City"
|
|
38543
|
+
:items="['Milan', 'Rome', 'Turin']"
|
|
38544
|
+
/>
|
|
38545
|
+
</template>
|
|
38546
|
+
```
|
|
38547
|
+
|
|
38315
38548
|
### Events and v-model
|
|
38316
38549
|
|
|
38317
38550
|
- `update:modelValue` — the resolved value (single) or array (multiple), on
|
|
38318
38551
|
pick, chip removal, clear and coherence enforcement.
|
|
38319
|
-
- `option:add` — Enter on a query with no highlighted option (see above).
|
|
38552
|
+
- `option:add` — Enter on a query with no highlighted option, or the create row (see above).
|
|
38320
38553
|
- `focus` / `blur` — the control gaining/losing focus; `input` / `change` —
|
|
38321
38554
|
native events from the panel search field.
|
|
38322
38555
|
- `inactive` — focus has fully left the component (control **and** panel).
|
|
@@ -38653,8 +38886,8 @@ it: [passthrough guide § Typing `pt` in `<script>`](https://llms-bitboss-ui.bit
|
|
|
38653
38886
|
- **A failed load is not an empty one.** A provider throws to fail; returning
|
|
38654
38887
|
`[]` is applied as a real empty result and, with `enforce-coherence`, prunes
|
|
38655
38888
|
every pick. On a failure the rows are cleared, nothing is pruned, and the
|
|
38656
|
-
panel shows `failed-text` (with `stash`,
|
|
38657
|
-
names); `#empty`
|
|
38889
|
+
panel shows its failure row, `failed-text` and "Try again" (with `stash`,
|
|
38890
|
+
below the picks the stash still names); `#empty` stays for empty results.
|
|
38658
38891
|
- `option:add` can fire with an empty string — trim and guard in the handler.
|
|
38659
38892
|
|
|
38660
38893
|
### Anti-patterns
|
|
@@ -38694,6 +38927,7 @@ it: [passthrough guide § Typing `pt` in `<script>`](https://llms-bitboss-ui.bit
|
|
|
38694
38927
|
## v-model
|
|
38695
38928
|
|
|
38696
38929
|
- `v-model` — type: `any`
|
|
38930
|
+
- `v-model:open` — type: `boolean \| undefined`
|
|
38697
38931
|
|
|
38698
38932
|
## Props
|
|
38699
38933
|
|
|
@@ -38713,7 +38947,7 @@ it: [passthrough guide § Typing `pt` in `<script>`](https://llms-bitboss-ui.bit
|
|
|
38713
38947
|
| `disabled` | `boolean \| undefined` | `false` | | Disables the component. |
|
|
38714
38948
|
| `disableWriting` | `boolean \| "auto" \| "mobile" \| "desktop" \| undefined` | `'auto'` | | Hides the panel's search field: `true` everywhere, `'mobile'` / `'desktop'` on that platform only. `'auto'` hides it, per open, for an array `items` shorter than the plugin's `autoDisableWritingThreshold` (6); never for a provider or with an `option:add` listener. |
|
|
38715
38949
|
| `emptyText` | `string \| undefined` | | | String displayed when there are no items to display. |
|
|
38716
|
-
| `enforceCoherence` | `boolean \| undefined` | `false` | | After
|
|
38950
|
+
| `enforceCoherence` | `boolean \| undefined` | `false` | | After each successful non-search load, removes the picks the fetched rows lack (a single model resets to `null`). A `stash` does not count; a `known-items` value stays until a parent change; a search or a failed load never prunes. |
|
|
38717
38951
|
| `errors` | `string \| string[] \| undefined` | | | Error messages under the field, a string or array, in an `aria-live="polite"` region and first in the control's `aria-describedby`, so they are re-read when it regains focus. |
|
|
38718
38952
|
| `failedText` | `string \| undefined` | `the localized `common.failedText` ("Couldn't load items")` | | String displayed in the empty state while the latest load FAILED (the provider threw): the twin of `emptyText` for that case. |
|
|
38719
38953
|
| `filterBy` | `false \| string[] \| undefined` | `[]` | | What typing filters on: empty = the display text and description; item paths = those fields (`['name', 'email']`); `false` = no filtering. Ranked, case and accents ignored (guide § Search). Use `false` when the provider matched the query on the server, or its email matches show as "No results". |
|
|
@@ -38747,6 +38981,7 @@ it: [passthrough guide § Typing `pt` in `<script>`](https://llms-bitboss-ui.bit
|
|
|
38747
38981
|
| `multiple` | `boolean \| undefined` | `false` | | Allows the selection of multiple items. |
|
|
38748
38982
|
| `name` | `string \| undefined` | | | Defines the name of the input. |
|
|
38749
38983
|
| `offCanvasProps` | `Partial<BbOffCanvasProps> \| undefined` | | | Props for the phone sheet (the `BbOffCanvas` that `adaptive` renders on mobile), spread over its defaults. A `pt` inside it styles only the sheet (passthrough guide § Inside the sheet). |
|
|
38984
|
+
| `open` | `boolean \| undefined` | `false` | | Whether the panel is open (`v-model:open`; `v-model` stays the value). Bound, the app opens and closes it; unbound, the initial state. |
|
|
38750
38985
|
| `persistentHint` | `boolean \| undefined` | `false` | | Keeps the hint displayed. |
|
|
38751
38986
|
| `placeholder` | `string \| undefined` | | | Text shown in the field while nothing is picked (an empty list has `emptyText`). |
|
|
38752
38987
|
| `prefill` | `boolean \| "interaction" \| undefined` | `'interaction'` | | When the options first load: `'interaction'` on first open, `true` on mount, `false` only once the user types (on open with `disable-writing`). An array `items` or a seeded model always loads at once. |
|
|
@@ -38758,7 +38993,7 @@ it: [passthrough guide § Typing `pt` in `<script>`](https://llms-bitboss-ui.bit
|
|
|
38758
38993
|
| `rules` | `RuleExpression<any>` | | | vee-validate rules for this field. Only inside a `BbForm`. |
|
|
38759
38994
|
| `selectable` | `boolean \| ((item: T) => boolean) \| undefined` | `true` | | Defines whether options are selectable. Can be a global boolean that affects all options or a function that accepts an item and returns a boolean that only affects that item. Non-selectable options are rendered disabled. |
|
|
38760
38995
|
| `selectedLabelsFn` | `((count: number) => string) \| undefined` | | | Function that returns a string to be displayed when the number of selected labels is greater than `maxSelectedLabels`. |
|
|
38761
|
-
| `stash` | `boolean \| undefined` | `false` | | Keeps
|
|
38996
|
+
| `stash` | `boolean \| undefined` | `false` | | Keeps picks named (their chips keep their text) when a later search or a failed load no longer returns them. It follows the model; it does not keep a pick valid (`enforce-coherence` still prunes it). |
|
|
38762
38997
|
| `transitionDuration` | `number \| undefined` | `250` | | How long the transition has to last in milliseconds. |
|
|
38763
38998
|
| `validationLabel` | `string \| undefined` | | | The field's name in validation messages (`{field}`): "Email is not valid". Defaults to the `label` (or `legend`), then "This field"; never the `name`. Set it when the label is hidden or reads badly in a sentence (icon-only, a question). `BbForm` only. |
|
|
38764
38999
|
| `validationMode` | `'aggressive'` \| `'balanced'` \| `'lazy'` \| `'submit-only'` \| `'submit-live'` | | | When the field validates: `aggressive` (each change), `balanced` (on leave, then live while in error), `lazy` (on leave), `submit-only`, `submit-live`. Unset: the `BbForm`'s `validation-mode`, then `all.validationMode` (`'balanced'`). `BbForm` only. |
|
|
@@ -38828,20 +39063,21 @@ States are listed in precedence order: when two are on at once and their entries
|
|
|
38828
39063
|
- `show` — `(): void` — Emitted as soon as the options surface starts to open (the popover, or the sheet on a phone).
|
|
38829
39064
|
- `shown` — `(): void` — Emitted once the options surface is open and its open transition has finished.
|
|
38830
39065
|
- `update:modelValue` — `(value: any): void` — Emitted with the new value whenever `v-model` changes.
|
|
39066
|
+
- `update:open` — `(value: boolean): void` — The panel opened or closed (`v-model:open`).
|
|
38831
39067
|
|
|
38832
39068
|
## Slots
|
|
38833
39069
|
|
|
38834
39070
|
- `append` — scope: `{ query: string; focus: () => void; close: () => Promise<void>; }` — Content appended inside the input field, after the value area.
|
|
38835
39071
|
- `append:outer` — scope: `{ query: string; close: () => Promise<void>; }` — Content appended outside the input field wrapper.
|
|
38836
|
-
- `chip` — scope: `BbSelectChipSlotProps<T, Known>` `{ known: boolean; item: BbSelectKnownItem \| T; text: string; value: any; disabled: boolean; deselect: () => void }` —
|
|
39072
|
+
- `chip` — scope: `BbSelectChipSlotProps<T, Known>` `{ known: boolean; item: BbSelectKnownItem \| T; text: string; value: any; disabled: boolean; deselect: () => void }` — Each selection's badge with `multiple` (not in `comma` mode, nor the "+N" summary). With `known-items` bound, `item` is the known `{ value, label }` row (`known: true`) until the list brings the real one.
|
|
38837
39073
|
- `description` — scope: `BbSelectDescriptionSlotProps` `{ text: string; hasErrors: boolean; hasWarnings: boolean }` — Replaces the description text. Provided alone (no `description` prop) it still renders the description region and wires it into `aria-describedby`.
|
|
38838
|
-
- `empty` — scope: `{ query: string; focus: () => void; close: () => Promise<void>;
|
|
39074
|
+
- `empty` — scope: `{ query: string; focus: () => void; close: () => Promise<void>; }` — Content shown when no options match the query or the list is empty. Empty only: a failed load shows the failure row (`failed-text`, then "Try again"). `close()` closes the panel, for an action that does not move focus out of it.
|
|
38839
39075
|
- `footer` — scope: `BbSelectPanelSlotProps` `{ close: () => Promise<void>; clear: () => void; empty: boolean; focus: () => void; query: string; selectedOptions: BbSelectResolvedOption[] }` — Content pinned to the bottom of the options panel, below the options list. Rendered in both the desktop popover and the adaptive sheet.
|
|
38840
39076
|
- `group` — scope: `BbSelectGroupSlotProps<T>` `{ text: string; item: T; index: number; length: number; disabled: boolean }` — Replaces the default group header rendered above grouped options. Not called for rows with no group (`group-by` gives `null`/`undefined`, known rows): they are listed without a header.
|
|
38841
39077
|
- `header` — scope: `BbSelectPanelSlotProps` `{ close: () => Promise<void>; clear: () => void; empty: boolean; focus: () => void; query: string; selectedOptions: BbSelectResolvedOption[] }` — Content pinned to the top of the options panel, above the search field. Rendered in both the desktop popover and the adaptive sheet.
|
|
38842
39078
|
- `label` — scope: `BbSelectLabelSlotProps` `{ showAsterisk?: boolean; text: string; hasErrors: boolean; hasWarnings: boolean }` — Replaces the default label text rendered above the input.
|
|
38843
39079
|
- `loading` — scope: `{ query: string; }` — Content shown inside the options dropdown while items are loading.
|
|
38844
|
-
- `option` — scope: `BbSelectOptionSlotProps<T, Known>` `{ known: boolean; item: BbSelectKnownItem \| T; disabled: boolean; focused: boolean; index: number; hasErrors?: boolean; loading: boolean; selected: boolean; text: string; value: any; description: string }` —
|
|
39080
|
+
- `option` — scope: `BbSelectOptionSlotProps<T, Known>` `{ known: boolean; item: BbSelectKnownItem \| T; disabled: boolean; focused: boolean; index: number; hasErrors?: boolean; loading: boolean; selected: boolean; text: string; value: any; description: string }` — Each option row's content. With `known-items` bound, a row the list has not brought yet is the known `{ value, label }` row (`known: true`): check `known` before reading an option field off `item`.
|
|
38845
39081
|
- `prefix` — scope: `object` — Content rendered as an inline prefix inside the input field.
|
|
38846
39082
|
- `prepend` — scope: `{ query: string; focus: () => void; close: () => Promise<void>; }` — Content prepended inside the input field, before the value area.
|
|
38847
39083
|
- `prepend:outer` — scope: `{ query: string; close: () => Promise<void>; }` — Content prepended outside the input field wrapper.
|
|
@@ -39326,8 +39562,9 @@ Items playbook. The essentials:
|
|
|
39326
39562
|
chips stay accurate; `modelValue` is your v-model as-is (typed `any`);
|
|
39327
39563
|
`signal` is an `AbortSignal` to pass to every request.
|
|
39328
39564
|
- A provider **throws** to fail (never `return []`, an applied empty result):
|
|
39329
|
-
the rows are cleared, nothing is pruned,
|
|
39330
|
-
|
|
39565
|
+
the rows are cleared, nothing is pruned, and the failure row shows
|
|
39566
|
+
`failed-text` with a built-in "Try again" (`#empty` is for empty results
|
|
39567
|
+
only). A pick no row has
|
|
39331
39568
|
named yet still shows (trigger text, phone-sheet chip): its value as given
|
|
39332
39569
|
when it is a string or a number, else no text.
|
|
39333
39570
|
|
|
@@ -39964,6 +40201,12 @@ closed-but-growable vocabularies — the same as `BbSelect`. The behaviour is ga
|
|
|
39964
40201
|
by the search field existing; `disable-writing` (which removes the field) also
|
|
39965
40202
|
disables it.
|
|
39966
40203
|
|
|
40204
|
+
While you listen to `option:add`, a typed query that no option matches
|
|
40205
|
+
exactly (case aside) also gets a **"Create «query»" row**: last after the
|
|
40206
|
+
matches, or the only row when nothing matches (in place of the no-results
|
|
40207
|
+
text and `#empty`). It is a real option (click, arrow keys, announced) and
|
|
40208
|
+
does what Enter does; not while the list loads or after a failed load.
|
|
40209
|
+
|
|
39967
40210
|
```ts
|
|
39968
40211
|
const roles = ref<string[]>(['Reviewer', 'Approver']);
|
|
39969
40212
|
const role = ref<string | null>(null);
|
|
@@ -40529,12 +40772,21 @@ popover ↔ sheet. `off-canvas-props` forwards extra `BbOffCanvas` props to the
|
|
|
40529
40772
|
sheet (`size`, `draggable`, `fullscreen`, `stack`); `:adaptive="false"` keeps a
|
|
40530
40773
|
floating popover everywhere.
|
|
40531
40774
|
|
|
40775
|
+
### Opening from code: `v-model:open`
|
|
40776
|
+
|
|
40777
|
+
`v-model` is the value; `v-model:open` is whether the options panel is open. Bound,
|
|
40778
|
+
your ref opens and closes it, and every open and close the user makes is
|
|
40779
|
+
written back: a pick, Escape, a click outside, the phone sheet's own dismiss. A static `:open` with no
|
|
40780
|
+
listener is only the initial state. An open from code is the same open a
|
|
40781
|
+
click makes (focus moves into the panel), and `disabled` / `readonly` refuse it (the ref is set back
|
|
40782
|
+
to `false`).
|
|
40783
|
+
|
|
40532
40784
|
### Events and v-model
|
|
40533
40785
|
|
|
40534
40786
|
- `update:modelValue` — the resolved value (single) or array (multiple), on pick,
|
|
40535
40787
|
`clear`, coherence enforcement, and — in `multiple` mode only — deselect.
|
|
40536
40788
|
A second click on the current option in single mode emits nothing.
|
|
40537
|
-
- `option:add` — Enter on a non-matching query with nothing highlighted (above).
|
|
40789
|
+
- `option:add` — Enter on a non-matching query with nothing highlighted, or the create row (above).
|
|
40538
40790
|
- `focus` / `blur` — the activator gaining/losing focus.
|
|
40539
40791
|
- `input` / `change` — native events from the panel search field.
|
|
40540
40792
|
- `click` — the activator was clicked.
|
|
@@ -40696,7 +40948,7 @@ A `pt` value written in `<script>` (a constant, a preset, a wrapper's
|
|
|
40696
40948
|
it does not keep them valid.
|
|
40697
40949
|
- A provider **throws** to fail; `return []` is an applied empty result that
|
|
40698
40950
|
prunes every pick. On a failure the rows are cleared, nothing is pruned,
|
|
40699
|
-
`failed-text`
|
|
40951
|
+
and the failure row shows `failed-text` with "Try again", never `#empty`.
|
|
40700
40952
|
- `enforce-coherence` opts **each instance** into its own load. One field, one
|
|
40701
40953
|
request; N provider-backed rows, N requests.
|
|
40702
40954
|
- `option:add` can fire with an empty string — trim and guard.
|
|
@@ -40780,6 +41032,7 @@ A `pt` value written in `<script>` (a constant, a preset, a wrapper's
|
|
|
40780
41032
|
## v-model
|
|
40781
41033
|
|
|
40782
41034
|
- `v-model` — type: `any`
|
|
41035
|
+
- `v-model:open` — type: `boolean \| undefined`
|
|
40783
41036
|
|
|
40784
41037
|
## Props
|
|
40785
41038
|
|
|
@@ -40824,6 +41077,7 @@ A `pt` value written in `<script>` (a constant, a preset, a wrapper's
|
|
|
40824
41077
|
| `multiple` | `boolean \| undefined` | `false` | | Enable multiple item selection. When true, modelValue must be an array. |
|
|
40825
41078
|
| `offCanvasProps` | `Partial<BbOffCanvasProps> \| undefined` | | | Props for the phone sheet (the `BbOffCanvas` that `adaptive` renders on mobile), spread over its defaults. A `pt` inside it styles only the sheet (passthrough guide § Inside the sheet). |
|
|
40826
41079
|
| `offset` | `number \| undefined` | `4` | | Distance (px) between the activator and the popover. |
|
|
41080
|
+
| `open` | `boolean \| undefined` | `false` | | Whether the panel is open (`v-model:open`; `v-model` stays the value). Bound, the app opens and closes it; unbound, the initial state. |
|
|
40827
41081
|
| `padding` | `number \| undefined` | `10` | | Minimum page padding used by floating shift middleware. |
|
|
40828
41082
|
| `placement` | `'start'` \| `'end'` \| `'top'` \| `'bottom'` \| `'left'` \| `'right'` \| `'top-start'` \| `'top-end'` \| `'right-start'` \| `'right-end'` \| `'bottom-start'` \| `'bottom-end'` \| `'left-start'` \| `'left-end'` \| `'start-start'` \| `'start-end'` \| `'end-start'` \| `'end-end'` | `"bottom"` | | Floating placement of the popover. |
|
|
40829
41083
|
| `prefill` | `boolean \| "interaction" \| undefined` | `"interaction"` | | When the options first load: `'interaction'` on first open, `true` on mount (and in SSR), `false` once the user types (on open with `disable-writing` or a non-empty model). An array `items` always resolves on mount; else a seeded model's text waits for the first open. |
|
|
@@ -40878,11 +41132,12 @@ States are listed in precedence order: when two are on at once and their entries
|
|
|
40878
41132
|
- `show` — `(): void` — Emitted as soon as the options surface starts to open (the popover, or the sheet on a phone).
|
|
40879
41133
|
- `shown` — `(): void` — Emitted once the options surface is open and its open transition has finished.
|
|
40880
41134
|
- `update:modelValue` — `(value: any): void` — Emitted with the next selection value whenever selection changes.
|
|
41135
|
+
- `update:open` — `(value: boolean): void` — The panel opened or closed (`v-model:open`).
|
|
40881
41136
|
|
|
40882
41137
|
## Slots
|
|
40883
41138
|
|
|
40884
41139
|
- `activator` — scope: `BbSelectPopoverActivatorSlotProps` `{ clear: () => void; close: () => Promise<void>; focus: () => void; disabled: boolean; loading: boolean; open: () => Promise<void>; props: { ref: (reference: unknown) => void; }; query: string; readonly: boolean; selectedOptions: BbSelectResolvedOption<any>[]; shown: boolean; text: string; toggle: () => Promise<void> }` — Replaces the default trigger element that opens the select popover.
|
|
40885
|
-
- `empty` — scope: `{ query: string; focus: () => void; close: () => Promise<void>;
|
|
41140
|
+
- `empty` — scope: `{ query: string; focus: () => void; close: () => Promise<void>; }` — Content shown when no options match the query or the list is empty. Empty only: a failed load shows the library's failure row instead (its message is `failed-text`, and it ends with "Try again"). `close()` closes the panel, for an action that does not move focus out of it.
|
|
40886
41141
|
- `footer` — scope: `BbSelectPopoverPanelSlotProps` `{ close: () => Promise<void>; clear: () => void; empty: boolean; focus: () => void; query: string; selectedOptions: BbSelectResolvedOption<any>[]; titleId: string }` — Content pinned to the bottom of the panel, below the options list. Rendered in both the desktop popover and the adaptive sheet.
|
|
40887
41142
|
- `group` — scope: `BbSelectPopoverGroupSlotProps<Item>` `{ disabled: boolean; index: number; item: Item; length: number; text: string }` — Replaces the default group header rendered above grouped options. Not called for rows with no group (`group-by` gives `null`/`undefined`, known rows): they are listed without a header.
|
|
40888
41143
|
- `header` — scope: `BbSelectPopoverPanelSlotProps` `{ close: () => Promise<void>; clear: () => void; empty: boolean; focus: () => void; query: string; selectedOptions: BbSelectResolvedOption<any>[]; titleId: string }` — Content pinned to the top of the panel, above the search field. Rendered in both the desktop popover and the adaptive sheet.
|
|
@@ -44713,8 +44968,9 @@ called with one context object — `BbSwitchGroupItemsContext`: `reason`
|
|
|
44713
44968
|
`'model'` when the model changed from outside and the options cannot resolve
|
|
44714
44969
|
it), `modelValue` and `signal`; a group has no search field, so no `query`.
|
|
44715
44970
|
While it resolves, `loading-text` (or the `#loading` slot) shows; `empty-text`
|
|
44716
|
-
(or `#empty`) covers the empty result, and `failed-text`
|
|
44717
|
-
|
|
44971
|
+
(or `#empty`) covers the empty result, and `failed-text` words the failure
|
|
44972
|
+
row of a load that threw (it ends with a built-in "Try again"; `#empty` never
|
|
44973
|
+
renders for a failure). Loading, cancellation and race protection are
|
|
44718
44974
|
built in — don't wrap the provider in your own `loading` ref or debounce.
|
|
44719
44975
|
|
|
44720
44976
|
Tie the option set to external state with `dependencies` (debounced by
|
|
@@ -45007,7 +45263,7 @@ for a preset that fits any row type (never `<any>`), not an imported
|
|
|
45007
45263
|
| `itemLayout` | `FieldLayout \| undefined` | `'auto'` | | How each row's input and label sit together, in the `layout` keywords: `'auto'`, `'vertical'`, `'horizontal'`, `'label-fill'`, `'input-fill'`, or a two-word ratio pattern like `'xx xxxxx'`. |
|
|
45008
45264
|
| `itemProps` | `BbOptionGroupItemProps<T> \| undefined` | | | ADDITIONAL row fields, never the text or value: `description`, a muted line under the label (it may wrap; announced as the option's description). An object of paths or getters, or a function of the item; nothing is read implicitly. |
|
|
45009
45265
|
| `itemReverse` | `boolean \| undefined` | `undefined` | | Swaps each row's input and label from their natural order (input first), in every `item-layout`. `reverse` swaps the legend and the options instead. |
|
|
45010
|
-
| `items` | `T[] \| ((context: BbCheckboxGroupItemsContext) => T[] \| Promise<T[]>)` | | yes | The options: an array, or a provider called with
|
|
45266
|
+
| `items` | `T[] \| ((context: BbCheckboxGroupItemsContext) => T[] \| Promise<T[]>)` | | yes | The options: an array, or a provider called with `{ reason, modelValue, signal }`, sync or async. A provider fails by THROWING, never by returning `[]`: the rows clear and the failure row shows `failed-text` with "Try again". |
|
|
45011
45267
|
| `itemText` | `ItemAccessor<T, string> \| undefined` | `own `label`, else `text`, else `JSON.stringify(item)`` | | Defines a path that returns a property of the object to use as text or a function that returns a string. Unset: own `label`, else `text` (`{ label, value }` needs no accessor). |
|
|
45012
45268
|
| `itemValue` | `ItemAccessor<T> \| undefined` | `own `value`, else the whole item` | | Defines a path that returns a property of the object to use as value or a function that returns any value. Unset: own `value`, even `null`. |
|
|
45013
45269
|
| `labelAlign` | `'center'` \| `'top'` \| `'bottom'` | | | Vertical position of the label block in a side-by-side row; not `labelPosition`, the horizontal one. Omitted, `'top'`. |
|
|
@@ -45080,7 +45336,7 @@ States are listed in precedence order: when two are on at once and their entries
|
|
|
45080
45336
|
|
|
45081
45337
|
- `append` — scope: `object` — Content rendered after the last option, inside the options container.
|
|
45082
45338
|
- `description` — scope: `BbSwitchGroupDescriptionSlotProps` `{ text: string; hasErrors: boolean; hasWarnings: boolean }` — Replaces the description text. Provided alone (no `description` prop) it still renders the description region and wires it into `aria-describedby`.
|
|
45083
|
-
- `empty` — scope: `
|
|
45339
|
+
- `empty` — scope: `object` — Content shown when no options are available (replaces the default "no data" text). Empty only: a failed load shows the library's failure row instead (its message is `failed-text`, and it ends with "Try again").
|
|
45084
45340
|
- `icon` — scope: `BbSwitchGroupIconSlotProps<T>` `{ disabled: boolean; readonly: boolean; checked: boolean; indeterminate?: boolean; focused: boolean; focusVisible: boolean; id: string; name: string; falseValue: any; hasErrors: boolean; hasWarnings: boolean; parsedValue: string; trueValue: any; value: any; item: T; text: string }` — Replaces the default switch track visual for each option. Receives the switch state plus the source item and its display text.
|
|
45085
45341
|
- `label` — scope: `BbSwitchGroupLabelSlotProps<T>` `{ item: T; text: string; checked: boolean; description: string }` — Replaces the default label text for each option.
|
|
45086
45342
|
- `legend` — scope: `BbSwitchGroupLegendSlotProps` `{ showAsterisk?: boolean; text: string; hasErrors: boolean; hasWarnings: boolean }` — Replaces the default fieldset legend text for the group.
|
|
@@ -45521,6 +45777,9 @@ match; `bitboss-ui check` catches it when `columns` is in the same file, and
|
|
|
45521
45777
|
warns on a loop over keys it cannot see (`#[column.key]` over a prop) until
|
|
45522
45778
|
the name goes through `slotKey`. Keep the column in `columns`
|
|
45523
45779
|
even when you fully slot it: label, alignment and width still come from there.
|
|
45780
|
+
A `#<key>` slot owns its cell: when it renders nothing (a `v-if` that is
|
|
45781
|
+
false), the cell is empty, never the raw value (the one exception to the
|
|
45782
|
+
empty-slot rule).
|
|
45524
45783
|
|
|
45525
45784
|
Body cell scope: `content` (this cell, formatted), `item` (raw row), `value`
|
|
45526
45785
|
(the row's `item-value`, e.g. its id — not this cell), `classes`, plus the row's interaction surface —
|
|
@@ -45548,7 +45807,8 @@ costs you the built-in sort button. The table-wide pair `#header:prepend` /
|
|
|
45548
45807
|
structural select/actions cells); both forms receive the header scope above
|
|
45549
45808
|
plus `columnKey` (the raw column key) so a table-wide template can branch per
|
|
45550
45809
|
column. When both a per-column and the table-wide slot are provided for the
|
|
45551
|
-
same side, the per-column one wins for that column — they never stack
|
|
45810
|
+
same side, the per-column one wins for that column — they never stack; one
|
|
45811
|
+
that renders nothing for its column falls back to the table-wide one. Affixes
|
|
45552
45812
|
render even beside a full `#<key>:header` replacement (the same rule as
|
|
45553
45813
|
BbDropdown's `#<value>:prepend/append`). The key always comes first, so a
|
|
45554
45814
|
column keyed `prepend` still owns `#prepend:header`, and `#header:prepend`
|
|
@@ -45875,9 +46135,10 @@ There is no `error-text` prop and no `empty-text` alias — don't guess either
|
|
|
45875
46135
|
by analogy with `loading-text`. A failed _server_ visit (Inertia, a full-page
|
|
45876
46136
|
load) is a full error page, not something the table renders inline. A failed
|
|
45877
46137
|
_client-side_ fetch is the table's own: an `items` provider function that
|
|
45878
|
-
throws clears the rows and the
|
|
45879
|
-
load items"),
|
|
45880
|
-
Async items and filters)
|
|
46138
|
+
throws clears the rows and the table shows its failure row: `failed-text`
|
|
46139
|
+
("Couldn't load items"), announced, then a "Try again" button that runs the
|
|
46140
|
+
failed call again (see § Async items and filters). `#empty` is for an empty
|
|
46141
|
+
result only — don't catch the error yourself.
|
|
45881
46142
|
|
|
45882
46143
|
**Skeletons and a custom empty state**
|
|
45883
46144
|
|
|
@@ -45969,11 +46230,9 @@ type BbTableItemsContext = {
|
|
|
45969
46230
|
- A newer call aborts the one in flight and its late answer is dropped. A
|
|
45970
46231
|
provider **throws** to fail — never `return []`, an applied empty result:
|
|
45971
46232
|
the rows are cleared (stale rows never sit under a new filter), nothing is
|
|
45972
|
-
pruned, and the
|
|
45973
|
-
|
|
45974
|
-
|
|
45975
|
-
becomes an `Error`), and `null` when nothing failed. Retry by bumping a
|
|
45976
|
-
counter you list in `dependencies`.
|
|
46233
|
+
pruned, and the failure row shows `failed-text` ("Couldn't load items")
|
|
46234
|
+
with a built-in "Try again" (on click only; focus then moves to the table).
|
|
46235
|
+
`#empty` never renders for a failure.
|
|
45977
46236
|
- Return the page as it is: the table never merges the selection into it.
|
|
45978
46237
|
- A plain array bypasses the provider machinery entirely.
|
|
45979
46238
|
|
|
@@ -47714,8 +47973,9 @@ being pinned.
|
|
|
47714
47973
|
A pinned cell is opaque — it paints the table's `--bg` surface because it
|
|
47715
47974
|
slides over its siblings — so a nested table sitting on a tinted expand row
|
|
47716
47975
|
(`--bb-muted` is the usual choice) shows white pinned actions unless you tell
|
|
47717
|
-
it which surface it is on: `.nest .bb-table { --bg: var(--bb-muted); }`.
|
|
47718
|
-
|
|
47976
|
+
it which surface it is on: `.nest .bb-table { --bg: var(--bb-muted); }`. A
|
|
47977
|
+
nested table paints no surface of its own, so its pinned cells are the only
|
|
47978
|
+
place its `--bg` shows (see **Styling hooks**).
|
|
47719
47979
|
|
|
47720
47980
|
#### Flush tables + inherited widths: mind the edge padding
|
|
47721
47981
|
|
|
@@ -48640,8 +48900,9 @@ Four rules:
|
|
|
48640
48900
|
positional, so a lone left-pinned column dragged to the middle sticks at
|
|
48641
48901
|
`left: 0` and slides over the columns before it — by design; lock the
|
|
48642
48902
|
pinned columns in place by normalizing `@update:order` if you need to.
|
|
48643
|
-
- **Pinned cells are opaque** — they paint the table's `--bg
|
|
48644
|
-
|
|
48903
|
+
- **Pinned cells are opaque** — they paint the table's `--bg`, the same
|
|
48904
|
+
colour the whole table paints (see Styling hooks), so they always match
|
|
48905
|
+
the cells beside them. Under a glass
|
|
48645
48906
|
theme (a translucent `--bb-panel`) the alpha is forced to 1, so the rows
|
|
48646
48907
|
never show through: the pinned column and the stuck header read as a solid
|
|
48647
48908
|
band.
|
|
@@ -48764,13 +49025,11 @@ const rows: Entry[] = Array.from({ length: 5000 }, (_, i) => ({
|
|
|
48764
49025
|
|
|
48765
49026
|
### Styling hooks
|
|
48766
49027
|
|
|
48767
|
-
**The table
|
|
48768
|
-
`.bb-table
|
|
48769
|
-
|
|
48770
|
-
|
|
48771
|
-
|
|
48772
|
-
as a hole). When a table sits on a surface that is not the panel colour, set
|
|
48773
|
-
the one knob and everything pinned follows:
|
|
49028
|
+
**The table paints `--bg`** (default `var(--bb-panel)`), a local on
|
|
49029
|
+
`.bb-table`: the whole table is one solid surface, and the stuck header band
|
|
49030
|
+
and pinned (`fixed`) cells paint the same colour, so they never stand out.
|
|
49031
|
+
Rows and cells stay transparent so hover, highlight and row tones lay over
|
|
49032
|
+
it. To blend into a different surface, set it once:
|
|
48774
49033
|
|
|
48775
49034
|
```css
|
|
48776
49035
|
.my-card .bb-table {
|
|
@@ -48778,6 +49037,8 @@ the one knob and everything pinned follows:
|
|
|
48778
49037
|
}
|
|
48779
49038
|
```
|
|
48780
49039
|
|
|
49040
|
+
A nested table paints nothing; it sits on its parent's rows.
|
|
49041
|
+
|
|
48781
49042
|
**The row hover.** A hovered row takes a faint wash, the hovered row's pinned
|
|
48782
49043
|
cells included. Retint it or switch it off with one local on the table, never
|
|
48783
49044
|
with a `hover:bg-*` on `pt:row`: a pinned cell can only inherit its row's
|
|
@@ -48789,6 +49050,25 @@ colour, so a transparent one lets the scrolled columns show through it.
|
|
|
48789
49050
|
}
|
|
48790
49051
|
```
|
|
48791
49052
|
|
|
49053
|
+
**A resting row tone** (overdue, archived, a status): set `--row-tone` to a
|
|
49054
|
+
colour on the row, never a `bg-*`. The table lays a faint layer of it (8%)
|
|
49055
|
+
over the row, so hover and highlighted still darken it, and pinned cells,
|
|
49056
|
+
the keyboard-lifted row and the dragged copy show the same colour.
|
|
49057
|
+
|
|
49058
|
+
```vue
|
|
49059
|
+
<BbTable
|
|
49060
|
+
:items="rows"
|
|
49061
|
+
:columns="cols"
|
|
49062
|
+
:pt:row="({ item }) => (item.overdue ? '[--row-tone:var(--bb-danger)]' : '')"
|
|
49063
|
+
/>
|
|
49064
|
+
```
|
|
49065
|
+
|
|
49066
|
+
`--row-tone-mix` sets the strength (`[--row-tone-mix:4%]`). An open row's
|
|
49067
|
+
expansion is not toned with its row; to tone it, set the same value there:
|
|
49068
|
+
`:pt:expand="({ item }) => (item.overdue ? '[--row-tone:var(--bb-danger)]' : '')"`.
|
|
49069
|
+
A `bg-*` on the row hides hover and highlighted, and pinned cells keep the
|
|
49070
|
+
table surface.
|
|
49071
|
+
|
|
48792
49072
|
**The scroll cue.** While content is hidden past an edge the root carries
|
|
48793
49073
|
`bb-table--overflow-left` / `bb-table--overflow-right`. On a side with no
|
|
48794
49074
|
pinned column a `mask-image` on the root fades that edge (to 30% over 20px,
|
|
@@ -48865,22 +49145,20 @@ Or in CSS, once for the whole app:
|
|
|
48865
49145
|
|
|
48866
49146
|
#### The table as a card
|
|
48867
49147
|
|
|
48868
|
-
The root paints no
|
|
48869
|
-
scrollport. That is exactly what makes a card
|
|
49148
|
+
The root paints `--bg` and no border or radius of its own — it is the
|
|
49149
|
+
scrollport. That is exactly what makes a card two declarations of ordinary
|
|
48870
49150
|
CSS on your own class, with no component change and nothing to keep in sync:
|
|
48871
49151
|
|
|
48872
49152
|
```css
|
|
48873
49153
|
.bb-table.card {
|
|
48874
|
-
background: var(--bg);
|
|
48875
49154
|
border: var(--bb-border-w) solid var(--bb-border);
|
|
48876
49155
|
border-radius: var(--bb-radius-surface);
|
|
48877
49156
|
}
|
|
48878
49157
|
```
|
|
48879
49158
|
|
|
48880
|
-
|
|
48881
|
-
|
|
48882
|
-
|
|
48883
|
-
still retints all three at once.
|
|
49159
|
+
The fill is already there: the card, the stuck header band and the pinned
|
|
49160
|
+
cells all paint `--bg`, so they cannot drift, and `.my-table { --bg: … }`
|
|
49161
|
+
retints them at once.
|
|
48884
49162
|
|
|
48885
49163
|
The radius needs no `overflow` beside it, and **must not be given one**. The
|
|
48886
49164
|
root already clips in both axes (`overflow-x: auto`, and `overflow-y` computes
|
|
@@ -49541,7 +49819,7 @@ for a preset that fits any row type (never `<any>`), not an imported
|
|
|
49541
49819
|
| `id` | `string \| undefined` | | | Stable id for this table's width context. When omitted a unique id is generated. Nested tables use the nearest ancestor id to inherit widths. |
|
|
49542
49820
|
| `inheritColumnWidths` | `string \| boolean \| undefined` | | | Snaps a nested table's columns to an ancestor table's tracks: `true` = the nearest one, a table `id` = that one (when a table in between has a different column count). Off by default: a nested table sizes itself. |
|
|
49543
49821
|
| `interactiveWhileLoading` | `boolean \| undefined` | `false` | | Keeps the header and rows interactive while loading (by default they are `inert`: a refetch is about to replace them). For background refreshes that must not interrupt an open editor. |
|
|
49544
|
-
| `items` | `Item[] \| ((context: BbTableItemsContext) => Item[] \| Promise<Item[]>)` | `[]` | yes | Rows to render: an array, or a provider called with a `BbTableItemsContext` (`reason`, `modelValue`, `signal`), sync or async. A provider fails by THROWING, never by returning `[]`: the rows clear and
|
|
49822
|
+
| `items` | `Item[] \| ((context: BbTableItemsContext) => Item[] \| Promise<Item[]>)` | `[]` | yes | Rows to render: an array, or a provider called with a `BbTableItemsContext` (`reason`, `modelValue`, `signal`), sync or async. A provider fails by THROWING, never by returning `[]`: the rows clear and the failure row shows `failed-text` with "Try again". Return the page as it is. |
|
|
49545
49823
|
| `itemValue` | `ItemAccessor<Item> \| undefined` | | | The row's value, as a property path or a function returning any value; the selection, `expandedItems` and row keys compare by it. |
|
|
49546
49824
|
| `keyboardNavigation` | `boolean \| undefined` | `false` | | Opt-in keyboard navigation: the table becomes an ARIA `grid` (`treegrid` with an `#expand` slot) with ONE tab stop and roving focus over its cells. Controls in cells leave the tab order (Enter/F2 go in). Ignored with a `#tbody` slot. |
|
|
49547
49825
|
| `legend` | `string \| undefined` | | | The `<legend>` of a `selectable` table (it renders as a `<fieldset>`): the selection's accessible name. Falls back to `caption`, then to a localized default. |
|
|
@@ -49635,10 +49913,10 @@ States are listed in precedence order: when two are on at once and their entries
|
|
|
49635
49913
|
|
|
49636
49914
|
- `actions` — scope: `{ expanded?: boolean \| undefined; expandProps?: ExpandControllerProps \| undefined; toggleExpanded?: (() => void) \| undefined; highlighted?: boolean \| undefi…` — Content of each row's actions cell; this slot CREATES the actions column (there is no prop). The header cell (labelled by `actions-text`, replaceable through `#actions:header`) and one cell per row come and go with it. Pin it with `fixed-actions`.
|
|
49637
49915
|
- `actions:header` — scope: `{ text: string; }` — Replaces the default actions header cell content.
|
|
49638
|
-
- `empty` — scope: `
|
|
49916
|
+
- `empty` — scope: `object` — Content shown when there are no rows and nothing is loading, inside the table's own full-width cell: pass content, never a row. Empty only: a failed load shows the table's failure row instead (its message is `failed-text`, and it ends with "Try again").
|
|
49639
49917
|
- `expand` — scope: `{ expanded: boolean; expandProps?: ExpandControllerProps \| undefined; toggleExpanded: () => void; highlighted?: boolean \| undefined; toggleHighlighted?: (() =…` — Full-width expandable content row rendered below each main row when expanded.
|
|
49640
|
-
- `header:append` — scope: `BbTableHeaderAffixSlotProps<Item>` `{ classes?: Classes; columnKey: string; items?: Item[]; label?: string; sortable?: boolean; sortOrder?: "asc" \| "desc" \| null; toggleSort?: ((event?: MouseEvent \| KeyboardEvent \| undefined) => void); hideColumn?: (() => void) }` — Content after every data column's header content (the label + sort control, or its own `<key>:header` replacement). A column's `<key>:header:append` wins over this for that column; they never stack. Branch on `columnKey` for per-column output.
|
|
49641
|
-
- `header:prepend` — scope: `BbTableHeaderAffixSlotProps<Item>` `{ classes?: Classes; columnKey: string; items?: Item[]; label?: string; sortable?: boolean; sortOrder?: "asc" \| "desc" \| null; toggleSort?: ((event?: MouseEvent \| KeyboardEvent \| undefined) => void); hideColumn?: (() => void) }` — Content before every data column's header content (the label + sort control, or its own `<key>:header` replacement). A column's `<key>:header:prepend` wins over this for that column; they never stack. Branch on `columnKey` for per-column output.
|
|
49918
|
+
- `header:append` — scope: `BbTableHeaderAffixSlotProps<Item>` `{ classes?: Classes; columnKey: string; items?: Item[]; label?: string; sortable?: boolean; sortOrder?: "asc" \| "desc" \| null; toggleSort?: ((event?: MouseEvent \| KeyboardEvent \| undefined) => void); hideColumn?: (() => void) }` — Content after every data column's header content (the label + sort control, or its own `<key>:header` replacement). A column's `<key>:header:append` wins over this for that column; they never stack, unless it renders nothing there. Branch on `columnKey` for per-column output.
|
|
49919
|
+
- `header:prepend` — scope: `BbTableHeaderAffixSlotProps<Item>` `{ classes?: Classes; columnKey: string; items?: Item[]; label?: string; sortable?: boolean; sortOrder?: "asc" \| "desc" \| null; toggleSort?: ((event?: MouseEvent \| KeyboardEvent \| undefined) => void); hideColumn?: (() => void) }` — Content before every data column's header content (the label + sort control, or its own `<key>:header` replacement). A column's `<key>:header:prepend` wins over this for that column; they never stack, unless it renders nothing there. Branch on `columnKey` for per-column output.
|
|
49642
49920
|
- `loading` — scope: `{ items: Item[]; }` — Content shown while table rows are loading (replaces the skeleton rows).
|
|
49643
49921
|
- `select` — scope: `{ item: Item; value: TableValueOf<Item, A>; checked: boolean; disabled: boolean; inputName: string; readonly: boolean; toggleSelected?: (() => void) \| undefine…` — Replaces the default checkbox/radio in the selection cell for each row.
|
|
49644
49922
|
- `select:header` — scope: `{ multiple: boolean; selectAll: boolean; text: string; }` — Replaces the default selection header cell content (checkbox or radio label).
|
|
@@ -49647,8 +49925,8 @@ States are listed in precedence order: when two are on at once and their entries
|
|
|
49647
49925
|
- `thead` — scope: `{ empty: boolean; }` — Replaces the header row group's content (`.bb-table__head`). The table is a CSS grid: provide `<div role="row">` rows of `<div role="columnheader">` cells, never `<tr>` / `<th>`.
|
|
49648
49926
|
- `#<key>` (named from data) — scope: `object` — One column's body cell in every row, by the column `key` through `slotKey`. Scope: `{ item, value, content, selected, expanded, highlighted, classes, sortOrder, toggleSelected, toggleExpanded, toggleHighlighted, expandProps }`; `content` is this cell, `value` the row's `item-value`. Reserved names (their slot is one of this component's own, so an item value or column key spelled like them is an error): `actions`, `empty`, `expand`, `loading`, `select`, `tbody`, `tfoot`, `thead`.
|
|
49649
49927
|
- `#<key>:header` (named from data) — scope: `object` — One column's header content, replacing its label and the built-in sort button. Scope: `{ label, items, sortable, sortOrder, toggleSort, hideColumn, classes }`.
|
|
49650
|
-
- `#<key>:header:prepend` (named from data) — scope: `BbTableHeaderAffixSlotProps<Item>` — Content before one column's header, keeping the sort button; beats `header:prepend` (they never stack).
|
|
49651
|
-
- `#<key>:header:append` (named from data) — scope: `BbTableHeaderAffixSlotProps<Item>` — Content after one column's header, keeping the sort button; beats `header:append` (they never stack).
|
|
49928
|
+
- `#<key>:header:prepend` (named from data) — scope: `BbTableHeaderAffixSlotProps<Item>` — Content before one column's header, keeping the sort button; beats `header:prepend` (they never stack) unless it renders nothing.
|
|
49929
|
+
- `#<key>:header:append` (named from data) — scope: `BbTableHeaderAffixSlotProps<Item>` — Content after one column's header, keeping the sort button; beats `header:append` (they never stack) unless it renders nothing.
|
|
49652
49930
|
- `#<key>:first` (named from data) — scope: `BbTableEdgeCellSlotProps<Item>` — One column's cell in a row before the data rows; any such slot creates the row, aligned with the columns. Only over rows.
|
|
49653
49931
|
- `#<key>:last` (named from data) — scope: `BbTableEdgeCellSlotProps<Item>` — One column's cell in a row after the data rows (a totals row); any such slot creates that row, aligned like `<key>:first`.
|
|
49654
49932
|
|
|
@@ -49659,8 +49937,10 @@ Set these on the element, or on a class you put on it, to retune this component
|
|
|
49659
49937
|
| Property | Set on | Default | What it is |
|
|
49660
49938
|
| --- | --- | --- | --- |
|
|
49661
49939
|
| `--min-w` | `.bb-table` | `0px` | |
|
|
49662
|
-
| `--bg` | `.bb-table` | `var(--bb-panel)` | The table's surface colour.
|
|
49940
|
+
| `--bg` | `.bb-table` | `var(--bb-panel)` | The table's surface colour. A root table PAINTS it (below), so the whole table is one solid surface: pinned cells, the stuck head band and the rows between them always match, whatever the table sits on. Set it on the table (`.my-table { --bg: … }`) to blend into another surface. Rows and cells stay transparent so the row states and tones lay over it; a nested table re-declares its own and paints nothing (it sits on its parent's rows). |
|
|
49663
49941
|
| `--row-hover` | `.bb-table` | `var(--bb-surface-hover)` | The row hover's fill: the faint wash by default. Retint it or switch it off here (`transparent`), never with a `hover:bg-*` on the row: a pinned cell can only inherit the row's colour, and a transparent one would let the scrolled cells show through it. This one knob reaches the row and its pinned cells alike. |
|
|
49942
|
+
| `--row-tone` | `.bb-table` | `initial` | A row's resting tone: set `--row-tone` on a row (`pt:row`, `row-class`) on an open row's expansion (`pt:expand`) or on a `#<key>:first` / `:last` row (`pt:firstRow` / `pt:lastRow`), never a `bg-*`. It paints as one translucent layer (`--row-tone-mix` of the colour) ABOVE every state fill, so hover and highlighted still show through it, and pinned cells and sticky rows lay the same layer over their opaque base. Re-declared on every table, so a table nested in a toned row starts untoned (the row's value would otherwise inherit into it). |
|
|
49943
|
+
| `--row-tone-mix` | `.bb-table` | `8%` | |
|
|
49664
49944
|
| `--px` | `.bb-table` | `12px` | |
|
|
49665
49945
|
| `--cell-h` | `.bb-table` | `36px` | |
|
|
49666
49946
|
| `--py` | `.bb-table` | `6px` | |
|
|
@@ -49689,6 +49969,7 @@ Set these on the element, or on a class you put on it, to retune this component
|
|
|
49689
49969
|
| `--cue-w` | `.bb-table` | `8px` | |
|
|
49690
49970
|
| `--cue` | `.bb-table` | `rgb(0 0 0 / 0.1)` | |
|
|
49691
49971
|
| `--row-bg` | `.bb-table__row--lifted` | `var(--bb-panel)` | |
|
|
49972
|
+
| `--tone` | `.bb-table__row` | `color-mix( in oklab, var(--row-tone, transparent) var(--row-tone-mix), transpare…` | |
|
|
49692
49973
|
|
|
49693
49974
|
## Component tree
|
|
49694
49975
|
|
|
@@ -55344,7 +55625,8 @@ const opensAt = ref<string | null>(null);
|
|
|
55344
55625
|
|
|
55345
55626
|
The value is typed `string | string[] | null` in either mode. `v-model` needs
|
|
55346
55627
|
nothing: bind a `ref<string | null>` for one time, a `ref<string[]>` for a
|
|
55347
|
-
range (always an array, `[]` when empty).
|
|
55628
|
+
range (always an array, `[]` when empty). With no `v-model` at all the picker keeps the picked value itself, like a
|
|
55629
|
+
native input, and still emits `update:modelValue`. An explicit `@update:model-value`
|
|
55348
55630
|
handler narrows in one line:
|
|
55349
55631
|
|
|
55350
55632
|
```ts no-check
|
|
@@ -55479,6 +55761,15 @@ Reach for the **component** (slot or `activator` prop) when you want the
|
|
|
55479
55761
|
the directive is the shortcut for the bare-trigger cell case, not a replacement
|
|
55480
55762
|
for the component's `v-model` in a form.
|
|
55481
55763
|
|
|
55764
|
+
### Opening from code: `v-model:open`
|
|
55765
|
+
|
|
55766
|
+
`v-model` is the value; `v-model:open` is whether the time panel is open. Bound,
|
|
55767
|
+
your ref opens and closes it, and every open and close the user makes is
|
|
55768
|
+
written back: a pick, Escape, a click outside, the phone sheet's own dismiss. A static `:open` with no
|
|
55769
|
+
listener is only the initial state. An open from code is the same open a
|
|
55770
|
+
click makes, and `disabled` / `readonly` refuse it (the ref is set back
|
|
55771
|
+
to `false`).
|
|
55772
|
+
|
|
55482
55773
|
### Relationship to BbTimePickerInput
|
|
55483
55774
|
|
|
55484
55775
|
`BbTimePickerInput` _is_ these columns with a segmented text field wrapped around
|
|
@@ -55562,7 +55853,8 @@ typeahead. Always pass a `label` when the trigger is an unlabelled cell or icon.
|
|
|
55562
55853
|
## v-model
|
|
55563
55854
|
|
|
55564
55855
|
- `v-model:activeSegment` — type: `BbTimePickerSegment \| undefined`
|
|
55565
|
-
- `v-model` — type: `string \| string[] \| null`
|
|
55856
|
+
- `v-model` — type: `string \| string[] \| null \| undefined`
|
|
55857
|
+
- `v-model:open` — type: `boolean \| undefined`
|
|
55566
55858
|
|
|
55567
55859
|
## Props
|
|
55568
55860
|
|
|
@@ -55581,9 +55873,10 @@ typeahead. Always pass a `label` when the trigger is an unlabelled cell or icon.
|
|
|
55581
55873
|
| `label` | `string \| undefined` | | | Accessible label. The activator is named by it followed by the activator's own text ("Due date 12 Sep"), through `aria-labelledby`. |
|
|
55582
55874
|
| `max` | `string \| undefined` | | | Maximum selectable time, `HH:mm` (other shapes throw at setup). The columns disable the entries no in-range time can use; a typed value (or an hour beside an out-of-range minute) is clamped with a `disabled_time` error. |
|
|
55583
55875
|
| `min` | `string \| undefined` | | | Minimum selectable time, `HH:mm` (other shapes throw at setup). The columns disable the entries no in-range time can use; a typed value (or an hour beside an out-of-range minute) is clamped with a `disabled_time` error. |
|
|
55584
|
-
| `modelValue` | `string \| string[] \| null` | |
|
|
55876
|
+
| `modelValue` | `string \| string[] \| null \| undefined` | | | v-model value: `null` for empty, a 24-hour `HH:mm` (or `HH:mm:ss` with `seconds`) string, or a two-element `[start, end]` array when `range` is true. |
|
|
55585
55877
|
| `offCanvasProps` | `Partial<BbOffCanvasProps> \| undefined` | | | Props for the phone sheet (the `BbOffCanvas` that `adaptive` renders on mobile), spread over its defaults. A `pt` inside it styles only the sheet (passthrough guide § Inside the sheet). The sheet hides its ✕; `{ hideClose: false }` brings it back. |
|
|
55586
55878
|
| `offset` | `number \| undefined` | `4` | | Space the popover keeps from the activator. |
|
|
55879
|
+
| `open` | `boolean \| undefined` | `false` | | Whether the panel is open (`v-model:open`; `v-model` stays the value). Bound, the app opens and closes it; unbound, the initial state. |
|
|
55587
55880
|
| `padding` | `number \| undefined` | | | Minimum empty space to keep from the edge of the page. |
|
|
55588
55881
|
| `placement` | `'start'` \| `'end'` \| `'top'` \| `'bottom'` \| `'left'` \| `'right'` \| `'top-start'` \| `'top-end'` \| `'right-start'` \| `'right-end'` \| `'bottom-start'` \| `'bottom-end'` \| `'left-start'` \| `'left-end'` \| `'start-start'` \| `'start-end'` \| `'end-start'` \| `'end-end'` | | | Position of the popover relative to the activator/anchor. |
|
|
55589
55882
|
| `range` | `boolean` | `false` | | Range selection: the value is a two-element `[start, end]` array. |
|
|
@@ -55623,6 +55916,7 @@ States are listed in precedence order: when two are on at once and their entries
|
|
|
55623
55916
|
- `time-pick` — `(payload: { unit: TimeUnit; value: string; }): void` — Relay of the raw column pick, before this component combines it into the value. A host binds this to run its own engine; clean consumers ignore it.
|
|
55624
55917
|
- `update:activeSegment` — `(value: BbTimePickerSegment): void` — The active range end changed (range only).
|
|
55625
55918
|
- `update:modelValue` — `(value: string \| string[] \| null): void` — Emitted when the selected time changes (single/range/null).
|
|
55919
|
+
- `update:open` — `(value: boolean): void` — The panel opened or closed (`v-model:open`).
|
|
55626
55920
|
|
|
55627
55921
|
## Slots
|
|
55628
55922
|
|
|
@@ -55799,7 +56093,9 @@ and parses its own digits. Any other attribute lands on the field root; a
|
|
|
55799
56093
|
|
|
55800
56094
|
`min` / `max` (`HH:mm`) clamp typed times when interaction ends — the value
|
|
55801
56095
|
snaps to the nearest bound and an `error` event with code `disabled_time`
|
|
55802
|
-
fires (`{ original, normalized }`).
|
|
56096
|
+
fires (`{ original, normalized }`). A value your app sets past a bound stays
|
|
56097
|
+
as it is while nobody touches the field; once the user focuses it and leaves,
|
|
56098
|
+
it is clamped like a typed one. In `range` mode the model is `[start,
|
|
55803
56099
|
end]`; typing an inverted pair swaps it on blur with the usual
|
|
55804
56100
|
`end_before_start` error.
|
|
55805
56101
|
|
|
@@ -55828,6 +56124,15 @@ title and ✕: none of the input's own parts reach inside the sheet). `disableWr
|
|
|
55828
56124
|
interaction, and a tap anywhere on the field opens them (Enter or Space too;
|
|
55829
56125
|
the ✕ still only clears).
|
|
55830
56126
|
|
|
56127
|
+
### Opening from code: `v-model:open`
|
|
56128
|
+
|
|
56129
|
+
`v-model` is the value; `v-model:open` is whether the time panel is open. Bound,
|
|
56130
|
+
your ref opens and closes it, and every open and close the user makes is
|
|
56131
|
+
written back: a pick, Escape, a click outside, the phone sheet's own dismiss. A static `:open` with no
|
|
56132
|
+
listener is only the initial state. An open from code is the same open a
|
|
56133
|
+
click makes, and `disabled` / `readonly` refuse it (the ref is set back
|
|
56134
|
+
to `false`).
|
|
56135
|
+
|
|
55831
56136
|
### Events & v-model
|
|
55832
56137
|
|
|
55833
56138
|
| Event | Payload | When |
|
|
@@ -55961,6 +56266,7 @@ Messages _also_ render in an `aria-live="polite"` region.
|
|
|
55961
56266
|
## v-model
|
|
55962
56267
|
|
|
55963
56268
|
- `v-model` — type: `string \| string[] \| null \| undefined`
|
|
56269
|
+
- `v-model:open` — type: `boolean \| undefined`
|
|
55964
56270
|
|
|
55965
56271
|
## Props
|
|
55966
56272
|
|
|
@@ -55996,6 +56302,7 @@ Messages _also_ render in an `aria-live="polite"` region.
|
|
|
55996
56302
|
| `modelValue` | `string \| string[] \| null \| undefined` | | | v-model value: `null` for empty, a 24-hour `HH:mm` (or `HH:mm:ss` with `seconds`) string, or a two-element array when `range` is true. |
|
|
55997
56303
|
| `name` | `string \| undefined` | | | Defines the name of the input. |
|
|
55998
56304
|
| `offCanvasProps` | `Partial<BbOffCanvasProps> \| undefined` | | | Props for the phone sheet (the `BbOffCanvas` that `adaptive` renders on mobile), spread over its defaults. A `pt` inside it styles only the sheet (passthrough guide § Inside the sheet). The sheet hides its ✕; `{ hideClose: false }` brings it back. |
|
|
56305
|
+
| `open` | `boolean \| undefined` | `false` | | Whether the panel is open (`v-model:open`; `v-model` stays the value). Bound, the app opens and closes it; unbound, the initial state. |
|
|
55999
56306
|
| `persistentHint` | `boolean \| undefined` | `false` | | Keeps the hint displayed. |
|
|
56000
56307
|
| `placeholder` | `string \| undefined` | | | Text shown while the field is empty. |
|
|
56001
56308
|
| `prepend:icon` | `string \| undefined` | | | Name of the icon to be added at the start of the input. |
|
|
@@ -56064,6 +56371,7 @@ States are listed in precedence order: when two are on at once and their entries
|
|
|
56064
56371
|
- `show` — `(): void` — Emitted as soon as the time panel (the popover, or the sheet on a phone) starts to open.
|
|
56065
56372
|
- `shown` — `(): void` — Emitted once the time panel is open and its open transition has finished.
|
|
56066
56373
|
- `update:modelValue` — `(value: string \| string[] \| null): void` — Emitted whenever the selected time changes. `null` for cleared values, a `HH:mm(:ss)` string, or an array in range mode.
|
|
56374
|
+
- `update:open` — `(value: boolean): void` — The panel opened or closed (`v-model:open`).
|
|
56067
56375
|
|
|
56068
56376
|
## Slots
|
|
56069
56377
|
|
|
@@ -56481,8 +56789,9 @@ positions form independent stacks.
|
|
|
56481
56789
|
### Action buttons
|
|
56482
56790
|
|
|
56483
56791
|
Pass an `actions` array to render buttons in a row below the text. While a
|
|
56484
|
-
button's `onClick` runs it shows a spinner, its siblings
|
|
56485
|
-
|
|
56792
|
+
button's `onClick` runs it shows a spinner, its siblings ignore clicks (they
|
|
56793
|
+
keep their look and leave the tab order), and the auto-dismiss countdown is
|
|
56794
|
+
held; the toast dismisses itself when the callback
|
|
56486
56795
|
resolves. A rejected callback keeps the toast open and the countdown resumes.
|
|
56487
56796
|
Defaults per button: `variant: 'primary'`, `size: 'sm'`. An action's `text`
|
|
56488
56797
|
is its button label; the toast's own `text` is the body copy above them.
|
|
@@ -56990,7 +57299,7 @@ Set these on the element, or on a class you put on it, to retune this component
|
|
|
56990
57299
|
|
|
56991
57300
|
## Slots
|
|
56992
57301
|
|
|
56993
|
-
- `default` — scope: `BbToastPortalContext
|
|
57302
|
+
- `default` — scope: `BbToastPortalContext<any>` `{ toast: BbToast; data: P; close: () => void }` — The toast's body, rendered per toast with its own context.
|
|
56994
57303
|
|
|
56995
57304
|
## See Also
|
|
56996
57305
|
|
|
@@ -58221,6 +58530,10 @@ and `#<depth>:children` slots that **replace the children container** of the
|
|
|
58221
58530
|
matching node — the recursion stops there and your content renders instead,
|
|
58222
58531
|
useful for a custom layout or an inline empty state under one branch.
|
|
58223
58532
|
|
|
58533
|
+
A slot that renders nothing for a node (its content behind a `v-if` that is
|
|
58534
|
+
false there) is skipped: `#<value>` falls to `#<depth>`, then `default`; an
|
|
58535
|
+
empty `:children` slot leaves that node its default children.
|
|
58536
|
+
|
|
58224
58537
|
**Sections, pages and a special trash node**
|
|
58225
58538
|
|
|
58226
58539
|
```vue
|
|
@@ -58966,7 +59279,7 @@ States are listed in precedence order: when two are on at once and their entries
|
|
|
58966
59279
|
- `default` — scope: `BbTreeNodeSlotProps<Meta>` `{ meta: Meta; item: BbTreeItem<Meta>; parent?: BbTreeItem<Meta>; index: number; depth: number; value: any; expanded: boolean; expandable: boolean; toggleExpanded: () => void; expandProps: BbTreeExpandControllerProps }`
|
|
58967
59280
|
- `#<value>` (named from data) — scope: `BbTreeNodeSlotProps<Meta>` — One node, by its resolved `item-value` (string or number) through `slotKey`; beats `<depth>`, which beats `default`. Reserved names (their slot is one of this component's own, so an item value or column key spelled like them is an error): `default`.
|
|
58968
59281
|
- `#<depth>` (named from data) — scope: `BbTreeNodeSlotProps<Meta>` — Every node at one depth (`0` = root); a numeric value can share this name. Reserved names (their slot is one of this component's own, so an item value or column key spelled like them is an error): `default`.
|
|
58969
|
-
- `#<value>:children` (named from data) — scope: `BbTreeNodeSlotProps<Meta>` — One node's children container, stopping the recursion there; beats `<depth>:children`. Renders for leaves too.
|
|
59282
|
+
- `#<value>:children` (named from data) — scope: `BbTreeNodeSlotProps<Meta>` — One node's children container, stopping the recursion there; beats `<depth>:children`. Renders for leaves too; empty, the default children.
|
|
58970
59283
|
- `#<depth>:children` (named from data) — scope: `BbTreeNodeSlotProps<Meta>` — The children container of every node at one depth.
|
|
58971
59284
|
|
|
58972
59285
|
## CSS custom properties
|
|
@@ -59365,6 +59678,7 @@ Set these on the element, or on a class you put on it, to retune this component
|
|
|
59365
59678
|
| `anchor` | `ElementOrComponentRef \| VirtualAnchor \| undefined` | | | The element the popover positions itself relative to. Accepts an HTMLElement, a Vue component ref, or a virtual element with a `getBoundingClientRect` method. |
|
|
59366
59679
|
| `arrowPadding` | `number \| undefined` | | | Space the arrow will maintain to the edge of the dropdown. Useful when the floating element has border radius so it won't appear broken |
|
|
59367
59680
|
| `boundary` | `ElementOrComponentRefOrSelector \| undefined` | | | Keeps the popover inside this element alongside its anchor (sideways above or below, vertically beside it); away from the anchor it may pass the edge, and only the viewport flips it. It never clamps the size (that is `overflowBoundary`). An HTMLElement, component ref or selector. |
|
|
59681
|
+
| `boundaryX` | `Element \| undefined` | | | Internal: keeps the popover inside this element's left and right edges only; its top and bottom stay the viewport's. Ignored when `boundary` is set. A dropdown inside a table passes the table. |
|
|
59368
59682
|
| `bubbleAttrs` | `Record<string, unknown> \| ((space: CommonPopoverAvailableSpace) => Record<string, unknown>) \| undefined` | | | Attributes bound on the bubble (`class`, `style`, `inert`, …) after its own class, so the owner can make the bubble its layout container. The function form receives the default slot's free space (for a height cap). |
|
|
59369
59683
|
| `dialog` | `boolean \| undefined` | `false` | | Renders the popover as a `<dialog>` element (modal overlay) instead of a `<span>` with the Popover API. |
|
|
59370
59684
|
| `disableFlip` | `boolean \| undefined` | `false` | | Disables the automatic flip to the opposite side when the popover would overflow (flipping is on by default). |
|
|
@@ -61608,8 +61922,8 @@ buttons: `text`, `variant` — default `'primary'` —, `size` — default `'sm'
|
|
|
61608
61922
|
`prepend:icon`/`append:icon`, `iconOnly` (the icon alone, `text` its
|
|
61609
61923
|
accessible name), `block`, `onClick`; confirm buttons
|
|
61610
61924
|
default to `'outline'` / `'md'` instead). While a button's
|
|
61611
|
-
`onClick` runs it shows a spinner, siblings
|
|
61612
|
-
countdown is held; the toast dismisses itself (reason `'action'`) when the
|
|
61925
|
+
`onClick` runs it shows a spinner, siblings ignore clicks (keeping their look),
|
|
61926
|
+
and the auto-dismiss countdown is held; the toast dismisses itself (reason `'action'`) when the
|
|
61613
61927
|
callback resolves. A rejected callback keeps the toast open and the countdown
|
|
61614
61928
|
resumes.
|
|
61615
61929
|
|
|
@@ -61782,6 +62096,7 @@ Set these on the element, or on a class you put on it, to retune this component
|
|
|
61782
62096
|
- `focused:change` — `(id: string \| undefined): void` — Emitted when the keyboard-focused option changes.
|
|
61783
62097
|
- `option:selected` — `(option: Option): void` — Emitted when an option is selected by the user.
|
|
61784
62098
|
- `option:unselected` — `(option: Option): void` — Emitted when a previously selected option is deselected.
|
|
62099
|
+
- `retry` — `(event: MouseEvent): void` — The failure footer's "Try again" was pressed: the host runs the failed load again.
|
|
61785
62100
|
|
|
61786
62101
|
## Slots
|
|
61787
62102
|
|
|
@@ -61860,6 +62175,7 @@ Set these on the element, or on a class you put on it, to retune this component
|
|
|
61860
62175
|
- `focused:change` — `(id: string \| undefined): void` — Emitted when the keyboard-focused option changes.
|
|
61861
62176
|
- `option:selected` — `(option: Option): void` — Emitted when an option is selected by the user.
|
|
61862
62177
|
- `option:unselected` — `(option: Option): void` — Emitted when a previously selected option is deselected.
|
|
62178
|
+
- `retry` — `(event: MouseEvent): void` — The failure footer's "Try again" was pressed: the host runs the failed load again.
|
|
61863
62179
|
|
|
61864
62180
|
## Slots
|
|
61865
62181
|
|
|
@@ -62148,7 +62464,7 @@ Where the option goes: [Installation and Plugin Setup](https://llms-bitboss-ui.b
|
|
|
62148
62464
|
|
|
62149
62465
|
## Overlay Open-State Rule
|
|
62150
62466
|
|
|
62151
|
-
Open a dialog or sheet **without** owning its state: give `BbDialog` / `BbOffCanvas` an `id` and put `v-bb-dialog="'edit'"` / `v-bb-off-canvas="'filters'"` on the button (`useBbDialog('edit')` in code); a dialog in its own file, or one per row's data, opens on demand with `useBbDialog(Component).show(data)`; a yes/no is `useConfirm`. Which one: [BbDialog](https://llms-bitboss-ui.bitboss.it/dist/ai/BbDialog.md) § Which one?. A boolean `v-model` is the fallback for state your page already holds — never a separate `v-model:open`. `BbPopover` and `
|
|
62467
|
+
Open a dialog or sheet **without** owning its state: give `BbDialog` / `BbOffCanvas` an `id` and put `v-bb-dialog="'edit'"` / `v-bb-off-canvas="'filters'"` on the button (`useBbDialog('edit')` in code); a dialog in its own file, or one per row's data, opens on demand with `useBbDialog(Component).show(data)`; a yes/no is `useConfirm`. Which one: [BbDialog](https://llms-bitboss-ui.bitboss.it/dist/ai/BbDialog.md) § Which one?. A boolean `v-model` is the fallback for state your page already holds — never a separate `v-model:open`. `BbPopover`, `BbTooltip` and `BbDropdown` also take a boolean `v-model`. A component whose `v-model` is its value (`BbSelect`, `BbSelectPopover`, `BbDropdownButton`, the date / time / colour pickers and inputs) takes `v-model:open` for its panel; a value-less overlay never does.
|
|
62152
62468
|
|
|
62153
62469
|
These overlays also return focus to their trigger element on close, by documented default — a consumer `@focus`-reopen handler on that trigger will fight the restore and can loop.
|
|
62154
62470
|
|
|
@@ -62214,13 +62530,17 @@ the field keeps it a string (`''`).
|
|
|
62214
62530
|
Boolean props default to `false` so the bare `<Comp foo>` shorthand turns the feature **on**. A few props deliberately default to `true` for cross-library keyword clarity — pass `:prop="false"` to opt out:
|
|
62215
62531
|
|
|
62216
62532
|
- `multiple` on `BbTable`, `BbCheckboxGroup`, `BbSwitchGroup` — multi-select is the expected default; `:multiple="false"` forces single-select.
|
|
62217
|
-
- `selectable` on the option components (`BbSelect`, `BbSelectPopover`, `BbCheckboxGroup`, `BbRadioGroup`, `BbSwitchGroup`) — options are selectable by default; pass a predicate or `false` to restrict. **Not `BbTable`**: there `selectable` is unset by default and
|
|
62218
|
-
- `modelValue` on `BbAlert` — an uncontrolled alert
|
|
62533
|
+
- `selectable` on the option components (`BbSelect`, `BbSelectPopover`, `BbCheckboxGroup`, `BbRadioGroup`, `BbSwitchGroup`) — options are selectable by default; pass a predicate or `false` to restrict. **Not `BbTable`**: there `selectable` is unset by default and renders the selection column, so off means no checkboxes.
|
|
62534
|
+
- `modelValue` on `BbAlert` — an uncontrolled alert shows on mount; its `v-model` exists to dismiss it.
|
|
62219
62535
|
- `trueValue` on `BbButton` — the value a `v-model` toggle commits when on (`true` is the natural on-value), not a feature flag.
|
|
62220
62536
|
|
|
62221
62537
|
These are the only intentional default-`true` booleans — exactly the exemptions `check-api` whitelists; anywhere else, `true` default is a bug (`check-api` flags it).
|
|
62222
62538
|
|
|
62223
|
-
**Arrows are tooltip-only in v3.** `hideArrow` / `showArrow` / `arrowPadding` were removed from `BbPopover`, `BbSelectPopover`, `BbColorPalette
|
|
62539
|
+
**Arrows are tooltip-only in v3.** `hideArrow` / `showArrow` / `arrowPadding` were removed from `BbPopover`, `BbSelectPopover`, `BbColorPalette` and `BbDropdown` (leftovers land in `$attrs`). `BbTooltip` keeps `hideArrow` (default `false`) and `arrowPadding` (default `10`). See [bb-popover.md](https://llms-bitboss-ui.bitboss.it/dist/ai/guides/migration/components/bb-popover.md).
|
|
62540
|
+
|
|
62541
|
+
## Empty Slot Rule
|
|
62542
|
+
|
|
62543
|
+
A slot that renders nothing (a `v-if` false there) counts as absent: the next more general slot draws, then the default (`prepend:icon`, label, children). Exception: a `BbTable` `#<key>` cell slot owns its cell.
|
|
62224
62544
|
|
|
62225
62545
|
## Testing Against bitboss-ui
|
|
62226
62546
|
|
|
@@ -64772,6 +65092,19 @@ zero specificity, so a class you put on the panel (`pt:panel`, `pt:root`,
|
|
|
64772
65092
|
`class` on a dialog) or on its content wins. To style a surface like its
|
|
64773
65093
|
activator again, set the styles on that part.
|
|
64774
65094
|
|
|
65095
|
+
### Avatar palette
|
|
65096
|
+
|
|
65097
|
+
`BbAvatar`'s `color` paints the fallback from a palette: ten hues, one picked
|
|
65098
|
+
per person from a stable hash of the `name`, and one fill / ink pair per
|
|
65099
|
+
scheme built as `oklch(L C <hue>)`. Every pair measures over 6:1. A theme
|
|
65100
|
+
moves a hue or the pair; keep the 4.5:1 budget.
|
|
65101
|
+
|
|
65102
|
+
| Token | Default (light) | Dark | Meaning |
|
|
65103
|
+
| --- | --- | --- | --- |
|
|
65104
|
+
| `--bb-avatar-hue-coral` … `--bb-avatar-hue-rose` | 25 … 355 | same | The ten hues in degrees: coral 25, tangerine 55, sunflower 85, mint 165, teal 195, sky 230, blue 260, violet 295, orchid 325, rose 355 |
|
|
65105
|
+
| `--bb-avatar-bg-l` / `--bb-avatar-bg-c` | `0.93` / `0.065` | `0.4` / `0.095` | The fill's OKLCH lightness and chroma |
|
|
65106
|
+
| `--bb-avatar-ink-l` / `--bb-avatar-ink-c` | `0.42` / `0.13` | `0.93` / `0.06` | The initials' and icon's OKLCH lightness and chroma |
|
|
65107
|
+
|
|
64775
65108
|
### Input family
|
|
64776
65109
|
|
|
64777
65110
|
Form controls are ~half the library and must agree with each other, so their
|
|
@@ -64897,6 +65230,26 @@ export const components = {
|
|
|
64897
65230
|
} satisfies BbComponentsMap;
|
|
64898
65231
|
```
|
|
64899
65232
|
|
|
65233
|
+
The same local hides the placeholder where it would only mislead: a
|
|
65234
|
+
read-only or disabled field shows its value, or nothing, never a "Type
|
|
65235
|
+
here" no one can type into. Key it on the box's states, once, app-wide;
|
|
65236
|
+
no `placeholder()` helper per page:
|
|
65237
|
+
|
|
65238
|
+
```ts
|
|
65239
|
+
// bitboss-ui.components.ts
|
|
65240
|
+
import type { BbComponentsMap } from 'bitboss-ui/vite';
|
|
65241
|
+
|
|
65242
|
+
const quiet = {
|
|
65243
|
+
'box:readonly': '[--ph:transparent]',
|
|
65244
|
+
'box:disabled': '[--ph:transparent]',
|
|
65245
|
+
};
|
|
65246
|
+
export const components = {
|
|
65247
|
+
BbTextInput: { pt: quiet },
|
|
65248
|
+
BbSelect: { pt: quiet },
|
|
65249
|
+
BbDatePickerInput: { pt: quiet },
|
|
65250
|
+
} satisfies BbComponentsMap;
|
|
65251
|
+
```
|
|
65252
|
+
|
|
64900
65253
|
## Tier 2 — component tokens (`--*`)
|
|
64901
65254
|
|
|
64902
65255
|
Defined on the component's **root class** in the component's own CSS file.
|
|
@@ -65554,7 +65907,7 @@ Two rules in `recommended` are `warn` rather than `error`, because each describe
|
|
|
65554
65907
|
|
|
65555
65908
|
`recommended` also enables **`bitboss-ui/carousel-items-without-slide`** (error): a `BbCarousel` with no `#slide` template whose `items` hold objects with neither `src` nor `srcset`. Without `#slide`, an entry renders as an image only when it is a string or has a `src` / `srcset`; any other object renders an empty slide, silently. Add `src` (or `srcset`) to the entries, or render them with `<template #slide="{ item }">`. Only entries in sight are judged: an inline array, or a `const` array in the same file's `<script setup>`; imported or fetched items, refs, spreads and a number of slides are not reported. `bitboss-ui check` reports the same.
|
|
65556
65909
|
|
|
65557
|
-
`recommended` also enables **`bitboss-ui/hidden-label-placeholder`** (warning): a `BbTextInput` / `BbTextarea` / `BbNumberInput` / `BbSelect` / `BbTag` / `BbColorInput` / `BbDatePickerInput` / `BbTimePickerInput` with a static `hide-label` and no `placeholder`. A screen reader still hears the label, but a sighted user sees an empty box with nothing saying what it is for: add a `placeholder` (the label's words will do). Not reported: an `aria-labelledby`, a `#prefix` slot, an object `v-bind`, a field inside a `BbTable` / `BbTree` slot (its column header labels it), a field at the root of an SFC's template (a cell editor or wrapper: the parent lays out its label), a `variant="ghost"` field (the inline-edit cell: its column header labels it, and a narrow cell cuts a placeholder anyway) and a single `BbSelect` that is neither `clearable` nor `multiple` (it always shows its pick, so a placeholder would never show). `bitboss-ui check` reports the same finding as `hidden-label-placeholder`, a warning that never fails the run.
|
|
65910
|
+
`recommended` also enables **`bitboss-ui/hidden-label-placeholder`** (warning): a `BbTextInput` / `BbTextarea` / `BbNumberInput` / `BbSelect` / `BbTag` / `BbColorInput` / `BbDatePickerInput` / `BbTimePickerInput` with a static `hide-label` and no `placeholder`. A screen reader still hears the label, but a sighted user sees an empty box with nothing saying what it is for: add a `placeholder` (the label's words will do). A `BbNumberInput` `unit` or `currency` is no caption: it shows only once there is a number, so an empty field still needs a `placeholder` or a visible label (the message says so). Not reported: an `aria-labelledby`, a `#prefix` or `#suffix` slot (text in the box, like "days after"), an object `v-bind`, a field inside a `BbTable` / `BbTree` slot (its column header labels it), a field at the root of an SFC's template (a cell editor or wrapper: the parent lays out its label), a `variant="ghost"` field (the inline-edit cell: its column header labels it, and a narrow cell cuts a placeholder anyway) and a single `BbSelect` that is neither `clearable` nor `multiple` (it always shows its pick, so a placeholder would never show). `bitboss-ui check` reports the same finding as `hidden-label-placeholder`, a warning that never fails the run.
|
|
65558
65911
|
|
|
65559
65912
|
`recommended` also enables **`bitboss-ui/no-unregistered-rule`** (error): a rule name in a library control's `rules` (`rules="required|email"`, a bound string, `:rules="{ required: cond }"`) that no `defineRule` in the project registers; vee-validate throws "No such validator" when the field validates. It reads literal `defineRule('email', …)` calls, loops over `@vee-validate/rules` itself (from the installed package) and loops over an object literal in the same file. **It fails closed**: a registration it cannot read (a computed name, an object imported from elsewhere, a shared package) reports the rule as unconfirmed and names the call; write the name literally or list it under `registeredRules` in `bitboss-ui.check.json` (or `package.json` → `"bitboss-ui"`). Function rules and rules beside a form `schema` are not reported. `bitboss-ui check` reports the same finding as `unregistered-rule`; in a `.md` page it also counts the `defineRule` calls the page's own fences show.
|
|
65560
65913
|
|
|
@@ -65700,7 +66053,7 @@ Four cases ignore `prefill` and load anyway, because deferring would buy nothing
|
|
|
65700
66053
|
|
|
65701
66054
|
- **Race protection**: a newer call aborts the one in flight (`signal`), and a superseded answer — resolution or rejection — is dropped. Nothing runs after a superseded call: no prune, no stash.
|
|
65702
66055
|
- **Loading**: the component tracks in-flight requests itself, and the loading state ends the moment a call is aborted; don't add your own `loading` ref for option fetching.
|
|
65703
|
-
- **Failure is never "empty"**: a provider **throws** to fail — it never returns `[]` for one, because an empty array is a real, applied result. On a failed (not aborted) call the component clears the rows (stale rows never sit under a new filter), prunes nothing, publishes nothing to the SSR payload (the client loads again), logs the error, and shows `failed-text` (locale default "Couldn't load items")
|
|
66056
|
+
- **Failure is never "empty"**: a provider **throws** to fail — it never returns `[]` for one, because an empty array is a real, applied result. On a failed (not aborted) call the component clears the rows (stale rows never sit under a new filter), prunes nothing, publishes nothing to the SSR payload (the client loads again), logs the error, and shows its own failure row: `failed-text` (locale default "Couldn't load items"), announced, then a "Try again" button that runs the failed call again with the same query (on click only, never on its own). `#empty` means empty: it never renders for a failure and its scope has no `error`.
|
|
65704
66057
|
- **Coherence** (`enforce-coherence`): prunes only after an applied, successful load whose reason is not `'search'` — an empty one included — against the fetched rows alone, except values a `known-items` row names (a select's `stash` does not count). Failures never prune. Details in the [Coherence playbook](https://llms-bitboss-ui.bitboss.it/dist/ai/guides/coherence-playbook.md).
|
|
65705
66058
|
- **Dependency comparison is value-based** (hashed), not reference-based — `:dependencies="[filters]"` re-fetches only when the content actually changes, no matter how often the array identity does.
|
|
65706
66059
|
|
|
@@ -65738,19 +66091,15 @@ Pass it to every request; combine it with a timeout (`AbortSignal.any([signal, A
|
|
|
65738
66091
|
|
|
65739
66092
|
### Failure and retry
|
|
65740
66093
|
|
|
66094
|
+
The failure row is the library's: set its message with `failed-text`, and keep `#empty` for the empty result. "Try again" is built in.
|
|
66095
|
+
|
|
65741
66096
|
```vue
|
|
65742
66097
|
<BbTable
|
|
65743
66098
|
:items="fetchInvoices"
|
|
65744
|
-
:dependencies="[status
|
|
65745
|
-
failed-text="The invoices could not be loaded"
|
|
66099
|
+
:dependencies="[status]"
|
|
66100
|
+
failed-text="The invoices could not be loaded."
|
|
65746
66101
|
>
|
|
65747
|
-
<template #empty
|
|
65748
|
-
<template v-if="error">
|
|
65749
|
-
Couldn't load the invoices.
|
|
65750
|
-
<BbButton size="sm" variant="ghost" @click="retry++">Try again</BbButton>
|
|
65751
|
-
</template>
|
|
65752
|
-
<template v-else>No invoices match these filters.</template>
|
|
65753
|
-
</template>
|
|
66102
|
+
<template #empty>No invoices match these filters.</template>
|
|
65754
66103
|
</BbTable>
|
|
65755
66104
|
```
|
|
65756
66105
|
|
|
@@ -65822,7 +66171,7 @@ The same object, with `query` only on a `searchable` group. A getter for a searc
|
|
|
65822
66171
|
- [ ] The provider takes ONE object typed with its component's context type, and `signal` reaches every request.
|
|
65823
66172
|
- [ ] Selects: the current picks are named on every `reason !== 'search'` call (required with `enforce-coherence`), `stash` is on, the ids request fails soft.
|
|
65824
66173
|
- [ ] A provider that matches `query` on the server has `:filter-by="false"` (dropdown group: `filterBy: false`).
|
|
65825
|
-
- [ ] Failures are thrown, not returned; `failed-text`
|
|
66174
|
+
- [ ] Failures are thrown, not returned; `failed-text` words the failure row (it has "Try again" built in), and `#empty` holds empty copy only.
|
|
65826
66175
|
- [ ] All branches return the same item shape.
|
|
65827
66176
|
- [ ] Field-tied fetching uses `dependencies` (+ `deps-debounce-time`), no manual watchers; dependent selects filter both requests by the parent.
|
|
65828
66177
|
|
|
@@ -66349,21 +66698,22 @@ explicitly rather than relying on them being hoisted through `bitboss-ui`'s own
|
|
|
66349
66698
|
`dependencies`, which breaks under pnpm and Yarn PnP:
|
|
66350
66699
|
|
|
66351
66700
|
```
|
|
66352
|
-
npm i @vueuse/core
|
|
66701
|
+
npm i @vueuse/core query-string
|
|
66353
66702
|
npm i -D @inertiajs/core
|
|
66354
66703
|
```
|
|
66355
66704
|
|
|
66356
66705
|
`@vueuse/core` backs every keyed context's `injectLocal`/`provideLocal`
|
|
66357
66706
|
(`usePaginatedResponseContext`, `useTableSelectionContext`, `useTableContext`,
|
|
66358
|
-
`usePageShellContext`) and `useDeleteCmd`/`useScreenSizes`; `
|
|
66359
|
-
powers the `isEqual` hash-comparison utility below; `query-string` backs
|
|
66707
|
+
`usePageShellContext`) and `useDeleteCmd`/`useScreenSizes`; `query-string` backs
|
|
66360
66708
|
`useQuery`/`useRouteQuery`/`useQueryObject`; `@inertiajs/core` is a type-only
|
|
66361
66709
|
import (`PageProps`, `VisitOptions`, in the URL and context helpers) that `@inertiajs/vue3`
|
|
66362
66710
|
does not re-export, so a strict pnpm app fails to type-check without it. Install
|
|
66363
66711
|
the version your `@inertiajs/vue3` runs on (`add` prints it pinned, e.g.
|
|
66364
66712
|
`@inertiajs/core@3.1.1`): a newer core's visit types do not match. The
|
|
66365
66713
|
helpers' shared types, tiny utilities and words are three files of the
|
|
66366
|
-
folder, `types.ts`, `utils.ts` and `messages.ts`, below.
|
|
66714
|
+
folder, `types.ts`, `utils.ts` and `messages.ts`, below. `utils.ts` carries a
|
|
66715
|
+
copy of bitboss-ui's exact `isEqual` and `hash` (the package exports
|
|
66716
|
+
components, not utilities).
|
|
66367
66717
|
|
|
66368
66718
|
## Shared types and utilities
|
|
66369
66719
|
|
|
@@ -66405,7 +66755,7 @@ hand-built `{ data, meta }`. Pass whichever your controller has, as is — see
|
|
|
66405
66755
|
```ts
|
|
66406
66756
|
// inertia-helpers/utils.ts
|
|
66407
66757
|
// micro-utilities the helpers share
|
|
66408
|
-
import {
|
|
66758
|
+
import { toRaw } from 'vue';
|
|
66409
66759
|
|
|
66410
66760
|
export const isNil = (value: unknown): value is null | undefined =>
|
|
66411
66761
|
value === null || value === undefined;
|
|
@@ -66418,8 +66768,557 @@ export const isEmpty = (value: unknown): boolean =>
|
|
|
66418
66768
|
|
|
66419
66769
|
export const noop = (): void => undefined;
|
|
66420
66770
|
|
|
66421
|
-
|
|
66422
|
-
|
|
66771
|
+
/*
|
|
66772
|
+
* EXACT deep equality, the same as bitboss-ui's own. Never a hash: the
|
|
66773
|
+
* object-code hash it replaced folded a number to int32 (2400 === 2400.5,
|
|
66774
|
+
* 0.1 === 0.2), so a decimal-only change read as "unchanged".
|
|
66775
|
+
*
|
|
66776
|
+
* - Primitives: `Object.is` (NaN equals NaN, 0 and -0 differ).
|
|
66777
|
+
* - Vue proxies are read raw; the same reference is equal.
|
|
66778
|
+
* - Arrays by index; plain objects by own enumerable keys (order aside, a key
|
|
66779
|
+
* holding `undefined` is still a key); Dates by time; Maps and Sets by content.
|
|
66780
|
+
* - Files: the same file, or one with the same name, size, type and
|
|
66781
|
+
* lastModified (a re-read of the same pick).
|
|
66782
|
+
* - Class instances: the same constructor, then a primitive `valueOf()`
|
|
66783
|
+
* (dayjs, Decimal …), else a custom `toString()` when there are no fields
|
|
66784
|
+
* (URL, Temporal …), else their fields.
|
|
66785
|
+
* - Cycles: a pair already being compared counts as equal.
|
|
66786
|
+
*
|
|
66787
|
+
* `hash` below agrees: equal values give the same key.
|
|
66788
|
+
*/
|
|
66789
|
+
|
|
66790
|
+
type Seen = { xs: object[]; ys: object[] };
|
|
66791
|
+
|
|
66792
|
+
const isPlainProto = (proto: object | null) =>
|
|
66793
|
+
proto === null || Object.getPrototypeOf(proto) === null;
|
|
66794
|
+
|
|
66795
|
+
export const isEqual = (a: unknown, b: unknown): boolean => equal(a, b, null);
|
|
66796
|
+
|
|
66797
|
+
const equal = (a: unknown, b: unknown, seen: Seen | null): boolean => {
|
|
66798
|
+
if (Object.is(a, b)) return true;
|
|
66799
|
+
if (
|
|
66800
|
+
a === null ||
|
|
66801
|
+
b === null ||
|
|
66802
|
+
typeof a !== 'object' ||
|
|
66803
|
+
typeof b !== 'object'
|
|
66804
|
+
)
|
|
66805
|
+
return false;
|
|
66806
|
+
|
|
66807
|
+
const x = toRaw(a);
|
|
66808
|
+
const y = toRaw(b);
|
|
66809
|
+
if (x === y) return true;
|
|
66810
|
+
if (seen === null) seen = { xs: [], ys: [] };
|
|
66811
|
+
const { xs, ys } = seen;
|
|
66812
|
+
for (let i = 0; i < xs.length; i++)
|
|
66813
|
+
if (xs[i] === x && ys[i] === y) return true;
|
|
66814
|
+
xs.push(x);
|
|
66815
|
+
ys.push(y);
|
|
66816
|
+
try {
|
|
66817
|
+
return equalObjects(x, y, seen);
|
|
66818
|
+
} finally {
|
|
66819
|
+
xs.pop();
|
|
66820
|
+
ys.pop();
|
|
66821
|
+
}
|
|
66822
|
+
};
|
|
66823
|
+
|
|
66824
|
+
const equalObjects = (x: object, y: object, seen: Seen): boolean => {
|
|
66825
|
+
if (Array.isArray(x)) {
|
|
66826
|
+
if (!Array.isArray(y) || x.length !== y.length) return false;
|
|
66827
|
+
const other = y as unknown[];
|
|
66828
|
+
for (let i = 0; i < x.length; i++)
|
|
66829
|
+
if (!equal(x[i], other[i], seen)) return false;
|
|
66830
|
+
return true;
|
|
66831
|
+
}
|
|
66832
|
+
if (Array.isArray(y)) return false;
|
|
66833
|
+
|
|
66834
|
+
const px = Object.getPrototypeOf(x) as object | null;
|
|
66835
|
+
const py = Object.getPrototypeOf(y) as object | null;
|
|
66836
|
+
const plainX = px === Object.prototype || px === null;
|
|
66837
|
+
const plainY = py === Object.prototype || py === null;
|
|
66838
|
+
if (plainX && plainY) return equalFields(x, y, seen);
|
|
66839
|
+
if (plainX !== plainY || px !== py) {
|
|
66840
|
+
// Plain objects from two realms (or a null-prototype one) still compare.
|
|
66841
|
+
return isPlainProto(px) && isPlainProto(py)
|
|
66842
|
+
? equalFields(x, y, seen)
|
|
66843
|
+
: false;
|
|
66844
|
+
}
|
|
66845
|
+
// Same prototype from here on; a foreign realm's plain objects land here too.
|
|
66846
|
+
if (isPlainProto(px)) return equalFields(x, y, seen);
|
|
66847
|
+
|
|
66848
|
+
if (x instanceof Date) return Object.is(x.getTime(), (y as Date).getTime());
|
|
66849
|
+
if (x instanceof Map) return equalMaps(x, y as Map<unknown, unknown>, seen);
|
|
66850
|
+
if (x instanceof Set) return equalSets(x, y as Set<unknown>, seen);
|
|
66851
|
+
if (typeof Blob !== 'undefined' && x instanceof Blob) {
|
|
66852
|
+
const f = x as File;
|
|
66853
|
+
const g = y as File;
|
|
66854
|
+
return (
|
|
66855
|
+
f.name === g.name &&
|
|
66856
|
+
f.size === g.size &&
|
|
66857
|
+
f.type === g.type &&
|
|
66858
|
+
f.lastModified === g.lastModified
|
|
66859
|
+
);
|
|
66860
|
+
}
|
|
66861
|
+
|
|
66862
|
+
const p = primitiveValueOf(x);
|
|
66863
|
+
if (p) {
|
|
66864
|
+
const q = primitiveValueOf(y);
|
|
66865
|
+
return !!q && Object.is(p.value, q.value);
|
|
66866
|
+
}
|
|
66867
|
+
if (Object.keys(x).length === 0 && Object.keys(y).length === 0) {
|
|
66868
|
+
const text = customText(x);
|
|
66869
|
+
if (text !== undefined) return text === customText(y);
|
|
66870
|
+
}
|
|
66871
|
+
return equalFields(x, y, seen);
|
|
66872
|
+
};
|
|
66873
|
+
|
|
66874
|
+
const equalFields = (x: object, y: object, seen: Seen) => {
|
|
66875
|
+
const keys = Object.keys(x);
|
|
66876
|
+
if (keys.length !== Object.keys(y).length) return false;
|
|
66877
|
+
for (const key of keys) {
|
|
66878
|
+
if (!Object.prototype.hasOwnProperty.call(y, key)) return false;
|
|
66879
|
+
if (
|
|
66880
|
+
!equal(
|
|
66881
|
+
(x as Record<string, unknown>)[key],
|
|
66882
|
+
(y as Record<string, unknown>)[key],
|
|
66883
|
+
seen
|
|
66884
|
+
)
|
|
66885
|
+
)
|
|
66886
|
+
return false;
|
|
66887
|
+
}
|
|
66888
|
+
return true;
|
|
66889
|
+
};
|
|
66890
|
+
|
|
66891
|
+
const equalMaps = (
|
|
66892
|
+
x: Map<unknown, unknown>,
|
|
66893
|
+
y: Map<unknown, unknown>,
|
|
66894
|
+
seen: Seen
|
|
66895
|
+
) => {
|
|
66896
|
+
if (x.size !== y.size) return false;
|
|
66897
|
+
const unmatched = [...y.entries()];
|
|
66898
|
+
for (const [key, value] of x) {
|
|
66899
|
+
const at = y.has(key)
|
|
66900
|
+
? unmatched.findIndex(([k]) => k === key || Object.is(k, key))
|
|
66901
|
+
: unmatched.findIndex(([k]) => equal(k, key, seen));
|
|
66902
|
+
const match = at === -1 ? undefined : unmatched[at];
|
|
66903
|
+
if (!match || !equal(value, match[1], seen)) return false;
|
|
66904
|
+
unmatched.splice(at, 1);
|
|
66905
|
+
}
|
|
66906
|
+
return true;
|
|
66907
|
+
};
|
|
66908
|
+
|
|
66909
|
+
const equalSets = (x: Set<unknown>, y: Set<unknown>, seen: Seen) => {
|
|
66910
|
+
if (x.size !== y.size) return false;
|
|
66911
|
+
const unmatched = [...y];
|
|
66912
|
+
for (const member of x) {
|
|
66913
|
+
const at = y.has(member)
|
|
66914
|
+
? unmatched.findIndex((m) => m === member || Object.is(m, member))
|
|
66915
|
+
: unmatched.findIndex((m) => equal(m, member, seen));
|
|
66916
|
+
if (at === -1) return false;
|
|
66917
|
+
unmatched.splice(at, 1);
|
|
66918
|
+
}
|
|
66919
|
+
return true;
|
|
66920
|
+
};
|
|
66921
|
+
|
|
66922
|
+
/*
|
|
66923
|
+
* A key for any value, the same as bitboss-ui's own: a 96-bit digest of an
|
|
66924
|
+
* EXACT encoding (numbers by their IEEE-754 bits, strings by length + text,
|
|
66925
|
+
* objects by sorted own keys, Maps and Sets by sorted content, Dates by time,
|
|
66926
|
+
* Files by name/size/type/lastModified, value objects by `valueOf()`).
|
|
66927
|
+
* Numbers, booleans, null and short id-safe strings are spelled out exactly.
|
|
66928
|
+
* Equal values (by `isEqual`) give the same key; useHasChanged keeps one as
|
|
66929
|
+
* its baseline.
|
|
66930
|
+
*/
|
|
66931
|
+
|
|
66932
|
+
// Structural tags of the word stream. The encoding is prefix-free: a tag
|
|
66933
|
+
// fixes how its payload words are counted (numbers are two words, strings
|
|
66934
|
+
// are length-prefixed, arrays/objects/maps/sets are count-prefixed), so two
|
|
66935
|
+
// different values can only key alike through the 96-bit finish.
|
|
66936
|
+
const T_UNDEFINED = 0x100;
|
|
66937
|
+
const T_NULL = 0x101;
|
|
66938
|
+
const T_TRUE = 0x102;
|
|
66939
|
+
const T_FALSE = 0x103;
|
|
66940
|
+
const T_NUMBER = 0x104;
|
|
66941
|
+
const T_BIGINT = 0x105;
|
|
66942
|
+
const T_STRING = 0x106;
|
|
66943
|
+
const T_SYMBOL = 0x107;
|
|
66944
|
+
const T_FUNCTION = 0x108;
|
|
66945
|
+
const T_ARRAY = 0x109;
|
|
66946
|
+
const T_DATE = 0x10a;
|
|
66947
|
+
const T_MAP = 0x10b;
|
|
66948
|
+
const T_SET = 0x10c;
|
|
66949
|
+
const T_BLOB = 0x10d;
|
|
66950
|
+
const T_OBJECT = 0x10e;
|
|
66951
|
+
const T_CLASS = 0x10f;
|
|
66952
|
+
const T_CYCLE = 0x110;
|
|
66953
|
+
const T_VALUE_OF = 0x111;
|
|
66954
|
+
const T_TO_STRING = 0x112;
|
|
66955
|
+
const T_ENTRY = 0x113;
|
|
66956
|
+
|
|
66957
|
+
type Lanes = [number, number, number, number];
|
|
66958
|
+
|
|
66959
|
+
const start = (): Lanes => [
|
|
66960
|
+
0x243f6a88 | 0,
|
|
66961
|
+
0x85a308d3 | 0,
|
|
66962
|
+
0x13198a2e | 0,
|
|
66963
|
+
0x03707344 | 0,
|
|
66964
|
+
];
|
|
66965
|
+
|
|
66966
|
+
const mix = (s: Lanes, w: number) => {
|
|
66967
|
+
s[0] = Math.imul(s[0] ^ w, 2654435761);
|
|
66968
|
+
s[0] = (s[0] << 13) | (s[0] >>> 19);
|
|
66969
|
+
s[1] = Math.imul(s[1] ^ w, 1597334677);
|
|
66970
|
+
s[1] = (s[1] << 17) | (s[1] >>> 15);
|
|
66971
|
+
s[2] = Math.imul(s[2] ^ w, 2246822519);
|
|
66972
|
+
s[2] = (s[2] << 19) | (s[2] >>> 13);
|
|
66973
|
+
s[3] = Math.imul(s[3] ^ w, 3266489917);
|
|
66974
|
+
s[3] = (s[3] << 23) | (s[3] >>> 9);
|
|
66975
|
+
};
|
|
66976
|
+
|
|
66977
|
+
const mix2 = (s: Lanes, w1: number, w2: number) => {
|
|
66978
|
+
let a = s[0];
|
|
66979
|
+
let b = s[1];
|
|
66980
|
+
let c = s[2];
|
|
66981
|
+
let d = s[3];
|
|
66982
|
+
a = Math.imul(a ^ w1, 2654435761);
|
|
66983
|
+
a = (a << 13) | (a >>> 19);
|
|
66984
|
+
b = Math.imul(b ^ w1, 1597334677);
|
|
66985
|
+
b = (b << 17) | (b >>> 15);
|
|
66986
|
+
c = Math.imul(c ^ w1, 2246822519);
|
|
66987
|
+
c = (c << 19) | (c >>> 13);
|
|
66988
|
+
d = Math.imul(d ^ w1, 3266489917);
|
|
66989
|
+
d = (d << 23) | (d >>> 9);
|
|
66990
|
+
a = Math.imul(a ^ w2, 2654435761);
|
|
66991
|
+
a = (a << 13) | (a >>> 19);
|
|
66992
|
+
b = Math.imul(b ^ w2, 1597334677);
|
|
66993
|
+
b = (b << 17) | (b >>> 15);
|
|
66994
|
+
c = Math.imul(c ^ w2, 2246822519);
|
|
66995
|
+
c = (c << 19) | (c >>> 13);
|
|
66996
|
+
d = Math.imul(d ^ w2, 3266489917);
|
|
66997
|
+
d = (d << 23) | (d >>> 9);
|
|
66998
|
+
s[0] = a;
|
|
66999
|
+
s[1] = b;
|
|
67000
|
+
s[2] = c;
|
|
67001
|
+
s[3] = d;
|
|
67002
|
+
};
|
|
67003
|
+
|
|
67004
|
+
// Packed string feed: two UTF-16 units per word. `head` is a word mixed
|
|
67005
|
+
// before the length (a type tag) or -1 to mix the length only (object keys).
|
|
67006
|
+
const mixString = (s: Lanes, head: number, text: string) => {
|
|
67007
|
+
let a = s[0];
|
|
67008
|
+
let b = s[1];
|
|
67009
|
+
let c = s[2];
|
|
67010
|
+
let d = s[3];
|
|
67011
|
+
if (head !== -1) {
|
|
67012
|
+
a = Math.imul(a ^ head, 2654435761);
|
|
67013
|
+
a = (a << 13) | (a >>> 19);
|
|
67014
|
+
b = Math.imul(b ^ head, 1597334677);
|
|
67015
|
+
b = (b << 17) | (b >>> 15);
|
|
67016
|
+
c = Math.imul(c ^ head, 2246822519);
|
|
67017
|
+
c = (c << 19) | (c >>> 13);
|
|
67018
|
+
d = Math.imul(d ^ head, 3266489917);
|
|
67019
|
+
d = (d << 23) | (d >>> 9);
|
|
67020
|
+
}
|
|
67021
|
+
const n = text.length;
|
|
67022
|
+
a = Math.imul(a ^ n, 2654435761);
|
|
67023
|
+
a = (a << 13) | (a >>> 19);
|
|
67024
|
+
b = Math.imul(b ^ n, 1597334677);
|
|
67025
|
+
b = (b << 17) | (b >>> 15);
|
|
67026
|
+
c = Math.imul(c ^ n, 2246822519);
|
|
67027
|
+
c = (c << 19) | (c >>> 13);
|
|
67028
|
+
d = Math.imul(d ^ n, 3266489917);
|
|
67029
|
+
d = (d << 23) | (d >>> 9);
|
|
67030
|
+
let i = 0;
|
|
67031
|
+
for (; i + 1 < n; i += 2) {
|
|
67032
|
+
const w = text.charCodeAt(i) | (text.charCodeAt(i + 1) << 16);
|
|
67033
|
+
a = Math.imul(a ^ w, 2654435761);
|
|
67034
|
+
a = (a << 13) | (a >>> 19);
|
|
67035
|
+
b = Math.imul(b ^ w, 1597334677);
|
|
67036
|
+
b = (b << 17) | (b >>> 15);
|
|
67037
|
+
c = Math.imul(c ^ w, 2246822519);
|
|
67038
|
+
c = (c << 19) | (c >>> 13);
|
|
67039
|
+
d = Math.imul(d ^ w, 3266489917);
|
|
67040
|
+
d = (d << 23) | (d >>> 9);
|
|
67041
|
+
}
|
|
67042
|
+
if (i < n) {
|
|
67043
|
+
const w = text.charCodeAt(i);
|
|
67044
|
+
a = Math.imul(a ^ w, 2654435761);
|
|
67045
|
+
a = (a << 13) | (a >>> 19);
|
|
67046
|
+
b = Math.imul(b ^ w, 1597334677);
|
|
67047
|
+
b = (b << 17) | (b >>> 15);
|
|
67048
|
+
c = Math.imul(c ^ w, 2246822519);
|
|
67049
|
+
c = (c << 19) | (c >>> 13);
|
|
67050
|
+
d = Math.imul(d ^ w, 3266489917);
|
|
67051
|
+
d = (d << 23) | (d >>> 9);
|
|
67052
|
+
}
|
|
67053
|
+
s[0] = a;
|
|
67054
|
+
s[1] = b;
|
|
67055
|
+
s[2] = c;
|
|
67056
|
+
s[3] = d;
|
|
67057
|
+
};
|
|
67058
|
+
|
|
67059
|
+
// A double by its bit pattern: exact for every finite/infinite value, -0
|
|
67060
|
+
// apart from 0 as `Object.is` has it, every NaN payload mapped to one
|
|
67061
|
+
// canonical pattern (Object.is(NaN, NaN)). The words are read
|
|
67062
|
+
// little-endian whatever the host, so server and client agree.
|
|
67063
|
+
const bits = new DataView(new ArrayBuffer(8));
|
|
67064
|
+
const lowWord = (n: number) => {
|
|
67065
|
+
bits.setFloat64(0, n, true);
|
|
67066
|
+
return bits.getUint32(0, true);
|
|
67067
|
+
};
|
|
67068
|
+
/** The high word of the double `lowWord` last read. */
|
|
67069
|
+
const highWord = () => bits.getUint32(4, true);
|
|
67070
|
+
|
|
67071
|
+
const mixNumber = (s: Lanes, n: number) => {
|
|
67072
|
+
if (n !== n) return mix2(s, 0, 0x7ff80000);
|
|
67073
|
+
const lo = lowWord(n);
|
|
67074
|
+
return mix2(s, lo | 0, highWord() | 0);
|
|
67075
|
+
};
|
|
67076
|
+
|
|
67077
|
+
const fmix32 = (h: number) => {
|
|
67078
|
+
h ^= h >>> 16;
|
|
67079
|
+
h = Math.imul(h, 0x85ebca6b);
|
|
67080
|
+
h ^= h >>> 13;
|
|
67081
|
+
h = Math.imul(h, 0xc2b2ae35);
|
|
67082
|
+
h ^= h >>> 16;
|
|
67083
|
+
return h >>> 0;
|
|
67084
|
+
};
|
|
67085
|
+
|
|
67086
|
+
// 96 bits out: three lanes, each cross-folded with a neighbour so no lane's
|
|
67087
|
+
// state reaches the key unmixed with the others.
|
|
67088
|
+
const finishWords = (s: Lanes): [number, number, number] => [
|
|
67089
|
+
fmix32(s[0] ^ s[3]),
|
|
67090
|
+
fmix32(s[1] ^ s[0]),
|
|
67091
|
+
fmix32(s[2] ^ s[1]),
|
|
67092
|
+
];
|
|
67093
|
+
|
|
67094
|
+
/** A 32-bit word as 8 hex digits. */
|
|
67095
|
+
const hexWord = (w: number) => (w >>> 0).toString(16).padStart(8, '0');
|
|
67096
|
+
|
|
67097
|
+
/** A primitive `valueOf()` of a value object (dayjs, Decimal …), else `undefined`. */
|
|
67098
|
+
const primitiveValueOf = (o: object): { value: unknown } | undefined => {
|
|
67099
|
+
const valueOf = (o as { valueOf?: unknown }).valueOf;
|
|
67100
|
+
if (typeof valueOf !== 'function' || valueOf === Object.prototype.valueOf)
|
|
67101
|
+
return undefined;
|
|
67102
|
+
try {
|
|
67103
|
+
const value = valueOf.call(o);
|
|
67104
|
+
if (value !== o && (value === null || typeof value !== 'object'))
|
|
67105
|
+
return { value };
|
|
67106
|
+
} catch {
|
|
67107
|
+
// Temporal and friends throw on valueOf: fall through.
|
|
67108
|
+
}
|
|
67109
|
+
return undefined;
|
|
67110
|
+
};
|
|
67111
|
+
|
|
67112
|
+
/** `o`'s text through a custom `toString` (URL, Temporal …), else `undefined`. */
|
|
67113
|
+
const customText = (o: object): string | undefined => {
|
|
67114
|
+
const toString = (o as { toString?: unknown }).toString;
|
|
67115
|
+
return typeof toString === 'function' &&
|
|
67116
|
+
toString !== Object.prototype.toString
|
|
67117
|
+
? (toString as (this: object) => string).call(o)
|
|
67118
|
+
: undefined;
|
|
67119
|
+
};
|
|
67120
|
+
|
|
67121
|
+
const encode = (s: Lanes, value: unknown, stack: object[]): void => {
|
|
67122
|
+
switch (typeof value) {
|
|
67123
|
+
case 'undefined':
|
|
67124
|
+
return mix(s, T_UNDEFINED);
|
|
67125
|
+
case 'boolean':
|
|
67126
|
+
return mix(s, value ? T_TRUE : T_FALSE);
|
|
67127
|
+
case 'number':
|
|
67128
|
+
mix(s, T_NUMBER);
|
|
67129
|
+
return mixNumber(s, value);
|
|
67130
|
+
case 'bigint':
|
|
67131
|
+
return mixString(s, T_BIGINT, String(value));
|
|
67132
|
+
case 'string':
|
|
67133
|
+
return mixString(s, T_STRING, value);
|
|
67134
|
+
case 'symbol':
|
|
67135
|
+
return mixString(s, T_SYMBOL, String(value.description));
|
|
67136
|
+
case 'function':
|
|
67137
|
+
// By source text, as before: two closures of one factory key alike.
|
|
67138
|
+
return mixString(s, T_FUNCTION, String(value));
|
|
67139
|
+
}
|
|
67140
|
+
if (value === null) return mix(s, T_NULL);
|
|
67141
|
+
|
|
67142
|
+
const o = toRaw(value as object);
|
|
67143
|
+
const depth = stack.indexOf(o);
|
|
67144
|
+
if (depth !== -1) return mix2(s, T_CYCLE, depth);
|
|
67145
|
+
stack.push(o);
|
|
67146
|
+
try {
|
|
67147
|
+
encodeObject(s, o, stack);
|
|
67148
|
+
} finally {
|
|
67149
|
+
stack.pop();
|
|
67150
|
+
}
|
|
67151
|
+
};
|
|
67152
|
+
|
|
67153
|
+
const encodeFields = (s: Lanes, o: object, stack: object[]) => {
|
|
67154
|
+
const keys = Object.keys(o).sort();
|
|
67155
|
+
mix(s, keys.length);
|
|
67156
|
+
for (const key of keys) {
|
|
67157
|
+
mixString(s, -1, key);
|
|
67158
|
+
encode(s, (o as Record<string, unknown>)[key], stack);
|
|
67159
|
+
}
|
|
67160
|
+
};
|
|
67161
|
+
|
|
67162
|
+
// Map/Set members are digested apart and mixed back in sorted order, so
|
|
67163
|
+
// iteration order cannot change the key.
|
|
67164
|
+
const compareWords = (
|
|
67165
|
+
a: [number, number, number],
|
|
67166
|
+
b: [number, number, number]
|
|
67167
|
+
) =>
|
|
67168
|
+
a[0] !== b[0]
|
|
67169
|
+
? a[0] < b[0]
|
|
67170
|
+
? -1
|
|
67171
|
+
: 1
|
|
67172
|
+
: a[1] !== b[1]
|
|
67173
|
+
? a[1] < b[1]
|
|
67174
|
+
? -1
|
|
67175
|
+
: 1
|
|
67176
|
+
: a[2] < b[2]
|
|
67177
|
+
? -1
|
|
67178
|
+
: a[2] > b[2]
|
|
67179
|
+
? 1
|
|
67180
|
+
: 0;
|
|
67181
|
+
|
|
67182
|
+
const mixSortedDigests = (
|
|
67183
|
+
s: Lanes,
|
|
67184
|
+
digests: Array<[number, number, number]>
|
|
67185
|
+
) => {
|
|
67186
|
+
digests.sort(compareWords);
|
|
67187
|
+
for (const d of digests) {
|
|
67188
|
+
mix(s, d[0] | 0);
|
|
67189
|
+
mix2(s, d[1] | 0, d[2] | 0);
|
|
67190
|
+
}
|
|
67191
|
+
};
|
|
67192
|
+
|
|
67193
|
+
const encodeObject = (s: Lanes, o: object, stack: object[]) => {
|
|
67194
|
+
if (Array.isArray(o)) {
|
|
67195
|
+
mix2(s, T_ARRAY, o.length);
|
|
67196
|
+
for (const item of o) encode(s, item, stack);
|
|
67197
|
+
return;
|
|
67198
|
+
}
|
|
67199
|
+
const proto = Object.getPrototypeOf(o);
|
|
67200
|
+
if (proto === Object.prototype || proto === null) {
|
|
67201
|
+
mix(s, T_OBJECT);
|
|
67202
|
+
return encodeFields(s, o, stack);
|
|
67203
|
+
}
|
|
67204
|
+
if (o instanceof Date) {
|
|
67205
|
+
mix(s, T_DATE);
|
|
67206
|
+
return mixNumber(s, o.getTime());
|
|
67207
|
+
}
|
|
67208
|
+
if (o instanceof Map) {
|
|
67209
|
+
mix2(s, T_MAP, o.size);
|
|
67210
|
+
const digests: Array<[number, number, number]> = [];
|
|
67211
|
+
for (const [k, v] of o) {
|
|
67212
|
+
const sub = start();
|
|
67213
|
+
mix(sub, T_ENTRY);
|
|
67214
|
+
encode(sub, k, stack);
|
|
67215
|
+
encode(sub, v, stack);
|
|
67216
|
+
digests.push(finishWords(sub));
|
|
67217
|
+
}
|
|
67218
|
+
return mixSortedDigests(s, digests);
|
|
67219
|
+
}
|
|
67220
|
+
if (o instanceof Set) {
|
|
67221
|
+
mix2(s, T_SET, o.size);
|
|
67222
|
+
const digests: Array<[number, number, number]> = [];
|
|
67223
|
+
for (const member of o) {
|
|
67224
|
+
const sub = start();
|
|
67225
|
+
encode(sub, member, stack);
|
|
67226
|
+
digests.push(finishWords(sub));
|
|
67227
|
+
}
|
|
67228
|
+
return mixSortedDigests(s, digests);
|
|
67229
|
+
}
|
|
67230
|
+
if (typeof Blob !== 'undefined' && o instanceof Blob) {
|
|
67231
|
+
mix(s, T_BLOB);
|
|
67232
|
+
encode(s, (o as File).name ?? null, stack);
|
|
67233
|
+
encode(s, o.size, stack);
|
|
67234
|
+
encode(s, o.type, stack);
|
|
67235
|
+
encode(s, (o as File).lastModified ?? null, stack);
|
|
67236
|
+
return;
|
|
67237
|
+
}
|
|
67238
|
+
if (isPlainProto(proto)) {
|
|
67239
|
+
// A plain object from another realm.
|
|
67240
|
+
mix(s, T_OBJECT);
|
|
67241
|
+
return encodeFields(s, o, stack);
|
|
67242
|
+
}
|
|
67243
|
+
|
|
67244
|
+
// A class instance: its constructor's name, then its value.
|
|
67245
|
+
mix(s, T_CLASS);
|
|
67246
|
+
mixString(s, -1, String(o.constructor?.name ?? ''));
|
|
67247
|
+
const primitive = primitiveValueOf(o);
|
|
67248
|
+
if (primitive) {
|
|
67249
|
+
mix(s, T_VALUE_OF);
|
|
67250
|
+
return encode(s, primitive.value, stack);
|
|
67251
|
+
}
|
|
67252
|
+
const text = Object.keys(o).length === 0 ? customText(o) : undefined;
|
|
67253
|
+
if (text !== undefined) {
|
|
67254
|
+
mix(s, T_TO_STRING);
|
|
67255
|
+
return encode(s, text, stack);
|
|
67256
|
+
}
|
|
67257
|
+
return encodeFields(s, o, stack);
|
|
67258
|
+
};
|
|
67259
|
+
|
|
67260
|
+
const digestOf = (value: unknown) => {
|
|
67261
|
+
const s = start();
|
|
67262
|
+
encode(s, value, []);
|
|
67263
|
+
const words = finishWords(s);
|
|
67264
|
+
return hexWord(words[0]) + hexWord(words[1]) + hexWord(words[2]);
|
|
67265
|
+
};
|
|
67266
|
+
|
|
67267
|
+
// A short string of id characters is its own key (`s` + the text).
|
|
67268
|
+
const isShortIdSafe = (text: string) => {
|
|
67269
|
+
if (text.length > 64) return false;
|
|
67270
|
+
for (let i = 0; i < text.length; i++) {
|
|
67271
|
+
const c = text.charCodeAt(i);
|
|
67272
|
+
if (
|
|
67273
|
+
!(
|
|
67274
|
+
(c >= 48 && c <= 57) ||
|
|
67275
|
+
(c >= 65 && c <= 90) ||
|
|
67276
|
+
(c >= 97 && c <= 122) ||
|
|
67277
|
+
c === 95 ||
|
|
67278
|
+
c === 45
|
|
67279
|
+
)
|
|
67280
|
+
)
|
|
67281
|
+
return false;
|
|
67282
|
+
}
|
|
67283
|
+
return true;
|
|
67284
|
+
};
|
|
67285
|
+
|
|
67286
|
+
// A number's key: a safe integer spelled out (`42`, `m7` for -7), anything
|
|
67287
|
+
// else (decimals, ±Infinity, NaN, -0, huge integers) as `x` + its 64 IEEE-754
|
|
67288
|
+
// bits in hex, high word first, NaN canonical. Both forms are exact, and no
|
|
67289
|
+
// `String(n)` runs for a decimal (the costly part of a decimal key).
|
|
67290
|
+
const numberKey = (n: number) => {
|
|
67291
|
+
if (Number.isSafeInteger(n) && !Object.is(n, -0))
|
|
67292
|
+
return n >= 0 ? String(n) : `m${String(-n)}`;
|
|
67293
|
+
if (n !== n) return 'x7ff8000000000000';
|
|
67294
|
+
const lo = lowWord(n);
|
|
67295
|
+
return `x${hexWord(highWord())}${hexWord(lo)}`;
|
|
67296
|
+
};
|
|
67297
|
+
|
|
67298
|
+
/**
|
|
67299
|
+
* The key of `value`: `prefix` + a type tag + the value itself for numbers,
|
|
67300
|
+
* booleans, null, undefined, bigints and short id-safe strings (exact, so
|
|
67301
|
+
* those never collide); + `h` and a 96-bit digest of the exact encoding for
|
|
67302
|
+
* everything else.
|
|
67303
|
+
*/
|
|
67304
|
+
export const hash = (value: unknown, prefix = 'bb'): string => {
|
|
67305
|
+
switch (typeof value) {
|
|
67306
|
+
case 'number':
|
|
67307
|
+
return `${prefix}n${numberKey(value)}`;
|
|
67308
|
+
case 'boolean':
|
|
67309
|
+
return `${prefix}${value ? 't' : 'f'}`;
|
|
67310
|
+
case 'undefined':
|
|
67311
|
+
return `${prefix}u`;
|
|
67312
|
+
case 'bigint':
|
|
67313
|
+
return `${prefix}g${String(value).replace('-', 'm')}`;
|
|
67314
|
+
case 'string':
|
|
67315
|
+
if (isShortIdSafe(value)) return `${prefix}s${value}`;
|
|
67316
|
+
break;
|
|
67317
|
+
default:
|
|
67318
|
+
if (value === null) return `${prefix}z`;
|
|
67319
|
+
}
|
|
67320
|
+
return `${prefix}h${digestOf(value)}`;
|
|
67321
|
+
};
|
|
66423
67322
|
|
|
66424
67323
|
export const isPlainObject = (
|
|
66425
67324
|
value: unknown
|
|
@@ -66972,10 +67871,16 @@ import { shallowRef } from 'vue';
|
|
|
66972
67871
|
/**
|
|
66973
67872
|
* How arrays sit in the query string, for every helper that reads or writes
|
|
66974
67873
|
* it: `tags=a,b`, what Spatie QueryBuilder parses. Change it here, once —
|
|
66975
|
-
* a reader and a writer that disagree turn an array into a string.
|
|
67874
|
+
* a reader and a writer that disagree turn an array into a string. Under
|
|
67875
|
+
* `'bracket'` (`tags[]=a&tags[]=b`, what Laravel's `array` rule validates),
|
|
67876
|
+
* Laravel's own indexed `tags[0]=a&tags[1]=b` (in `page.url` and pager
|
|
67877
|
+
* links) reads as the same array, and a write to `tags` replaces either form.
|
|
66976
67878
|
*/
|
|
66977
67879
|
export const QUERY_ARRAY_FORMAT = 'comma';
|
|
66978
67880
|
|
|
67881
|
+
/** A `[]` or `[0]` suffix, raw or percent-encoded: `tags[]`, `tags%5B0%5D`. */
|
|
67882
|
+
const ARRAY_SUFFIX = /(?:\[|%5B)\d*(?:\]|%5D)$/i;
|
|
67883
|
+
|
|
66979
67884
|
/** A URL's parts. The first `?` starts the query; a `#` ends it. */
|
|
66980
67885
|
export const splitUrl = (url: string) => {
|
|
66981
67886
|
const hashAt = url.indexOf('#');
|
|
@@ -67032,7 +67937,10 @@ export const withQuery = (
|
|
|
67032
67937
|
.split('&')
|
|
67033
67938
|
.filter(Boolean)
|
|
67034
67939
|
.flatMap((part) => {
|
|
67035
|
-
|
|
67940
|
+
// `tags[]` and `tags[0]` are `tags`: a write owns every part of its key.
|
|
67941
|
+
const key = decodeKey(
|
|
67942
|
+
(part.split('=')[0] ?? '').replace(ARRAY_SUFFIX, '')
|
|
67943
|
+
);
|
|
67036
67944
|
if (!(key in changes)) return [part];
|
|
67037
67945
|
if (written.has(key)) return [];
|
|
67038
67946
|
written.add(key);
|
|
@@ -67091,10 +67999,19 @@ export const parseQuery = (
|
|
|
67091
67999
|
if (!query) return {};
|
|
67092
68000
|
// `qs.parse` decodes once. An encoded comma separates too: Laravel's pager
|
|
67093
68001
|
// links write `a%2Cb`, which PHP decodes to `a,b` before Spatie splits it.
|
|
67094
|
-
|
|
67095
|
-
|
|
67096
|
-
|
|
67097
|
-
|
|
68002
|
+
if (arrayFormat === 'comma')
|
|
68003
|
+
return qs.parse(query.replace(/%2C/gi, ','), { arrayFormat });
|
|
68004
|
+
if (arrayFormat !== 'bracket') return qs.parse(query, { arrayFormat });
|
|
68005
|
+
// Laravel's indexed `tags[0]=a&tags[1]=b` reads as `tags[]=a&tags[]=b`.
|
|
68006
|
+
const unindexed = query
|
|
68007
|
+
.split('&')
|
|
68008
|
+
.map((part) => {
|
|
68009
|
+
const at = part.indexOf('=');
|
|
68010
|
+
const key = at < 0 ? part : part.slice(0, at);
|
|
68011
|
+
return key.replace(ARRAY_SUFFIX, '[]') + (at < 0 ? '' : part.slice(at));
|
|
68012
|
+
})
|
|
68013
|
+
.join('&');
|
|
68014
|
+
return qs.parse(unindexed, { arrayFormat });
|
|
67098
68015
|
};
|
|
67099
68016
|
|
|
67100
68017
|
export const useQuery = ({
|
|
@@ -67483,6 +68400,9 @@ results are never hidden on an out-of-range page.
|
|
|
67483
68400
|
|
|
67484
68401
|
Arrays are written in the one `QUERY_ARRAY_FORMAT` of `useQuery.ts` (`comma`:
|
|
67485
68402
|
`tags=a,b`, what Spatie QueryBuilder parses), the same one `useQuery` reads.
|
|
68403
|
+
Set it to `'bracket'` for `tags[]=a&tags[]=b`, what Laravel's `array` rule
|
|
68404
|
+
validates: Laravel's own indexed `tags[0]=a` (in `page.url` and pager links)
|
|
68405
|
+
then reads as the same array, and a write replaces either form.
|
|
67486
68406
|
To send server-shaped keys (`filter[status]`) or reshape values, pass a getter
|
|
67487
68407
|
that builds them: `useQueryObject(() => ({ 'filter[status]': f.status }))`.
|
|
67488
68408
|
|
|
@@ -68887,65 +69807,54 @@ export const usePromiseRouter = (defaults: VisitOptions = {}) => {
|
|
|
68887
69807
|
Deep dirty-checking against a snapshot baseline — for edit screens whose
|
|
68888
69808
|
state is not a single Inertia form (multiple forms, ad-hoc refs). For a
|
|
68889
69809
|
single `usePromiseForm`, prefer the built-in `form.isDirty`. The baseline is
|
|
68890
|
-
|
|
68891
|
-
|
|
68892
|
-
|
|
69810
|
+
an exact key of each value (the same `hash` bitboss-ui keys rows with), so a
|
|
69811
|
+
cents-only edit (1450 → 1450.5) counts, Dates, Sets, Maps, `undefined` and
|
|
69812
|
+
NaN compare as they are, and a `File` by its name, size, type and date, so
|
|
69813
|
+
picking another file over a picked one counts.
|
|
68893
69814
|
|
|
68894
69815
|
```ts
|
|
68895
69816
|
// inertia-helpers/useHasChanged.ts
|
|
68896
|
-
import {
|
|
68897
|
-
import {
|
|
68898
|
-
import { computed, ref, toValue, type WatchSource } from 'vue';
|
|
69817
|
+
import { hash } from './utils';
|
|
69818
|
+
import { computed, ref, toValue, watch, type WatchSource } from 'vue';
|
|
68899
69819
|
|
|
68900
69820
|
export function useHasChanged<T extends WatchSource<unknown>[]>(
|
|
68901
69821
|
dependencies: T
|
|
68902
69822
|
) {
|
|
68903
69823
|
/*
|
|
68904
|
-
* The baseline is
|
|
68905
|
-
* values a form holds: a JSON round-trip turns a Date into a string, a
|
|
68906
|
-
* Set or Map into `{}`, drops `undefined` (and throws on a bare one),
|
|
68907
|
-
* an untouched form read as changed; `structuredClone` throws on Vue
|
|
68908
|
-
* `
|
|
68909
|
-
*
|
|
68910
|
-
*
|
|
68911
|
-
*
|
|
68912
|
-
* over a picked one counts as a change.
|
|
69824
|
+
* The baseline is an exact KEY (`hash`), not a copy. A copy has to survive
|
|
69825
|
+
* the values a form holds: a JSON round-trip turns a Date into a string, a
|
|
69826
|
+
* File, Set or Map into `{}`, drops `undefined` (and throws on a bare one),
|
|
69827
|
+
* so an untouched form read as changed; `structuredClone` throws on Vue
|
|
69828
|
+
* proxies. `hash` reads straight through a proxy and encodes every value
|
|
69829
|
+
* exactly: numbers to the last bit (2400 is not 2400.5), Dates by time,
|
|
69830
|
+
* Sets / Maps by content, Files by name, size, type and date, `undefined`
|
|
69831
|
+
* and NaN apart.
|
|
68913
69832
|
*/
|
|
68914
|
-
const snapshot = (dep: WatchSource<unknown>) =>
|
|
68915
|
-
hash(withFileFingerprints(toValue(dep)));
|
|
69833
|
+
const snapshot = (dep: WatchSource<unknown>) => hash(toValue(dep));
|
|
68916
69834
|
|
|
68917
|
-
const baselines = ref<
|
|
69835
|
+
const baselines = ref<string[]>(dependencies.map(snapshot));
|
|
68918
69836
|
|
|
68919
69837
|
/** Re-baseline (call after a successful save). */
|
|
68920
69838
|
const takeSnapshot = (): void => {
|
|
68921
69839
|
baselines.value = dependencies.map(snapshot);
|
|
68922
69840
|
};
|
|
68923
69841
|
|
|
68924
|
-
|
|
68925
|
-
|
|
68926
|
-
|
|
69842
|
+
/*
|
|
69843
|
+
* `hash` reads values raw, so it subscribes to nothing: a deep watch
|
|
69844
|
+
* bumps `edits` on every change, and that is what re-runs `hasChanged`.
|
|
69845
|
+
*/
|
|
69846
|
+
const edits = ref(0);
|
|
69847
|
+
watch(dependencies, () => edits.value++, { deep: true, flush: 'sync' });
|
|
69848
|
+
|
|
69849
|
+
const hasChanged = computed(() => {
|
|
69850
|
+
void edits.value;
|
|
69851
|
+
return dependencies.some(
|
|
69852
|
+
(dep, index) => snapshot(dep) !== baselines.value[index]
|
|
69853
|
+
);
|
|
69854
|
+
});
|
|
68927
69855
|
|
|
68928
69856
|
return { hasChanged, takeSnapshot };
|
|
68929
69857
|
}
|
|
68930
|
-
|
|
68931
|
-
const withFileFingerprints = (value: unknown): unknown =>
|
|
68932
|
-
value instanceof Blob
|
|
68933
|
-
? [
|
|
68934
|
-
value.size,
|
|
68935
|
-
value.type,
|
|
68936
|
-
(value as Partial<File>).name,
|
|
68937
|
-
(value as Partial<File>).lastModified,
|
|
68938
|
-
]
|
|
68939
|
-
: Array.isArray(value)
|
|
68940
|
-
? value.map(withFileFingerprints)
|
|
68941
|
-
: isPlainObject(value)
|
|
68942
|
-
? Object.fromEntries(
|
|
68943
|
-
Object.entries(value).map(([key, item]) => [
|
|
68944
|
-
key,
|
|
68945
|
-
withFileFingerprints(item),
|
|
68946
|
-
])
|
|
68947
|
-
)
|
|
68948
|
-
: value;
|
|
68949
69858
|
```
|
|
68950
69859
|
|
|
68951
69860
|
### useConfirmOnRouteLeave
|
|
@@ -71861,9 +72770,9 @@ Each row: what you will find, how to find it, and what to write instead.
|
|
|
71861
72770
|
- Find: `rg -n -g '*.vue' 'role=.tab(list)?[^a-z]'`
|
|
71862
72771
|
- Write: `<BbTabs v-model="view" :items="views" />`
|
|
71863
72772
|
- `pill` is the default look; `line` for page sections; `navigation` puts the tab in the URL.
|
|
71864
|
-
4. **A segmented control or tag group: a `v-for` of buttons
|
|
71865
|
-
- Find: `rg -n -g '*.vue' 'aria-pressed'` (in files that also match `v-for`)
|
|
71866
|
-
- Find: `rg -n -g '*.vue' '<(Segmented[A-Za-z]*|Tags?Group|ChipGroup|ToggleGroup|RadioCards?[A-Za-z]*)[\s/>]'`
|
|
72773
|
+
4. **A segmented control or tag group: a `v-for` of buttons whose `aria-pressed` compares to one shared value (`o === v`, `picked.includes(o)`), or an app component named like one (`SegmentedControl`, `TagGroup`, `ChipGroup`, `ToggleGroup`, `RadioCards`) that does not already render the library's group** → BbTabs (switch views) / BbRadioGroup (pick a value) / BbCheckboxGroup (pick several) `[toggle-group]`
|
|
72774
|
+
- Find: `rg -n -g '*.vue' '(^|\s)(:|v-bind:)?aria-pressed="[^"]*(==|!=|\.includes\(|\.has\()'` (in files that also match `v-for`)
|
|
72775
|
+
- Find: `rg -n -g '*.vue' '<(Segmented[A-Za-z]*|Tags?Group|ChipGroup|ToggleGroup|RadioCards?[A-Za-z]*)[\s/>]'` (skip a tag whose own `.vue` file renders `BbRadioGroup`, `BbCheckboxGroup` or `BbTabs`)
|
|
71867
72776
|
- Write: `<BbTabs v-model="view" :items="views" />`
|
|
71868
72777
|
- Decide by the job, not the look: switching what the page shows is BbTabs (`pill`); choosing a value a form or a filter submits is BbRadioGroup `variant="pill"` (several values: BbCheckboxGroup `variant="pill"`). See "Switch views or pick a value" above. On/off toggles that are not one choice are `BbButton` with `v-model` (it owns `aria-pressed`; `group` fuses them).
|
|
71869
72778
|
5. **Hand-built sortable headers: your own `aria-sort`, sort arrows and click handlers on `<th>`** → BbTable `sortable` columns + `v-model:sort` `[sort-header]`
|
|
@@ -71916,9 +72825,9 @@ Each row: what you will find, how to find it, and what to write instead.
|
|
|
71916
72825
|
- Write: `const ok = await confirm({ title: 'Delete invoice?', variant: 'destructive' });`
|
|
71917
72826
|
- The OK button takes the variant too. A row menu's delete item takes `variant: 'destructive'` on the item.
|
|
71918
72827
|
|
|
71919
|
-
14. **Your own mobile check: a `useIsMobile`, `window.matchMedia(…)` or an `innerWidth` comparison deciding layout** → `useMobile()` from bitboss-ui `[media-query]`
|
|
72828
|
+
14. **Your own mobile check: a `useIsMobile`, a `window.matchMedia(…)` width or pointer query, or an `innerWidth` comparison deciding layout** → `useMobile()` from bitboss-ui `[media-query]`
|
|
71920
72829
|
|
|
71921
|
-
- Find: `rg -n -g '*.{vue,ts,js}' '\buseIsMobile\b|window\.matchMedia\(|innerWidth\s*[<>]'`
|
|
72830
|
+
- Find: `rg -n -g '*.{vue,ts,js}' '\buseIsMobile\b|window\.matchMedia\(\s*[\x27"\x60][^\x27"\x60]*\b(?:(?:min-|max-)?width|(?:any-)?pointer)\b|innerWidth\s*[<>]'`
|
|
71922
72831
|
- Write: `const { isMobile } = useMobile();`
|
|
71923
72832
|
- It is the same breakpoint the adaptive overlays switch at (`mobileMaxWidth`), so the app and the library never disagree.
|
|
71924
72833
|
|
|
@@ -72991,14 +73900,14 @@ stays in your markup.
|
|
|
72991
73900
|
| `showArrow?: boolean` (default `false`) | removed | arrows are tooltip-only in v3; **⚠ silent** — a leftover `show-arrow` lands in `$attrs` |
|
|
72992
73901
|
| `arrowPadding` | removed | dead with the arrow |
|
|
72993
73902
|
| `picker?: boolean` | `eyeDropper?: boolean` | rename (same eyedropper feature) |
|
|
72994
|
-
| `update:open` event |
|
|
73903
|
+
| `update:open` event | `v-model:open` (since 3.0.0-beta.75) | the same event, now with an `open` prop: bind `v-model:open` to open the palette from code; `show` / `hide` still fire |
|
|
72995
73904
|
| `update:modelValue` payload `string \| null` | `string` — the palette always emits a concrete color, never `null` | **behavior** — clearing is the consumer's job now; handlers narrowing on `null` have dead branches |
|
|
72996
73905
|
| activator slot prop `color` | `value` | rename |
|
|
72997
73906
|
|
|
72998
73907
|
## Edits
|
|
72999
73908
|
|
|
73000
73909
|
```diff
|
|
73001
|
-
- <BbColorPalette v-model="color" :flip="false" show-arrow picker
|
|
73910
|
+
- <BbColorPalette v-model="color" :flip="false" show-arrow picker>
|
|
73002
73911
|
- <template #activator="{ props, color }">
|
|
73003
73912
|
- <button v-bind="props" :style="{ background: color }" />
|
|
73004
73913
|
+ <BbColorPalette v-model="color" disable-flip eye-dropper>
|
|
@@ -73398,6 +74307,7 @@ reaches it. Its own button hooks changed — see
|
|
|
73398
74307
|
| items `{ key, text }` (v2, and v3 up to beta.48) | items `{ value, label }` — the same rows as `BbDropdown` | hard rename — `npx bitboss-ui check --fix` rewrites literal items; see [bb-dropdown.md](https://llms-bitboss-ui.bitboss.it/dist/ai/guides/migration/components/bb-dropdown.md) |
|
|
73399
74308
|
| `items[0]` was the main button (v2, and v3 up to beta.57) | the component is the main button: label in the default slot, `@click` / `href` / `to` / `type` / `form` on it; every item is a menu row | **break** — move the first item onto the component (below); `bitboss-ui check` flags a split button with no label |
|
|
73400
74309
|
| default slot: `<BbDropdownGroup>` companions (v3 up to beta.57) | `#dropdown` slot; the default slot is the main button's label | **break** — wrap the companion in `<template #dropdown>` |
|
|
74310
|
+
| `#<groupId>` (a group's title; up to beta.74) | `#<groupId>:label`; `#group` / `#<groupId>:group` draw `groupBy` headings | `check --fix` renames it for the group ids it sees |
|
|
73401
74311
|
|
|
73402
74312
|
## Edits
|
|
73403
74313
|
|
|
@@ -73477,6 +74387,7 @@ label. `toggle:icon` is unchanged.
|
|
|
73477
74387
|
| _(v3 prereleases up to beta.63; v2 had no submenus)_ `Escape` anywhere closed the whole menu; only `ArrowRight` drilled into a submenu with focus | `Escape` in a submenu closes that level and refocuses its row; `Enter`, `Space` and click open a submenu with focus inside (search box first); focus returns to the row when a submenu closes under it; `dir="rtl"` swaps the inline arrows | **⚠ silent**: drop hand-rolled per-level `Escape` handlers and `focus()` calls into submenus, which now fight the menu (`v2-to-v3.md` § 6 item 101) |
|
|
73478
74388
|
| _(v3 prereleases up to beta.63)_ on the mobile sheet `Escape` closed the whole sheet from any level; going back focused the parent level's first row | `Escape` on a drilled-in level (row or search box) goes back one level, like the back control; going back focuses the row that opened the level; at the top level `Escape` closes the sheet | **⚠ silent**: update tests that expect `Escape` on a sheet level to close the menu (`v2-to-v3.md` § 6 item 107) |
|
|
73479
74389
|
| _(v3 prereleases up to beta.63)_ an item's `data-*` / `aria-*` keys were copied onto its row | items take only the fields the menu reads; row attributes go through `pt:item` (function form per row) | **⚠ silent**: move them to `:pt:item="({ item }) => ({ attrs: { … } })"` (`v2-to-v3.md` § 6 item 108) |
|
|
74390
|
+
| _(v3 prereleases up to beta.74)_ `#<groupId>`: a group's title content | `#<groupId>:label`; `#group` / `#<groupId>:group` draw the `groupBy` headings | rename the slot; `npx bitboss-ui check --fix` does it for the group ids it can see |
|
|
73480
74391
|
|
|
73481
74392
|
## Edits
|
|
73482
74393
|
|
|
@@ -74917,7 +75828,8 @@ from a cell slot on an unbound table does nothing and warns once.
|
|
|
74917
75828
|
table has no search field). `reason` replaces the `prefill` flag: `'initial'`,
|
|
74918
75829
|
`'dependencies'`, or `'pagination'` for a page or page-size move.
|
|
74919
75830
|
Pass `signal` to the request; throw on a failure (never `return []`), and the
|
|
74920
|
-
|
|
75831
|
+
table shows its failure row: `failed-text` with a built-in "Try again"
|
|
75832
|
+
(`#empty` is for empty results only). **⚠ silent**
|
|
74921
75833
|
for untyped code: a `prefill ? a : b` always takes `a`. Details and the
|
|
74922
75834
|
before/after in [§6 item 37](https://llms-bitboss-ui.bitboss.it/dist/ai/guides/migration/v2-to-v3.md).
|
|
74923
75835
|
|
|
@@ -75722,8 +76634,8 @@ Nothing catches this for you — `dismissAll` is not a template attribute, so
|
|
|
75722
76634
|
`rg -n 'dismissAll' --type ts --type js --type vue`. Hits on a `useConfirm()`
|
|
75723
76635
|
destructure are fine: `dismissAll` is **new** there, and unrelated.
|
|
75724
76636
|
|
|
75725
|
-
Notes on `actions` (additive but with rules): handlers run with a spinner
|
|
75726
|
-
|
|
76637
|
+
Notes on `actions` (additive but with rules): handlers run with a spinner,
|
|
76638
|
+
siblings ignore clicks meanwhile, and they hold the dismiss timer; portal toasts ignore `actions`.
|
|
75727
76639
|
Styling hooks moved from `theme` classes to `bb-toast__panel--<variant>` —
|
|
75728
76640
|
custom looks register through the plugin's `components.BbToast.variants` option
|
|
75729
76641
|
([main guide §4](https://llms-bitboss-ui.bitboss.it/dist/ai/guides/migration/v2-to-v3.md)).
|
|
@@ -78415,6 +79327,14 @@ to the new name (`hide-close`).
|
|
|
78415
79327
|
work. The v3 prereleases up to beta.32 exported this union as
|
|
78416
79328
|
`InputDirection`; that type export is gone — import `FieldLayout` (for
|
|
78417
79329
|
`layout` / `itemLayout`) or `ListLayout` (for `listLayout`) instead.
|
|
79330
|
+
- **Slot scope types**: each component exports its whole slots type
|
|
79331
|
+
(`BbCarouselSlots<T>`, `BbDropdownSlots`); index it for one slot. The v3
|
|
79332
|
+
prereleases up to beta.74 also exported `BbCarouselSlotProps` and
|
|
79333
|
+
`BbDropdownItemSlotProps`; those exports are gone — write
|
|
79334
|
+
`Parameters<BbCarouselSlots<Photo>['slide']>[0]` or
|
|
79335
|
+
`Parameters<BbDropdownSlots['item:prepend']>[0]`. The portal scopes
|
|
79336
|
+
(`BbConfirmPortalSlotProps`, `BbHoverCardPortalSlotProps`,
|
|
79337
|
+
`BbPopoverPortalSlotProps`, `DirectivePortalSlotProps`) stay.
|
|
78418
79338
|
|
|
78419
79339
|
- **Fall-through attributes are typed** (after 3.0.0-beta.65): each
|
|
78420
79340
|
component's props type carries Vue's attribute type of the element its
|
|
@@ -79071,11 +79991,13 @@ Nothing here fails to compile — these change what existing code does.
|
|
|
79071
79991
|
Two behaviours moved with it. **A provider signals a failure by throwing**,
|
|
79072
79992
|
never by returning `[]` (an empty array is a real, applied result): the
|
|
79073
79993
|
rows are cleared so stale rows never sit under a new filter, nothing is
|
|
79074
|
-
pruned, nothing reaches the SSR payload, and the
|
|
79075
|
-
|
|
79076
|
-
|
|
79077
|
-
|
|
79078
|
-
`
|
|
79994
|
+
pruned, nothing reaches the SSR payload, and the component shows its own
|
|
79995
|
+
failure row: the new `failed-text` prop — default "Couldn't load items"
|
|
79996
|
+
— then a "Try again" button that runs the failed call again. `#empty`
|
|
79997
|
+
means empty: it never renders for a failure, and its scope has no
|
|
79998
|
+
`error` (the v3 prereleases up to beta.74 handed it one; move that
|
|
79999
|
+
branch's copy to `failed-text` and drop any retry counter you listed in
|
|
80000
|
+
`dependencies`). And **one coherence rule for every family**:
|
|
79079
80001
|
`enforce-coherence` prunes only after an applied, successful, non-search
|
|
79080
80002
|
load — an EMPTY one included, so a legitimately empty dependent list drops
|
|
79081
80003
|
its stale picks. `BbDropdown` used to skip empty results; if a group relied
|
|
@@ -80337,6 +81259,37 @@ nullValue }, BbTextarea: { nullValue } }`, same values (`'null'` /
|
|
|
80337
81259
|
ignored and the default buttons show
|
|
80338
81260
|
([use-confirm](https://llms-bitboss-ui.bitboss.it/dist/ai/guides/migration/components/use-confirm.md)).
|
|
80339
81261
|
|
|
81262
|
+
166. **BbAlert has no empty title or icon containers** (after
|
|
81263
|
+
3.0.0-beta.73). With no `title` (prop or slot) the alert renders no
|
|
81264
|
+
`.bb-alert__title`, and with no icon no `.bb-alert__icon-container`.
|
|
81265
|
+
A selector that matched them empty (`:has(.bb-alert__title:empty)`)
|
|
81266
|
+
silently stops matching: write `:not(:has(.bb-alert__title))` for a
|
|
81267
|
+
body-only alert, `:not(:has(.bb-alert__icon-container))` for one with
|
|
81268
|
+
no icon. Drop `pt:title="hidden"` and
|
|
81269
|
+
`[&_.bb-alert__icon-container]:hidden` workarounds.
|
|
81270
|
+
|
|
81271
|
+
167. **BbTable paints its own surface** (after 3.0.0-beta.73). A table
|
|
81272
|
+
paints `--bg` (default `--bb-panel`) at rest, so on a surface of
|
|
81273
|
+
another colour it now shows the panel colour instead of the surface.
|
|
81274
|
+
Set `--bg` once on the table to blend in; pinned cells and the stuck
|
|
81275
|
+
header follow:
|
|
81276
|
+
|
|
81277
|
+
```css
|
|
81278
|
+
.my-card .bb-table {
|
|
81279
|
+
--bg: var(--card-bg);
|
|
81280
|
+
}
|
|
81281
|
+
```
|
|
81282
|
+
|
|
81283
|
+
A nested table still paints nothing. A `background: var(--bg)` on a
|
|
81284
|
+
`.bb-table.card` class is now redundant.
|
|
81285
|
+
|
|
81286
|
+
168. **A creatable select shows a "Create «query»" row** (after
|
|
81287
|
+
3.0.0-beta.74). With an `option:add` listener, a typed query that no
|
|
81288
|
+
option matches exactly gets a create row: last after the matches, or
|
|
81289
|
+
alone in place of the no-results text and `#empty`. Its click (and the
|
|
81290
|
+
arrow keys + Enter) emits `option:add`, as Enter already did. A
|
|
81291
|
+
`#empty` that offered a create link or button is redundant: drop it.
|
|
81292
|
+
|
|
80340
81293
|
## 7. Class overrides → variants
|
|
80341
81294
|
|
|
80342
81295
|
### The v2 pattern to hunt down
|
|
@@ -81492,6 +82445,8 @@ it):
|
|
|
81492
82445
|
Since 3.0.0-beta.58 the index rows carry no `file` (it is
|
|
81493
82446
|
`files.component` with the name) and `tree` only when `false`; the
|
|
81494
82447
|
`types.<usage>.json` files write `usedBy` as `"BbTable.prop.columns"` strings.
|
|
82448
|
+
Since 3.0.0-beta.74 each `types.<usage>.json` says its `usage` once, at the
|
|
82449
|
+
top, and its rows leave it out.
|
|
81495
82450
|
In `components.json` itself, a type whose resolved `fields` say everything
|
|
81496
82451
|
drops its `definition` (a generic, an index signature or a top-level union
|
|
81497
82452
|
keeps it), and `BbOffCanvasProps` points at its component instead of copying
|
|
@@ -81679,7 +82634,9 @@ What changed in the install and build-plugin setup during the 3.0 betas, for an
|
|
|
81679
82634
|
| `mcp` plugin option | `mcp: true` registered the MCP server on dev start | Removed in 3.0.0-beta.69: the build stops on it as an unknown option. `ai` (default `true`) sets up the agent files and the server, from installs and the dev server | Delete `mcp`. For none of it: `ai: false`, or `BITBOSS_UI_AI=0` on one machine |
|
|
81680
82635
|
| `ai-init` (and `--no-mcp`) | Wrote the agent files, `--no-mcp` without the MCP server | Removed in 3.0.0-beta.69: exits 1 and names `update --no-install`. Files and server are one setting | `npx bitboss-ui update --no-install`; for none of it, `ai: false` in the build plugin, or `BITBOSS_UI_AI=0` on one machine |
|
|
81681
82636
|
| `allowComponents` for `check` | `package.json` `"bitboss-ui": { "allowComponents": [...] }` or `bitboss-ui.check.json` | Read only from the build plugin, as a literal (3.0.0-beta.69); the old places are ignored, so those tags are reported again | Move the list into `bitbossUi({ allowComponents: [...] })` (Nuxt: `bitboss`). `registeredRules` and `dialogIdsWhitelist` stay in `bitboss-ui.check.json` |
|
|
82637
|
+
| Reporting opt-out | None: an app could not turn reporting off | `"bitboss-ui": { "report": false }` in `package.json` (3.0.0-beta.74): no `report` command, no MCP `report_issue`, no reporting section in the agent files | Add it to opt out; on by default |
|
|
81682
82638
|
| Cursor, Windsurf and Copilot rule files | `ai-init` wrote `.cursor/rules/bitboss-ui.mdc`, `.windsurf/rules/bitboss-ui.md` and a block in `.github/copilot-instructions.md` | Removed by `setup` and `update` (3.0.0-beta.69): those harnesses read `AGENTS.md`, and Zed read the Copilot file instead of it | Commit the deletions |
|
|
82639
|
+
| Agent files on a dev server start | Up to 3.0.0-beta.74 a dev, build or test start also deleted the old rule files and edited `CLAUDE.md` | Only installs (the postinstall) and `update` / `setup` delete files or edit `CLAUDE.md`; a dev start writes our own blocks and files | After changing `ai`, run `npx bitboss-ui update --no-install` |
|
|
81683
82640
|
|
|
81684
82641
|
---
|
|
81685
82642
|
|
|
@@ -83382,7 +84339,7 @@ _Passthrough parts and states_ table in that component's contract
|
|
|
83382
84339
|
| `BbAccordion` | `root`, `header`, `title`, `icon`, `panel` | `disabled`, `open` |
|
|
83383
84340
|
| `BbAlert` | `root`, `icon`, `title`, `text`, `close` | —; _(variants, every part: `outline`, `primary`, `destructive`, `warning`)_ |
|
|
83384
84341
|
| `BbAsterisk` | `root` | — |
|
|
83385
|
-
| `BbAvatar` | `root`, `icon` | — |
|
|
84342
|
+
| `BbAvatar` | `root`, `icon`, `initials` | — |
|
|
83386
84343
|
| `BbBadge` | `root`, `icon`, `spinner`, `text`, `clear` | `activeLink`, `exactActiveLink` _(from its link body)_, `loading`; _(variants, every part: `primary`, `secondary`, `destructive`, `outline`)_ |
|
|
83387
84344
|
| `BbBaseButton` | `root` | `activeLink`, `exactActiveLink`, `disabled` |
|
|
83388
84345
|
| `BbBaseCheckboxIcon` | `root` | `errors`, `warnings`, `disabled`, `readonly`, `checked`, `indeterminate`, `focused`, `focusVisible` |
|
|
@@ -83401,8 +84358,8 @@ _Passthrough parts and states_ table in that component's contract
|
|
|
83401
84358
|
| `BbDatePicker` | `root`, `panel`, `sheet`, `header`, `arrow`, `month`, `year`, `cellColumnHeader`, `week`, `weekNumber` _(`type="week"` rows)_, `day`, `dayButton`, `monthItem`, `yearItem`, `item` _(forwarded to the calendar)_ | `outside`, `today`, `inRange`, `selected`, `rangeStart`, `rangeEnd`, `disabled`, `highlighted` _(per cell)_, `active` _(month / year)_, `open` |
|
|
83402
84359
|
| `BbDatePickerInput` | family + `activator`, `panel`, `sheet`, `header`, `arrow`, `month`, `year`, `cellColumnHeader`, `week`, `weekNumber` _(`type="week"` rows)_, `day`, `dayButton`, `monthItem`, `yearItem`, `item` _(forwarded to the calendar)_ | family + `open`, `outside`, `today`, `inRange`, `selected`, `rangeStart`, `rangeEnd`, `disabled`, `highlighted` _(per cell)_, `active` _(month / year)_ |
|
|
83403
84360
|
| `BbDialog` | `root`, `sheet`, `header`, `title`, `description`, `content`, `footer`, `close` | `open`, `fullscreen` |
|
|
83404
|
-
| `BbDropdown` | `root`, `panel`, `sheet`, `header`, `footer`, `input` _(every searchable group's field)_, `list`, `item`, `itemText`, `itemIcon`, `itemDescription`, `check` _(the tick)_, `submenu` _(each flyout box)_ | `open`, `activeLink`, `exactActiveLink`, `selected`, `disabled` _(per entry)_; _(variants, per entry, on the entry parts: `default`, `destructive`)_ |
|
|
83405
|
-
| `BbDropdownButton` | `root`, `main`, `toggle` _(the two halves)_, `icon`, `spinner`, `text` _(the main button's)_, `panel`, `sheet`, `header`, `footer`, `input`, `item`, `itemText`, `itemIcon`, `itemDescription`, `check`, `submenu` _(the menu's)_ | `activeLink`, `exactActiveLink` _(the main button's link; per entry on the entry parts)_, `loading`, `disabled`, `open`; `selected` _(entry parts only)_; _(variants: the button's on the control's parts — root, main, toggle, icon, spinner, text: `primary`, `outline`, `secondary`, `ghost`, `destructive`, `link`; each entry's on the entry parts: `default`, `destructive`)_ |
|
|
84361
|
+
| `BbDropdown` | `root`, `panel`, `sheet`, `header`, `footer`, `box` _(each search box)_, `input` _(every searchable group's field)_, `list`, `item`, `itemText`, `itemIcon`, `itemDescription`, `check` _(the tick)_, `submenu` _(each flyout box)_ | `open`, `activeLink`, `exactActiveLink`, `selected`, `disabled` _(per entry)_; _(variants, per entry, on the entry parts: `default`, `destructive`)_ |
|
|
84362
|
+
| `BbDropdownButton` | `root`, `main`, `toggle` _(the two halves)_, `icon`, `spinner`, `text` _(the main button's)_, `panel`, `sheet`, `header`, `footer`, `box`, `input`, `list`, `item`, `itemText`, `itemIcon`, `itemDescription`, `check`, `submenu` _(the menu's)_ | `activeLink`, `exactActiveLink` _(the main button's link; per entry on the entry parts)_, `loading`, `disabled`, `open`; `selected` _(entry parts only)_; _(variants: the button's on the control's parts — root, main, toggle, icon, spinner, text: `primary`, `outline`, `secondary`, `ghost`, `destructive`, `link`; each entry's on the entry parts: `default`, `destructive`)_ |
|
|
83406
84363
|
| `BbDropzone` | `root`, `content`, `message` | `active`, `errors`, `warnings`, `disabled`, `readonly` |
|
|
83407
84364
|
| `BbGallery` | `root`, `header`, `title`, `close`, `slide` _(per photo)_, `image` _(per photo)_, `prev`, `next`, `footer`, `caption`, `more`, `counter` | `disabled` _(per node)_, `active` _(per node)_, `zoomed` |
|
|
83408
84365
|
| `BbHoverCard` | `root`, `panel`, `header`, `content`, `footer` | `open` |
|
|
@@ -83494,6 +84451,7 @@ customer's `id`.
|
|
|
83494
84451
|
| has its own logic: state, computed props it derives, extra props it reads, markup around the control | an SFC: [options-items-playbook](https://llms-bitboss-ui.bitboss.it/dist/ai/guides/options-items-playbook.md) § Wrapping BbSelect in your own component |
|
|
83495
84452
|
| is used on one page | neither: write the props on `BbSelect` there |
|
|
83496
84453
|
| only restyles parts, everywhere or in one area | neither: `pt` in the plugin config, or a named scope ([passthrough](https://llms-bitboss-ui.bitboss.it/dist/ai/guides/passthrough.md)) |
|
|
84454
|
+
| is a second look of one component, picked per instance (a dialog with a lined header) | a **preset** whose `pt` holds the look (step 2, `SeparatedDialog`) |
|
|
83497
84455
|
|
|
83498
84456
|
## 1. Copy the helper
|
|
83499
84457
|
|
|
@@ -83971,7 +84929,7 @@ One `.ts` file per domain, next to the data they read:
|
|
|
83971
84929
|
```ts no-check
|
|
83972
84930
|
// src/components/customers.ts
|
|
83973
84931
|
import { h } from 'vue';
|
|
83974
|
-
import { BbBadge, BbSelect, BbTextInput } from 'bitboss-ui';
|
|
84932
|
+
import { BbBadge, BbDialog, BbSelect, BbTextInput } from 'bitboss-ui';
|
|
83975
84933
|
import { definePreset } from '@/lib/definePreset';
|
|
83976
84934
|
import { getCustomers, type Customer } from '@/api/customers';
|
|
83977
84935
|
|
|
@@ -84001,6 +84959,14 @@ export const CustomerMultiSelect = definePreset(BbSelect<Customer>, {
|
|
|
84001
84959
|
multiple: true,
|
|
84002
84960
|
});
|
|
84003
84961
|
|
|
84962
|
+
// A second look of one component, picked per instance: no SFC wrapper, so
|
|
84963
|
+
// every BbDialog prop, event and slot stays typed for the caller.
|
|
84964
|
+
export const SeparatedDialog = definePreset(
|
|
84965
|
+
BbDialog,
|
|
84966
|
+
{ pt: { header: 'border-b', footer: 'border-t' } },
|
|
84967
|
+
{ name: 'SeparatedDialog' }
|
|
84968
|
+
);
|
|
84969
|
+
|
|
84004
84970
|
// Any component, not only selects.
|
|
84005
84971
|
export const SearchInput = definePreset(
|
|
84006
84972
|
BbTextInput,
|
|
@@ -84070,7 +85036,11 @@ is a `.ts` module, not an `.vue` file.
|
|
|
84070
85036
|
`:pt`; a default, the caller's `:pt` replaces it whole. Either way an
|
|
84071
85037
|
instance still adds its own look with the attribute form
|
|
84072
85038
|
(`<CustomerSelect pt:option="font-medium" />`), which merges over the
|
|
84073
|
-
preset's, so a one-off look needs no second preset.
|
|
85039
|
+
preset's, so a one-off look needs no second preset. The merge is the
|
|
85040
|
+
passthrough rule ([passthrough](https://llms-bitboss-ui.bitboss.it/dist/ai/guides/passthrough.md) § What merging means):
|
|
85041
|
+
the preset's `pt` object first, then the caller's `pt:<part>`; a class
|
|
85042
|
+
appends, and a conflicting utility from the caller replaces the preset's
|
|
85043
|
+
(`<SeparatedDialog pt:header="border-b-2">` drops `border-b`).
|
|
84074
85044
|
|
|
84075
85045
|
## Limits
|
|
84076
85046
|
|
|
@@ -84087,6 +85057,56 @@ is a `.ts` module, not an `.vue` file.
|
|
|
84087
85057
|
|
|
84088
85058
|
---
|
|
84089
85059
|
|
|
85060
|
+
<!-- dist/ai/guides/reporting.md -->
|
|
85061
|
+
<!-- https://llms-bitboss-ui.bitboss.it/dist/ai/guides/reporting.md -->
|
|
85062
|
+
|
|
85063
|
+
# Reporting to the maintainers
|
|
85064
|
+
|
|
85065
|
+
Whenever you work around the library, or hit one of these, report it to the
|
|
85066
|
+
maintainers, then keep your workaround in place: a report never waits on a fix.
|
|
85067
|
+
|
|
85068
|
+
- `bug`: The library does the wrong thing.
|
|
85069
|
+
- `friction`: It works, but getting there took trial and error, or the docs or types misled you.
|
|
85070
|
+
- `glue`: Code you had to write around the library for a common need (a wrapper, an adapter, wiring you repeat across screens). Put the glue in `snippet`.
|
|
85071
|
+
- `smell`: It works, but something feels wrong: an inconsistent API, an odd name, a surprising default.
|
|
85072
|
+
- `feature`: Something the library doesn't do and should.
|
|
85073
|
+
- `docs`: Docs that are wrong, missing or unfindable.
|
|
85074
|
+
|
|
85075
|
+
With the MCP server connected, call `report_issue`. Otherwise
|
|
85076
|
+
`npx bitboss-ui report --kind friction --component BbSelect --expected "…" --actual "…"`
|
|
85077
|
+
(it fills in the installed version and prints the report id and a status URL),
|
|
85078
|
+
or, with nothing installed:
|
|
85079
|
+
|
|
85080
|
+
```sh
|
|
85081
|
+
curl -sS https://ui-components.bitboss.it/api/report -H 'content-type: application/json' -d '{"kind":"bug","component":"BbSelect","version":"<installed bitboss-ui version>","expected":"…","actual":"…"}'
|
|
85082
|
+
```
|
|
85083
|
+
|
|
85084
|
+
`component` is the `Bb*` name or the surface (`cli`, `mcp`, `vite-plugin`,
|
|
85085
|
+
`nuxt-module`, `docs`, `other`); `workaround` and `snippet` are optional.
|
|
85086
|
+
Send a minimal repro only: never app data, customer data, secrets or
|
|
85087
|
+
proprietary code.
|
|
85088
|
+
|
|
85089
|
+
Each report gets an id and a status URL that says when it is fixed and in
|
|
85090
|
+
which version. The human-facing guide: https://ui-components.bitboss.it/en/guides/reporting
|
|
85091
|
+
|
|
85092
|
+
## Turning reporting off
|
|
85093
|
+
|
|
85094
|
+
Reporting is on by default. An app turns it off in its `package.json`:
|
|
85095
|
+
|
|
85096
|
+
```json
|
|
85097
|
+
{
|
|
85098
|
+
"bitboss-ui": { "report": false }
|
|
85099
|
+
}
|
|
85100
|
+
```
|
|
85101
|
+
|
|
85102
|
+
Then `npx bitboss-ui report` refuses ("reporting is off in this project:
|
|
85103
|
+
package.json bitboss-ui.report"), the MCP server does not offer
|
|
85104
|
+
`report_issue`, and the next `npx bitboss-ui update` (or install) drops the
|
|
85105
|
+
reporting section from the agent files (`AGENTS.md`, the skill). Remove the
|
|
85106
|
+
key, or set it to `true`, to turn it back on.
|
|
85107
|
+
|
|
85108
|
+
---
|
|
85109
|
+
|
|
84090
85110
|
<!-- dist/ai/guides/ssr-prefill.md -->
|
|
84091
85111
|
<!-- https://llms-bitboss-ui.bitboss.it/dist/ai/guides/ssr-prefill.md -->
|
|
84092
85112
|
|
|
@@ -85645,7 +86665,7 @@ Do not use these components directly in consumer code unless the user explicitly
|
|
|
85645
86665
|
- [Migration v2→v3: BbChip (removed)](https://llms-bitboss-ui.bitboss.it/dist/ai/guides/migration/components/bb-chip.md) - BbChip is gone — BbBadge with clearable is the replacement; non-clearable chips were badges all along.
|
|
85646
86666
|
- [Migration v2→v3: BbCollapsible](https://llms-bitboss-ui.bitboss.it/dist/ai/guides/migration/components/bb-collapsible.md) - `tag` narrows to `'span' | 'div'` and still defaults to `div`; the inner element mirrors it.
|
|
85647
86667
|
- [Migration v2→v3: BbColorInput](https://llms-bitboss-ui.bitboss.it/dist/ai/guides/migration/components/bb-color-input.md) - picker renamed to eyeDropper.
|
|
85648
|
-
- [Migration v2→v3: BbColorPalette](https://llms-bitboss-ui.bitboss.it/dist/ai/guides/migration/components/bb-color-palette.md) - flip inverted to disableFlip, showArrow removed, picker renamed eyeDropper, update:open
|
|
86668
|
+
- [Migration v2→v3: BbColorPalette](https://llms-bitboss-ui.bitboss.it/dist/ai/guides/migration/components/bb-color-palette.md) - flip inverted to disableFlip, showArrow removed, picker renamed eyeDropper, update:open is v-model:open, model updates never emit null.
|
|
85649
86669
|
- [Migration v2→v3: BbConfirm + BbToast → BbHost](https://llms-bitboss-ui.bitboss.it/dist/ai/guides/migration/components/bb-host.md) - Delete the <BbConfirm /> and <BbToast /> tags — the plugin renders the <BbHost /> that replaces them; their size, position and pt props move to the plugin config; a second host renders nothing; confirm() with no host resolves false after 1s.
|
|
85650
86670
|
- [Migration v2→v3: BbDatePickerInput](https://llms-bitboss-ui.bitboss.it/dist/ai/guides/migration/components/bb-date-picker-input.md) - allowWriting inverted to disableWriting and hidePopover renamed to disableCalendar, both with a changed token set; the width prop is removed; adaptive mobile sheet by default; non-floating output carries the local offset instead of UTC `Z` (new `utc` prop restores v2 output).
|
|
85651
86671
|
- [Migration v2→v3: BbDialog](https://llms-bitboss-ui.bitboss.it/dist/ai/guides/migration/components/bb-dialog.md) - showClose inverted to hideClose, #close removed (description restored in beta.19), default widths changed, adaptive bottom sheet on mobile by default, --bb-dialog-* tokens replaced by --bb-panel-p plus locals.
|
|
@@ -85679,6 +86699,7 @@ Do not use these components directly in consumer code unless the user explicitly
|
|
|
85679
86699
|
- [Passthrough (pt)](https://llms-bitboss-ui.bitboss.it/dist/ai/guides/passthrough.md) - Reach a named part of a component — its icon, its field box, a table row, a menu entry — with a class list, a style or an attribute, optionally only while a named state is on. One grammar for every component, typed and linted. A pt value typed in <script> (a const, a preset, a wrapper's prop, a split components map) uses <Component>Props['pt'] and satisfies BbComponentsMap; the Pt* types are not exported.
|
|
85680
86700
|
- [Porting forms from Element Plus, Naive UI and Ant Design Vue (async-validator `rules`)](https://llms-bitboss-ui.bitboss.it/dist/ai/guides/migration/from-async-validator.md) - Port an `el-form` / `n-form` / `a-form` with a `rules` object (async-validator `FormItemRule`s) to BbForm. Every rule field mapped to a string rule AND a Zod schema (Valibot, Yup noted), `validator` / `asyncValidator` callbacks to return values, `trigger` to `validationMode`, every form and form-item prop and instance method (`validate`, `validateField`, `resetFields`, `clearValidate`, `scrollToField`, `restoreValidation`, `useForm` / `validateInfos`), three complete before/after forms, and what does not port.
|
|
85681
86701
|
- [Preset Components](https://llms-bitboss-ui.bitboss.it/dist/ai/guides/preset-components.md) - Make an app component that is a bitboss-ui component with some props and slots already set (a CustomerSelect, a SearchInput) in one definePreset call, with no SFC, no re-emit and a typed v-model.
|
|
86702
|
+
- [Reporting to the maintainers](https://llms-bitboss-ui.bitboss.it/dist/ai/guides/reporting.md) - When you work around bitboss-ui or hit a bug, friction, glue, smell, missing feature or docs gap, report it and keep your workaround — the six kinds, `npx bitboss-ui report`, the MCP `report_issue` tool, and a curl one-liner.
|
|
85682
86703
|
- [SSR prefill](https://llms-bitboss-ui.bitboss.it/dist/ai/guides/ssr-prefill.md) - Item providers run on the server only with an SSR-state adapter (bitboss-ui/nuxt installs one).
|
|
85683
86704
|
- [TypeScript and Generic Components](https://llms-bitboss-ui.bitboss.it/dist/ai/guides/typescript-generic-components.md) - Which bitboss-ui components are generic, and the four places their type differs from a regular component — template refs (InstanceType), Storybook Meta, test-utils findComponent, and v-model write-backs vue-tsc never checks.
|
|
85684
86705
|
- [Validated Forms (vee-validate)](https://llms-bitboss-ui.bitboss.it/dist/ai/guides/validated-forms.md) - Forms with validation — the form controls join a BbForm (vee-validate underneath). Validate with one schema for the whole form (any Standard Schema — Zod, Valibot, ArkType, Yup — on BbForm's `schema`, no adapter) or with per-field `rules="required|email"` strings; BbForm hosts the form, focuses the first invalid field on a failed submit and emits `invalid`; requiredAsterisk marks required fields.
|
|
@@ -85746,6 +86767,7 @@ Do not use these components directly in consumer code unless the user explicitly
|
|
|
85746
86767
|
- `focused:change` — `(id: string \| undefined): void` — Emitted when the keyboard-focused option changes.
|
|
85747
86768
|
- `option:selected` — `(option: Option): void` — Emitted when an option is selected by the user.
|
|
85748
86769
|
- `option:unselected` — `(option: Option): void` — Emitted when a previously selected option is deselected.
|
|
86770
|
+
- `retry` — `(event: MouseEvent): void` — The failure footer's "Try again" was pressed: the host runs the failed load again.
|
|
85749
86771
|
|
|
85750
86772
|
## Slots
|
|
85751
86773
|
|
|
@@ -85790,8 +86812,8 @@ Do not use these components directly in consumer code unless the user explicitly
|
|
|
85790
86812
|
| --- | --- | --- | --- | --- |
|
|
85791
86813
|
| `block` | `string` | | yes | The owning group's public BEM block (`bb-checkbox-group`): the nodes are its elements (`__list`, `__loading`, `__item`, `__label`, …), named after the `pt` parts. |
|
|
85792
86814
|
| `emptyText` | `string \| undefined` | | | String displayed when there are no items to display. |
|
|
85793
|
-
| `error` | `unknown` | | | What the owning group's latest failed `items` load rejected with; `null` (or unset) when nothing failed. While set, the
|
|
85794
|
-
| `failedText` | `string \| undefined` | | |
|
|
86815
|
+
| `error` | `unknown` | | | What the owning group's latest failed `items` load rejected with; `null` (or unset) when nothing failed. While set, the list shows the failure row (`failedText` and "Try again"), never the `empty` slot. Internal. |
|
|
86816
|
+
| `failedText` | `string \| undefined` | | | The failure row's message while `error` is set. |
|
|
85795
86817
|
| `hasErrors` | `boolean \| undefined` | `false` | | Define if the component should be in an error state. It usually attaches a CSS class for styling purposes. |
|
|
85796
86818
|
| `hasWarnings` | `boolean \| undefined` | `false` | | Define if the component should be in a warning state. Attaches a `--warnings` CSS class; suppressed when `hasErrors` is true. |
|
|
85797
86819
|
| `hideLabel` | `boolean \| undefined` | `false` | | Visually hides the label of the input while maintaining accessibility. |
|
|
@@ -85810,12 +86832,12 @@ Do not use these components directly in consumer code unless the user explicitly
|
|
|
85810
86832
|
|
|
85811
86833
|
## Events
|
|
85812
86834
|
|
|
85813
|
-
-
|
|
86835
|
+
- `retry` — `(event: MouseEvent): void` — The failure row's "Try again" was pressed: the group runs the failed load again.
|
|
85814
86836
|
|
|
85815
86837
|
## Slots
|
|
85816
86838
|
|
|
85817
86839
|
- `append` — scope: `object` — Content rendered after the last option, inside the options container.
|
|
85818
|
-
- `empty` — scope: `
|
|
86840
|
+
- `empty` — scope: `object` — Content shown when no options are available (replaces the default "no data" text). Empty only: a failed load shows the failure row.
|
|
85819
86841
|
- `input` — scope: `OptionsContainerInputSlotProps<T>` `{ index: number; option: Option<T>; labelId: string; descriptionId: string; rowStates: Partial<Record<RowPtState, boolean>> }` — The actual input element for each option (e.g. radio or checkbox).
|
|
85820
86842
|
- `label` — scope: `OptionsContainerLabelSlotProps<T>` `{ checked: boolean; item: T; text: string; description: string }` — Replaces the default label text for each option.
|
|
85821
86843
|
- `loading` — scope: `object` — Content shown while options are loading (replaces the default loading text).
|
|
@@ -89898,7 +90920,9 @@ const onEscape = (event: KeyboardEvent) => {
|
|
|
89898
90920
|
row-gap: 0.5rem;
|
|
89899
90921
|
}
|
|
89900
90922
|
|
|
89901
|
-
|
|
90923
|
+
/* The trail is the row's `<nav>` landmark: no reach into the library's
|
|
90924
|
+
own classes. */
|
|
90925
|
+
.page-shell__topbar > :deep(* > nav) {
|
|
89902
90926
|
flex-basis: 100%;
|
|
89903
90927
|
}
|
|
89904
90928
|
|
|
@@ -108214,7 +109238,9 @@ const onEscape = (event: KeyboardEvent) => {
|
|
|
108214
109238
|
row-gap: 0.5rem;
|
|
108215
109239
|
}
|
|
108216
109240
|
|
|
108217
|
-
|
|
109241
|
+
/* The trail is the row's `<nav>` landmark: no reach into the library's
|
|
109242
|
+
own classes. */
|
|
109243
|
+
.page-shell__topbar > :deep(* > nav) {
|
|
108218
109244
|
flex-basis: 100%;
|
|
108219
109245
|
}
|
|
108220
109246
|
|
|
@@ -126502,7 +127528,9 @@ const onEscape = (event: KeyboardEvent) => {
|
|
|
126502
127528
|
row-gap: 0.5rem;
|
|
126503
127529
|
}
|
|
126504
127530
|
|
|
126505
|
-
|
|
127531
|
+
/* The trail is the row's `<nav>` landmark: no reach into the library's
|
|
127532
|
+
own classes. */
|
|
127533
|
+
.page-shell__topbar > :deep(* > nav) {
|
|
126506
127534
|
flex-basis: 100%;
|
|
126507
127535
|
}
|
|
126508
127536
|
|