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
|
@@ -2,98 +2,109 @@ import { useId as e } from "../../composables/useId.js";
|
|
|
2
2
|
import { removedPropsFor as t } from "../../deprecation/removedProps.js";
|
|
3
3
|
import { useLogger as n } from "../../composables/useLogger.js";
|
|
4
4
|
import { warnRemovedAttrs as r } from "../../utilities/functions/warnRemovedAttrs.js";
|
|
5
|
-
import i from "
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { useItemsGetter as c } from "../../composables/useItemsGetter.js";
|
|
10
|
-
import { useItemValue as l } from "../../composables/useItemValue.js";
|
|
5
|
+
import { isTopEscapeEntry as i, pushEscapeEntry as a, removeEscapeEntry as o } from "../../utils/overlayEscapeStack.js";
|
|
6
|
+
import s from "../BbBaseButton/BbBaseButton.vue.js";
|
|
7
|
+
import { useLocale as c } from "../../composables/useLocale.js";
|
|
8
|
+
import { isNil as l } from "../../utilities/functions/isNil.js";
|
|
11
9
|
import { hash as u } from "../../utilities/functions/hash.js";
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import
|
|
16
|
-
import {
|
|
17
|
-
import
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import le from "../../
|
|
24
|
-
import
|
|
25
|
-
import
|
|
10
|
+
import { useItemsGetter as d } from "../../composables/useItemsGetter.js";
|
|
11
|
+
import { useItemValue as f } from "../../composables/useItemValue.js";
|
|
12
|
+
import { useHashedWatcher as p } from "../../composables/useHashedWatcher.js";
|
|
13
|
+
import { useBbTableContextHost as ee } from "../../composables/useBbTableContext.js";
|
|
14
|
+
import { clamp as te } from "../../utilities/functions/clamp.js";
|
|
15
|
+
import ne from "../BbBaseCheckbox/BbBaseCheckbox.vue.js";
|
|
16
|
+
import { useIndexById as re } from "../../composables/useIndexById.js";
|
|
17
|
+
import { useBaseOptions as ie } from "../../composables/useBaseOptions.js";
|
|
18
|
+
import { usePrefill as ae } from "../../composables/usePrefill.js";
|
|
19
|
+
import { parseCount as oe, parsePositiveInteger as se } from "../../utilities/functions/parsePaginationNumber.js";
|
|
20
|
+
import { when as ce } from "../../utilities/functions/when.js";
|
|
21
|
+
import { useTableWidthContext as le } from "../../composables/useTableWidthContext.js";
|
|
22
|
+
import ue from "./BbTableDataRow.js";
|
|
23
|
+
import de from "./BbTableExpandRow.js";
|
|
24
|
+
import { applyFixedTableColumns as fe, columnKeyToSlotName as pe, completeColumnOrder as me, mergeCellClasses as he, mergeHeaderClasses as ge, mergeRowClasses as _e, moveColumnKey as ve, orderColumns as ye, readResolvedTracks as be, sameColumnOrder as xe } from "./utils.js";
|
|
25
|
+
import { Fragment as m, computed as h, createBlock as Se, createCommentVNode as g, createElementBlock as _, createElementVNode as v, createTextVNode as Ce, defineComponent as we, getCurrentInstance as Te, mergeModels as Ee, mergeProps as De, nextTick as y, normalizeClass as b, normalizeStyle as x, onBeforeUnmount as Oe, onBeforeUpdate as ke, onMounted as Ae, openBlock as S, reactive as je, ref as C, renderList as Me, renderSlot as w, resolveDynamicComponent as Ne, shallowRef as Pe, toDisplayString as T, toRef as Fe, unref as E, useModel as Ie, useSlots as Le, watch as D, watchEffect as Re, withCtx as ze, withModifiers as Be } from "vue";
|
|
26
|
+
import { defaultRangeExtractor as Ve, elementScroll as He, observeElementOffset as Ue, observeElementRect as We, observeWindowOffset as Ge, observeWindowRect as Ke, useVirtualizer as qe, windowScroll as Je } from "@tanstack/vue-virtual";
|
|
26
27
|
//#region src/components/BbTable/BbTable.vue?vue&type=script&setup=true&lang.ts
|
|
27
|
-
var
|
|
28
|
+
var Ye = {
|
|
28
29
|
key: 0,
|
|
29
30
|
class: "sr-only"
|
|
30
|
-
},
|
|
31
|
+
}, Xe = ["id"], Ze = ["id"], Qe = {
|
|
32
|
+
"aria-live": "polite",
|
|
33
|
+
class: "bb-table-loading__text sr-only",
|
|
34
|
+
role: "status"
|
|
35
|
+
}, $e = {
|
|
36
|
+
"aria-live": "polite",
|
|
37
|
+
class: "bb-table__reorder-status sr-only",
|
|
38
|
+
role: "status"
|
|
39
|
+
}, et = ["aria-labelledby", "aria-rowcount"], tt = ["inert"], nt = ["aria-rowindex"], rt = { class: "bb-table-header__content" }, it = { class: "bb-table-check__label-text sr-only" }, at = {
|
|
31
40
|
key: 1,
|
|
32
41
|
class: "bb-table-radio__label-text sr-only"
|
|
33
|
-
},
|
|
42
|
+
}, ot = [
|
|
43
|
+
"aria-describedby",
|
|
44
|
+
"aria-sort",
|
|
45
|
+
"data-column-key",
|
|
46
|
+
"tabindex",
|
|
47
|
+
"onClick",
|
|
48
|
+
"onFocus",
|
|
49
|
+
"onKeydown"
|
|
50
|
+
], st = { class: "bb-table-header__content" }, ct = {
|
|
34
51
|
key: 1,
|
|
35
52
|
class: "bb-table-header__content"
|
|
36
|
-
},
|
|
53
|
+
}, lt = ["onDblclick", "onPointerdown"], ut = { class: "bb-table-header__content sr-only" }, dt = ["aria-rowindex"], ft = {
|
|
37
54
|
key: 0,
|
|
38
|
-
class: "bb-table-skeleton__cell bb-table-skeleton__cell--select"
|
|
39
|
-
|
|
55
|
+
class: "bb-table-skeleton__cell bb-table-skeleton__cell--select",
|
|
56
|
+
role: "cell"
|
|
57
|
+
}, pt = {
|
|
40
58
|
key: 0,
|
|
41
59
|
class: "bb-table-skeleton__cell-content"
|
|
42
|
-
},
|
|
60
|
+
}, mt = {
|
|
43
61
|
key: 1,
|
|
44
62
|
class: "bb-table-skeleton__avatar"
|
|
45
|
-
},
|
|
63
|
+
}, ht = {
|
|
46
64
|
key: 2,
|
|
47
65
|
class: "bb-table-skeleton__avatar-text"
|
|
48
|
-
},
|
|
66
|
+
}, gt = { class: "bb-table-skeleton__cell-content" }, _t = {
|
|
49
67
|
key: 3,
|
|
50
68
|
class: "bb-table-skeleton__image"
|
|
51
|
-
},
|
|
69
|
+
}, vt = {
|
|
52
70
|
key: 4,
|
|
53
71
|
class: "bb-table-skeleton__badge"
|
|
54
|
-
},
|
|
72
|
+
}, yt = {
|
|
55
73
|
key: 1,
|
|
56
|
-
class: "bb-table-skeleton__cell bb-table-skeleton__cell--actions"
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
"aria-rowindex",
|
|
60
|
-
"inert",
|
|
61
|
-
"tabindex",
|
|
62
|
-
"onClick",
|
|
63
|
-
"onContextmenu",
|
|
64
|
-
"onDblclick",
|
|
65
|
-
"onFocus",
|
|
66
|
-
"onKeydown"
|
|
67
|
-
], Qe = { class: "bb-table-check__label-text sr-only" }, $e = { class: "bb-table-radio__label-text sr-only" }, et = ["id", "aria-rowindex"], tt = ["colspan"], nt = ["aria-rowindex"], rt = ["colspan"], it = { class: "bb-table-loading__text sr-only" }, at = 10, k = /*@__PURE__*/ y({
|
|
74
|
+
class: "bb-table-skeleton__cell bb-table-skeleton__cell--actions",
|
|
75
|
+
role: "cell"
|
|
76
|
+
}, bt = ["aria-rowindex"], xt = ["aria-colspan"], St = { class: "bb-table-no-data__text" }, Ct = ["data-index"], wt = ["role"], Tt = 48, Et = 10, Dt = "bb-table-resizing", Ot = 5, kt = 10, At = 500, jt = 40, Mt = 12, Nt = 4, Pt = 12, Ft = "a, button:not(.bb-table-sort), input, select, textarea, [contenteditable], [role=\"button\"], .bb-table-header__resizer", It = 12, Lt = 10, Rt = 600, zt = 120, Bt = 6, Vt = 120, Ht = 10, O = /*@__PURE__*/ we({
|
|
68
77
|
__name: "BbTable",
|
|
69
|
-
props: /*@__PURE__*/
|
|
78
|
+
props: /*@__PURE__*/ Ee({
|
|
70
79
|
accessibleLabel: {},
|
|
71
|
-
actions: { type: Boolean },
|
|
72
80
|
actionsText: {},
|
|
73
81
|
align: { default: "left" },
|
|
74
|
-
id: {},
|
|
75
|
-
inheritColumnWidths: { type: [Boolean, String] },
|
|
76
|
-
disableSelectAll: { type: Boolean },
|
|
77
82
|
caption: {},
|
|
78
83
|
compact: { type: Boolean },
|
|
79
84
|
dependencies: { default: () => [] },
|
|
80
85
|
depsDebounceTime: { default: 0 },
|
|
81
86
|
disabled: { type: Boolean },
|
|
82
|
-
|
|
87
|
+
disableSelectAll: { type: Boolean },
|
|
83
88
|
displayCaption: { type: Boolean },
|
|
89
|
+
enforceCoherence: { type: Boolean },
|
|
90
|
+
expandedItems: {},
|
|
84
91
|
fixed: { type: Boolean },
|
|
85
|
-
|
|
92
|
+
fixedActions: { type: Boolean },
|
|
86
93
|
fixedHeaders: { type: Boolean },
|
|
94
|
+
fixedSelect: { type: Boolean },
|
|
95
|
+
headerRowClass: {},
|
|
87
96
|
highlighted: {},
|
|
97
|
+
id: {},
|
|
98
|
+
inheritColumnWidths: { type: [Boolean, String] },
|
|
99
|
+
interactiveWhileLoading: { type: Boolean },
|
|
88
100
|
items: {
|
|
89
101
|
type: [Array, Function],
|
|
90
102
|
default: () => []
|
|
91
103
|
},
|
|
92
|
-
keyboardNavigation: { type: Boolean },
|
|
93
104
|
itemValue: {},
|
|
105
|
+
keyboardNavigation: { type: Boolean },
|
|
94
106
|
legend: {},
|
|
95
107
|
loading: { type: Boolean },
|
|
96
|
-
interactiveWhileLoading: { type: Boolean },
|
|
97
108
|
loadingText: {},
|
|
98
109
|
max: { default: Infinity },
|
|
99
110
|
modelValue: { default: () => [] },
|
|
@@ -103,22 +114,24 @@ var Oe = {
|
|
|
103
114
|
},
|
|
104
115
|
name: {},
|
|
105
116
|
noDataText: {},
|
|
117
|
+
order: {},
|
|
106
118
|
page: {},
|
|
107
119
|
perPage: {},
|
|
108
120
|
readonly: { type: Boolean },
|
|
121
|
+
reorderable: { type: Boolean },
|
|
122
|
+
resizable: { type: Boolean },
|
|
109
123
|
rowClass: {},
|
|
110
|
-
headerRowClass: {},
|
|
111
|
-
selectAll: { type: Boolean },
|
|
112
124
|
selectable: { type: [Boolean, Function] },
|
|
113
|
-
|
|
114
|
-
expandedItems: {},
|
|
125
|
+
selectAll: { type: Boolean },
|
|
115
126
|
selectAllLabel: {},
|
|
116
127
|
selectText: {},
|
|
128
|
+
sort: {},
|
|
117
129
|
tdClass: {},
|
|
118
130
|
thClass: {},
|
|
119
131
|
totalItems: {},
|
|
120
132
|
totalPages: {},
|
|
121
133
|
unselectedItems: { default: () => [] },
|
|
134
|
+
virtual: { type: Boolean },
|
|
122
135
|
columns: { default: () => [] }
|
|
123
136
|
}, {
|
|
124
137
|
selectAll: {
|
|
@@ -132,6 +145,11 @@ var Oe = {
|
|
|
132
145
|
default: () => []
|
|
133
146
|
},
|
|
134
147
|
sortModifiers: {},
|
|
148
|
+
order: {
|
|
149
|
+
required: !1,
|
|
150
|
+
default: () => []
|
|
151
|
+
},
|
|
152
|
+
orderModifiers: {},
|
|
135
153
|
highlighted: {
|
|
136
154
|
required: !1,
|
|
137
155
|
default: void 0
|
|
@@ -143,7 +161,7 @@ var Oe = {
|
|
|
143
161
|
},
|
|
144
162
|
expandedItemsModifiers: {}
|
|
145
163
|
}),
|
|
146
|
-
emits: /*@__PURE__*/
|
|
164
|
+
emits: /*@__PURE__*/ Ee([
|
|
147
165
|
"click:row",
|
|
148
166
|
"contextmenu:row",
|
|
149
167
|
"dblclick:row",
|
|
@@ -151,6 +169,9 @@ var Oe = {
|
|
|
151
169
|
"update:modelValue",
|
|
152
170
|
"update:selectAll",
|
|
153
171
|
"update:sort",
|
|
172
|
+
"update:order",
|
|
173
|
+
"resize:column",
|
|
174
|
+
"hide:column",
|
|
154
175
|
"update:expandedItems",
|
|
155
176
|
"update:unselectedItems",
|
|
156
177
|
"item:selected",
|
|
@@ -158,32 +179,392 @@ var Oe = {
|
|
|
158
179
|
], [
|
|
159
180
|
"update:selectAll",
|
|
160
181
|
"update:sort",
|
|
182
|
+
"update:order",
|
|
161
183
|
"update:highlighted",
|
|
162
184
|
"update:expandedItems"
|
|
163
185
|
]),
|
|
164
|
-
setup(
|
|
165
|
-
let
|
|
186
|
+
setup(we, { emit: Ee }) {
|
|
187
|
+
let O = Ie(we, "selectAll"), k = Ie(we, "sort"), A = Ie(we, "order"), j = Ie(we, "highlighted"), M = Ie(we, "expandedItems"), N = we, P = Ee, F = Le();
|
|
166
188
|
process.env.NODE_ENV !== "production" && r("BbTable", t("BbTable"));
|
|
167
|
-
let
|
|
189
|
+
let I = C(!!F.actions);
|
|
190
|
+
ke(() => {
|
|
191
|
+
let e = !!F.actions;
|
|
192
|
+
e !== I.value && (I.value = e);
|
|
193
|
+
});
|
|
194
|
+
let { getItemValue: Ut } = f(), Wt = e().id.value;
|
|
168
195
|
N.multiple && !Array.isArray(N.modelValue) && n().throw("BbTable is set for multiple selection but modelValue is not an array.");
|
|
169
|
-
let
|
|
196
|
+
let Gt = ["actions", "select"], Kt = ["prepend", "append"], qt = (e) => Kt.includes(e);
|
|
170
197
|
if (process.env.NODE_ENV !== "production") {
|
|
171
|
-
let e = N.columns.filter((e) =>
|
|
172
|
-
for (let t of e) n().warn(`BbTable: \`{ key: '${String(t.key)}' }\` is a reserved column and must not appear in \`columns\`. ` + (t.key === "actions" ? "
|
|
198
|
+
let e = N.columns.filter((e) => Gt.includes(e.key));
|
|
199
|
+
for (let t of e) n().warn(`BbTable: \`{ key: '${String(t.key)}' }\` is a reserved column and must not appear in \`columns\`. ` + (t.key === "actions" ? "Fill the `#actions` slot instead — the slot creates the column." : "Selection is controlled by the `selectable` prop."));
|
|
200
|
+
for (let e of N.columns) {
|
|
201
|
+
let t = pe(e.key);
|
|
202
|
+
qt(t) && n().warn(`BbTable: column key '${String(e.key)}' normalizes to the slot name '${t}', which collides with the table-wide \`#header:${t}\` slot. That name keeps its table-wide meaning and per-column header slots are unavailable for this column.`);
|
|
203
|
+
}
|
|
173
204
|
}
|
|
174
|
-
let { t:
|
|
205
|
+
let { t: L } = c(), R = C(), Jt = C(), { id: Yt, parentId: Xt, parentNode: Zt, node: Qt, cssVars: $t, parentVar: en, setTracks: tn } = le({
|
|
175
206
|
id: () => N.id,
|
|
176
|
-
container: () =>
|
|
207
|
+
container: () => Jt.value,
|
|
177
208
|
inheritFrom: () => typeof N.inheritColumnWidths == "string" ? N.inheritColumnWidths : void 0
|
|
178
|
-
}),
|
|
179
|
-
let
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
209
|
+
}), nn = h(() => `${Yt.value}__caption`), rn = h(() => `${Yt.value}__header_instructions`), an = h(() => !!(N.reorderable || N.resizable)), on = C(/* @__PURE__ */ new Set()), sn = h(() => {
|
|
210
|
+
let e = new Set(on.value);
|
|
211
|
+
for (let t of N.columns) t.hidden && e.add(String(t.key));
|
|
212
|
+
return e;
|
|
213
|
+
}), cn = h(() => {
|
|
214
|
+
let e = sn.value;
|
|
215
|
+
return e.size ? N.columns.filter((t) => !e.has(String(t.key))) : N.columns;
|
|
216
|
+
}), ln = (e) => {
|
|
217
|
+
if (sn.value.has(e)) return;
|
|
218
|
+
let t = vn(e), n = V.value.indexOf(e), r = !!t && t.contains(document.activeElement) && an.value;
|
|
219
|
+
on.value = /* @__PURE__ */ new Set([...on.value, e]), P("hide:column", e), r && y(() => yn(n));
|
|
220
|
+
};
|
|
221
|
+
D(() => N.columns.map((e) => [String(e.key), !!e.hidden]), (e, t) => {
|
|
222
|
+
if (!t || !on.value.size) return;
|
|
223
|
+
let n = new Map(t), r = on.value, i = e.filter(([e, t]) => n.has(e) && n.get(e) !== t && r.has(e) && !t);
|
|
224
|
+
if (!i.length) return;
|
|
225
|
+
let a = new Set(r);
|
|
226
|
+
for (let [e] of i) a.delete(e);
|
|
227
|
+
on.value = a;
|
|
228
|
+
});
|
|
229
|
+
let un = h(() => N.columns.map((e) => String(e.key))), z = C(null), B = h(() => {
|
|
230
|
+
let e = cn.value, t = z.value ?? A.value;
|
|
231
|
+
if (!t.length) return e;
|
|
232
|
+
let n = ye(e, t);
|
|
233
|
+
return n.every((t, n) => t === e[n]) ? e : n;
|
|
234
|
+
}), V = h(() => B.value.map((e) => String(e.key))), dn = (e, t) => {
|
|
235
|
+
let n = me(A.value, un.value), r = ve(A.value, un.value, e, t, sn.value);
|
|
236
|
+
return xe(r, n) ? null : r;
|
|
237
|
+
}, fn = C("");
|
|
238
|
+
D(() => N.reorderable, () => {
|
|
239
|
+
fn.value = "";
|
|
240
|
+
});
|
|
241
|
+
let pn = (e, t) => {
|
|
242
|
+
let n = B.value, r = n.findIndex((t) => String(t.key) === e);
|
|
243
|
+
r < 0 || r === t || (fn.value = L("table.columnMoved", n[r].label, r + 1, n.length).value);
|
|
244
|
+
}, mn = C(null), hn = h(() => {
|
|
245
|
+
let e = V.value, t = mn.value;
|
|
246
|
+
return t !== null && e.includes(t) ? t : e[0] ?? null;
|
|
247
|
+
}), gn = (e, t) => {
|
|
248
|
+
if (!t.sortable) return;
|
|
249
|
+
let n = e.target;
|
|
250
|
+
if (!(n instanceof Element)) return;
|
|
251
|
+
let r = e.currentTarget;
|
|
252
|
+
if (n.closest(".bb-table-sort")) return;
|
|
253
|
+
let i = n.closest(Ft);
|
|
254
|
+
i && r.contains(i) || window.getSelection()?.toString() || yr(t.key);
|
|
255
|
+
}, _n = (e) => {
|
|
256
|
+
an.value && (mn.value = e);
|
|
257
|
+
}, vn = (e) => R.value?.querySelector(`:scope > .bb-table__head > .bb-table-header-row > [data-column-key="${CSS.escape(e)}"]`) ?? null, yn = (e) => {
|
|
258
|
+
let t = V.value, n = t[Math.max(0, Math.min(t.length - 1, e))];
|
|
259
|
+
n && (mn.value = n, vn(n)?.focus());
|
|
260
|
+
}, bn = async (e, t) => {
|
|
261
|
+
if (!an.value) return;
|
|
262
|
+
let n = e.currentTarget, r = e.target;
|
|
263
|
+
if (!(r instanceof Element) || r !== n && !r.closest(".bb-table-sort")) return;
|
|
264
|
+
let i = getComputedStyle(n).direction === "rtl";
|
|
265
|
+
if (e.altKey && !e.ctrlKey && !e.metaKey) {
|
|
266
|
+
if (!xn.value || e.key !== "ArrowLeft" && e.key !== "ArrowRight") return;
|
|
267
|
+
e.preventDefault();
|
|
268
|
+
let r = e.key === "ArrowRight" !== i, a = H.value[t] ?? n.getBoundingClientRect().width;
|
|
269
|
+
kn({ [t]: a + (r ? 1 : -1) * Et });
|
|
270
|
+
return;
|
|
271
|
+
}
|
|
272
|
+
if (e.ctrlKey || e.metaKey) return;
|
|
273
|
+
let a = V.value, o = a.indexOf(t);
|
|
274
|
+
if (o < 0) return;
|
|
275
|
+
let s;
|
|
276
|
+
switch (e.key) {
|
|
277
|
+
case "ArrowLeft":
|
|
278
|
+
s = i ? o + 1 : o - 1;
|
|
279
|
+
break;
|
|
280
|
+
case "ArrowRight":
|
|
281
|
+
s = i ? o - 1 : o + 1;
|
|
282
|
+
break;
|
|
283
|
+
case "Home":
|
|
284
|
+
s = 0;
|
|
285
|
+
break;
|
|
286
|
+
case "End":
|
|
287
|
+
s = a.length - 1;
|
|
288
|
+
break;
|
|
289
|
+
case "Enter":
|
|
290
|
+
case " ":
|
|
291
|
+
if (r !== n || !B.value[o]?.sortable) return;
|
|
292
|
+
e.preventDefault(), yr(t);
|
|
293
|
+
return;
|
|
294
|
+
default: return;
|
|
295
|
+
}
|
|
296
|
+
if (e.preventDefault(), !e.shiftKey) {
|
|
297
|
+
yn(s);
|
|
298
|
+
return;
|
|
299
|
+
}
|
|
300
|
+
if (!N.reorderable) return;
|
|
301
|
+
let c = dn(t, s);
|
|
302
|
+
c && (fn.value = "", A.value = c, mn.value = t, await y(), vn(t)?.focus(), pn(t, o));
|
|
303
|
+
};
|
|
304
|
+
process.env.NODE_ENV !== "production" && (D(A, (e) => {
|
|
305
|
+
new Set(e).size !== e.length && n().warn("BbTable: `order` lists a key more than once — the first occurrence wins.");
|
|
306
|
+
}, { immediate: !0 }), D(() => N.columns.some((e) => e.snap != null) && (!!N.reorderable || B.value !== N.columns), (e) => {
|
|
307
|
+
e && n().warn("BbTable: `snap` names a PARENT column and the child renders in its own order — it does not compose with `order` / `reorderable` / a `hidden` column on the snapped table itself. Order and hide on the parent (a key-snapped child follows it), or drop the snaps.");
|
|
308
|
+
}, { immediate: !0 }));
|
|
309
|
+
let xn = h(() => !!N.resizable && !J.value), H = C({}), U = C(null), Sn = C(null), Cn = (e) => {
|
|
310
|
+
let t = String(e.key);
|
|
311
|
+
return U.value?.[t] ?? H.value[t] ?? e.width ?? (Y.value ? X.value[t] : void 0);
|
|
312
|
+
}, wn = (e) => {
|
|
313
|
+
let t = String(e.key);
|
|
314
|
+
return U.value?.[t] !== void 0 || t in H.value;
|
|
315
|
+
}, Tn = h(() => Object.keys(U.value ?? {}).join(" ")), En = h(() => /* @__PURE__ */ new Set([...Object.keys(H.value), ...Tn.value.split(" ").filter(Boolean)])), Dn = h(() => {
|
|
316
|
+
let e = /* @__PURE__ */ new Map(), t = En.value, n = Y.value, r = X.value;
|
|
317
|
+
for (let i of B.value) {
|
|
318
|
+
let a = String(i.key), o = n && i.width == null, s = [];
|
|
319
|
+
o && s.push("bb-table-data__cell--nowrap"), t.has(a) && s.push("bb-table-data__cell--resized"), (t.has(a) || o && a in r) && s.push("bb-table-data__cell--clip"), s.length && e.set(a, s.join(" "));
|
|
320
|
+
}
|
|
321
|
+
return e;
|
|
322
|
+
}), On = h(() => U.value !== null || Object.keys(H.value).length > 0), kn = (e) => {
|
|
323
|
+
let t = { ...H.value }, n = [];
|
|
324
|
+
for (let [r, i] of Object.entries(e)) {
|
|
325
|
+
let e = Math.max(Tt, Math.round(i));
|
|
326
|
+
t[r] !== e && (t[r] = e, n.push([r, e]));
|
|
327
|
+
}
|
|
328
|
+
if (n.length) {
|
|
329
|
+
H.value = t;
|
|
330
|
+
for (let [e, t] of n) P("resize:column", e, t);
|
|
331
|
+
}
|
|
332
|
+
}, An = (e) => {
|
|
333
|
+
if (!(e in H.value)) return;
|
|
334
|
+
let { [e]: t, ...n } = H.value;
|
|
335
|
+
H.value = n, P("resize:column", e, null);
|
|
336
|
+
};
|
|
337
|
+
D(() => N.columns.map((e) => [String(e.key), e.width]), (e, t) => {
|
|
338
|
+
if (!t || !Object.keys(H.value).length) return;
|
|
339
|
+
let n = new Map(t), r = H.value, i = e.filter(([e, t]) => n.has(e) && n.get(e) !== t && e in r && t !== r[e]);
|
|
340
|
+
if (!i.length) return;
|
|
341
|
+
let a = { ...r };
|
|
342
|
+
for (let [e] of i) delete a[e];
|
|
343
|
+
H.value = a;
|
|
344
|
+
});
|
|
345
|
+
let W = null, jn = () => {
|
|
346
|
+
document.removeEventListener("pointermove", Nn), document.removeEventListener("pointerup", Pn), document.removeEventListener("pointercancel", Fn), document.removeEventListener("keydown", In, !0), window.removeEventListener("blur", Fn);
|
|
347
|
+
}, Mn = () => {
|
|
348
|
+
if (jn(), W) try {
|
|
349
|
+
W.handle.releasePointerCapture(W.pointerId);
|
|
350
|
+
} catch {}
|
|
351
|
+
document.documentElement.classList.remove(Dt), W = null, U.value = null, Sn.value = null, R.value && (R.value.style.gridTemplateColumns = ai.value);
|
|
352
|
+
}, Nn = (e) => {
|
|
353
|
+
if (!W || e.pointerId !== W.pointerId) return;
|
|
354
|
+
let t = (e.clientX - W.x0) * (W.rtl ? -1 : 1);
|
|
355
|
+
t = Math.max(Tt - W.startWidth, t);
|
|
356
|
+
let { neighbour: n } = W;
|
|
357
|
+
if (e.shiftKey && n) {
|
|
358
|
+
t = Math.min(n.startWidth - Tt, t), U.value = {
|
|
359
|
+
[W.key]: Math.round(W.startWidth + t),
|
|
360
|
+
[n.key]: Math.round(n.startWidth - t)
|
|
361
|
+
};
|
|
362
|
+
return;
|
|
363
|
+
}
|
|
364
|
+
U.value = { [W.key]: Math.round(W.startWidth + t) };
|
|
365
|
+
}, Pn = (e) => {
|
|
366
|
+
if (!W || e.pointerId !== W.pointerId) return;
|
|
367
|
+
let { key: t, startWidth: n, neighbour: r } = W, i = U.value;
|
|
368
|
+
if (Mn(), !i) return;
|
|
369
|
+
let a = {};
|
|
370
|
+
i[t] !== Math.round(n) && (a[t] = i[t]), r && i[r.key] !== void 0 && i[r.key] !== Math.round(r.startWidth) && (a[r.key] = i[r.key]), kn(a);
|
|
371
|
+
}, Fn = (e) => {
|
|
372
|
+
W && (e instanceof PointerEvent && e.pointerId !== W.pointerId || Mn());
|
|
373
|
+
}, In = (e) => {
|
|
374
|
+
!W || e.key !== "Escape" || (e.preventDefault(), e.stopImmediatePropagation(), Mn());
|
|
375
|
+
}, Ln = (e, t) => {
|
|
376
|
+
if (!xn.value || Oi.value || W || !e.isPrimary || e.button !== 0) return;
|
|
377
|
+
let n = vn(t);
|
|
378
|
+
if (!n) return;
|
|
379
|
+
e.preventDefault();
|
|
380
|
+
let r = e.currentTarget;
|
|
381
|
+
try {
|
|
382
|
+
r.setPointerCapture(e.pointerId);
|
|
383
|
+
} catch {}
|
|
384
|
+
document.documentElement.classList.add(Dt);
|
|
385
|
+
let i = V.value, a = i[i.indexOf(t) + 1], o = a ? vn(a) : null;
|
|
386
|
+
W = {
|
|
387
|
+
pointerId: e.pointerId,
|
|
388
|
+
handle: r,
|
|
389
|
+
key: t,
|
|
390
|
+
x0: e.clientX,
|
|
391
|
+
startWidth: n.getBoundingClientRect().width,
|
|
392
|
+
neighbour: a && o ? {
|
|
393
|
+
key: a,
|
|
394
|
+
startWidth: o.getBoundingClientRect().width
|
|
395
|
+
} : null,
|
|
396
|
+
rtl: getComputedStyle(n).direction === "rtl"
|
|
397
|
+
}, Sn.value = t, document.addEventListener("pointermove", Nn), document.addEventListener("pointerup", Pn), document.addEventListener("pointercancel", Fn), document.addEventListener("keydown", In, !0), window.addEventListener("blur", Fn);
|
|
398
|
+
};
|
|
399
|
+
Oe(Mn);
|
|
400
|
+
let G = C("idle"), Rn = C(null), zn = C(""), Bn = C(), Vn = Symbol("bb-table-column-drag"), K = null, Hn = (e) => Math.max(0, Math.min(1, e)), Un = () => {
|
|
401
|
+
let e = Or.value ? Jt.value?.parentElement ?? null : Jt.value ?? null;
|
|
402
|
+
for (; e;) {
|
|
403
|
+
let t = getComputedStyle(e).overflowX;
|
|
404
|
+
if (t === "auto" || t === "scroll") return e;
|
|
405
|
+
e = e.parentElement;
|
|
406
|
+
}
|
|
407
|
+
return null;
|
|
408
|
+
}, Wn = () => {
|
|
409
|
+
let e = K?.scrollport?.getBoundingClientRect(), t = Math.max(e?.left ?? 0, 0), n = Math.min(e?.right ?? window.innerWidth, window.innerWidth);
|
|
410
|
+
return {
|
|
411
|
+
left: t,
|
|
412
|
+
right: Math.max(t + 1, n)
|
|
413
|
+
};
|
|
414
|
+
}, Gn = (e) => Array.from(e.children).filter((e) => e instanceof HTMLElement && e.classList.contains("bb-table-header") && !!e.dataset.columnKey), Kn = () => {
|
|
415
|
+
let e = Bn.value;
|
|
416
|
+
e?.isConnected && !e.matches(":popover-open") && e.showPopover();
|
|
417
|
+
}, qn = () => {
|
|
418
|
+
let e = Bn.value;
|
|
419
|
+
e && e.matches(":popover-open") && e.hidePopover();
|
|
420
|
+
}, Jn = (e, t) => {
|
|
421
|
+
let n = Bn.value;
|
|
422
|
+
n && (n.style.translate = `${e + Pt}px ${t + Pt}px`);
|
|
423
|
+
}, Yn = (e) => {
|
|
424
|
+
if (!K || G.value !== "dragging") return;
|
|
425
|
+
let t = Wn(), n = Math.max(t.left, Math.min(e, t.right - 1)), r = Gn(K.row);
|
|
426
|
+
if (r.length < 2) return;
|
|
427
|
+
let i = (e) => e.style.position === "sticky", a = new Map(r.map((e) => [e, e.getBoundingClientRect()])), o = [...r.filter(i), ...r.filter((e) => !i(e))].filter((e) => e.dataset.columnKey !== K.key), s = V.value, c = s.indexOf(K.key);
|
|
428
|
+
if (c < 0) return;
|
|
429
|
+
let l = Infinity, u = -Infinity;
|
|
430
|
+
for (let e of a.values()) l = Math.min(l, e.left), u = Math.max(u, e.right);
|
|
431
|
+
let d, f;
|
|
432
|
+
if (n < l) d = "\0start", f = K.rtl ? s.length - 1 : 0;
|
|
433
|
+
else if (n >= u) d = "\0end", f = K.rtl ? 0 : s.length - 1;
|
|
434
|
+
else {
|
|
435
|
+
let e = o.find((e) => {
|
|
436
|
+
let t = a.get(e);
|
|
437
|
+
return n >= t.left && n < t.right;
|
|
438
|
+
});
|
|
439
|
+
if (!e) return;
|
|
440
|
+
d = e.dataset.columnKey, f = s.indexOf(d);
|
|
441
|
+
}
|
|
442
|
+
if (f < 0 || f === c) return;
|
|
443
|
+
let p = f > c;
|
|
444
|
+
if (K.target?.key === d && K.target.after === p) return;
|
|
445
|
+
let ee = ve(K.base, un.value, K.key, f, sn.value);
|
|
446
|
+
if (xe(ee, z.value ?? K.base)) {
|
|
447
|
+
K.target = {
|
|
448
|
+
key: d,
|
|
449
|
+
after: p
|
|
450
|
+
};
|
|
451
|
+
return;
|
|
452
|
+
}
|
|
453
|
+
((K.rtl ? !p : p) ? n <= K.lastMoveX + Nt : n >= K.lastMoveX - Nt) || (K.target = {
|
|
454
|
+
key: d,
|
|
455
|
+
after: p
|
|
456
|
+
}, K.lastMoveX = n, z.value = ee);
|
|
457
|
+
}, Xn = () => {
|
|
458
|
+
if (!K || G.value !== "dragging" || !K.scrollDirection) {
|
|
459
|
+
K && (K.raf = void 0);
|
|
460
|
+
return;
|
|
461
|
+
}
|
|
462
|
+
let e = Wn(), t = K.scrollDirection < 0 ? K.lastX - e.left : e.right - K.lastX, n = Math.ceil(Mt * (1 - Hn(t / jt))), r = K.scrollport ?? document.scrollingElement;
|
|
463
|
+
r && (r.scrollLeft += K.scrollDirection * n), Yn(K.lastX), K.raf = requestAnimationFrame(Xn);
|
|
464
|
+
}, Zn = () => {
|
|
465
|
+
if (!K) return;
|
|
466
|
+
let e = Wn(), t = K.lastX - e.left, n = e.right - K.lastX;
|
|
467
|
+
K.scrollDirection = t < jt ? -1 : +(n < jt), K.scrollDirection && K.raf === void 0 && (K.raf = requestAnimationFrame(Xn));
|
|
468
|
+
}, Qn = () => {
|
|
469
|
+
document.removeEventListener("pointermove", nr), document.removeEventListener("pointerup", rr), document.removeEventListener("pointercancel", ir), document.removeEventListener("keydown", or, !0), document.removeEventListener("dragstart", sr), document.removeEventListener("contextmenu", sr, !0), window.removeEventListener("blur", ir), K?.row.removeEventListener("lostpointercapture", ar);
|
|
470
|
+
}, $n = () => {
|
|
471
|
+
if (K) {
|
|
472
|
+
clearTimeout(K.timer), K.raf !== void 0 && cancelAnimationFrame(K.raf), Qn();
|
|
473
|
+
try {
|
|
474
|
+
K.row.hasPointerCapture(K.pointerId) && K.row.releasePointerCapture(K.pointerId);
|
|
475
|
+
} catch {}
|
|
476
|
+
qn(), o(Vn), Rn.value = null, z.value = null, G.value = "idle", K = null;
|
|
477
|
+
}
|
|
478
|
+
}, er = () => {
|
|
479
|
+
K && (K.raf !== void 0 && cancelAnimationFrame(K.raf), K.raf = void 0, K.scrollDirection = 0, qn(), o(Vn), Rn.value = null, z.value = null, G.value = "cancelled");
|
|
480
|
+
}, tr = () => {
|
|
481
|
+
if (!(!K || G.value !== "armed")) {
|
|
482
|
+
clearTimeout(K.timer), K.timer = void 0;
|
|
483
|
+
try {
|
|
484
|
+
K.row.setPointerCapture(K.pointerId);
|
|
485
|
+
} catch {}
|
|
486
|
+
K.row.addEventListener("lostpointercapture", ar), K.base = me(A.value, un.value), K.rtl = getComputedStyle(K.row).direction === "rtl", K.scrollport = Un(), K.lastMoveX = K.x0, K.target = null, z.value = K.base, Rn.value = K.key, zn.value = K.label, G.value = "dragging", a(Vn), Kn(), Jn(K.lastX, K.lastY), Yn(K.lastX), Zn();
|
|
487
|
+
}
|
|
488
|
+
}, nr = (e) => {
|
|
489
|
+
if (!(!K || e.pointerId !== K.pointerId)) {
|
|
490
|
+
if (K.lastX = e.clientX, K.lastY = e.clientY, G.value === "armed") {
|
|
491
|
+
let t = Math.hypot(e.clientX - K.x0, e.clientY - K.y0);
|
|
492
|
+
if (K.pointerType === "touch") {
|
|
493
|
+
t >= kt && $n();
|
|
494
|
+
return;
|
|
495
|
+
}
|
|
496
|
+
if (t < Ot) return;
|
|
497
|
+
tr();
|
|
498
|
+
return;
|
|
499
|
+
}
|
|
500
|
+
G.value === "dragging" && (Jn(e.clientX, e.clientY), Yn(e.clientX), Zn());
|
|
501
|
+
}
|
|
502
|
+
}, rr = (e) => {
|
|
503
|
+
if (!K || e.pointerId !== K.pointerId) return;
|
|
504
|
+
let { key: t } = K, n = K.base ? K.base.filter((e) => un.value.includes(e) && !sn.value.has(e)).indexOf(t) : -1, r = G.value === "dragging" && z.value !== null && !xe(z.value, K.base) ? z.value : null;
|
|
505
|
+
$n(), r && (fn.value = "", A.value = r, y(() => pn(t, n)));
|
|
506
|
+
}, ir = (e) => {
|
|
507
|
+
K && (e instanceof PointerEvent && e.pointerId !== K.pointerId || $n());
|
|
508
|
+
}, ar = () => {
|
|
509
|
+
K && G.value === "dragging" && $n();
|
|
510
|
+
}, or = (e) => {
|
|
511
|
+
!K || G.value !== "dragging" || e.key !== "Escape" || !i(Vn) || (e.preventDefault(), e.stopImmediatePropagation(), er());
|
|
512
|
+
}, sr = (e) => {
|
|
513
|
+
K && G.value !== "idle" && e.preventDefault();
|
|
514
|
+
}, cr = (e) => {
|
|
515
|
+
if (!N.reorderable || Oi.value || F.thead || !e.isPrimary || e.button !== 0 || K || B.value.length < 2) return;
|
|
516
|
+
let t = e.target;
|
|
517
|
+
if (!(t instanceof Element)) return;
|
|
518
|
+
let n = e.currentTarget, r = t.closest(".bb-table-header");
|
|
519
|
+
if (!r || r.parentElement !== n || !r.dataset.columnKey) return;
|
|
520
|
+
let i = t.closest(Ft);
|
|
521
|
+
if (i && r.contains(i)) return;
|
|
522
|
+
let a = r.dataset.columnKey, o = B.value.find((e) => String(e.key) === a);
|
|
523
|
+
o && (K = {
|
|
524
|
+
pointerId: e.pointerId,
|
|
525
|
+
pointerType: e.pointerType,
|
|
526
|
+
key: a,
|
|
527
|
+
label: o.label,
|
|
528
|
+
row: n,
|
|
529
|
+
x0: e.clientX,
|
|
530
|
+
y0: e.clientY,
|
|
531
|
+
lastX: e.clientX,
|
|
532
|
+
lastY: e.clientY,
|
|
533
|
+
lastMoveX: e.clientX,
|
|
534
|
+
rtl: !1,
|
|
535
|
+
base: [],
|
|
536
|
+
scrollport: null,
|
|
537
|
+
target: null,
|
|
538
|
+
timer: void 0,
|
|
539
|
+
raf: void 0,
|
|
540
|
+
scrollDirection: 0
|
|
541
|
+
}, G.value = "armed", document.addEventListener("pointermove", nr), document.addEventListener("pointerup", rr), document.addEventListener("pointercancel", ir), document.addEventListener("keydown", or, !0), document.addEventListener("dragstart", sr), document.addEventListener("contextmenu", sr, !0), window.addEventListener("blur", ir), e.pointerType === "touch" && (K.timer = setTimeout(tr, At)));
|
|
542
|
+
}, lr = (e) => {
|
|
543
|
+
K && (G.value === "dragging" || G.value === "cancelled") && e.cancelable && e.preventDefault();
|
|
544
|
+
};
|
|
545
|
+
Oe($n);
|
|
546
|
+
let { data: ur } = re({ items: h(() => l(j.value) ? [] : [j.value]) }), dr = h(() => j.value !== void 0 || q.highlighted !== void 0), fr = Te(), pr = () => {
|
|
547
|
+
let e = fr?.vnode.props ?? {};
|
|
548
|
+
return "highlighted" in e || "onUpdate:highlighted" in e;
|
|
549
|
+
};
|
|
550
|
+
process.env.NODE_ENV !== "production" && D(() => j.value === void 0 && pr(), (e) => {
|
|
551
|
+
e && n().warn("BbTable: `highlighted` is bound but its value is `undefined`, so the highlight mechanic stays off. Initialise it to `null` — `ref(null)`, not `ref()` — to be considered bound. `undefined` means \"never initialised\" and switches highlight off entirely; `null` means \"initialised and currently empty\".");
|
|
552
|
+
}, { immediate: !0 });
|
|
553
|
+
let mr = !1, hr = () => {
|
|
554
|
+
process.env.NODE_ENV !== "production" && (mr || (mr = !0, n().warn("BbTable: `toggleHighlighted` was called from a slot, but highlight is not connected, so nothing happened. Bind `v-model:highlighted` (initialised to `null`), or seed `highlighted` through `useBbTableContext(id, { highlighted })`, or drop the call — with nothing bound the table has nowhere to put the value.")));
|
|
555
|
+
}, gr = (e, { viaSlot: t = !1 } = {}) => {
|
|
556
|
+
if (!dr.value) {
|
|
557
|
+
t && hr();
|
|
558
|
+
return;
|
|
559
|
+
}
|
|
560
|
+
let n = e.valueHash in ur.value;
|
|
561
|
+
j.value = n ? null : e.value;
|
|
562
|
+
}, _r = (e, t) => {
|
|
563
|
+
e.target instanceof Element && (e.target.closest("a, button, input, label, select, textarea, [contenteditable], [role=\"button\"]") || window.getSelection()?.toString() || gr(t));
|
|
564
|
+
}, vr = (e) => k.value.find(([t]) => t === e)?.[1] ?? null, yr = (e) => {
|
|
565
|
+
let t = vr(e);
|
|
566
|
+
t === null ? k.value = [...k.value, [e, "asc"]] : t === "asc" ? k.value = k.value.map((t) => t[0] === e ? [e, "desc"] : t) : k.value = k.value.filter(([t]) => t !== e);
|
|
567
|
+
}, { state: q, isReady: br } = ee(() => Yt.value, {
|
|
187
568
|
selected: {
|
|
188
569
|
get: () => N.modelValue,
|
|
189
570
|
set: (e) => P("update:modelValue", e)
|
|
@@ -193,378 +574,770 @@ var Oe = {
|
|
|
193
574
|
set: (e) => P("update:unselectedItems", e)
|
|
194
575
|
},
|
|
195
576
|
all: {
|
|
196
|
-
get: () =>
|
|
577
|
+
get: () => O.value,
|
|
197
578
|
set: (e) => {
|
|
198
|
-
|
|
579
|
+
O.value = e;
|
|
199
580
|
}
|
|
200
581
|
},
|
|
201
582
|
sort: {
|
|
202
|
-
get: () =>
|
|
583
|
+
get: () => k.value,
|
|
203
584
|
set: (e) => {
|
|
204
|
-
|
|
585
|
+
k.value = e;
|
|
205
586
|
}
|
|
206
587
|
},
|
|
207
588
|
highlighted: {
|
|
208
|
-
get: () => j.value
|
|
589
|
+
get: () => j.value,
|
|
209
590
|
set: (e) => {
|
|
210
591
|
j.value = e;
|
|
211
592
|
}
|
|
212
593
|
},
|
|
213
|
-
page: { get: () => N.page === void 0 ? void 0 :
|
|
594
|
+
page: { get: () => N.page === void 0 ? N.virtual ? 1 : void 0 : se(N.page, 1) },
|
|
214
595
|
perPage: {
|
|
215
|
-
get: () =>
|
|
596
|
+
get: () => oe(N.perPage),
|
|
216
597
|
infer: () => Array.isArray(N.items) ? N.items.length : void 0
|
|
217
598
|
},
|
|
218
599
|
totalItems: {
|
|
219
|
-
get: () =>
|
|
600
|
+
get: () => oe(N.totalItems),
|
|
220
601
|
infer: () => Array.isArray(N.items) ? N.items.length : void 0
|
|
221
602
|
},
|
|
222
|
-
totalPages: { get: () => N.totalPages === void 0 ? void 0 :
|
|
223
|
-
}),
|
|
603
|
+
totalPages: { get: () => N.totalPages === void 0 ? void 0 : se(N.totalPages, 1) }
|
|
604
|
+
}), xr = h(() => N.columns.some((e) => e.snap != null)), Sr = h(() => !!N.inheritColumnWidths || xr.value), Cr = h(() => N.fixed || xr.value || cn.value.some((e) => e.width != null) || On.value || Sr.value && !!Xt.value), J = h(() => Sr.value && !!Xt.value);
|
|
605
|
+
Re(() => {
|
|
606
|
+
Qt.ordered = !!N.reorderable || A.value.length > 0;
|
|
607
|
+
});
|
|
608
|
+
let Y = h(() => !!N.virtual && !J.value && !F.tbody), X = C({}), wr = C({}), Tr = C(""), Er = h(() => Y.value && !!Tr.value && ni.value.every((e) => !e.contentSized)), Dr = (e) => Y.value && e.width == null && !wn(e) && String(e.key) in X.value, Or = J, kr = (e) => {
|
|
224
609
|
if (typeof e == "number") return `${e}px`;
|
|
225
610
|
let t = e.trim();
|
|
226
611
|
return /^-?\d*\.?\d+$/.test(t) ? `${t}px` : t;
|
|
227
|
-
},
|
|
228
|
-
let e =
|
|
229
|
-
return e ?
|
|
230
|
-
}),
|
|
231
|
-
let
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
}), Tt = h(() => +("select" in (ut.value?.tracks ?? {}))), Et = h(() => Tt.value + Ct.value), Dt = h(() => wt.value.length), Ot = (e) => {
|
|
236
|
-
let t = wt.value[e];
|
|
237
|
-
return t ? ft(t, "0px") : "0px";
|
|
238
|
-
}, kt = (e, t) => {
|
|
239
|
-
if (!R.value || t - e <= 1e-6) return null;
|
|
612
|
+
}, Ar = h(() => Zt.value?.keys ?? []), jr = h(() => +(Ar.value[0] === "select")), Mr = h(() => Ar.value.length), Nr = h(() => {
|
|
613
|
+
let e = Ar.value;
|
|
614
|
+
return e[e.length - 1] === "actions" ? e.length - 1 : e.length;
|
|
615
|
+
}), Pr = (e) => Ar.value.indexOf(e), Fr = (e) => {
|
|
616
|
+
let t = Ar.value[e];
|
|
617
|
+
return t ? en(t, "0px") : "0px";
|
|
618
|
+
}, Ir = (e, t) => {
|
|
619
|
+
if (!Xt.value || t - e <= 1e-6) return null;
|
|
240
620
|
let n = [];
|
|
241
621
|
for (let r = Math.floor(e); r < Math.ceil(t - 1e-6); r++) {
|
|
242
622
|
let i = Math.min(t, r + 1) - Math.max(e, r);
|
|
243
623
|
if (i <= 1e-6) continue;
|
|
244
|
-
let a =
|
|
624
|
+
let a = Fr(r);
|
|
245
625
|
n.push(i >= .999999 ? a : `${Number(i.toFixed(4))} * ${a}`);
|
|
246
626
|
}
|
|
247
627
|
return n.length ? n.length === 1 && !n[0].includes("*") ? n[0] : `calc(${n.join(" + ")})` : null;
|
|
248
|
-
},
|
|
249
|
-
let
|
|
250
|
-
return
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
628
|
+
}, Lr = (e) => {
|
|
629
|
+
let t = /^(.+)\.(\d+)$/.exec(e);
|
|
630
|
+
return t ? {
|
|
631
|
+
key: t[1],
|
|
632
|
+
fraction: Number(`0.${t[2]}`)
|
|
633
|
+
} : {
|
|
634
|
+
key: e,
|
|
635
|
+
fraction: 0
|
|
636
|
+
};
|
|
637
|
+
}, Rr = (e) => {
|
|
638
|
+
if (Array.isArray(e)) {
|
|
639
|
+
let t = Lr(e[0]), n = Lr(e[1]), r = Pr(t.key), i = Pr(n.key);
|
|
640
|
+
if (r < 0 || i < 0) return null;
|
|
641
|
+
let a = r + t.fraction, o = n.fraction > 0 ? i + n.fraction : i + 1;
|
|
642
|
+
return o > a ? {
|
|
643
|
+
start: a,
|
|
644
|
+
end: o,
|
|
645
|
+
explicit: !0
|
|
646
|
+
} : null;
|
|
647
|
+
}
|
|
648
|
+
let t = Lr(e), n = Pr(t.key);
|
|
649
|
+
if (n < 0) {
|
|
650
|
+
let t = Pr(e);
|
|
651
|
+
return t < 0 ? null : {
|
|
652
|
+
start: t,
|
|
653
|
+
end: t + 1,
|
|
654
|
+
explicit: !1
|
|
260
655
|
};
|
|
656
|
+
}
|
|
657
|
+
return {
|
|
658
|
+
start: n,
|
|
659
|
+
end: n + 1,
|
|
660
|
+
explicit: !1
|
|
661
|
+
};
|
|
662
|
+
}, zr = h(() => !!Zt.value?.ordered), Br = h(() => {
|
|
663
|
+
let e = B.value, t = jr.value, n = Nr.value, r = Mr.value, i = zr.value, a = e.map(() => null), o = /* @__PURE__ */ new Set(), s = (e) => {
|
|
664
|
+
for (let t = Math.floor(e.start); t < e.end - 1e-6; t++) o.add(t);
|
|
665
|
+
};
|
|
666
|
+
i || (e.forEach((e, t) => {
|
|
667
|
+
if (e.snap == null) return;
|
|
668
|
+
let n = Rr(e.snap);
|
|
669
|
+
n && (a[t] = {
|
|
670
|
+
...n,
|
|
671
|
+
overflow: !1
|
|
672
|
+
}, s(a[t]));
|
|
673
|
+
}), e.forEach((e, r) => {
|
|
674
|
+
if (a[r] || e.snap != null) return;
|
|
675
|
+
let i = Pr(String(e.key));
|
|
676
|
+
i < t || i >= n || o.has(i) || (a[r] = {
|
|
677
|
+
start: i,
|
|
678
|
+
end: i + 1,
|
|
679
|
+
explicit: !1,
|
|
680
|
+
overflow: !1
|
|
681
|
+
}, o.add(i));
|
|
682
|
+
}));
|
|
683
|
+
let c = 0, l = 0, u = e.map((i, s) => {
|
|
684
|
+
let u = a[s], d;
|
|
685
|
+
if (u && u.start + 1e-6 < c && (a[s] = null, u = null, d = String(i.key)), !u) {
|
|
686
|
+
let i = Math.max(c, t), f = n;
|
|
687
|
+
for (let t = s + 1; t < e.length; t++) {
|
|
688
|
+
let e = a[t];
|
|
689
|
+
e && (f = Math.min(f, e.start));
|
|
690
|
+
}
|
|
691
|
+
let p = Math.max(Math.floor(i), t);
|
|
692
|
+
for (; p < f && o.has(p);) p++;
|
|
693
|
+
if (p < f && p + 1e-6 >= i) o.add(p), u = {
|
|
694
|
+
start: i,
|
|
695
|
+
end: p + 1,
|
|
696
|
+
explicit: !1,
|
|
697
|
+
overflow: !1
|
|
698
|
+
};
|
|
699
|
+
else if (p < f) o.add(p), u = {
|
|
700
|
+
start: i,
|
|
701
|
+
end: p + 1,
|
|
702
|
+
explicit: !1,
|
|
703
|
+
overflow: !1
|
|
704
|
+
};
|
|
705
|
+
else {
|
|
706
|
+
let e = Math.max(r, n) + l++;
|
|
707
|
+
u = {
|
|
708
|
+
start: e,
|
|
709
|
+
end: e + 1,
|
|
710
|
+
explicit: !1,
|
|
711
|
+
overflow: !0
|
|
712
|
+
};
|
|
713
|
+
}
|
|
714
|
+
d && (u.demoted = d);
|
|
715
|
+
}
|
|
716
|
+
return c = Math.max(c, u.end), u;
|
|
261
717
|
});
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
718
|
+
return u.forEach((t, r) => {
|
|
719
|
+
if (t.overflow || t.explicit) return;
|
|
720
|
+
let i = u[r + 1];
|
|
721
|
+
i && !i.overflow && i.start > t.end && (t.end = i.start), r === e.length - 1 && e[r].width == null && (t.end = Math.max(t.end, n));
|
|
722
|
+
}), u;
|
|
723
|
+
}), Vr = (e) => J.value && e.overflow;
|
|
724
|
+
process.env.NODE_ENV !== "production" && (D(() => xr.value && zr.value, (e) => {
|
|
725
|
+
e && n().warn("BbTable: `snap` targets are ignored under a parent that uses `order` / `reorderable` — the parent's columns can move, so the child inherits by position. Keep the parent's order static (no `reorderable`, an empty `order`) to snap by key.");
|
|
726
|
+
}, { immediate: !0 }), D(() => Br.value.find((e) => e.demoted)?.demoted ?? null, (e) => {
|
|
727
|
+
e !== null && n().warn(`BbTable: column '${e}' snaps to a parent column that sits BEFORE the column preceding it — the child's order disagrees with the parent's, so the snap cannot tile and the column flows into the next free parent track instead. Declare the child's columns in the parent's order.`);
|
|
728
|
+
}, { immediate: !0 }));
|
|
729
|
+
let Hr = h(() => Br.value.some(Vr)), Ur = (e) => {
|
|
730
|
+
let t = B.value[e];
|
|
731
|
+
return (t ? Cn(t) : null) == null && !J.value;
|
|
732
|
+
}, Wr = h(() => {
|
|
733
|
+
if (!J.value) return -1;
|
|
734
|
+
let e = B.value;
|
|
735
|
+
for (let t = e.length - 1; t >= 0; t--) {
|
|
736
|
+
let n = e[t];
|
|
737
|
+
if (n.width == null && n.snap == null) return t;
|
|
267
738
|
}
|
|
268
739
|
return -1;
|
|
269
|
-
}),
|
|
270
|
-
let e =
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
actions: null
|
|
282
|
-
}), zt = h(() => {
|
|
283
|
-
let e = (e) => V.value ? ft(e) : "auto", t = (t) => H.value && U[t] ? U[t] : e(t), n = [];
|
|
284
|
-
N.selectable && n.push({
|
|
740
|
+
}), Gr = h(() => {
|
|
741
|
+
let e = Br.value[0];
|
|
742
|
+
return !Sr.value || !Xt.value || !e ? null : Ir(0, e.start);
|
|
743
|
+
}), Kr = h(() => {
|
|
744
|
+
let e = Br.value, t = e[e.length - 1];
|
|
745
|
+
return !Sr.value || !Xt.value || !t || Hr.value ? null : Ir(t.end, Mr.value);
|
|
746
|
+
}), qr = (e) => Qt.tracks[e] ?? null, Jr = (e, t, n) => !Sr.value || !Xt.value ? null : n ? t ? `calc(${e ?? "0px"} - ${t})` : null : e, Yr = h(() => Jr(Gr.value, N.selectable ? qr("select") : null, !!N.selectable)), Xr = h(() => Hr.value ? null : Jr(Kr.value, I.value ? qr("actions") : null, I.value)), Zr = h(() => Yr.value !== null), Qr = h(() => Xr.value !== null), $r = (e, t) => {
|
|
747
|
+
let n = Y.value ? wr.value[t] : null;
|
|
748
|
+
return n == null ? e && ei.value ? `minmax(${e}, max-content)` : "max-content" : `${n}px`;
|
|
749
|
+
}, ei = h(() => Object.keys(Zt.value?.tracks ?? {}).length > 0), ti = (e) => /^(auto|min-content|max-content|fit-content\(.*\)|-?[\d.]+fr)$/.test(e.trim()), ni = h(() => {
|
|
750
|
+
let e = [];
|
|
751
|
+
N.selectable && e.push({
|
|
285
752
|
key: "select",
|
|
286
|
-
width:
|
|
753
|
+
width: $r(Gr.value, "select"),
|
|
754
|
+
contentSized: wr.value.select == null
|
|
287
755
|
});
|
|
288
|
-
let
|
|
289
|
-
return
|
|
290
|
-
let
|
|
291
|
-
if (t
|
|
292
|
-
|
|
293
|
-
key:
|
|
294
|
-
width:
|
|
756
|
+
let t = B.value, n = t.length - 1, r = !J.value && t.length > 0 && t.every((e) => e.width != null);
|
|
757
|
+
return t.forEach((t, i) => {
|
|
758
|
+
let a = String(t.key), o = Cn(t), s = o == null ? null : kr(o), c = Br.value[i], l = null, u = null;
|
|
759
|
+
if (s != null && ti(s) ? u = s : s != null && r && !wn(t) ? u = `minmax(${s}, ${parseFloat(s) || 1}fr)` : s != null && Dr(t) ? u = `minmax(${s}, 1fr)` : s == null ? Ur(i) ? u = N.fixed ? "minmax(0, 1fr)" : "auto" : ei.value ? Vr(c) ? u = "min-content" : (l = Ir(c.start, c.end), l === null && (u = "auto")) : u = "max-content" : l = s, u !== null) {
|
|
760
|
+
e.push({
|
|
761
|
+
key: a,
|
|
762
|
+
width: u,
|
|
763
|
+
contentSized: /^(auto|min-content|max-content)$/.test(u)
|
|
295
764
|
});
|
|
296
765
|
return;
|
|
297
766
|
}
|
|
298
|
-
let
|
|
299
|
-
|
|
300
|
-
let
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
width: l
|
|
767
|
+
let d = [];
|
|
768
|
+
i === 0 && Zr.value && d.push("var(--offset-internal-start, 0px)"), i === n && Qr.value && d.push("var(--offset-internal-end, 0px)");
|
|
769
|
+
let f = d.length ? `calc(${[...d, l].join(" + ")})` : l, p = i === Wr.value && !Hr.value ? `minmax(${f}, 1fr)` : f;
|
|
770
|
+
e.push({
|
|
771
|
+
key: a,
|
|
772
|
+
width: p,
|
|
773
|
+
contentSized: !1
|
|
306
774
|
});
|
|
307
|
-
}),
|
|
775
|
+
}), I.value && e.push({
|
|
308
776
|
key: "actions",
|
|
309
|
-
width:
|
|
310
|
-
|
|
311
|
-
|
|
777
|
+
width: $r(Kr.value, "actions"),
|
|
778
|
+
contentSized: wr.value.actions == null
|
|
779
|
+
}), e;
|
|
780
|
+
}), ri = h(() => {
|
|
781
|
+
let e = B.value, t = [];
|
|
782
|
+
for (let n of ni.value) n.contentSized || e.some((e) => String(e.key) === n.key) && t.push(n.key);
|
|
783
|
+
return t.join(" ");
|
|
784
|
+
}), ii = h(() => new Set(ri.value.split(" ").filter(Boolean))), ai = h(() => ni.value.map((e) => e.width).join(" ")), oi = C(ai.value), si = h(() => `grid-template-columns: ${oi.value}`);
|
|
785
|
+
D(ai, (e) => {
|
|
786
|
+
if (W && R.value) {
|
|
787
|
+
R.value.style.gridTemplateColumns = e;
|
|
788
|
+
return;
|
|
789
|
+
}
|
|
790
|
+
oi.value = e;
|
|
791
|
+
}, { flush: "sync" });
|
|
792
|
+
let ci = h(() => {
|
|
312
793
|
let e = {};
|
|
313
|
-
return
|
|
314
|
-
}),
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
}, Wt = () => {
|
|
327
|
-
let e = I.value;
|
|
328
|
-
if (!e) return;
|
|
329
|
-
let t = [
|
|
330
|
-
"block",
|
|
331
|
-
"flex",
|
|
332
|
-
"grid",
|
|
333
|
-
"flow-root",
|
|
334
|
-
"list-item"
|
|
335
|
-
], n = [
|
|
336
|
-
"BUTTON",
|
|
337
|
-
"INPUT",
|
|
338
|
-
"SELECT",
|
|
339
|
-
"TEXTAREA",
|
|
340
|
-
"IMG",
|
|
341
|
-
"svg",
|
|
342
|
-
"VIDEO",
|
|
343
|
-
"CANVAS"
|
|
344
|
-
], r = (e) => {
|
|
345
|
-
let i = getComputedStyle(e), a = i.display.includes("flex") || i.display.includes("grid"), o = 0, s = 0;
|
|
346
|
-
if (e.querySelectorAll(":scope > *").forEach((e) => {
|
|
347
|
-
let i = getComputedStyle(e);
|
|
348
|
-
if (i.position === "absolute" || i.position === "fixed") return;
|
|
349
|
-
let c = parseFloat(i.marginLeft) + parseFloat(i.marginRight), l = !a && !n.includes(e.tagName) && i.cssFloat === "none" && t.includes(i.display) ? r(e) + parseFloat(i.paddingLeft) + parseFloat(i.paddingRight) + parseFloat(i.borderLeftWidth) + parseFloat(i.borderRightWidth) : e.getBoundingClientRect().width;
|
|
350
|
-
o += l + (c || 0), s += 1;
|
|
351
|
-
}), s === 0) {
|
|
352
|
-
let t = document.createRange();
|
|
353
|
-
return t.selectNodeContents(e), t.getBoundingClientRect().width;
|
|
354
|
-
}
|
|
355
|
-
if (s > 1) {
|
|
356
|
-
let e = parseFloat(i.columnGap);
|
|
357
|
-
e && (o += e * (s - 1));
|
|
794
|
+
return Yr.value && (e["--offset-start"] = Yr.value), Xr.value && (e["--offset-end"] = Xr.value), e;
|
|
795
|
+
}), li = C({}), ui = [
|
|
796
|
+
.62,
|
|
797
|
+
.42,
|
|
798
|
+
.78,
|
|
799
|
+
.52
|
|
800
|
+
], di = (e) => {
|
|
801
|
+
let t = ["transparent 0"], n = 0;
|
|
802
|
+
return e.forEach((e, r) => {
|
|
803
|
+
let i = ui[r % ui.length], a = Math.round((e - It * 2) * i);
|
|
804
|
+
if (a >= Lt) {
|
|
805
|
+
let e = Math.round(n + It);
|
|
806
|
+
t.push(`transparent ${e}px`, `currentColor ${e}px ${e + a}px`, `transparent ${e + a}px`);
|
|
358
807
|
}
|
|
359
|
-
|
|
360
|
-
},
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
}, Kt = C([]), qt = C([]), W = C(0), Jt = C(null), Yt = () => {
|
|
371
|
-
let e = L.value;
|
|
372
|
-
if (!e || !H.value || !N.columns.some((e) => e.width != null) && !Mt.value && Pt.value < 0) return;
|
|
373
|
-
let t = e.offsetWidth, n = +!!N.selectable, r = U.select ? parseFloat(U.select) : 0, i = U.actions ? parseFloat(U.actions) : 0, a = Ht(), o = 0, s = 0;
|
|
374
|
-
N.columns.forEach((e, t) => {
|
|
375
|
-
let r = a[n + t]?.getBoundingClientRect().width ?? 0;
|
|
376
|
-
e.width != null && (o += r), Nt(t) || (s += r);
|
|
808
|
+
n += e;
|
|
809
|
+
}), `linear-gradient(90deg, ${t.join(",")})`;
|
|
810
|
+
}, fi = (e) => {
|
|
811
|
+
if (!Y.value) {
|
|
812
|
+
li.value["--placeholder-bars"] && (li.value = {});
|
|
813
|
+
return;
|
|
814
|
+
}
|
|
815
|
+
let t = e.map((e) => parseFloat(e));
|
|
816
|
+
t.some((e) => !(e >= 0)) || (li.value = {
|
|
817
|
+
...li.value,
|
|
818
|
+
"--placeholder-bars": di(t)
|
|
377
819
|
});
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
`height:${e.offsetHeight}px`,
|
|
387
|
-
"overflow:visible"
|
|
388
|
-
].join(";");
|
|
389
|
-
let l = e.cloneNode(!0);
|
|
390
|
-
l.classList.remove("bb-table--fixed"), l.querySelectorAll(".bb-table-expand__row").forEach((e) => e.remove());
|
|
391
|
-
let u = Array.from(l.querySelectorAll("col"));
|
|
392
|
-
N.columns.forEach((e, t) => {
|
|
393
|
-
if (e.width == null) {
|
|
394
|
-
let e = u[n + t];
|
|
395
|
-
e && (e.style.width = "");
|
|
396
|
-
}
|
|
820
|
+
}, pi = () => {
|
|
821
|
+
if (!Y.value) return;
|
|
822
|
+
let e = Math.round(Aa.value || pa.value);
|
|
823
|
+
if (!(e > 0)) return;
|
|
824
|
+
let t = `${e}px`;
|
|
825
|
+
li.value["--row-h"] !== t && (li.value = {
|
|
826
|
+
...li.value,
|
|
827
|
+
"--row-h": t
|
|
397
828
|
});
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
829
|
+
}, mi = h(() => ({
|
|
830
|
+
...$t.value,
|
|
831
|
+
...ci.value,
|
|
832
|
+
...li.value,
|
|
833
|
+
...N.fixedHeaders || Y.value ? { "--stuck-head-h": `${_i.value}px` } : null,
|
|
834
|
+
...Er.value ? { "--virtual-row-tracks": Tr.value } : null
|
|
835
|
+
})), hi = () => {
|
|
836
|
+
let e = R.value, t = ni.value.length;
|
|
837
|
+
if (!e || !t) return [];
|
|
838
|
+
let n = e.querySelector(":scope > .bb-table__head > .bb-table-header-row"), r = [...n ? [n] : [], ...Array.from(e.querySelectorAll(":scope > .bb-table__head > [role=\"row\"], :scope > .bb-table__body > [role=\"row\"]"))].find((e) => e.children.length >= t);
|
|
839
|
+
return r ? Array.from(r.children) : [];
|
|
840
|
+
}, gi = "", _i = C(0), vi = () => {
|
|
841
|
+
let e = R.value;
|
|
842
|
+
if (!e) return;
|
|
843
|
+
if (N.fixedHeaders || Y.value) {
|
|
844
|
+
let t = e.querySelector(":scope > .bb-table__head"), n = t ? Math.round(t.getBoundingClientRect().height) : 0;
|
|
845
|
+
n !== _i.value && (_i.value = n);
|
|
846
|
+
}
|
|
847
|
+
let t = be(e);
|
|
848
|
+
if (!t) return;
|
|
849
|
+
let n = ni.value.map((e) => e.key);
|
|
850
|
+
if (t.length !== n.length) return;
|
|
851
|
+
let r = t.join(" "), i = `${Ci.value}|${r}`;
|
|
852
|
+
if (i === gi) return;
|
|
853
|
+
gi = i;
|
|
854
|
+
let a = {};
|
|
855
|
+
n.forEach((e, n) => {
|
|
856
|
+
a[e] = t[n];
|
|
404
857
|
});
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
Jt.value = p > 0 ? `${Math.ceil(p)}px` : null;
|
|
419
|
-
}, G = null, Xt, Zt = C(!1), Qt = !1, $t = () => {
|
|
420
|
-
let e = L.value, t = I.value;
|
|
421
|
-
Qt = !!e && !!t && t.getBoundingClientRect().width > e.clientWidth + 1;
|
|
422
|
-
}, en = () => {
|
|
423
|
-
G !== null && clearTimeout(G), G = setTimeout(() => {
|
|
424
|
-
G = null, Yt(), be(() => {
|
|
425
|
-
Zt.value = !1, $t();
|
|
426
|
-
});
|
|
427
|
-
}, 200);
|
|
428
|
-
}, K, tn, nn = () => {
|
|
429
|
-
K && (K.disconnect(), Ht().forEach((e) => K?.observe(e)), Gt());
|
|
858
|
+
let o = V.value, s = o[0], c = o[o.length - 1], l = Yr.value, u = Xr.value;
|
|
859
|
+
l && s && a[s] && (a[s] = `calc(${a[s]} - (${l}))`, !N.selectable && Gr.value && (a.select = Gr.value)), u && c && a[c] && (a[c] = `calc(${a[c]} - (${u}))`, !I.value && Kr.value && (a.actions = Kr.value));
|
|
860
|
+
let d = [
|
|
861
|
+
..."select" in a ? ["select"] : [],
|
|
862
|
+
...o,
|
|
863
|
+
..."actions" in a ? ["actions"] : []
|
|
864
|
+
];
|
|
865
|
+
Ga(t), fi(t), Y.value && (Tr.value = r), yi = t, tn(a, d), vo.value.length && fe(e, vo.value, t);
|
|
866
|
+
}, yi = null, bi, xi = () => {
|
|
867
|
+
if (!bi) return;
|
|
868
|
+
bi.disconnect();
|
|
869
|
+
let e = hi();
|
|
870
|
+
e.forEach((e) => bi?.observe(e)), e.length && vi();
|
|
430
871
|
};
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
}
|
|
442
|
-
let
|
|
872
|
+
Ae(() => {
|
|
873
|
+
bi = new ResizeObserver(vi), xi();
|
|
874
|
+
}), Oe(() => {
|
|
875
|
+
bi?.disconnect();
|
|
876
|
+
});
|
|
877
|
+
let Si = h(() => ni.value.map((e) => e.key).join(" ")), Ci = h(() => V.value.join(" "));
|
|
878
|
+
D([Si, Ci], () => {
|
|
879
|
+
y(xi), requestAnimationFrame(() => {
|
|
880
|
+
R.value && vi();
|
|
881
|
+
});
|
|
882
|
+
}, { flush: "post" });
|
|
883
|
+
let wi = (e, t) => N.accessibleLabel ? N.accessibleLabel(e, t) : [L("table.select").value, ...e.map((e) => e.content)].join(" "), Ti = h(() => N.selectable ? "fieldset" : "div"), Ei = h(() => N.legend || N.caption || L("table.selectableLegend").value), Di = h(() => N.loading || Li.value), Oi = h(() => Di.value && !N.interactiveWhileLoading), ki = h(() => br.value && !l(q.page) && !l(q.perPage) && !l(q.totalItems) && q.page >= 1 && q.perPage > 0 && q.totalItems >= 0), Ai = h(() => ({
|
|
443
884
|
"bb-table": !0,
|
|
444
885
|
[`bb-table--align-${N.align}`]: !0,
|
|
445
886
|
"bb-table--compact": N.compact,
|
|
446
|
-
"bb-table--
|
|
447
|
-
"bb-table--
|
|
448
|
-
"bb-table--fixed
|
|
449
|
-
"bb-table--
|
|
450
|
-
"bb-table--
|
|
887
|
+
"bb-table--reorderable": !!N.reorderable,
|
|
888
|
+
"bb-table--resizable": xn.value,
|
|
889
|
+
"bb-table--fixed": Cr.value,
|
|
890
|
+
"bb-table--inherit-widths": Or.value,
|
|
891
|
+
"bb-table--fixed-header": N.fixedHeaders || Y.value,
|
|
892
|
+
"bb-table--virtual": Y.value,
|
|
893
|
+
"bb-table--virtual-flat": Er.value,
|
|
894
|
+
"bb-table--loading": Di.value,
|
|
895
|
+
"bb-table--empty": !Z.value.length,
|
|
451
896
|
"bb-table--selectable": !!N.selectable,
|
|
452
|
-
"bb-table--measuring": Zt.value,
|
|
453
897
|
"scrollbar-border": !0
|
|
454
|
-
})),
|
|
898
|
+
})), ji = h(() => cn.value.length + Number(!!N.selectable) + Number(I.value)), Mi = h(() => Object.fromEntries(N.columns.map((e) => [e.key, pe(e.key)]))), { getter: Ni, clientReproducible: Pi, hydratedFromSsr: Fi, items: Ii, loading: Li } = d({ items: Fe(N, "items") }), { hasPrefilled: Ri } = ae({
|
|
899
|
+
alreadyLoaded: Fi,
|
|
900
|
+
clientReproducible: Pi,
|
|
455
901
|
trigger: !0,
|
|
456
902
|
fn: async (e) => {
|
|
457
|
-
await
|
|
903
|
+
await Ni(e, q.selected), Ui();
|
|
458
904
|
}
|
|
459
|
-
}), { data:
|
|
460
|
-
disabled:
|
|
461
|
-
items:
|
|
905
|
+
}), { data: zi } = re({ items: h(() => q.selected) }), { options: Z, baseOptions: Bi } = ie({
|
|
906
|
+
disabled: Fe(N, "disabled"),
|
|
907
|
+
items: Ii,
|
|
462
908
|
itemText: void 0,
|
|
463
909
|
itemValue: N.itemValue,
|
|
464
910
|
max: N.max,
|
|
465
911
|
selectable: !0,
|
|
466
|
-
selectedIndexedByHash:
|
|
467
|
-
}),
|
|
468
|
-
N.multiple ?
|
|
469
|
-
},
|
|
912
|
+
selectedIndexedByHash: zi
|
|
913
|
+
}), Vi = async (e) => {
|
|
914
|
+
N.multiple ? q.selected = (q.selected ?? []).concat(e.value) : q.selected = e.value;
|
|
915
|
+
}, Hi = async (e) => {
|
|
470
916
|
if (N.multiple) {
|
|
471
|
-
let t = { ...
|
|
472
|
-
delete t[e.valueHash],
|
|
473
|
-
} else
|
|
917
|
+
let t = { ...zi.value };
|
|
918
|
+
delete t[e.valueHash], q.selected = Object.values(t);
|
|
919
|
+
} else q.selected = null;
|
|
474
920
|
};
|
|
475
|
-
|
|
921
|
+
p(() => [
|
|
476
922
|
N.dependencies,
|
|
477
923
|
N.items,
|
|
478
|
-
typeof N.items == "function" ? [
|
|
924
|
+
typeof N.items == "function" ? [q.page, q.perPage] : void 0
|
|
479
925
|
], async () => {
|
|
480
|
-
|
|
926
|
+
Ri.value && (await Ni(!0, q.selected), Ui());
|
|
481
927
|
}, { debounce: N.depsDebounceTime });
|
|
482
|
-
let
|
|
928
|
+
let Ui = () => {
|
|
483
929
|
if (!N.enforceCoherence) return;
|
|
484
|
-
let e = new Set(
|
|
930
|
+
let e = new Set(Z.value.map((e) => e.valueHash)), t = (t) => e.has(u(t));
|
|
485
931
|
if (N.multiple) {
|
|
486
|
-
let e =
|
|
487
|
-
e.every(t) || (
|
|
488
|
-
} else !
|
|
489
|
-
let n =
|
|
490
|
-
n.every(t) || (
|
|
491
|
-
},
|
|
492
|
-
let n =
|
|
493
|
-
return e.formatter && (!
|
|
932
|
+
let e = q.selected ?? [];
|
|
933
|
+
e.every(t) || (q.selected = e.filter(t));
|
|
934
|
+
} else !l(q.selected) && !t(q.selected) && (q.selected = null);
|
|
935
|
+
let n = q.unselected ?? [];
|
|
936
|
+
n.every(t) || (q.unselected = n.filter(t)), !l(j.value) && !t(j.value) && (j.value = null), M.value.every(t) || (M.value = M.value.filter(t));
|
|
937
|
+
}, Wi = (e, t) => {
|
|
938
|
+
let n = Mi.value[e.key], r = e.align ?? "left", i = Ut(t.item, e.key);
|
|
939
|
+
return e.formatter && (!l(i) || e.formatOnNull !== !1) && (i = e.formatter(i, e.key, t.item)), e.placeholder && l(i) && (i = e.placeholder), {
|
|
494
940
|
align: r,
|
|
495
|
-
classes
|
|
941
|
+
get classes() {
|
|
942
|
+
return he([`bb-table-data__cell--${r}`], N.tdClass, e.tdClass, i, e.key, t.item);
|
|
943
|
+
},
|
|
496
944
|
content: i,
|
|
497
945
|
key: e.key,
|
|
498
946
|
label: e.label,
|
|
499
947
|
slotName: n
|
|
500
948
|
};
|
|
501
|
-
},
|
|
502
|
-
let t = e.align ?? "left", n =
|
|
949
|
+
}, Gi = h(() => B.value.map((e) => {
|
|
950
|
+
let t = e.align ?? "left", n = Mi.value[e.key], r = qt(n) ? `header:${n} (shadowed)` : `header:${n}`, i = vr(e.key), a = i ?? e.sorted, o = a ? a === "asc" ? "ascending" : "descending" : void 0;
|
|
503
951
|
return {
|
|
504
952
|
align: t,
|
|
505
953
|
key: e.key,
|
|
506
954
|
label: e.label,
|
|
507
|
-
slotName:
|
|
508
|
-
classes:
|
|
955
|
+
slotName: r,
|
|
956
|
+
classes: ge([`bb-table-header--${t}`], N.thClass, e.thClass),
|
|
509
957
|
sortable: !!e.sortable,
|
|
510
|
-
sortDirection:
|
|
511
|
-
sortOrder:
|
|
958
|
+
sortDirection: o,
|
|
959
|
+
sortOrder: i
|
|
512
960
|
};
|
|
513
|
-
})),
|
|
514
|
-
let n =
|
|
515
|
-
return n
|
|
516
|
-
},
|
|
517
|
-
|
|
961
|
+
})), Ki = (e, t) => {
|
|
962
|
+
let n = Mi.value[e];
|
|
963
|
+
return (qt(n) ? void 0 : F[`header:${n}:${t}`]) ?? F[`header:${t}`];
|
|
964
|
+
}, qi = (e) => ({
|
|
965
|
+
classes: e.classes,
|
|
966
|
+
columnKey: e.key,
|
|
967
|
+
items: Ii.value,
|
|
968
|
+
label: e.label,
|
|
969
|
+
sortable: e.sortable,
|
|
970
|
+
sortOrder: e.sortOrder,
|
|
971
|
+
toggleSort: () => yr(e.key),
|
|
972
|
+
hideColumn: () => ln(e.key)
|
|
973
|
+
}), Ji = (e, t) => {
|
|
974
|
+
let n = Z.value[e];
|
|
975
|
+
return n && n.valueHash === t ? n : Z.value.find((e) => e.valueHash === t);
|
|
976
|
+
}, Yi = (e) => {
|
|
977
|
+
let t = Bi.value[e], n = B.value.map((e) => Wi(e, t));
|
|
518
978
|
return {
|
|
519
|
-
accessibleLabel:
|
|
979
|
+
accessibleLabel: wi(n, t.item),
|
|
520
980
|
cols: n,
|
|
521
|
-
rowClasses
|
|
981
|
+
get rowClasses() {
|
|
982
|
+
return _e(N.rowClass, B.value, n, t.item);
|
|
983
|
+
},
|
|
522
984
|
onRowClick: (n) => {
|
|
523
|
-
let r =
|
|
524
|
-
r && (
|
|
985
|
+
let r = Ji(e, t.valueHash);
|
|
986
|
+
r && (_r(n, r), P("click:row", n, r.item));
|
|
525
987
|
},
|
|
526
988
|
onRowContextMenu: (n) => {
|
|
527
|
-
let r =
|
|
528
|
-
r && P("contextmenu:row", n, r
|
|
989
|
+
let r = Ji(e, t.valueHash);
|
|
990
|
+
r && P("contextmenu:row", n, r.item);
|
|
529
991
|
},
|
|
530
992
|
onRowDblClick: (n) => {
|
|
531
|
-
let r =
|
|
532
|
-
r && P("dblclick:row", n, r
|
|
993
|
+
let r = Ji(e, t.valueHash);
|
|
994
|
+
r && P("dblclick:row", n, r.item);
|
|
995
|
+
},
|
|
996
|
+
item: t.item,
|
|
997
|
+
get text() {
|
|
998
|
+
return t.text;
|
|
533
999
|
},
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
valueHash: e.valueHash,
|
|
537
|
-
value: e.value
|
|
1000
|
+
valueHash: t.valueHash,
|
|
1001
|
+
value: t.value
|
|
538
1002
|
};
|
|
539
|
-
}
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
1003
|
+
}, Xi = h(() => {
|
|
1004
|
+
Bi.value, Mi.value, N.tdClass, N.rowClass, N.accessibleLabel;
|
|
1005
|
+
for (let e of B.value) e.align, e.formatOnNull, e.formatter, e.key, e.label, e.placeholder, e.tdClass;
|
|
1006
|
+
return /* @__PURE__ */ new Map();
|
|
1007
|
+
}), Zi = (e) => {
|
|
1008
|
+
if (!(!Y.value || e.size <= Rt)) {
|
|
1009
|
+
for (let t of e.keys()) if (e.delete(t), e.size <= Rt) break;
|
|
1010
|
+
}
|
|
1011
|
+
}, Qi = (e) => {
|
|
1012
|
+
let t = Xi.value, n = t.get(e);
|
|
1013
|
+
if (n) return n;
|
|
1014
|
+
let r = Yi(e);
|
|
1015
|
+
return t.set(e, r), Zi(t), r;
|
|
1016
|
+
}, $i = h(() => (Xi.value, Q.value, Z.value, ur.value, N.selectable, /* @__PURE__ */ new Map())), ea = (e) => {
|
|
1017
|
+
let t = $i.value, n = t.get(e.index);
|
|
1018
|
+
if (n) return n;
|
|
1019
|
+
let r = Qi(e.index), i = Z.value[e.index], a = !N.selectable || typeof N.selectable == "function" && !N.selectable(r.item) || !!i.disabled, o = {
|
|
1020
|
+
accessibleLabel: r.accessibleLabel,
|
|
1021
|
+
cols: r.cols,
|
|
1022
|
+
item: r.item,
|
|
1023
|
+
onRowClick: r.onRowClick,
|
|
1024
|
+
onRowContextMenu: r.onRowContextMenu,
|
|
1025
|
+
onRowDblClick: r.onRowDblClick,
|
|
1026
|
+
get rowClasses() {
|
|
1027
|
+
return r.rowClasses;
|
|
1028
|
+
},
|
|
1029
|
+
get text() {
|
|
1030
|
+
return r.text;
|
|
1031
|
+
},
|
|
1032
|
+
value: r.value,
|
|
1033
|
+
valueHash: r.valueHash,
|
|
1034
|
+
expanded: e.expanded,
|
|
1035
|
+
highlighted: r.valueHash in ur.value,
|
|
1036
|
+
rowIndex: e.rowIndex,
|
|
1037
|
+
selected: i.selected,
|
|
1038
|
+
disabled: a,
|
|
1039
|
+
expandProps: {},
|
|
1040
|
+
toggleExpanded: () => ro(r.valueHash),
|
|
1041
|
+
toggleHighlighted: () => gr(r, { viaSlot: !0 }),
|
|
1042
|
+
toggleSelected: () => uo(o)
|
|
1043
|
+
};
|
|
1044
|
+
return o.expandProps = no(o), t.set(e.index, o), Zi(t), o;
|
|
1045
|
+
}, ta = C(0);
|
|
1046
|
+
D(() => Bi.value.length, (e) => {
|
|
1047
|
+
ta.value = te(ta.value, 0, Math.max(0, e - 1));
|
|
1048
|
+
});
|
|
1049
|
+
let na = () => R.value?.querySelectorAll(":scope > .bb-table__body > .bb-table-data__row"), ra = (e) => {
|
|
1050
|
+
let t = na();
|
|
1051
|
+
if (t) {
|
|
1052
|
+
if (!Y.value) return t[e];
|
|
1053
|
+
for (let n of t) if (Q.value[Number(n.dataset.index)]?.index === e) return n;
|
|
1054
|
+
}
|
|
1055
|
+
}, ia = () => new Promise((e) => requestAnimationFrame(() => e())), aa = async (e) => {
|
|
1056
|
+
ta.value = e;
|
|
1057
|
+
let t = ra(e);
|
|
1058
|
+
if (Y.value && !t) {
|
|
1059
|
+
let n = Q.value.findIndex((t) => t.kind === "row" && t.index === e);
|
|
1060
|
+
if (n >= 0) {
|
|
1061
|
+
Ca++, Oa();
|
|
1062
|
+
try {
|
|
1063
|
+
for (let r = 0; r < 8 && !t; r++) Ha.value.scrollToIndex(n, { align: "auto" }), await ia(), await y(), t = ra(e);
|
|
1064
|
+
} finally {
|
|
1065
|
+
Ca--;
|
|
1066
|
+
}
|
|
1067
|
+
}
|
|
1068
|
+
}
|
|
1069
|
+
if (t?.focus(), t?.scrollIntoView({ block: "nearest" }), t && Y.value) for (let e = 0; e < 4; e++) {
|
|
1070
|
+
let e = t.getBoundingClientRect().top;
|
|
1071
|
+
if (await ia(), t.scrollIntoView({ block: "nearest" }), Math.abs(t.getBoundingClientRect().top - e) < .5) break;
|
|
1072
|
+
}
|
|
1073
|
+
}, oa = (e) => {
|
|
1074
|
+
N.keyboardNavigation && (ta.value = e);
|
|
1075
|
+
}, Q = h(() => {
|
|
1076
|
+
let e = [], t = 0, n = ((q.page ?? 0) - 1) * (q.perPage ?? 0);
|
|
1077
|
+
return Bi.value.forEach((r, i) => {
|
|
1078
|
+
let a = r.valueHash in eo.value, o = n + 1 + i + 1 + t;
|
|
1079
|
+
e.push({
|
|
1080
|
+
kind: "row",
|
|
1081
|
+
index: i,
|
|
1082
|
+
key: `r:${r.valueHash}`,
|
|
1083
|
+
virtualIndex: e.length,
|
|
1084
|
+
expanded: a,
|
|
1085
|
+
rowIndex: o
|
|
1086
|
+
}), a && (t++, e.push({
|
|
1087
|
+
kind: "expand",
|
|
1088
|
+
index: i,
|
|
1089
|
+
key: `x:${r.valueHash}`,
|
|
1090
|
+
virtualIndex: e.length,
|
|
1091
|
+
expanded: a,
|
|
1092
|
+
rowIndex: o
|
|
1093
|
+
}));
|
|
1094
|
+
}), e;
|
|
1095
|
+
}), sa = (e, t, n, r) => {
|
|
1096
|
+
let i;
|
|
1097
|
+
return {
|
|
1098
|
+
kind: t,
|
|
1099
|
+
index: e.index,
|
|
1100
|
+
key: n,
|
|
1101
|
+
virtualIndex: e.virtualIndex,
|
|
1102
|
+
height: r,
|
|
1103
|
+
get item() {
|
|
1104
|
+
return i ??= ea(e);
|
|
1105
|
+
}
|
|
1106
|
+
};
|
|
1107
|
+
}, ca = Pe(null), la = C(0), ua = C(null), da = (e) => /^(auto|scroll)$/.test(getComputedStyle(e).overflowY), fa = () => {
|
|
1108
|
+
let e = Jt.value, t = ua.value, n = R.value;
|
|
1109
|
+
if (!Y.value || !e || !t || !n) {
|
|
1110
|
+
ca.value = null;
|
|
1111
|
+
return;
|
|
1112
|
+
}
|
|
1113
|
+
let r = e.getBoundingClientRect(), i = n.getBoundingClientRect().bottom - r.top, a = getComputedStyle(e).maxHeight !== "none" || e.scrollHeight > e.clientHeight + 1 || e.clientHeight > i + 1, o = window;
|
|
1114
|
+
if (a) o = e;
|
|
1115
|
+
else {
|
|
1116
|
+
let t = e.parentElement;
|
|
1117
|
+
for (; t && t !== document.body && t !== document.documentElement;) {
|
|
1118
|
+
if (da(t)) {
|
|
1119
|
+
o = t;
|
|
1120
|
+
break;
|
|
1121
|
+
}
|
|
1122
|
+
t = t.parentElement;
|
|
1123
|
+
}
|
|
1124
|
+
}
|
|
1125
|
+
let s = t.getBoundingClientRect().top, c = o === window ? s + window.scrollY : s - o.getBoundingClientRect().top + o.scrollTop;
|
|
1126
|
+
la.value !== c && (la.value = c), ca.value !== o && (ca.value = o);
|
|
1127
|
+
}, pa = C(37), ma = () => {
|
|
1128
|
+
let e = Jt.value;
|
|
1129
|
+
if (!e) return;
|
|
1130
|
+
let t = parseFloat(getComputedStyle(e).getPropertyValue("--cell-h"));
|
|
1131
|
+
t > 0 && (pa.value = t + 1);
|
|
1132
|
+
}, ha = C(null), ga = (e) => {
|
|
1133
|
+
if (!Y.value || !ua.value) return;
|
|
1134
|
+
let t = e.target;
|
|
1135
|
+
for (; t && t.parentElement !== ua.value;) t = t.parentElement;
|
|
1136
|
+
let n = Number(t?.dataset.index);
|
|
1137
|
+
ha.value = Number.isInteger(n) ? n : null;
|
|
1138
|
+
}, _a = (e) => {
|
|
1139
|
+
if (!Y.value) return;
|
|
1140
|
+
let t = e.relatedTarget;
|
|
1141
|
+
(!t || !ua.value?.contains(t)) && (ha.value = null);
|
|
1142
|
+
}, va = C(0), ya = 0, ba = C(!1), xa, Sa = {
|
|
1143
|
+
offset: 0,
|
|
1144
|
+
time: 0
|
|
1145
|
+
}, Ca = 0, wa = /* @__PURE__ */ new Set(), Ta = null, Ea = 0, Da = (e) => {
|
|
1146
|
+
Ea = Ea ? Ea * .7 + e * .3 : e;
|
|
1147
|
+
}, Oa = () => {
|
|
1148
|
+
clearTimeout(xa), xa = void 0, ba.value && (ba.value = !1, Ia());
|
|
1149
|
+
}, ka = (e) => {
|
|
1150
|
+
let t = performance.now(), n = t - Sa.time, r = e - Sa.offset;
|
|
1151
|
+
if (Sa = {
|
|
1152
|
+
offset: e,
|
|
1153
|
+
time: t
|
|
1154
|
+
}, Ca > 0) return;
|
|
1155
|
+
let i = Ta;
|
|
1156
|
+
if (n > 0 && n < 250 && i && Ea) {
|
|
1157
|
+
let e = $?.scrollRect?.height ?? 0, t = (i.end - i.start + e) / 2;
|
|
1158
|
+
Math.abs(r) / n * Ea > t && (ba.value = !0);
|
|
1159
|
+
}
|
|
1160
|
+
clearTimeout(xa), xa = setTimeout(Oa, Vt);
|
|
1161
|
+
}, Aa = C(0), ja = -1, Ma = !1, Na = () => {
|
|
1162
|
+
let e = $?.itemSizeCache;
|
|
1163
|
+
if (!e?.size || e.size === ja) return;
|
|
1164
|
+
ja = e.size;
|
|
1165
|
+
let t = /* @__PURE__ */ new Map(), n = 0;
|
|
1166
|
+
for (let [r, i] of e) {
|
|
1167
|
+
if (typeof r != "string" || !r.startsWith("r:")) continue;
|
|
1168
|
+
let e = Math.round(i);
|
|
1169
|
+
t.set(e, (t.get(e) ?? 0) + 1), n++;
|
|
1170
|
+
}
|
|
1171
|
+
if (n >= 5) {
|
|
1172
|
+
let e = 0, r = -1;
|
|
1173
|
+
for (let [n, i] of t) (i > r || i === r && n < e) && (r = i, e = n);
|
|
1174
|
+
e > 0 && !Ma && (Aa.value = e, n >= 20 && (Ma = !0));
|
|
1175
|
+
}
|
|
1176
|
+
pi();
|
|
1177
|
+
}, $ = null, Pa = !1;
|
|
1178
|
+
D(Y, (e) => {
|
|
1179
|
+
Pa = e;
|
|
1180
|
+
}, { immediate: !0 });
|
|
1181
|
+
let Fa = Pe([]), Ia = (e = !1) => {
|
|
1182
|
+
if (ya &&= (cancelAnimationFrame(ya), 0), !$) return;
|
|
1183
|
+
let t = Y.value ? $.getVirtualItems() : [];
|
|
1184
|
+
va.value = $.getTotalSize();
|
|
1185
|
+
let n = [], r = null;
|
|
1186
|
+
if (t.length) {
|
|
1187
|
+
let e = $.measurementsCache, i = Q.value.length, a = $.range, o = a ? a.startIndex : t[0].index, s = a ? a.endIndex : t[t.length - 1].index;
|
|
1188
|
+
for (let e of t) n.push({
|
|
1189
|
+
index: e.index,
|
|
1190
|
+
start: e.start,
|
|
1191
|
+
end: e.end,
|
|
1192
|
+
size: e.size
|
|
1193
|
+
});
|
|
1194
|
+
let c = e?.[Math.max(0, o - Bt)], l = e?.[Math.min(i - 1, s + Bt)] ?? c;
|
|
1195
|
+
c && l && (r = {
|
|
1196
|
+
start: c.start,
|
|
1197
|
+
end: l.end
|
|
1198
|
+
});
|
|
1199
|
+
}
|
|
1200
|
+
let i = !La || !r || La.start !== r.start || La.end !== r.end;
|
|
1201
|
+
if (La = r, Fa.value = n, !r) return;
|
|
1202
|
+
if (!e || !i) {
|
|
1203
|
+
Ta = r;
|
|
1204
|
+
return;
|
|
1205
|
+
}
|
|
1206
|
+
let a = performance.now(), o = r;
|
|
1207
|
+
y(() => {
|
|
1208
|
+
Da(performance.now() - a), Ta = o;
|
|
1209
|
+
});
|
|
1210
|
+
}, La = null, Ra = () => {
|
|
1211
|
+
ya ||= requestAnimationFrame(() => {
|
|
1212
|
+
ya = 0, Na(), Ia();
|
|
1213
|
+
});
|
|
1214
|
+
}, za = (e, t) => {
|
|
1215
|
+
t ? (ka(e.getScrollOffset()), Ia(!0)) : Ra();
|
|
1216
|
+
}, Ba = (e) => Q.value[e]?.key ?? e, Va = (e) => (Q.value[e]?.kind === "expand" ? 3 : 1) * (Aa.value || pa.value), Ha = qe(h(() => {
|
|
1217
|
+
let e = ca.value, t = e === window, n = ha.value;
|
|
1218
|
+
return {
|
|
1219
|
+
onChange: za,
|
|
1220
|
+
count: Y.value ? Q.value.length : 0,
|
|
1221
|
+
enabled: Y.value,
|
|
1222
|
+
getScrollElement: () => e,
|
|
1223
|
+
estimateSize: Va,
|
|
1224
|
+
getItemKey: Ba,
|
|
1225
|
+
overscan: Bt,
|
|
1226
|
+
scrollMargin: la.value,
|
|
1227
|
+
initialRect: {
|
|
1228
|
+
width: 0,
|
|
1229
|
+
height: 800
|
|
1230
|
+
},
|
|
1231
|
+
rangeExtractor: (e) => {
|
|
1232
|
+
let t = Ve(e.endIndex - e.startIndex > zt ? {
|
|
1233
|
+
...e,
|
|
1234
|
+
endIndex: e.startIndex + zt
|
|
1235
|
+
} : e);
|
|
1236
|
+
return n == null || n >= e.count || t.includes(n) ? t : [...t, n].sort((e, t) => e - t);
|
|
1237
|
+
},
|
|
1238
|
+
observeElementRect: t ? Ke : We,
|
|
1239
|
+
observeElementOffset: t ? Ge : Ue,
|
|
1240
|
+
scrollToFn: t ? Je : He
|
|
1241
|
+
};
|
|
1242
|
+
}));
|
|
1243
|
+
$ = Ha.value, Ia();
|
|
1244
|
+
let Ua = (e) => {
|
|
1245
|
+
Pa && $?.measureElement(e);
|
|
1246
|
+
}, Wa = h(() => {
|
|
1247
|
+
let e = Q.value;
|
|
1248
|
+
if ($i.value, !Y.value) return e.map((e) => sa(e, e.kind, e.key, 0));
|
|
1249
|
+
let t = Fa.value;
|
|
1250
|
+
if (!t.length) return [];
|
|
1251
|
+
let n = [], r = la.value, i = ba.value, a = r, o;
|
|
1252
|
+
for (let r of t) {
|
|
1253
|
+
let t = e[r.index];
|
|
1254
|
+
if (!t) continue;
|
|
1255
|
+
let s = r.start - a;
|
|
1256
|
+
s > .5 && n.push(sa(t, "spacer", `s:${t.key}`, s)), i && t.kind === "row" && !wa.has(t.key) ? n.push(sa(t, "placeholder", `p:${t.key}`, r.size)) : n.push(sa(t, t.kind, t.key, 0)), a = r.end, o = t;
|
|
1257
|
+
}
|
|
1258
|
+
let s = va.value - (a - r);
|
|
1259
|
+
return s > .5 && o && n.push(sa(o, "spacer", "s:end", s)), n;
|
|
1260
|
+
});
|
|
1261
|
+
D(Wa, (e) => {
|
|
1262
|
+
if (Y.value) for (let t of e) (t.kind === "row" || t.kind === "expand") && wa.add(t.key);
|
|
1263
|
+
}, { flush: "post" });
|
|
1264
|
+
let Ga = (e) => {
|
|
1265
|
+
let t = R.value;
|
|
1266
|
+
if (!Y.value || !t || !t.querySelector(":scope > .bb-table__body > .bb-table-data__row")) return;
|
|
1267
|
+
let n = B.value, r = null, i = null;
|
|
1268
|
+
if (ni.value.forEach((t, a) => {
|
|
1269
|
+
if (t.key === "select" || t.key === "actions") {
|
|
1270
|
+
if (t.key in wr.value) return;
|
|
1271
|
+
let n = parseFloat(e[a]);
|
|
1272
|
+
if (!(n > 0)) return;
|
|
1273
|
+
(i ??= { ...wr.value })[t.key] = n;
|
|
1274
|
+
return;
|
|
1275
|
+
}
|
|
1276
|
+
let o = n.find((e) => String(e.key) === t.key);
|
|
1277
|
+
if (!o || o.width != null) return;
|
|
1278
|
+
let s = String(o.key);
|
|
1279
|
+
if (s in X.value || s in (r ?? {})) return;
|
|
1280
|
+
let c = parseFloat(e[a]);
|
|
1281
|
+
c > 0 && ((r ??= { ...X.value })[s] = c);
|
|
1282
|
+
}), !r && !i || Ka) return;
|
|
1283
|
+
let a = r, o = i;
|
|
1284
|
+
Ka = requestAnimationFrame(() => {
|
|
1285
|
+
Ka = 0, a && (X.value = {
|
|
1286
|
+
...X.value,
|
|
1287
|
+
...a
|
|
1288
|
+
}), o && (wr.value = {
|
|
1289
|
+
...wr.value,
|
|
1290
|
+
...o
|
|
1291
|
+
});
|
|
1292
|
+
});
|
|
1293
|
+
}, Ka = 0;
|
|
1294
|
+
D(() => [Y.value, Z.value.length === 0], ([e, t]) => {
|
|
1295
|
+
(!e || t) && (X.value = {}, wr.value = {}, Tr.value = "");
|
|
1296
|
+
}), D(pa, () => {
|
|
1297
|
+
Y.value && Ha.value.measure();
|
|
1298
|
+
});
|
|
1299
|
+
let qa, Ja, Ya = () => {
|
|
1300
|
+
qa?.disconnect(), qa = void 0, Ja?.(), Ja = void 0;
|
|
1301
|
+
let e = Jt.value;
|
|
1302
|
+
if (!Y.value || !e) return;
|
|
1303
|
+
let t = 0, n = () => {
|
|
1304
|
+
t ||= requestAnimationFrame(() => {
|
|
1305
|
+
t = 0, fa();
|
|
1306
|
+
});
|
|
1307
|
+
};
|
|
1308
|
+
if (ca.value === e) qa = new ResizeObserver(() => fa()), qa.observe(e);
|
|
1309
|
+
else {
|
|
1310
|
+
window.addEventListener("resize", n);
|
|
1311
|
+
let e = new ResizeObserver(n);
|
|
1312
|
+
e.observe(document.documentElement), Ja = () => {
|
|
1313
|
+
window.removeEventListener("resize", n), e.disconnect(), t && cancelAnimationFrame(t);
|
|
550
1314
|
};
|
|
1315
|
+
}
|
|
1316
|
+
};
|
|
1317
|
+
D(ca, Ya), D(() => [Y.value, Q.value.length], () => {
|
|
1318
|
+
y(() => {
|
|
1319
|
+
ma(), fa(), Ya(), wa = /* @__PURE__ */ new Set(), ja = -1, Ma = !1, Ia();
|
|
551
1320
|
});
|
|
552
|
-
}
|
|
553
|
-
|
|
554
|
-
|
|
1321
|
+
}, { flush: "post" });
|
|
1322
|
+
let Xa = () => {
|
|
1323
|
+
Y.value && Object.keys(X.value).length && (X.value = {});
|
|
1324
|
+
}, Za, Qa = () => {
|
|
1325
|
+
let e = typeof document < "u" ? document.fonts : void 0;
|
|
1326
|
+
!e || Za || (e.status !== "loaded" && e.ready.then(Xa), e.addEventListener("loadingdone", Xa), Za = () => e.removeEventListener("loadingdone", Xa));
|
|
1327
|
+
};
|
|
1328
|
+
Ae(() => {
|
|
1329
|
+
ma(), pi(), fa(), Ya(), Ia(), Y.value && Qa();
|
|
1330
|
+
}), D(Y, (e) => {
|
|
1331
|
+
e && Qa(), yi && fi(yi), pi();
|
|
1332
|
+
}), Oe(() => {
|
|
1333
|
+
qa?.disconnect(), Ja?.(), Za?.(), ya && cancelAnimationFrame(ya);
|
|
555
1334
|
});
|
|
556
|
-
let
|
|
557
|
-
X.value = e;
|
|
558
|
-
let t = Tn()?.[e];
|
|
559
|
-
t?.focus(), t?.scrollIntoView({ block: "nearest" });
|
|
560
|
-
}, Dn = (e) => {
|
|
561
|
-
N.keyboardNavigation && (X.value = e);
|
|
562
|
-
}, On = (e, t) => {
|
|
1335
|
+
let $a = (e, t) => {
|
|
563
1336
|
if (!N.keyboardNavigation || e.target !== e.currentTarget) return;
|
|
564
|
-
let n =
|
|
1337
|
+
let n = Bi.value.length - 1;
|
|
565
1338
|
if (n < 0) return;
|
|
566
1339
|
let r = (t) => {
|
|
567
|
-
e.preventDefault(),
|
|
1340
|
+
e.preventDefault(), aa(te(t, 0, n));
|
|
568
1341
|
};
|
|
569
1342
|
switch (e.key) {
|
|
570
1343
|
case "ArrowDown":
|
|
@@ -574,10 +1347,10 @@ var Oe = {
|
|
|
574
1347
|
r(t - 1);
|
|
575
1348
|
break;
|
|
576
1349
|
case "PageDown":
|
|
577
|
-
r(t +
|
|
1350
|
+
r(t + Ht);
|
|
578
1351
|
break;
|
|
579
1352
|
case "PageUp":
|
|
580
|
-
r(t -
|
|
1353
|
+
r(t - Ht);
|
|
581
1354
|
break;
|
|
582
1355
|
case "Home":
|
|
583
1356
|
r(0);
|
|
@@ -590,105 +1363,189 @@ var Oe = {
|
|
|
590
1363
|
e.preventDefault(), e.currentTarget.click();
|
|
591
1364
|
break;
|
|
592
1365
|
}
|
|
593
|
-
}, { data:
|
|
594
|
-
e.target instanceof HTMLElement && (e.target instanceof HTMLButtonElement || e.key !== "Enter" && e.key !== " " || (e.preventDefault(),
|
|
595
|
-
},
|
|
596
|
-
"aria-controls":
|
|
1366
|
+
}, { data: eo } = re({ items: M }), to = (e, t) => {
|
|
1367
|
+
e.target instanceof HTMLElement && (e.target instanceof HTMLButtonElement || e.key !== "Enter" && e.key !== " " || (e.preventDefault(), ro(t)));
|
|
1368
|
+
}, no = (e) => ({
|
|
1369
|
+
"aria-controls": l(eo.value[e.valueHash]) ? void 0 : `expanded_${e.valueHash}`,
|
|
597
1370
|
"aria-expanded": e.expanded ? "true" : "false",
|
|
598
1371
|
onClick: (t) => {
|
|
599
|
-
t.stopPropagation(),
|
|
1372
|
+
t.stopPropagation(), ro(e.valueHash);
|
|
600
1373
|
},
|
|
601
|
-
onKeydown: (t) =>
|
|
602
|
-
}),
|
|
603
|
-
let t =
|
|
604
|
-
t && (e in
|
|
1374
|
+
onKeydown: (t) => to(t, e.valueHash)
|
|
1375
|
+
}), ro = (e) => {
|
|
1376
|
+
let t = Z.value.find((t) => t.valueHash === e);
|
|
1377
|
+
t && (e in eo.value ? M.value = M.value.filter((t) => u(t) !== e) : M.value = [...M.value, t.value]);
|
|
605
1378
|
};
|
|
606
|
-
O
|
|
607
|
-
|
|
1379
|
+
D(O, () => {
|
|
1380
|
+
ao.clear(), q.unselected = [], q.selected = [];
|
|
608
1381
|
});
|
|
609
|
-
let
|
|
610
|
-
let e = Array.isArray(
|
|
611
|
-
return !!(N.multiple && e > 0 && !
|
|
612
|
-
}),
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
1382
|
+
let io = h(() => {
|
|
1383
|
+
let e = Array.isArray(q.selected) ? q.selected.length : 0;
|
|
1384
|
+
return !!(N.multiple && e > 0 && !O.value || O.value && ao.size > 0);
|
|
1385
|
+
}), ao = je(/* @__PURE__ */ new Set());
|
|
1386
|
+
D(() => q.unselected, (e) => {
|
|
1387
|
+
ao.clear(), (e ?? []).forEach((e) => {
|
|
1388
|
+
ao.add(u(e));
|
|
616
1389
|
});
|
|
617
1390
|
}, { immediate: !0 });
|
|
618
|
-
let
|
|
619
|
-
let t =
|
|
620
|
-
if (
|
|
621
|
-
|
|
1391
|
+
let oo = (e) => {
|
|
1392
|
+
let t = q.unselected ?? [];
|
|
1393
|
+
if (so(e)) {
|
|
1394
|
+
Hi(e), P("item:unselected", e.value), ao.add(e.valueHash), q.unselected = [...t, e.value];
|
|
622
1395
|
return;
|
|
623
1396
|
}
|
|
624
|
-
|
|
625
|
-
},
|
|
1397
|
+
O.value || Vi(e), P("item:selected", e.value), ao.delete(e.valueHash), q.unselected = t.filter((t) => u(t) !== u(e.value));
|
|
1398
|
+
}, so = (e) => ao.has(e.valueHash) ? !1 : e.selected || O.value, co = h(() => {
|
|
1399
|
+
let e = /* @__PURE__ */ new Map();
|
|
1400
|
+
for (let t of Z.value) e.set(t.valueHash, t);
|
|
1401
|
+
return e;
|
|
1402
|
+
}), lo = (e) => {
|
|
626
1403
|
if (N.disabled || N.readonly || typeof N.selectable == "function" && !N.selectable(e.item)) return !0;
|
|
627
|
-
let t =
|
|
1404
|
+
let t = co.value.get(e.valueHash);
|
|
628
1405
|
return !t || !!t.disabled;
|
|
629
|
-
},
|
|
630
|
-
|
|
631
|
-
},
|
|
1406
|
+
}, uo = (e) => {
|
|
1407
|
+
lo(e) || oo(e);
|
|
1408
|
+
}, fo = ce((e) => typeof e != "string", JSON.stringify), po = h(() => [].concat(q.selected ?? []).map((e) => ({
|
|
632
1409
|
disabled: N.disabled,
|
|
633
1410
|
name: N.name,
|
|
634
1411
|
type: "hidden",
|
|
635
|
-
value:
|
|
636
|
-
}))),
|
|
1412
|
+
value: fo(e)
|
|
1413
|
+
}))), mo = [
|
|
637
1414
|
70,
|
|
638
1415
|
45,
|
|
639
1416
|
85,
|
|
640
1417
|
55
|
|
641
|
-
],
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
1418
|
+
], ho = h(() => te(Z.value.length || N.columns.length || 1, 4, 10)), go = h(() => {
|
|
1419
|
+
let e = /* @__PURE__ */ new Map();
|
|
1420
|
+
for (let [t, n] of k.value) e.has(t) || e.set(t, n);
|
|
1421
|
+
return e;
|
|
1422
|
+
}), _o = h(() => ({
|
|
1423
|
+
slots: F,
|
|
1424
|
+
selectable: N.selectable,
|
|
1425
|
+
multiple: !!N.multiple,
|
|
1426
|
+
readonly: !!N.readonly,
|
|
1427
|
+
actions: I.value,
|
|
1428
|
+
keyboardNavigation: !!N.keyboardNavigation,
|
|
1429
|
+
contentInert: Oi.value,
|
|
1430
|
+
hasRowIndex: ki.value,
|
|
1431
|
+
columnSpan: ji.value,
|
|
1432
|
+
inputName: Wt,
|
|
1433
|
+
tdClass: N.tdClass,
|
|
1434
|
+
cellClasses: Dn.value,
|
|
1435
|
+
sortOrders: go.value,
|
|
1436
|
+
measureRow: Ua,
|
|
1437
|
+
onInputChange: oo,
|
|
1438
|
+
onRowFocus: oa,
|
|
1439
|
+
onRowKeydown: $a
|
|
1440
|
+
})), vo = h(() => {
|
|
1441
|
+
let e = [], t = +!!N.selectable;
|
|
1442
|
+
return N.selectable && N.fixedSelect && e.push({
|
|
1443
|
+
index: 0,
|
|
1444
|
+
position: "left"
|
|
1445
|
+
}), B.value.forEach((n, r) => {
|
|
1446
|
+
n.fixed && e.push({
|
|
1447
|
+
index: r + t,
|
|
1448
|
+
position: n.fixed
|
|
1449
|
+
});
|
|
1450
|
+
}), I.value && N.fixedActions && e.push({
|
|
1451
|
+
index: B.value.length + t,
|
|
1452
|
+
position: "right"
|
|
1453
|
+
}), e;
|
|
1454
|
+
}), yo = h(() => vo.value.map((e) => typeof e == "number" ? `${e}:left` : `${e.index}:${e.position}`).join(","));
|
|
1455
|
+
return D(() => [
|
|
1456
|
+
Wa.value,
|
|
1457
|
+
yo.value,
|
|
1458
|
+
Si.value
|
|
1459
|
+
], ([, e, t], n) => {
|
|
1460
|
+
let r = n?.[1], i = vo.value;
|
|
1461
|
+
if (R.value && (e.length || r?.length)) {
|
|
1462
|
+
let a = e === r && t === n?.[2];
|
|
1463
|
+
fe(R.value, i, a ? yi : null, a);
|
|
1464
|
+
}
|
|
1465
|
+
F.thead && y(xi);
|
|
1466
|
+
}, { flush: "post" }), (e, t) => (S(), Se(Ne(Ti.value), {
|
|
645
1467
|
id: e.id,
|
|
646
1468
|
ref_key: "containerRef",
|
|
647
|
-
ref:
|
|
648
|
-
"aria-busy":
|
|
649
|
-
class: b(
|
|
650
|
-
"data-bb-table-id":
|
|
1469
|
+
ref: Jt,
|
|
1470
|
+
"aria-busy": Di.value,
|
|
1471
|
+
class: b(Ai.value),
|
|
1472
|
+
"data-bb-table-id": E(Yt),
|
|
651
1473
|
inert: e.disabled,
|
|
652
|
-
style: x(
|
|
1474
|
+
style: x(mi.value)
|
|
653
1475
|
}, {
|
|
654
|
-
default:
|
|
655
|
-
e.selectable ? (S(), _("legend",
|
|
656
|
-
|
|
1476
|
+
default: ze(() => [
|
|
1477
|
+
e.selectable ? (S(), _("legend", Ye, T(Ei.value), 1)) : g("", !0),
|
|
1478
|
+
e.caption ? (S(), _("div", {
|
|
1479
|
+
key: 1,
|
|
1480
|
+
id: nn.value,
|
|
1481
|
+
class: b(["bb-table-caption", { "sr-only": !e.displayCaption }])
|
|
1482
|
+
}, T(e.caption), 11, Xe)) : g("", !0),
|
|
1483
|
+
e.reorderable || e.resizable ? (S(), _("div", {
|
|
1484
|
+
key: 2,
|
|
1485
|
+
id: rn.value,
|
|
1486
|
+
class: "sr-only"
|
|
1487
|
+
}, [e.reorderable ? (S(), _(m, { key: 0 }, [Ce(T(E(L)("table.reorderInstructions").value), 1)], 64)) : g("", !0), e.resizable && !J.value ? (S(), _(m, { key: 1 }, [Ce(T(E(L)("table.resizeInstructions").value), 1)], 64)) : g("", !0)], 8, Ze)) : g("", !0),
|
|
1488
|
+
v("span", Qe, T(Di.value ? e.loadingText || E(L)("common.loadingText").value : ""), 1),
|
|
1489
|
+
e.reorderable ? (S(), _(m, { key: 3 }, [v("span", $e, T(fn.value), 1), v("div", {
|
|
1490
|
+
ref_key: "ghostRef",
|
|
1491
|
+
ref: Bn,
|
|
1492
|
+
"aria-hidden": "true",
|
|
1493
|
+
class: "bb-table-column-ghost",
|
|
1494
|
+
popover: "manual"
|
|
1495
|
+
}, [t[1] ||= v("svg", {
|
|
1496
|
+
"aria-hidden": "true",
|
|
1497
|
+
class: "bb-table-column-ghost__icon",
|
|
1498
|
+
fill: "none",
|
|
1499
|
+
height: "1em",
|
|
1500
|
+
stroke: "currentColor",
|
|
1501
|
+
"stroke-linecap": "round",
|
|
1502
|
+
"stroke-linejoin": "round",
|
|
1503
|
+
"stroke-width": "2",
|
|
1504
|
+
viewBox: "0 0 24 24",
|
|
1505
|
+
width: "1em"
|
|
1506
|
+
}, [v("path", { d: "M12 2v20M2 12h20M5 9l-3 3 3 3M9 5l3-3 3 3M15 19l-3 3-3-3M19 9l3 3-3 3" })], -1), v("span", null, T(zn.value), 1)], 512)], 64)) : g("", !0),
|
|
1507
|
+
v("div", {
|
|
657
1508
|
ref_key: "tableRef",
|
|
658
|
-
ref:
|
|
659
|
-
"aria-
|
|
1509
|
+
ref: R,
|
|
1510
|
+
"aria-labelledby": e.caption ? nn.value : void 0,
|
|
1511
|
+
"aria-rowcount": ki.value && E(q).totalItems != null ? E(q).totalItems + 1 : void 0,
|
|
1512
|
+
class: "bb-table__table",
|
|
1513
|
+
role: "table",
|
|
1514
|
+
style: x(si.value)
|
|
660
1515
|
}, [
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
},
|
|
669
|
-
|
|
670
|
-
"
|
|
671
|
-
|
|
1516
|
+
v("div", {
|
|
1517
|
+
class: b(["bb-table__head", {
|
|
1518
|
+
"bb-table__head--dragging": G.value === "dragging",
|
|
1519
|
+
"bb-table__head--resizing": Sn.value !== null
|
|
1520
|
+
}]),
|
|
1521
|
+
inert: Oi.value,
|
|
1522
|
+
role: "rowgroup"
|
|
1523
|
+
}, [w(e.$slots, "thead", {}, () => [v("div", {
|
|
1524
|
+
"aria-rowindex": ki.value ? 1 : void 0,
|
|
1525
|
+
class: b(["bb-table-header-row", e.headerRowClass]),
|
|
1526
|
+
role: "row",
|
|
1527
|
+
onPointerdown: cr,
|
|
1528
|
+
onTouchmove: lr
|
|
672
1529
|
}, [
|
|
673
|
-
e.selectable ? (S(), _("
|
|
1530
|
+
e.selectable ? (S(), _("div", {
|
|
674
1531
|
key: 0,
|
|
675
1532
|
class: b(["bb-table-header bb-table-header--select", e.thClass]),
|
|
676
|
-
|
|
677
|
-
}, [
|
|
1533
|
+
role: "columnheader"
|
|
1534
|
+
}, [w(e.$slots, "header:select", {
|
|
678
1535
|
multiple: e.multiple,
|
|
679
|
-
selectAll: !!
|
|
680
|
-
text: e.selectText ||
|
|
681
|
-
}, () => [v("span",
|
|
1536
|
+
selectAll: !!O.value,
|
|
1537
|
+
text: e.selectText || E(L)("table.selectText").value
|
|
1538
|
+
}, () => [v("span", rt, [!e.disableSelectAll && e.multiple ? (S(), _("label", {
|
|
682
1539
|
key: 0,
|
|
683
1540
|
class: b(["bb-table-check__label", { "bb-table-check__label--disabled": e.disabled }])
|
|
684
|
-
}, [(S(),
|
|
685
|
-
key:
|
|
686
|
-
modelValue:
|
|
687
|
-
"onUpdate:modelValue": t[0] ||= (e) =>
|
|
688
|
-
checked: !!
|
|
1541
|
+
}, [(S(), Se(ne, {
|
|
1542
|
+
key: io.value.toString(),
|
|
1543
|
+
modelValue: O.value,
|
|
1544
|
+
"onUpdate:modelValue": t[0] ||= (e) => O.value = e,
|
|
1545
|
+
checked: !!O.value,
|
|
689
1546
|
class: "bb-table-check",
|
|
690
1547
|
disabled: e.disabled,
|
|
691
|
-
indeterminate:
|
|
1548
|
+
indeterminate: io.value,
|
|
692
1549
|
name: `select_all_${e.name || ""}`,
|
|
693
1550
|
readonly: e.readonly
|
|
694
1551
|
}, null, 8, [
|
|
@@ -698,198 +1555,174 @@ var Oe = {
|
|
|
698
1555
|
"indeterminate",
|
|
699
1556
|
"name",
|
|
700
1557
|
"readonly"
|
|
701
|
-
])), v("span",
|
|
702
|
-
(S(!0), _(m, null,
|
|
703
|
-
key:
|
|
704
|
-
"aria-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
"bb-table-header--edge-
|
|
1558
|
+
])), v("span", it, T(e.selectAllLabel || E(L)("table.selectAllLabel").value), 1)], 2)) : e.multiple ? g("", !0) : (S(), _("span", at, T(e.selectText || E(L)("table.selectText").value), 1))])])], 2)) : g("", !0),
|
|
1559
|
+
(S(!0), _(m, null, Me(Gi.value, (n, r) => (S(), _("div", {
|
|
1560
|
+
key: n.key,
|
|
1561
|
+
"aria-describedby": an.value ? rn.value : void 0,
|
|
1562
|
+
"aria-sort": n.sortDirection ?? (n.sortable ? "none" : void 0),
|
|
1563
|
+
class: b(["bb-table-header", [n.classes, {
|
|
1564
|
+
"bb-table-header--edge-start": r === 0,
|
|
1565
|
+
"bb-table-header--edge-end": r === Gi.value.length - 1,
|
|
1566
|
+
"bb-table-header--clip": ii.value.has(n.key),
|
|
1567
|
+
"bb-table-header--dragging": Rn.value === n.key,
|
|
1568
|
+
"bb-table-header--sortable": n.sortable,
|
|
1569
|
+
"bb-table-header--resizing": Sn.value === n.key
|
|
708
1570
|
}]]),
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
1571
|
+
"data-column-key": an.value ? n.key : void 0,
|
|
1572
|
+
role: "columnheader",
|
|
1573
|
+
tabindex: an.value ? n.key === hn.value ? 0 : -1 : void 0,
|
|
1574
|
+
onClick: (e) => gn(e, n),
|
|
1575
|
+
onFocus: (e) => _n(n.key),
|
|
1576
|
+
onKeydown: (e) => bn(e, n.key)
|
|
1577
|
+
}, [
|
|
1578
|
+
Ki(n.key, "prepend") ? (S(), Se(Ne(Ki(n.key, "prepend")), De({
|
|
1579
|
+
key: 0,
|
|
1580
|
+
ref_for: !0
|
|
1581
|
+
}, qi(n)), null, 16)) : g("", !0),
|
|
1582
|
+
w(e.$slots, n.slotName, {
|
|
1583
|
+
classes: n.classes,
|
|
1584
|
+
hideColumn: () => ln(n.key),
|
|
1585
|
+
items: E(Ii),
|
|
1586
|
+
label: n.label,
|
|
1587
|
+
sortOrder: n.sortOrder,
|
|
1588
|
+
sortable: n.sortable,
|
|
1589
|
+
toggleSort: () => yr(n.key)
|
|
1590
|
+
}, () => [n.sortable ? (S(), Se(s, {
|
|
1591
|
+
key: 0,
|
|
1592
|
+
class: b(["bb-table-sort", {
|
|
1593
|
+
"bb-table-sort--asc": n.sortOrder === "asc",
|
|
1594
|
+
"bb-table-sort--desc": n.sortOrder === "desc"
|
|
1595
|
+
}]),
|
|
1596
|
+
tabindex: an.value ? -1 : void 0,
|
|
1597
|
+
type: "button",
|
|
1598
|
+
onClick: () => yr(n.key)
|
|
1599
|
+
}, {
|
|
1600
|
+
default: ze(() => [v("span", st, T(n.label), 1), t[2] ||= v("svg", {
|
|
1601
|
+
"aria-hidden": "true",
|
|
1602
|
+
class: "bb-table-sort__icon",
|
|
1603
|
+
fill: "none",
|
|
1604
|
+
height: "1em",
|
|
1605
|
+
stroke: "currentColor",
|
|
1606
|
+
"stroke-linecap": "round",
|
|
1607
|
+
"stroke-linejoin": "round",
|
|
1608
|
+
"stroke-width": "2",
|
|
1609
|
+
viewBox: "0 0 24 24",
|
|
1610
|
+
width: "1em"
|
|
1611
|
+
}, [v("path", { d: "M12 20V4m-7 7l7-7l7 7" })], -1)]),
|
|
1612
|
+
_: 2
|
|
1613
|
+
}, 1032, [
|
|
1614
|
+
"class",
|
|
1615
|
+
"tabindex",
|
|
1616
|
+
"onClick"
|
|
1617
|
+
])) : (S(), _("span", ct, T(n.label), 1))]),
|
|
1618
|
+
Ki(n.key, "append") ? (S(), Se(Ne(Ki(n.key, "append")), De({
|
|
1619
|
+
key: 1,
|
|
1620
|
+
ref_for: !0
|
|
1621
|
+
}, qi(n)), null, 16)) : g("", !0),
|
|
1622
|
+
e.resizable && !J.value ? (S(), _("div", {
|
|
1623
|
+
key: 2,
|
|
1624
|
+
"aria-hidden": "true",
|
|
1625
|
+
class: "bb-table-header__resizer",
|
|
1626
|
+
onDblclick: Be((e) => An(n.key), ["stop"]),
|
|
1627
|
+
onPointerdown: (e) => Ln(e, n.key)
|
|
1628
|
+
}, null, 40, lt)) : g("", !0)
|
|
1629
|
+
], 42, ot))), 128)),
|
|
1630
|
+
I.value ? (S(), _("div", {
|
|
734
1631
|
key: 1,
|
|
735
1632
|
class: b(["bb-table-header bb-table-header--actions", e.thClass]),
|
|
736
|
-
|
|
737
|
-
}, [
|
|
738
|
-
],
|
|
739
|
-
v("
|
|
1633
|
+
role: "columnheader"
|
|
1634
|
+
}, [w(e.$slots, "header:actions", { text: e.actionsText || E(L)("table.actionsText").value }, () => [v("span", ut, T(e.actionsText || E(L)("table.actionsText").value), 1)])], 2)) : g("", !0)
|
|
1635
|
+
], 42, nt)])], 10, tt),
|
|
1636
|
+
v("div", {
|
|
1637
|
+
ref_key: "bodyRef",
|
|
1638
|
+
ref: ua,
|
|
1639
|
+
class: "bb-table__body",
|
|
1640
|
+
role: "rowgroup",
|
|
1641
|
+
onFocusin: ga,
|
|
1642
|
+
onFocusout: _a
|
|
1643
|
+
}, [Di.value && !E(Z).length ? w(e.$slots, "loading", {
|
|
740
1644
|
key: 0,
|
|
741
|
-
items:
|
|
742
|
-
}, () => [(S(!0), _(m, null,
|
|
1645
|
+
items: E(Ii)
|
|
1646
|
+
}, () => [(S(!0), _(m, null, Me(ho.value, (n, r) => (S(), _("div", {
|
|
743
1647
|
key: r,
|
|
744
|
-
"aria-rowindex":
|
|
745
|
-
class: "bb-table-skeleton__row"
|
|
1648
|
+
"aria-rowindex": ki.value ? r + 2 : void 0,
|
|
1649
|
+
class: "bb-table-skeleton__row",
|
|
1650
|
+
role: "row"
|
|
746
1651
|
}, [
|
|
747
|
-
e.selectable ? (S(), _("
|
|
748
|
-
(S(!0), _(m, null,
|
|
1652
|
+
e.selectable ? (S(), _("div", ft, t[3] ||= [v("div", { class: "bb-table-skeleton__placeholder" }, null, -1)])) : g("", !0),
|
|
1653
|
+
(S(!0), _(m, null, Me(B.value, (e, n) => (S(), _("div", {
|
|
749
1654
|
key: e.key,
|
|
750
|
-
class: b(["bb-table-skeleton__cell", [`bb-table-skeleton__cell--${e.skeleton ?? "text"}`]])
|
|
751
|
-
|
|
1655
|
+
class: b(["bb-table-skeleton__cell", [`bb-table-skeleton__cell--${e.skeleton ?? "text"}`]]),
|
|
1656
|
+
role: "cell"
|
|
1657
|
+
}, [!e.skeleton || e.skeleton === "text" ? (S(), _("div", pt, [v("div", {
|
|
752
1658
|
class: "bb-table-skeleton__line",
|
|
753
|
-
style: x({ width: `${
|
|
1659
|
+
style: x({ width: `${mo[(r + n) % 4]}%` })
|
|
754
1660
|
}, null, 4), v("div", {
|
|
755
1661
|
class: "bb-table-skeleton__line",
|
|
756
|
-
style: x({ width: `${
|
|
757
|
-
}, null, 4)])) : e.skeleton === "avatar" ? (S(), _("div",
|
|
1662
|
+
style: x({ width: `${mo[(r + n + 2) % 4]}%` })
|
|
1663
|
+
}, null, 4)])) : e.skeleton === "avatar" ? (S(), _("div", mt)) : e.skeleton === "avatar-text" ? (S(), _("div", ht, [t[4] ||= v("div", { class: "bb-table-skeleton__avatar" }, null, -1), v("div", gt, [v("div", {
|
|
758
1664
|
class: "bb-table-skeleton__line",
|
|
759
|
-
style: x({ width: `${
|
|
1665
|
+
style: x({ width: `${mo[(r + n) % 4]}%` })
|
|
760
1666
|
}, null, 4), v("div", {
|
|
761
1667
|
class: "bb-table-skeleton__line",
|
|
762
|
-
style: x({ width: `${
|
|
763
|
-
}, null, 4)])])) : e.skeleton === "image" ? (S(), _("div",
|
|
764
|
-
|
|
765
|
-
], 8,
|
|
766
|
-
"aria-current": t.highlighted ? "true" : void 0,
|
|
767
|
-
"aria-rowindex": J.value && t.rowIndex ? t.rowIndex : void 0,
|
|
768
|
-
class: b(["bb-table-data__row", [t.rowClasses, { "bb-table-data__row--highlighted": t.highlighted }]]),
|
|
769
|
-
inert: sn.value,
|
|
770
|
-
tabindex: e.keyboardNavigation ? n === X.value ? 0 : -1 : void 0,
|
|
771
|
-
onClick: t.onRowClick,
|
|
772
|
-
onContextmenu: t.onRowContextMenu,
|
|
773
|
-
onDblclick: t.onRowDblClick,
|
|
774
|
-
onFocus: () => Dn(n),
|
|
775
|
-
onKeydown: (e) => On(e, n)
|
|
776
|
-
}, [
|
|
777
|
-
e.selectable ? (S(), _("td", {
|
|
778
|
-
key: 0,
|
|
779
|
-
class: b(["bb-table-data__cell bb-table-data__cell--select", e.tdClass])
|
|
780
|
-
}, [T(e.$slots, "select", {
|
|
781
|
-
checked: $(t),
|
|
782
|
-
disabled: Pn(t),
|
|
783
|
-
inputName: D(st),
|
|
784
|
-
item: t.item,
|
|
785
|
-
readonly: !!e.readonly,
|
|
786
|
-
toggleSelected: () => Fn(t),
|
|
787
|
-
value: t.value
|
|
788
|
-
}, () => [e.multiple ? (S(), _("label", {
|
|
789
|
-
key: 0,
|
|
790
|
-
class: b(["bb-table-check__label", { "bb-table-check__label--disabled": t.disabled }])
|
|
791
|
-
}, [_e(d, {
|
|
792
|
-
checked: $(t),
|
|
793
|
-
class: "bb-table-check",
|
|
794
|
-
disabled: t.disabled,
|
|
795
|
-
readonly: e.readonly,
|
|
796
|
-
onChange: () => Nn(t)
|
|
797
|
-
}, null, 8, [
|
|
798
|
-
"checked",
|
|
799
|
-
"disabled",
|
|
800
|
-
"readonly",
|
|
801
|
-
"onChange"
|
|
802
|
-
]), v("span", Qe, E(t.accessibleLabel), 1)], 2)) : (S(), _("label", {
|
|
803
|
-
key: 1,
|
|
804
|
-
class: b(["bb-table-radio__label", { "bb-table-radio__label--disabled": t.disabled }])
|
|
805
|
-
}, [_e(oe, {
|
|
806
|
-
checked: t.selected,
|
|
807
|
-
class: "bb-table-radio",
|
|
808
|
-
disabled: t.disabled,
|
|
809
|
-
name: D(st),
|
|
810
|
-
readonly: e.readonly,
|
|
811
|
-
value: t.value,
|
|
812
|
-
onChange: () => Nn(t)
|
|
813
|
-
}, null, 8, [
|
|
814
|
-
"checked",
|
|
815
|
-
"disabled",
|
|
816
|
-
"name",
|
|
817
|
-
"readonly",
|
|
818
|
-
"value",
|
|
819
|
-
"onChange"
|
|
820
|
-
]), v("span", $e, E(t.accessibleLabel), 1)], 2))])], 2)) : g("", !0),
|
|
821
|
-
(S(!0), _(m, null, w(t.cols, (n, r) => (S(), _("td", {
|
|
822
|
-
key: n.key,
|
|
823
|
-
class: b(["bb-table-data__cell", [n.classes, {
|
|
824
|
-
"bb-table-data__cell--edge-start": r === 0,
|
|
825
|
-
"bb-table-data__cell--edge-end": r === t.cols.length - 1
|
|
826
|
-
}]])
|
|
827
|
-
}, [T(e.$slots, n.slotName, {
|
|
828
|
-
classes: n.classes,
|
|
829
|
-
content: n.content,
|
|
830
|
-
expandProps: jn(t),
|
|
831
|
-
expanded: t.expanded,
|
|
832
|
-
highlighted: t.highlighted,
|
|
833
|
-
item: t.item,
|
|
834
|
-
selected: $(t),
|
|
835
|
-
sortOrder: gt(n.key),
|
|
836
|
-
toggleExpanded: () => Z(t.valueHash),
|
|
837
|
-
toggleHighlighted: () => z(t),
|
|
838
|
-
toggleSelected: () => Fn(t),
|
|
839
|
-
value: t.value
|
|
840
|
-
}, () => [ge(E(n.content), 1)])], 2))), 128)),
|
|
841
|
-
e.actions ? (S(), _("td", {
|
|
842
|
-
key: 1,
|
|
843
|
-
class: b(["bb-table__cell bb-table__cell--actions", e.tdClass])
|
|
844
|
-
}, [T(e.$slots, "actions", {
|
|
845
|
-
expandProps: jn(t),
|
|
846
|
-
expanded: t.expanded,
|
|
847
|
-
highlighted: t.highlighted,
|
|
848
|
-
item: t.item,
|
|
849
|
-
selected: $(t),
|
|
850
|
-
toggleExpanded: () => Z(t.valueHash),
|
|
851
|
-
toggleHighlighted: () => z(t),
|
|
852
|
-
toggleSelected: () => Fn(t),
|
|
853
|
-
value: t.value
|
|
854
|
-
})], 2)) : g("", !0)
|
|
855
|
-
], 42, Ze), t.expanded ? (S(), _("tr", {
|
|
1668
|
+
style: x({ width: `${mo[(r + n + 2) % 4]}%` })
|
|
1669
|
+
}, null, 4)])])) : e.skeleton === "image" ? (S(), _("div", _t)) : e.skeleton === "badge" ? (S(), _("div", vt)) : g("", !0)], 2))), 128)),
|
|
1670
|
+
I.value ? (S(), _("div", yt, t[5] ||= [v("div", { class: "bb-table-skeleton__placeholder" }, null, -1)])) : g("", !0)
|
|
1671
|
+
], 8, dt))), 128))]) : E(Z).length ? w(e.$slots, "tbody", { key: 2 }, () => [(S(!0), _(m, null, Me(Wa.value, (e) => (S(), _(m, { key: e.key }, [e.kind === "spacer" ? (S(), _("div", {
|
|
856
1672
|
key: 0,
|
|
857
|
-
|
|
858
|
-
"
|
|
859
|
-
|
|
860
|
-
},
|
|
861
|
-
class: "bb-table-expand__cell",
|
|
862
|
-
colspan: ln.value
|
|
863
|
-
}, [T(e.$slots, "expand", {
|
|
864
|
-
expandProps: jn(t),
|
|
865
|
-
expanded: t.expanded,
|
|
866
|
-
highlighted: t.highlighted,
|
|
867
|
-
item: t.item,
|
|
868
|
-
selected: $(t),
|
|
869
|
-
toggleExpanded: () => Z(t.valueHash),
|
|
870
|
-
toggleHighlighted: () => z(t),
|
|
871
|
-
toggleSelected: () => Fn(t),
|
|
872
|
-
value: t.value
|
|
873
|
-
})], 8, tt)], 10, et)) : g("", !0)], 64))), 128))]) : (S(), _("tr", {
|
|
1673
|
+
"aria-hidden": "true",
|
|
1674
|
+
class: "bb-table-spacer__row bb-table-placeholder__row",
|
|
1675
|
+
style: x({ height: `${e.height}px` })
|
|
1676
|
+
}, null, 4)) : e.kind === "placeholder" ? (S(), _("div", {
|
|
874
1677
|
key: 1,
|
|
875
|
-
"aria-
|
|
876
|
-
class: "bb-table-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
1678
|
+
"aria-hidden": "true",
|
|
1679
|
+
class: "bb-table-placeholder__row bb-table-placeholder__row--pending",
|
|
1680
|
+
"data-index": e.virtualIndex,
|
|
1681
|
+
style: x({ height: `${e.height}px` })
|
|
1682
|
+
}, null, 12, Ct)) : e.kind === "row" ? (S(), Se(E(ue), {
|
|
1683
|
+
key: 2,
|
|
1684
|
+
active: e.index === ta.value,
|
|
1685
|
+
context: _o.value,
|
|
1686
|
+
index: e.index,
|
|
1687
|
+
item: e.item,
|
|
1688
|
+
"select-blocked": lo(e.item),
|
|
1689
|
+
selected: so(e.item),
|
|
1690
|
+
"virtual-index": e.virtualIndex
|
|
1691
|
+
}, null, 8, [
|
|
1692
|
+
"active",
|
|
1693
|
+
"context",
|
|
1694
|
+
"index",
|
|
1695
|
+
"item",
|
|
1696
|
+
"select-blocked",
|
|
1697
|
+
"selected",
|
|
1698
|
+
"virtual-index"
|
|
1699
|
+
])) : (S(), Se(E(de), {
|
|
881
1700
|
key: 3,
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
"
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
1701
|
+
context: _o.value,
|
|
1702
|
+
item: e.item,
|
|
1703
|
+
selected: so(e.item),
|
|
1704
|
+
"virtual-index": e.virtualIndex
|
|
1705
|
+
}, null, 8, [
|
|
1706
|
+
"context",
|
|
1707
|
+
"item",
|
|
1708
|
+
"selected",
|
|
1709
|
+
"virtual-index"
|
|
1710
|
+
]))], 64))), 128))]) : (S(), _("div", {
|
|
1711
|
+
key: 1,
|
|
1712
|
+
"aria-rowindex": ki.value ? 2 : void 0,
|
|
1713
|
+
class: "bb-table-no-data__row",
|
|
1714
|
+
role: "row"
|
|
1715
|
+
}, [v("div", {
|
|
1716
|
+
"aria-colspan": ji.value,
|
|
1717
|
+
class: "bb-table-no-data__cell",
|
|
1718
|
+
role: "cell"
|
|
1719
|
+
}, [w(e.$slots, "no-data", {}, () => [v("span", St, T(e.noDataText || E(L)("common.noDataText").value), 1)])], 8, xt)], 8, bt))], 544),
|
|
1720
|
+
v("div", {
|
|
1721
|
+
class: "bb-table__foot",
|
|
1722
|
+
role: F.tfoot ? "rowgroup" : void 0
|
|
1723
|
+
}, [w(e.$slots, "tfoot", { columnCount: ji.value })], 8, wt)
|
|
1724
|
+
], 12, et),
|
|
1725
|
+
(S(!0), _(m, null, Me(po.value, (e) => (S(), _("input", De({
|
|
893
1726
|
key: e.value,
|
|
894
1727
|
ref_for: !0
|
|
895
1728
|
}, e), null, 16))), 128))
|
|
@@ -906,4 +1739,4 @@ var Oe = {
|
|
|
906
1739
|
}
|
|
907
1740
|
});
|
|
908
1741
|
//#endregion
|
|
909
|
-
export {
|
|
1742
|
+
export { O as default };
|