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
|
@@ -59,7 +59,13 @@
|
|
|
59
59
|
aria-live="polite"
|
|
60
60
|
class="bb-table-loading__text bb-sr-only"
|
|
61
61
|
role="status"
|
|
62
|
-
>{{
|
|
62
|
+
>{{
|
|
63
|
+
loading
|
|
64
|
+
? loadingText || t('common.loadingText').value
|
|
65
|
+
: itemsError !== null
|
|
66
|
+
? resolvedFailedText
|
|
67
|
+
: ''
|
|
68
|
+
}}</span
|
|
63
69
|
>
|
|
64
70
|
<!-- Row reorder (POC): the handles' keyboard instructions, the reason
|
|
65
71
|
they refuse while a sort is active, and the polite region every lift,
|
|
@@ -274,8 +280,8 @@
|
|
|
274
280
|
>
|
|
275
281
|
<!-- eslint-enable vue/attributes-order -->
|
|
276
282
|
<HeaderAffix
|
|
277
|
-
v-if="
|
|
278
|
-
:
|
|
283
|
+
v-if="headerAffixNames(header.key, 'prepend').length"
|
|
284
|
+
:names="headerAffixNames(header.key, 'prepend')"
|
|
279
285
|
:scope="headerAffixScope(header)"
|
|
280
286
|
/>
|
|
281
287
|
<!-- @vue-ignore -->
|
|
@@ -330,8 +336,8 @@
|
|
|
330
336
|
}}</span>
|
|
331
337
|
</slot>
|
|
332
338
|
<HeaderAffix
|
|
333
|
-
v-if="
|
|
334
|
-
:
|
|
339
|
+
v-if="headerAffixNames(header.key, 'append').length"
|
|
340
|
+
:names="headerAffixNames(header.key, 'append')"
|
|
335
341
|
:scope="headerAffixScope(header)"
|
|
336
342
|
/>
|
|
337
343
|
<!-- Resize handle on the trailing edge (root tables only — an
|
|
@@ -494,12 +500,30 @@
|
|
|
494
500
|
class="bb-table-empty__cell"
|
|
495
501
|
:role="cellRole"
|
|
496
502
|
>
|
|
497
|
-
|
|
498
|
-
|
|
503
|
+
<!-- A failed load is the table's own row, never `#empty` (empty
|
|
504
|
+
means empty), and ends with "Try again".
|
|
505
|
+
The busy region above announces the message. -->
|
|
506
|
+
<div
|
|
507
|
+
v-if="itemsError !== null"
|
|
508
|
+
class="bb-table-empty__content bb-table-empty__content--failed"
|
|
509
|
+
>
|
|
510
|
+
<span class="bb-table-empty__failed"
|
|
511
|
+
><span class="bb-table-empty__text">{{
|
|
512
|
+
resolvedFailedText
|
|
513
|
+
}}</span
|
|
514
|
+
><button
|
|
515
|
+
class="bb-load-retry"
|
|
516
|
+
type="button"
|
|
517
|
+
@click="runRetry($event, retryLoad, () => tableRef)"
|
|
518
|
+
>
|
|
519
|
+
{{ t('common.retryLabel').value }}
|
|
520
|
+
</button></span
|
|
521
|
+
>
|
|
522
|
+
</div>
|
|
523
|
+
<div v-else class="bb-table-empty__content">
|
|
524
|
+
<slot name="empty">
|
|
499
525
|
<span class="bb-table-empty__text">{{
|
|
500
|
-
|
|
501
|
-
? failedText || t('common.failedText').value
|
|
502
|
-
: emptyText || t('common.emptyText').value
|
|
526
|
+
emptyText || t('common.emptyText').value
|
|
503
527
|
}}</span>
|
|
504
528
|
</slot>
|
|
505
529
|
</div>
|
|
@@ -675,6 +699,7 @@ import {
|
|
|
675
699
|
import { clamp } from '@/utilities/functions/clamp';
|
|
676
700
|
import { hash } from '@/utilities/functions/hash';
|
|
677
701
|
import { isNil } from '@/utilities/functions/isNil';
|
|
702
|
+
import { slotContent } from '@/utilities/functions/slotContent';
|
|
678
703
|
import { when } from '@/utilities/functions/when';
|
|
679
704
|
import { useId } from '@/composables/useId';
|
|
680
705
|
import { useItemValue } from '@/composables/useItemValue';
|
|
@@ -786,6 +811,7 @@ import {
|
|
|
786
811
|
takeOutOfTabOrder,
|
|
787
812
|
} from './gridWidgets';
|
|
788
813
|
import BbBaseButton from '../BbBaseButton/BbBaseButton.vue';
|
|
814
|
+
import { runRetry } from '@/utils/loadRetry';
|
|
789
815
|
|
|
790
816
|
/** A row's value through `item-value`: the whole row when it is unset. */
|
|
791
817
|
type RowValue = TableValueOf<Item, A>;
|
|
@@ -3793,10 +3819,18 @@ const columnTracks = computed(() => {
|
|
|
3793
3819
|
// the frozen lengths become proportional floors instead of hard sizes. A
|
|
3794
3820
|
// user-resized column opts out of that share (it is an exact track, see
|
|
3795
3821
|
// `isResized`); the declared-only columns keep filling around it.
|
|
3822
|
+
// Every width a LENGTH: a keyword track (`1fr`,
|
|
3823
|
+
// `minmax(…)`, `auto`) sizes itself, so a table that has one is not all
|
|
3824
|
+
// frozen, and its bare lengths hold as declared.
|
|
3796
3825
|
const allFrozen =
|
|
3797
3826
|
!isInheriting.value &&
|
|
3798
3827
|
columns.length > 0 &&
|
|
3799
|
-
columns.every(
|
|
3828
|
+
columns.every(
|
|
3829
|
+
// The DECLARED width: a virtual table's measured one is not a
|
|
3830
|
+
// declaration (`isVirtualFrozen` sizes those).
|
|
3831
|
+
(column) =>
|
|
3832
|
+
column.width != null && !isTrackKeyword(toLength(column.width))
|
|
3833
|
+
);
|
|
3800
3834
|
columns.forEach((column, index) => {
|
|
3801
3835
|
const key = String(column.key);
|
|
3802
3836
|
const declared = effectiveWidth(column);
|
|
@@ -4444,12 +4478,21 @@ const {
|
|
|
4444
4478
|
items: internalItems,
|
|
4445
4479
|
loading: innerLoading,
|
|
4446
4480
|
error: itemsError,
|
|
4481
|
+
retry,
|
|
4447
4482
|
ssrMarker,
|
|
4448
4483
|
} = useItemsGetter({
|
|
4449
4484
|
items: toRef(props, 'items'),
|
|
4450
4485
|
marker: true,
|
|
4451
4486
|
});
|
|
4452
4487
|
|
|
4488
|
+
const resolvedFailedText = computed(
|
|
4489
|
+
() => props.failedText || t('common.failedText').value
|
|
4490
|
+
);
|
|
4491
|
+
/** The failure row's "Try again": the failed load again, then the prune on rows it applied. */
|
|
4492
|
+
const retryLoad = async () => {
|
|
4493
|
+
if ((await retry()) === 'applied') pruneIncoherent();
|
|
4494
|
+
};
|
|
4495
|
+
|
|
4453
4496
|
const { hasPrefilled, whenPrefilled } = usePrefill({
|
|
4454
4497
|
alreadyLoaded: hydratedFromSsr,
|
|
4455
4498
|
clientReproducible,
|
|
@@ -5382,11 +5425,11 @@ const mappedHeaders = computed(() =>
|
|
|
5382
5425
|
* `<key>:header:prepend/append` slot wins over the table-wide
|
|
5383
5426
|
* `header:prepend/append` one — they never stack (BbDropdown's item rule).
|
|
5384
5427
|
*/
|
|
5385
|
-
|
|
5386
|
-
|
|
5387
|
-
|
|
5388
|
-
|
|
5389
|
-
|
|
5428
|
+
/** A header affix's slots present, strongest first: the column's, then the table-wide one. */
|
|
5429
|
+
const headerAffixNames = (key: string, suffix: HeaderAffixSuffix) =>
|
|
5430
|
+
[`${slotNamesByKey.value[key]}:header:${suffix}`, `header:${suffix}`].filter(
|
|
5431
|
+
(name) => slots[name]
|
|
5432
|
+
);
|
|
5390
5433
|
|
|
5391
5434
|
/**
|
|
5392
5435
|
* Renders a header affix slot. One component type for the table's life, so
|
|
@@ -5397,10 +5440,18 @@ const headerAffixName = (key: string, suffix: HeaderAffixSuffix) => {
|
|
|
5397
5440
|
* compiler adds `key` and `ref_for` to a spread outlet's scope.
|
|
5398
5441
|
*/
|
|
5399
5442
|
const HeaderAffix: FunctionalComponent<{
|
|
5400
|
-
|
|
5443
|
+
names: string[];
|
|
5401
5444
|
scope: BbTableHeaderAffixSlotProps<Item>;
|
|
5402
|
-
}> = (affix) =>
|
|
5403
|
-
|
|
5445
|
+
}> = (affix) => {
|
|
5446
|
+
// The first that renders something: a column's affix that renders nothing
|
|
5447
|
+
// for it falls back to the table-wide one (the empty-slot rule).
|
|
5448
|
+
for (const name of affix.names) {
|
|
5449
|
+
const nodes = slotContent(slots[name], affix.scope);
|
|
5450
|
+
if (nodes) return nodes;
|
|
5451
|
+
}
|
|
5452
|
+
return null;
|
|
5453
|
+
};
|
|
5454
|
+
HeaderAffix.props = ['names', 'scope'];
|
|
5404
5455
|
|
|
5405
5456
|
/**
|
|
5406
5457
|
* Affix slots receive the `<key>:header` payload plus the column key so a
|
|
@@ -8817,7 +8868,7 @@ export type BbTableProps<Item = any> = BbTablePtProps & {
|
|
|
8817
8868
|
* Rows to render: an array, or a provider called with a
|
|
8818
8869
|
* `BbTableItemsContext` (`reason`, `modelValue`, `signal`), sync or async.
|
|
8819
8870
|
* A provider fails by THROWING, never by returning `[]`: the rows clear and
|
|
8820
|
-
*
|
|
8871
|
+
* the failure row shows `failed-text` with "Try again". Return the page as it is.
|
|
8821
8872
|
*
|
|
8822
8873
|
* @defaultValue `[]`
|
|
8823
8874
|
*/
|
|
@@ -9280,8 +9331,8 @@ type BbTableColumnSlots<Item, V> = Record<
|
|
|
9280
9331
|
/**
|
|
9281
9332
|
* @dynamicSlot `<key>` - 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`.
|
|
9282
9333
|
* @dynamicSlot `<key>:header` - One column's header content, replacing its label and the built-in sort button. Scope: `{ label, items, sortable, sortOrder, toggleSort, hideColumn, classes }`.
|
|
9283
|
-
* @dynamicSlot `<key>:header:prepend` {BbTableHeaderAffixSlotProps<Item>} - Content before one column's header, keeping the sort button; beats `header:prepend` (they never stack).
|
|
9284
|
-
* @dynamicSlot `<key>:header:append` {BbTableHeaderAffixSlotProps<Item>} - Content after one column's header, keeping the sort button; beats `header:append` (they never stack).
|
|
9334
|
+
* @dynamicSlot `<key>:header:prepend` {BbTableHeaderAffixSlotProps<Item>} - Content before one column's header, keeping the sort button; beats `header:prepend` (they never stack) unless it renders nothing.
|
|
9335
|
+
* @dynamicSlot `<key>:header:append` {BbTableHeaderAffixSlotProps<Item>} - Content after one column's header, keeping the sort button; beats `header:append` (they never stack) unless it renders nothing.
|
|
9285
9336
|
* @dynamicSlot `<key>:first` {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.
|
|
9286
9337
|
* @dynamicSlot `<key>:last` {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`.
|
|
9287
9338
|
*/
|
|
@@ -9347,14 +9398,16 @@ export type BbTableSlots<Item = any, V = any> = BbTableColumnSlots<Item, V> & {
|
|
|
9347
9398
|
/**
|
|
9348
9399
|
* Content before every data column's header content (the label + sort
|
|
9349
9400
|
* control, or its own `<key>:header` replacement). A column's
|
|
9350
|
-
* `<key>:header:prepend` wins over this for that column; they never stack
|
|
9401
|
+
* `<key>:header:prepend` wins over this for that column; they never stack,
|
|
9402
|
+
* unless it renders nothing there.
|
|
9351
9403
|
* Branch on `columnKey` for per-column output.
|
|
9352
9404
|
*/
|
|
9353
9405
|
'header:prepend'?: (props: BbTableHeaderAffixSlotProps<Item>) => any;
|
|
9354
9406
|
/**
|
|
9355
9407
|
* Content after every data column's header content (the label + sort
|
|
9356
9408
|
* control, or its own `<key>:header` replacement). A column's
|
|
9357
|
-
* `<key>:header:append` wins over this for that column; they never stack
|
|
9409
|
+
* `<key>:header:append` wins over this for that column; they never stack,
|
|
9410
|
+
* unless it renders nothing there.
|
|
9358
9411
|
* Branch on `columnKey` for per-column output.
|
|
9359
9412
|
*/
|
|
9360
9413
|
'header:append'?: (props: BbTableHeaderAffixSlotProps<Item>) => any;
|
|
@@ -9365,10 +9418,11 @@ export type BbTableSlots<Item = any, V = any> = BbTableColumnSlots<Item, V> & {
|
|
|
9365
9418
|
loading?: (props: { items: Item[] }) => any;
|
|
9366
9419
|
/**
|
|
9367
9420
|
* Content shown when there are no rows and nothing is loading, inside the
|
|
9368
|
-
* table's own full-width cell: pass content, never a row.
|
|
9369
|
-
* the
|
|
9421
|
+
* table's own full-width cell: pass content, never a row. Empty only: a
|
|
9422
|
+
* failed load shows the table's failure row instead (its message is
|
|
9423
|
+
* `failed-text`, and it ends with "Try again").
|
|
9370
9424
|
*/
|
|
9371
|
-
empty?: (props:
|
|
9425
|
+
empty?: (props: object) => any;
|
|
9372
9426
|
/**
|
|
9373
9427
|
* Content of each row's actions cell; this slot CREATES the actions column
|
|
9374
9428
|
* (there is no prop). The header cell (labelled by `actions-text`, replaceable through
|
|
@@ -9450,11 +9504,13 @@ export type BbTableSlots<Item = any, V = any> = BbTableColumnSlots<Item, V> & {
|
|
|
9450
9504
|
}
|
|
9451
9505
|
|
|
9452
9506
|
.bb-table {
|
|
9453
|
-
/* The table's surface colour.
|
|
9454
|
-
|
|
9455
|
-
head band and
|
|
9456
|
-
Set it on the table (`.my-table { --bg: … }`)
|
|
9457
|
-
|
|
9507
|
+
/* The table's surface colour. A root table PAINTS it (below), so the
|
|
9508
|
+
whole table is one solid surface: pinned cells, the
|
|
9509
|
+
stuck head band and the rows between them always match, whatever the
|
|
9510
|
+
table sits on. Set it on the table (`.my-table { --bg: … }`) to blend
|
|
9511
|
+
into another surface. Rows and cells stay transparent so the row
|
|
9512
|
+
states and tones lay over it; a nested table re-declares its own and
|
|
9513
|
+
paints nothing (it sits on its parent's rows). */
|
|
9458
9514
|
--bg: var(--bb-panel);
|
|
9459
9515
|
/* The row hover's fill: the faint wash by default. Retint it or
|
|
9460
9516
|
switch it off here (`transparent`), never with a `hover:bg-*` on the
|
|
@@ -9462,6 +9518,16 @@ export type BbTableSlots<Item = any, V = any> = BbTableColumnSlots<Item, V> & {
|
|
|
9462
9518
|
one would let the scrolled cells show through it. This one knob reaches
|
|
9463
9519
|
the row and its pinned cells alike. */
|
|
9464
9520
|
--row-hover: var(--bb-surface-hover);
|
|
9521
|
+
/* A row's resting tone: set `--row-tone` on a row (`pt:row`, `row-class`)
|
|
9522
|
+
on an open row's expansion (`pt:expand`) or on a `#<key>:first` /
|
|
9523
|
+
`:last` row (`pt:firstRow` / `pt:lastRow`), never a `bg-*`. It paints
|
|
9524
|
+
as one translucent layer (`--row-tone-mix` of the colour) ABOVE every
|
|
9525
|
+
state fill, so hover and highlighted still show through it, and pinned
|
|
9526
|
+
cells and sticky rows lay the same layer over their opaque base.
|
|
9527
|
+
Re-declared on every table, so a table nested in a toned row starts
|
|
9528
|
+
untoned (the row's value would otherwise inherit into it). */
|
|
9529
|
+
--row-tone: initial;
|
|
9530
|
+
--row-tone-mix: 8%;
|
|
9465
9531
|
/* Plate frost. `--bb-surface-filter` is a full `backdrop-filter` VALUE and
|
|
9466
9532
|
defaults to `none` — the property's own initial value — so this pair is a
|
|
9467
9533
|
measured no-op until a theme sets the knob: no containing block for fixed
|
|
@@ -9881,6 +9947,8 @@ export type BbTableSlots<Item = any, V = any> = BbTableColumnSlots<Item, V> & {
|
|
|
9881
9947
|
from color-mix(in oklab, var(--row-bg, transparent) 99.9%, var(--bg)) r g
|
|
9882
9948
|
b / 1
|
|
9883
9949
|
);
|
|
9950
|
+
/* The row's tone layer, over the opaque base (`--row-tone`). */
|
|
9951
|
+
background-image: inherit;
|
|
9884
9952
|
/* Same curve and duration as the row's own tint transition, so a pinned
|
|
9885
9953
|
cell fades in step with its row instead of snapping ahead of it. */
|
|
9886
9954
|
transition: background-color var(--bb-transition-fast) var(--bb-ease);
|
|
@@ -10774,6 +10842,22 @@ export type BbTableSlots<Item = any, V = any> = BbTableColumnSlots<Item, V> & {
|
|
|
10774
10842
|
white-space: nowrap;
|
|
10775
10843
|
}
|
|
10776
10844
|
|
|
10845
|
+
/* The tone layer (see `--row-tone` on the root). An image, so it sits
|
|
10846
|
+
above the row's `background-color`: the library's states and an app's
|
|
10847
|
+
`bg-*` stay under it and keep showing. A pinned cell inherits the
|
|
10848
|
+
image over its own opaque base (below), so it shows the same
|
|
10849
|
+
composite, never the rows scrolled under it. */
|
|
10850
|
+
&__row,
|
|
10851
|
+
&__edge-row,
|
|
10852
|
+
&-expand__cell {
|
|
10853
|
+
--tone: color-mix(
|
|
10854
|
+
in oklab,
|
|
10855
|
+
var(--row-tone, transparent) var(--row-tone-mix),
|
|
10856
|
+
transparent
|
|
10857
|
+
);
|
|
10858
|
+
background-image: linear-gradient(var(--tone), var(--tone));
|
|
10859
|
+
}
|
|
10860
|
+
|
|
10777
10861
|
&__row {
|
|
10778
10862
|
/* Keep a row on one printed page. */
|
|
10779
10863
|
break-inside: avoid;
|
|
@@ -11153,6 +11237,16 @@ export type BbTableSlots<Item = any, V = any> = BbTableColumnSlots<Item, V> & {
|
|
|
11153
11237
|
}
|
|
11154
11238
|
}
|
|
11155
11239
|
|
|
11240
|
+
/* A root table paints its surface at rest: one solid
|
|
11241
|
+
table on any surface, so a pinned cell can never differ from its
|
|
11242
|
+
neighbours. A nested table paints nothing: it sits on its parent's rows
|
|
11243
|
+
and lets their hover, highlight and tone show. Under a glass theme `--bg`
|
|
11244
|
+
is the translucent panel, so the table reads as a frosted plate like a
|
|
11245
|
+
dialog. One class of specificity, like the `--bg` it paints. */
|
|
11246
|
+
.bb-table:where(:not(.bb-table .bb-table)) {
|
|
11247
|
+
background-color: var(--bg);
|
|
11248
|
+
}
|
|
11249
|
+
|
|
11156
11250
|
/* The nested-indent tokens, defaulted on ROOT tables only (zero specificity):
|
|
11157
11251
|
a consumer sets them on the root table (`.my-table { --indent: 24px;
|
|
11158
11252
|
--indent-at: select }`) and every nested table inherits them, while a
|
package/dist/ai/source/BbTag.md
CHANGED
|
@@ -409,7 +409,9 @@ const setInactive = () => {
|
|
|
409
409
|
const onWrapperFocusIn = () => {
|
|
410
410
|
if (active.value) return;
|
|
411
411
|
setActive();
|
|
412
|
-
|
|
412
|
+
// Capture: a dialog around the field stops `click` at
|
|
413
|
+
// its root, so a click elsewhere in it never bubbles here.
|
|
414
|
+
document.addEventListener('click', onOutsideInteraction, true);
|
|
413
415
|
document.addEventListener('focusin', onOutsideInteraction);
|
|
414
416
|
};
|
|
415
417
|
|
|
@@ -606,9 +608,14 @@ const onWrapperClick = (event: MouseEvent) => {
|
|
|
606
608
|
const onOutsideInteraction = async (event: Event) => {
|
|
607
609
|
if (event.target instanceof Node) {
|
|
608
610
|
if (wrapper.value) {
|
|
611
|
+
// a press on the field's own padding parks focus
|
|
612
|
+
// on the nearest focusable ancestor (the dialog around it): not the
|
|
613
|
+
// user going elsewhere. A CLICK on that ancestor still is.
|
|
614
|
+
if (event.type === 'focusin' && event.target.contains(wrapper.value.$el))
|
|
615
|
+
return;
|
|
609
616
|
if (!wrapper.value.$el.contains(event.target)) {
|
|
610
617
|
setInactive();
|
|
611
|
-
document.removeEventListener('click', onOutsideInteraction);
|
|
618
|
+
document.removeEventListener('click', onOutsideInteraction, true);
|
|
612
619
|
document.removeEventListener('focusin', onOutsideInteraction);
|
|
613
620
|
alignQueryToState();
|
|
614
621
|
return;
|
|
@@ -656,7 +663,7 @@ const leave = () => {
|
|
|
656
663
|
} else {
|
|
657
664
|
activity.value = 'idle';
|
|
658
665
|
}
|
|
659
|
-
document.removeEventListener('click', onOutsideInteraction);
|
|
666
|
+
document.removeEventListener('click', onOutsideInteraction, true);
|
|
660
667
|
document.removeEventListener('focusin', onOutsideInteraction);
|
|
661
668
|
};
|
|
662
669
|
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
},
|
|
23
23
|
anchorProps: { ref: setAnchorRef },
|
|
24
24
|
open: isOpen,
|
|
25
|
-
value:
|
|
25
|
+
value: ownModel,
|
|
26
26
|
text: activatorText,
|
|
27
27
|
disabled: !!disabled,
|
|
28
28
|
}"
|
|
@@ -146,6 +146,8 @@ import {
|
|
|
146
146
|
watch,
|
|
147
147
|
} from 'vue';
|
|
148
148
|
import { useId } from '@/composables/useId';
|
|
149
|
+
import { useOwnModel } from '@/composables/useOwnModel';
|
|
150
|
+
import { useOpenModel } from '@/composables/useOpenModel';
|
|
149
151
|
import { createReusableTemplate } from '@vueuse/core';
|
|
150
152
|
import {
|
|
151
153
|
extractDomContainer,
|
|
@@ -158,6 +160,7 @@ import { useMobile } from '@/composables/useMobile';
|
|
|
158
160
|
import { transitions } from '@/utilities/misc/transitions';
|
|
159
161
|
import CommonTimeSelector from '../CommonTimeSelector/CommonTimeSelector.vue';
|
|
160
162
|
import { spokenTimeOf } from '../BbCalendar/useDayjsLocale';
|
|
163
|
+
import { useHydrated } from '@/composables/useHydrated';
|
|
161
164
|
import type { TimeUnit } from '../CommonTimeSelector/types';
|
|
162
165
|
import BbOffCanvas from '../BbOffCanvas/BbOffCanvas.vue';
|
|
163
166
|
import { BB_OFF_CANVAS_PT } from '../BbOffCanvas/types';
|
|
@@ -213,6 +216,15 @@ const props = declaredProps as unknown as ShapeErasedProps<
|
|
|
213
216
|
>;
|
|
214
217
|
const emit = declaredEmit as unknown as BbTimePickerEvents;
|
|
215
218
|
|
|
219
|
+
type TimeModel = Exclude<BbTimePickerProps['modelValue'], undefined>;
|
|
220
|
+
// No `v-model`: the picker keeps its own value, like an input.
|
|
221
|
+
const { model: ownModel, set: setModel } = useOwnModel<'modelValue', TimeModel>(
|
|
222
|
+
props,
|
|
223
|
+
'modelValue',
|
|
224
|
+
(event, value) => emit(event, value),
|
|
225
|
+
() => (props.range ? [] : null)
|
|
226
|
+
);
|
|
227
|
+
|
|
216
228
|
/**
|
|
217
229
|
* Passthrough. `root` lands on the floating popover, where a consumer `class` lands too (no node on the phone sheet); `panel` on the surface you see (the popover's painted bubble, or the sheet itself on a phone); `item` lives in the shared time selector, which binds what it is given per entry.
|
|
218
230
|
*/
|
|
@@ -231,11 +243,19 @@ const config = useConfig();
|
|
|
231
243
|
* The value as the picker shows it, for a trigger's label:
|
|
232
244
|
* 12-hour with the locale's day period under `ampm` ("9:30 PM",
|
|
233
245
|
* "午後9:30"), else 24-hour; a range is `start – end`; empty is `''`.
|
|
246
|
+
* Before hydration, the model as written (`spokenTimeOf`).
|
|
234
247
|
*/
|
|
248
|
+
const { isHydrated } = useHydrated();
|
|
235
249
|
const activatorText = computed(() => {
|
|
236
250
|
const say = (value: string) =>
|
|
237
|
-
spokenTimeOf(
|
|
238
|
-
|
|
251
|
+
spokenTimeOf(
|
|
252
|
+
value,
|
|
253
|
+
config.locale,
|
|
254
|
+
!!props.ampm,
|
|
255
|
+
!!props.seconds,
|
|
256
|
+
isHydrated.value
|
|
257
|
+
);
|
|
258
|
+
const value = ownModel.value;
|
|
239
259
|
if (Array.isArray(value)) return value.filter(Boolean).map(say).join(' – ');
|
|
240
260
|
return value ? say(value) : '';
|
|
241
261
|
});
|
|
@@ -360,11 +380,31 @@ const onActivatorClick = (event: MouseEvent) => {
|
|
|
360
380
|
isOpen.value = !isOpen.value;
|
|
361
381
|
};
|
|
362
382
|
|
|
363
|
-
|
|
383
|
+
// `v-model:open`: the activator's own open, the same close.
|
|
384
|
+
useOpenModel(props, emit, {
|
|
385
|
+
isOpen: () => isOpen.value,
|
|
386
|
+
open: () => {
|
|
387
|
+
if (props.disabled || props.readonly) return;
|
|
388
|
+
surface.value = resolveSurface();
|
|
389
|
+
isOpen.value = true;
|
|
390
|
+
},
|
|
391
|
+
close: () => (isOpen.value = false),
|
|
392
|
+
});
|
|
393
|
+
|
|
394
|
+
/**
|
|
395
|
+
* a click outside the panel closes it. The panel is a modal
|
|
396
|
+
* `<dialog>` whose transparent backdrop the browser does not hit-test, so the
|
|
397
|
+
* click lands on the page, not on the dialog; heard in the capture phase, as
|
|
398
|
+
* a dialog around the picker stops `click` at its root. The activator's own
|
|
399
|
+
* click toggles it itself. Closing hands focus back to the activator.
|
|
400
|
+
*/
|
|
364
401
|
const onClickDocument = (event: Event) => {
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
402
|
+
const target = event.target;
|
|
403
|
+
if (!(target instanceof Node)) return;
|
|
404
|
+
const panel = document.getElementById(panelId)?.closest('.bb-common-popover');
|
|
405
|
+
if (panel?.contains(target)) return;
|
|
406
|
+
if (activatorEl.value?.contains(target)) return;
|
|
407
|
+
isOpen.value = false;
|
|
368
408
|
};
|
|
369
409
|
|
|
370
410
|
watch(isOpen, async (val) => {
|
|
@@ -375,7 +415,10 @@ watch(isOpen, async (val) => {
|
|
|
375
415
|
: null;
|
|
376
416
|
// The floating <dialog> is modal; the sheet manages its own backdrop.
|
|
377
417
|
if (!useOffcanvas.value) {
|
|
378
|
-
document.addEventListener('click', onClickDocument, {
|
|
418
|
+
document.addEventListener('click', onClickDocument, {
|
|
419
|
+
passive: true,
|
|
420
|
+
capture: true,
|
|
421
|
+
});
|
|
379
422
|
}
|
|
380
423
|
await nextTick();
|
|
381
424
|
firstFocusableMatch(
|
|
@@ -383,7 +426,9 @@ watch(isOpen, async (val) => {
|
|
|
383
426
|
'[tabindex="0"]'
|
|
384
427
|
)?.focus();
|
|
385
428
|
} else {
|
|
386
|
-
document.removeEventListener('click', onClickDocument
|
|
429
|
+
document.removeEventListener('click', onClickDocument, {
|
|
430
|
+
capture: true,
|
|
431
|
+
});
|
|
387
432
|
previousFocus?.focus();
|
|
388
433
|
previousFocus = null;
|
|
389
434
|
}
|
|
@@ -460,7 +505,9 @@ watch(
|
|
|
460
505
|
|
|
461
506
|
onBeforeUnmount(() => {
|
|
462
507
|
cleanupActivator?.();
|
|
463
|
-
document.removeEventListener('click', onClickDocument
|
|
508
|
+
document.removeEventListener('click', onClickDocument, {
|
|
509
|
+
capture: true,
|
|
510
|
+
});
|
|
464
511
|
});
|
|
465
512
|
|
|
466
513
|
// ---- Adaptive surface (popover on desktop, bottom sheet on mobile) --------------
|
|
@@ -520,7 +567,7 @@ const segIndex = (segment: BbTimePickerSegment) => (segment === 'end' ? 1 : 0);
|
|
|
520
567
|
|
|
521
568
|
/** The raw `HH:mm[:ss]` string carried in `modelValue` for a segment. */
|
|
522
569
|
const timeStringFor = (segment: BbTimePickerSegment): string | null => {
|
|
523
|
-
const mv =
|
|
570
|
+
const mv = ownModel.value;
|
|
524
571
|
if (mv == null) return null;
|
|
525
572
|
if (Array.isArray(mv)) return mv[segIndex(segment)] ?? null;
|
|
526
573
|
return segment === 'start' && typeof mv === 'string' ? mv : null;
|
|
@@ -597,7 +644,7 @@ const onTimePick = (payload: { unit: TimeUnit; value: string }) => {
|
|
|
597
644
|
}
|
|
598
645
|
|
|
599
646
|
if (!props.range) {
|
|
600
|
-
|
|
647
|
+
setModel(clamped);
|
|
601
648
|
return;
|
|
602
649
|
}
|
|
603
650
|
|
|
@@ -609,7 +656,7 @@ const onTimePick = (payload: { unit: TimeUnit; value: string }) => {
|
|
|
609
656
|
if (startStr) out.push(startStr);
|
|
610
657
|
if (endStr) out.push(endStr);
|
|
611
658
|
// A range is always an array, `[]` included.
|
|
612
|
-
|
|
659
|
+
setModel(out);
|
|
613
660
|
};
|
|
614
661
|
|
|
615
662
|
// Deactivated by KeepAlive while open counts as closing: the surface leaves the
|
|
@@ -734,6 +781,11 @@ type BbTimePickerPtProps = /* @vue-ignore */ PtCompoundProps<
|
|
|
734
781
|
// does not substitute a generic alias's type parameters — PASSTHROUGH.md T20).
|
|
735
782
|
|
|
736
783
|
export type BbTimePickerBaseProps = BbTimePickerPtProps & {
|
|
784
|
+
/**
|
|
785
|
+
* Whether the panel is open (`v-model:open`; `v-model` stays the value).
|
|
786
|
+
* Bound, the app opens and closes it; unbound, the initial state.
|
|
787
|
+
*/
|
|
788
|
+
open?: boolean;
|
|
737
789
|
/**
|
|
738
790
|
* Passthrough, object form: the same keys as the `pt:*` attributes
|
|
739
791
|
* without the prefix. See the `pt:<part>` row.
|
|
@@ -756,7 +808,7 @@ export type BbTimePickerBaseProps = BbTimePickerPtProps & {
|
|
|
756
808
|
* v-model value: `null` for empty, a 24-hour `HH:mm` (or `HH:mm:ss` with
|
|
757
809
|
* `seconds`) string, or a two-element `[start, end]` array when `range` is true.
|
|
758
810
|
*/
|
|
759
|
-
modelValue
|
|
811
|
+
modelValue?: string | string[] | null;
|
|
760
812
|
/**
|
|
761
813
|
* Which end the columns edit in range mode (`v-model:active-segment`).
|
|
762
814
|
* Standalone use manages this internally via the in-panel toggle; a host can
|
|
@@ -843,7 +895,7 @@ export type BbTimePickerBaseProps = BbTimePickerPtProps & {
|
|
|
843
895
|
*/
|
|
844
896
|
export type BbTimePickerModelProps<R extends boolean = boolean> = {
|
|
845
897
|
range?: R;
|
|
846
|
-
modelValue
|
|
898
|
+
modelValue?: PtNoInfer<BbTimeModel<R>>;
|
|
847
899
|
};
|
|
848
900
|
|
|
849
901
|
export type BbTimePickerProps<R extends boolean = boolean> =
|
|
@@ -856,6 +908,8 @@ export type BbTimePickerEvents<R extends boolean = boolean> = {
|
|
|
856
908
|
(e: 'shown'): void;
|
|
857
909
|
/** Emitted as soon as the time panel starts to close. */
|
|
858
910
|
(e: 'hide'): void;
|
|
911
|
+
/** The panel opened or closed (`v-model:open`). */
|
|
912
|
+
(e: 'update:open', value: boolean): void;
|
|
859
913
|
/** Emitted once the time panel has finished closing. */
|
|
860
914
|
(e: 'hidden'): void;
|
|
861
915
|
/** Emitted when the selected time changes (single/range/null). */
|