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