bitboss-ui 3.0.0-beta.74 → 3.0.0-beta.76
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 +5 -5
- package/bin/cli.mjs +16 -10
- package/dist/ai/BbAlert.md +1 -1
- package/dist/ai/BbAvatar.md +86 -58
- package/dist/ai/BbBadge.md +1 -1
- package/dist/ai/BbBreadcrumbs.md +3 -3
- package/dist/ai/BbButton.md +4 -4
- package/dist/ai/BbCalendar.md +5 -2
- package/dist/ai/BbCheckboxGroup.md +5 -4
- package/dist/ai/BbColorInput.md +13 -1
- package/dist/ai/BbColorPalette.md +12 -7
- package/dist/ai/BbConfirm.md +1 -1
- package/dist/ai/BbDatePicker.md +13 -1
- package/dist/ai/BbDatePickerInput.md +18 -2
- package/dist/ai/BbDialog.md +6 -3
- package/dist/ai/BbDropdown.md +174 -77
- package/dist/ai/BbDropdownButton.md +37 -16
- package/dist/ai/BbGallery.md +3 -2
- package/dist/ai/BbIcon.md +10 -10
- package/dist/ai/BbNumberInput.md +3 -1
- package/dist/ai/BbOffCanvas.md +3 -2
- package/dist/ai/BbPopover.md +1 -1
- package/dist/ai/BbRadioGroup.md +4 -4
- package/dist/ai/BbSelect.md +227 -105
- package/dist/ai/BbSelectPopover.md +139 -14
- package/dist/ai/BbSwitchGroup.md +5 -4
- package/dist/ai/BbTable.md +18 -17
- package/dist/ai/BbTimePicker.md +13 -1
- package/dist/ai/BbTimePickerInput.md +16 -2
- package/dist/ai/BbToast.md +3 -2
- package/dist/ai/BbTree.md +5 -1
- package/dist/ai/CommonPopover.md +1 -0
- package/dist/ai/FlatListBox.md +1 -0
- package/dist/ai/GroupedListBox.md +3 -2
- package/dist/ai/ListBox.md +4 -2
- package/dist/ai/OptionsContainer.md +4 -4
- package/dist/ai/changelog.json +310 -7
- package/dist/ai/components.json +33 -35
- package/dist/ai/composables/useToast.md +2 -2
- package/dist/ai/design-tokens.json +60 -0
- package/dist/ai/guides/agent-contract.md +9 -5
- package/dist/ai/guides/calendars-and-digits.md +1 -1
- package/dist/ai/guides/design-tokens.md +13 -0
- package/dist/ai/guides/eslint-rules.md +1 -1
- package/dist/ai/guides/fetch-items-playbook.md +7 -11
- package/dist/ai/guides/icons-policy.md +32 -11
- package/dist/ai/guides/installation-and-plugin-setup.md +24 -23
- package/dist/ai/guides/migration/adoption-checklist.md +1 -1
- package/dist/ai/guides/migration/components/bb-color-palette.md +11 -11
- package/dist/ai/guides/migration/components/bb-dropdown-button.md +1 -0
- package/dist/ai/guides/migration/components/bb-dropdown.md +1 -0
- package/dist/ai/guides/migration/components/bb-icon.md +4 -4
- package/dist/ai/guides/migration/components/bb-table.md +2 -1
- package/dist/ai/guides/migration/components/bb-toast.md +2 -2
- package/dist/ai/guides/migration/v2-to-v3.md +70 -24
- package/dist/ai/guides/migration/v3-beta-css-classes.md +18 -3
- package/dist/ai/guides/migration/v3-beta-tooling.md +1 -0
- package/dist/ai/guides/passthrough.md +58 -58
- package/dist/ai/helpers/inertia/manifest.json +1 -1
- package/dist/ai/index.md +1 -1
- package/dist/ai/manifest/common.json +1 -0
- package/dist/ai/manifest/components/BbAvatar.json +5 -2
- package/dist/ai/manifest/components/BbAvatar.tree.json +32 -2
- package/dist/ai/manifest/components/BbCarousel.json +0 -3
- package/dist/ai/manifest/components/BbCheckboxGroup.json +2 -2
- package/dist/ai/manifest/components/BbCheckboxGroup.tree.json +2 -0
- package/dist/ai/manifest/components/BbColorInput.json +5 -2
- package/dist/ai/manifest/components/BbColorPalette.json +5 -2
- package/dist/ai/manifest/components/BbColorPalette.removed.json +1 -2
- package/dist/ai/manifest/components/BbDatePicker.json +3 -0
- package/dist/ai/manifest/components/BbDatePickerInput.json +3 -0
- package/dist/ai/manifest/components/BbDialog.tree.json +3 -1
- package/dist/ai/manifest/components/BbDropdown.json +36 -28
- package/dist/ai/manifest/components/BbDropdown.removed.json +2 -1
- package/dist/ai/manifest/components/BbDropdown.tree.json +21 -11
- package/dist/ai/manifest/components/BbDropdownButton.json +24 -16
- package/dist/ai/manifest/components/BbDropdownButton.removed.json +2 -1
- package/dist/ai/manifest/components/BbDropdownButton.tree.json +4 -0
- package/dist/ai/manifest/components/BbGallery.tree.json +1 -1
- package/dist/ai/manifest/components/BbOffCanvas.tree.json +3 -1
- package/dist/ai/manifest/components/BbRadioGroup.json +2 -2
- package/dist/ai/manifest/components/BbRadioGroup.tree.json +2 -0
- package/dist/ai/manifest/components/BbSelect.json +47 -40
- package/dist/ai/manifest/components/BbSelect.tree.json +2 -1
- package/dist/ai/manifest/components/BbSelectPopover.json +14 -7
- package/dist/ai/manifest/components/BbSelectPopover.tree.json +9 -2
- package/dist/ai/manifest/components/BbSwitchGroup.json +2 -2
- package/dist/ai/manifest/components/BbSwitchGroup.tree.json +2 -0
- package/dist/ai/manifest/components/BbTable.json +6 -6
- package/dist/ai/manifest/components/BbTable.tree.json +9 -1
- package/dist/ai/manifest/components/BbTimePicker.json +5 -2
- package/dist/ai/manifest/components/BbTimePickerInput.json +5 -2
- package/dist/ai/manifest/components/BbTree.json +1 -1
- package/dist/ai/manifest/components/CommonPopover.json +1 -0
- package/dist/ai/manifest/components/FlatListBox.json +2 -1
- package/dist/ai/manifest/components/GroupedListBox.json +3 -2
- package/dist/ai/manifest/components/GroupedListBox.tree.json +1 -0
- package/dist/ai/manifest/components/ListBox.json +3 -2
- package/dist/ai/manifest/components/ListBox.tree.json +1 -1
- package/dist/ai/manifest/components/OptionsContainer.json +6 -4
- package/dist/ai/manifest/index.json +2 -2
- package/dist/ai/manifest/meta.json +0 -3
- package/dist/ai/manifest/types.advanced.json +6 -6
- package/dist/ai/manifest/types.api.json +1 -3
- package/dist/ai/recipes/inertia/inline-edit-workspace.md +1 -1
- package/dist/ai/recipes/inertia/onboarding.md +1 -1
- package/dist/ai/recipes/nuxt/inline-edit-workspace.md +1 -1
- package/dist/ai/recipes/nuxt/onboarding.md +1 -1
- package/dist/ai/recipes/vue/inline-edit-workspace.md +1 -1
- package/dist/ai/recipes/vue/onboarding.md +2 -2
- package/dist/ai/source/BbAccordion.md +4 -5
- package/dist/ai/source/BbAvatar.md +128 -11
- package/dist/ai/source/BbBadge.md +18 -7
- package/dist/ai/source/BbBreadcrumbs.md +57 -56
- package/dist/ai/source/BbButton.md +41 -25
- package/dist/ai/source/BbCalendar.md +8 -6
- package/dist/ai/source/BbCarousel.md +41 -34
- package/dist/ai/source/BbCheckboxGroup.md +15 -9
- package/dist/ai/source/BbColorInput.md +19 -0
- package/dist/ai/source/BbColorPalette.md +23 -2
- package/dist/ai/source/BbDatePicker.md +18 -0
- package/dist/ai/source/BbDatePickerInput.md +47 -3
- package/dist/ai/source/BbDialog.md +14 -1
- package/dist/ai/source/BbDropdown.md +296 -99
- package/dist/ai/source/BbDropdownButton.md +61 -19
- package/dist/ai/source/BbDropdownGroup.md +189 -98
- package/dist/ai/source/BbGallery.md +82 -60
- package/dist/ai/source/BbHost.md +12 -0
- package/dist/ai/source/BbNumberInput.md +17 -10
- package/dist/ai/source/BbOffCanvas.md +14 -1
- package/dist/ai/source/BbPagination.md +12 -28
- package/dist/ai/source/BbRadioGroup.md +12 -5
- package/dist/ai/source/BbRating.md +4 -4
- package/dist/ai/source/BbSelect.md +151 -112
- package/dist/ai/source/BbSelectPopover.md +244 -29
- package/dist/ai/source/BbSwitchGroup.md +11 -4
- package/dist/ai/source/BbTable.md +114 -35
- package/dist/ai/source/BbTimePicker.md +19 -0
- package/dist/ai/source/BbTimePickerInput.md +21 -2
- package/dist/ai/source/BbToast.md +2 -2
- package/dist/ai/source/BbToastPortal.md +2 -2
- package/dist/ai/source/BbTree.md +1 -1
- package/dist/ai/source/ClearableButton.md +4 -2
- package/dist/ai/source/CommonPopover.md +24 -1
- package/dist/ai/source/ErrorIcon.md +4 -3
- package/dist/ai/source/FlatListBox.md +33 -7
- package/dist/ai/source/GroupedListBox.md +85 -14
- package/dist/ai/source/ListBox.md +11 -1
- package/dist/ai/source/OptionsContainer.md +29 -11
- package/dist/ai/source/WarningIcon.md +4 -3
- package/dist/assets/svgs/close.svg_raw.js +1 -1
- package/dist/components/BbAccordion/BbAccordion.vue.d.ts +1 -1
- package/dist/components/BbAccordion/BbAccordion.vue_vue_type_script_setup_true_lang.js +35 -34
- package/dist/components/BbAvatar/BbAvatar.vue.d.ts +1 -0
- package/dist/components/BbAvatar/BbAvatar.vue_vue_type_script_setup_true_lang.js +62 -43
- package/dist/components/BbAvatar/avatarIdentity.js +25 -0
- package/dist/components/BbAvatar/ptKeys.generated.d.ts +5 -1
- package/dist/components/BbAvatar/types.d.ts +24 -5
- package/dist/components/BbAvatar/types.js +5 -1
- package/dist/components/BbBadge/BadgeBodyContent.vue_vue_type_script_setup_true_lang.js +24 -23
- package/dist/components/BbBadge/BbBadge.vue_vue_type_script_setup_true_lang.js +66 -64
- package/dist/components/BbBreadcrumbs/BbBreadcrumbs.vue_vue_type_script_setup_true_lang.js +141 -146
- package/dist/components/BbButton/BbButton.vue_vue_type_script_setup_true_lang.js +100 -85
- package/dist/components/BbCalendar/BbCalendar.vue.d.ts +1 -1
- package/dist/components/BbCalendar/BbCalendar.vue_vue_type_script_setup_true_lang.js +240 -239
- package/dist/components/BbCalendar/useDayGrid.js +120 -123
- package/dist/components/BbCarousel/BbCarousel.vue_vue_type_script_setup_true_lang.js +503 -502
- package/dist/components/BbCheckboxGroup/BbCheckboxGroup.vue.d.ts +4 -4
- package/dist/components/BbCheckboxGroup/BbCheckboxGroup.vue_vue_type_script_setup_true_lang.js +126 -122
- package/dist/components/BbCheckboxGroup/types.d.ts +7 -11
- package/dist/components/BbColorInput/BbColorInput.vue.d.ts +2 -0
- package/dist/components/BbColorInput/BbColorInput.vue_vue_type_script_setup_true_lang.js +148 -141
- package/dist/components/BbColorInput/types.d.ts +7 -0
- package/dist/components/BbColorPalette/BbColorPalette.vue.d.ts +2 -0
- package/dist/components/BbColorPalette/BbColorPalette.vue_vue_type_script_setup_true_lang.js +208 -196
- package/dist/components/BbColorPalette/types.d.ts +7 -0
- package/dist/components/BbDatePicker/BbDatePicker.vue.d.ts +3 -1
- package/dist/components/BbDatePicker/BbDatePicker.vue_vue_type_script_setup_true_lang.js +84 -73
- package/dist/components/BbDatePicker/types.d.ts +7 -0
- package/dist/components/BbDatePickerInput/BbDatePickerInput.vue.d.ts +4 -2
- package/dist/components/BbDatePickerInput/BbDatePickerInput.vue_vue_type_script_setup_true_lang.js +496 -510
- package/dist/components/BbDatePickerInput/types.d.ts +7 -0
- package/dist/components/BbDialog/BbDialog.vue_vue_type_script_setup_true_lang.js +219 -211
- package/dist/components/BbDialog/leaveGhost.js +22 -17
- package/dist/components/BbDropdown/AdaptiveDropdown.vue_vue_type_script_setup_true_lang.js +106 -100
- package/dist/components/BbDropdown/BbDropdown.vue.d.ts +3 -0
- package/dist/components/BbDropdown/BbDropdown.vue_vue_type_script_setup_true_lang.js +416 -369
- package/dist/components/BbDropdown/BbDropdownList.vue_vue_type_script_setup_true_lang.js +404 -354
- package/dist/components/BbDropdown/DropdownFailures.vue.js +4 -0
- package/dist/components/BbDropdown/DropdownFailures.vue_vue_type_script_setup_true_lang.js +24 -0
- package/dist/components/BbDropdown/DropdownPipelineResolver.vue_vue_type_script_setup_true_lang.js +117 -102
- package/dist/components/BbDropdown/DropdownRow.vue_vue_type_script_setup_true_lang.js +67 -38
- package/dist/components/BbDropdown/normalizeGroups.js +6 -2
- package/dist/components/BbDropdown/ptKeys.generated.d.ts +44 -20
- package/dist/components/BbDropdown/types.d.ts +109 -87
- package/dist/components/BbDropdown/types.js +3 -0
- package/dist/components/BbDropdownButton/BbDropdownButton.vue.d.ts +3 -1
- package/dist/components/BbDropdownButton/BbDropdownButton.vue_vue_type_script_setup_true_lang.js +101 -65
- package/dist/components/BbDropdownButton/ptKeys.generated.d.ts +153 -57
- package/dist/components/BbDropdownButton/types.d.ts +23 -10
- package/dist/components/BbDropdownButton/types.js +4 -0
- package/dist/components/BbDropzone/BbDropzone.vue.d.ts +1 -1
- package/dist/components/BbGallery/BbGallery.vue_vue_type_script_setup_true_lang.js +335 -312
- package/dist/components/BbHost/BbHost.vue_vue_type_script_setup_true_lang.js +7 -1
- package/dist/components/BbIcon/iconCache.js +1 -1
- package/dist/components/BbNumberInput/BbNumberInput.vue.d.ts +1 -1
- package/dist/components/BbNumberInput/BbNumberInput.vue_vue_type_script_setup_true_lang.js +9 -5
- package/dist/components/BbOffCanvas/BbOffCanvas.vue_vue_type_script_setup_true_lang.js +152 -144
- package/dist/components/BbPagination/BbPagination.vue.d.ts +2 -2
- package/dist/components/BbPagination/BbPagination.vue_vue_type_script_setup_true_lang.js +138 -136
- package/dist/components/BbProgress/BbProgress.vue.d.ts +1 -1
- package/dist/components/BbRadioGroup/BbRadioGroup.vue.d.ts +4 -4
- package/dist/components/BbRadioGroup/BbRadioGroup.vue_vue_type_script_setup_true_lang.js +108 -104
- package/dist/components/BbRadioGroup/types.d.ts +4 -7
- package/dist/components/BbRating/BbRating.vue.d.ts +1 -1
- package/dist/components/BbRating/BbRating.vue_vue_type_script_setup_true_lang.js +100 -99
- package/dist/components/BbSelect/BbSelect.vue.d.ts +32 -20
- package/dist/components/BbSelect/BbSelect.vue_vue_type_script_setup_true_lang.js +217 -196
- package/dist/components/BbSelect/ptKeys.generated.d.ts +128 -96
- package/dist/components/BbSelect/types.d.ts +110 -111
- package/dist/components/BbSelect/types.js +1 -27
- package/dist/components/BbSelectPopover/BbSelectPopover.vue.d.ts +8 -3
- package/dist/components/BbSelectPopover/BbSelectPopover.vue_vue_type_script_setup_true_lang.js +728 -653
- package/dist/components/BbSelectPopover/ptKeys.generated.d.ts +22 -10
- package/dist/components/BbSelectPopover/types.d.ts +32 -17
- package/dist/components/BbSelectPopover/types.js +3 -1
- package/dist/components/BbSwitchGroup/BbSwitchGroup.vue.d.ts +1 -1
- package/dist/components/BbSwitchGroup/BbSwitchGroup.vue_vue_type_script_setup_true_lang.js +159 -155
- package/dist/components/BbSwitchGroup/types.d.ts +3 -6
- package/dist/components/BbTable/BbTable.vue.d.ts +2 -4
- package/dist/components/BbTable/BbTable.vue_vue_type_script_setup_true_lang.js +1171 -1152
- package/dist/components/BbTable/BbTableDataRow.js +97 -90
- package/dist/components/BbTable/types.d.ts +11 -10
- package/dist/components/BbTabs/BbTabs.vue.d.ts +3 -3
- package/dist/components/BbTimePicker/BbTimePicker.vue.d.ts +4 -2
- package/dist/components/BbTimePicker/BbTimePicker.vue_vue_type_script_setup_true_lang.js +145 -134
- package/dist/components/BbTimePicker/types.d.ts +7 -0
- package/dist/components/BbTimePickerInput/BbTimePickerInput.vue.d.ts +4 -2
- package/dist/components/BbTimePickerInput/BbTimePickerInput.vue_vue_type_script_setup_true_lang.js +290 -280
- package/dist/components/BbTimePickerInput/types.d.ts +7 -0
- package/dist/components/BbToast/BbToastMessage.vue_vue_type_script_setup_true_lang.js +79 -78
- package/dist/components/BbToast/types.d.ts +2 -2
- package/dist/components/BbTree/BbTreeLevel.vue_vue_type_script_setup_true_lang.js +56 -46
- package/dist/components/BbTree/types.d.ts +1 -1
- package/dist/components/ClearableButton/ClearableButton.vue_vue_type_script_setup_true_lang.js +9 -8
- package/dist/components/CloseIcon/CloseButton.vue.js +1 -1
- package/dist/components/CloseIcon/CloseButton.vue_vue_type_script_setup_true_lang.js +9 -7
- package/dist/components/CommonPopover/CommonPopover.vue_vue_type_script_setup_true_lang.js +13 -1
- package/dist/components/ErrorIcon/ErrorIcon.vue_vue_type_script_setup_true_lang.js +8 -6
- package/dist/components/FlatListBox/FlatListBox.vue_vue_type_script_setup_true_lang.js +122 -102
- package/dist/components/GroupedListBox/GroupedListBox.vue_vue_type_script_setup_true_lang.js +182 -153
- package/dist/components/ListBox/ListBox.vue_vue_type_script_setup_true_lang.js +7 -4
- package/dist/components/OptionsContainer/OptionsContainer.vue_vue_type_script_setup_true_lang.js +86 -77
- package/dist/components/WarningIcon/WarningIcon.vue_vue_type_script_setup_true_lang.js +8 -6
- package/dist/composables/useInternalIcon.js +25 -0
- package/dist/composables/useItemsGetter.js +34 -32
- package/dist/composables/useOpenModel.js +20 -0
- package/dist/deprecation/ai-deprecations.json.js +1 -1
- package/dist/i18n/locales/ar.json +2 -0
- package/dist/i18n/locales/cs.json +2 -0
- package/dist/i18n/locales/da.json +2 -0
- package/dist/i18n/locales/de-CH.json +2 -0
- package/dist/i18n/locales/de.json +2 -0
- package/dist/i18n/locales/el.json +2 -0
- package/dist/i18n/locales/en-GB.json +2 -0
- package/dist/i18n/locales/en.json +2 -0
- package/dist/i18n/locales/es-MX.json +2 -0
- package/dist/i18n/locales/es.json +2 -0
- package/dist/i18n/locales/fa.json +2 -0
- package/dist/i18n/locales/fi.json +2 -0
- package/dist/i18n/locales/fr.json +2 -0
- package/dist/i18n/locales/he.json +2 -0
- package/dist/i18n/locales/hu.json +2 -0
- package/dist/i18n/locales/it.json +2 -0
- package/dist/i18n/locales/ja.json +2 -0
- package/dist/i18n/locales/ko.json +2 -0
- package/dist/i18n/locales/nb.json +2 -0
- package/dist/i18n/locales/nl.json +2 -0
- package/dist/i18n/locales/pl.json +2 -0
- package/dist/i18n/locales/pt-BR.json +2 -0
- package/dist/i18n/locales/pt-PT.json +2 -0
- package/dist/i18n/locales/ro.json +2 -0
- package/dist/i18n/locales/ru.json +2 -0
- package/dist/i18n/locales/sv.json +2 -0
- package/dist/i18n/locales/tr.json +2 -0
- package/dist/i18n/locales/uk.json +2 -0
- package/dist/i18n/locales/zh-CN.json +2 -0
- package/dist/i18n/locales/zh-HK.json +2 -0
- package/dist/i18n/locales/zh-TW.json +2 -0
- package/dist/icon-scan.d.ts +1 -1
- package/dist/icon-scan.js +68 -61
- package/dist/index.d.ts +2 -2
- package/dist/llms-full.txt +1038 -451
- package/dist/llms-medium.txt +33 -28
- package/dist/llms.txt +2 -2
- package/dist/locale-blueprint.json +2 -0
- package/dist/nuxt.js +1 -1
- package/dist/styles.css +2 -2
- package/dist/types/ActionButton.d.ts +2 -3
- package/dist/types/Config.d.ts +8 -1
- package/dist/types/ConfigDefaults.d.ts +10 -2
- package/dist/types/Option.d.ts +10 -0
- package/dist/types/internalIcons.d.ts +89 -0
- package/dist/types/internalIcons.js +158 -0
- package/dist/types/ptComponentMap.d.ts +5 -5
- package/dist/utilities/functions/slotContent.js +19 -0
- package/dist/utils/configDefaults.js +75 -64
- package/dist/utils/iconsOption.js +48 -0
- package/dist/utils/loadRetry.js +8 -0
- package/dist/utils/versionCheck.js +1 -1
- package/dist/vite-plugin.d.ts +10 -16
- package/dist/vite.js +323 -307
- package/llms.txt +2 -2
- package/package.json +3 -1
- package/scripts/README.md +2 -0
- package/scripts/lib/adoption-checklist.json +1 -1
- package/scripts/lib/agent-setup.mjs +44 -26
- package/scripts/lib/update-install.mjs +48 -0
- package/scripts/lib/validate-bb-markup.mjs +93 -12
- package/dist/ai/manifest/components/BbAvatar.removed.json +0 -6
- package/dist/assets/svgs/caret_down.svg_raw.js +0 -3
|
@@ -5,61 +5,64 @@ import { useConfigDefaults as r } from "../../composables/useConfigDefaults.js";
|
|
|
5
5
|
import { clamp as i } from "../../utilities/functions/clamp.js";
|
|
6
6
|
import { hash as a } from "../../utilities/functions/hash.js";
|
|
7
7
|
import { isNil as o } from "../../utilities/functions/isNil.js";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import ce from "
|
|
23
|
-
import
|
|
24
|
-
import {
|
|
25
|
-
import ge from "
|
|
26
|
-
import _e from "./
|
|
27
|
-
import ve from "./
|
|
28
|
-
import ye from "./
|
|
29
|
-
import
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
40
|
-
import at from "
|
|
41
|
-
import
|
|
42
|
-
import {
|
|
8
|
+
import { slotContent as s } from "../../utilities/functions/slotContent.js";
|
|
9
|
+
import { when as c } from "../../utilities/functions/when.js";
|
|
10
|
+
import { useId as l } from "../../composables/useId.js";
|
|
11
|
+
import { useItemValue as u } from "../../composables/useItemValue.js";
|
|
12
|
+
import { useItemsGetter as d } from "../../composables/useItemsGetter.js";
|
|
13
|
+
import { SsrMarker as f } from "../../composables/ssrMarker.js";
|
|
14
|
+
import { usePrefill as p } from "../../composables/usePrefill.js";
|
|
15
|
+
import { useIndexById as ee } from "../../composables/useIndexById.js";
|
|
16
|
+
import { useBaseOptions as te } from "../../composables/useBaseOptions.js";
|
|
17
|
+
import { useHashedWatcher as ne } from "../../composables/useHashedWatcher.js";
|
|
18
|
+
import { useTableWidthContext as re } from "../../composables/useTableWidthContext.js";
|
|
19
|
+
import { useLocale as ie } from "../../composables/useLocale.js";
|
|
20
|
+
import { removedPropsFor as ae } from "../../deprecation/removedProps.js";
|
|
21
|
+
import { warnRemovedAttrs as oe } from "../../utilities/functions/warnRemovedAttrs.js";
|
|
22
|
+
import { parseCount as se, parsePositiveInteger as ce } from "../../utilities/functions/parsePaginationNumber.js";
|
|
23
|
+
import le from "../BbBaseCheckboxIcon/BbBaseCheckboxIcon.vue.js";
|
|
24
|
+
import { useToggleFocus as ue } from "../../composables/useToggleInput.js";
|
|
25
|
+
import { preventReadonlyClick as de, preventReadonlyKeydown as fe, revertReadonlyChange as pe, syncCheckedToData as me, syncIndeterminate as he, toggleInputAttrs as ge } from "../../utilities/functions/toggleInput.js";
|
|
26
|
+
import _e from "./BbTableDataRow.js";
|
|
27
|
+
import ve from "./BbTableExpandRow.js";
|
|
28
|
+
import ye from "./BbTableEdgeRow.js";
|
|
29
|
+
import be from "./BbTableRowMenu.js";
|
|
30
|
+
import { hasVisibleRow as xe } from "../BbDropdown/normalizeGroups.js";
|
|
31
|
+
import { pressedInteractive as Se, useRowReorder as Ce } from "./useRowReorder.js";
|
|
32
|
+
import { BB_TABLE_PT as we } from "./types.js";
|
|
33
|
+
import { usePassthrough as Te } from "../../composables/usePassthrough.js";
|
|
34
|
+
import { applyFixedTableColumns as Ee, cellRole as De, columnKeyToSlotName as Oe, completeColumnOrder as ke, estimateFromProfile as Ae, estimateSamples as je, fitFloors as Me, floorTextPx as Ne, lockColumnOrder as Pe, mergeCellClasses as Fe, mergeHeaderClasses as Ie, mergeRowClasses as Le, moveColumnKey as Re, orderColumns as ze, profileValues as Be, readResolvedTracks as Ve, reorderRange as He, rowNameText as Ue, sameColumnOrder as We, sampleForEstimate as Ge } from "./utils.js";
|
|
35
|
+
import { createMeasuredFloors as Ke } from "./measuredFloors.js";
|
|
36
|
+
import { useBbTableHost as qe } from "../../composables/useBbTable.js";
|
|
37
|
+
import { useLogger as Je } from "../../composables/useLogger.js";
|
|
38
|
+
import { flowsRtl as Ye, isRtl as Xe } from "../../composables/useDirection.js";
|
|
39
|
+
import { escapeStackDepth as Ze, isTopEscapeEntry as Qe, pushEscapeEntry as $e, removeEscapeEntry as et } from "../../utils/overlayEscapeStack.js";
|
|
40
|
+
import { GRID_FOCUSABLE as tt, GRID_MANAGED_ATTR as nt, cellWidgets as rt, restoreTabOrder as it, takeOutOfTabOrder as at } from "./gridWidgets.js";
|
|
41
|
+
import ot from "../BbBaseButton/BbBaseButton.vue.js";
|
|
42
|
+
import { runRetry as st } from "../../utils/loadRetry.js";
|
|
43
|
+
import { useInternalIcon as ct } from "../../composables/useInternalIcon.js";
|
|
44
|
+
import { Fragment as lt, computed as m, createBlock as ut, createCommentVNode as h, createElementBlock as g, createElementVNode as _, createTextVNode as dt, createVNode as ft, defineComponent as v, getCurrentInstance as pt, guardReactiveProps as mt, isReactive as ht, mergeModels as gt, mergeProps as y, nextTick as b, normalizeClass as _t, normalizeProps as vt, normalizeStyle as yt, onBeforeUnmount as x, onBeforeUpdate as bt, onDeactivated as xt, onMounted as St, onUpdated as Ct, openBlock as S, reactive as wt, ref as C, renderList as Tt, renderSlot as Et, resolveDynamicComponent as Dt, shallowRef as Ot, toDisplayString as w, toRaw as kt, toRef as At, unref as T, useAttrs as jt, useModel as Mt, useSlots as Nt, watch as E, watchEffect as Pt, withCtx as Ft, withModifiers as It } from "vue";
|
|
45
|
+
import { defaultRangeExtractor as Lt, elementScroll as Rt, observeElementOffset as zt, observeElementRect as Bt, observeWindowOffset as Vt, observeWindowRect as Ht, useVirtualizer as Ut, windowScroll as Wt } from "@tanstack/vue-virtual";
|
|
43
46
|
// src/components/BbTable/BbTable.vue?vue&type=script&setup=true&lang.ts
|
|
44
|
-
var
|
|
47
|
+
var Gt = {
|
|
45
48
|
key: 0,
|
|
46
49
|
class: "bb-sr-only"
|
|
47
|
-
},
|
|
50
|
+
}, Kt = ["id", "hidden"], qt = ["id"], Jt = ["id"], Yt = {
|
|
48
51
|
"aria-live": "polite",
|
|
49
52
|
class: "bb-table-loading__text bb-sr-only",
|
|
50
53
|
role: "status"
|
|
51
|
-
},
|
|
54
|
+
}, Xt = ["id"], Zt = {
|
|
52
55
|
"aria-live": "polite",
|
|
53
56
|
class: "bb-table__row-reorder-status bb-sr-only",
|
|
54
57
|
role: "status"
|
|
55
|
-
},
|
|
58
|
+
}, Qt = {
|
|
56
59
|
"aria-live": "polite",
|
|
57
60
|
class: "bb-table__reorder-status bb-sr-only",
|
|
58
61
|
role: "status"
|
|
59
|
-
},
|
|
62
|
+
}, $t = ["inert"], en = ["aria-rowindex"], tn = ["tabindex"], nn = { class: "bb-table-header__content bb-sr-only" }, rn = ["tabindex"], an = { class: "bb-table-header__content" }, on = { class: "bb-table-check__label-text bb-sr-only" }, sn = {
|
|
60
63
|
key: 1,
|
|
61
64
|
class: "bb-table-radio__label-text bb-sr-only"
|
|
62
|
-
},
|
|
65
|
+
}, cn = [
|
|
63
66
|
"aria-describedby",
|
|
64
67
|
"aria-sort",
|
|
65
68
|
"data-column-key",
|
|
@@ -68,28 +71,34 @@ var Ht = {
|
|
|
68
71
|
"onFocus",
|
|
69
72
|
"onKeydown",
|
|
70
73
|
"onMousedown"
|
|
71
|
-
],
|
|
74
|
+
], ln = { class: "bb-table-header__content" }, un = {
|
|
72
75
|
key: 1,
|
|
73
76
|
class: "bb-table-header__content"
|
|
74
|
-
},
|
|
77
|
+
}, dn = ["onDblclick", "onPointerdown"], fn = ["tabindex"], pn = { class: "bb-table-header__content bb-sr-only" }, mn = ["aria-rowindex"], hn = ["role"], gn = ["role"], _n = ["role"], vn = {
|
|
75
78
|
key: 0,
|
|
76
79
|
class: "bb-table-skeleton__cell-content"
|
|
77
|
-
},
|
|
80
|
+
}, yn = {
|
|
78
81
|
key: 1,
|
|
79
82
|
class: "bb-table-skeleton__avatar"
|
|
80
|
-
},
|
|
83
|
+
}, bn = {
|
|
81
84
|
key: 2,
|
|
82
85
|
class: "bb-table-skeleton__avatar-text"
|
|
83
|
-
},
|
|
86
|
+
}, xn = { class: "bb-table-skeleton__cell-content" }, Sn = {
|
|
84
87
|
key: 3,
|
|
85
88
|
class: "bb-table-skeleton__image"
|
|
86
|
-
},
|
|
89
|
+
}, Cn = {
|
|
87
90
|
key: 4,
|
|
88
91
|
class: "bb-table-skeleton__badge"
|
|
89
|
-
},
|
|
92
|
+
}, wn = ["role"], Tn = ["aria-rowindex"], En = ["aria-colspan", "role"], Dn = {
|
|
93
|
+
key: 0,
|
|
94
|
+
class: "bb-table-empty__content bb-table-empty__content--failed"
|
|
95
|
+
}, On = { class: "bb-table-empty__failed" }, kn = { class: "bb-table-empty__text" }, An = {
|
|
96
|
+
key: 1,
|
|
97
|
+
class: "bb-table-empty__content"
|
|
98
|
+
}, jn = { class: "bb-table-empty__text" }, Mn = ["data-index"], Nn = ["role"], Pn = "__bb-row-drag", Fn = 500, In = 10, Ln = 1e3, Rn = 48, zn = 10, Bn = "bb-table-resizing", Vn = 5, Hn = 10, Un = 500, Wn = 40, Gn = 12, Kn = 4, qn = 12, Jn = "a, button:not(.bb-table-sort), input, select, textarea, [contenteditable], [role=\"button\"], .bb-table-header__resizer", Yn = 12, Xn = 10, Zn = "a[href], button:not([disabled]), input:not([disabled]):not([type=\"hidden\"]), select:not([disabled]), textarea:not([disabled]), summary, [contenteditable]:not([contenteditable=\"false\"]), [tabindex]:not([tabindex=\"-1\"])", Qn = 600, $n = -1, er = -2, tr = -3, nr = 120, rr = 6, ir = 800, ar = 120, or = 10, D = /*@__PURE__*/ v({
|
|
90
99
|
inheritAttrs: !1,
|
|
91
100
|
__name: "BbTable",
|
|
92
|
-
props: /*@__PURE__*/
|
|
101
|
+
props: /*@__PURE__*/ gt({
|
|
93
102
|
"pt:root": {},
|
|
94
103
|
"pt:root:empty": {},
|
|
95
104
|
"pt:root:loading": {},
|
|
@@ -253,7 +262,7 @@ var Ht = {
|
|
|
253
262
|
},
|
|
254
263
|
highlightedModifiers: {}
|
|
255
264
|
}),
|
|
256
|
-
emits: /*@__PURE__*/
|
|
265
|
+
emits: /*@__PURE__*/ gt([
|
|
257
266
|
"click:row",
|
|
258
267
|
"contextmenu:row",
|
|
259
268
|
"dblclick:row",
|
|
@@ -275,75 +284,75 @@ var Ht = {
|
|
|
275
284
|
"update:order",
|
|
276
285
|
"update:highlighted"
|
|
277
286
|
]),
|
|
278
|
-
setup(v, { emit:
|
|
279
|
-
let D =
|
|
287
|
+
setup(v, { emit: gt }) {
|
|
288
|
+
let D = Mt(v, "selectAll"), sr = Mt(v, "sort"), cr = Mt(v, "order"), lr = Mt(v, "highlighted"), O = v, k = gt, A = Nt(), ur = ct("move", t), dr = ct("sortAsc", n), fr = ct("sortDesc", ""), pr = ct("dragHandle", ""), mr = Mt(O, "expandedItems"), hr = r("BbTable", O, { compact: !1 }), j = Te({
|
|
280
289
|
component: "BbTable",
|
|
281
|
-
attrs:
|
|
290
|
+
attrs: jt(),
|
|
282
291
|
props: O,
|
|
283
|
-
parts:
|
|
284
|
-
states:
|
|
292
|
+
parts: we.parts,
|
|
293
|
+
states: we.states,
|
|
285
294
|
active: {
|
|
286
|
-
loading: () =>
|
|
295
|
+
loading: () => ss.value,
|
|
287
296
|
empty: () => !J.value.length
|
|
288
297
|
}
|
|
289
|
-
}),
|
|
298
|
+
}), gr = (e) => ({
|
|
290
299
|
sorted: !!e,
|
|
291
300
|
sortedDesc: e === "desc"
|
|
292
301
|
});
|
|
293
|
-
process.env.NODE_ENV !== "production" &&
|
|
302
|
+
process.env.NODE_ENV !== "production" && oe("BbTable", ae("BbTable"), {
|
|
294
303
|
slotKeys: () => (O.columns ?? []).map((e) => e.key),
|
|
295
304
|
fixedSlots: ["header:prepend", "header:append"]
|
|
296
305
|
});
|
|
297
|
-
let M = C(!!A.actions),
|
|
298
|
-
|
|
299
|
-
let e =
|
|
300
|
-
e !==
|
|
306
|
+
let M = C(!!A.actions), _r = C(!!A.expand), vr = C(!!A.tbody), yr = C(!!A.thead), br = () => Object.keys(A).filter((e) => /:(first|last)$/.test(e)).sort().join(" "), xr = C(br());
|
|
307
|
+
bt(() => {
|
|
308
|
+
let e = br();
|
|
309
|
+
e !== xr.value && (xr.value = e);
|
|
301
310
|
let t = !!A.actions;
|
|
302
|
-
t !== M.value && (M.value = t), !!A.expand !==
|
|
311
|
+
t !== M.value && (M.value = t), !!A.expand !== _r.value && (_r.value = !!A.expand), !!A.tbody !== vr.value && (vr.value = !!A.tbody), !!A.thead !== yr.value && (yr.value = !!A.thead);
|
|
303
312
|
});
|
|
304
|
-
let N = m(() => !!O.keyboardNavigation && !
|
|
305
|
-
O.multiple && !Array.isArray(O.modelValue) &&
|
|
306
|
-
let
|
|
313
|
+
let N = m(() => !!O.keyboardNavigation && !vr.value), Sr = m(() => N.value && _r.value), Cr = m(() => Sr.value ? "treegrid" : N.value ? "grid" : "table"), wr = m(() => N.value ? "gridcell" : "cell"), Tr = m(() => new Set(O.columns.filter((e) => e.rowHeader).map((e) => String(e.key)))), Er = m(() => N.value && !yr.value), { getItemValue: Dr } = u(), Or = l().id.value, kr = (e) => `expanded_${Or}_${e}`;
|
|
314
|
+
O.multiple && !Array.isArray(O.modelValue) && Je().throw("BbTable is set for multiple selection but modelValue is not an array.");
|
|
315
|
+
let Ar = ["actions", "select"];
|
|
307
316
|
if (process.env.NODE_ENV !== "production") {
|
|
308
|
-
let e = O.columns.filter((e) =>
|
|
309
|
-
for (let t of e)
|
|
317
|
+
let e = O.columns.filter((e) => Ar.includes(e.key));
|
|
318
|
+
for (let t of e) Je().warn(`BbTable: \`{ key: '${String(t.key)}' }\` is a reserved column and must not appear in \`columns\`. ` + (t.key === "actions" ? "Fill the `#actions` slot instead — the slot creates the column." : "Selection is controlled by the `selectable` prop."));
|
|
310
319
|
}
|
|
311
|
-
let { t:
|
|
320
|
+
let { t: P } = ie(), F = C(), I = C(), { id: jr, parentId: Mr, parentNode: Nr, node: Pr, cssVars: Fr, parentVar: Ir, setTracks: Lr } = re({
|
|
312
321
|
id: () => O.id,
|
|
313
|
-
container: () =>
|
|
322
|
+
container: () => I.value,
|
|
314
323
|
inheritFrom: () => typeof O.inheritColumnWidths == "string" ? O.inheritColumnWidths : void 0
|
|
315
|
-
}),
|
|
324
|
+
}), Rr = m(() => `${jr.value}__caption`), zr = m(() => `${jr.value}__header_instructions`), Br = m(() => `${jr.value}__sort_instructions`), Vr = m(() => !O.multiSort && O.columns.some((e) => e.sortable)), Hr = (e) => {
|
|
316
325
|
let t = [];
|
|
317
|
-
return
|
|
318
|
-
},
|
|
319
|
-
bodyRef:
|
|
320
|
-
containerRef:
|
|
321
|
-
enabled: () =>
|
|
326
|
+
return Ur.value && t.push(zr.value), Vr.value && e.sortable && (Ur.value || Er.value) && t.push(Br.value), t.join(" ") || void 0;
|
|
327
|
+
}, Ur = m(() => !!(O.reorderable || O.resizable)), L = C(null), Wr = C(null), R = m(() => !!O.reorderableRows && !vr.value), Gr = m(() => `${jr.value}__row-reorder-instructions`), Kr = Ce({
|
|
328
|
+
bodyRef: L,
|
|
329
|
+
containerRef: I,
|
|
330
|
+
enabled: () => R.value && !cs.value,
|
|
322
331
|
count: () => Y.value.length,
|
|
323
332
|
indexOf: (e) => Y.value.findIndex((t) => t.valueHash === e),
|
|
324
333
|
itemAt: (e) => {
|
|
325
|
-
let t =
|
|
326
|
-
return !Array.isArray(O.items) ||
|
|
334
|
+
let t = kt(Y.value[e]?.item);
|
|
335
|
+
return !Array.isArray(O.items) || ht(O.items) ? t : O.items.find((e) => kt(e) === t) ?? t;
|
|
327
336
|
},
|
|
328
337
|
valueHashAt: (e) => Y.value[e]?.valueHash,
|
|
329
|
-
spanOf: (e) => q.value ?
|
|
330
|
-
labelAt: (e) => Y.value[e] ?
|
|
338
|
+
spanOf: (e) => q.value ? Dl(e) : null,
|
|
339
|
+
labelAt: (e) => Y.value[e] ? Ue(Fc(e).cols, Tr.value) : "",
|
|
331
340
|
emit: (e) => k("reorder:rows", e),
|
|
332
341
|
text: {
|
|
333
|
-
lifted: (e, t, n) =>
|
|
334
|
-
position: (e, t) =>
|
|
335
|
-
dropped: (e, t, n) =>
|
|
336
|
-
cancelled: (e, t, n) =>
|
|
342
|
+
lifted: (e, t, n) => P("table.rowLifted", e, t, n).value,
|
|
343
|
+
position: (e, t) => P("table.rowPosition", e, t).value,
|
|
344
|
+
dropped: (e, t, n) => P("table.rowDropped", e, t, n).value,
|
|
345
|
+
cancelled: (e, t, n) => P("table.rowMoveCancelled", e, t, n).value
|
|
337
346
|
}
|
|
338
347
|
});
|
|
339
|
-
x(
|
|
340
|
-
let
|
|
341
|
-
|
|
342
|
-
},
|
|
343
|
-
|
|
348
|
+
x(Kr.stop);
|
|
349
|
+
let qr = (e) => {
|
|
350
|
+
R.value && Kr.onBodyPointerDown(e), li(e);
|
|
351
|
+
}, Jr = C(null), Yr = Ot([]), Xr = wt(/* @__PURE__ */ new Set()), Zr = null, Qr = 0, $r = !1, ei = !1, ti = null, ni = () => {
|
|
352
|
+
ti && clearTimeout(ti.timer), ti = null;
|
|
344
353
|
};
|
|
345
|
-
x(
|
|
346
|
-
let
|
|
354
|
+
x(ni);
|
|
355
|
+
let ri = (e, t, n) => {
|
|
347
356
|
let r = e.getBoundingClientRect(), i = t - r.left, a = n - r.top;
|
|
348
357
|
return {
|
|
349
358
|
contextElement: e,
|
|
@@ -362,182 +371,183 @@ var Ht = {
|
|
|
362
371
|
};
|
|
363
372
|
}
|
|
364
373
|
};
|
|
365
|
-
},
|
|
374
|
+
}, ii = (e) => {
|
|
366
375
|
let t = e.target;
|
|
367
376
|
if (!(t instanceof Element)) return null;
|
|
368
377
|
let n = t.closest(".bb-table__row");
|
|
369
|
-
return !n || n.closest(".bb-table__body") !==
|
|
370
|
-
},
|
|
378
|
+
return !n || n.closest(".bb-table__body") !== L.value || Se(e, n) ? null : n;
|
|
379
|
+
}, ai = (e, t, n, r) => {
|
|
371
380
|
let i = new MouseEvent("contextmenu", {
|
|
372
381
|
bubbles: !0,
|
|
373
382
|
cancelable: !0,
|
|
374
383
|
clientX: t,
|
|
375
384
|
clientY: n
|
|
376
385
|
});
|
|
377
|
-
|
|
386
|
+
Zr = r;
|
|
378
387
|
try {
|
|
379
388
|
e.dispatchEvent(i);
|
|
380
389
|
} finally {
|
|
381
|
-
|
|
390
|
+
Zr = null;
|
|
382
391
|
}
|
|
383
392
|
return i.defaultPrevented;
|
|
384
|
-
},
|
|
385
|
-
let r =
|
|
393
|
+
}, oi = (e, t, n) => {
|
|
394
|
+
let r = Zr;
|
|
386
395
|
if (!O.rowMenu || e.defaultPrevented) return;
|
|
387
|
-
if (e.isTrusted &&
|
|
396
|
+
if (e.isTrusted && Xr.has(t) && performance.now() - Qr < 1e3) {
|
|
388
397
|
e.preventDefault(), e.stopPropagation();
|
|
389
398
|
return;
|
|
390
399
|
}
|
|
391
400
|
let i = O.rowMenu(n);
|
|
392
|
-
if (!
|
|
393
|
-
e.preventDefault(), e.stopPropagation(), r && (
|
|
401
|
+
if (!xe(i)) return;
|
|
402
|
+
e.preventDefault(), e.stopPropagation(), r && (Qr = performance.now());
|
|
394
403
|
let a = e.currentTarget, o = document.activeElement, s = o instanceof HTMLElement && a.contains(o) ? o : null;
|
|
395
|
-
|
|
396
|
-
let c =
|
|
404
|
+
ei = !0, Xr.clear(), Xr.add(t), Yr.value = i;
|
|
405
|
+
let c = ri(a, e.clientX, e.clientY);
|
|
397
406
|
b(async () => {
|
|
398
|
-
await
|
|
407
|
+
await Jr.value?.open(c, r === "keyboard" ? "keyboard" : "pointer", s), ei = !1;
|
|
399
408
|
});
|
|
400
|
-
},
|
|
401
|
-
!
|
|
402
|
-
},
|
|
403
|
-
if (!O.rowMenu || e.key !== "ContextMenu" && !(e.key === "F10" && e.shiftKey) || !
|
|
409
|
+
}, si = () => {
|
|
410
|
+
!ei && !Jr.value?.isOpen() && Xr.clear();
|
|
411
|
+
}, ci = (e) => {
|
|
412
|
+
if (!O.rowMenu || e.key !== "ContextMenu" && !(e.key === "F10" && e.shiftKey) || !ii(e)) return;
|
|
404
413
|
let t = e.target, n = t.getBoundingClientRect();
|
|
405
|
-
|
|
406
|
-
},
|
|
407
|
-
if (
|
|
414
|
+
ai(t, n.left, n.bottom, "keyboard") && e.preventDefault();
|
|
415
|
+
}, li = (e) => {
|
|
416
|
+
if ($r = !1, ni(), !O.rowMenu || e.pointerType !== "touch" || !ii(e)) return;
|
|
408
417
|
let t = e.target, { clientX: n, clientY: r } = e;
|
|
409
|
-
|
|
418
|
+
ti = {
|
|
410
419
|
x: n,
|
|
411
420
|
y: r,
|
|
412
421
|
timer: setTimeout(() => {
|
|
413
|
-
|
|
414
|
-
},
|
|
422
|
+
ti = null, t.isConnected && ai(t, n, r, "touch") && ($r = !0);
|
|
423
|
+
}, Fn)
|
|
415
424
|
};
|
|
416
|
-
},
|
|
425
|
+
}, ui = [
|
|
417
426
|
[
|
|
418
427
|
"click",
|
|
419
428
|
(e) => {
|
|
420
|
-
|
|
429
|
+
$r && ($r = !1, e.preventDefault(), e.stopPropagation());
|
|
421
430
|
},
|
|
422
431
|
!0
|
|
423
432
|
],
|
|
424
433
|
[
|
|
425
434
|
"keydown",
|
|
426
|
-
|
|
435
|
+
ci,
|
|
427
436
|
!1
|
|
428
437
|
],
|
|
429
438
|
[
|
|
430
439
|
"pointercancel",
|
|
431
|
-
|
|
440
|
+
ni,
|
|
432
441
|
!1
|
|
433
442
|
],
|
|
434
443
|
[
|
|
435
444
|
"pointermove",
|
|
436
445
|
(e) => {
|
|
437
|
-
|
|
446
|
+
ti && Math.hypot(e.clientX - ti.x, e.clientY - ti.y) > In && ni();
|
|
438
447
|
},
|
|
439
448
|
!1
|
|
440
449
|
],
|
|
441
450
|
[
|
|
442
451
|
"pointerup",
|
|
443
|
-
|
|
452
|
+
ni,
|
|
444
453
|
!1
|
|
445
454
|
],
|
|
446
455
|
[
|
|
447
456
|
"touchend",
|
|
448
457
|
(e) => {
|
|
449
|
-
|
|
458
|
+
$r && e.cancelable && e.preventDefault();
|
|
450
459
|
},
|
|
451
460
|
!1
|
|
452
461
|
]
|
|
453
462
|
];
|
|
454
|
-
|
|
455
|
-
for (let [e, t, n] of
|
|
463
|
+
St(() => {
|
|
464
|
+
for (let [e, t, n] of ui) L.value?.addEventListener(e, t, { capture: n });
|
|
456
465
|
}), x(() => {
|
|
457
|
-
for (let [e, t, n] of
|
|
466
|
+
for (let [e, t, n] of ui) L.value?.removeEventListener(e, t, { capture: n });
|
|
458
467
|
});
|
|
459
|
-
let
|
|
460
|
-
describedBy:
|
|
461
|
-
nameFor: (e) =>
|
|
462
|
-
onKeydown:
|
|
463
|
-
|
|
464
|
-
|
|
468
|
+
let di = m(() => R.value ? {
|
|
469
|
+
describedBy: Gr.value,
|
|
470
|
+
nameFor: (e) => P("table.moveRow", e).value.trim(),
|
|
471
|
+
onKeydown: Kr.onKeydown,
|
|
472
|
+
icon: pr.value
|
|
473
|
+
} : null), fi = C(/* @__PURE__ */ new Set()), pi = m(() => {
|
|
474
|
+
let e = new Set(fi.value);
|
|
465
475
|
for (let t of O.columns) t.hidden && e.add(String(t.key));
|
|
466
476
|
return e;
|
|
467
|
-
}),
|
|
468
|
-
let e =
|
|
477
|
+
}), mi = m(() => {
|
|
478
|
+
let e = pi.value;
|
|
469
479
|
return e.size ? O.columns.filter((t) => !e.has(String(t.key))) : O.columns;
|
|
470
|
-
}),
|
|
471
|
-
if (
|
|
472
|
-
let t =
|
|
473
|
-
|
|
480
|
+
}), hi = (e) => {
|
|
481
|
+
if (pi.value.has(e)) return;
|
|
482
|
+
let t = ki(e), n = B.value.indexOf(e), r = !!t && t.contains(document.activeElement) && (Ur.value || Er.value);
|
|
483
|
+
fi.value = /* @__PURE__ */ new Set([...fi.value, e]), k("hide:column", e), r && b(() => Ai(n));
|
|
474
484
|
};
|
|
475
485
|
E(() => O.columns.map((e) => [String(e.key), !!e.hidden]), (e, t) => {
|
|
476
|
-
if (!t || !
|
|
477
|
-
let n = new Map(t), r =
|
|
486
|
+
if (!t || !fi.value.size) return;
|
|
487
|
+
let n = new Map(t), r = fi.value, i = e.filter(([e, t]) => n.has(e) && n.get(e) !== t && r.has(e) && !t);
|
|
478
488
|
if (!i.length) return;
|
|
479
489
|
let a = new Set(r);
|
|
480
490
|
for (let [e] of i) a.delete(e);
|
|
481
|
-
|
|
491
|
+
fi.value = a;
|
|
482
492
|
});
|
|
483
|
-
let
|
|
484
|
-
let e =
|
|
493
|
+
let gi = m(() => O.columns.map((e) => String(e.key))), _i = m(() => new Set(O.columns.filter((e) => e.reorderable === !1).map((e) => String(e.key)))), vi = (e) => _i.value.size ? Pe(ke(e, gi.value), gi.value, _i.value) : ke(e, gi.value), yi = C(null), z = m(() => {
|
|
494
|
+
let e = mi.value, t = yi.value ?? cr.value;
|
|
485
495
|
if (!t.length) return e;
|
|
486
|
-
let n =
|
|
496
|
+
let n = _i.value.size ? vi(t) : t, r = ze(e, n);
|
|
487
497
|
return r.every((t, n) => t === e[n]) ? e : r;
|
|
488
|
-
}),
|
|
489
|
-
let n =
|
|
498
|
+
}), B = m(() => z.value.map((e) => String(e.key))), bi = (e, t) => {
|
|
499
|
+
let n = vi(cr.value), r = xi(e, t);
|
|
490
500
|
if (r === null) return null;
|
|
491
|
-
let i =
|
|
492
|
-
return
|
|
493
|
-
},
|
|
494
|
-
let n =
|
|
501
|
+
let i = Re(n, gi.value, e, r, pi.value);
|
|
502
|
+
return We(i, n) ? null : i;
|
|
503
|
+
}, xi = (e, t) => {
|
|
504
|
+
let n = B.value, r = He(n, n.indexOf(e), _i.value);
|
|
495
505
|
return r ? Math.max(r.min, Math.min(r.max, t)) : null;
|
|
496
|
-
},
|
|
506
|
+
}, Si = C("");
|
|
497
507
|
E(() => O.reorderable, () => {
|
|
498
|
-
|
|
508
|
+
Si.value = "";
|
|
499
509
|
});
|
|
500
|
-
let
|
|
501
|
-
let n =
|
|
502
|
-
r < 0 || r === t || (
|
|
503
|
-
},
|
|
504
|
-
let e =
|
|
510
|
+
let Ci = (e, t) => {
|
|
511
|
+
let n = z.value, r = n.findIndex((t) => String(t.key) === e);
|
|
512
|
+
r < 0 || r === t || (Si.value = P("table.columnMoved", n[r].label, r + 1, n.length).value);
|
|
513
|
+
}, wi = C(null), Ti = m(() => {
|
|
514
|
+
let e = B.value, t = wi.value;
|
|
505
515
|
return t !== null && e.includes(t) ? t : e[0] ?? null;
|
|
506
|
-
}),
|
|
516
|
+
}), Ei = (e, t) => {
|
|
507
517
|
if (!t.sortable) return;
|
|
508
518
|
let n = e.target;
|
|
509
519
|
if (!(n instanceof Element)) return;
|
|
510
520
|
let r = e.currentTarget;
|
|
511
521
|
if (!r.contains(n) || n.closest(".bb-table-sort")) return;
|
|
512
|
-
let i = n.closest(
|
|
513
|
-
i && r.contains(i) || (e.shiftKey || !window.getSelection()?.toString()) &&
|
|
514
|
-
},
|
|
522
|
+
let i = n.closest(Jn);
|
|
523
|
+
i && r.contains(i) || (e.shiftKey || !window.getSelection()?.toString()) && za(t.key, e);
|
|
524
|
+
}, Di = (e, t) => {
|
|
515
525
|
if (!t.sortable || !e.shiftKey) return;
|
|
516
526
|
let n = e.target;
|
|
517
527
|
if (!(n instanceof Element)) return;
|
|
518
|
-
let r = n.closest(
|
|
528
|
+
let r = n.closest(Jn), i = e.currentTarget;
|
|
519
529
|
r && i.contains(r) || window.getSelection()?.removeAllRanges();
|
|
520
|
-
},
|
|
521
|
-
|
|
522
|
-
},
|
|
523
|
-
let t =
|
|
524
|
-
n && (
|
|
525
|
-
},
|
|
526
|
-
|
|
527
|
-
let n =
|
|
528
|
-
if (!
|
|
530
|
+
}, Oi = (e) => {
|
|
531
|
+
Ur.value && (wi.value = e);
|
|
532
|
+
}, ki = (e) => F.value?.querySelector(`:scope > .bb-table__head > .bb-table__header-row > [data-column-key="${CSS.escape(e)}"]`) ?? null, Ai = (e) => {
|
|
533
|
+
let t = B.value, n = t[Math.max(0, Math.min(t.length - 1, e))];
|
|
534
|
+
n && (wi.value = n, ki(n)?.focus());
|
|
535
|
+
}, ji = async (e, t) => {
|
|
536
|
+
La = (e.key === "Enter" || e.key === " ") && e.shiftKey;
|
|
537
|
+
let n = Er.value;
|
|
538
|
+
if (!Ur.value && !n) return;
|
|
529
539
|
let r = e.currentTarget, i = e.target;
|
|
530
540
|
if (!(i instanceof Element) || i !== r && !i.closest(".bb-table-sort")) return;
|
|
531
|
-
let a =
|
|
541
|
+
let a = Xe(r);
|
|
532
542
|
if (e.altKey && !e.ctrlKey && !e.metaKey) {
|
|
533
|
-
if (!
|
|
543
|
+
if (!Ii(t) || e.key !== "ArrowLeft" && e.key !== "ArrowRight") return;
|
|
534
544
|
e.preventDefault();
|
|
535
545
|
let n = e.key === "ArrowRight" !== a, i = V.value[t] ?? r.getBoundingClientRect().width;
|
|
536
|
-
|
|
546
|
+
Gi({ [t]: i + (n ? 1 : -1) * zn });
|
|
537
547
|
return;
|
|
538
548
|
}
|
|
539
549
|
if (e.ctrlKey || e.metaKey) return;
|
|
540
|
-
let o =
|
|
550
|
+
let o = B.value, s = o.indexOf(t);
|
|
541
551
|
if (s < 0) return;
|
|
542
552
|
let c;
|
|
543
553
|
switch (e.key) {
|
|
@@ -555,72 +565,72 @@ var Ht = {
|
|
|
555
565
|
break;
|
|
556
566
|
case "Enter":
|
|
557
567
|
case " ":
|
|
558
|
-
if (i !== r || !
|
|
559
|
-
e.preventDefault(),
|
|
568
|
+
if (i !== r || !z.value[s]?.sortable) return;
|
|
569
|
+
e.preventDefault(), za(t, e);
|
|
560
570
|
return;
|
|
561
571
|
default: return;
|
|
562
572
|
}
|
|
563
573
|
if (n && (!e.shiftKey || !O.reorderable)) return;
|
|
564
574
|
if (e.preventDefault(), !e.shiftKey) {
|
|
565
|
-
|
|
575
|
+
Ai(c);
|
|
566
576
|
return;
|
|
567
577
|
}
|
|
568
578
|
if (!O.reorderable) return;
|
|
569
|
-
let l =
|
|
570
|
-
l && (
|
|
579
|
+
let l = bi(t, c);
|
|
580
|
+
l && (Si.value = "", cr.value = l, wi.value = t, await b(), Mi(t, n), Ni = B.value.indexOf(t) === l.indexOf(t) ? null : {
|
|
571
581
|
key: t,
|
|
572
582
|
index: l.indexOf(t),
|
|
573
583
|
inGrid: n,
|
|
574
|
-
until: Date.now() +
|
|
575
|
-
},
|
|
576
|
-
},
|
|
577
|
-
let n =
|
|
578
|
-
n?.focus(), n && t && n.parentElement && (
|
|
584
|
+
until: Date.now() + Ln
|
|
585
|
+
}, Ci(t, s));
|
|
586
|
+
}, Mi = (e, t) => {
|
|
587
|
+
let n = ki(e);
|
|
588
|
+
n?.focus(), n && t && n.parentElement && (Bc.value = {
|
|
579
589
|
key: null,
|
|
580
590
|
row: -1,
|
|
581
591
|
col: Array.prototype.indexOf.call(n.parentElement.children, n)
|
|
582
592
|
});
|
|
583
|
-
},
|
|
584
|
-
E(
|
|
585
|
-
let t =
|
|
593
|
+
}, Ni = null;
|
|
594
|
+
E(B, (e) => {
|
|
595
|
+
let t = Ni;
|
|
586
596
|
if (!t) return;
|
|
587
597
|
if (Date.now() > t.until) {
|
|
588
|
-
|
|
598
|
+
Ni = null;
|
|
589
599
|
return;
|
|
590
600
|
}
|
|
591
601
|
if (e.indexOf(t.key) !== t.index) return;
|
|
592
|
-
|
|
593
|
-
let n = document.activeElement, r =
|
|
594
|
-
(!n || n === document.body || r?.contains(n)) && n !==
|
|
595
|
-
}, { flush: "post" }), process.env.NODE_ENV !== "production" && (E(
|
|
596
|
-
new Set(e).size !== e.length &&
|
|
597
|
-
}, { immediate: !0 }), E(() => O.columns.some((e) => e.snap != null) && (!!O.reorderable ||
|
|
598
|
-
e &&
|
|
602
|
+
Ni = null;
|
|
603
|
+
let n = document.activeElement, r = F.value;
|
|
604
|
+
(!n || n === document.body || r?.contains(n)) && n !== ki(t.key) && Mi(t.key, t.inGrid);
|
|
605
|
+
}, { flush: "post" }), process.env.NODE_ENV !== "production" && (E(cr, (e) => {
|
|
606
|
+
new Set(e).size !== e.length && Je().warn("BbTable: `order` lists a key more than once — the first occurrence wins.");
|
|
607
|
+
}, { immediate: !0 }), E(() => O.columns.some((e) => e.snap != null) && (!!O.reorderable || z.value !== O.columns), (e) => {
|
|
608
|
+
e && Je().warn("BbTable: `snap` names a PARENT column and the child renders in its own order — it does not compose with `order` / `reorderable` / a `hidden` column on the snapped table itself. Order and hide on the parent (a key-snapped child follows it), or drop the snaps.");
|
|
599
609
|
}, { immediate: !0 }));
|
|
600
|
-
let
|
|
610
|
+
let Pi = m(() => !!O.resizable && !K.value), Fi = m(() => new Set(O.columns.filter((e) => e.resizable === !1).map((e) => String(e.key)))), Ii = (e) => Pi.value && !Fi.value.has(e), V = C({}), Li = C(null), Ri = C(null), zi = (e) => {
|
|
601
611
|
let t = String(e.key);
|
|
602
|
-
return
|
|
603
|
-
},
|
|
612
|
+
return Li.value?.[t] ?? V.value[t] ?? e.width ?? (q.value ? Ya.value[t] : void 0);
|
|
613
|
+
}, Bi = (e) => {
|
|
604
614
|
let t = String(e.key);
|
|
605
|
-
return
|
|
606
|
-
},
|
|
607
|
-
let e = /* @__PURE__ */ new Map(), t =
|
|
608
|
-
for (let i of
|
|
615
|
+
return Li.value?.[t] !== void 0 || t in V.value;
|
|
616
|
+
}, Vi = m(() => Object.keys(Li.value ?? {}).join(" ")), Hi = m(() => /* @__PURE__ */ new Set([...Object.keys(V.value), ...Vi.value.split(" ").filter(Boolean)])), Ui = m(() => {
|
|
617
|
+
let e = /* @__PURE__ */ new Map(), t = Hi.value, n = q.value, r = Ya.value;
|
|
618
|
+
for (let i of z.value) {
|
|
609
619
|
let a = String(i.key), o = n && i.width == null, s = [];
|
|
610
620
|
o && s.push("bb-table__cell--nowrap"), t.has(a) && s.push("bb-table__cell--resized"), (t.has(a) || o && a in r) && s.push("bb-table__cell--clip"), s.length && e.set(a, s.join(" "));
|
|
611
621
|
}
|
|
612
622
|
return e;
|
|
613
|
-
}),
|
|
623
|
+
}), Wi = m(() => Li.value !== null || Object.keys(V.value).length > 0), Gi = (e) => {
|
|
614
624
|
let t = { ...V.value }, n = [];
|
|
615
625
|
for (let [r, i] of Object.entries(e)) {
|
|
616
|
-
let e = Math.max(
|
|
626
|
+
let e = Math.max(Rn, Math.round(i));
|
|
617
627
|
t[r] !== e && (t[r] = e, n.push([r, e]));
|
|
618
628
|
}
|
|
619
629
|
if (n.length) {
|
|
620
630
|
V.value = t;
|
|
621
631
|
for (let [e, t] of n) k("resize:column", e, t);
|
|
622
632
|
}
|
|
623
|
-
},
|
|
633
|
+
}, Ki = (e) => {
|
|
624
634
|
if (!(e in V.value)) return;
|
|
625
635
|
let { [e]: t, ...n } = V.value;
|
|
626
636
|
V.value = n, k("resize:column", e, null);
|
|
@@ -633,43 +643,43 @@ var Ht = {
|
|
|
633
643
|
for (let [e] of i) delete a[e];
|
|
634
644
|
V.value = a;
|
|
635
645
|
});
|
|
636
|
-
let H = null,
|
|
637
|
-
document.removeEventListener("pointermove",
|
|
638
|
-
},
|
|
639
|
-
if (
|
|
646
|
+
let H = null, qi = () => {
|
|
647
|
+
document.removeEventListener("pointermove", Yi), document.removeEventListener("pointerup", Xi), document.removeEventListener("pointercancel", Zi), document.removeEventListener("keydown", Qi, !0), window.removeEventListener("blur", Zi);
|
|
648
|
+
}, Ji = () => {
|
|
649
|
+
if (qi(), H) try {
|
|
640
650
|
H.handle.releasePointerCapture(H.pointerId);
|
|
641
651
|
} catch {}
|
|
642
|
-
document.documentElement.classList.remove(
|
|
643
|
-
},
|
|
652
|
+
document.documentElement.classList.remove(Bn), H = null, Li.value = null, Ri.value = null, F.value && (F.value.style.gridTemplateColumns = Lo.value);
|
|
653
|
+
}, Yi = (e) => {
|
|
644
654
|
if (!H || e.pointerId !== H.pointerId) return;
|
|
645
655
|
let t = (e.clientX - H.x0) * (H.rtl ? -1 : 1);
|
|
646
|
-
t = Math.max(
|
|
656
|
+
t = Math.max(Rn - H.startWidth, t);
|
|
647
657
|
let { neighbour: n } = H;
|
|
648
|
-
e.shiftKey && n ? (t = Math.min(n.startWidth -
|
|
658
|
+
e.shiftKey && n ? (t = Math.min(n.startWidth - Rn, t), Li.value = {
|
|
649
659
|
[H.key]: Math.round(H.startWidth + t),
|
|
650
660
|
[n.key]: Math.round(n.startWidth - t)
|
|
651
|
-
}) :
|
|
652
|
-
},
|
|
661
|
+
}) : Li.value = { [H.key]: Math.round(H.startWidth + t) };
|
|
662
|
+
}, Xi = (e) => {
|
|
653
663
|
if (!H || e.pointerId !== H.pointerId) return;
|
|
654
|
-
let { key: t, startWidth: n, neighbour: r } = H, i =
|
|
655
|
-
if (
|
|
664
|
+
let { key: t, startWidth: n, neighbour: r } = H, i = Li.value;
|
|
665
|
+
if (Ji(), !i) return;
|
|
656
666
|
let a = {};
|
|
657
|
-
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]),
|
|
658
|
-
},
|
|
659
|
-
H && (e instanceof PointerEvent && e.pointerId !== H.pointerId ||
|
|
660
|
-
},
|
|
661
|
-
H && e.key === "Escape" && (e.preventDefault(), e.stopImmediatePropagation(),
|
|
662
|
-
},
|
|
663
|
-
if (!
|
|
664
|
-
let n =
|
|
667
|
+
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]), Gi(a);
|
|
668
|
+
}, Zi = (e) => {
|
|
669
|
+
H && (e instanceof PointerEvent && e.pointerId !== H.pointerId || Ji());
|
|
670
|
+
}, Qi = (e) => {
|
|
671
|
+
H && e.key === "Escape" && (e.preventDefault(), e.stopImmediatePropagation(), Ji());
|
|
672
|
+
}, $i = (e, t) => {
|
|
673
|
+
if (!Ii(t) || cs.value || H || !e.isPrimary || e.button !== 0) return;
|
|
674
|
+
let n = ki(t);
|
|
665
675
|
if (!n) return;
|
|
666
676
|
e.preventDefault();
|
|
667
677
|
let r = e.currentTarget;
|
|
668
678
|
try {
|
|
669
679
|
r.setPointerCapture(e.pointerId);
|
|
670
680
|
} catch {}
|
|
671
|
-
document.documentElement.classList.add(
|
|
672
|
-
let i =
|
|
681
|
+
document.documentElement.classList.add(Bn);
|
|
682
|
+
let i = B.value, a = i[i.indexOf(t) + 1], o = a && Ii(a) ? a : void 0, s = o ? ki(o) : null;
|
|
673
683
|
H = {
|
|
674
684
|
pointerId: e.pointerId,
|
|
675
685
|
handle: r,
|
|
@@ -680,38 +690,38 @@ var Ht = {
|
|
|
680
690
|
key: o,
|
|
681
691
|
startWidth: s.getBoundingClientRect().width
|
|
682
692
|
} : null,
|
|
683
|
-
rtl:
|
|
684
|
-
},
|
|
693
|
+
rtl: Ye(n)
|
|
694
|
+
}, Ri.value = t, document.addEventListener("pointermove", Yi), document.addEventListener("pointerup", Xi), document.addEventListener("pointercancel", Zi), document.addEventListener("keydown", Qi, !0), window.addEventListener("blur", Zi);
|
|
685
695
|
};
|
|
686
|
-
x(
|
|
687
|
-
let U = C("idle"),
|
|
688
|
-
let e =
|
|
696
|
+
x(Ji);
|
|
697
|
+
let U = C("idle"), ea = C(null), ta = C(""), na = C(), ra = Symbol("bb-table-column-drag"), W = null, ia = (e) => Math.max(0, Math.min(1, e)), aa = () => {
|
|
698
|
+
let e = eo.value ? I.value?.parentElement ?? null : I.value ?? null;
|
|
689
699
|
for (; e;) {
|
|
690
700
|
let t = getComputedStyle(e).overflowX;
|
|
691
701
|
if (t === "auto" || t === "scroll") return e;
|
|
692
702
|
e = e.parentElement;
|
|
693
703
|
}
|
|
694
704
|
return null;
|
|
695
|
-
},
|
|
705
|
+
}, oa = () => {
|
|
696
706
|
let e = W?.scrollport?.getBoundingClientRect(), t = Math.max(e?.left ?? 0, 0), n = Math.min(e?.right ?? window.innerWidth, window.innerWidth);
|
|
697
707
|
return {
|
|
698
708
|
left: t,
|
|
699
709
|
right: Math.max(t + 1, n)
|
|
700
710
|
};
|
|
701
|
-
},
|
|
702
|
-
let e =
|
|
711
|
+
}, sa = (e) => Array.from(e.children).filter((e) => e instanceof HTMLElement && e.classList.contains("bb-table__cell-column-header") && !!e.dataset.columnKey), ca = () => {
|
|
712
|
+
let e = na.value;
|
|
703
713
|
e?.isConnected && !e.matches(":popover-open") && e.showPopover();
|
|
704
|
-
},
|
|
705
|
-
let e =
|
|
714
|
+
}, la = () => {
|
|
715
|
+
let e = na.value;
|
|
706
716
|
e && e.matches(":popover-open") && e.hidePopover();
|
|
707
|
-
},
|
|
708
|
-
let n =
|
|
709
|
-
n && (n.style.translate = `${e +
|
|
710
|
-
},
|
|
717
|
+
}, ua = (e, t) => {
|
|
718
|
+
let n = na.value;
|
|
719
|
+
n && (n.style.translate = `${e + qn}px ${t + qn}px`);
|
|
720
|
+
}, da = (e) => {
|
|
711
721
|
if (!W || U.value !== "dragging") return;
|
|
712
|
-
let t =
|
|
722
|
+
let t = oa(), n = Math.max(t.left, Math.min(e, t.right - 1)), r = sa(W.row);
|
|
713
723
|
if (r.length < 2) return;
|
|
714
|
-
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 =
|
|
724
|
+
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 = B.value, c = s.indexOf(W.key);
|
|
715
725
|
if (c < 0) return;
|
|
716
726
|
let l = Infinity, u = -Infinity;
|
|
717
727
|
for (let e of a.values()) l = Math.min(l, e.left), u = Math.max(u, e.right);
|
|
@@ -726,82 +736,82 @@ var Ht = {
|
|
|
726
736
|
if (!e) return;
|
|
727
737
|
d = e.dataset.columnKey, f = s.indexOf(d);
|
|
728
738
|
}
|
|
729
|
-
if (f < 0 || (f =
|
|
739
|
+
if (f < 0 || (f = xi(W.key, f) ?? c, f === c)) return;
|
|
730
740
|
let p = f > c;
|
|
731
741
|
if (W.target?.key === d && W.target.after === p) return;
|
|
732
|
-
let ee =
|
|
733
|
-
|
|
742
|
+
let ee = Re(W.base, gi.value, W.key, f, pi.value), te = yi.value ?? W.base;
|
|
743
|
+
We(ee, te) ? W.target = {
|
|
734
744
|
key: d,
|
|
735
745
|
after: p
|
|
736
|
-
} : ((W.rtl ? !p : p) ? n <= W.lastMoveX +
|
|
746
|
+
} : ((W.rtl ? !p : p) ? n <= W.lastMoveX + Kn : n >= W.lastMoveX - Kn) || (W.target = {
|
|
737
747
|
key: d,
|
|
738
748
|
after: p
|
|
739
|
-
}, W.lastMoveX = n,
|
|
740
|
-
},
|
|
749
|
+
}, W.lastMoveX = n, yi.value = ee);
|
|
750
|
+
}, fa = () => {
|
|
741
751
|
if (!W || U.value !== "dragging" || !W.scrollDirection) {
|
|
742
752
|
W && (W.raf = void 0);
|
|
743
753
|
return;
|
|
744
754
|
}
|
|
745
|
-
let e =
|
|
746
|
-
r && (r.scrollLeft += W.scrollDirection * n),
|
|
747
|
-
},
|
|
755
|
+
let e = oa(), t = W.scrollDirection < 0 ? W.lastX - e.left : e.right - W.lastX, n = Math.ceil(Gn * (1 - ia(t / Wn))), r = W.scrollport ?? document.scrollingElement;
|
|
756
|
+
r && (r.scrollLeft += W.scrollDirection * n), da(W.lastX), W.raf = requestAnimationFrame(fa);
|
|
757
|
+
}, pa = () => {
|
|
748
758
|
if (!W) return;
|
|
749
|
-
let e =
|
|
750
|
-
W.scrollDirection = t <
|
|
751
|
-
},
|
|
752
|
-
document.removeEventListener("pointermove",
|
|
753
|
-
},
|
|
759
|
+
let e = oa(), t = W.lastX - e.left, n = e.right - W.lastX;
|
|
760
|
+
W.scrollDirection = t < Wn ? -1 : +(n < Wn), W.scrollDirection && W.raf === void 0 && (W.raf = requestAnimationFrame(fa));
|
|
761
|
+
}, ma = () => {
|
|
762
|
+
document.removeEventListener("pointermove", va), document.removeEventListener("pointerup", ya), document.removeEventListener("pointercancel", ba), document.removeEventListener("keydown", Sa, !0), document.removeEventListener("dragstart", Ca), document.removeEventListener("contextmenu", Ca, !0), window.removeEventListener("blur", ba), W?.row.removeEventListener("lostpointercapture", xa);
|
|
763
|
+
}, ha = () => {
|
|
754
764
|
if (W) {
|
|
755
|
-
clearTimeout(W.timer), W.raf !== void 0 && cancelAnimationFrame(W.raf),
|
|
765
|
+
clearTimeout(W.timer), W.raf !== void 0 && cancelAnimationFrame(W.raf), ma();
|
|
756
766
|
try {
|
|
757
767
|
W.row.hasPointerCapture(W.pointerId) && W.row.releasePointerCapture(W.pointerId);
|
|
758
768
|
} catch {}
|
|
759
|
-
|
|
769
|
+
la(), et(ra), ea.value = null, yi.value = null, U.value = "idle", W = null;
|
|
760
770
|
}
|
|
761
|
-
},
|
|
762
|
-
W && (W.raf !== void 0 && cancelAnimationFrame(W.raf), W.raf = void 0, W.scrollDirection = 0,
|
|
763
|
-
},
|
|
771
|
+
}, ga = () => {
|
|
772
|
+
W && (W.raf !== void 0 && cancelAnimationFrame(W.raf), W.raf = void 0, W.scrollDirection = 0, la(), et(ra), ea.value = null, yi.value = null, U.value = "cancelled");
|
|
773
|
+
}, _a = () => {
|
|
764
774
|
if (W && U.value === "armed") {
|
|
765
775
|
clearTimeout(W.timer), W.timer = void 0;
|
|
766
776
|
try {
|
|
767
777
|
W.row.setPointerCapture(W.pointerId);
|
|
768
778
|
} catch {}
|
|
769
|
-
W.row.addEventListener("lostpointercapture",
|
|
779
|
+
W.row.addEventListener("lostpointercapture", xa), W.base = vi(cr.value), W.rtl = Ye(W.row), W.scrollport = aa(), W.lastMoveX = W.x0, W.target = null, yi.value = W.base, ea.value = W.key, ta.value = W.label, U.value = "dragging", $e(ra), ca(), ua(W.lastX, W.lastY), da(W.lastX), pa();
|
|
770
780
|
}
|
|
771
|
-
},
|
|
781
|
+
}, va = (e) => {
|
|
772
782
|
if (W && e.pointerId === W.pointerId) {
|
|
773
783
|
if (W.lastX = e.clientX, W.lastY = e.clientY, U.value === "armed") {
|
|
774
784
|
let t = Math.hypot(e.clientX - W.x0, e.clientY - W.y0);
|
|
775
785
|
if (W.pointerType === "touch") {
|
|
776
|
-
t >=
|
|
786
|
+
t >= Hn && ha();
|
|
777
787
|
return;
|
|
778
788
|
}
|
|
779
|
-
if (t <
|
|
780
|
-
|
|
781
|
-
} else U.value === "dragging" && (
|
|
789
|
+
if (t < Vn) return;
|
|
790
|
+
_a();
|
|
791
|
+
} else U.value === "dragging" && (ua(e.clientX, e.clientY), da(e.clientX), pa());
|
|
782
792
|
}
|
|
783
|
-
},
|
|
793
|
+
}, ya = (e) => {
|
|
784
794
|
if (!W || e.pointerId !== W.pointerId) return;
|
|
785
|
-
let { key: t } = W, n = W.base ? W.base.filter((e) =>
|
|
786
|
-
|
|
787
|
-
},
|
|
788
|
-
W && (e instanceof PointerEvent && e.pointerId !== W.pointerId ||
|
|
789
|
-
},
|
|
790
|
-
W && U.value === "dragging" &&
|
|
791
|
-
},
|
|
792
|
-
W && U.value === "dragging" && e.key === "Escape" &&
|
|
793
|
-
},
|
|
795
|
+
let { key: t } = W, n = W.base ? W.base.filter((e) => gi.value.includes(e) && !pi.value.has(e)).indexOf(t) : -1, r = U.value === "dragging" && yi.value !== null && !We(yi.value, W.base) ? yi.value : null;
|
|
796
|
+
ha(), r && (Si.value = "", cr.value = r, b(() => Ci(t, n)));
|
|
797
|
+
}, ba = (e) => {
|
|
798
|
+
W && (e instanceof PointerEvent && e.pointerId !== W.pointerId || ha());
|
|
799
|
+
}, xa = () => {
|
|
800
|
+
W && U.value === "dragging" && ha();
|
|
801
|
+
}, Sa = (e) => {
|
|
802
|
+
W && U.value === "dragging" && e.key === "Escape" && Qe(ra) && (e.preventDefault(), e.stopImmediatePropagation(), ga());
|
|
803
|
+
}, Ca = (e) => {
|
|
794
804
|
W && U.value !== "idle" && e.preventDefault();
|
|
795
|
-
},
|
|
796
|
-
if (!O.reorderable ||
|
|
805
|
+
}, wa = (e) => {
|
|
806
|
+
if (!O.reorderable || cs.value || A.thead || !e.isPrimary || e.button !== 0 || W || z.value.length < 2) return;
|
|
797
807
|
let t = e.target;
|
|
798
808
|
if (!(t instanceof Element)) return;
|
|
799
809
|
let n = e.currentTarget, r = t.closest(".bb-table__cell-column-header");
|
|
800
810
|
if (!r || r.parentElement !== n || !r.dataset.columnKey) return;
|
|
801
|
-
let i = t.closest(
|
|
811
|
+
let i = t.closest(Jn);
|
|
802
812
|
if (i && r.contains(i)) return;
|
|
803
|
-
let a = r.dataset.columnKey, o =
|
|
804
|
-
o && (
|
|
813
|
+
let a = r.dataset.columnKey, o = z.value.find((e) => String(e.key) === a);
|
|
814
|
+
o && (_i.value.has(a) || (W = {
|
|
805
815
|
pointerId: e.pointerId,
|
|
806
816
|
pointerType: e.pointerType,
|
|
807
817
|
key: a,
|
|
@@ -819,33 +829,33 @@ var Ht = {
|
|
|
819
829
|
timer: void 0,
|
|
820
830
|
raf: void 0,
|
|
821
831
|
scrollDirection: 0
|
|
822
|
-
}, U.value = "armed", document.addEventListener("pointermove",
|
|
823
|
-
},
|
|
832
|
+
}, U.value = "armed", document.addEventListener("pointermove", va), document.addEventListener("pointerup", ya), document.addEventListener("pointercancel", ba), document.addEventListener("keydown", Sa, !0), document.addEventListener("dragstart", Ca), document.addEventListener("contextmenu", Ca, !0), window.addEventListener("blur", ba), e.pointerType === "touch" && (W.timer = setTimeout(_a, Un))));
|
|
833
|
+
}, Ta = (e) => {
|
|
824
834
|
W && (U.value === "dragging" || U.value === "cancelled") && e.cancelable && e.preventDefault();
|
|
825
835
|
};
|
|
826
|
-
x(
|
|
827
|
-
let
|
|
828
|
-
E(() => Object.keys(
|
|
829
|
-
let
|
|
830
|
-
let e =
|
|
836
|
+
x(ha);
|
|
837
|
+
let Ea = m(() => o(lr.value) ? [] : [lr.value]), { data: Da } = ee({ items: Ea }), { data: Oa } = ee({ items: mr });
|
|
838
|
+
E(() => Object.keys(Oa.value).sort().join("\0"), () => Kr.cancel());
|
|
839
|
+
let ka = pt(), Aa = () => {
|
|
840
|
+
let e = ka?.vnode.props ?? {};
|
|
831
841
|
return "highlighted" in e || "onUpdate:highlighted" in e || G.highlighted !== void 0;
|
|
832
|
-
},
|
|
833
|
-
process.env.NODE_ENV !== "production" && (
|
|
834
|
-
},
|
|
835
|
-
if (!
|
|
836
|
-
t &&
|
|
842
|
+
}, ja = (e) => O.highlightable === !1 || typeof O.highlightable == "function" && !O.highlightable(e), Ma = !1, Na = () => {
|
|
843
|
+
process.env.NODE_ENV !== "production" && (Ma || (Ma = !0, Je().warn("BbTable: `toggleHighlighted` was called from a slot, but highlight is not bound, so nothing happened. Bind `v-model:highlighted`, or provide `highlighted` through `useBbTable(id, { highlighted })`, or drop the call — with nothing bound the table has nowhere to put the value.")));
|
|
844
|
+
}, Pa = (e, { viaSlot: t = !1 } = {}) => {
|
|
845
|
+
if (!Aa()) {
|
|
846
|
+
t && Na();
|
|
837
847
|
return;
|
|
838
848
|
}
|
|
839
|
-
if (
|
|
840
|
-
let n = e.valueHash in
|
|
841
|
-
|
|
842
|
-
},
|
|
843
|
-
let n =
|
|
844
|
-
if (
|
|
849
|
+
if (ja(e.item)) return;
|
|
850
|
+
let n = e.valueHash in Da.value;
|
|
851
|
+
lr.value = n ? null : e.value;
|
|
852
|
+
}, Fa = (e) => !(e.currentTarget instanceof Element) || Se(e, e.currentTarget), Ia = (e) => !Fa(e) && !window.getSelection()?.toString(), La = !1, Ra = (e) => sr.value.find(([t]) => t === e)?.[1] ?? null, za = (e, t) => {
|
|
853
|
+
let n = Ra(e), r = !!t?.shiftKey || t instanceof MouseEvent && t.detail === 0 && La;
|
|
854
|
+
if (La = !1, !O.multiSort && !r) {
|
|
845
855
|
let t = n === null ? "asc" : n === "asc" ? "desc" : null;
|
|
846
|
-
|
|
847
|
-
} else n === null ?
|
|
848
|
-
}, { state: G, isReady:
|
|
856
|
+
sr.value = t ? [[e, t]] : [];
|
|
857
|
+
} else n === null ? sr.value = [...sr.value, [e, "asc"]] : n === "asc" ? sr.value = sr.value.map((t) => t[0] === e ? [e, "desc"] : t) : sr.value = sr.value.filter(([t]) => t !== e);
|
|
858
|
+
}, { state: G, isReady: Ba } = qe(() => jr.value, {
|
|
849
859
|
selected: {
|
|
850
860
|
get: () => O.modelValue,
|
|
851
861
|
set: (e) => k("update:modelValue", e)
|
|
@@ -861,73 +871,73 @@ var Ht = {
|
|
|
861
871
|
}
|
|
862
872
|
},
|
|
863
873
|
sort: {
|
|
864
|
-
get: () =>
|
|
874
|
+
get: () => sr.value,
|
|
865
875
|
set: (e) => {
|
|
866
|
-
|
|
876
|
+
sr.value = e;
|
|
867
877
|
}
|
|
868
878
|
},
|
|
869
879
|
order: {
|
|
870
|
-
get: () =>
|
|
880
|
+
get: () => cr.value,
|
|
871
881
|
set: (e) => {
|
|
872
|
-
|
|
882
|
+
cr.value = e;
|
|
873
883
|
}
|
|
874
884
|
},
|
|
875
885
|
highlighted: {
|
|
876
|
-
get: () =>
|
|
886
|
+
get: () => lr.value,
|
|
877
887
|
set: (e) => {
|
|
878
|
-
|
|
888
|
+
lr.value = e;
|
|
879
889
|
}
|
|
880
890
|
},
|
|
881
|
-
page: { get: () => O.page === void 0 ? O.virtual ? 1 : void 0 :
|
|
891
|
+
page: { get: () => O.page === void 0 ? O.virtual ? 1 : void 0 : ce(O.page, 1) },
|
|
882
892
|
perPage: {
|
|
883
|
-
get: () =>
|
|
893
|
+
get: () => se(O.perPage),
|
|
884
894
|
infer: () => Array.isArray(O.items) ? O.items.length : void 0
|
|
885
895
|
},
|
|
886
896
|
totalItems: {
|
|
887
|
-
get: () =>
|
|
897
|
+
get: () => se(O.totalItems),
|
|
888
898
|
infer: () => Array.isArray(O.items) ? O.items.length : void 0
|
|
889
899
|
},
|
|
890
|
-
totalPages: { get: () => O.totalPages === void 0 ? void 0 :
|
|
891
|
-
}),
|
|
892
|
-
|
|
893
|
-
|
|
900
|
+
totalPages: { get: () => O.totalPages === void 0 ? void 0 : ce(O.totalPages, 1) }
|
|
901
|
+
}), Va = m(() => O.columns.some((e) => e.snap != null)), Ha = m(() => !!O.inheritColumnWidths || Va.value), Ua = m(() => O.fixed || Va.value || mi.value.some((e) => e.width != null) || Wi.value || Ha.value && !!Mr.value), K = m(() => Ha.value && !!Mr.value), Wa = C(""), Ga = C(0);
|
|
902
|
+
Pt(() => {
|
|
903
|
+
Pr.depth = K.value ? (Nr.value?.depth ?? 0) + 1 : 0;
|
|
894
904
|
});
|
|
895
|
-
let
|
|
905
|
+
let Ka = m(() => Ja.value === "drag-handle" || Ja.value === "select" ? Ga.value * Pr.depth : 0), qa = (e, t) => {
|
|
896
906
|
if (!t) return 0;
|
|
897
907
|
if (/^-?[\d.]+px$/.test(t)) return parseFloat(t);
|
|
898
908
|
let n = document.createElement("span");
|
|
899
909
|
n.style.cssText = `position:absolute;visibility:hidden;width:${t}`, e.appendChild(n);
|
|
900
910
|
let r = n.getBoundingClientRect().width;
|
|
901
911
|
return n.remove(), r;
|
|
902
|
-
},
|
|
912
|
+
}, Ja = m(() => {
|
|
903
913
|
if (!K.value) return null;
|
|
904
|
-
let e =
|
|
905
|
-
return e === "drag-handle" &&
|
|
914
|
+
let e = Wa.value || "select";
|
|
915
|
+
return e === "drag-handle" && R.value ? "drag-handle" : e !== "content" && O.selectable ? "select" : "content";
|
|
906
916
|
});
|
|
907
|
-
|
|
908
|
-
|
|
917
|
+
Pt(() => {
|
|
918
|
+
Pr.ordered = !!O.reorderable || cr.value.length > 0;
|
|
909
919
|
});
|
|
910
|
-
let q = m(() => !!O.virtual && !K.value && !A.tbody),
|
|
920
|
+
let q = m(() => !!O.virtual && !K.value && !A.tbody), Ya = C({}), Xa = C({}), Za = C(""), Qa = m(() => q.value && !!Za.value && Po.value.every((e) => !e.contentSized)), $a = (e) => q.value && e.width == null && !Bi(e) && String(e.key) in Ya.value, eo = K, to = (e) => {
|
|
911
921
|
if (typeof e == "number") return `${e}px`;
|
|
912
922
|
let t = e.trim();
|
|
913
923
|
return /^-?\d*\.?\d+$/.test(t) ? `${t}px` : t;
|
|
914
|
-
},
|
|
915
|
-
let e =
|
|
924
|
+
}, no = m(() => Nr.value?.keys ?? []), ro = m(() => +(no.value[0] === "select")), io = m(() => no.value.length), ao = m(() => {
|
|
925
|
+
let e = no.value;
|
|
916
926
|
return e[e.length - 1] === "actions" ? e.length - 1 : e.length;
|
|
917
|
-
}),
|
|
918
|
-
let t =
|
|
919
|
-
return t ?
|
|
920
|
-
},
|
|
921
|
-
if (!
|
|
927
|
+
}), oo = (e) => no.value.indexOf(e), so = (e) => {
|
|
928
|
+
let t = no.value[e];
|
|
929
|
+
return t ? Ir(t, "0px") : "0px";
|
|
930
|
+
}, co = (e, t) => {
|
|
931
|
+
if (!Mr.value || t - e <= 1e-6) return null;
|
|
922
932
|
let n = [];
|
|
923
933
|
for (let r = Math.floor(e); r < Math.ceil(t - 1e-6); r++) {
|
|
924
934
|
let i = Math.min(t, r + 1) - Math.max(e, r);
|
|
925
935
|
if (i <= 1e-6) continue;
|
|
926
|
-
let a =
|
|
936
|
+
let a = so(r);
|
|
927
937
|
n.push(i >= 1 - 1e-6 ? a : `${Number(i.toFixed(4))} * ${a}`);
|
|
928
938
|
}
|
|
929
939
|
return n.length ? n.length === 1 && !n[0].includes("*") ? n[0] : `calc(${n.join(" + ")})` : null;
|
|
930
|
-
},
|
|
940
|
+
}, lo = (e) => {
|
|
931
941
|
let t = /^(.+)\.(\d+)$/.exec(e);
|
|
932
942
|
return t ? {
|
|
933
943
|
key: t[1],
|
|
@@ -936,9 +946,9 @@ var Ht = {
|
|
|
936
946
|
key: e,
|
|
937
947
|
fraction: 0
|
|
938
948
|
};
|
|
939
|
-
},
|
|
949
|
+
}, uo = (e) => {
|
|
940
950
|
if (Array.isArray(e)) {
|
|
941
|
-
let t =
|
|
951
|
+
let t = lo(e[0]), n = lo(e[1]), r = oo(t.key), i = oo(n.key);
|
|
942
952
|
if (r < 0 || i < 0) return null;
|
|
943
953
|
let a = r + t.fraction, o = n.fraction > 0 ? i + n.fraction : i + 1;
|
|
944
954
|
return o > a ? {
|
|
@@ -947,9 +957,9 @@ var Ht = {
|
|
|
947
957
|
explicit: !0
|
|
948
958
|
} : null;
|
|
949
959
|
}
|
|
950
|
-
let t =
|
|
960
|
+
let t = lo(e), n = oo(t.key);
|
|
951
961
|
if (n < 0) {
|
|
952
|
-
let t =
|
|
962
|
+
let t = oo(e);
|
|
953
963
|
return t < 0 ? null : {
|
|
954
964
|
start: t,
|
|
955
965
|
end: t + 1,
|
|
@@ -961,20 +971,20 @@ var Ht = {
|
|
|
961
971
|
end: n + 1,
|
|
962
972
|
explicit: !1
|
|
963
973
|
};
|
|
964
|
-
},
|
|
965
|
-
let e =
|
|
974
|
+
}, fo = m(() => !!Nr.value?.ordered), po = m(() => {
|
|
975
|
+
let e = z.value, t = ro.value, n = ao.value, r = io.value, i = fo.value, a = e.map(() => null), o = /* @__PURE__ */ new Set(), s = (e) => {
|
|
966
976
|
for (let t = Math.floor(e.start); t < e.end - 1e-6; t++) o.add(t);
|
|
967
977
|
};
|
|
968
978
|
i || (e.forEach((e, t) => {
|
|
969
979
|
if (e.snap == null) return;
|
|
970
|
-
let n =
|
|
980
|
+
let n = uo(e.snap);
|
|
971
981
|
n && (a[t] = {
|
|
972
982
|
...n,
|
|
973
983
|
overflow: !1
|
|
974
984
|
}, s(a[t]));
|
|
975
985
|
}), e.forEach((e, r) => {
|
|
976
986
|
if (a[r] || e.snap != null) return;
|
|
977
|
-
let i =
|
|
987
|
+
let i = oo(String(e.key));
|
|
978
988
|
i < t || i >= n || o.has(i) || (a[r] = {
|
|
979
989
|
start: i,
|
|
980
990
|
end: i + 1,
|
|
@@ -1022,10 +1032,10 @@ var Ht = {
|
|
|
1022
1032
|
let i = u[r + 1];
|
|
1023
1033
|
i && !i.overflow && i.start > t.end && (t.end = i.start), r === e.length - 1 && e[r].width == null && (t.end = Math.max(t.end, n));
|
|
1024
1034
|
}), u;
|
|
1025
|
-
}),
|
|
1035
|
+
}), mo = (e) => K.value && e.overflow, ho = m(() => {
|
|
1026
1036
|
let e = /* @__PURE__ */ new Map();
|
|
1027
1037
|
if (!K.value) return e;
|
|
1028
|
-
let t =
|
|
1038
|
+
let t = po.value, n = z.value, r = (e) => !t[e].overflow && zi(n[e]) == null, i = t.length - 1;
|
|
1029
1039
|
for (; i >= 0 && t[i].overflow;) i--;
|
|
1030
1040
|
return t.forEach((a, o) => {
|
|
1031
1041
|
if (!a.overflow || o > i) return;
|
|
@@ -1034,55 +1044,55 @@ var Ht = {
|
|
|
1034
1044
|
for (let e = o + 1; e < t.length && s < 0; e++) r(e) && (s = e);
|
|
1035
1045
|
s < 0 || e.set(s, [...e.get(s) ?? [], String(n[o].key)]);
|
|
1036
1046
|
}), e;
|
|
1037
|
-
}),
|
|
1038
|
-
process.env.NODE_ENV !== "production" && (E(() =>
|
|
1039
|
-
e &&
|
|
1040
|
-
}, { immediate: !0 }), E(() =>
|
|
1041
|
-
e !== null &&
|
|
1047
|
+
}), go = m(() => new Set([...ho.value.values()].flat()));
|
|
1048
|
+
process.env.NODE_ENV !== "production" && (E(() => Va.value && fo.value, (e) => {
|
|
1049
|
+
e && Je().warn("BbTable: `snap` targets are ignored under a parent that uses `order` / `reorderable` — the parent's columns can move, so the child inherits by position. Keep the parent's order static (no `reorderable`, an empty `order`) to snap by key.");
|
|
1050
|
+
}, { immediate: !0 }), E(() => po.value.find((e) => e.demoted)?.demoted ?? null, (e) => {
|
|
1051
|
+
e !== null && Je().warn(`BbTable: column '${e}' snaps to a parent column that sits BEFORE the column preceding it — the child's order disagrees with the parent's, so the snap cannot tile and the column flows into the next free parent track instead. Declare the child's columns in the parent's order.`);
|
|
1042
1052
|
}, { immediate: !0 }));
|
|
1043
|
-
let
|
|
1044
|
-
let t =
|
|
1045
|
-
return (t ?
|
|
1046
|
-
},
|
|
1053
|
+
let _o = m(() => po.value.some((e, t) => mo(e) && !go.value.has(String(z.value[t].key)))), vo = (e) => {
|
|
1054
|
+
let t = z.value[e];
|
|
1055
|
+
return (t ? zi(t) : null) == null && !K.value;
|
|
1056
|
+
}, yo = m(() => {
|
|
1047
1057
|
if (!K.value) return -1;
|
|
1048
|
-
let e =
|
|
1058
|
+
let e = z.value;
|
|
1049
1059
|
for (let t = e.length - 1; t >= 0; t--) {
|
|
1050
1060
|
let n = e[t];
|
|
1051
1061
|
if (n.width == null && n.snap == null) return t;
|
|
1052
1062
|
}
|
|
1053
1063
|
return -1;
|
|
1054
|
-
}),
|
|
1055
|
-
let e =
|
|
1056
|
-
return !
|
|
1057
|
-
}),
|
|
1058
|
-
let e =
|
|
1059
|
-
return !
|
|
1060
|
-
}),
|
|
1061
|
-
let e =
|
|
1064
|
+
}), bo = m(() => {
|
|
1065
|
+
let e = po.value, t = e.find((e) => !e.overflow) ?? e[0];
|
|
1066
|
+
return !Ha.value || !Mr.value || !t ? null : co(0, t.start);
|
|
1067
|
+
}), xo = m(() => {
|
|
1068
|
+
let e = po.value, t = e[e.length - 1];
|
|
1069
|
+
return !Ha.value || !Mr.value || !t || _o.value ? null : co(t.end, io.value);
|
|
1070
|
+
}), So = (e) => Pr.tracks[e] ?? null, Co = (e, t, n) => !Ha.value || !Mr.value ? null : n ? t ? `calc(${e ?? "0px"} - ${t})` : null : e, wo = m(() => !!O.selectable || R.value), To = m(() => {
|
|
1071
|
+
let e = So("select"), t = Ka.value;
|
|
1062
1072
|
return e && t ? `calc(${e} + ${t}px)` : e;
|
|
1063
|
-
}),
|
|
1064
|
-
let n = q.value ?
|
|
1065
|
-
return n == null ? e &&
|
|
1066
|
-
},
|
|
1073
|
+
}), Eo = m(() => Co(bo.value, wo.value ? To.value : null, wo.value)), Do = m(() => _o.value ? null : Co(xo.value, M.value ? So("actions") : null, M.value)), Oo = m(() => Eo.value !== null), ko = m(() => Do.value !== null), Ao = (e, t) => {
|
|
1074
|
+
let n = q.value ? Xa.value[t] : null;
|
|
1075
|
+
return n == null ? e && Mo.value ? "minmax(auto, max-content)" : "max-content" : `${n}px`;
|
|
1076
|
+
}, jo = m(() => {
|
|
1067
1077
|
let e = {};
|
|
1068
|
-
if (!
|
|
1069
|
-
let t =
|
|
1070
|
-
return
|
|
1071
|
-
}),
|
|
1072
|
-
let e = [], t =
|
|
1073
|
-
|
|
1074
|
-
key:
|
|
1075
|
-
width:
|
|
1076
|
-
contentSized:
|
|
1078
|
+
if (!Mo.value) return e;
|
|
1079
|
+
let t = bo.value, n = R.value && !!O.selectable, r = Ka.value, i = (e, t) => r && Ja.value === t ? `calc(${e} + ${r}px)` : e, a = Wr.value && r && Ja.value === "drag-handle" ? `calc(${Wr.value} - ${r}px)` : Wr.value;
|
|
1080
|
+
return R.value && !n && t && (e["--min-g"] = i(t, "drag-handle")), O.selectable && t && (R.value ? a && (e["--min-s"] = i(`calc(${t} - ${a})`, "select")) : e["--min-s"] = i(t, "select")), M.value && xo.value && !_o.value && (e["--min-a"] = xo.value), e;
|
|
1081
|
+
}), Mo = m(() => Object.keys(Nr.value?.tracks ?? {}).length > 0), No = (e) => /^(auto|min-content|max-content|(fit-content|minmax)\(.*\)|-?[\d.]+fr)$/.test(e.trim()), Po = m(() => {
|
|
1082
|
+
let e = [], t = R.value && !!O.selectable;
|
|
1083
|
+
R.value && e.push({
|
|
1084
|
+
key: Pn,
|
|
1085
|
+
width: Ao(t ? null : bo.value, Pn),
|
|
1086
|
+
contentSized: Xa.value[Pn] == null
|
|
1077
1087
|
}), O.selectable && e.push({
|
|
1078
1088
|
key: "select",
|
|
1079
|
-
width:
|
|
1080
|
-
contentSized:
|
|
1089
|
+
width: Ao(R.value ? bo.value && Wr.value ? `calc(${bo.value} - ${Wr.value})` : null : bo.value, "select"),
|
|
1090
|
+
contentSized: Xa.value.select == null
|
|
1081
1091
|
});
|
|
1082
|
-
let n =
|
|
1092
|
+
let n = z.value, r = n.length - 1, i = !K.value && n.length > 0 && n.every((e) => e.width != null && !No(to(e.width)));
|
|
1083
1093
|
return n.forEach((t, n) => {
|
|
1084
|
-
let a = String(t.key), o =
|
|
1085
|
-
if (s != null &&
|
|
1094
|
+
let a = String(t.key), o = zi(t), s = o == null ? null : to(o), c = po.value[n], l = null, u = null;
|
|
1095
|
+
if (s != null && No(s) ? u = s : s != null && i && !Bi(t) ? u = `minmax(${s}, ${parseFloat(s) || 1}fr)` : s != null && $a(t) ? u = `minmax(${s}, 1fr)` : s == null ? vo(n) ? u = O.fixed ? "minmax(0, 1fr)" : "auto" : Mo.value ? mo(c) ? u = "min-content" : (l = co(c.start, c.end), l === null && (u = "auto")) : u = "max-content" : l = s, u !== null) {
|
|
1086
1096
|
e.push({
|
|
1087
1097
|
key: a,
|
|
1088
1098
|
width: u,
|
|
@@ -1091,8 +1101,8 @@ var Ht = {
|
|
|
1091
1101
|
return;
|
|
1092
1102
|
}
|
|
1093
1103
|
let d = [];
|
|
1094
|
-
n === 0 &&
|
|
1095
|
-
let f = (
|
|
1104
|
+
n === 0 && Oo.value && d.push("var(--offset-internal-start, 0px)"), n === r && ko.value && d.push("var(--offset-internal-end, 0px)");
|
|
1105
|
+
let f = (ho.value.get(n) ?? []).map((e) => Pr.tracks[e]).filter(Boolean), p = [...d, l].join(" + "), ee = d.length || f.length ? `calc(${[p, ...f].join(" - ")})` : l, te = n === yo.value && !_o.value ? `minmax(${ee}, 1fr)` : ee;
|
|
1096
1106
|
e.push({
|
|
1097
1107
|
key: a,
|
|
1098
1108
|
width: te,
|
|
@@ -1100,198 +1110,200 @@ var Ht = {
|
|
|
1100
1110
|
});
|
|
1101
1111
|
}), M.value && e.push({
|
|
1102
1112
|
key: "actions",
|
|
1103
|
-
width:
|
|
1104
|
-
contentSized:
|
|
1113
|
+
width: Ao(xo.value, "actions"),
|
|
1114
|
+
contentSized: Xa.value.actions == null
|
|
1105
1115
|
}), e;
|
|
1106
|
-
}),
|
|
1107
|
-
let e =
|
|
1108
|
-
for (let n of
|
|
1116
|
+
}), Fo = m(() => {
|
|
1117
|
+
let e = z.value, t = [];
|
|
1118
|
+
for (let n of Po.value) n.contentSized || e.some((e) => String(e.key) === n.key) && t.push(n.key);
|
|
1109
1119
|
return t.join(" ");
|
|
1110
|
-
}),
|
|
1111
|
-
E(
|
|
1112
|
-
H &&
|
|
1120
|
+
}), Io = m(() => new Set(Fo.value.split(" ").filter(Boolean))), Lo = m(() => Po.value.map((e) => e.width).join(" ")), Ro = C(Lo.value), zo = m(() => `grid-template-columns: ${Ro.value}`);
|
|
1121
|
+
E(Lo, (e) => {
|
|
1122
|
+
H && F.value ? F.value.style.gridTemplateColumns = e : Ro.value = e;
|
|
1113
1123
|
}, { flush: "sync" });
|
|
1114
|
-
let
|
|
1124
|
+
let Bo = m(() => {
|
|
1115
1125
|
let e = {};
|
|
1116
|
-
return
|
|
1117
|
-
}),
|
|
1126
|
+
return Eo.value && (e["--offset-start"] = Eo.value), Do.value && (e["--offset-end"] = Do.value), Object.assign(e, jo.value), Pr.depth && (e["--depth"] = String(Pr.depth)), e;
|
|
1127
|
+
}), Vo = C({}), Ho = [
|
|
1118
1128
|
.62,
|
|
1119
1129
|
.42,
|
|
1120
1130
|
.78,
|
|
1121
1131
|
.52
|
|
1122
|
-
],
|
|
1132
|
+
], Uo = (e) => {
|
|
1123
1133
|
let t = ["transparent 0"], n = 0;
|
|
1124
1134
|
return e.forEach((e, r) => {
|
|
1125
|
-
let i =
|
|
1126
|
-
if (a >=
|
|
1127
|
-
let e = Math.round(n +
|
|
1135
|
+
let i = Ho[r % Ho.length], a = Math.round((e - 24) * i);
|
|
1136
|
+
if (a >= Xn) {
|
|
1137
|
+
let e = Math.round(n + Yn);
|
|
1128
1138
|
t.push(`transparent ${e}px`, `currentColor ${e}px ${e + a}px`, `transparent ${e + a}px`);
|
|
1129
1139
|
}
|
|
1130
1140
|
n += e;
|
|
1131
1141
|
}), `linear-gradient(90deg, ${t.join(",")})`;
|
|
1132
|
-
},
|
|
1142
|
+
}, Wo = (e) => {
|
|
1133
1143
|
if (!q.value) {
|
|
1134
|
-
|
|
1144
|
+
Vo.value["--placeholder-bars"] && (Vo.value = {});
|
|
1135
1145
|
return;
|
|
1136
1146
|
}
|
|
1137
1147
|
let t = e.map((e) => parseFloat(e));
|
|
1138
|
-
t.some((e) => !(e >= 0)) || (
|
|
1139
|
-
...
|
|
1140
|
-
"--placeholder-bars":
|
|
1148
|
+
t.some((e) => !(e >= 0)) || (Vo.value = {
|
|
1149
|
+
...Vo.value,
|
|
1150
|
+
"--placeholder-bars": Uo(t)
|
|
1141
1151
|
});
|
|
1142
|
-
},
|
|
1152
|
+
}, Go = () => {
|
|
1143
1153
|
if (!q.value) return;
|
|
1144
|
-
let e = Math.round(
|
|
1154
|
+
let e = Math.round(pl.value || Xc.value);
|
|
1145
1155
|
if (!(e > 0)) return;
|
|
1146
1156
|
let t = `${e}px`;
|
|
1147
|
-
|
|
1148
|
-
...
|
|
1157
|
+
Vo.value["--row-h"] !== t && (Vo.value = {
|
|
1158
|
+
...Vo.value,
|
|
1149
1159
|
"--row-h": t
|
|
1150
1160
|
});
|
|
1151
|
-
},
|
|
1152
|
-
...
|
|
1153
|
-
...K.value ? null : { "--ts":
|
|
1154
|
-
...
|
|
1155
|
-
...
|
|
1156
|
-
...O.fixedHeaders || q.value ? { "--stuck-head-h": `${
|
|
1157
|
-
...
|
|
1158
|
-
})),
|
|
1159
|
-
let e =
|
|
1161
|
+
}, Ko = m(() => ({
|
|
1162
|
+
...Fr.value,
|
|
1163
|
+
...K.value ? null : { "--ts": R.value && !O.selectable ? 1 : 0 },
|
|
1164
|
+
...Bo.value,
|
|
1165
|
+
...Vo.value,
|
|
1166
|
+
...O.fixedHeaders || q.value ? { "--stuck-head-h": `${Yo.value}px` } : null,
|
|
1167
|
+
...Qa.value ? { "--virtual-row-tracks": Za.value } : null
|
|
1168
|
+
})), qo = () => {
|
|
1169
|
+
let e = F.value, t = Po.value.length;
|
|
1160
1170
|
if (!e || !t) return [];
|
|
1161
1171
|
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);
|
|
1162
1172
|
return r ? Array.from(r.children) : [];
|
|
1163
|
-
},
|
|
1164
|
-
let e =
|
|
1173
|
+
}, Jo = "", Yo = C(0), Xo = () => {
|
|
1174
|
+
let e = F.value;
|
|
1165
1175
|
if (!e) return;
|
|
1166
1176
|
if (K.value) {
|
|
1167
1177
|
let t = getComputedStyle(e), n = t.getPropertyValue("--indent-at").trim();
|
|
1168
|
-
n !==
|
|
1169
|
-
let r =
|
|
1170
|
-
r !==
|
|
1178
|
+
n !== Wa.value && (Wa.value = n);
|
|
1179
|
+
let r = qa(e, t.getPropertyValue("--indent").trim());
|
|
1180
|
+
r !== Ga.value && (Ga.value = r);
|
|
1171
1181
|
}
|
|
1172
1182
|
if (O.fixedHeaders || q.value) {
|
|
1173
1183
|
let t = e.querySelector(":scope > .bb-table__head"), n = t ? Math.round(t.getBoundingClientRect().height) : 0;
|
|
1174
|
-
n !==
|
|
1184
|
+
n !== Yo.value && (Yo.value = n);
|
|
1175
1185
|
}
|
|
1176
|
-
let t =
|
|
1186
|
+
let t = Ve(e);
|
|
1177
1187
|
if (!t) return;
|
|
1178
|
-
let n =
|
|
1188
|
+
let n = Po.value.map((e) => e.key);
|
|
1179
1189
|
if (t.length !== n.length) return;
|
|
1180
|
-
let r = t.join(" "), i = `${
|
|
1181
|
-
if (i ===
|
|
1182
|
-
a &&
|
|
1190
|
+
let r = t.join(" "), i = `${rs.value}|${r}`, a = Qu.value !== Zo;
|
|
1191
|
+
if (i === Jo) {
|
|
1192
|
+
a && Qo(e, t);
|
|
1183
1193
|
return;
|
|
1184
1194
|
}
|
|
1185
|
-
|
|
1195
|
+
Jo = i;
|
|
1186
1196
|
let o = {};
|
|
1187
1197
|
n.forEach((e, n) => {
|
|
1188
1198
|
o[e] = t[n];
|
|
1189
1199
|
});
|
|
1190
|
-
let s =
|
|
1191
|
-
if (u && c && o[c] && (o[c] = `calc(${o[c]} - max(0px, ${u}))`, !O.selectable && !
|
|
1192
|
-
let e = o[
|
|
1193
|
-
|
|
1200
|
+
let s = B.value, c = s[0], l = s[s.length - 1], u = Eo.value, d = Do.value;
|
|
1201
|
+
if (u && c && o[c] && (o[c] = `calc(${o[c]} - max(0px, ${u}))`, !O.selectable && !R.value && bo.value && (o.select = bo.value)), Pn in o) {
|
|
1202
|
+
let e = o[Pn];
|
|
1203
|
+
Wr.value !== e && (Wr.value = e), o.select = o.select ? `calc(${e} + ${o.select})` : e, delete o[Pn];
|
|
1194
1204
|
}
|
|
1195
|
-
let f =
|
|
1196
|
-
f && o.select && c && o[c] && (o.select = `calc(${o.select} - ${f}px)`, o[c] = `calc(${o[c]} + ${f}px)`), d && l && o[l] && (o[l] = `calc(${o[l]} - max(0px, ${d}))`, !M.value &&
|
|
1205
|
+
let f = Ka.value;
|
|
1206
|
+
f && o.select && c && o[c] && (o.select = `calc(${o.select} - ${f}px)`, o[c] = `calc(${o[c]} + ${f}px)`), d && l && o[l] && (o[l] = `calc(${o[l]} - max(0px, ${d}))`, !M.value && xo.value && (o.actions = xo.value));
|
|
1197
1207
|
let p = [
|
|
1198
1208
|
..."select" in o ? ["select"] : [],
|
|
1199
1209
|
...s,
|
|
1200
1210
|
..."actions" in o ? ["actions"] : []
|
|
1201
1211
|
];
|
|
1202
|
-
|
|
1203
|
-
},
|
|
1204
|
-
|
|
1205
|
-
},
|
|
1206
|
-
if (!
|
|
1207
|
-
|
|
1208
|
-
let e =
|
|
1209
|
-
e.forEach((e) =>
|
|
1212
|
+
jl(t), Wo(t), q.value && (Za.value = r), $o = t, Lr(o, p), (Zu.value.length || a) && Qo(e, t), Zu.value.length && Ec();
|
|
1213
|
+
}, Zo = "", Qo = (e, t) => {
|
|
1214
|
+
Ee(e, Zu.value, t) && (Zo = Qu.value);
|
|
1215
|
+
}, $o = null, es, ts = () => {
|
|
1216
|
+
if (!es) return;
|
|
1217
|
+
es.disconnect();
|
|
1218
|
+
let e = qo();
|
|
1219
|
+
e.forEach((e) => es?.observe(e)), e.length && Xo();
|
|
1210
1220
|
};
|
|
1211
|
-
|
|
1212
|
-
|
|
1221
|
+
St(() => {
|
|
1222
|
+
es = new ResizeObserver(Xo), ts();
|
|
1213
1223
|
}), x(() => {
|
|
1214
|
-
|
|
1224
|
+
es?.disconnect();
|
|
1215
1225
|
});
|
|
1216
|
-
let
|
|
1217
|
-
E([
|
|
1218
|
-
b(
|
|
1219
|
-
|
|
1226
|
+
let ns = m(() => Po.value.map((e) => e.key).join(" ")), rs = m(() => B.value.join(" "));
|
|
1227
|
+
E([ns, rs], () => {
|
|
1228
|
+
b(ts), requestAnimationFrame(() => {
|
|
1229
|
+
F.value && Xo();
|
|
1220
1230
|
});
|
|
1221
1231
|
}, { flush: "post" });
|
|
1222
|
-
let
|
|
1232
|
+
let is = (e, t) => O.accessibleLabel ? O.accessibleLabel(e, t) : P("table.select", Ue(e, Tr.value)).value, as = m(() => O.selectable ? "fieldset" : "div"), os = m(() => O.legend || O.caption || P("table.selectableLegend").value), ss = m(() => O.loading || _s.value), cs = m(() => ss.value && !O.interactiveWhileLoading), ls = m(() => Ba.value && !o(G.page) && !o(G.perPage) && !o(G.totalItems) && G.page >= 1 && G.perPage > 0 && G.totalItems >= 0), us = m(() => ({
|
|
1223
1233
|
"bb-table": !0,
|
|
1224
1234
|
[`bb-table--align-${O.align}`]: !0,
|
|
1225
|
-
"bb-table--compact":
|
|
1235
|
+
"bb-table--compact": hr.compact,
|
|
1226
1236
|
"bb-table--reorderable": !!O.reorderable,
|
|
1227
|
-
"bb-table--rows-reorderable":
|
|
1228
|
-
"bb-table--resizable":
|
|
1229
|
-
"bb-table--fixed":
|
|
1230
|
-
"bb-table--inherit-widths":
|
|
1231
|
-
[`bb-table--indent-${
|
|
1237
|
+
"bb-table--rows-reorderable": R.value,
|
|
1238
|
+
"bb-table--resizable": Pi.value,
|
|
1239
|
+
"bb-table--fixed": Ua.value,
|
|
1240
|
+
"bb-table--inherit-widths": eo.value,
|
|
1241
|
+
[`bb-table--indent-${Ja.value}`]: !!Ja.value,
|
|
1232
1242
|
"bb-table--fixed-header": O.fixedHeaders || q.value,
|
|
1233
1243
|
"bb-table--virtual": q.value,
|
|
1234
|
-
"bb-table--virtual-flat":
|
|
1235
|
-
"bb-table--loading":
|
|
1244
|
+
"bb-table--virtual-flat": Qa.value,
|
|
1245
|
+
"bb-table--loading": ss.value,
|
|
1236
1246
|
"bb-table--empty": !J.value.length,
|
|
1237
1247
|
"bb-table--selectable": !!O.selectable,
|
|
1238
|
-
"bb-table--overflow-left":
|
|
1239
|
-
"bb-table--overflow-right":
|
|
1240
|
-
"bb-table--pinned-left":
|
|
1241
|
-
"bb-table--pinned-right":
|
|
1248
|
+
"bb-table--overflow-left": cc.value,
|
|
1249
|
+
"bb-table--overflow-right": lc.value,
|
|
1250
|
+
"bb-table--pinned-left": fc.value,
|
|
1251
|
+
"bb-table--pinned-right": pc.value,
|
|
1242
1252
|
"scrollbar-border": !0
|
|
1243
|
-
})),
|
|
1244
|
-
items:
|
|
1253
|
+
})), ds = m(() => mi.value.length + Number(R.value) + Number(!!O.selectable) + Number(M.value)), fs = m(() => Object.fromEntries(O.columns.map((e) => [e.key, Oe(e.key)]))), { getter: ps, clientReproducible: ms, hydratedFromSsr: hs, items: gs, loading: _s, error: vs, retry: ys, ssrMarker: bs } = d({
|
|
1254
|
+
items: At(O, "items"),
|
|
1245
1255
|
marker: !0
|
|
1246
|
-
}),
|
|
1247
|
-
|
|
1248
|
-
|
|
1256
|
+
}), xs = m(() => O.failedText || P("common.failedText").value), Ss = async () => {
|
|
1257
|
+
await ys() === "applied" && ks();
|
|
1258
|
+
}, { hasPrefilled: Cs, whenPrefilled: ws } = p({
|
|
1259
|
+
alreadyLoaded: hs,
|
|
1260
|
+
clientReproducible: ms,
|
|
1249
1261
|
trigger: !0,
|
|
1250
1262
|
fn: async () => {
|
|
1251
|
-
await
|
|
1263
|
+
await ps(void 0, "initial", G.selected) === "applied" && ks();
|
|
1252
1264
|
}
|
|
1253
|
-
}), { data:
|
|
1265
|
+
}), { data: Ts } = ee({ items: m(() => {
|
|
1254
1266
|
let e = G.selected;
|
|
1255
1267
|
return O.multiple ? e ?? [] : e == null ? [] : [e];
|
|
1256
|
-
}) }), { options: J, baseOptions: Y } =
|
|
1257
|
-
disabled:
|
|
1258
|
-
items:
|
|
1268
|
+
}) }), { options: J, baseOptions: Y } = te({
|
|
1269
|
+
disabled: At(() => O.disabled),
|
|
1270
|
+
items: gs,
|
|
1259
1271
|
itemText: void 0,
|
|
1260
1272
|
itemValue: O.itemValue,
|
|
1261
|
-
max:
|
|
1273
|
+
max: At(() => O.max),
|
|
1262
1274
|
selectable: !0,
|
|
1263
|
-
selectedIndexedByHash:
|
|
1264
|
-
}),
|
|
1265
|
-
E(Y, () =>
|
|
1275
|
+
selectedIndexedByHash: Ts
|
|
1276
|
+
}), Es = m(() => !ss.value && !J.value.length);
|
|
1277
|
+
E(Y, () => Kr.sync(), { flush: "post" });
|
|
1266
1278
|
let X = m(() => {
|
|
1267
|
-
let e = new Set(
|
|
1268
|
-
if (!e.size ||
|
|
1279
|
+
let e = new Set(xr.value.split(" ").filter(Boolean));
|
|
1280
|
+
if (!e.size || vr.value || !J.value.length) return {
|
|
1269
1281
|
first: !1,
|
|
1270
1282
|
last: !1
|
|
1271
1283
|
};
|
|
1272
|
-
let t = (t) =>
|
|
1284
|
+
let t = (t) => z.value.some((n) => e.has(`${fs.value[n.key]}:${t}`));
|
|
1273
1285
|
return {
|
|
1274
1286
|
first: t("first"),
|
|
1275
1287
|
last: t("last")
|
|
1276
1288
|
};
|
|
1277
|
-
}),
|
|
1289
|
+
}), Ds = async (e) => {
|
|
1278
1290
|
O.multiple ? G.selected = (G.selected ?? []).concat(e.value) : G.selected = e.value;
|
|
1279
|
-
},
|
|
1291
|
+
}, Os = async (e) => {
|
|
1280
1292
|
if (O.multiple) {
|
|
1281
|
-
let t = { ...
|
|
1293
|
+
let t = { ...Ts.value };
|
|
1282
1294
|
delete t[e.valueHash], G.selected = Object.values(t);
|
|
1283
1295
|
} else G.selected = null;
|
|
1284
1296
|
};
|
|
1285
|
-
|
|
1297
|
+
ne(() => [
|
|
1286
1298
|
O.dependencies,
|
|
1287
1299
|
O.items,
|
|
1288
1300
|
typeof O.items == "function" ? [G.page, G.perPage] : void 0
|
|
1289
1301
|
], async (e, t) => {
|
|
1290
|
-
if (
|
|
1302
|
+
if (Cs.value || await ws(), !Cs.value) return;
|
|
1291
1303
|
let n = (n) => a(e?.[n]) !== a(t?.[n]), r = t && !n(0) && !n(1) && n(2) ? "pagination" : "dependencies";
|
|
1292
|
-
await
|
|
1304
|
+
await ps(void 0, r, G.selected) === "applied" && ks();
|
|
1293
1305
|
}, { debounce: O.depsDebounceTime });
|
|
1294
|
-
let
|
|
1306
|
+
let ks = () => {
|
|
1295
1307
|
if (!O.enforceCoherence) return;
|
|
1296
1308
|
let e = new Set(J.value.map((e) => e.valueHash)), t = (t) => e.has(a(t));
|
|
1297
1309
|
if (O.multiple) {
|
|
@@ -1299,9 +1311,9 @@ var Ht = {
|
|
|
1299
1311
|
e.every(t) || (G.selected = e.filter(t));
|
|
1300
1312
|
} else !o(G.selected) && !t(G.selected) && (G.selected = null);
|
|
1301
1313
|
let n = G.unselected ?? [];
|
|
1302
|
-
n.every(t) || (G.unselected = n.filter(t)), !o(
|
|
1303
|
-
},
|
|
1304
|
-
let n =
|
|
1314
|
+
n.every(t) || (G.unselected = n.filter(t)), !o(lr.value) && !t(lr.value) && (lr.value = null), mr.value.every(t) || (mr.value = mr.value.filter(t));
|
|
1315
|
+
}, As = (e, t) => {
|
|
1316
|
+
let n = Dr(t, e.key);
|
|
1305
1317
|
return e.formatter && (!o(n) || e.formatOnNull !== !1) && (n = e.formatter(n, e.key, t)), o(n) ? e.placeholder ? {
|
|
1306
1318
|
content: e.placeholder,
|
|
1307
1319
|
kind: "placeholder"
|
|
@@ -1312,16 +1324,16 @@ var Ht = {
|
|
|
1312
1324
|
content: n,
|
|
1313
1325
|
kind: "value"
|
|
1314
1326
|
};
|
|
1315
|
-
},
|
|
1316
|
-
let r = () => n().content, i =
|
|
1327
|
+
}, js = (e, t) => As(e, t).content, Ms = (e, t, n) => {
|
|
1328
|
+
let r = () => n().content, i = fs.value[e.key], a = e.align ?? "start";
|
|
1317
1329
|
return {
|
|
1318
1330
|
align: a,
|
|
1319
1331
|
get classes() {
|
|
1320
1332
|
let n = String(e.key);
|
|
1321
|
-
return
|
|
1333
|
+
return Fe(Gs.value.has(n) ? [
|
|
1322
1334
|
`bb-table__cell--${a}`,
|
|
1323
1335
|
"bb-table__cell--fluid",
|
|
1324
|
-
...
|
|
1336
|
+
...Bs(n, r())
|
|
1325
1337
|
] : [`bb-table__cell--${a}`], O.tdClass, e.tdClass, r(), e.key, t.item);
|
|
1326
1338
|
},
|
|
1327
1339
|
get content() {
|
|
@@ -1334,19 +1346,19 @@ var Ht = {
|
|
|
1334
1346
|
label: e.label,
|
|
1335
1347
|
slotName: i
|
|
1336
1348
|
};
|
|
1337
|
-
},
|
|
1349
|
+
}, Ns = m(() => {
|
|
1338
1350
|
let e = {};
|
|
1339
1351
|
if (O.fixed || K.value || q.value || A.thead) return e;
|
|
1340
|
-
let t =
|
|
1341
|
-
for (let n of
|
|
1352
|
+
let t = Ge(gs.value ?? []);
|
|
1353
|
+
for (let n of z.value) zi(n) ?? (A[fs.value[n.key]] || (e[String(n.key)] = t.map((e) => w(js(n, e)))));
|
|
1342
1354
|
return e;
|
|
1343
|
-
}),
|
|
1344
|
-
table: () =>
|
|
1345
|
-
container: () =>
|
|
1346
|
-
columns: () =>
|
|
1347
|
-
em: () =>
|
|
1355
|
+
}), Ps = m(() => Z.value?.em ?? 0), Fs = Ke({
|
|
1356
|
+
table: () => F.value,
|
|
1357
|
+
container: () => I.value,
|
|
1358
|
+
columns: () => Us(),
|
|
1359
|
+
em: () => Ps.value,
|
|
1348
1360
|
plan: () => {
|
|
1349
|
-
let { stage: e, hold: t, floors: n, wrapLabels: r } =
|
|
1361
|
+
let { stage: e, hold: t, floors: n, wrapLabels: r } = Js.value;
|
|
1350
1362
|
return JSON.stringify([
|
|
1351
1363
|
e,
|
|
1352
1364
|
t,
|
|
@@ -1354,18 +1366,18 @@ var Ht = {
|
|
|
1354
1366
|
[...r]
|
|
1355
1367
|
]);
|
|
1356
1368
|
}
|
|
1357
|
-
}),
|
|
1358
|
-
|
|
1369
|
+
}), Is = m(() => {
|
|
1370
|
+
Fs.version.value;
|
|
1359
1371
|
let e = {};
|
|
1360
|
-
for (let [t, n] of Object.entries(
|
|
1372
|
+
for (let [t, n] of Object.entries(Ns.value)) e[t] = Be(n, Fs.lookup(t));
|
|
1361
1373
|
return e;
|
|
1362
|
-
}),
|
|
1374
|
+
}), Ls = m(() => {
|
|
1363
1375
|
let e = [];
|
|
1364
|
-
for (let [t, n] of Object.entries(
|
|
1376
|
+
for (let [t, n] of Object.entries(Is.value)) n && e.push(`${t}\u0001${+!!n.prose}\u0001${n.usual}`);
|
|
1365
1377
|
return e.join("");
|
|
1366
|
-
}),
|
|
1378
|
+
}), Rs = m(() => {
|
|
1367
1379
|
let e = /* @__PURE__ */ new Map();
|
|
1368
|
-
for (let t of
|
|
1380
|
+
for (let t of Ls.value.split("")) {
|
|
1369
1381
|
if (!t) continue;
|
|
1370
1382
|
let [n, r, i] = t.split("");
|
|
1371
1383
|
e.set(n, {
|
|
@@ -1374,28 +1386,28 @@ var Ht = {
|
|
|
1374
1386
|
});
|
|
1375
1387
|
}
|
|
1376
1388
|
return e;
|
|
1377
|
-
}),
|
|
1378
|
-
let e =
|
|
1379
|
-
if (!
|
|
1380
|
-
let t =
|
|
1381
|
-
for (let e of
|
|
1389
|
+
}), zs = m(() => {
|
|
1390
|
+
let e = gs.value ?? [];
|
|
1391
|
+
if (!je(e.length)) return null;
|
|
1392
|
+
let t = Ge(e), n = /* @__PURE__ */ new Map();
|
|
1393
|
+
for (let e of z.value) A[fs.value[e.key]] || n.set(String(e.key), new Set(t.map((t) => w(js(e, t)).trim())));
|
|
1382
1394
|
return n;
|
|
1383
|
-
}),
|
|
1384
|
-
let n =
|
|
1395
|
+
}), Bs = (e, t) => {
|
|
1396
|
+
let n = Rs.value.get(e);
|
|
1385
1397
|
if (!n) return [];
|
|
1386
1398
|
let r = w(t);
|
|
1387
|
-
return
|
|
1388
|
-
},
|
|
1389
|
-
let e = {}, t =
|
|
1390
|
-
for (let o of
|
|
1399
|
+
return zs.value?.get(e)?.has(r.trim()) === !1 ? [] : De(r, n);
|
|
1400
|
+
}, Vs = m(() => {
|
|
1401
|
+
let e = {}, t = Is.value, n = Z.value?.padEm ?? 1.5, r = Z.value?.head, i = Z.value ? Z.value.rootEm / Z.value.em : 1, a = n / i;
|
|
1402
|
+
for (let o of z.value) {
|
|
1391
1403
|
let s = String(o.key);
|
|
1392
1404
|
if (!(s in t)) continue;
|
|
1393
|
-
let c = o.sortable ? 1.3 : 0, l =
|
|
1394
|
-
l.squeeze = (l.squeeze - a) * i + n,
|
|
1405
|
+
let c = o.sortable ? 1.3 : 0, l = Ae(t[s], r ? Ks(o.label ?? "", r.transform) : o.label ?? "", n + Fs.extraPadOf(s), c, r, a, Fs.labelOf(s, c));
|
|
1406
|
+
l.squeeze = (l.squeeze - a) * i + n, Hs(o) || (l.labelWrap = l.label, l.wrapped = l.hard), e[String(o.key)] = l;
|
|
1395
1407
|
}
|
|
1396
1408
|
return e;
|
|
1397
|
-
}),
|
|
1398
|
-
let t =
|
|
1409
|
+
}), Hs = (e) => {
|
|
1410
|
+
let t = fs.value[e.key];
|
|
1399
1411
|
return ![
|
|
1400
1412
|
`${t}:header`,
|
|
1401
1413
|
`${t}:header:prepend`,
|
|
@@ -1403,65 +1415,65 @@ var Ht = {
|
|
|
1403
1415
|
"header:prepend",
|
|
1404
1416
|
"header:append"
|
|
1405
1417
|
].some((e) => A[e]);
|
|
1406
|
-
},
|
|
1407
|
-
let e =
|
|
1408
|
-
return
|
|
1418
|
+
}, Us = () => {
|
|
1419
|
+
let e = Ns.value, t = Number(R.value) + Number(!!O.selectable), n = [];
|
|
1420
|
+
return z.value.forEach((r, i) => {
|
|
1409
1421
|
let a = String(r.key);
|
|
1410
1422
|
a in e && n.push({
|
|
1411
1423
|
key: a,
|
|
1412
1424
|
index: i + t,
|
|
1413
1425
|
values: e[a],
|
|
1414
1426
|
placeholder: r.placeholder || void 0,
|
|
1415
|
-
prose:
|
|
1416
|
-
label:
|
|
1427
|
+
prose: Rs.value.get(a)?.prose ?? !1,
|
|
1428
|
+
label: Hs(r) && r.label || void 0,
|
|
1417
1429
|
dynamic: typeof O.tdClass == "function" || typeof r.tdClass == "function" || typeof O.rowClass == "function"
|
|
1418
1430
|
});
|
|
1419
1431
|
}), n;
|
|
1420
|
-
},
|
|
1432
|
+
}, Ws = m(() => Object.keys(Vs.value).join(" ")), Gs = m(() => new Set(Ws.value.split(" ").filter(Boolean))), Z = C(null), Ks = (e, t) => t === "uppercase" ? e.toUpperCase() : t === "lowercase" ? e.toLowerCase() : t === "capitalize" ? e.replace(/(^|\s)(\S)/g, (e, t, n) => t + n.toUpperCase()) : e, qs = m(() => {
|
|
1421
1433
|
let e = Z.value;
|
|
1422
1434
|
if (!e) return 0;
|
|
1423
|
-
let t =
|
|
1424
|
-
let n =
|
|
1435
|
+
let t = z.value.reduce((e, t) => {
|
|
1436
|
+
let n = zi(t), r = n == null ? "" : to(n);
|
|
1425
1437
|
return e + (/^[\d.]+px$/.test(r) ? parseFloat(r) : 0);
|
|
1426
1438
|
}, 0);
|
|
1427
1439
|
return Math.max(0, (e.width - t) / e.em);
|
|
1428
|
-
}),
|
|
1440
|
+
}), Js = m(() => Me(Vs.value, qs.value, Z.value ? {
|
|
1429
1441
|
em: Z.value.em,
|
|
1430
1442
|
padEm: Z.value.padEm
|
|
1431
|
-
} : void 0)),
|
|
1432
|
-
let { hold: e } =
|
|
1433
|
-
return
|
|
1434
|
-
}),
|
|
1435
|
-
let { floors: e } =
|
|
1443
|
+
} : void 0)), Ys = m(() => {
|
|
1444
|
+
let { hold: e } = Js.value;
|
|
1445
|
+
return Ws.value && e !== "none" ? `bb-table__table--hold-${e}` : void 0;
|
|
1446
|
+
}), Xs = m(() => Js.value.wrapLabels), Zs = m(() => {
|
|
1447
|
+
let { floors: e } = Js.value, t = Z.value, n = t?.padEm ?? 1.5, r = {};
|
|
1436
1448
|
for (let i in e) {
|
|
1437
1449
|
let a = Math.max(0, e[i] - n);
|
|
1438
|
-
r[i] = { "--floor": t ? `${
|
|
1450
|
+
r[i] = { "--floor": t ? `${Ne(e[i], n, t.em)}px` : `calc(${a.toFixed(2)} * var(--bb-fs, 1em))` };
|
|
1439
1451
|
}
|
|
1440
1452
|
return r;
|
|
1441
|
-
}), Q,
|
|
1453
|
+
}), Q, Qs = 0, $s, ec = (e) => {
|
|
1442
1454
|
let t = [];
|
|
1443
1455
|
for (let n = e.parentElement; n; n = n.parentElement) getComputedStyle(n).containerType !== "normal" && t.push(`${n.clientWidth}x${n.clientHeight}`);
|
|
1444
1456
|
return t.join(",");
|
|
1445
|
-
},
|
|
1457
|
+
}, tc = (e) => {
|
|
1446
1458
|
let t = getComputedStyle(e), n = t.getPropertyValue("--bb-fs").trim(), r = [
|
|
1447
1459
|
n,
|
|
1448
1460
|
t.fontSize,
|
|
1449
1461
|
getComputedStyle(document.documentElement).fontSize,
|
|
1450
1462
|
/v(w|h|i|b|min|max)|cq/.test(n) ? `${window.innerWidth}x${window.innerHeight}` : "",
|
|
1451
|
-
/cq/.test(n) ?
|
|
1463
|
+
/cq/.test(n) ? ec(e) : ""
|
|
1452
1464
|
].join("|");
|
|
1453
|
-
if (
|
|
1465
|
+
if ($s?.key === r) return $s.em;
|
|
1454
1466
|
let i = document.createElement("span");
|
|
1455
1467
|
i.style.cssText = "position:absolute;visibility:hidden;font-size:var(--bb-fs,1em)", e.append(i);
|
|
1456
1468
|
let a = parseFloat(getComputedStyle(i).fontSize);
|
|
1457
|
-
return i.remove(),
|
|
1469
|
+
return i.remove(), $s = {
|
|
1458
1470
|
key: r,
|
|
1459
1471
|
em: a
|
|
1460
1472
|
}, a;
|
|
1461
|
-
},
|
|
1462
|
-
let e =
|
|
1473
|
+
}, nc = () => {
|
|
1474
|
+
let e = I.value, t = F.value;
|
|
1463
1475
|
if (!e?.isConnected || !t) return;
|
|
1464
|
-
let n = getComputedStyle(t), r = parseFloat(n.fontSize) || 16, i =
|
|
1476
|
+
let n = getComputedStyle(t), r = parseFloat(n.fontSize) || 16, i = tc(e) || r, a = 2 * (parseFloat(n.getPropertyValue("--px")) || 12) / i, o = 0;
|
|
1465
1477
|
for (let e of t.querySelectorAll(":scope > .bb-table__head > [role=\"row\"] > :is(.bb-table__cell-column-header--row-drag, .bb-table__cell-column-header--select, .bb-table__cell-column-header--actions)")) o += e.getBoundingClientRect().width;
|
|
1466
1478
|
let s = e.clientWidth ? Math.max(1, e.clientWidth - o) : 0, c = t.querySelector(".bb-table-header__content"), l;
|
|
1467
1479
|
if (c) {
|
|
@@ -1480,7 +1492,7 @@ var Ht = {
|
|
|
1480
1492
|
padEm: a,
|
|
1481
1493
|
head: l
|
|
1482
1494
|
});
|
|
1483
|
-
},
|
|
1495
|
+
}, rc = {
|
|
1484
1496
|
units: {
|
|
1485
1497
|
whole: ".bb-table__cell--fluid:is(.bb-table__cell--line, .bb-table__cell--token)",
|
|
1486
1498
|
word: ".bb-table__cell--fluid.bb-table__cell--word"
|
|
@@ -1494,130 +1506,133 @@ var Ht = {
|
|
|
1494
1506
|
word: ".bb-table__cell--fluid:is(.bb-table__cell--line, .bb-table__cell--word)"
|
|
1495
1507
|
},
|
|
1496
1508
|
none: {}
|
|
1497
|
-
},
|
|
1498
|
-
let { stage: e, hold: t, floors: n } =
|
|
1499
|
-
e >= 7 || !Object.keys(n).length ||
|
|
1500
|
-
},
|
|
1501
|
-
|
|
1502
|
-
},
|
|
1503
|
-
cancelAnimationFrame(
|
|
1509
|
+
}, ic = () => {
|
|
1510
|
+
let { stage: e, hold: t, floors: n } = Js.value;
|
|
1511
|
+
e >= 7 || !Object.keys(n).length || Fs.guard(t, rc[t]);
|
|
1512
|
+
}, ac = (e = !1) => {
|
|
1513
|
+
nc(), q.value || (Fs.checkTypography(), Fs.measure(e), b(ic));
|
|
1514
|
+
}, oc = () => {
|
|
1515
|
+
cancelAnimationFrame(Qs), Qs = requestAnimationFrame(() => ac());
|
|
1504
1516
|
};
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
}), E([
|
|
1517
|
+
St(() => {
|
|
1518
|
+
I.value && typeof ResizeObserver < "u" && (q.value || ac(!0), Q = new ResizeObserver(oc), Q.observe(I.value), F.value && !q.value && Q.observe(F.value), Fs.onFontsChanged(() => !q.value && oc()));
|
|
1519
|
+
}), E([F, q], ([e, t], [n]) => {
|
|
1508
1520
|
Q && (n && Q.unobserve(n), e && !t && Q.observe(e));
|
|
1509
1521
|
});
|
|
1510
|
-
let
|
|
1511
|
-
E(
|
|
1512
|
-
Object.entries(e).every(([e, n]) =>
|
|
1513
|
-
}), E(
|
|
1514
|
-
Q && (t && Q.unobserve(t), e && Q.observe(e),
|
|
1522
|
+
let sc = (e, t) => e?.length === t.length && e.every((e, n) => e === t[n]);
|
|
1523
|
+
E(Ns, (e, t) => {
|
|
1524
|
+
Object.entries(e).every(([e, n]) => sc(t?.[e], n)) || (Fs.rowsChanged(), Q && oc());
|
|
1525
|
+
}), E(I, (e, t) => {
|
|
1526
|
+
Q && (t && Q.unobserve(t), e && Q.observe(e), oc());
|
|
1515
1527
|
}), E(() => [
|
|
1516
1528
|
!!O.selectable,
|
|
1517
|
-
|
|
1529
|
+
R.value,
|
|
1518
1530
|
M.value
|
|
1519
|
-
], () => Q &&
|
|
1520
|
-
Q?.disconnect(), cancelAnimationFrame(
|
|
1531
|
+
], () => Q && oc()), x(() => {
|
|
1532
|
+
Q?.disconnect(), cancelAnimationFrame(Qs), Fs.dispose();
|
|
1521
1533
|
});
|
|
1522
|
-
let
|
|
1523
|
-
let t =
|
|
1524
|
-
return t ?
|
|
1534
|
+
let cc = C(!1), lc = C(!1), uc = C(!1), dc = C(!1), fc = C(!1), pc = C(!1), mc, hc = 0, gc = 0, _c = (e) => {
|
|
1535
|
+
let t = $o;
|
|
1536
|
+
return t ? Zu.value.reduce((n, r) => {
|
|
1525
1537
|
let i = typeof r == "number" ? {
|
|
1526
1538
|
index: r,
|
|
1527
1539
|
position: "left"
|
|
1528
1540
|
} : r;
|
|
1529
1541
|
return i.position === e ? n + (parseFloat(t[i.index] ?? "") || 0) : n;
|
|
1530
1542
|
}, 0) : 0;
|
|
1531
|
-
},
|
|
1532
|
-
let e =
|
|
1543
|
+
}, vc = 0, yc = !1, bc = "", xc = () => {
|
|
1544
|
+
let e = I.value;
|
|
1533
1545
|
if (!e) return;
|
|
1534
|
-
let t =
|
|
1535
|
-
|
|
1536
|
-
},
|
|
1537
|
-
let e =
|
|
1546
|
+
let t = vc, n = yc ? t + e.scrollLeft : e.scrollLeft;
|
|
1547
|
+
cc.value = t > 1 && n > 1, lc.value = t > 1 && t - n > 1;
|
|
1548
|
+
}, Sc = () => {
|
|
1549
|
+
let e = I.value;
|
|
1538
1550
|
if (!e) return;
|
|
1539
|
-
|
|
1540
|
-
let t =
|
|
1541
|
-
r !==
|
|
1542
|
-
},
|
|
1543
|
-
|
|
1551
|
+
vc = K.value ? 0 : e.scrollWidth - e.clientWidth, yc = Ye(e), uc.value = !K.value && (vc > 1 || e.scrollHeight - e.clientHeight > 1), Cc();
|
|
1552
|
+
let t = _c(yc ? "right" : "left"), n = _c(yc ? "left" : "right"), r = `${t} ${n}`;
|
|
1553
|
+
r !== bc && (bc = r, e.style.setProperty("--pin-l", `${t}px`), e.style.setProperty("--pin-r", `${n}px`)), K.value || e.style.setProperty("--vw", `${e.clientWidth}px`), fc.value = t > 0, pc.value = n > 0, xc();
|
|
1554
|
+
}, Cc = () => {
|
|
1555
|
+
dc.value = !!I.value?.querySelector(Zn);
|
|
1544
1556
|
};
|
|
1545
|
-
|
|
1546
|
-
let
|
|
1557
|
+
Ct(Cc);
|
|
1558
|
+
let wc = m(() => {
|
|
1547
1559
|
if (N.value) return { tabindex: -1 };
|
|
1548
|
-
if (!
|
|
1549
|
-
if (
|
|
1560
|
+
if (!uc.value) return {};
|
|
1561
|
+
if (dc.value) return { tabindex: -1 };
|
|
1550
1562
|
let e = j.rootAttrs;
|
|
1551
1563
|
return {
|
|
1552
1564
|
tabindex: 0,
|
|
1553
|
-
...(O.caption || e["aria-label"] || e["aria-labelledby"]) &&
|
|
1554
|
-
...O.caption ? { "aria-labelledby":
|
|
1565
|
+
...(O.caption || e["aria-label"] || e["aria-labelledby"]) && as.value === "div" ? { role: "region" } : {},
|
|
1566
|
+
...O.caption ? { "aria-labelledby": Rr.value } : {}
|
|
1555
1567
|
};
|
|
1556
|
-
}),
|
|
1557
|
-
cancelAnimationFrame(
|
|
1558
|
-
},
|
|
1559
|
-
cancelAnimationFrame(
|
|
1568
|
+
}), Tc = () => {
|
|
1569
|
+
cancelAnimationFrame(hc), hc = requestAnimationFrame(xc);
|
|
1570
|
+
}, Ec = () => {
|
|
1571
|
+
cancelAnimationFrame(gc), gc = requestAnimationFrame(Sc);
|
|
1560
1572
|
};
|
|
1561
|
-
|
|
1562
|
-
let e =
|
|
1563
|
-
e && t && (e.addEventListener("scroll",
|
|
1564
|
-
}), E(L, (e, t) => {
|
|
1565
|
-
t?.removeEventListener("scroll", fc), e && (e.addEventListener("scroll", fc, { passive: !0 }), tc && (t && tc.unobserve(t), tc.observe(e), pc()));
|
|
1573
|
+
St(() => {
|
|
1574
|
+
let e = I.value, t = F.value;
|
|
1575
|
+
e && t && (e.addEventListener("scroll", Tc, { passive: !0 }), typeof ResizeObserver < "u" && (mc = new ResizeObserver(Ec), mc.observe(e), mc.observe(t)));
|
|
1566
1576
|
}), E(I, (e, t) => {
|
|
1567
|
-
|
|
1577
|
+
t?.removeEventListener("scroll", Tc), e && (e.addEventListener("scroll", Tc, { passive: !0 }), mc && (t && mc.unobserve(t), mc.observe(e), Ec()));
|
|
1578
|
+
}), E(F, (e, t) => {
|
|
1579
|
+
mc && (t && mc.unobserve(t), e && mc.observe(e), Ec());
|
|
1568
1580
|
}), x(() => {
|
|
1569
|
-
|
|
1581
|
+
I.value?.removeEventListener("scroll", Tc), mc?.disconnect(), cancelAnimationFrame(hc), cancelAnimationFrame(gc);
|
|
1570
1582
|
});
|
|
1571
|
-
let
|
|
1572
|
-
let t = e.align ?? "start", n = `${
|
|
1583
|
+
let Dc = m(() => z.value.map((e) => {
|
|
1584
|
+
let t = e.align ?? "start", n = `${fs.value[e.key]}:header`, r = Ra(e.key), i = r ?? e.sorted, a = i ? i === "asc" ? "ascending" : "descending" : void 0;
|
|
1573
1585
|
return {
|
|
1574
1586
|
align: t,
|
|
1575
1587
|
key: e.key,
|
|
1576
1588
|
label: e.label,
|
|
1577
1589
|
slotName: n,
|
|
1578
|
-
classes:
|
|
1590
|
+
classes: Ie([`bb-table__cell-column-header--${t}`], O.thClass, e.thClass),
|
|
1579
1591
|
sortable: !!e.sortable,
|
|
1580
1592
|
sortDirection: a,
|
|
1581
1593
|
sortOrder: r
|
|
1582
1594
|
};
|
|
1583
|
-
})),
|
|
1584
|
-
let
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1595
|
+
})), Oc = (e, t) => [`${fs.value[e]}:header:${t}`, `header:${t}`].filter((e) => A[e]), kc = (e) => {
|
|
1596
|
+
for (let t of e.names) {
|
|
1597
|
+
let n = s(A[t], e.scope);
|
|
1598
|
+
if (n) return n;
|
|
1599
|
+
}
|
|
1600
|
+
return null;
|
|
1601
|
+
};
|
|
1602
|
+
kc.props = ["names", "scope"];
|
|
1603
|
+
let Ac = (e) => ({
|
|
1589
1604
|
classes: e.classes,
|
|
1590
1605
|
columnKey: e.key,
|
|
1591
|
-
items:
|
|
1606
|
+
items: gs.value,
|
|
1592
1607
|
label: e.label,
|
|
1593
1608
|
sortable: e.sortable,
|
|
1594
1609
|
sortOrder: e.sortOrder,
|
|
1595
|
-
toggleSort: (t) =>
|
|
1596
|
-
hideColumn: () =>
|
|
1597
|
-
}),
|
|
1610
|
+
toggleSort: (t) => za(e.key, t),
|
|
1611
|
+
hideColumn: () => hi(e.key)
|
|
1612
|
+
}), jc = (e, t) => {
|
|
1598
1613
|
let n = J.value[e];
|
|
1599
1614
|
return n && n.valueHash === t ? n : J.value.find((e) => e.valueHash === t);
|
|
1600
|
-
},
|
|
1601
|
-
let t = Y.value[e], n =
|
|
1615
|
+
}, Mc = (e) => {
|
|
1616
|
+
let t = Y.value[e], n = z.value, r = m(() => n.map((e) => As(e, t.item))), i = n.map((e, n) => Ms(e, t, () => r.value[n]));
|
|
1602
1617
|
return {
|
|
1603
1618
|
get accessibleLabel() {
|
|
1604
|
-
return
|
|
1619
|
+
return is(i, t.item);
|
|
1605
1620
|
},
|
|
1606
1621
|
cols: i,
|
|
1607
1622
|
get rowClasses() {
|
|
1608
|
-
return
|
|
1623
|
+
return Le(O.rowClass, z.value, i, t.item);
|
|
1609
1624
|
},
|
|
1610
1625
|
onRowClick: (n) => {
|
|
1611
|
-
let r =
|
|
1612
|
-
r &&
|
|
1626
|
+
let r = jc(e, t.valueHash);
|
|
1627
|
+
r && Ia(n) && (Pa(r), k("click:row", n, r.item));
|
|
1613
1628
|
},
|
|
1614
1629
|
onRowContextMenu: (n) => {
|
|
1615
|
-
let r =
|
|
1616
|
-
r && !
|
|
1630
|
+
let r = jc(e, t.valueHash);
|
|
1631
|
+
r && !Fa(n) && (k("contextmenu:row", n, r.item), oi(n, r.valueHash, r.item));
|
|
1617
1632
|
},
|
|
1618
1633
|
onRowDblClick: (n) => {
|
|
1619
|
-
let r =
|
|
1620
|
-
r && !
|
|
1634
|
+
let r = jc(e, t.valueHash);
|
|
1635
|
+
r && !Fa(n) && k("dblclick:row", n, r.item);
|
|
1621
1636
|
},
|
|
1622
1637
|
item: t.item,
|
|
1623
1638
|
get text() {
|
|
@@ -1626,24 +1641,24 @@ var Ht = {
|
|
|
1626
1641
|
valueHash: t.valueHash,
|
|
1627
1642
|
value: t.value
|
|
1628
1643
|
};
|
|
1629
|
-
},
|
|
1630
|
-
Y.value,
|
|
1631
|
-
for (let e of
|
|
1644
|
+
}, Nc = m(() => {
|
|
1645
|
+
Y.value, fs.value, O.tdClass, O.rowClass, O.accessibleLabel;
|
|
1646
|
+
for (let e of z.value) e.align, e.formatOnNull, e.formatter, e.key, e.label, e.placeholder, e.tdClass;
|
|
1632
1647
|
return /* @__PURE__ */ new Map();
|
|
1633
|
-
}),
|
|
1634
|
-
if (!(!q.value || e.size <=
|
|
1635
|
-
for (let t of e.keys()) if (e.delete(t), e.size <=
|
|
1648
|
+
}), Pc = (e) => {
|
|
1649
|
+
if (!(!q.value || e.size <= Qn)) {
|
|
1650
|
+
for (let t of e.keys()) if (e.delete(t), e.size <= Qn) break;
|
|
1636
1651
|
}
|
|
1637
|
-
},
|
|
1638
|
-
let t =
|
|
1652
|
+
}, Fc = (e) => {
|
|
1653
|
+
let t = Nc.value, n = t.get(e);
|
|
1639
1654
|
if (n) return n;
|
|
1640
|
-
let r =
|
|
1641
|
-
return t.set(e, r),
|
|
1642
|
-
},
|
|
1643
|
-
let t =
|
|
1655
|
+
let r = Mc(e);
|
|
1656
|
+
return t.set(e, r), Pc(t), r;
|
|
1657
|
+
}, Ic = m(() => (Nc.value, $.value, J.value, Da.value, O.selectable, O.highlightable, /* @__PURE__ */ new Map())), Lc = /* @__PURE__ */ new Map(), Rc = /* @__PURE__ */ new WeakMap(), zc = (e) => {
|
|
1658
|
+
let t = Ic.value, n = t.get(e.index);
|
|
1644
1659
|
if (n) return n;
|
|
1645
|
-
let r =
|
|
1646
|
-
if (c && c.item === r.item && c.cols === r.cols && c.onRowClick === r.onRowClick && c.expanded === e.expanded && c.rowIndex === e.rowIndex && c.selected === i.selected &&
|
|
1660
|
+
let r = Fc(e.index), i = J.value[e.index], a = !!i.disabled, o = () => !O.selectable || typeof O.selectable == "function" && !O.selectable(r.item) || a, s = r.valueHash in Da.value, c = Lc.get(r.valueHash);
|
|
1661
|
+
if (c && c.item === r.item && c.cols === r.cols && c.onRowClick === r.onRowClick && c.expanded === e.expanded && c.rowIndex === e.rowIndex && c.selected === i.selected && Rc.get(c) === a && c.highlighted === s) return t.set(e.index, c), Pc(t), c;
|
|
1647
1662
|
let l = {
|
|
1648
1663
|
get accessibleLabel() {
|
|
1649
1664
|
return r.accessibleLabel;
|
|
@@ -1669,43 +1684,43 @@ var Ht = {
|
|
|
1669
1684
|
return o();
|
|
1670
1685
|
},
|
|
1671
1686
|
get highlightable() {
|
|
1672
|
-
return
|
|
1687
|
+
return Aa() && !ja(r.item);
|
|
1673
1688
|
},
|
|
1674
1689
|
expandProps: {},
|
|
1675
|
-
toggleExpanded: () =>
|
|
1676
|
-
toggleHighlighted: () =>
|
|
1677
|
-
toggleSelected: () =>
|
|
1690
|
+
toggleExpanded: () => gu(r.valueHash),
|
|
1691
|
+
toggleHighlighted: () => Pa(r, { viaSlot: !0 }),
|
|
1692
|
+
toggleSelected: () => Au(l)
|
|
1678
1693
|
};
|
|
1679
|
-
return l.expandProps =
|
|
1680
|
-
},
|
|
1694
|
+
return l.expandProps = hu(l), Rc.set(l, a), t.set(e.index, l), Pc(t), Lc.delete(r.valueHash), Lc.set(r.valueHash, l), Lc.size > Qn && Lc.delete(Lc.keys().next().value), l;
|
|
1695
|
+
}, Bc = Ot({
|
|
1681
1696
|
key: null,
|
|
1682
1697
|
row: 0,
|
|
1683
1698
|
col: null
|
|
1684
|
-
}),
|
|
1699
|
+
}), Vc = m(() => {
|
|
1685
1700
|
if (!N.value) return null;
|
|
1686
1701
|
let e = /* @__PURE__ */ new Map();
|
|
1687
1702
|
for (let t of $.value) e.set(t.key, t.virtualIndex);
|
|
1688
1703
|
return e;
|
|
1689
|
-
}),
|
|
1704
|
+
}), Hc = m(() => {
|
|
1690
1705
|
if (!N.value) return null;
|
|
1691
|
-
let e = $.value.length, t =
|
|
1692
|
-
if (n = t.row ===
|
|
1693
|
-
let r = t.col === null && (!
|
|
1706
|
+
let e = $.value.length, t = Bc.value, n;
|
|
1707
|
+
if (n = t.row === er && X.value.first || t.row === tr && X.value.last ? t.row : !e || t.row < 0 ? Er.value ? -1 : e ? 0 : null : (t.key === null ? void 0 : Vc.value?.get(t.key)) ?? i(t.row, 0, e - 1), n === null) return null;
|
|
1708
|
+
let r = t.col === null && (!Sr.value || n < 0) ? 0 : t.col;
|
|
1694
1709
|
return {
|
|
1695
1710
|
row: n,
|
|
1696
1711
|
col: r
|
|
1697
1712
|
};
|
|
1698
|
-
}),
|
|
1699
|
-
let t =
|
|
1713
|
+
}), Uc = (e) => {
|
|
1714
|
+
let t = Hc.value;
|
|
1700
1715
|
return !t || t.row !== e ? -2 : t.col ?? -1;
|
|
1701
|
-
},
|
|
1702
|
-
if (!
|
|
1703
|
-
let t =
|
|
1704
|
-
return !t || t.row !== -1 ? -1 : Math.min(t.col ?? 0,
|
|
1716
|
+
}, Wc = (e) => {
|
|
1717
|
+
if (!Er.value) return;
|
|
1718
|
+
let t = Hc.value;
|
|
1719
|
+
return !t || t.row !== -1 ? -1 : Math.min(t.col ?? 0, ds.value - 1) === e ? 0 : -1;
|
|
1705
1720
|
}, $ = m(() => {
|
|
1706
1721
|
let e = [], t = 0, n = ((G.page ?? 0) - 1) * (G.perPage ?? 0), r = 1 + Number(X.value.first);
|
|
1707
1722
|
return Y.value.forEach((i, a) => {
|
|
1708
|
-
let o = i.valueHash in
|
|
1723
|
+
let o = i.valueHash in Oa.value, s = n + r + a + 1 + t;
|
|
1709
1724
|
e.push({
|
|
1710
1725
|
kind: "row",
|
|
1711
1726
|
index: a,
|
|
@@ -1722,7 +1737,7 @@ var Ht = {
|
|
|
1722
1737
|
rowIndex: s
|
|
1723
1738
|
}));
|
|
1724
1739
|
}), e;
|
|
1725
|
-
}),
|
|
1740
|
+
}), Gc = (e, t, n, r) => {
|
|
1726
1741
|
let i;
|
|
1727
1742
|
return {
|
|
1728
1743
|
kind: t,
|
|
@@ -1731,13 +1746,13 @@ var Ht = {
|
|
|
1731
1746
|
virtualIndex: e.virtualIndex,
|
|
1732
1747
|
height: r,
|
|
1733
1748
|
get item() {
|
|
1734
|
-
return i ??=
|
|
1749
|
+
return i ??= zc(e);
|
|
1735
1750
|
}
|
|
1736
1751
|
};
|
|
1737
|
-
},
|
|
1738
|
-
let e =
|
|
1752
|
+
}, Kc = Ot(null), qc = C(0), Jc = (e) => /^(auto|scroll)$/.test(getComputedStyle(e).overflowY), Yc = () => {
|
|
1753
|
+
let e = I.value, t = L.value, n = F.value;
|
|
1739
1754
|
if (!q.value || !e || !t || !n) {
|
|
1740
|
-
|
|
1755
|
+
Kc.value = null;
|
|
1741
1756
|
return;
|
|
1742
1757
|
}
|
|
1743
1758
|
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;
|
|
@@ -1745,7 +1760,7 @@ var Ht = {
|
|
|
1745
1760
|
else {
|
|
1746
1761
|
let t = e.parentElement;
|
|
1747
1762
|
for (; t && t !== document.body && t !== document.documentElement;) {
|
|
1748
|
-
if (
|
|
1763
|
+
if (Jc(t)) {
|
|
1749
1764
|
o = t;
|
|
1750
1765
|
break;
|
|
1751
1766
|
}
|
|
@@ -1753,46 +1768,46 @@ var Ht = {
|
|
|
1753
1768
|
}
|
|
1754
1769
|
}
|
|
1755
1770
|
let s = t.querySelector(":scope > .bb-table__edge-row--first"), c = t.getBoundingClientRect().top + (s?.offsetHeight ?? 0), l = o === window ? c + window.scrollY : c - o.getBoundingClientRect().top + o.scrollTop;
|
|
1756
|
-
|
|
1757
|
-
},
|
|
1758
|
-
let e =
|
|
1771
|
+
qc.value !== l && (qc.value = l), Kc.value !== o && (Kc.value = o);
|
|
1772
|
+
}, Xc = C(37), Zc = () => {
|
|
1773
|
+
let e = I.value;
|
|
1759
1774
|
if (!e) return;
|
|
1760
1775
|
let t = parseFloat(getComputedStyle(e).getPropertyValue("--cell-h"));
|
|
1761
|
-
t > 0 && (
|
|
1762
|
-
},
|
|
1763
|
-
if (!q.value || !
|
|
1776
|
+
t > 0 && (Xc.value = t + 1);
|
|
1777
|
+
}, Qc = C(null), $c = (e) => {
|
|
1778
|
+
if (!q.value || !L.value) return;
|
|
1764
1779
|
let t = e.target;
|
|
1765
|
-
for (; t && t.parentElement !==
|
|
1780
|
+
for (; t && t.parentElement !== L.value;) t = t.parentElement;
|
|
1766
1781
|
let n = Number(t?.dataset.index);
|
|
1767
|
-
|
|
1768
|
-
},
|
|
1782
|
+
Qc.value = Number.isInteger(n) ? n : null;
|
|
1783
|
+
}, el = (e) => {
|
|
1769
1784
|
if (!q.value) return;
|
|
1770
1785
|
let t = e.relatedTarget;
|
|
1771
|
-
t &&
|
|
1772
|
-
},
|
|
1786
|
+
t && L.value?.contains(t) || (Qc.value = null);
|
|
1787
|
+
}, tl = C(0), nl = 0, rl = C(!1), il, al = {
|
|
1773
1788
|
offset: 0,
|
|
1774
1789
|
time: 0
|
|
1775
|
-
},
|
|
1776
|
-
|
|
1777
|
-
},
|
|
1778
|
-
clearTimeout(
|
|
1779
|
-
},
|
|
1780
|
-
let t = performance.now(), n = t -
|
|
1781
|
-
if (
|
|
1790
|
+
}, ol = 0, sl = /* @__PURE__ */ new Set(), cl = null, ll = 0, ul = (e) => {
|
|
1791
|
+
ll = ll ? ll * .7 + e * .3 : e;
|
|
1792
|
+
}, dl = () => {
|
|
1793
|
+
clearTimeout(il), il = void 0, rl.value && (rl.value = !1, bl());
|
|
1794
|
+
}, fl = (e) => {
|
|
1795
|
+
let t = performance.now(), n = t - al.time, r = e - al.offset;
|
|
1796
|
+
if (al = {
|
|
1782
1797
|
offset: e,
|
|
1783
1798
|
time: t
|
|
1784
|
-
},
|
|
1785
|
-
let i =
|
|
1786
|
-
if (n > 0 && n < 250 && i &&
|
|
1787
|
-
let e =
|
|
1788
|
-
Math.abs(r) / n *
|
|
1799
|
+
}, ol > 0) return;
|
|
1800
|
+
let i = cl;
|
|
1801
|
+
if (n > 0 && n < 250 && i && ll) {
|
|
1802
|
+
let e = _l?.scrollRect?.height ?? 0, t = (i.end - i.start + e) / 2;
|
|
1803
|
+
Math.abs(r) / n * ll > t && (rl.value = !0);
|
|
1789
1804
|
}
|
|
1790
|
-
clearTimeout(
|
|
1791
|
-
},
|
|
1792
|
-
let e =
|
|
1793
|
-
if (!e?.size || e.size ===
|
|
1794
|
-
if (
|
|
1795
|
-
|
|
1805
|
+
clearTimeout(il), il = setTimeout(dl, ar);
|
|
1806
|
+
}, pl = C(0), ml = -1, hl = !1, gl = () => {
|
|
1807
|
+
let e = _l?.itemSizeCache;
|
|
1808
|
+
if (!e?.size || e.size === ml) return;
|
|
1809
|
+
if (ml = e.size, hl) {
|
|
1810
|
+
Go();
|
|
1796
1811
|
return;
|
|
1797
1812
|
}
|
|
1798
1813
|
let t = /* @__PURE__ */ new Map(), n = 0;
|
|
@@ -1804,78 +1819,78 @@ var Ht = {
|
|
|
1804
1819
|
if (n >= 5) {
|
|
1805
1820
|
let e = 0, r = -1;
|
|
1806
1821
|
for (let [n, i] of t) (i > r || i === r && n < e) && (r = i, e = n);
|
|
1807
|
-
e > 0 && !
|
|
1822
|
+
e > 0 && !hl && (pl.value = e, n >= 20 && (hl = !0));
|
|
1808
1823
|
}
|
|
1809
|
-
|
|
1810
|
-
},
|
|
1824
|
+
Go();
|
|
1825
|
+
}, _l = null, vl = !1;
|
|
1811
1826
|
E(q, (e) => {
|
|
1812
|
-
|
|
1827
|
+
vl = e;
|
|
1813
1828
|
}, { immediate: !0 });
|
|
1814
|
-
let
|
|
1815
|
-
if (
|
|
1816
|
-
let t = q.value ?
|
|
1817
|
-
|
|
1829
|
+
let yl = Ot([]), bl = (e = !1) => {
|
|
1830
|
+
if (nl &&= (cancelAnimationFrame(nl), 0), !_l) return;
|
|
1831
|
+
let t = q.value ? _l.getVirtualItems() : [];
|
|
1832
|
+
tl.value = _l.getTotalSize();
|
|
1818
1833
|
let n = [], r = null;
|
|
1819
1834
|
if (t.length) {
|
|
1820
|
-
let e =
|
|
1835
|
+
let e = _l.measurementsCache, i = $.value.length, a = _l.range, o = a ? a.startIndex : t[0].index, s = a ? a.endIndex : t[t.length - 1].index;
|
|
1821
1836
|
for (let e of t) n.push({
|
|
1822
1837
|
index: e.index,
|
|
1823
1838
|
start: e.start,
|
|
1824
1839
|
end: e.end,
|
|
1825
1840
|
size: e.size
|
|
1826
1841
|
});
|
|
1827
|
-
let c = e?.[Math.max(0, o -
|
|
1842
|
+
let c = e?.[Math.max(0, o - rr)], l = e?.[Math.min(i - 1, s + rr)] ?? c;
|
|
1828
1843
|
c && l && (r = {
|
|
1829
1844
|
start: c.start,
|
|
1830
1845
|
end: l.end
|
|
1831
1846
|
});
|
|
1832
1847
|
}
|
|
1833
|
-
let i = !
|
|
1834
|
-
if (
|
|
1848
|
+
let i = !xl || !r || xl.start !== r.start || xl.end !== r.end;
|
|
1849
|
+
if (xl = r, yl.value = n, !r) return;
|
|
1835
1850
|
if (!e || !i) {
|
|
1836
|
-
|
|
1851
|
+
cl = r;
|
|
1837
1852
|
return;
|
|
1838
1853
|
}
|
|
1839
1854
|
let a = performance.now(), o = r;
|
|
1840
1855
|
b(() => {
|
|
1841
|
-
|
|
1856
|
+
ul(performance.now() - a), cl = o;
|
|
1842
1857
|
});
|
|
1843
|
-
},
|
|
1844
|
-
|
|
1845
|
-
|
|
1858
|
+
}, xl = null, Sl = () => {
|
|
1859
|
+
nl ||= requestAnimationFrame(() => {
|
|
1860
|
+
nl = 0, gl(), bl();
|
|
1846
1861
|
});
|
|
1847
|
-
},
|
|
1848
|
-
t ? (
|
|
1849
|
-
},
|
|
1850
|
-
let e =
|
|
1862
|
+
}, Cl = (e, t) => {
|
|
1863
|
+
t ? (fl(e.getScrollOffset()), bl(!0)) : Sl();
|
|
1864
|
+
}, wl = (e) => $.value[e]?.key ?? e, Tl = (e) => ($.value[e]?.kind === "expand" ? 3 : 1) * (pl.value || Xc.value), El = Ut(m(() => {
|
|
1865
|
+
let e = Kc.value, t = typeof window < "u" && e === window, n = Qc.value, r = Hc.value?.row, i = r != null && r >= 0 ? r : null;
|
|
1851
1866
|
return {
|
|
1852
|
-
onChange:
|
|
1867
|
+
onChange: Cl,
|
|
1853
1868
|
count: q.value ? $.value.length : 0,
|
|
1854
1869
|
enabled: q.value,
|
|
1855
1870
|
getScrollElement: () => e,
|
|
1856
|
-
estimateSize:
|
|
1857
|
-
getItemKey:
|
|
1858
|
-
overscan:
|
|
1859
|
-
scrollMargin:
|
|
1871
|
+
estimateSize: Tl,
|
|
1872
|
+
getItemKey: wl,
|
|
1873
|
+
overscan: rr,
|
|
1874
|
+
scrollMargin: qc.value,
|
|
1860
1875
|
initialRect: {
|
|
1861
1876
|
width: 0,
|
|
1862
|
-
height:
|
|
1877
|
+
height: ir
|
|
1863
1878
|
},
|
|
1864
1879
|
rangeExtractor: (e) => {
|
|
1865
|
-
let t = e.endIndex - e.startIndex >
|
|
1880
|
+
let t = e.endIndex - e.startIndex > nr ? {
|
|
1866
1881
|
...e,
|
|
1867
|
-
endIndex: e.startIndex +
|
|
1868
|
-
} : e, r =
|
|
1882
|
+
endIndex: e.startIndex + nr
|
|
1883
|
+
} : e, r = Lt(t), a = [n, i].filter((t) => t != null && t < e.count && !r.includes(t));
|
|
1869
1884
|
return a.length ? [.../* @__PURE__ */ new Set([...r, ...a])].sort((e, t) => e - t) : r;
|
|
1870
1885
|
},
|
|
1871
|
-
observeElementRect: t ?
|
|
1872
|
-
observeElementOffset: t ?
|
|
1873
|
-
scrollToFn: t ?
|
|
1886
|
+
observeElementRect: t ? Ht : Bt,
|
|
1887
|
+
observeElementOffset: t ? Vt : zt,
|
|
1888
|
+
scrollToFn: t ? Wt : Rt
|
|
1874
1889
|
};
|
|
1875
1890
|
}));
|
|
1876
|
-
|
|
1877
|
-
let
|
|
1878
|
-
let t =
|
|
1891
|
+
_l = El.value;
|
|
1892
|
+
let Dl = (e) => {
|
|
1893
|
+
let t = _l.measurementsCache, n = $.value, r = n.findIndex((t) => t.kind === "row" && t.index === e);
|
|
1879
1894
|
if (r < 0 || !t?.[r]) return null;
|
|
1880
1895
|
let i = n[r + 1]?.kind === "expand" && t[r + 1] ? r + 1 : r;
|
|
1881
1896
|
return {
|
|
@@ -1883,13 +1898,13 @@ var Ht = {
|
|
|
1883
1898
|
end: t[i].end
|
|
1884
1899
|
};
|
|
1885
1900
|
};
|
|
1886
|
-
|
|
1887
|
-
let
|
|
1888
|
-
|
|
1889
|
-
},
|
|
1890
|
-
let t = [], n = 0, r =
|
|
1891
|
-
for (let i = 0; i < e.length && t.length <
|
|
1892
|
-
let e =
|
|
1901
|
+
bl();
|
|
1902
|
+
let Ol = (e) => {
|
|
1903
|
+
vl && _l?.measureElement(e);
|
|
1904
|
+
}, kl = (e) => {
|
|
1905
|
+
let t = [], n = 0, r = rr;
|
|
1906
|
+
for (let i = 0; i < e.length && t.length < nr && !(n >= ir && r-- <= 0); i++) {
|
|
1907
|
+
let e = Tl(i);
|
|
1893
1908
|
t.push({
|
|
1894
1909
|
index: i,
|
|
1895
1910
|
start: n,
|
|
@@ -1898,119 +1913,119 @@ var Ht = {
|
|
|
1898
1913
|
}), n += e;
|
|
1899
1914
|
}
|
|
1900
1915
|
return t;
|
|
1901
|
-
},
|
|
1916
|
+
}, Al = m(() => {
|
|
1902
1917
|
let e = $.value;
|
|
1903
|
-
if (
|
|
1904
|
-
let t =
|
|
1918
|
+
if (Ic.value, !q.value) return e.map((e) => Gc(e, e.kind, e.key, 0));
|
|
1919
|
+
let t = yl.value.length ? yl.value : kl(e);
|
|
1905
1920
|
if (!t.length) return [];
|
|
1906
|
-
let n = [], r =
|
|
1921
|
+
let n = [], r = qc.value, i = rl.value, a = r, o;
|
|
1907
1922
|
for (let r of t) {
|
|
1908
1923
|
let t = e[r.index];
|
|
1909
1924
|
if (!t) continue;
|
|
1910
1925
|
let s = r.start - a;
|
|
1911
|
-
s > .5 && n.push(
|
|
1926
|
+
s > .5 && n.push(Gc(t, "spacer", `s:${t.key}`, s)), i && t.kind === "row" && !sl.has(t.key) ? n.push(Gc(t, "placeholder", `p:${t.key}`, r.size)) : n.push(Gc(t, t.kind, t.key, 0)), a = r.end, o = t;
|
|
1912
1927
|
}
|
|
1913
|
-
let s =
|
|
1914
|
-
return s > .5 && o && n.push(
|
|
1928
|
+
let s = tl.value - (a - r);
|
|
1929
|
+
return s > .5 && o && n.push(Gc(o, "spacer", "s:end", s)), n;
|
|
1915
1930
|
});
|
|
1916
|
-
E(
|
|
1917
|
-
if (q.value) for (let t of e) (t.kind === "row" || t.kind === "expand") &&
|
|
1931
|
+
E(Al, (e) => {
|
|
1932
|
+
if (q.value) for (let t of e) (t.kind === "row" || t.kind === "expand") && sl.add(t.key);
|
|
1918
1933
|
}, { flush: "post" });
|
|
1919
|
-
let
|
|
1920
|
-
let t =
|
|
1934
|
+
let jl = (e) => {
|
|
1935
|
+
let t = F.value;
|
|
1921
1936
|
if (!q.value || !t || !t.querySelector(":scope > .bb-table__body > .bb-table__row")) return;
|
|
1922
|
-
let n =
|
|
1923
|
-
if (
|
|
1924
|
-
if (t.key === "select" || t.key === "actions" || t.key ===
|
|
1925
|
-
if (t.key in
|
|
1937
|
+
let n = z.value, r = null, i = null;
|
|
1938
|
+
if (Po.value.forEach((t, a) => {
|
|
1939
|
+
if (t.key === "select" || t.key === "actions" || t.key === Pn) {
|
|
1940
|
+
if (t.key in Xa.value) return;
|
|
1926
1941
|
let n = parseFloat(e[a]);
|
|
1927
1942
|
if (!(n > 0)) return;
|
|
1928
|
-
(i ??= { ...
|
|
1943
|
+
(i ??= { ...Xa.value })[t.key] = n;
|
|
1929
1944
|
return;
|
|
1930
1945
|
}
|
|
1931
1946
|
let o = n.find((e) => String(e.key) === t.key);
|
|
1932
1947
|
if (!o || o.width != null) return;
|
|
1933
1948
|
let s = String(o.key);
|
|
1934
|
-
if (s in
|
|
1949
|
+
if (s in Ya.value || s in (r ?? {})) return;
|
|
1935
1950
|
let c = parseFloat(e[a]);
|
|
1936
|
-
c > 0 && ((r ??= { ...
|
|
1937
|
-
}), !r && !i ||
|
|
1951
|
+
c > 0 && ((r ??= { ...Ya.value })[s] = c);
|
|
1952
|
+
}), !r && !i || Ml) return;
|
|
1938
1953
|
let a = r, o = i;
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
...
|
|
1954
|
+
Ml = requestAnimationFrame(() => {
|
|
1955
|
+
Ml = 0, a && (Ya.value = {
|
|
1956
|
+
...Ya.value,
|
|
1942
1957
|
...a
|
|
1943
|
-
}), o && (
|
|
1944
|
-
...
|
|
1958
|
+
}), o && (Xa.value = {
|
|
1959
|
+
...Xa.value,
|
|
1945
1960
|
...o
|
|
1946
1961
|
});
|
|
1947
1962
|
});
|
|
1948
|
-
},
|
|
1963
|
+
}, Ml = 0;
|
|
1949
1964
|
E([() => q.value, () => J.value.length === 0], ([e, t]) => {
|
|
1950
|
-
(!e || t) && (Object.keys(
|
|
1951
|
-
}), E(
|
|
1952
|
-
q.value &&
|
|
1965
|
+
(!e || t) && (Object.keys(Ya.value).length && (Ya.value = {}), Object.keys(Xa.value).length && (Xa.value = {}), Za.value = "");
|
|
1966
|
+
}), E(Xc, () => {
|
|
1967
|
+
q.value && El.value.measure();
|
|
1953
1968
|
});
|
|
1954
|
-
let
|
|
1955
|
-
|
|
1956
|
-
let e =
|
|
1969
|
+
let Nl, Pl, Fl = () => {
|
|
1970
|
+
Nl?.disconnect(), Nl = void 0, Pl?.(), Pl = void 0;
|
|
1971
|
+
let e = I.value;
|
|
1957
1972
|
if (!q.value || !e) return;
|
|
1958
1973
|
let t = 0, n = () => {
|
|
1959
1974
|
t ||= requestAnimationFrame(() => {
|
|
1960
|
-
t = 0,
|
|
1975
|
+
t = 0, Yc();
|
|
1961
1976
|
});
|
|
1962
1977
|
};
|
|
1963
|
-
if (
|
|
1978
|
+
if (Kc.value === e) Nl = new ResizeObserver(() => Yc()), Nl.observe(e);
|
|
1964
1979
|
else {
|
|
1965
1980
|
window.addEventListener("resize", n);
|
|
1966
1981
|
let e = new ResizeObserver(n);
|
|
1967
|
-
e.observe(document.documentElement),
|
|
1982
|
+
e.observe(document.documentElement), Pl = () => {
|
|
1968
1983
|
window.removeEventListener("resize", n), e.disconnect(), t && cancelAnimationFrame(t);
|
|
1969
1984
|
};
|
|
1970
1985
|
}
|
|
1971
1986
|
};
|
|
1972
|
-
E(
|
|
1973
|
-
let
|
|
1987
|
+
E(Kc, Fl);
|
|
1988
|
+
let Il;
|
|
1974
1989
|
E(() => [q.value, X.value.first], ([e]) => {
|
|
1975
|
-
|
|
1976
|
-
let t =
|
|
1977
|
-
e && t && typeof ResizeObserver < "u" && (
|
|
1978
|
-
}, { flush: "post" }), x(() =>
|
|
1990
|
+
Il?.disconnect(), Il = void 0, Yc();
|
|
1991
|
+
let t = L.value?.querySelector(":scope > .bb-table__edge-row--first");
|
|
1992
|
+
e && t && typeof ResizeObserver < "u" && (Il = new ResizeObserver(() => requestAnimationFrame(Yc)), Il.observe(t));
|
|
1993
|
+
}, { flush: "post" }), x(() => Il?.disconnect()), E(() => [q.value, $.value.length], () => {
|
|
1979
1994
|
b(() => {
|
|
1980
|
-
|
|
1995
|
+
Zc(), Yc(), Fl(), sl = /* @__PURE__ */ new Set(), ml = -1, hl = !1, bl();
|
|
1981
1996
|
});
|
|
1982
1997
|
}, { flush: "post" });
|
|
1983
|
-
let
|
|
1984
|
-
q.value && Object.keys(
|
|
1985
|
-
let e =
|
|
1986
|
-
t &&
|
|
1998
|
+
let Ll = () => {
|
|
1999
|
+
q.value && Object.keys(Ya.value).length && (Ya.value = {}, b(() => requestAnimationFrame(() => {
|
|
2000
|
+
let e = F.value, t = e ? Ve(e) : null;
|
|
2001
|
+
t && jl(t);
|
|
1987
2002
|
})));
|
|
1988
|
-
},
|
|
2003
|
+
}, Rl, zl = () => {
|
|
1989
2004
|
let e = typeof document < "u" ? document.fonts : void 0;
|
|
1990
|
-
e && !
|
|
2005
|
+
e && !Rl && (e.status !== "loaded" && e.ready.then(Ll), e.addEventListener("loadingdone", Ll), Rl = () => e.removeEventListener("loadingdone", Ll));
|
|
1991
2006
|
};
|
|
1992
|
-
|
|
1993
|
-
|
|
2007
|
+
St(() => {
|
|
2008
|
+
Zc(), Go(), Yc(), Fl(), bl(), q.value && zl();
|
|
1994
2009
|
}), E(q, (e) => {
|
|
1995
|
-
e &&
|
|
2010
|
+
e && zl(), $o && Wo($o), Go();
|
|
1996
2011
|
}), x(() => {
|
|
1997
|
-
|
|
2012
|
+
Nl?.disconnect(), Pl?.(), Rl?.(), nl && cancelAnimationFrame(nl);
|
|
1998
2013
|
});
|
|
1999
|
-
let
|
|
2000
|
-
let n = e >= 0 ?
|
|
2014
|
+
let Bl = () => new Promise((e) => requestAnimationFrame(() => e())), Vl = () => F.value?.querySelector(":scope > .bb-table__head > .bb-table__header-row") ?? null, Hl = (e) => L.value?.querySelector(`:scope > [role="row"][data-index="${e}"]`) ?? null, Ul = (e) => L.value?.querySelector(`:scope > .bb-table__edge-row--${e === er ? "first" : "last"}`) ?? null, Wl = (e, t) => {
|
|
2015
|
+
let n = e >= 0 ? Hl(e) : e === $n ? Vl() : Ul(e);
|
|
2001
2016
|
if (!n || t === null) return n;
|
|
2002
2017
|
let r = n.children;
|
|
2003
2018
|
return r[Math.min(t, r.length - 1)] ?? null;
|
|
2004
|
-
},
|
|
2005
|
-
let t =
|
|
2019
|
+
}, Gl = (e) => e >= 0 && $.value[e]?.kind === "expand" ? 1 : ds.value, Kl = (e) => {
|
|
2020
|
+
let t = F.value;
|
|
2006
2021
|
if (!t || !(e instanceof Element) || !t.contains(e)) return null;
|
|
2007
2022
|
let n = null;
|
|
2008
2023
|
for (let r = e; r && r !== t;) {
|
|
2009
2024
|
let i = r.parentElement;
|
|
2010
2025
|
if (i && i.parentElement === t && r.getAttribute("role") === "row") {
|
|
2011
2026
|
let t = r, a = i.classList.contains("bb-table__head");
|
|
2012
|
-
if ((a ? !
|
|
2013
|
-
let o = !a && t.classList.contains("bb-table__edge-row"), s = a ?
|
|
2027
|
+
if ((a ? !Er.value : i !== L.value) || a && !t.classList.contains("bb-table__header-row")) return null;
|
|
2028
|
+
let o = !a && t.classList.contains("bb-table__edge-row"), s = a ? $n : o ? t.classList.contains("bb-table__edge-row--first") ? er : tr : Number(t.dataset.index);
|
|
2014
2029
|
if (!Number.isInteger(s)) return null;
|
|
2015
2030
|
if (!n) return {
|
|
2016
2031
|
row: s,
|
|
@@ -2031,19 +2046,19 @@ var Ht = {
|
|
|
2031
2046
|
n = r, r = i;
|
|
2032
2047
|
}
|
|
2033
2048
|
return null;
|
|
2034
|
-
},
|
|
2035
|
-
|
|
2049
|
+
}, ql = async (e, t) => {
|
|
2050
|
+
Bc.value = {
|
|
2036
2051
|
key: e < 0 ? null : $.value[e]?.key ?? null,
|
|
2037
2052
|
row: e,
|
|
2038
2053
|
col: t
|
|
2039
2054
|
};
|
|
2040
|
-
let n =
|
|
2055
|
+
let n = Wl(e, t);
|
|
2041
2056
|
if (!n && e >= 0 && q.value) {
|
|
2042
|
-
|
|
2057
|
+
ol++, dl();
|
|
2043
2058
|
try {
|
|
2044
|
-
for (let r = 0; r < 8 && !n; r++)
|
|
2059
|
+
for (let r = 0; r < 8 && !n; r++) El.value.scrollToIndex(e, { align: "auto" }), await Bl(), await b(), n = Wl(e, t);
|
|
2045
2060
|
} finally {
|
|
2046
|
-
|
|
2061
|
+
ol--;
|
|
2047
2062
|
}
|
|
2048
2063
|
}
|
|
2049
2064
|
if (n && (n.focus(), n.scrollIntoView({
|
|
@@ -2051,96 +2066,96 @@ var Ht = {
|
|
|
2051
2066
|
inline: "nearest"
|
|
2052
2067
|
}), q.value && e >= 0)) for (let e = 0; e < 4; e++) {
|
|
2053
2068
|
let e = n.getBoundingClientRect().top;
|
|
2054
|
-
if (await
|
|
2069
|
+
if (await Bl(), n.scrollIntoView({
|
|
2055
2070
|
block: "nearest",
|
|
2056
2071
|
inline: "nearest"
|
|
2057
2072
|
}), Math.abs(n.getBoundingClientRect().top - e) < .5) break;
|
|
2058
2073
|
}
|
|
2059
|
-
},
|
|
2060
|
-
if (e.closest("[data-bb-table-id]") !==
|
|
2061
|
-
let t =
|
|
2062
|
-
return !!t?.inside && t.cell !==
|
|
2063
|
-
},
|
|
2064
|
-
let t = e.querySelectorAll(
|
|
2065
|
-
e.matches("a[href], area[href], button, input:not([type=\"hidden\"]), select, textarea, iframe, summary, audio[controls], video[controls], [contenteditable]:not([contenteditable=\"false\"]), [tabindex]") &&
|
|
2066
|
-
for (let e of t)
|
|
2067
|
-
},
|
|
2068
|
-
for (let t of e.querySelectorAll(`[${
|
|
2069
|
-
},
|
|
2070
|
-
|
|
2071
|
-
},
|
|
2072
|
-
let e =
|
|
2073
|
-
|
|
2074
|
-
},
|
|
2075
|
-
let t =
|
|
2076
|
-
return t ? (
|
|
2077
|
-
},
|
|
2078
|
-
|
|
2079
|
-
let e =
|
|
2080
|
-
e && (N.value ? (
|
|
2074
|
+
}, Jl = null, Yl = 0, Xl = (e) => {
|
|
2075
|
+
if (e.closest("[data-bb-table-id]") !== I.value) return !1;
|
|
2076
|
+
let t = Kl(e);
|
|
2077
|
+
return !!t?.inside && t.cell !== Jl;
|
|
2078
|
+
}, Zl = (e) => {
|
|
2079
|
+
let t = e.querySelectorAll(tt);
|
|
2080
|
+
e.matches("a[href], area[href], button, input:not([type=\"hidden\"]), select, textarea, iframe, summary, audio[controls], video[controls], [contenteditable]:not([contenteditable=\"false\"]), [tabindex]") && Xl(e) && at(e);
|
|
2081
|
+
for (let e of t) Xl(e) && at(e);
|
|
2082
|
+
}, Ql = (e) => {
|
|
2083
|
+
for (let t of e.querySelectorAll(`[${nt}]`)) t.closest("[data-bb-table-id]") === I.value && it(t);
|
|
2084
|
+
}, $l = (e) => {
|
|
2085
|
+
Jl !== e && (eu(), Jl = e, Yl = Ze(), Ql(e));
|
|
2086
|
+
}, eu = () => {
|
|
2087
|
+
let e = Jl;
|
|
2088
|
+
Jl = null, e?.isConnected && N.value && Zl(e);
|
|
2089
|
+
}, tu = (e) => {
|
|
2090
|
+
let t = rt(e)[0];
|
|
2091
|
+
return t ? ($l(e), t.focus(), !0) : !1;
|
|
2092
|
+
}, nu = null, ru = () => {
|
|
2093
|
+
nu?.disconnect(), nu = null;
|
|
2094
|
+
let e = F.value;
|
|
2095
|
+
e && (N.value ? (Zl(e), nu = new MutationObserver((e) => {
|
|
2081
2096
|
for (let t of e) {
|
|
2082
2097
|
if (t.type === "childList") {
|
|
2083
|
-
for (let e of t.addedNodes) e instanceof Element &&
|
|
2098
|
+
for (let e of t.addedNodes) e instanceof Element && Zl(e);
|
|
2084
2099
|
continue;
|
|
2085
2100
|
}
|
|
2086
2101
|
let e = t.target;
|
|
2087
|
-
e.getAttribute("tabindex") !== "-1" && (e.removeAttribute(
|
|
2102
|
+
e.getAttribute("tabindex") !== "-1" && (e.removeAttribute(nt), Zl(e));
|
|
2088
2103
|
}
|
|
2089
|
-
}),
|
|
2104
|
+
}), nu.observe(e, {
|
|
2090
2105
|
childList: !0,
|
|
2091
2106
|
subtree: !0,
|
|
2092
2107
|
attributes: !0,
|
|
2093
2108
|
attributeFilter: ["tabindex"]
|
|
2094
|
-
})) : (
|
|
2109
|
+
})) : (Jl = null, Ql(e)));
|
|
2095
2110
|
};
|
|
2096
|
-
|
|
2097
|
-
let
|
|
2098
|
-
let t =
|
|
2111
|
+
St(ru), E(N, () => b(ru)), x(() => nu?.disconnect());
|
|
2112
|
+
let iu = (e) => {
|
|
2113
|
+
let t = Kl(e.target);
|
|
2099
2114
|
if (!t) return;
|
|
2100
|
-
t.inside && t.cell ?
|
|
2101
|
-
let n =
|
|
2102
|
-
n && n.row === t.row &&
|
|
2115
|
+
t.inside && t.cell ? $l(t.cell) : eu();
|
|
2116
|
+
let n = Hc.value, r = t.cell ?? t.rowEl;
|
|
2117
|
+
n && n.row === t.row && Wl(n.row, n.col) === r || (Bc.value = {
|
|
2103
2118
|
key: t.row < 0 ? null : $.value[t.row]?.key ?? null,
|
|
2104
2119
|
row: t.row,
|
|
2105
2120
|
col: t.cell ? t.col : null
|
|
2106
2121
|
});
|
|
2107
|
-
},
|
|
2108
|
-
N.value &&
|
|
2122
|
+
}, au = (e) => {
|
|
2123
|
+
N.value && iu(e);
|
|
2109
2124
|
};
|
|
2110
|
-
E(
|
|
2111
|
-
t?.removeEventListener("focusin",
|
|
2112
|
-
}, { flush: "sync" }), x(() =>
|
|
2113
|
-
let
|
|
2125
|
+
E(F, (e, t) => {
|
|
2126
|
+
t?.removeEventListener("focusin", au), e?.addEventListener("focusin", au);
|
|
2127
|
+
}, { flush: "sync" }), x(() => F.value?.removeEventListener("focusin", au));
|
|
2128
|
+
let ou = (e) => {
|
|
2114
2129
|
let t = e.relatedTarget;
|
|
2115
|
-
|
|
2116
|
-
},
|
|
2130
|
+
Jl && !(t instanceof Node && Jl.contains(t)) && eu();
|
|
2131
|
+
}, su = (e) => {
|
|
2117
2132
|
let t = $.value[e];
|
|
2118
|
-
O.selectable && t && t.kind === "row" &&
|
|
2119
|
-
},
|
|
2133
|
+
O.selectable && t && t.kind === "row" && ju(zc(t));
|
|
2134
|
+
}, cu = () => !O.selectable || !Su() ? !1 : (bu.value?.click(), !0), lu = (e) => {
|
|
2120
2135
|
e.row >= 0 && $.value[e.row]?.kind === "row" && e.rowEl.click();
|
|
2121
|
-
},
|
|
2136
|
+
}, uu = (e) => e >= 0 ? e : e === tr ? $.value.length : e === er ? -1 : X.value.first ? -2 : -1, du = (e) => {
|
|
2122
2137
|
let t = $.value.length;
|
|
2123
|
-
return e >= t ? X.value.last ?
|
|
2124
|
-
},
|
|
2125
|
-
let r = $.value.length, a = X.value.first ? -1 : 0, o = n ? a :
|
|
2126
|
-
return s < o ? e :
|
|
2127
|
-
},
|
|
2128
|
-
if (e.defaultPrevented ||
|
|
2129
|
-
let t =
|
|
2138
|
+
return e >= t ? X.value.last ? tr : t - 1 : e >= 0 ? e : e === -1 && X.value.first ? er : $n;
|
|
2139
|
+
}, fu = (e, t, n = !1) => {
|
|
2140
|
+
let r = $.value.length, a = X.value.first ? -1 : 0, o = n ? a : Er.value ? a - 1 : a, s = X.value.last ? r : r - 1;
|
|
2141
|
+
return s < o ? e : du(i(uu(e) + t, o, s));
|
|
2142
|
+
}, pu = (e) => {
|
|
2143
|
+
if (e.defaultPrevented || R.value && Kr.onGridKeydown(e)) return;
|
|
2144
|
+
let t = Kl(e.target);
|
|
2130
2145
|
if (!t) return;
|
|
2131
2146
|
let n = e.key;
|
|
2132
2147
|
if (t.inside) {
|
|
2133
|
-
if (!t.cell || !(n === "F2" || n === "Escape" &&
|
|
2148
|
+
if (!t.cell || !(n === "F2" || n === "Escape" && Ze() <= Yl) || e.altKey || e.ctrlKey || e.metaKey) return;
|
|
2134
2149
|
e.preventDefault(), e.stopPropagation(), t.cell.focus();
|
|
2135
2150
|
return;
|
|
2136
2151
|
}
|
|
2137
2152
|
if ((e.ctrlKey || e.metaKey) && !e.altKey && n.toLowerCase() === "a") {
|
|
2138
|
-
|
|
2153
|
+
cu() && e.preventDefault();
|
|
2139
2154
|
return;
|
|
2140
2155
|
}
|
|
2141
2156
|
if (e.altKey || e.metaKey || e.shiftKey && n !== " ") return;
|
|
2142
|
-
let r = e.ctrlKey, i =
|
|
2143
|
-
e.preventDefault(), (n !== t.row || r !== (t.cell ? t.col : null)) &&
|
|
2157
|
+
let r = e.ctrlKey, i = Xe(t.rowEl), a = i ? "ArrowLeft" : "ArrowRight", o = i ? "ArrowRight" : "ArrowLeft", s = $.value.length - 1, c = Sr.value, l = (n, r) => {
|
|
2158
|
+
e.preventDefault(), (n !== t.row || r !== (t.cell ? t.col : null)) && ql(n, r);
|
|
2144
2159
|
}, u = () => e.preventDefault();
|
|
2145
2160
|
if (!t.cell) {
|
|
2146
2161
|
if (!c) return;
|
|
@@ -2148,137 +2163,137 @@ var Ht = {
|
|
|
2148
2163
|
switch (n) {
|
|
2149
2164
|
case "ArrowDown": return l(Math.min(t.row + 1, s), null);
|
|
2150
2165
|
case "ArrowUp": return l(Math.max(t.row - 1, 0), null);
|
|
2151
|
-
case "PageDown": return l(Math.min(t.row +
|
|
2152
|
-
case "PageUp": return l(Math.max(t.row -
|
|
2166
|
+
case "PageDown": return l(Math.min(t.row + or, s), null);
|
|
2167
|
+
case "PageUp": return l(Math.max(t.row - or, 0), null);
|
|
2153
2168
|
case "Home": return l(0, null);
|
|
2154
2169
|
case "End": return l(s, null);
|
|
2155
2170
|
case a:
|
|
2156
2171
|
if (i && !r.expanded) {
|
|
2157
|
-
u(),
|
|
2172
|
+
u(), gu(Y.value[r.index].valueHash);
|
|
2158
2173
|
return;
|
|
2159
2174
|
}
|
|
2160
2175
|
return l(t.row, 0);
|
|
2161
2176
|
case o:
|
|
2162
|
-
u(), i && r.expanded &&
|
|
2177
|
+
u(), i && r.expanded && gu(Y.value[r.index].valueHash);
|
|
2163
2178
|
return;
|
|
2164
2179
|
case "Enter":
|
|
2165
2180
|
case " ":
|
|
2166
|
-
u(), e.shiftKey && n === " " ?
|
|
2181
|
+
u(), e.shiftKey && n === " " ? su(t.row) : lu(t);
|
|
2167
2182
|
return;
|
|
2168
2183
|
}
|
|
2169
2184
|
return;
|
|
2170
2185
|
}
|
|
2171
|
-
let d =
|
|
2186
|
+
let d = Hc.value, f = d && d.row === t.row && d.col !== null ? d.col : t.col, p = (e) => Gl(e) - 1, ee = !!O.selectable && t.col === Number(R.value);
|
|
2172
2187
|
switch (n) {
|
|
2173
2188
|
case a: return l(t.row, Math.min(t.col + 1, p(t.row)));
|
|
2174
2189
|
case o: return t.col > 0 ? l(t.row, t.col - 1) : c && t.row >= 0 ? l(t.row, null) : u();
|
|
2175
|
-
case "ArrowDown": return l(
|
|
2176
|
-
case "ArrowUp": return l(
|
|
2177
|
-
case "PageDown": return l(t.row ===
|
|
2178
|
-
case "PageUp": return l(t.row ===
|
|
2179
|
-
case "Home": return r ? l(
|
|
2190
|
+
case "ArrowDown": return l(fu(t.row, 1), f);
|
|
2191
|
+
case "ArrowUp": return l(fu(t.row, -1), f);
|
|
2192
|
+
case "PageDown": return l(t.row === $n && s < 0 ? t.row : fu(t.row, or), f);
|
|
2193
|
+
case "PageUp": return l(t.row === $n ? t.row : fu(t.row, -10, !0), f);
|
|
2194
|
+
case "Home": return r ? l(fu(t.row, -Infinity), c ? f : 0) : l(t.row, 0);
|
|
2180
2195
|
case "End": {
|
|
2181
2196
|
if (!r) return l(t.row, p(t.row));
|
|
2182
|
-
let e =
|
|
2197
|
+
let e = fu(t.row, Infinity);
|
|
2183
2198
|
return l(e, c ? f : p(e));
|
|
2184
2199
|
}
|
|
2185
2200
|
case "F2":
|
|
2186
|
-
u(),
|
|
2201
|
+
u(), tu(t.cell);
|
|
2187
2202
|
return;
|
|
2188
2203
|
case "Enter":
|
|
2189
2204
|
case " ": {
|
|
2190
|
-
if (u(), t.row ===
|
|
2191
|
-
ee && !e.shiftKey ?
|
|
2205
|
+
if (u(), t.row === $n) {
|
|
2206
|
+
ee && !e.shiftKey ? cu() : n === "Enter" && tu(t.cell);
|
|
2192
2207
|
return;
|
|
2193
2208
|
}
|
|
2194
2209
|
if (n === " " && e.shiftKey) {
|
|
2195
|
-
|
|
2210
|
+
su(t.row);
|
|
2196
2211
|
return;
|
|
2197
2212
|
}
|
|
2198
2213
|
let r = $.value[t.row]?.kind === "row";
|
|
2199
2214
|
if (ee && r) {
|
|
2200
|
-
|
|
2215
|
+
su(t.row);
|
|
2201
2216
|
return;
|
|
2202
2217
|
}
|
|
2203
|
-
if (n === "Enter" &&
|
|
2204
|
-
|
|
2218
|
+
if (n === "Enter" && tu(t.cell)) return;
|
|
2219
|
+
lu(t);
|
|
2205
2220
|
return;
|
|
2206
2221
|
}
|
|
2207
2222
|
}
|
|
2208
|
-
},
|
|
2209
|
-
e.target instanceof HTMLElement && (e.target instanceof HTMLButtonElement || (e.key === "Enter" || e.key === " ") && (e.preventDefault(),
|
|
2210
|
-
},
|
|
2211
|
-
"aria-controls": o(
|
|
2223
|
+
}, mu = (e, t) => {
|
|
2224
|
+
e.target instanceof HTMLElement && (e.target instanceof HTMLButtonElement || (e.key === "Enter" || e.key === " ") && (e.preventDefault(), gu(t)));
|
|
2225
|
+
}, hu = (e) => ({
|
|
2226
|
+
"aria-controls": o(Oa.value[e.valueHash]) ? void 0 : kr(e.valueHash),
|
|
2212
2227
|
"aria-expanded": e.expanded ? "true" : "false",
|
|
2213
2228
|
onClick: (t) => {
|
|
2214
|
-
t.stopPropagation(),
|
|
2229
|
+
t.stopPropagation(), gu(e.valueHash);
|
|
2215
2230
|
},
|
|
2216
|
-
onKeydown: (t) =>
|
|
2217
|
-
}),
|
|
2231
|
+
onKeydown: (t) => mu(t, e.valueHash)
|
|
2232
|
+
}), gu = (e) => {
|
|
2218
2233
|
let t = J.value.find((t) => t.valueHash === e);
|
|
2219
|
-
t && (e in
|
|
2234
|
+
t && (e in Oa.value ? mr.value = mr.value.filter((t) => a(t) !== e) : mr.value = [...mr.value, t.value]);
|
|
2220
2235
|
};
|
|
2221
2236
|
E(D, () => {
|
|
2222
|
-
|
|
2237
|
+
yu.clear(), G.unselected = [], G.selected = [];
|
|
2223
2238
|
});
|
|
2224
|
-
let
|
|
2239
|
+
let _u = m(() => {
|
|
2225
2240
|
let e = Array.isArray(G.selected) ? G.selected.length : 0;
|
|
2226
|
-
return !!(O.multiple && e > 0 && !D.value || D.value &&
|
|
2227
|
-
}),
|
|
2228
|
-
selected: !!D.value && !
|
|
2229
|
-
indeterminate:
|
|
2241
|
+
return !!(O.multiple && e > 0 && !D.value || D.value && yu.size > 0);
|
|
2242
|
+
}), vu = m(() => j.part("selectIcon", {
|
|
2243
|
+
selected: !!D.value && !_u.value,
|
|
2244
|
+
indeterminate: _u.value,
|
|
2230
2245
|
disabled: !!O.disabled
|
|
2231
|
-
})),
|
|
2246
|
+
})), yu = wt(/* @__PURE__ */ new Set());
|
|
2232
2247
|
E(() => G.unselected, (e) => {
|
|
2233
|
-
|
|
2234
|
-
|
|
2248
|
+
yu.clear(), (e ?? []).forEach((e) => {
|
|
2249
|
+
yu.add(a(e));
|
|
2235
2250
|
});
|
|
2236
2251
|
}, { immediate: !0 });
|
|
2237
|
-
let
|
|
2238
|
-
E([() =>
|
|
2239
|
-
let
|
|
2240
|
-
onBlur: () =>
|
|
2252
|
+
let bu = C(null), xu = ue(), Su = () => !O.disableSelectAll && O.multiple;
|
|
2253
|
+
E([() => _u.value, Su], () => xu.onBlur());
|
|
2254
|
+
let Cu = {
|
|
2255
|
+
onBlur: () => xu.onBlur(),
|
|
2241
2256
|
onChange: (e) => {
|
|
2242
|
-
e.target instanceof HTMLInputElement && (
|
|
2257
|
+
e.target instanceof HTMLInputElement && (pe(e.target, O.readonly, !!D.value) ? he(bu.value, _u.value) : (he(bu.value, _u.value), D.value = e.target.checked, me(() => bu.value, () => !!D.value, () => _u.value)));
|
|
2243
2258
|
},
|
|
2244
|
-
onFocus:
|
|
2245
|
-
onClick: (e) =>
|
|
2246
|
-
onKeydown: (e) =>
|
|
2247
|
-
},
|
|
2248
|
-
...
|
|
2259
|
+
onFocus: xu.onFocus,
|
|
2260
|
+
onClick: (e) => de(e, O.readonly),
|
|
2261
|
+
onKeydown: (e) => fe(e, O.readonly)
|
|
2262
|
+
}, wu = m(() => ({
|
|
2263
|
+
...ge("checkbox", {
|
|
2249
2264
|
checked: !!D.value,
|
|
2250
2265
|
disabled: O.disabled,
|
|
2251
|
-
indeterminate:
|
|
2266
|
+
indeterminate: _u.value,
|
|
2252
2267
|
name: `select_all_${O.name || ""}`,
|
|
2253
2268
|
readonly: O.readonly,
|
|
2254
2269
|
required: !1,
|
|
2255
2270
|
value: !0
|
|
2256
2271
|
}),
|
|
2257
|
-
...
|
|
2258
|
-
})),
|
|
2272
|
+
...Cu
|
|
2273
|
+
})), Tu = (e) => {
|
|
2259
2274
|
let t = G.unselected ?? [];
|
|
2260
|
-
|
|
2261
|
-
},
|
|
2275
|
+
Eu(e) ? (Os(e), k("item:unselected", e.value), yu.add(e.valueHash), G.unselected = [...t, e.value]) : (D.value || Ds(e), k("item:selected", e.value), yu.delete(e.valueHash), G.unselected = t.filter((t) => a(t) !== a(e.value)));
|
|
2276
|
+
}, Eu = (e) => D.value && yu.has(e.valueHash) ? !1 : e.selected ? !0 : D.value && !(typeof O.selectable == "function" && !O.selectable(e.item)), Du = m(() => {
|
|
2262
2277
|
let e = /* @__PURE__ */ new Map();
|
|
2263
2278
|
for (let t of J.value) e.set(t.valueHash, t);
|
|
2264
2279
|
return e;
|
|
2265
|
-
}),
|
|
2280
|
+
}), Ou = (e) => {
|
|
2266
2281
|
if (O.disabled || O.readonly || typeof O.selectable == "function" && !O.selectable(e.item)) return !0;
|
|
2267
|
-
let t =
|
|
2282
|
+
let t = Du.value.get(e.valueHash);
|
|
2268
2283
|
return !t || !!t.disabled;
|
|
2269
|
-
},
|
|
2270
|
-
|
|
2271
|
-
},
|
|
2272
|
-
if (
|
|
2273
|
-
let t = (e) => e === void 0 ? -1 : J.value.findIndex((t) => t.valueHash === e), n = t(
|
|
2284
|
+
}, ku, Au = (e) => {
|
|
2285
|
+
Ou(e) || (Tu(e), ku = e.valueHash);
|
|
2286
|
+
}, ju = (e) => {
|
|
2287
|
+
if (Ou(e)) return;
|
|
2288
|
+
let t = (e) => e === void 0 ? -1 : J.value.findIndex((t) => t.valueHash === e), n = t(ku), r = t(e.valueHash);
|
|
2274
2289
|
if (!O.multiple || n < 0 || r < 0) {
|
|
2275
|
-
|
|
2290
|
+
Au(e);
|
|
2276
2291
|
return;
|
|
2277
2292
|
}
|
|
2278
|
-
let i = !
|
|
2293
|
+
let i = !Eu(e), o = n <= r ? 1 : -1, s = [];
|
|
2279
2294
|
for (let e = n; e !== r + o; e += o) {
|
|
2280
2295
|
let t = J.value[e];
|
|
2281
|
-
if (t.disabled ||
|
|
2296
|
+
if (t.disabled || Eu(t) === i) continue;
|
|
2282
2297
|
let { item: n } = Y.value[e];
|
|
2283
2298
|
(typeof O.selectable != "function" || O.selectable(n)) && s.push(t);
|
|
2284
2299
|
}
|
|
@@ -2286,61 +2301,61 @@ var Ht = {
|
|
|
2286
2301
|
let e = O.max - (G.selected ?? []).length;
|
|
2287
2302
|
s = s.slice(0, Math.max(0, e));
|
|
2288
2303
|
}
|
|
2289
|
-
if (
|
|
2304
|
+
if (ku = e.valueHash, !s.length) return;
|
|
2290
2305
|
let c = new Set(s.map((e) => e.valueHash)), l = G.unselected ?? [];
|
|
2291
2306
|
if (i) {
|
|
2292
2307
|
D.value || (G.selected = [...G.selected ?? [], ...s.map((e) => e.value)]), G.unselected = l.filter((e) => !c.has(a(e)));
|
|
2293
|
-
for (let e of s)
|
|
2308
|
+
for (let e of s) yu.delete(e.valueHash), k("item:selected", e.value);
|
|
2294
2309
|
} else {
|
|
2295
2310
|
G.selected = (G.selected ?? []).filter((e) => !c.has(a(e))), G.unselected = [...l, ...s.map((e) => e.value)];
|
|
2296
|
-
for (let e of s)
|
|
2311
|
+
for (let e of s) yu.add(e.valueHash), k("item:unselected", e.value);
|
|
2297
2312
|
}
|
|
2298
|
-
},
|
|
2313
|
+
}, Mu = c((e) => typeof e != "string", JSON.stringify), Nu = m(() => [].concat(G.selected ?? []).map((e) => ({
|
|
2299
2314
|
disabled: O.disabled,
|
|
2300
2315
|
name: O.name,
|
|
2301
2316
|
type: "hidden",
|
|
2302
|
-
value:
|
|
2303
|
-
}))),
|
|
2317
|
+
value: Mu(e)
|
|
2318
|
+
}))), Pu = [
|
|
2304
2319
|
70,
|
|
2305
2320
|
45,
|
|
2306
2321
|
85,
|
|
2307
2322
|
55
|
|
2308
|
-
],
|
|
2323
|
+
], Fu = m(() => i(J.value.length || O.columns.length || 1, 4, 10)), Iu = m(() => {
|
|
2309
2324
|
let e = /* @__PURE__ */ new Map();
|
|
2310
|
-
for (let [t, n] of
|
|
2325
|
+
for (let [t, n] of sr.value) e.has(t) || e.set(t, n);
|
|
2311
2326
|
return e;
|
|
2312
|
-
}),
|
|
2327
|
+
}), Lu = m(() => yt([zo.value, j.table.style])), Ru = m(() => {
|
|
2313
2328
|
let { style: e, ...t } = j.table;
|
|
2314
2329
|
return {
|
|
2315
2330
|
...y({
|
|
2316
|
-
ref:
|
|
2317
|
-
class: ["bb-table__table",
|
|
2318
|
-
role:
|
|
2319
|
-
"aria-labelledby": O.caption ?
|
|
2331
|
+
ref: F,
|
|
2332
|
+
class: ["bb-table__table", Ys.value],
|
|
2333
|
+
role: Cr.value,
|
|
2334
|
+
"aria-labelledby": O.caption ? Rr.value : void 0,
|
|
2320
2335
|
"aria-multiselectable": N.value && O.selectable && O.multiple ? "true" : void 0,
|
|
2321
|
-
"aria-rowcount":
|
|
2336
|
+
"aria-rowcount": Wu.value === void 0 ? void 0 : Wu.value + Ku.value,
|
|
2322
2337
|
...N.value ? {
|
|
2323
|
-
onKeydown:
|
|
2324
|
-
onFocusout:
|
|
2338
|
+
onKeydown: pu,
|
|
2339
|
+
onFocusout: ou
|
|
2325
2340
|
} : {}
|
|
2326
2341
|
}, t),
|
|
2327
|
-
style:
|
|
2342
|
+
style: Lu.value
|
|
2328
2343
|
};
|
|
2329
|
-
}),
|
|
2344
|
+
}), zu = m(() => yt([Ko.value, j.rootAttrs.style])), Bu = m(() => {
|
|
2330
2345
|
let { style: e, ...t } = j.rootAttrs;
|
|
2331
2346
|
return {
|
|
2332
2347
|
...y({
|
|
2333
2348
|
id: O.id,
|
|
2334
|
-
ref:
|
|
2335
|
-
"aria-busy":
|
|
2336
|
-
class:
|
|
2337
|
-
"data-bb-table-id":
|
|
2349
|
+
ref: I,
|
|
2350
|
+
"aria-busy": ss.value,
|
|
2351
|
+
class: us.value,
|
|
2352
|
+
"data-bb-table-id": jr.value,
|
|
2338
2353
|
inert: O.disabled,
|
|
2339
|
-
...
|
|
2354
|
+
...wc.value
|
|
2340
2355
|
}, t),
|
|
2341
|
-
style:
|
|
2356
|
+
style: zu.value
|
|
2342
2357
|
};
|
|
2343
|
-
}),
|
|
2358
|
+
}), Vu = m(() => ({
|
|
2344
2359
|
passthrough: j,
|
|
2345
2360
|
slots: A,
|
|
2346
2361
|
selectable: O.selectable,
|
|
@@ -2348,367 +2363,367 @@ var Ht = {
|
|
|
2348
2363
|
readonly: !!O.readonly,
|
|
2349
2364
|
actions: M.value,
|
|
2350
2365
|
grid: N.value,
|
|
2351
|
-
treegrid:
|
|
2352
|
-
cellRole:
|
|
2353
|
-
rowHeaderKeys:
|
|
2354
|
-
contentInert:
|
|
2355
|
-
hasRowIndex:
|
|
2356
|
-
rowOffset:
|
|
2357
|
-
setSize:
|
|
2358
|
-
columnSpan:
|
|
2359
|
-
inputName:
|
|
2366
|
+
treegrid: Sr.value,
|
|
2367
|
+
cellRole: wr.value,
|
|
2368
|
+
rowHeaderKeys: Tr.value,
|
|
2369
|
+
contentInert: cs.value,
|
|
2370
|
+
hasRowIndex: ls.value,
|
|
2371
|
+
rowOffset: ls.value ? ((G.page ?? 1) - 1) * (G.perPage ?? 0) : 0,
|
|
2372
|
+
setSize: ls.value ? G.totalItems ?? void 0 : void 0,
|
|
2373
|
+
columnSpan: ds.value,
|
|
2374
|
+
inputName: Or,
|
|
2360
2375
|
tdClass: O.tdClass,
|
|
2361
|
-
cellClasses:
|
|
2362
|
-
sortOrders:
|
|
2363
|
-
measureRow:
|
|
2364
|
-
expandRegionId:
|
|
2365
|
-
selectRange:
|
|
2366
|
-
rowReorder:
|
|
2367
|
-
menuRows:
|
|
2368
|
-
})),
|
|
2376
|
+
cellClasses: Ui.value,
|
|
2377
|
+
sortOrders: Iu.value,
|
|
2378
|
+
measureRow: Ol,
|
|
2379
|
+
expandRegionId: kr,
|
|
2380
|
+
selectRange: ju,
|
|
2381
|
+
rowReorder: di.value,
|
|
2382
|
+
menuRows: Xr
|
|
2383
|
+
})), Hu = m(() => ({
|
|
2369
2384
|
passthrough: j,
|
|
2370
2385
|
slots: A,
|
|
2371
2386
|
selectable: !!O.selectable,
|
|
2372
|
-
rowDrag:
|
|
2387
|
+
rowDrag: R.value,
|
|
2373
2388
|
actions: M.value,
|
|
2374
|
-
cellRole:
|
|
2389
|
+
cellRole: wr.value,
|
|
2375
2390
|
grid: N.value,
|
|
2376
|
-
rowHeaderKeys:
|
|
2377
|
-
contentInert:
|
|
2378
|
-
columns:
|
|
2391
|
+
rowHeaderKeys: Tr.value,
|
|
2392
|
+
contentInert: cs.value,
|
|
2393
|
+
columns: z.value.map((e) => {
|
|
2379
2394
|
let t = e.align ?? "start";
|
|
2380
2395
|
return {
|
|
2381
2396
|
key: String(e.key),
|
|
2382
|
-
slotName:
|
|
2383
|
-
classes:
|
|
2397
|
+
slotName: fs.value[e.key],
|
|
2398
|
+
classes: Gs.value.has(String(e.key)) ? [`bb-table__cell--${t}`, "bb-table__cell--fluid"] : [`bb-table__cell--${t}`]
|
|
2384
2399
|
};
|
|
2385
2400
|
}),
|
|
2386
|
-
cellClasses:
|
|
2387
|
-
items:
|
|
2388
|
-
})),
|
|
2401
|
+
cellClasses: Ui.value,
|
|
2402
|
+
items: gs.value ?? []
|
|
2403
|
+
})), Uu = m(() => Wu.value === void 0 ? {
|
|
2389
2404
|
first: void 0,
|
|
2390
2405
|
last: void 0
|
|
2391
2406
|
} : {
|
|
2392
2407
|
first: ((G.page ?? 1) - 1) * (G.perPage ?? 0) + 2,
|
|
2393
|
-
last:
|
|
2394
|
-
}),
|
|
2395
|
-
if (
|
|
2408
|
+
last: Wu.value
|
|
2409
|
+
}), Wu = m(() => {
|
|
2410
|
+
if (!ls.value || G.totalItems == null) return;
|
|
2396
2411
|
let e = G.totalItems + 1;
|
|
2397
|
-
if (
|
|
2398
|
-
if (!J.value.length) return O.loading ? A.loading ? e : Math.max(e,
|
|
2412
|
+
if (vr.value) return e;
|
|
2413
|
+
if (!J.value.length) return O.loading ? A.loading ? e : Math.max(e, Fu.value + 1) : Math.max(e, 2);
|
|
2399
2414
|
let t = $.value.length - Y.value.length;
|
|
2400
2415
|
return e + Number(X.value.first) + Number(X.value.last) + t;
|
|
2401
|
-
}),
|
|
2402
|
-
let e =
|
|
2403
|
-
|
|
2404
|
-
let n =
|
|
2416
|
+
}), Gu = C(null), Ku = C(0), qu = /* @__PURE__ */ new WeakMap(), Ju = (e) => Array.from(e.querySelectorAll("[role=\"row\"]")).filter((t) => t.parentElement?.closest("[role=\"rowgroup\"], [role=\"table\"], [role=\"grid\"], [role=\"treegrid\"]") === e), Yu = () => {
|
|
2417
|
+
let e = Gu.value, t = e && A.tfoot ? Ju(e) : [];
|
|
2418
|
+
Ku.value = t.length;
|
|
2419
|
+
let n = Wu.value;
|
|
2405
2420
|
t.forEach((e, t) => {
|
|
2406
2421
|
let r = e.getAttribute("aria-rowindex");
|
|
2407
|
-
if (r !== null &&
|
|
2408
|
-
|
|
2422
|
+
if (r !== null && qu.get(e) !== r) {
|
|
2423
|
+
qu.delete(e);
|
|
2409
2424
|
return;
|
|
2410
2425
|
}
|
|
2411
2426
|
if (n === void 0) {
|
|
2412
|
-
r !== null && e.removeAttribute("aria-rowindex"),
|
|
2427
|
+
r !== null && e.removeAttribute("aria-rowindex"), qu.delete(e);
|
|
2413
2428
|
return;
|
|
2414
2429
|
}
|
|
2415
2430
|
let i = String(n + 1 + t);
|
|
2416
|
-
r !== i && e.setAttribute("aria-rowindex", i),
|
|
2431
|
+
r !== i && e.setAttribute("aria-rowindex", i), qu.set(e, i);
|
|
2417
2432
|
});
|
|
2418
|
-
},
|
|
2419
|
-
|
|
2420
|
-
|
|
2433
|
+
}, Xu;
|
|
2434
|
+
St(() => {
|
|
2435
|
+
Yu(), Gu.value && typeof MutationObserver < "u" && (Xu = new MutationObserver(Yu), Xu.observe(Gu.value, {
|
|
2421
2436
|
childList: !0,
|
|
2422
2437
|
subtree: !0,
|
|
2423
2438
|
attributes: !0,
|
|
2424
2439
|
attributeFilter: ["role", "aria-rowindex"]
|
|
2425
2440
|
}));
|
|
2426
|
-
}), E(
|
|
2427
|
-
let
|
|
2428
|
-
let e = [], t = Number(
|
|
2429
|
-
return t && (O.selectable && O.fixedSelect ||
|
|
2441
|
+
}), E(Wu, Yu, { flush: "post" }), x(() => Xu?.disconnect());
|
|
2442
|
+
let Zu = m(() => {
|
|
2443
|
+
let e = [], t = Number(R.value), n = t + +!!O.selectable;
|
|
2444
|
+
return t && (O.selectable && O.fixedSelect || z.value.some((e) => e.fixed === "left")) && e.push({
|
|
2430
2445
|
index: 0,
|
|
2431
2446
|
position: "left"
|
|
2432
2447
|
}), O.selectable && O.fixedSelect && e.push({
|
|
2433
2448
|
index: t,
|
|
2434
2449
|
position: "left"
|
|
2435
|
-
}),
|
|
2450
|
+
}), z.value.forEach((t, r) => {
|
|
2436
2451
|
t.fixed && e.push({
|
|
2437
2452
|
index: r + n,
|
|
2438
2453
|
position: t.fixed
|
|
2439
2454
|
});
|
|
2440
2455
|
}), M.value && O.fixedActions && e.push({
|
|
2441
|
-
index:
|
|
2456
|
+
index: z.value.length + n,
|
|
2442
2457
|
position: "right"
|
|
2443
2458
|
}), e;
|
|
2444
|
-
}),
|
|
2459
|
+
}), Qu = m(() => Zu.value.map((e) => typeof e == "number" ? `${e}:left` : `${e.index}:${e.position}`).join(","));
|
|
2445
2460
|
return E(() => [
|
|
2446
|
-
|
|
2447
|
-
|
|
2448
|
-
|
|
2461
|
+
Al.value,
|
|
2462
|
+
Qu.value,
|
|
2463
|
+
ns.value
|
|
2449
2464
|
], ([, e, t], n) => {
|
|
2450
|
-
let r = n?.[1], i =
|
|
2451
|
-
if (
|
|
2465
|
+
let r = n?.[1], i = Zu.value;
|
|
2466
|
+
if (F.value && (e.length || r?.length)) {
|
|
2452
2467
|
let a = e === r && t === n?.[2];
|
|
2453
|
-
|
|
2468
|
+
Ee(F.value, i, a ? $o : null, a) && (Zo = e), e !== r && Ec();
|
|
2454
2469
|
}
|
|
2455
|
-
A.thead && b(
|
|
2456
|
-
}, { flush: "post" }),
|
|
2457
|
-
|
|
2458
|
-
}), (
|
|
2459
|
-
default:
|
|
2460
|
-
|
|
2461
|
-
v.selectable ? (S(), g("legend",
|
|
2470
|
+
A.thead && b(ts);
|
|
2471
|
+
}, { flush: "post" }), xt(() => {
|
|
2472
|
+
Ji(), ha(), Kr.stop();
|
|
2473
|
+
}), (t, n) => (S(), ut(Dt(as.value), vt(mt(Bu.value)), {
|
|
2474
|
+
default: Ft(() => [
|
|
2475
|
+
ft(T(f), { value: T(bs) }, null, 8, ["value"]),
|
|
2476
|
+
v.selectable ? (S(), g("legend", Gt, w(os.value), 1)) : h("", !0),
|
|
2462
2477
|
v.caption ? (S(), g("div", y({
|
|
2463
2478
|
key: 1,
|
|
2464
|
-
id:
|
|
2479
|
+
id: Rr.value,
|
|
2465
2480
|
class: "bb-table__caption",
|
|
2466
2481
|
hidden: !v.displayCaption
|
|
2467
|
-
}, T(j).caption), w(v.caption), 17,
|
|
2482
|
+
}, T(j).caption), w(v.caption), 17, Kt)) : h("", !0),
|
|
2468
2483
|
v.reorderable || v.resizable ? (S(), g("div", {
|
|
2469
2484
|
key: 2,
|
|
2470
|
-
id:
|
|
2485
|
+
id: zr.value,
|
|
2471
2486
|
hidden: ""
|
|
2472
|
-
}, [v.reorderable ? (S(), g(
|
|
2473
|
-
|
|
2487
|
+
}, [v.reorderable ? (S(), g(lt, { key: 0 }, [dt(w(T(P)("table.reorderInstructions").value), 1)], 64)) : h("", !0), v.resizable && !K.value ? (S(), g(lt, { key: 1 }, [dt(w(T(P)("table.resizeInstructions").value), 1)], 64)) : h("", !0)], 8, qt)) : h("", !0),
|
|
2488
|
+
Vr.value ? (S(), g("div", {
|
|
2474
2489
|
key: 3,
|
|
2475
|
-
id:
|
|
2490
|
+
id: Br.value,
|
|
2476
2491
|
hidden: ""
|
|
2477
|
-
}, w(T(
|
|
2478
|
-
_("span",
|
|
2479
|
-
|
|
2480
|
-
id:
|
|
2492
|
+
}, w(T(P)("table.sortInstructions").value), 9, Jt)) : h("", !0),
|
|
2493
|
+
_("span", Yt, w(ss.value ? v.loadingText || T(P)("common.loadingText").value : T(vs) === null ? "" : xs.value), 1),
|
|
2494
|
+
R.value ? (S(), g(lt, { key: 4 }, [_("div", {
|
|
2495
|
+
id: Gr.value,
|
|
2481
2496
|
hidden: ""
|
|
2482
|
-
}, w(T(
|
|
2483
|
-
v.reorderable ? (S(), g(
|
|
2497
|
+
}, w(T(P)("table.rowReorderInstructions").value), 9, Xt), _("span", Zt, w(T(Kr).status.value), 1)], 64)) : h("", !0),
|
|
2498
|
+
v.reorderable ? (S(), g(lt, { key: 5 }, [_("span", Qt, w(Si.value), 1), _("div", {
|
|
2484
2499
|
ref_key: "ghostRef",
|
|
2485
|
-
ref:
|
|
2500
|
+
ref: na,
|
|
2486
2501
|
"aria-hidden": "true",
|
|
2487
2502
|
class: "bb-table-column-ghost",
|
|
2488
2503
|
popover: "manual"
|
|
2489
|
-
}, [
|
|
2504
|
+
}, [ft(e, y({
|
|
2490
2505
|
class: "bb-table__drag-icon",
|
|
2491
|
-
icon: T(
|
|
2506
|
+
icon: T(ur),
|
|
2492
2507
|
size: "1em"
|
|
2493
|
-
}, T(j).dragIcon), null, 16, ["icon"]), _("span", null, w(
|
|
2494
|
-
_("div",
|
|
2508
|
+
}, T(j).dragIcon), null, 16, ["icon"]), _("span", null, w(ta.value), 1)], 512)], 64)) : h("", !0),
|
|
2509
|
+
_("div", vt(mt(Ru.value)), [
|
|
2495
2510
|
_("div", y({
|
|
2496
2511
|
class: ["bb-table__head", {
|
|
2497
2512
|
"bb-table__head--dragging": U.value === "dragging",
|
|
2498
|
-
"bb-table__head--resizing":
|
|
2513
|
+
"bb-table__head--resizing": Ri.value !== null
|
|
2499
2514
|
}],
|
|
2500
|
-
inert:
|
|
2515
|
+
inert: cs.value,
|
|
2501
2516
|
role: "rowgroup"
|
|
2502
|
-
}, T(j).head), [
|
|
2503
|
-
"aria-rowindex":
|
|
2517
|
+
}, T(j).head), [Et(t.$slots, "thead", { empty: Es.value }, () => [_("div", y({
|
|
2518
|
+
"aria-rowindex": ls.value ? 1 : void 0,
|
|
2504
2519
|
class: ["bb-table__header-row", v.headerRowClass],
|
|
2505
2520
|
role: "row",
|
|
2506
|
-
onPointerdown:
|
|
2507
|
-
onTouchmove:
|
|
2521
|
+
onPointerdown: wa,
|
|
2522
|
+
onTouchmove: Ta
|
|
2508
2523
|
}, T(j).headerRow), [
|
|
2509
|
-
|
|
2524
|
+
R.value ? (S(), g("div", y({
|
|
2510
2525
|
key: 0,
|
|
2511
2526
|
class: ["bb-table__cell-column-header bb-table__cell-column-header--row-drag", v.thClass],
|
|
2512
2527
|
role: "columnheader",
|
|
2513
|
-
tabindex:
|
|
2514
|
-
}, T(j).cellColumnHeader), [_("span",
|
|
2528
|
+
tabindex: Wc(0)
|
|
2529
|
+
}, T(j).cellColumnHeader), [_("span", nn, w(T(P)("table.rowReorderHeader").value), 1)], 16, tn)) : h("", !0),
|
|
2515
2530
|
v.selectable ? (S(), g("div", y({
|
|
2516
2531
|
key: 1,
|
|
2517
2532
|
class: ["bb-table__cell-column-header bb-table__cell-column-header--select", v.thClass],
|
|
2518
2533
|
role: "columnheader",
|
|
2519
|
-
tabindex:
|
|
2520
|
-
}, T(j).cellColumnHeader), [
|
|
2534
|
+
tabindex: Wc(Number(R.value))
|
|
2535
|
+
}, T(j).cellColumnHeader), [Et(t.$slots, "select:header", {
|
|
2521
2536
|
multiple: v.multiple,
|
|
2522
2537
|
selectAll: !!D.value,
|
|
2523
|
-
text: v.selectText || T(
|
|
2524
|
-
}, () => [_("span",
|
|
2538
|
+
text: v.selectText || T(P)("table.selectText").value
|
|
2539
|
+
}, () => [_("span", an, [!v.disableSelectAll && v.multiple ? (S(), g("label", {
|
|
2525
2540
|
key: 0,
|
|
2526
|
-
class:
|
|
2541
|
+
class: _t(["bb-table-check__label", { "bb-table-check__label--disabled": v.disabled }])
|
|
2527
2542
|
}, [(S(), g("span", {
|
|
2528
|
-
key:
|
|
2543
|
+
key: _u.value.toString(),
|
|
2529
2544
|
class: "bb-table-check"
|
|
2530
2545
|
}, [_("input", y({
|
|
2531
2546
|
ref_key: "selectAllInput",
|
|
2532
|
-
ref:
|
|
2533
|
-
},
|
|
2547
|
+
ref: bu
|
|
2548
|
+
}, wu.value), null, 16), ft(le, y({
|
|
2534
2549
|
checked: !!D.value,
|
|
2535
2550
|
class: "bb-table__select-icon",
|
|
2536
2551
|
disabled: !!v.disabled,
|
|
2537
|
-
"focus-visible": T(
|
|
2538
|
-
focused: T(
|
|
2552
|
+
"focus-visible": T(xu).focusVisible.value,
|
|
2553
|
+
focused: T(xu).focused.value,
|
|
2539
2554
|
"has-errors": !1,
|
|
2540
2555
|
"has-warnings": !1,
|
|
2541
|
-
indeterminate: !!
|
|
2556
|
+
indeterminate: !!_u.value,
|
|
2542
2557
|
readonly: !!v.readonly
|
|
2543
|
-
},
|
|
2558
|
+
}, vu.value), null, 16, [
|
|
2544
2559
|
"checked",
|
|
2545
2560
|
"disabled",
|
|
2546
2561
|
"focus-visible",
|
|
2547
2562
|
"focused",
|
|
2548
2563
|
"indeterminate",
|
|
2549
2564
|
"readonly"
|
|
2550
|
-
])])), _("span",
|
|
2551
|
-
(S(!0), g(
|
|
2552
|
-
key:
|
|
2553
|
-
"aria-describedby":
|
|
2554
|
-
"aria-sort":
|
|
2555
|
-
class: ["bb-table__cell-column-header", [
|
|
2556
|
-
"bb-table__cell-column-header--edge-start":
|
|
2557
|
-
"bb-table__cell-column-header--edge-end":
|
|
2558
|
-
"bb-table__cell-column-header--clip":
|
|
2559
|
-
"bb-table__cell-column-header--dragging":
|
|
2560
|
-
"bb-table__cell-column-header--locked": v.reorderable &&
|
|
2561
|
-
"bb-table__cell-column-header--sortable":
|
|
2562
|
-
"bb-table__cell-column-header--sorted": !!
|
|
2563
|
-
"bb-table__cell-column-header--sorted-desc":
|
|
2564
|
-
"bb-table__cell-column-header--resizing":
|
|
2565
|
-
"bb-table__cell-column-header--floored":
|
|
2566
|
-
"bb-table__cell-column-header--wrap":
|
|
2565
|
+
])])), _("span", on, w(v.selectAllLabel || T(P)("table.selectAllLabel").value), 1)], 2)) : v.multiple ? h("", !0) : (S(), g("span", sn, w(v.selectText || T(P)("table.selectText").value), 1))])])], 16, rn)) : h("", !0),
|
|
2566
|
+
(S(!0), g(lt, null, Tt(Dc.value, (n, r) => (S(), g("div", y({
|
|
2567
|
+
key: n.key,
|
|
2568
|
+
"aria-describedby": Hr(n),
|
|
2569
|
+
"aria-sort": n.sortDirection ?? (n.sortable ? "none" : void 0),
|
|
2570
|
+
class: ["bb-table__cell-column-header", [n.classes, {
|
|
2571
|
+
"bb-table__cell-column-header--edge-start": r === 0,
|
|
2572
|
+
"bb-table__cell-column-header--edge-end": r === Dc.value.length - 1,
|
|
2573
|
+
"bb-table__cell-column-header--clip": Io.value.has(n.key),
|
|
2574
|
+
"bb-table__cell-column-header--dragging": ea.value === n.key,
|
|
2575
|
+
"bb-table__cell-column-header--locked": v.reorderable && _i.value.has(n.key),
|
|
2576
|
+
"bb-table__cell-column-header--sortable": n.sortable,
|
|
2577
|
+
"bb-table__cell-column-header--sorted": !!n.sortOrder,
|
|
2578
|
+
"bb-table__cell-column-header--sorted-desc": n.sortOrder === "desc",
|
|
2579
|
+
"bb-table__cell-column-header--resizing": Ri.value === n.key,
|
|
2580
|
+
"bb-table__cell-column-header--floored": n.key in Zs.value,
|
|
2581
|
+
"bb-table__cell-column-header--wrap": Xs.value.has(n.key)
|
|
2567
2582
|
}]],
|
|
2568
|
-
style:
|
|
2569
|
-
"data-column-key":
|
|
2583
|
+
style: Zs.value[n.key],
|
|
2584
|
+
"data-column-key": Ur.value || Er.value ? n.key : void 0,
|
|
2570
2585
|
role: "columnheader",
|
|
2571
|
-
tabindex:
|
|
2572
|
-
onClick: (e) =>
|
|
2573
|
-
onFocus: (e) =>
|
|
2574
|
-
onKeydown: (e) =>
|
|
2575
|
-
onMousedown: (e) =>
|
|
2576
|
-
}, { ref_for: !0 }, T(j).part("cellColumnHeader",
|
|
2577
|
-
|
|
2586
|
+
tabindex: Er.value ? Wc(r + Number(R.value) + Number(!!v.selectable)) : Ur.value ? n.key === Ti.value ? 0 : -1 : void 0,
|
|
2587
|
+
onClick: (e) => Ei(e, n),
|
|
2588
|
+
onFocus: (e) => Oi(n.key),
|
|
2589
|
+
onKeydown: (e) => ji(e, n.key),
|
|
2590
|
+
onMousedown: (e) => Di(e, n)
|
|
2591
|
+
}, { ref_for: !0 }, T(j).part("cellColumnHeader", gr(n.sortOrder))), [
|
|
2592
|
+
Oc(n.key, "prepend").length ? (S(), ut(kc, {
|
|
2578
2593
|
key: 0,
|
|
2579
|
-
|
|
2580
|
-
scope:
|
|
2581
|
-
}, null, 8, ["
|
|
2582
|
-
|
|
2583
|
-
classes:
|
|
2584
|
-
hideColumn: () =>
|
|
2585
|
-
items: T(
|
|
2586
|
-
label:
|
|
2587
|
-
sortOrder:
|
|
2588
|
-
sortable:
|
|
2589
|
-
toggleSort: (e) =>
|
|
2590
|
-
}, () => [
|
|
2594
|
+
names: Oc(n.key, "prepend"),
|
|
2595
|
+
scope: Ac(n)
|
|
2596
|
+
}, null, 8, ["names", "scope"])) : h("", !0),
|
|
2597
|
+
Et(t.$slots, n.slotName, {
|
|
2598
|
+
classes: n.classes,
|
|
2599
|
+
hideColumn: () => hi(n.key),
|
|
2600
|
+
items: T(gs),
|
|
2601
|
+
label: n.label,
|
|
2602
|
+
sortOrder: n.sortOrder,
|
|
2603
|
+
sortable: n.sortable,
|
|
2604
|
+
toggleSort: (e) => za(n.key, e)
|
|
2605
|
+
}, () => [n.sortable ? (S(), ut(ot, {
|
|
2591
2606
|
key: 0,
|
|
2592
|
-
"aria-describedby":
|
|
2593
|
-
class:
|
|
2594
|
-
"bb-table-sort--asc":
|
|
2595
|
-
"bb-table-sort--desc":
|
|
2607
|
+
"aria-describedby": Vr.value && !Ur.value && !Er.value ? Br.value : void 0,
|
|
2608
|
+
class: _t(["bb-table-sort", {
|
|
2609
|
+
"bb-table-sort--asc": n.sortOrder === "asc",
|
|
2610
|
+
"bb-table-sort--desc": n.sortOrder === "desc"
|
|
2596
2611
|
}]),
|
|
2597
|
-
tabindex:
|
|
2612
|
+
tabindex: Ur.value || Er.value ? -1 : void 0,
|
|
2598
2613
|
type: "button",
|
|
2599
|
-
onClick: (e) =>
|
|
2614
|
+
onClick: (e) => za(n.key, e)
|
|
2600
2615
|
}, {
|
|
2601
|
-
default:
|
|
2602
|
-
class: "bb-table__sort-icon",
|
|
2603
|
-
icon: T(
|
|
2616
|
+
default: Ft(() => [_("span", ln, w(n.label), 1), ft(e, y({
|
|
2617
|
+
class: ["bb-table__sort-icon", { "bb-table__sort-icon--own-desc": n.sortOrder === "desc" && !!T(fr) }],
|
|
2618
|
+
icon: n.sortOrder === "desc" && T(fr) ? T(fr) : T(dr),
|
|
2604
2619
|
size: "1em"
|
|
2605
|
-
}, { ref_for: !0 }, T(j).part("sortIcon",
|
|
2620
|
+
}, { ref_for: !0 }, T(j).part("sortIcon", gr(n.sortOrder))), null, 16, ["class", "icon"])]),
|
|
2606
2621
|
_: 2
|
|
2607
2622
|
}, 1032, [
|
|
2608
2623
|
"aria-describedby",
|
|
2609
2624
|
"class",
|
|
2610
2625
|
"tabindex",
|
|
2611
2626
|
"onClick"
|
|
2612
|
-
])) : (S(), g("span",
|
|
2613
|
-
|
|
2627
|
+
])) : (S(), g("span", un, w(n.label), 1))]),
|
|
2628
|
+
Oc(n.key, "append").length ? (S(), ut(kc, {
|
|
2614
2629
|
key: 1,
|
|
2615
|
-
|
|
2616
|
-
scope:
|
|
2617
|
-
}, null, 8, ["
|
|
2618
|
-
|
|
2630
|
+
names: Oc(n.key, "append"),
|
|
2631
|
+
scope: Ac(n)
|
|
2632
|
+
}, null, 8, ["names", "scope"])) : h("", !0),
|
|
2633
|
+
Ii(String(n.key)) ? (S(), g("div", {
|
|
2619
2634
|
key: 2,
|
|
2620
2635
|
"aria-hidden": "true",
|
|
2621
2636
|
class: "bb-table-header__resizer",
|
|
2622
|
-
onDblclick:
|
|
2623
|
-
onPointerdown: (e) =>
|
|
2624
|
-
}, null, 40,
|
|
2625
|
-
], 16,
|
|
2637
|
+
onDblclick: It((e) => Ki(n.key), ["stop"]),
|
|
2638
|
+
onPointerdown: (e) => $i(e, n.key)
|
|
2639
|
+
}, null, 40, dn)) : h("", !0)
|
|
2640
|
+
], 16, cn))), 128)),
|
|
2626
2641
|
M.value ? (S(), g("div", y({
|
|
2627
2642
|
key: 2,
|
|
2628
2643
|
class: ["bb-table__cell-column-header bb-table__cell-column-header--actions", v.thClass],
|
|
2629
2644
|
role: "columnheader",
|
|
2630
|
-
tabindex:
|
|
2631
|
-
}, T(j).cellColumnHeader), [
|
|
2632
|
-
], 16,
|
|
2645
|
+
tabindex: Wc(ds.value - 1)
|
|
2646
|
+
}, T(j).cellColumnHeader), [Et(t.$slots, "actions:header", { text: v.actionsText || T(P)("table.actionsText").value }, () => [_("span", pn, w(v.actionsText || T(P)("table.actionsText").value), 1)])], 16, fn)) : h("", !0)
|
|
2647
|
+
], 16, en)])], 16, $t),
|
|
2633
2648
|
_("div", y({
|
|
2634
2649
|
ref_key: "bodyRef",
|
|
2635
|
-
ref:
|
|
2650
|
+
ref: L,
|
|
2636
2651
|
class: "bb-table__body",
|
|
2637
2652
|
role: "rowgroup",
|
|
2638
|
-
onPointerdown:
|
|
2639
|
-
onFocusin:
|
|
2640
|
-
onFocusout:
|
|
2641
|
-
}, T(j).body), [
|
|
2653
|
+
onPointerdown: qr,
|
|
2654
|
+
onFocusin: $c,
|
|
2655
|
+
onFocusout: el
|
|
2656
|
+
}, T(j).body), [ss.value && !T(J).length ? Et(t.$slots, "loading", { items: T(gs) }, () => [(S(!0), g(lt, null, Tt(Fu.value, (e, t) => (S(), g("div", {
|
|
2642
2657
|
key: t,
|
|
2643
|
-
"aria-rowindex":
|
|
2658
|
+
"aria-rowindex": ls.value ? t + 2 : void 0,
|
|
2644
2659
|
class: "bb-table-skeleton__row",
|
|
2645
2660
|
role: "row"
|
|
2646
2661
|
}, [
|
|
2647
|
-
|
|
2662
|
+
R.value ? (S(), g("div", {
|
|
2648
2663
|
key: 0,
|
|
2649
2664
|
class: "bb-table-skeleton__cell bb-table-skeleton__cell--row-drag",
|
|
2650
|
-
role:
|
|
2651
|
-
}, null, 8,
|
|
2665
|
+
role: wr.value
|
|
2666
|
+
}, null, 8, hn)) : h("", !0),
|
|
2652
2667
|
v.selectable ? (S(), g("div", {
|
|
2653
2668
|
key: 1,
|
|
2654
2669
|
class: "bb-table-skeleton__cell bb-table-skeleton__cell--select",
|
|
2655
|
-
role:
|
|
2656
|
-
}, [...
|
|
2657
|
-
(S(!0), g(
|
|
2670
|
+
role: wr.value
|
|
2671
|
+
}, [...n[1] ||= [_("div", { class: "bb-table-skeleton__placeholder" }, null, -1)]], 8, gn)) : h("", !0),
|
|
2672
|
+
(S(!0), g(lt, null, Tt(z.value, (e, r) => (S(), g("div", {
|
|
2658
2673
|
key: e.key,
|
|
2659
|
-
class:
|
|
2660
|
-
role:
|
|
2661
|
-
}, [!e.skeleton || e.skeleton === "text" ? (S(), g("div",
|
|
2674
|
+
class: _t(["bb-table-skeleton__cell", [`bb-table-skeleton__cell--${e.skeleton ?? "text"}`]]),
|
|
2675
|
+
role: wr.value
|
|
2676
|
+
}, [!e.skeleton || e.skeleton === "text" ? (S(), g("div", vn, [_("div", {
|
|
2662
2677
|
class: "bb-table-skeleton__line",
|
|
2663
|
-
style:
|
|
2678
|
+
style: yt({ width: `${Pu[(t + r) % 4]}%` })
|
|
2664
2679
|
}, null, 4), _("div", {
|
|
2665
2680
|
class: "bb-table-skeleton__line",
|
|
2666
|
-
style:
|
|
2667
|
-
}, null, 4)])) : e.skeleton === "avatar" ? (S(), g("div",
|
|
2681
|
+
style: yt({ width: `${Pu[(t + r + 2) % 4]}%` })
|
|
2682
|
+
}, null, 4)])) : e.skeleton === "avatar" ? (S(), g("div", yn)) : e.skeleton === "avatar-text" ? (S(), g("div", bn, [n[2] ||= _("div", { class: "bb-table-skeleton__avatar" }, null, -1), _("div", xn, [_("div", {
|
|
2668
2683
|
class: "bb-table-skeleton__line",
|
|
2669
|
-
style:
|
|
2684
|
+
style: yt({ width: `${Pu[(t + r) % 4]}%` })
|
|
2670
2685
|
}, null, 4), _("div", {
|
|
2671
2686
|
class: "bb-table-skeleton__line",
|
|
2672
|
-
style:
|
|
2673
|
-
}, null, 4)])])) : e.skeleton === "image" ? (S(), g("div",
|
|
2687
|
+
style: yt({ width: `${Pu[(t + r + 2) % 4]}%` })
|
|
2688
|
+
}, null, 4)])])) : e.skeleton === "image" ? (S(), g("div", Sn)) : e.skeleton === "badge" ? (S(), g("div", Cn)) : h("", !0)], 10, _n))), 128)),
|
|
2674
2689
|
M.value ? (S(), g("div", {
|
|
2675
2690
|
key: 2,
|
|
2676
2691
|
class: "bb-table-skeleton__cell bb-table-skeleton__cell--actions",
|
|
2677
|
-
role:
|
|
2678
|
-
}, [...
|
|
2679
|
-
], 8,
|
|
2680
|
-
X.value.first ? (S(),
|
|
2692
|
+
role: wr.value
|
|
2693
|
+
}, [...n[3] ||= [_("div", { class: "bb-table-skeleton__placeholder" }, null, -1)]], 8, wn)) : h("", !0)
|
|
2694
|
+
], 8, mn))), 128))], void 0, 0) : T(J).length ? Et(t.$slots, "tbody", {}, () => [
|
|
2695
|
+
X.value.first ? (S(), ut(T(ye), {
|
|
2681
2696
|
key: 0,
|
|
2682
|
-
context:
|
|
2697
|
+
context: Hu.value,
|
|
2683
2698
|
edge: "first",
|
|
2684
2699
|
fixed: v.fixedFirst,
|
|
2685
|
-
"row-index":
|
|
2686
|
-
stop:
|
|
2700
|
+
"row-index": Uu.value.first,
|
|
2701
|
+
stop: Uc(er)
|
|
2687
2702
|
}, null, 8, [
|
|
2688
2703
|
"context",
|
|
2689
2704
|
"fixed",
|
|
2690
2705
|
"row-index",
|
|
2691
2706
|
"stop"
|
|
2692
2707
|
])) : h("", !0),
|
|
2693
|
-
(S(!0), g(
|
|
2708
|
+
(S(!0), g(lt, null, Tt(Al.value, (e) => (S(), g(lt, { key: e.key }, [e.kind === "spacer" ? (S(), g("div", {
|
|
2694
2709
|
key: 0,
|
|
2695
2710
|
"aria-hidden": "true",
|
|
2696
2711
|
class: "bb-table-spacer__row bb-table-placeholder__row",
|
|
2697
|
-
style:
|
|
2712
|
+
style: yt({ height: `${e.height}px` })
|
|
2698
2713
|
}, null, 4)) : e.kind === "placeholder" ? (S(), g("div", {
|
|
2699
2714
|
key: 1,
|
|
2700
2715
|
"aria-hidden": "true",
|
|
2701
2716
|
class: "bb-table-placeholder__row bb-table-placeholder__row--pending",
|
|
2702
2717
|
"data-index": e.virtualIndex,
|
|
2703
|
-
style:
|
|
2704
|
-
}, null, 12,
|
|
2718
|
+
style: yt({ height: `${e.height}px` })
|
|
2719
|
+
}, null, 12, Mn)) : e.kind === "row" ? (S(), ut(T(_e), {
|
|
2705
2720
|
key: 2,
|
|
2706
|
-
context:
|
|
2721
|
+
context: Vu.value,
|
|
2707
2722
|
index: e.index,
|
|
2708
2723
|
item: e.item,
|
|
2709
|
-
"select-blocked":
|
|
2710
|
-
selected:
|
|
2711
|
-
stop:
|
|
2724
|
+
"select-blocked": Ou(e.item),
|
|
2725
|
+
selected: Eu(e.item),
|
|
2726
|
+
stop: Uc(e.virtualIndex),
|
|
2712
2727
|
"virtual-index": e.virtualIndex
|
|
2713
2728
|
}, null, 8, [
|
|
2714
2729
|
"context",
|
|
@@ -2718,12 +2733,12 @@ var Ht = {
|
|
|
2718
2733
|
"selected",
|
|
2719
2734
|
"stop",
|
|
2720
2735
|
"virtual-index"
|
|
2721
|
-
])) : (S(),
|
|
2736
|
+
])) : (S(), ut(T(ve), {
|
|
2722
2737
|
key: 3,
|
|
2723
|
-
context:
|
|
2738
|
+
context: Vu.value,
|
|
2724
2739
|
item: e.item,
|
|
2725
|
-
selected:
|
|
2726
|
-
stop:
|
|
2740
|
+
selected: Eu(e.item),
|
|
2741
|
+
stop: Uc(e.virtualIndex),
|
|
2727
2742
|
"virtual-index": e.virtualIndex
|
|
2728
2743
|
}, null, 8, [
|
|
2729
2744
|
"context",
|
|
@@ -2732,13 +2747,13 @@ var Ht = {
|
|
|
2732
2747
|
"stop",
|
|
2733
2748
|
"virtual-index"
|
|
2734
2749
|
]))], 64))), 128)),
|
|
2735
|
-
X.value.last ? (S(),
|
|
2750
|
+
X.value.last ? (S(), ut(T(ye), {
|
|
2736
2751
|
key: 1,
|
|
2737
|
-
context:
|
|
2752
|
+
context: Hu.value,
|
|
2738
2753
|
edge: "last",
|
|
2739
2754
|
fixed: v.fixedLast,
|
|
2740
|
-
"row-index":
|
|
2741
|
-
stop:
|
|
2755
|
+
"row-index": Uu.value.last,
|
|
2756
|
+
stop: Uc(tr)
|
|
2742
2757
|
}, null, 8, [
|
|
2743
2758
|
"context",
|
|
2744
2759
|
"fixed",
|
|
@@ -2747,32 +2762,36 @@ var Ht = {
|
|
|
2747
2762
|
])) : h("", !0)
|
|
2748
2763
|
], void 0, 2) : (S(), g("div", {
|
|
2749
2764
|
key: 1,
|
|
2750
|
-
"aria-rowindex":
|
|
2765
|
+
"aria-rowindex": ls.value ? 2 : void 0,
|
|
2751
2766
|
class: "bb-table-empty__row",
|
|
2752
2767
|
role: "row"
|
|
2753
2768
|
}, [_("div", {
|
|
2754
|
-
"aria-colspan":
|
|
2769
|
+
"aria-colspan": ds.value,
|
|
2755
2770
|
class: "bb-table-empty__cell",
|
|
2756
|
-
role:
|
|
2757
|
-
}, [
|
|
2771
|
+
role: wr.value
|
|
2772
|
+
}, [T(vs) === null ? (S(), g("div", An, [Et(t.$slots, "empty", {}, () => [_("span", jn, w(v.emptyText || T(P)("common.emptyText").value), 1)])])) : (S(), g("div", Dn, [_("span", On, [_("span", kn, w(xs.value), 1), _("button", {
|
|
2773
|
+
class: "bb-load-retry",
|
|
2774
|
+
type: "button",
|
|
2775
|
+
onClick: n[0] ||= (e) => T(st)(e, Ss, () => F.value)
|
|
2776
|
+
}, w(T(P)("common.retryLabel").value), 1)])]))], 8, En)], 8, Tn))], 16),
|
|
2758
2777
|
_("div", y({
|
|
2759
2778
|
ref_key: "footRef",
|
|
2760
|
-
ref:
|
|
2779
|
+
ref: Gu,
|
|
2761
2780
|
class: "bb-table__foot",
|
|
2762
2781
|
role: A.tfoot ? "rowgroup" : void 0
|
|
2763
|
-
}, T(j).foot), [
|
|
2764
|
-
columnCount:
|
|
2765
|
-
empty:
|
|
2766
|
-
})], 16,
|
|
2782
|
+
}, T(j).foot), [Et(t.$slots, "tfoot", {
|
|
2783
|
+
columnCount: ds.value,
|
|
2784
|
+
empty: Es.value
|
|
2785
|
+
})], 16, Nn)
|
|
2767
2786
|
], 16),
|
|
2768
|
-
(S(!0), g(
|
|
2769
|
-
v.rowMenu ? (S(),
|
|
2787
|
+
(S(!0), g(lt, null, Tt(Nu.value, (e) => (S(), g("input", y({ key: e.value }, { ref_for: !0 }, e), null, 16))), 128)),
|
|
2788
|
+
v.rowMenu ? (S(), ut(T(be), {
|
|
2770
2789
|
key: 6,
|
|
2771
2790
|
ref_key: "rowMenuEl",
|
|
2772
|
-
ref:
|
|
2773
|
-
items:
|
|
2774
|
-
label: v.actionsText || T(
|
|
2775
|
-
onHide:
|
|
2791
|
+
ref: Jr,
|
|
2792
|
+
items: Yr.value,
|
|
2793
|
+
label: v.actionsText || T(P)("table.actionsText").value,
|
|
2794
|
+
onHide: si
|
|
2776
2795
|
}, null, 8, ["items", "label"])) : h("", !0)
|
|
2777
2796
|
]),
|
|
2778
2797
|
_: 3
|