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