bitboss-ui 3.0.0-beta.2 → 3.0.0-beta.21
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 +72 -33
- package/dist/ai/BbAccordion.md +3 -3
- package/dist/ai/BbAlert.md +9 -5
- package/dist/ai/BbAsterisk.md +17 -0
- package/dist/ai/BbAvatar.md +12 -3
- package/dist/ai/BbBadge.md +15 -10
- package/dist/ai/BbBadgeButton.md +16 -16
- package/dist/ai/BbBaseButton.md +16 -16
- package/dist/ai/BbBaseCheckbox.md +8 -8
- package/dist/ai/BbBaseCheckboxGroup.md +13 -13
- package/dist/ai/BbBaseCheckboxIcon.md +26 -9
- package/dist/ai/BbBaseColorInput.md +11 -11
- package/dist/ai/BbBaseDatePicker.md +6 -6
- package/dist/ai/BbBaseDatePickerInput.md +15 -15
- package/dist/ai/BbBaseInputContainer.md +12 -12
- package/dist/ai/BbBaseNumberInput.md +8 -8
- package/dist/ai/BbBaseRadio.md +5 -5
- package/dist/ai/BbBaseRadioGroup.md +7 -7
- package/dist/ai/BbBaseRadioIcon.md +25 -9
- package/dist/ai/BbBaseRating.md +5 -5
- package/dist/ai/BbBaseSelect.md +22 -21
- package/dist/ai/BbBaseSlider.md +9 -9
- package/dist/ai/BbBaseSwitch.md +8 -8
- package/dist/ai/BbBaseSwitchGroup.md +13 -13
- package/dist/ai/BbBaseSwitchIcon.md +28 -10
- package/dist/ai/BbBaseTag.md +10 -10
- package/dist/ai/BbBaseTextInput.md +9 -9
- package/dist/ai/BbBaseTextarea.md +9 -9
- package/dist/ai/BbBaseTimePickerInput.md +13 -13
- package/dist/ai/BbBreadcrumbs.md +2 -2
- package/dist/ai/BbButton.md +15 -15
- package/dist/ai/BbCheckbox.md +18 -17
- package/dist/ai/BbCheckboxGroup.md +15 -14
- package/dist/ai/BbCollapsible.md +11 -9
- package/dist/ai/BbColorInput.md +15 -15
- package/dist/ai/BbColorPalette.md +12 -6
- package/dist/ai/BbConfirm.md +12 -5
- package/dist/ai/BbDatePicker.md +13 -13
- package/dist/ai/BbDatePickerInput.md +20 -20
- package/dist/ai/BbDialog.md +78 -12
- package/dist/ai/BbDropdown.md +132 -22
- package/dist/ai/BbDropdownButton.md +12 -12
- package/dist/ai/BbDropdownGroup.md +1 -1
- package/dist/ai/BbDropzone.md +4 -4
- package/dist/ai/BbForm.md +49 -14
- package/dist/ai/BbIcon.md +6 -0
- package/dist/ai/BbIndicator.md +5 -5
- package/dist/ai/BbNumberInput.md +11 -11
- package/dist/ai/BbOffCanvas.md +90 -20
- package/dist/ai/BbPagination.md +3 -3
- package/dist/ai/BbPopover.md +32 -17
- package/dist/ai/BbProgress.md +7 -4
- package/dist/ai/BbRadio.md +16 -15
- package/dist/ai/BbRadioGroup.md +20 -17
- package/dist/ai/BbRating.md +11 -11
- package/dist/ai/BbSelect.md +138 -37
- package/dist/ai/BbSelectPopover.md +40 -41
- package/dist/ai/BbSlider.md +37 -22
- package/dist/ai/BbSmoothHeight.md +1 -1
- package/dist/ai/BbSwitch.md +25 -10
- package/dist/ai/BbSwitchGroup.md +17 -14
- package/dist/ai/BbTable.md +920 -109
- package/dist/ai/BbTabs.md +28 -14
- package/dist/ai/BbTabsList.md +1 -1
- package/dist/ai/BbTabsPanes.md +1 -1
- package/dist/ai/BbTabsRoot.md +10 -10
- package/dist/ai/BbTag.md +14 -14
- package/dist/ai/BbTextInput.md +16 -15
- package/dist/ai/BbTextarea.md +13 -13
- package/dist/ai/BbTimePicker.md +10 -10
- package/dist/ai/BbTimePickerInput.md +17 -17
- package/dist/ai/BbToast.md +1 -1
- package/dist/ai/BbToastPortal.md +1 -1
- package/dist/ai/BbTooltip.md +12 -10
- package/dist/ai/BbTree.md +1 -1
- package/dist/ai/ChipsBox.md +1 -1
- package/dist/ai/CommonInputWrapper.md +10 -10
- package/dist/ai/CommonPopover.md +6 -6
- package/dist/ai/FlatListBox.md +5 -5
- package/dist/ai/GroupedListBox.md +5 -5
- package/dist/ai/ListBox.md +4 -4
- package/dist/ai/OptionsContainer.md +4 -4
- package/dist/ai/changelog.json +128 -2
- package/dist/ai/components.json +917 -100
- package/dist/ai/composables/useBbConfig.md +72 -11
- package/dist/ai/composables/useConfirm.md +5 -3
- package/dist/ai/guides/ai-router.md +9 -4
- package/dist/ai/guides/component-picker.md +18 -18
- package/dist/ai/guides/design-language.md +14 -14
- package/dist/ai/guides/design-tokens.md +25 -18
- package/dist/ai/guides/fetch-items-playbook.md +1 -1
- package/dist/ai/guides/icons-policy.md +11 -5
- package/dist/ai/guides/installation-and-plugin-setup.md +85 -23
- package/dist/ai/guides/migration/components/bb-checkbox-group.md +30 -0
- package/dist/ai/guides/migration/components/bb-checkbox.md +37 -3
- package/dist/ai/guides/migration/components/bb-collapsible.md +5 -5
- package/dist/ai/guides/migration/components/bb-dialog.md +62 -34
- package/dist/ai/guides/migration/components/bb-offcanvas.md +29 -13
- package/dist/ai/guides/migration/components/bb-rating.md +8 -2
- package/dist/ai/guides/migration/components/bb-select.md +5 -2
- package/dist/ai/guides/migration/components/bb-table.md +560 -28
- package/dist/ai/guides/migration/components/bb-text-input.md +6 -6
- package/dist/ai/guides/migration/v2-to-v3.md +260 -89
- package/dist/ai/guides/ssr-prefill.md +120 -0
- package/dist/ai/index.md +10 -9
- package/dist/ai/recipes/inertia/approvals-inbox.md +0 -1
- package/dist/ai/recipes/inertia/inline-edit-workspace.md +0 -1
- package/dist/ai/recipes/inertia/layout-scaffold.md +5 -1
- package/dist/ai/recipes/inertia/ownership-atlas.md +49 -29
- package/dist/ai/recipes/inertia/record-form.md +0 -1
- package/dist/ai/recipes/inertia/records-workspace.md +26 -8
- package/dist/ai/recipes/inertia/upload-center.md +0 -1
- package/dist/ai/recipes/nuxt/approvals-inbox.md +0 -1
- package/dist/ai/recipes/nuxt/inline-edit-workspace.md +0 -1
- package/dist/ai/recipes/nuxt/layout-scaffold.md +5 -1
- package/dist/ai/recipes/nuxt/record-form.md +0 -1
- package/dist/ai/recipes/nuxt/records-workspace.md +26 -8
- package/dist/ai/recipes/nuxt/upload-center.md +0 -1
- package/dist/ai/recipes/vue/approvals-inbox.md +0 -1
- package/dist/ai/recipes/vue/inline-edit-workspace.md +0 -1
- package/dist/ai/recipes/vue/layout-scaffold.md +5 -1
- package/dist/ai/recipes/vue/records-workspace.md +26 -8
- package/dist/ai/recipes/vue/upload-center.md +0 -1
- package/dist/ai/source/BbAlert.md +60 -2
- package/dist/ai/source/BbAvatar.md +3 -3
- package/dist/ai/source/BbBadge.md +60 -15
- package/dist/ai/source/BbBadgeButton.md +8 -2
- package/dist/ai/source/BbBaseButton.md +3 -1
- package/dist/ai/source/BbBaseCheckboxGroup.md +6 -2
- package/dist/ai/source/BbBaseDatePicker.md +3 -1
- package/dist/ai/source/BbBaseDatePickerInput.md +5 -1
- package/dist/ai/source/BbBaseInputContainer.md +52 -1
- package/dist/ai/source/BbBaseRadioGroup.md +4 -0
- package/dist/ai/source/BbBaseRating.md +3 -1
- package/dist/ai/source/BbBaseSelect.md +71 -16
- package/dist/ai/source/BbBaseSwitchGroup.md +4 -0
- package/dist/ai/source/BbBaseTimePickerInput.md +5 -1
- package/dist/ai/source/BbBreadcrumbs.md +31 -0
- package/dist/ai/source/BbButton.md +51 -24
- package/dist/ai/source/BbCheckbox.md +15 -1
- package/dist/ai/source/BbCheckboxGroup.md +2 -1
- package/dist/ai/source/BbCollapsible.md +7 -1
- package/dist/ai/source/BbColorInput.md +3 -4
- package/dist/ai/source/BbColorPalette.md +3 -4
- package/dist/ai/source/BbDatePicker.md +5 -1
- package/dist/ai/source/BbDatePickerInput.md +5 -1
- package/dist/ai/source/BbDialog.md +175 -19
- package/dist/ai/source/BbDropdown.md +376 -69
- package/dist/ai/source/BbDropdownGroup.md +330 -59
- package/dist/ai/source/BbForm.md +93 -5
- package/dist/ai/source/BbIcon.md +46 -36
- package/dist/ai/source/BbNumberInput.md +3 -4
- package/dist/ai/source/BbOffCanvas.md +474 -194
- package/dist/ai/source/BbPopover.md +24 -17
- package/dist/ai/source/BbProgress.md +2 -2
- package/dist/ai/source/BbRadio.md +15 -1
- package/dist/ai/source/BbRadioGroup.md +3 -1
- package/dist/ai/source/BbSelect.md +50 -2
- package/dist/ai/source/BbSelectPopover.md +171 -23
- package/dist/ai/source/BbSlider.md +3 -4
- package/dist/ai/source/BbSwitch.md +15 -1
- package/dist/ai/source/BbSwitchGroup.md +8 -5
- package/dist/ai/source/BbTable.md +5092 -1446
- package/dist/ai/source/BbTabs.md +6 -7
- package/dist/ai/source/BbTabsList.md +6 -7
- package/dist/ai/source/BbTabsPanes.md +6 -7
- package/dist/ai/source/BbTabsRoot.md +6 -7
- package/dist/ai/source/BbTag.md +3 -4
- package/dist/ai/source/BbTextInput.md +3 -4
- package/dist/ai/source/BbTextarea.md +3 -4
- package/dist/ai/source/BbTimePicker.md +4 -1
- package/dist/ai/source/BbTimePickerInput.md +5 -1
- package/dist/ai/source/BbToast.md +3 -1
- package/dist/ai/source/BbTooltip.md +5 -1
- package/dist/ai/source/CommonInputWrapper.md +4 -0
- package/dist/ai/source/CommonPopover.md +6 -0
- package/dist/ai/source/FlatListBox.md +11 -5
- package/dist/ai/source/GroupedListBox.md +7 -5
- package/dist/components/BbAlert/BbAlert.vue_vue_type_script_setup_true_lang.js +4 -4
- package/dist/components/BbAlert/types.d.ts +10 -1
- package/dist/components/BbAvatar/BbAvatar.vue.d.ts +1 -1
- package/dist/components/BbAvatar/BbAvatar.vue_vue_type_script_setup_true_lang.js +33 -33
- package/dist/components/BbBadge/BadgeBodyContent.vue_vue_type_script_setup_true_lang.js +22 -16
- package/dist/components/BbBadge/BbBadge.vue_vue_type_script_setup_true_lang.js +36 -15
- package/dist/components/BbBadge/badgeButtonContext.d.ts +21 -8
- package/dist/components/BbBadge/types.d.ts +8 -2
- package/dist/components/BbBaseButton/BbBaseButton.vue_vue_type_script_setup_true_lang.js +47 -47
- package/dist/components/BbBaseButton/RouterComponent.vue_vue_type_script_setup_true_lang.js +14 -14
- package/dist/components/BbBaseCheckboxGroup/BbBaseCheckboxGroup.vue_vue_type_script_setup_true_lang.js +30 -28
- package/dist/components/BbBaseCheckboxGroup/types.d.ts +2 -2
- package/dist/components/BbBaseDatePicker/BbBaseDatePicker.vue_vue_type_script_setup_true_lang.js +167 -167
- package/dist/components/BbBaseDatePicker/BbBaseDatePickerInputDaySelector.vue.d.ts +9 -9
- package/dist/components/BbBaseDatePicker/BbBaseDatePickerInputDaySelector.vue_vue_type_script_setup_true_lang.js +78 -78
- package/dist/components/BbBaseDatePicker/BbBaseDatePickerMonthSelector.vue_vue_type_script_setup_true_lang.js +64 -64
- package/dist/components/BbBaseDatePickerInput/BbBaseDatePickerInput.vue.d.ts +1 -1
- package/dist/components/BbBaseDatePickerInput/BbBaseDatePickerInput.vue_vue_type_script_setup_true_lang.js +138 -138
- package/dist/components/BbBaseInputContainer/BbBaseInputContainer.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/components/BbBaseRadioGroup/BbBaseRadioGroup.vue_vue_type_script_setup_true_lang.js +24 -22
- package/dist/components/BbBaseRating/BbBaseRating.vue_vue_type_script_setup_true_lang.js +40 -40
- package/dist/components/BbBaseSelect/BbBaseSelect.vue_vue_type_script_setup_true_lang.js +74 -65
- package/dist/components/BbBaseSelect/types.d.ts +22 -0
- package/dist/components/BbBaseSlider/BbBaseSlider.vue_vue_type_script_setup_true_lang.js +5 -5
- package/dist/components/BbBaseSwitchGroup/BbBaseSwitchGroup.vue_vue_type_script_setup_true_lang.js +30 -28
- package/dist/components/BbBaseTimePickerInput/BbBaseTimePickerInput.vue.d.ts +1 -1
- package/dist/components/BbBaseTimePickerInput/BbBaseTimePickerInput.vue_vue_type_script_setup_true_lang.js +104 -104
- package/dist/components/BbBreadcrumbs/BbBreadcrumbs.vue_vue_type_script_setup_true_lang.js +35 -35
- package/dist/components/BbButton/BbButton.vue_vue_type_script_setup_true_lang.js +85 -81
- package/dist/components/BbCheckboxGroup/types.d.ts +2 -1
- package/dist/components/BbCollapsible/types.d.ts +7 -1
- package/dist/components/BbColorInput/BbColorInput.vue.d.ts +1 -1
- package/dist/components/BbColorInput/BbColorInput.vue_vue_type_script_setup_true_lang.js +18 -18
- package/dist/components/BbColorPalette/BbColorPalette.vue.d.ts +2 -2
- package/dist/components/BbColorPalette/BbColorPalette.vue_vue_type_script_setup_true_lang.js +50 -50
- package/dist/components/BbConfirm/BbConfirm.vue_vue_type_script_setup_true_lang.js +17 -17
- package/dist/components/BbDatePicker/BbDatePicker.vue.d.ts +1 -1
- package/dist/components/BbDatePicker/BbDatePicker.vue_vue_type_script_setup_true_lang.js +100 -100
- package/dist/components/BbDatePickerInput/BbDatePickerInput.vue_vue_type_script_setup_true_lang.js +21 -21
- package/dist/components/BbDialog/BbDialog.vue.d.ts +1 -1
- package/dist/components/BbDialog/BbDialog.vue_vue_type_script_setup_true_lang.js +133 -107
- package/dist/components/BbDialog/types.d.ts +29 -2
- package/dist/components/BbDropdown/AdaptiveDropdown.vue.d.ts +2 -0
- package/dist/components/BbDropdown/AdaptiveDropdown.vue_vue_type_script_setup_true_lang.js +99 -100
- package/dist/components/BbDropdown/BbDropdown.vue.d.ts +2 -2
- package/dist/components/BbDropdown/BbDropdown.vue_vue_type_script_setup_true_lang.js +208 -201
- package/dist/components/BbDropdown/BbDropdownList.vue_vue_type_script_setup_true_lang.js +225 -208
- package/dist/components/BbDropdown/DropdownPipelineResolver.vue_vue_type_script_setup_true_lang.js +21 -21
- package/dist/components/BbDropdown/types.d.ts +20 -5
- package/dist/components/BbDropdownButton/BbDropdownButton.vue_vue_type_script_setup_true_lang.js +5 -5
- package/dist/components/BbIcon/BbIcon.vue_vue_type_script_setup_true_lang.js +46 -46
- package/dist/components/BbIcon/iconCache.d.ts +33 -0
- package/dist/components/BbIcon/iconCache.js +17 -0
- package/dist/components/BbNumberInput/BbNumberInput.vue.d.ts +1 -1
- package/dist/components/BbNumberInput/BbNumberInput.vue_vue_type_script_setup_true_lang.js +15 -15
- package/dist/components/BbOffCanvas/BbOffCanvas.vue.d.ts +1 -1
- package/dist/components/BbOffCanvas/BbOffCanvas.vue_vue_type_script_setup_true_lang.js +254 -208
- package/dist/components/BbOffCanvas/types.d.ts +30 -5
- package/dist/components/BbPagination/BbPagination.vue.d.ts +1 -1
- package/dist/components/BbPopover/BbPopover.vue.d.ts +2 -2
- package/dist/components/BbPopover/BbPopover.vue_vue_type_script_setup_true_lang.js +149 -146
- package/dist/components/BbPopover/types.d.ts +3 -2
- package/dist/components/BbRadioGroup/types.d.ts +3 -1
- package/dist/components/BbSelect/BbSelect.vue_vue_type_script_setup_true_lang.js +27 -23
- package/dist/components/BbSelect/types.d.ts +32 -0
- package/dist/components/BbSelectPopover/BbSelectPopover.vue_vue_type_script_setup_true_lang.js +221 -213
- package/dist/components/BbSlider/BbSlider.vue.d.ts +1 -1
- package/dist/components/BbSlider/BbSlider.vue_vue_type_script_setup_true_lang.js +20 -20
- package/dist/components/BbTable/BbTable.vue.d.ts +10 -4
- package/dist/components/BbTable/BbTable.vue_vue_type_script_setup_true_lang.js +1433 -600
- package/dist/components/BbTable/BbTableDataRow.d.ts +162 -0
- package/dist/components/BbTable/BbTableDataRow.js +136 -0
- package/dist/components/BbTable/BbTableExpandRow.d.ts +73 -0
- package/dist/components/BbTable/BbTableExpandRow.js +52 -0
- package/dist/components/BbTable/types.d.ts +324 -111
- package/dist/components/BbTable/utils.d.ts +92 -4
- package/dist/components/BbTable/utils.js +71 -36
- package/dist/components/BbTabs/types.d.ts +0 -8
- package/dist/components/BbTag/BbTag.vue.d.ts +1 -1
- package/dist/components/BbTag/BbTag.vue_vue_type_script_setup_true_lang.js +18 -18
- package/dist/components/BbTextInput/BbTextInput.vue.d.ts +1 -1
- package/dist/components/BbTextInput/BbTextInput.vue_vue_type_script_setup_true_lang.js +18 -18
- package/dist/components/BbTextarea/BbTextarea.vue.d.ts +1 -1
- package/dist/components/BbTextarea/BbTextarea.vue_vue_type_script_setup_true_lang.js +54 -54
- package/dist/components/BbTimePicker/BbTimePicker.vue.d.ts +1 -1
- package/dist/components/BbTimePicker/BbTimePicker.vue_vue_type_script_setup_true_lang.js +80 -80
- package/dist/components/BbTimePickerInput/BbTimePickerInput.vue_vue_type_script_setup_true_lang.js +61 -61
- package/dist/components/BbToast/BbToast.vue_vue_type_script_setup_true_lang.js +17 -17
- package/dist/components/BbToast/BbToastMessage.vue_vue_type_script_setup_true_lang.js +13 -13
- package/dist/components/BbTooltip/types.d.ts +5 -1
- package/dist/components/ChipsBox/ChipsBox.vue_vue_type_script_setup_true_lang.js +17 -17
- package/dist/components/ClearableButton/ClearableButton.vue_vue_type_script_setup_true_lang.js +5 -5
- package/dist/components/CommonPopover/CommonPopover.vue_vue_type_script_setup_true_lang.js +2 -1
- package/dist/components/FlatListBox/FlatListBox.vue_vue_type_script_setup_true_lang.js +83 -83
- package/dist/components/GroupedListBox/GroupedListBox.vue_vue_type_script_setup_true_lang.js +56 -56
- package/dist/composables/useBaseOptions.js +30 -20
- package/dist/composables/useBbConfig.d.ts +27 -6
- package/dist/composables/useBbConfig.js +8 -2
- package/dist/composables/useConfig.d.ts +59 -0
- package/dist/composables/useConfig.js +9 -0
- package/dist/composables/useItemsGetter.d.ts +11 -0
- package/dist/composables/useItemsGetter.js +44 -18
- package/dist/composables/useLocale.js +10 -7
- package/dist/composables/useMobile.js +5 -5
- package/dist/composables/usePrefill.d.ts +21 -2
- package/dist/composables/usePrefill.js +25 -19
- package/dist/composables/useSsrState.d.ts +20 -0
- package/dist/composables/useSsrState.js +13 -0
- package/dist/composables/useTableWidthContext.d.ts +24 -4
- package/dist/composables/useTableWidthContext.js +31 -28
- package/dist/composables/useToast.js +5 -5
- package/dist/deprecation/ai-deprecations.json.d.ts +121 -11
- package/dist/deprecation/ai-deprecations.json.js +1 -1
- package/dist/directives/bbDropdown.d.ts +15 -4
- package/dist/directives/bbDropdown.js +31 -9
- package/dist/directives/createPopoverDirective.d.ts +62 -0
- package/dist/directives/createPopoverDirective.js +63 -23
- package/dist/i18n/locales/cs.json +4 -1
- package/dist/i18n/locales/da.json +4 -1
- package/dist/i18n/locales/de.json +4 -1
- package/dist/i18n/locales/el.json +4 -1
- package/dist/i18n/locales/en.json +4 -1
- package/dist/i18n/locales/es.json +4 -1
- package/dist/i18n/locales/fi.json +4 -1
- package/dist/i18n/locales/fr.json +4 -1
- package/dist/i18n/locales/hu.json +4 -1
- package/dist/i18n/locales/it.json +4 -1
- package/dist/i18n/locales/ja.json +4 -1
- package/dist/i18n/locales/ko.json +4 -1
- package/dist/i18n/locales/nb.json +4 -1
- package/dist/i18n/locales/nl.json +4 -1
- package/dist/i18n/locales/pl.json +4 -1
- package/dist/i18n/locales/pt.json +4 -1
- package/dist/i18n/locales/ro.json +4 -1
- package/dist/i18n/locales/ru.json +4 -1
- package/dist/i18n/locales/sv.json +4 -1
- package/dist/i18n/locales/tr.json +4 -1
- package/dist/i18n/locales/uk.json +4 -1
- package/dist/i18n/locales/zh-cn.json +4 -1
- package/dist/index.d.ts +7 -2
- package/dist/index.js +69 -67
- package/dist/llms-full.txt +3997 -1458
- package/dist/llms-medium.txt +140 -73
- package/dist/llms.txt +7 -6
- package/dist/locale-blueprint.json +4 -1
- package/dist/nuxt-auto-imports.d.ts +100 -0
- package/dist/nuxt-auto-imports.js +55 -0
- package/dist/nuxt-module.d.ts +22 -1
- package/dist/nuxt.js +22 -8
- package/dist/plugin.d.ts +10 -1
- package/dist/plugin.js +20 -19
- package/dist/runtime/nuxt-plugin.js +28 -21
- package/dist/styles.css +1 -1
- package/dist/utilities/misc/listboxMetrics.d.ts +3 -3
- package/dist/utilities/misc/listboxMetrics.js +2 -2
- package/dist/utilities/misc/ssrStateInjectionKey.d.ts +42 -0
- package/dist/utilities/misc/ssrStateInjectionKey.js +4 -0
- package/dist/validated/BbForm.vue_vue_type_script_setup_true_lang.js +45 -27
- package/dist/validated/BbSelect.vue.d.ts +2 -0
- package/dist/validated/BbSelect.vue_vue_type_script_setup_true_lang.js +1 -0
- package/dist/validated/useValidatedField.js +25 -23
- package/dist/vite.js +7 -3
- package/llms.txt +8 -7
- package/package.json +2 -2
- package/scripts/lib/eslint-plugin.d.ts +19 -1
- package/scripts/lib/eslint-plugin.mjs +155 -14
- package/scripts/lib/html-attributes.mjs +91 -0
- package/scripts/lib/validate-bb-markup.mjs +59 -11
- package/dist/assets/svgs/sort.svg_raw.js +0 -4
- package/dist/components/BbBadge/BadgeAppendIcon.vue.d.ts +0 -3
- package/dist/components/BbBadge/BadgeAppendIcon.vue.js +0 -5
- package/dist/components/BbBadge/BadgeAppendIcon.vue_vue_type_script_setup_true_lang.js +0 -22
|
@@ -25,6 +25,13 @@ export type ItemKey<Item = any> = NestedPaths<Item> | (string & {});
|
|
|
25
25
|
* inferred per column, so the conditional has literal types to distribute over.
|
|
26
26
|
*/
|
|
27
27
|
export type ReservedColumnKey = 'actions' | 'select';
|
|
28
|
+
/**
|
|
29
|
+
* Suffixes of the header affix slots (`header:prepend` / `header:append` and
|
|
30
|
+
* their per-column `header:<key>:prepend/append` variants). A column key that
|
|
31
|
+
* normalizes to one of these shadows the table-wide slot name; the table-wide
|
|
32
|
+
* interpretation wins and dev builds warn.
|
|
33
|
+
*/
|
|
34
|
+
export type HeaderAffixSuffix = 'prepend' | 'append';
|
|
28
35
|
/**
|
|
29
36
|
* Skeleton placeholder style for the loading state.
|
|
30
37
|
* Matches the expected content type for a better loading experience.
|
|
@@ -80,52 +87,89 @@ export type BbTableColumn<Item = any> = BaseColumn<Item> & {
|
|
|
80
87
|
*/
|
|
81
88
|
sorted?: 'asc' | 'desc';
|
|
82
89
|
/**
|
|
83
|
-
* Classes this column contributes to the whole row
|
|
90
|
+
* Classes this column contributes to the whole row element. Every column's
|
|
84
91
|
* `rowClass` is accumulated with the table-level `rowClass` prop and applied
|
|
85
92
|
* together. Can also be a function of the cell's content for dynamic values.
|
|
86
93
|
*/
|
|
87
94
|
rowClass?: ColumnClasses<Item>;
|
|
88
95
|
/**
|
|
89
|
-
* Defines the classes to be passed to
|
|
96
|
+
* Defines the classes to be passed to this column's data cells. Can also be a function for dynamic values.
|
|
90
97
|
*/
|
|
91
98
|
tdClass?: ColumnClasses<Item>;
|
|
92
99
|
/**
|
|
93
|
-
* Defines the classes to be passed to
|
|
100
|
+
* Defines the classes to be passed to this column's header cell.
|
|
94
101
|
*/
|
|
95
102
|
thClass?: Classes;
|
|
103
|
+
/**
|
|
104
|
+
* Hides the column: it renders no header and no cells and contributes no
|
|
105
|
+
* grid track, but stays DECLARED — its key keeps its slot in `order`, the
|
|
106
|
+
* header reorder writes the model back complete around it, and it comes
|
|
107
|
+
* back exactly where it was when the flag clears. This is how a column
|
|
108
|
+
* panel or a narrow-screen breakpoint hides a column; filtering `columns`
|
|
109
|
+
* is for a column that does not exist at all (a field this user does not
|
|
110
|
+
* have). Like `width`, the definition is the single declared truth: a
|
|
111
|
+
* header's `hideColumn()` sets a per-mount override that `hide:column` reports
|
|
112
|
+
* and that clears the moment this flag changes to anything but `true`
|
|
113
|
+
* (write the reported key back as `hidden: true` to persist it).
|
|
114
|
+
*/
|
|
115
|
+
hidden?: boolean;
|
|
116
|
+
/**
|
|
117
|
+
* Pins the column: its cells become `position: sticky` on the given side,
|
|
118
|
+
* in place — the column keeps its render slot and sticks there as the rest
|
|
119
|
+
* scrolls under it (spreadsheet freeze panes, not a pinned region). The
|
|
120
|
+
* offset accumulates the pinned columns before it on the same side, so
|
|
121
|
+
* pin a contiguous run from the edge: a lone `left` column in the middle
|
|
122
|
+
* sticks at `left: 0` and slides over everything before it, by design.
|
|
123
|
+
* The pin travels with the column through `order` and `reorderable`, and
|
|
124
|
+
* a `hidden` pinned column pins nothing. The structural columns pin
|
|
125
|
+
* through `fixed-select` / `fixed-actions` on the table.
|
|
126
|
+
*/
|
|
127
|
+
fixed?: 'left' | 'right';
|
|
96
128
|
/**
|
|
97
129
|
* Freezes the column to a fixed width (numbers are treated as px). When
|
|
98
130
|
* omitted the column syncs its width to the parent table's matching track.
|
|
99
131
|
*/
|
|
100
132
|
width?: number | string;
|
|
101
133
|
/**
|
|
102
|
-
* For a nested table,
|
|
103
|
-
* parent's
|
|
104
|
-
*
|
|
134
|
+
* For a nested table, which parent column this column snaps onto — by the
|
|
135
|
+
* parent's column KEY, as written (`'client'`, not a position), plus the
|
|
136
|
+
* reserved names `'select'` and `'actions'` for the parent's structural
|
|
137
|
+
* columns.
|
|
105
138
|
*
|
|
106
|
-
* - A single
|
|
107
|
-
*
|
|
108
|
-
*
|
|
109
|
-
*
|
|
110
|
-
*
|
|
111
|
-
*
|
|
112
|
-
*
|
|
139
|
+
* - A single key takes that parent track: `snap: 'client'`.
|
|
140
|
+
* - A `[start, end]` pair spans from the start of `start` through the END
|
|
141
|
+
* of `end`, inclusive: `['client', 'amount']`, or `['name', 'actions']`
|
|
142
|
+
* to run across the parent's actions column too.
|
|
143
|
+
* - A trailing `.digits` on a key is a fraction of that track — `'amount.5'`
|
|
144
|
+
* as an end means "through half of `amount`", as a start "from halfway
|
|
145
|
+
* into it". Pairs only; a key that itself ends in `.digits` is written
|
|
146
|
+
* in its slot-name spelling (`line_1`).
|
|
113
147
|
*
|
|
114
|
-
* When omitted the column
|
|
115
|
-
*
|
|
148
|
+
* When omitted the column pairs with the parent column of the SAME key when
|
|
149
|
+
* there is one, and otherwise flows into the next parent track no other
|
|
150
|
+
* column claimed. A column whose target the parent does not render (a
|
|
151
|
+
* `hidden` parent column, a key it lacks) flows the same way; with no free
|
|
152
|
+
* track left it content-sizes and overflows. The last column runs to the end
|
|
153
|
+
* of the parent's data region unless it declares a `width` or an explicit
|
|
154
|
+
* pair, so a table with fewer columns than its parent widens its last
|
|
155
|
+
* content cell across the parent's trailing tracks rather than its actions
|
|
156
|
+
* cell.
|
|
157
|
+
*
|
|
158
|
+
* Snaps resolve against the parent's RENDERED columns, so they are ignored
|
|
159
|
+
* (dev builds warn) under a parent that reorders — `reorderable`, or a
|
|
160
|
+
* non-empty `order` model — where the child falls back to positional
|
|
161
|
+
* inheritance. Never reorder the snapped child itself.
|
|
116
162
|
*/
|
|
117
|
-
snap?:
|
|
163
|
+
snap?: string | [start: string, end: string];
|
|
118
164
|
};
|
|
119
165
|
export type BbTableProps<Item = any> = {
|
|
120
166
|
/**
|
|
121
167
|
* Function that accepts the columns and the current item as
|
|
122
168
|
* arguments and returns a label to be used for accessibility purposes.
|
|
169
|
+
* The cells arrive in RENDER order (they follow `order`, so the
|
|
170
|
+
* label reads like the row) — look a cell up by `key`, never by position.
|
|
123
171
|
*/
|
|
124
172
|
accessibleLabel?: (columns: MappedCell[], item: any) => string;
|
|
125
|
-
/**
|
|
126
|
-
* Displays the actions column.
|
|
127
|
-
*/
|
|
128
|
-
actions?: boolean;
|
|
129
173
|
/**
|
|
130
174
|
* Label used in the header of the actions column.
|
|
131
175
|
*/
|
|
@@ -136,31 +180,6 @@ export type BbTableProps<Item = any> = {
|
|
|
136
180
|
* @defaultValue `'left'`
|
|
137
181
|
*/
|
|
138
182
|
align?: 'left' | 'center' | 'right';
|
|
139
|
-
/**
|
|
140
|
-
* Stable id for this table's width context. When omitted a unique id is
|
|
141
|
-
* generated. Nested tables use the nearest ancestor id to inherit widths.
|
|
142
|
-
*/
|
|
143
|
-
id?: string;
|
|
144
|
-
/**
|
|
145
|
-
* Opt a nested table into inheriting its column widths from an ancestor
|
|
146
|
-
* table's matching tracks (accounting for `select`/`actions` columns). This
|
|
147
|
-
* also forces `table-layout: fixed`, so it is **off by default** — a nested
|
|
148
|
-
* table renders independently unless you ask for alignment.
|
|
149
|
-
* - `false` (the default): do not inherit; size independently.
|
|
150
|
-
* - `true`: inherit from the nearest ancestor table.
|
|
151
|
-
* - a table id (string): inherit from the specific ancestor in the chain with
|
|
152
|
-
* that id rather than the immediate parent. Use this when an intermediate
|
|
153
|
-
* table has a different column count, so the extra columns would otherwise
|
|
154
|
-
* misalign against it.
|
|
155
|
-
*/
|
|
156
|
-
inheritColumnWidths?: boolean | string;
|
|
157
|
-
/**
|
|
158
|
-
* Hides the "Select all" checkbox that selectable multi-row tables
|
|
159
|
-
* display by default.
|
|
160
|
-
*
|
|
161
|
-
* @defaultValue `false`
|
|
162
|
-
*/
|
|
163
|
-
disableSelectAll?: boolean;
|
|
164
183
|
/**
|
|
165
184
|
* Caption that describes the content of the table. Used for accessibility purposes.
|
|
166
185
|
*/
|
|
@@ -193,6 +212,18 @@ export type BbTableProps<Item = any> = {
|
|
|
193
212
|
* Disables the component
|
|
194
213
|
*/
|
|
195
214
|
disabled?: boolean;
|
|
215
|
+
/**
|
|
216
|
+
* Hides the "Select all" checkbox that selectable multi-row tables
|
|
217
|
+
* display by default.
|
|
218
|
+
*
|
|
219
|
+
* @defaultValue `false`
|
|
220
|
+
*/
|
|
221
|
+
disableSelectAll?: boolean;
|
|
222
|
+
/**
|
|
223
|
+
* Boolean that defines whether to display or hide the caption.
|
|
224
|
+
* By default is true and the caption is hidden.
|
|
225
|
+
*/
|
|
226
|
+
displayCaption?: boolean;
|
|
196
227
|
/**
|
|
197
228
|
* After every load (initial, `dependencies` refetch or a change of the
|
|
198
229
|
* `items` array) prunes the row-keyed models of values whose row is no
|
|
@@ -210,45 +241,102 @@ export type BbTableProps<Item = any> = {
|
|
|
210
241
|
*/
|
|
211
242
|
enforceCoherence?: boolean;
|
|
212
243
|
/**
|
|
213
|
-
*
|
|
214
|
-
*
|
|
244
|
+
* Used by `v-model:expandedItems`. Array of the currently expanded items —
|
|
245
|
+
* toggled by the row expand control and by external writes (mirrors the
|
|
246
|
+
* `highlighted`/`sort` v-model surfaces). Drives the `#expand` slot rows and
|
|
247
|
+
* their `aria-expanded`/`aria-controls` wiring.
|
|
248
|
+
*
|
|
249
|
+
* @defaultValue `[]`
|
|
215
250
|
*/
|
|
216
|
-
|
|
251
|
+
expandedItems?: any[];
|
|
217
252
|
/**
|
|
218
|
-
*
|
|
253
|
+
* Splits the width equally among the columns that declare no `width`
|
|
254
|
+
* (each undeclared column becomes a `minmax(0, 1fr)` track)
|
|
219
255
|
* making each column take up the same amount of space.
|
|
220
256
|
*/
|
|
221
257
|
fixed?: boolean;
|
|
222
258
|
/**
|
|
223
|
-
*
|
|
224
|
-
*
|
|
225
|
-
*
|
|
259
|
+
* Pins the actions column (the one the `#actions` slot creates) to the
|
|
260
|
+
* right edge, `position: sticky`, in place. Data columns pin through
|
|
261
|
+
* `column.fixed`; this is the same feature for the structural column that
|
|
262
|
+
* has no definition to carry it. No effect without an `#actions` slot.
|
|
226
263
|
*
|
|
227
|
-
* @defaultValue `
|
|
264
|
+
* @defaultValue `false`
|
|
228
265
|
*/
|
|
229
|
-
|
|
230
|
-
index: number;
|
|
231
|
-
position: 'left' | 'right';
|
|
232
|
-
}>;
|
|
266
|
+
fixedActions?: boolean;
|
|
233
267
|
/**
|
|
234
268
|
* Boolean that sets the headers as sticky to the top of the table.
|
|
235
269
|
*/
|
|
236
270
|
fixedHeaders?: boolean;
|
|
271
|
+
/**
|
|
272
|
+
* Pins the selection column to the left edge, `position: sticky`, in
|
|
273
|
+
* place. Data columns pin through `column.fixed`; this is the same feature
|
|
274
|
+
* for the structural column that has no definition to carry it. No effect
|
|
275
|
+
* unless the table is `selectable`.
|
|
276
|
+
*
|
|
277
|
+
* @defaultValue `false`
|
|
278
|
+
*/
|
|
279
|
+
fixedSelect?: boolean;
|
|
280
|
+
/**
|
|
281
|
+
* Defines the classes to be passed to the header row.
|
|
282
|
+
*/
|
|
283
|
+
headerRowClass?: Classes;
|
|
237
284
|
/**
|
|
238
285
|
* Used by `v-model:highlighted`. A parallel, UI-intent state to selection —
|
|
239
286
|
* typically "the row whose details are open". A single item value (or
|
|
240
287
|
* `null`) — highlight is single by design.
|
|
241
|
-
*
|
|
242
|
-
*
|
|
243
|
-
* is
|
|
288
|
+
*
|
|
289
|
+
* **Opt-in, and `undefined` is the opt-out.** Leave it unbound and the whole
|
|
290
|
+
* mechanic is off: clicking a row emits `click:row` and nothing else — no
|
|
291
|
+
* class, no `aria-current`, no internal state. Bind it and clicking a row
|
|
292
|
+
* toggles it. The value itself is the switch: `undefined` means "never
|
|
293
|
+
* initialised", `null` means "initialised and currently empty", so bind
|
|
294
|
+
* `ref(null)` rather than `ref()` — a bound-but-`undefined` model warns in
|
|
295
|
+
* dev and stays off. A value seeded through
|
|
296
|
+
* `useBbTableContext(id, { highlighted })` counts as bound the same way.
|
|
297
|
+
*
|
|
298
|
+
* A highlighted row gets `aria-current="true"` and the
|
|
299
|
+
* `bb-table-data__row--highlighted` class, which the shipped stylesheet
|
|
300
|
+
* paints with a neutral fill plus a brand accent bar; override the whole
|
|
301
|
+
* look with `rowClass`.
|
|
244
302
|
*/
|
|
245
303
|
highlighted?: any;
|
|
304
|
+
/**
|
|
305
|
+
* Stable id for this table's width context. When omitted a unique id is
|
|
306
|
+
* generated. Nested tables use the nearest ancestor id to inherit widths.
|
|
307
|
+
*/
|
|
308
|
+
id?: string;
|
|
309
|
+
/**
|
|
310
|
+
* Opt a nested table into inheriting its column widths from an ancestor
|
|
311
|
+
* table's matching tracks (accounting for `select`/`actions` columns). This
|
|
312
|
+
* also makes the parent's tracks authoritative, so it is **off by default** — a nested
|
|
313
|
+
* table renders independently unless you ask for alignment.
|
|
314
|
+
* - `false` (the default): do not inherit; size independently.
|
|
315
|
+
* - `true`: inherit from the nearest ancestor table.
|
|
316
|
+
* - a table id (string): inherit from the specific ancestor in the chain with
|
|
317
|
+
* that id rather than the immediate parent. Use this when an intermediate
|
|
318
|
+
* table has a different column count, so the extra columns would otherwise
|
|
319
|
+
* misalign against it.
|
|
320
|
+
*/
|
|
321
|
+
inheritColumnWidths?: boolean | string;
|
|
322
|
+
/**
|
|
323
|
+
* Keeps the table interactive while it is loading. The header and the rows are
|
|
324
|
+
* `inert` while loading by default — a refetch is about to replace the rows,
|
|
325
|
+
* so editing, selecting or sorting them races the incoming data. This escape
|
|
326
|
+
* hatch exists for tables that must stay usable during background refreshes
|
|
327
|
+
* (e.g. a poll that must not interrupt an open editor).
|
|
328
|
+
*
|
|
329
|
+
* The loading announcement is never inert, so the busy state is always
|
|
330
|
+
* conveyed.
|
|
331
|
+
*/
|
|
332
|
+
interactiveWhileLoading?: boolean;
|
|
246
333
|
/**
|
|
247
334
|
* Rows to render, or a fetcher that returns them.
|
|
248
335
|
*
|
|
249
336
|
* @defaultValue `[]`
|
|
250
337
|
*/
|
|
251
338
|
items: Item[] | ((prefill: boolean, modelValue?: any) => Item[] | Promise<Item[]>);
|
|
339
|
+
itemValue?: ItemAccessor<Item>;
|
|
252
340
|
/**
|
|
253
341
|
* Opt-in keyboard navigation with a roving tabindex: the body is one tab
|
|
254
342
|
* stop, ArrowUp/ArrowDown move the focused row (Home/End jump), and
|
|
@@ -257,7 +345,6 @@ export type BbTableProps<Item = any> = {
|
|
|
257
345
|
* not highlight until committed. Focused rows show the standard focus ring.
|
|
258
346
|
*/
|
|
259
347
|
keyboardNavigation?: boolean;
|
|
260
|
-
itemValue?: ItemAccessor<Item>;
|
|
261
348
|
/**
|
|
262
349
|
* Text content of the `<legend>` a `selectable` table renders (it becomes
|
|
263
350
|
* a `<fieldset>`, and the legend is that fieldset's accessible name).
|
|
@@ -274,17 +361,6 @@ export type BbTableProps<Item = any> = {
|
|
|
274
361
|
* a refetch should not blank a table the user is reading.
|
|
275
362
|
*/
|
|
276
363
|
loading?: boolean;
|
|
277
|
-
/**
|
|
278
|
-
* Keeps the table interactive while it is loading. The header and the rows are
|
|
279
|
-
* `inert` while loading by default — a refetch is about to replace the rows,
|
|
280
|
-
* so editing, selecting or sorting them races the incoming data. This escape
|
|
281
|
-
* hatch exists for tables that must stay usable during background refreshes
|
|
282
|
-
* (e.g. a poll that must not interrupt an open editor).
|
|
283
|
-
*
|
|
284
|
-
* The loading announcement is never inert, so the busy state is always
|
|
285
|
-
* conveyed.
|
|
286
|
-
*/
|
|
287
|
-
interactiveWhileLoading?: boolean;
|
|
288
364
|
/**
|
|
289
365
|
* Screen-reader announcement for the loading row's `aria-live` status.
|
|
290
366
|
* Visually hidden — the skeleton (or the `#loading` slot) is the visible
|
|
@@ -321,6 +397,23 @@ export type BbTableProps<Item = any> = {
|
|
|
321
397
|
* @defaultValue the localized `common.noDataText` ("No data to display")
|
|
322
398
|
*/
|
|
323
399
|
noDataText?: string;
|
|
400
|
+
/**
|
|
401
|
+
* Used by `v-model:order`. Ordered array of column keys — the render
|
|
402
|
+
* order of the data columns. Keys listed here render first, in this order;
|
|
403
|
+
* declared columns it omits follow, in declaration order (so a column added
|
|
404
|
+
* to `columns` later renders last); a `hidden` column keeps its slot
|
|
405
|
+
* without rendering, and keys that match no declared column render
|
|
406
|
+
* nothing but are PRESERVED in place on every write. The header drag /
|
|
407
|
+
* keyboard reorder of `reorderable` writes it back complete (every
|
|
408
|
+
* declared key present, hidden ones included, duplicates dropped — first
|
|
409
|
+
* occurrence wins) with exactly the moved column relocated: every other
|
|
410
|
+
* key keeps its relative order, and a drop that changes nothing emits
|
|
411
|
+
* nothing. Works uncontrolled when unbound, exactly like `sort`. The
|
|
412
|
+
* `select` and `actions` columns are structural and never part of it.
|
|
413
|
+
*
|
|
414
|
+
* @defaultValue `[]`
|
|
415
|
+
*/
|
|
416
|
+
order?: string[];
|
|
324
417
|
/**
|
|
325
418
|
* Current page number starting from 1, used for accessibility purposes.
|
|
326
419
|
* Also flows into the shared table context, so a `BbPagination` paired
|
|
@@ -343,14 +436,42 @@ export type BbTableProps<Item = any> = {
|
|
|
343
436
|
*/
|
|
344
437
|
readonly?: boolean;
|
|
345
438
|
/**
|
|
346
|
-
*
|
|
439
|
+
* Lets the user reorder the data columns: drag a header cell (AG Grid style —
|
|
440
|
+
* the column moves live under the pointer and a chip with its label follows)
|
|
441
|
+
* or, from the keyboard, use each header's reorder handle (ArrowLeft /
|
|
442
|
+
* ArrowRight move the column one slot, Home / End to the ends). Every move
|
|
443
|
+
* writes `v-model:order`. Not needed by an external control (a column
|
|
444
|
+
* panel) that only writes `order`. The `select` / `actions` columns and
|
|
445
|
+
* a custom `#thead` are never draggable.
|
|
446
|
+
*
|
|
447
|
+
* @defaultValue `false`
|
|
448
|
+
*/
|
|
449
|
+
reorderable?: boolean;
|
|
450
|
+
/**
|
|
451
|
+
* Lets the user resize the data columns of a root table: drag the handle on
|
|
452
|
+
* a header's trailing edge (the column follows live, the width commits on
|
|
453
|
+
* release), or press Alt + ArrowLeft / ArrowRight on the focused header;
|
|
454
|
+
* double-click the handle to go back to the declared width. Each commit
|
|
455
|
+
* fires `resize:column(key, width)` once. `column.width` stays the single declared
|
|
456
|
+
* truth: a resized width is an override the table keeps until that
|
|
457
|
+
* column's `width` changes — write the reported width back into your
|
|
458
|
+
* column definition to persist it. Ignored on a table that inherits its
|
|
459
|
+
* widths from a parent.
|
|
460
|
+
*
|
|
461
|
+
* @defaultValue `false`
|
|
462
|
+
*/
|
|
463
|
+
resizable?: boolean;
|
|
464
|
+
/**
|
|
465
|
+
* Defines the classes to be passed to each data row. Can also be a
|
|
347
466
|
* function of the row's item for dynamic values.
|
|
348
467
|
*/
|
|
349
468
|
rowClass?: RowClasses<Item>;
|
|
350
469
|
/**
|
|
351
|
-
* Defines the
|
|
470
|
+
* Defines whether the table is selectable.
|
|
471
|
+
* Can be a global boolean that affects all rows or a function
|
|
472
|
+
* that accepts an item and returns a boolean that only affects that item.
|
|
352
473
|
*/
|
|
353
|
-
|
|
474
|
+
selectable?: boolean | ((item: Item) => boolean);
|
|
354
475
|
/**
|
|
355
476
|
* Defines whether the "Select all" checkbox is checked.
|
|
356
477
|
*
|
|
@@ -358,11 +479,13 @@ export type BbTableProps<Item = any> = {
|
|
|
358
479
|
*/
|
|
359
480
|
selectAll?: boolean;
|
|
360
481
|
/**
|
|
361
|
-
*
|
|
362
|
-
* Can be a global boolean that affects all rows or a function
|
|
363
|
-
* that accepts an item and returns a boolean that only affects that item.
|
|
482
|
+
* Text of the label used by the "Select all" boolean.
|
|
364
483
|
*/
|
|
365
|
-
|
|
484
|
+
selectAllLabel?: string;
|
|
485
|
+
/**
|
|
486
|
+
* Text of the header used for the radio inputs when the table is not `multiple`.
|
|
487
|
+
*/
|
|
488
|
+
selectText?: string;
|
|
366
489
|
/**
|
|
367
490
|
* Used by `v-model:sort`. Ordered array of `[columnKey, direction]`
|
|
368
491
|
* entries, one per actively sorted column. Bidirectional: the header
|
|
@@ -374,28 +497,11 @@ export type BbTableProps<Item = any> = {
|
|
|
374
497
|
*/
|
|
375
498
|
sort?: BbTableSortEntry[];
|
|
376
499
|
/**
|
|
377
|
-
*
|
|
378
|
-
* toggled by the row expand control and by external writes (mirrors the
|
|
379
|
-
* `highlighted`/`sort` v-model surfaces). Drives the `#expand` slot rows and
|
|
380
|
-
* their `aria-expanded`/`aria-controls` wiring.
|
|
381
|
-
*
|
|
382
|
-
* @defaultValue `[]`
|
|
383
|
-
*/
|
|
384
|
-
expandedItems?: any[];
|
|
385
|
-
/**
|
|
386
|
-
* Text of the label used by the "Select all" boolean.
|
|
387
|
-
*/
|
|
388
|
-
selectAllLabel?: string;
|
|
389
|
-
/**
|
|
390
|
-
* Text of the header used for the radio inputs when the table is not `multiple`.
|
|
391
|
-
*/
|
|
392
|
-
selectText?: string;
|
|
393
|
-
/**
|
|
394
|
-
* Defines the classes to be passed to the `<td>` elements. Can also be a function for dynamic values.
|
|
500
|
+
* Defines the classes to be passed to every data cell. Can also be a function for dynamic values.
|
|
395
501
|
*/
|
|
396
502
|
tdClass?: ColumnClasses<Item>;
|
|
397
503
|
/**
|
|
398
|
-
* Defines the classes to be passed to
|
|
504
|
+
* Defines the classes to be passed to every header cell.
|
|
399
505
|
*/
|
|
400
506
|
thClass?: Classes;
|
|
401
507
|
/**
|
|
@@ -423,6 +529,22 @@ export type BbTableProps<Item = any> = {
|
|
|
423
529
|
* @defaultValue `[]`
|
|
424
530
|
*/
|
|
425
531
|
unselectedItems?: any[];
|
|
532
|
+
/**
|
|
533
|
+
* Windows the body: only the rows in (and just around) the vertical
|
|
534
|
+
* scrollport are mounted, so a client-side dataset of any size scrolls at
|
|
535
|
+
* a constant cost. The table itself is the scroller as soon as you bound
|
|
536
|
+
* its height (`max-height` / `height`, or a flex item with
|
|
537
|
+
* `min-height: 0`); left unbounded, the nearest scrolling ancestor or the
|
|
538
|
+
* page scrolls it. The header sticks to that scroller. Column widths are
|
|
539
|
+
* measured once from the first rendered batch and then hold — later rows
|
|
540
|
+
* never widen them. Expand rows and nested tables stay fully rendered
|
|
541
|
+
* inside their row (a nested table is never windowed); the row that owns
|
|
542
|
+
* focus stays mounted even when scrolled out of view. Ignored by a table
|
|
543
|
+
* that inherits its widths from a parent, and under a `#tbody` slot.
|
|
544
|
+
*
|
|
545
|
+
* @defaultValue `false`
|
|
546
|
+
*/
|
|
547
|
+
virtual?: boolean;
|
|
426
548
|
};
|
|
427
549
|
/**
|
|
428
550
|
* We allow table data classes to be a function so it can depend on the item.
|
|
@@ -454,12 +576,22 @@ export type MappedItem = Option & {
|
|
|
454
576
|
onRowContextMenu: (event: MouseEvent) => void;
|
|
455
577
|
onRowDblClick: (event: MouseEvent) => void;
|
|
456
578
|
rowIndex: number | undefined;
|
|
579
|
+
/**
|
|
580
|
+
* The row's slot scope, built ONCE per row in the projection rather than
|
|
581
|
+
* per cell per render (a 16-column row used to allocate ~100 closures and
|
|
582
|
+
* objects on every render; a virtualized table mounts a dozen rows per
|
|
583
|
+
* scroll step).
|
|
584
|
+
*/
|
|
585
|
+
expandProps: Record<string, unknown>;
|
|
586
|
+
toggleExpanded: () => void;
|
|
587
|
+
toggleHighlighted: () => void;
|
|
588
|
+
toggleSelected: () => void;
|
|
457
589
|
};
|
|
458
590
|
/**
|
|
459
591
|
* Projection that represents a header
|
|
460
592
|
*/
|
|
461
593
|
export type MappedHeader = {
|
|
462
|
-
align:
|
|
594
|
+
align: string;
|
|
463
595
|
classes?: Classes;
|
|
464
596
|
key: string;
|
|
465
597
|
label: string;
|
|
@@ -486,34 +618,90 @@ export type ExpandControllerProps = {
|
|
|
486
618
|
onKeydown: (event: KeyboardEvent) => void;
|
|
487
619
|
};
|
|
488
620
|
export type BbTableEvents = {
|
|
489
|
-
(e: 'click:row', event: MouseEvent, item: any
|
|
490
|
-
(e: 'contextmenu:row', event: MouseEvent, item: any
|
|
491
|
-
(e: 'dblclick:row', event: MouseEvent, item: any
|
|
621
|
+
(e: 'click:row', event: MouseEvent, item: any): void;
|
|
622
|
+
(e: 'contextmenu:row', event: MouseEvent, item: any): void;
|
|
623
|
+
(e: 'dblclick:row', event: MouseEvent, item: any): void;
|
|
492
624
|
(e: 'update:highlighted', value: any): void;
|
|
493
625
|
(e: 'update:modelValue', value: any): void;
|
|
494
626
|
(e: 'update:selectAll', value: boolean): void;
|
|
495
627
|
(e: 'update:sort', value: BbTableSortEntry[]): void;
|
|
628
|
+
(e: 'update:order', value: string[]): void;
|
|
629
|
+
/**
|
|
630
|
+
* A column was resized by the user (`resizable`): the new width in
|
|
631
|
+
* px, or `null` when the handle was double-clicked to reset the column to
|
|
632
|
+
* its declared width.
|
|
633
|
+
*/
|
|
634
|
+
(e: 'resize:column', key: string, width: number | null): void;
|
|
635
|
+
/**
|
|
636
|
+
* A column was hidden from its header (a `#header:<key>` /
|
|
637
|
+
* `#header:<key>:append` control calling the slot's `hideColumn()`). Fired once;
|
|
638
|
+
* the table keeps the column hidden for the mount, or until the column's
|
|
639
|
+
* `hidden` flag changes — write `hidden: true` into the definition to
|
|
640
|
+
* persist it, `hidden: false` (a column panel) to show it again.
|
|
641
|
+
*/
|
|
642
|
+
(e: 'hide:column', key: string): void;
|
|
496
643
|
(e: 'update:expandedItems', value: any[]): void;
|
|
497
644
|
(e: 'update:unselectedItems', value: any[]): void;
|
|
498
645
|
(e: 'item:selected', value: any): void;
|
|
499
646
|
(e: 'item:unselected', value: any): void;
|
|
500
647
|
};
|
|
648
|
+
/**
|
|
649
|
+
* Props exposed by the table-wide `header:prepend` / `header:append` slots and
|
|
650
|
+
* their per-column `header:<key>:prepend` / `header:<key>:append` variants —
|
|
651
|
+
* the `header:<key>` payload plus the column key.
|
|
652
|
+
*/
|
|
653
|
+
export type BbTableHeaderAffixSlotProps<Item = any> = {
|
|
654
|
+
/** Merged header classes for this column. */
|
|
655
|
+
classes?: Classes;
|
|
656
|
+
/**
|
|
657
|
+
* The raw key of the column being rendered — branch on it in the
|
|
658
|
+
* table-wide slots.
|
|
659
|
+
*/
|
|
660
|
+
columnKey: string;
|
|
661
|
+
/** The current table items. */
|
|
662
|
+
items?: Item[];
|
|
663
|
+
/** The column's label. */
|
|
664
|
+
label?: string;
|
|
665
|
+
/** Whether this column is sortable. */
|
|
666
|
+
sortable?: boolean;
|
|
667
|
+
/** This column's current sort direction, or `null` when unsorted. */
|
|
668
|
+
sortOrder?: 'asc' | 'desc' | null;
|
|
669
|
+
/** Cycles this column's sort: unsorted → asc → desc → unsorted. */
|
|
670
|
+
toggleSort?: () => void;
|
|
671
|
+
/**
|
|
672
|
+
* Hides this column (fires `hide:column`). One-way by nature — a hidden
|
|
673
|
+
* column has no header to call it from; showing it again is the
|
|
674
|
+
* definition's job (`hidden: false`).
|
|
675
|
+
*/
|
|
676
|
+
hideColumn?: () => void;
|
|
677
|
+
};
|
|
501
678
|
export type BbTableSlots<Item = any> = {
|
|
502
679
|
/**
|
|
503
|
-
* Replaces the
|
|
680
|
+
* Replaces the content of the header row group (`.bb-table__head`). Use when
|
|
681
|
+
* you need full control over the header markup. The table is a CSS grid,
|
|
682
|
+
* not a `<table>`: provide role-complete rows — `<div role="row">` holding
|
|
683
|
+
* one `<div role="columnheader">` per column — and never a `<tr>`/`<th>`.
|
|
684
|
+
* Rows are subgrid rows, so each cell lands on the matching column track.
|
|
504
685
|
*/
|
|
505
686
|
thead?: (props: object) => any;
|
|
506
687
|
/**
|
|
507
|
-
* Replaces the
|
|
688
|
+
* Replaces the content of the body row group (`.bb-table__body`). Use when
|
|
689
|
+
* you need full control over the body markup. Provide role-complete rows —
|
|
690
|
+
* `<div role="row">` holding one `<div role="cell">` per column — never a
|
|
691
|
+
* `<tr>`/`<td>`. A full-width cell spans with `grid-column: 1 / -1`.
|
|
508
692
|
*/
|
|
509
693
|
tbody?: (props: object) => any;
|
|
510
694
|
/**
|
|
511
|
-
*
|
|
695
|
+
* Fills the footer row group (`.bb-table__foot`). Use when you need a
|
|
696
|
+
* footer. Provide role-complete rows — `<div role="row">` holding
|
|
697
|
+
* `<div role="cell">` elements — never a `<tr>`/`<td>`.
|
|
512
698
|
*/
|
|
513
699
|
tfoot?: (props: {
|
|
514
700
|
/**
|
|
515
|
-
* Total rendered column count
|
|
516
|
-
*
|
|
701
|
+
* Total rendered column count (accounts for the selection/actions
|
|
702
|
+
* columns), so you never hand-count it. A footer cell spanning the
|
|
703
|
+
* whole table uses `grid-column: 1 / -1`; one spanning a subset uses
|
|
704
|
+
* `grid-column: span N` with `N` up to this value.
|
|
517
705
|
*/
|
|
518
706
|
columnCount: number;
|
|
519
707
|
}) => any;
|
|
@@ -535,6 +723,20 @@ export type BbTableSlots<Item = any> = {
|
|
|
535
723
|
'header:actions'?: (props: {
|
|
536
724
|
text: string;
|
|
537
725
|
}) => any;
|
|
726
|
+
/**
|
|
727
|
+
* Content rendered before every data column's header cell content — the
|
|
728
|
+
* label + sort control, or the column's own `header:<key>` replacement.
|
|
729
|
+
* A column's `header:<key>:prepend` slot wins over this one for that
|
|
730
|
+
* column; they never stack. Branch on `columnKey` for per-column output.
|
|
731
|
+
*/
|
|
732
|
+
'header:prepend'?: (props: BbTableHeaderAffixSlotProps<Item>) => any;
|
|
733
|
+
/**
|
|
734
|
+
* Content rendered after every data column's header cell content — the
|
|
735
|
+
* label + sort control, or the column's own `header:<key>` replacement.
|
|
736
|
+
* A column's `header:<key>:append` slot wins over this one for that
|
|
737
|
+
* column; they never stack. Branch on `columnKey` for per-column output.
|
|
738
|
+
*/
|
|
739
|
+
'header:append'?: (props: BbTableHeaderAffixSlotProps<Item>) => any;
|
|
538
740
|
/**
|
|
539
741
|
* Content shown while table rows are loading (replaces the skeleton rows).
|
|
540
742
|
* @param items - The current (possibly stale) list of items, useful to match the previous row count.
|
|
@@ -544,13 +746,17 @@ export type BbTableSlots<Item = any> = {
|
|
|
544
746
|
}) => any;
|
|
545
747
|
/**
|
|
546
748
|
* Content shown when the items list is empty and not loading. It fills the
|
|
547
|
-
* table's own full-width empty-state cell (
|
|
548
|
-
*
|
|
549
|
-
* illustration, a "clear filters" button — never a
|
|
749
|
+
* table's own full-width empty-state cell (it already spans the
|
|
750
|
+
* selection/actions columns), so provide the *content* — a message, an
|
|
751
|
+
* illustration, a "clear filters" button — never a row/cell of your own.
|
|
550
752
|
*/
|
|
551
753
|
'no-data'?: (props: object) => any;
|
|
552
754
|
/**
|
|
553
|
-
* Content rendered in the actions cell for each row.
|
|
755
|
+
* Content rendered in the actions cell for each row. Providing this slot
|
|
756
|
+
* is what CREATES the actions column (there is no prop): the header cell
|
|
757
|
+
* (labelled by `actions-text`, replaceable through `#header:actions`) and
|
|
758
|
+
* one cell per row appear with it, and go away with it. Pin it with
|
|
759
|
+
* `fixed-actions`.
|
|
554
760
|
* @param expanded - Whether this row is currently expanded.
|
|
555
761
|
* @param expandProps - Bind these onto an expand-toggle button to wire up aria attributes and keyboard handling.
|
|
556
762
|
* @param toggleExpanded - Toggles the expanded state for this row.
|
|
@@ -616,6 +822,11 @@ export type BbTableSlots<Item = any> = {
|
|
|
616
822
|
}) => any;
|
|
617
823
|
} & Record<string, (props: {
|
|
618
824
|
classes?: Classes[];
|
|
825
|
+
/**
|
|
826
|
+
* Present only in the `header:<key>:prepend/append` affix slots — the
|
|
827
|
+
* raw key of the column being rendered.
|
|
828
|
+
*/
|
|
829
|
+
columnKey?: string;
|
|
619
830
|
content?: any;
|
|
620
831
|
expanded?: boolean;
|
|
621
832
|
expandProps?: ExpandControllerProps;
|
|
@@ -627,6 +838,8 @@ export type BbTableSlots<Item = any> = {
|
|
|
627
838
|
sortable?: boolean;
|
|
628
839
|
sortOrder?: 'asc' | 'desc' | null;
|
|
629
840
|
toggleSort?: () => void;
|
|
841
|
+
/** Header slots only: hides this column (fires `hide:column`). */
|
|
842
|
+
hideColumn?: () => void;
|
|
630
843
|
/**
|
|
631
844
|
* Optional because this catch-all also types the `head:*` /
|
|
632
845
|
* `header:*` column slots, which have no row and never receive one.
|