@moubing/bing-ui 0.11.2 → 0.12.0
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 +300 -171
- package/dist/_virtual/_plugin-vue_export-helper.js +8 -0
- package/dist/bing-ui.css +1 -1
- package/dist/components/BingAnimatedText/BingAnimatedText.js +7 -0
- package/dist/components/BingAnimatedText/BingAnimatedText.vue_vue_type_script_setup_true_lang.js +194 -0
- package/dist/components/BingAppSwitcherTransition/BingAppSwitcherTransition.js +7 -0
- package/dist/components/BingAppSwitcherTransition/BingAppSwitcherTransition.vue_vue_type_script_setup_true_lang.js +244 -0
- package/dist/components/BingAutocomplete/BingAutocomplete.js +7 -0
- package/dist/components/BingAutocomplete/BingAutocomplete.vue.d.ts +4 -4
- package/dist/components/BingAutocomplete/BingAutocomplete.vue_vue_type_script_setup_true_lang.js +560 -0
- package/dist/components/BingButton/BingButton.js +7 -0
- package/dist/components/BingButton/BingButton.vue.d.ts +2 -2
- package/dist/components/BingButton/BingButton.vue_vue_type_script_setup_true_lang.js +200 -0
- package/dist/components/BingCard/BingCard.js +7 -0
- package/dist/components/BingCard/BingCard.vue_vue_type_script_setup_true_lang.js +481 -0
- package/dist/components/BingCarouselTransition/BingCarouselTransition.js +7 -0
- package/dist/components/BingCarouselTransition/BingCarouselTransition.vue_vue_type_script_setup_true_lang.js +174 -0
- package/dist/components/BingCheckbox/BingCheckbox.js +7 -0
- package/dist/components/BingCheckbox/BingCheckbox.vue.d.ts +4 -4
- package/dist/components/BingCheckbox/BingCheckbox.vue_vue_type_script_setup_true_lang.js +233 -0
- package/dist/components/BingCheckboxGroup/BingCheckboxGroup.context.js +4 -0
- package/dist/components/BingCheckboxGroup/BingCheckboxGroup.js +7 -0
- package/dist/components/BingCheckboxGroup/BingCheckboxGroup.vue.d.ts +4 -4
- package/dist/components/BingCheckboxGroup/BingCheckboxGroup.vue_vue_type_script_setup_true_lang.js +105 -0
- package/dist/components/BingCodeBlock/BingCodeBlock.highlight.js +78 -0
- package/dist/components/BingCodeBlock/BingCodeBlock.js +7 -0
- package/dist/components/BingCodeBlock/BingCodeBlock.vue_vue_type_script_setup_true_lang.js +347 -0
- package/dist/components/BingColorPicker/BingColorPicker.js +7 -0
- package/dist/components/BingColorPicker/BingColorPicker.utils.d.ts +70 -0
- package/dist/components/BingColorPicker/BingColorPicker.utils.js +265 -0
- package/dist/components/BingColorPicker/BingColorPicker.vue.d.ts +7 -7
- package/dist/components/BingColorPicker/BingColorPicker.vue_vue_type_script_setup_true_lang.js +540 -0
- package/dist/components/BingColorPicker/BingColorPickerFormatEditor.js +7 -0
- package/dist/components/BingColorPicker/BingColorPickerFormatEditor.vue.d.ts +27 -0
- package/dist/components/BingColorPicker/BingColorPickerFormatEditor.vue_vue_type_script_setup_true_lang.js +142 -0
- package/dist/components/BingColorPicker/BingColorPickerSpectrum.js +7 -0
- package/dist/components/BingColorPicker/BingColorPickerSpectrum.vue.d.ts +26 -0
- package/dist/components/BingColorPicker/BingColorPickerSpectrum.vue_vue_type_script_setup_true_lang.js +168 -0
- package/dist/components/BingConfigProvider/BingConfigProvider.js +5 -0
- package/dist/components/BingConfigProvider/BingConfigProvider.types.d.ts +5 -0
- package/dist/components/BingConfigProvider/BingConfigProvider.vue.d.ts +18 -0
- package/dist/components/BingConfigProvider/BingConfigProvider.vue_vue_type_script_setup_true_lang.js +18 -0
- package/dist/components/BingConfigProvider/index.d.ts +3 -0
- package/dist/components/BingCursor/BingCursor.controller.js +240 -0
- package/dist/components/BingCursor/BingCursor.js +7 -0
- package/dist/components/BingCursor/BingCursor.native.js +20 -0
- package/dist/components/BingCursor/BingCursor.presets.js +60 -0
- package/dist/components/BingCursor/BingCursor.shapes.js +83 -0
- package/dist/components/BingCursor/BingCursor.styleSource.js +83 -0
- package/dist/components/BingCursor/BingCursor.vue_vue_type_script_setup_true_lang.js +73 -0
- package/dist/components/BingDatePicker/BingDatePicker.js +7 -0
- package/dist/components/BingDatePicker/BingDatePicker.utils.d.ts +26 -0
- package/dist/components/BingDatePicker/BingDatePicker.utils.js +137 -0
- package/dist/components/BingDatePicker/BingDatePicker.vue.d.ts +14 -14
- package/dist/components/BingDatePicker/BingDatePicker.vue_vue_type_script_setup_true_lang.js +804 -0
- package/dist/components/BingDatePicker/BingDatePickerCalendar.js +7 -0
- package/dist/components/BingDatePicker/BingDatePickerCalendar.vue.d.ts +37 -0
- package/dist/components/BingDatePicker/BingDatePickerCalendar.vue_vue_type_script_setup_true_lang.js +248 -0
- package/dist/components/BingDatePicker/BingDatePickerTimePanel.js +7 -0
- package/dist/components/BingDatePicker/BingDatePickerTimePanel.vue.d.ts +26 -0
- package/dist/components/BingDatePicker/BingDatePickerTimePanel.vue_vue_type_script_setup_true_lang.js +97 -0
- package/dist/components/BingDeckTransition/BingDeckTransition.js +7 -0
- package/dist/components/BingDeckTransition/BingDeckTransition.vue_vue_type_script_setup_true_lang.js +187 -0
- package/dist/components/BingDialog/BingDialog.js +7 -0
- package/dist/components/BingDialog/BingDialog.vue.d.ts +4 -5
- package/dist/components/BingDialog/BingDialog.vue_vue_type_script_setup_true_lang.js +558 -0
- package/dist/components/BingDropDown/BingDropDown.context.js +4 -0
- package/dist/components/BingDropDown/BingDropDown.js +7 -0
- package/dist/components/BingDropDown/BingDropDown.vue.d.ts +1 -2
- package/dist/components/BingDropDown/BingDropDown.vue_vue_type_script_setup_true_lang.js +649 -0
- package/dist/components/BingDropDown/BingDropDownItem.js +7 -0
- package/dist/components/BingDropDown/BingDropDownItem.vue.d.ts +1 -1
- package/dist/components/BingDropDown/BingDropDownItem.vue_vue_type_script_setup_true_lang.js +308 -0
- package/dist/components/BingFilePreview/BingFilePreview.js +7 -0
- package/dist/components/BingFilePreview/BingFilePreview.vue.d.ts +4 -5
- package/dist/components/BingFilePreview/BingFilePreview.vue_vue_type_script_setup_true_lang.js +589 -0
- package/dist/components/BingForm/BingForm.context.js +7 -0
- package/dist/components/BingForm/BingForm.js +7 -0
- package/dist/components/BingForm/BingForm.vue.d.ts +0 -1
- package/dist/components/BingForm/BingForm.vue_vue_type_script_setup_true_lang.js +300 -0
- package/dist/components/BingForm/formFocus.js +13 -0
- package/dist/components/BingForm/formTabOrder.js +27 -0
- package/dist/components/BingForm/useFormControl.d.ts +1 -1
- package/dist/components/BingForm/useFormControl.js +24 -0
- package/dist/components/BingForm/useFormNextHint.js +135 -0
- package/dist/components/BingFormItem/BingFormItem.js +7 -0
- package/dist/components/BingFormItem/BingFormItem.vue.d.ts +1 -1
- package/dist/components/BingFormItem/BingFormItem.vue_vue_type_script_setup_true_lang.js +252 -0
- package/dist/components/BingIcon/BingIcon.js +7 -0
- package/dist/components/BingIcon/BingIcon.vue_vue_type_script_setup_true_lang.js +48 -0
- package/dist/components/BingImage/BingImage.js +7 -0
- package/dist/components/BingImage/BingImage.vue_vue_type_script_setup_true_lang.js +244 -0
- package/dist/components/BingImagePreview/BingImagePreview.js +7 -0
- package/dist/components/BingImagePreview/BingImagePreview.vue.d.ts +4 -5
- package/dist/components/BingImagePreview/BingImagePreview.vue_vue_type_script_setup_true_lang.js +699 -0
- package/dist/components/BingInput/BingInput.js +7 -0
- package/dist/components/BingInput/BingInput.vue.d.ts +6 -6
- package/dist/components/BingInput/BingInput.vue_vue_type_script_setup_true_lang.js +311 -0
- package/dist/components/BingRadio/BingRadio.js +7 -0
- package/dist/components/BingRadio/BingRadio.vue.d.ts +4 -4
- package/dist/components/BingRadio/BingRadio.vue_vue_type_script_setup_true_lang.js +170 -0
- package/dist/components/BingRadioGroup/BingRadioGroup.context.js +4 -0
- package/dist/components/BingRadioGroup/BingRadioGroup.js +7 -0
- package/dist/components/BingRadioGroup/BingRadioGroup.vue.d.ts +4 -4
- package/dist/components/BingRadioGroup/BingRadioGroup.vue_vue_type_script_setup_true_lang.js +125 -0
- package/dist/components/BingResizable/BingResizable.js +7 -0
- package/dist/components/BingResizable/BingResizable.vue.d.ts +1 -1
- package/dist/components/BingResizable/BingResizable.vue_vue_type_script_setup_true_lang.js +555 -0
- package/dist/components/BingScrollbar/BingScrollbar.js +7 -0
- package/dist/components/BingScrollbar/BingScrollbar.vue.d.ts +2 -2
- package/dist/components/BingScrollbar/BingScrollbar.vue_vue_type_script_setup_true_lang.js +398 -0
- package/dist/components/BingSelect/BingSelect.js +7 -0
- package/dist/components/BingSelect/BingSelect.vue.d.ts +7 -7
- package/dist/components/BingSelect/BingSelect.vue_vue_type_script_setup_true_lang.js +1066 -0
- package/dist/components/BingSlider/BingSlider.js +7 -0
- package/dist/components/BingSlider/BingSlider.vue.d.ts +6 -6
- package/dist/components/BingSlider/BingSlider.vue_vue_type_script_setup_true_lang.js +130 -0
- package/dist/components/BingSortableList/BingSortableList.js +7 -0
- package/dist/components/BingSortableList/BingSortableList.vue_vue_type_script_setup_true_lang.js +334 -0
- package/dist/components/BingSortableList/BingSortableListItem.js +7 -0
- package/dist/components/BingSortableList/BingSortableListItem.vue_vue_type_script_setup_true_lang.js +76 -0
- package/dist/components/BingSplitPane/BingSplitPane.js +7 -0
- package/dist/components/BingSplitPane/BingSplitPane.vue_vue_type_script_setup_true_lang.js +167 -0
- package/dist/components/BingTable/BingTable.js +7 -0
- package/dist/components/BingTable/BingTable.measurements.js +72 -0
- package/dist/components/BingTable/BingTable.vue.d.ts +1 -2
- package/dist/components/BingTable/BingTable.vue_vue_type_script_setup_true_lang.js +1416 -0
- package/dist/components/BingTable/BingTableCellValue.js +7 -0
- package/dist/components/BingTable/BingTableCellValue.vue_vue_type_script_setup_true_lang.js +68 -0
- package/dist/components/BingTable/BingTableHeaderCell.js +5 -0
- package/dist/components/BingTable/BingTableHeaderCell.vue_vue_type_script_setup_true_lang.js +45 -0
- package/dist/components/BingTable/BingTableHeaderContent.js +7 -0
- package/dist/components/BingTable/BingTableHeaderContent.vue_vue_type_script_setup_true_lang.js +110 -0
- package/dist/components/BingTable/useTableColumns.js +126 -0
- package/dist/components/BingTableColumnControls/BingTableColumnControls.js +7 -0
- package/dist/components/BingTableColumnControls/BingTableColumnControls.vue.d.ts +1 -1
- package/dist/components/BingTableColumnControls/BingTableColumnControls.vue_vue_type_script_setup_true_lang.js +251 -0
- package/dist/components/BingTabs/BingTabs.js +7 -0
- package/dist/components/BingTabs/BingTabs.vue.d.ts +2 -3
- package/dist/components/BingTabs/BingTabs.vue_vue_type_script_setup_true_lang.js +320 -0
- package/dist/components/BingTag/BingTag.js +7 -0
- package/dist/components/BingTag/BingTag.vue.d.ts +0 -1
- package/dist/components/BingTag/BingTag.vue_vue_type_script_setup_true_lang.js +65 -0
- package/dist/components/BingTextarea/BingTextarea.js +7 -0
- package/dist/components/BingTextarea/BingTextarea.vue.d.ts +6 -6
- package/dist/components/BingTextarea/BingTextarea.vue_vue_type_script_setup_true_lang.js +243 -0
- package/dist/components/BingToast/BingToast.js +7 -0
- package/dist/components/BingToast/BingToast.service.js +132 -0
- package/dist/components/BingToast/BingToast.types.d.ts +1 -1
- package/dist/components/BingToast/BingToast.types.js +19 -0
- package/dist/components/BingToast/BingToast.vue.d.ts +0 -1
- package/dist/components/BingToast/BingToast.vue_vue_type_script_setup_true_lang.js +307 -0
- package/dist/components/BingTooltip/BingTooltip.js +7 -0
- package/dist/components/BingTooltip/BingTooltip.shared.js +14 -0
- package/dist/components/BingTooltip/BingTooltip.vue.d.ts +4 -5
- package/dist/components/BingTooltip/BingTooltip.vue_vue_type_script_setup_true_lang.js +572 -0
- package/dist/components/BingTreeSelect/BingTreeSelect.js +7 -0
- package/dist/components/BingTreeSelect/BingTreeSelect.vue.d.ts +7 -7
- package/dist/components/BingTreeSelect/BingTreeSelect.vue_vue_type_script_setup_true_lang.js +1274 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/icons/LICENSE-lucide.txt +39 -0
- package/dist/icons/createIcon.d.ts +8 -0
- package/dist/icons/createIcon.js +36 -0
- package/dist/icons/icons.d.ts +51 -0
- package/dist/icons/icons.js +252 -0
- package/dist/icons/index.d.ts +3 -0
- package/dist/index.js +48 -0
- package/dist/motion/clickParticles.d.ts +1 -1
- package/dist/motion/clickParticles2.js +66 -0
- package/dist/motion/index.d.ts +1 -1
- package/dist/motion/index.js +17 -0
- package/dist/motion/liquidHover.js +36 -0
- package/dist/motion/optionDetailMotion.d.ts +7 -1
- package/dist/motion/optionDetailMotion.js +74 -0
- package/dist/motion/panelMotion.js +19 -0
- package/dist/motion/reducedMotion.d.ts +16 -0
- package/dist/motion/reducedMotion.js +28 -0
- package/dist/motion/selectPanelMotion.js +115 -0
- package/dist/motion/smoothScroll.d.ts +2 -0
- package/dist/motion/smoothScroll.js +276 -0
- package/dist/motion/useClickFeedback.js +47 -0
- package/dist/motion/useTextControlCaret.js +136 -0
- package/dist/utils/clipboard.d.ts +9 -0
- package/dist/utils/clipboard.js +16 -0
- package/dist/utils/config.d.ts +42 -0
- package/dist/utils/config.js +37 -0
- package/dist/utils/controlAttrs.js +37 -0
- package/dist/utils/floating.d.ts +86 -0
- package/dist/utils/floating.js +99 -0
- package/dist/utils/glass.js +25 -0
- package/dist/utils/overlay.js +94 -0
- package/dist/utils/scrollLock.js +44 -0
- package/dist/utils/search.d.ts +16 -0
- package/dist/utils/search.js +23 -0
- package/dist/utils/useClientReady.js +10 -0
- package/dist/utils/useDeferredBlurValidation.d.ts +18 -0
- package/dist/utils/useDeferredBlurValidation.js +34 -0
- package/dist/utils/useKeyboardScrollSync.d.ts +11 -0
- package/dist/utils/useKeyboardScrollSync.js +28 -0
- package/dist/utils/useOptionDetailPanel.d.ts +50 -0
- package/dist/utils/useOptionDetailPanel.js +180 -0
- package/dist/utils/useOutsidePointerDown.d.ts +8 -0
- package/dist/utils/useOutsidePointerDown.js +17 -0
- package/dist/utils/useSearchShortcutFocus.d.ts +18 -0
- package/dist/utils/useSearchShortcutFocus.js +47 -0
- package/dist/utils/useVirtualList.d.ts +42 -0
- package/dist/utils/useVirtualList.js +74 -0
- package/package.json +15 -9
- package/dist/bing-ui.es.js +0 -31278
- package/dist/bing-ui.umd.js +0 -229
|
@@ -0,0 +1,1416 @@
|
|
|
1
|
+
import { useConfigSize as e } from "../../utils/config.js";
|
|
2
|
+
import { useReducedMotion as t } from "../../motion/reducedMotion.js";
|
|
3
|
+
import { useClickFeedback as n } from "../../motion/useClickFeedback.js";
|
|
4
|
+
import r from "../BingButton/BingButton.js";
|
|
5
|
+
import { ChevronDown as i, ChevronLeft as a, ChevronRight as ee, ChevronsLeft as te, ChevronsRight as ne, LoaderCircle as re } from "../../icons/icons.js";
|
|
6
|
+
import o from "../BingIcon/BingIcon.js";
|
|
7
|
+
import ie from "../BingScrollbar/BingScrollbar.js";
|
|
8
|
+
import ae from "../BingCheckbox/BingCheckbox.js";
|
|
9
|
+
import oe from "../BingSelect/BingSelect.js";
|
|
10
|
+
import { useTableColumns as se } from "./useTableColumns.js";
|
|
11
|
+
import ce from "../BingTableColumnControls/BingTableColumnControls.js";
|
|
12
|
+
import le from "./BingTableHeaderCell.js";
|
|
13
|
+
import ue from "./BingTableHeaderContent.js";
|
|
14
|
+
import { bingTableMeasurementsKey as de, createTableMeasurements as fe } from "./BingTable.measurements.js";
|
|
15
|
+
import pe from "./BingTableCellValue.js";
|
|
16
|
+
import { Fragment as s, TransitionGroup as me, computed as c, createBlock as he, createCommentVNode as l, createElementBlock as u, createElementVNode as d, createTextVNode as ge, createVNode as f, defineComponent as p, mergeProps as _e, nextTick as ve, normalizeClass as m, normalizeStyle as h, onBeforeUnmount as ye, onMounted as be, openBlock as g, provide as xe, ref as _, renderList as v, renderSlot as Se, resolveDynamicComponent as Ce, shallowRef as we, toDisplayString as y, unref as b, watch as x, withCtx as S, withModifiers as Te } from "vue";
|
|
17
|
+
import { DragDropProvider as Ee, DragOverlay as De } from "@dnd-kit/vue";
|
|
18
|
+
import { AutoScroller as Oe, Feedback as ke, PointerActivationConstraints as Ae, PointerSensor as je } from "@dnd-kit/dom";
|
|
19
|
+
import { isSortable as Me } from "@dnd-kit/vue/sortable";
|
|
20
|
+
//#region src/components/BingTable/BingTable.vue?vue&type=script&setup=true&lang.ts
|
|
21
|
+
var Ne = ["aria-busy"], Pe = {
|
|
22
|
+
key: 0,
|
|
23
|
+
class: "bing-table__toolbar"
|
|
24
|
+
}, Fe = { class: "bing-table__toolbar-main" }, Ie = { class: "bing-table__head" }, Le = {
|
|
25
|
+
key: 0,
|
|
26
|
+
class: "bing-table__body"
|
|
27
|
+
}, Re = ["colspan"], ze = { key: 0 }, Be = {
|
|
28
|
+
key: 1,
|
|
29
|
+
class: "bing-table__body"
|
|
30
|
+
}, Ve = {
|
|
31
|
+
key: 0,
|
|
32
|
+
class: "bing-table__virtual-spacer",
|
|
33
|
+
"aria-hidden": "true"
|
|
34
|
+
}, He = ["colspan"], Ue = ["aria-selected", "onClick"], We = {
|
|
35
|
+
key: 1,
|
|
36
|
+
class: "bing-table__expander-spacer",
|
|
37
|
+
"aria-hidden": "true"
|
|
38
|
+
}, Ge = {
|
|
39
|
+
key: 1,
|
|
40
|
+
class: "bing-table__virtual-spacer",
|
|
41
|
+
"aria-hidden": "true"
|
|
42
|
+
}, Ke = ["colspan"], qe = {
|
|
43
|
+
key: 0,
|
|
44
|
+
class: "bing-table__loading-status",
|
|
45
|
+
role: "status",
|
|
46
|
+
"aria-live": "polite"
|
|
47
|
+
}, Je = {
|
|
48
|
+
class: "bing-table__loading-mark",
|
|
49
|
+
"aria-hidden": "true"
|
|
50
|
+
}, Ye = {
|
|
51
|
+
key: 1,
|
|
52
|
+
class: "bing-table__page-summary"
|
|
53
|
+
}, Xe = {
|
|
54
|
+
key: 2,
|
|
55
|
+
class: "bing-table__page-size"
|
|
56
|
+
}, Ze = 8, Qe = 150, $e = 250, et = 26, tt = 36, nt = .78, rt = /* @__PURE__ */ p({
|
|
57
|
+
__name: "BingTable",
|
|
58
|
+
props: {
|
|
59
|
+
data: { default: () => [] },
|
|
60
|
+
columns: { default: () => [] },
|
|
61
|
+
rowKey: {
|
|
62
|
+
type: [String, Function],
|
|
63
|
+
default: "id"
|
|
64
|
+
},
|
|
65
|
+
childrenKey: { default: "children" },
|
|
66
|
+
height: { default: void 0 },
|
|
67
|
+
maxHeight: { default: void 0 },
|
|
68
|
+
smoothScroll: {
|
|
69
|
+
type: [Boolean, Object],
|
|
70
|
+
default: !0
|
|
71
|
+
},
|
|
72
|
+
size: {},
|
|
73
|
+
bordered: {
|
|
74
|
+
type: Boolean,
|
|
75
|
+
default: !1
|
|
76
|
+
},
|
|
77
|
+
striped: {
|
|
78
|
+
type: Boolean,
|
|
79
|
+
default: !0
|
|
80
|
+
},
|
|
81
|
+
loading: {
|
|
82
|
+
type: Boolean,
|
|
83
|
+
default: !1
|
|
84
|
+
},
|
|
85
|
+
emptyText: { default: "暂无数据" },
|
|
86
|
+
loadingText: { default: "正在加载数据" },
|
|
87
|
+
selectable: {
|
|
88
|
+
type: Boolean,
|
|
89
|
+
default: !1
|
|
90
|
+
},
|
|
91
|
+
selectionMode: { default: "multiple" },
|
|
92
|
+
selectedRowKeys: { default: void 0 },
|
|
93
|
+
defaultSelectedRowKeys: { default: () => [] },
|
|
94
|
+
rowDisabled: {
|
|
95
|
+
type: [String, Function],
|
|
96
|
+
default: void 0
|
|
97
|
+
},
|
|
98
|
+
selectOnRowClick: {
|
|
99
|
+
type: Boolean,
|
|
100
|
+
default: !1
|
|
101
|
+
},
|
|
102
|
+
selectionFixed: {
|
|
103
|
+
type: Boolean,
|
|
104
|
+
default: !0
|
|
105
|
+
},
|
|
106
|
+
selectionColumnWidth: { default: 54 },
|
|
107
|
+
expandedRowKeys: { default: void 0 },
|
|
108
|
+
defaultExpandedRowKeys: { default: () => [] },
|
|
109
|
+
defaultExpandAll: {
|
|
110
|
+
type: Boolean,
|
|
111
|
+
default: !1
|
|
112
|
+
},
|
|
113
|
+
treeColumnKey: { default: void 0 },
|
|
114
|
+
indentSize: { default: 22 },
|
|
115
|
+
columnWidths: { default: void 0 },
|
|
116
|
+
defaultColumnWidths: { default: () => ({}) },
|
|
117
|
+
columnOrder: { default: void 0 },
|
|
118
|
+
defaultColumnOrder: { default: () => [] },
|
|
119
|
+
hiddenColumnKeys: { default: void 0 },
|
|
120
|
+
defaultHiddenColumnKeys: { default: () => [] },
|
|
121
|
+
columnFixed: { default: void 0 },
|
|
122
|
+
defaultColumnFixed: { default: () => ({}) },
|
|
123
|
+
resizableColumns: {
|
|
124
|
+
type: Boolean,
|
|
125
|
+
default: !0
|
|
126
|
+
},
|
|
127
|
+
reorderableColumns: {
|
|
128
|
+
type: Boolean,
|
|
129
|
+
default: !0
|
|
130
|
+
},
|
|
131
|
+
showColumnControls: {
|
|
132
|
+
type: Boolean,
|
|
133
|
+
default: !0
|
|
134
|
+
},
|
|
135
|
+
virtual: {
|
|
136
|
+
type: [Boolean, String],
|
|
137
|
+
default: "auto"
|
|
138
|
+
},
|
|
139
|
+
virtualThreshold: { default: 80 },
|
|
140
|
+
virtualRowHeight: { default: void 0 },
|
|
141
|
+
virtualOverscan: { default: 6 },
|
|
142
|
+
pagination: {
|
|
143
|
+
type: Boolean,
|
|
144
|
+
default: !1
|
|
145
|
+
},
|
|
146
|
+
remotePagination: {
|
|
147
|
+
type: Boolean,
|
|
148
|
+
default: !1
|
|
149
|
+
},
|
|
150
|
+
remoteSort: {
|
|
151
|
+
type: Boolean,
|
|
152
|
+
default: !1
|
|
153
|
+
},
|
|
154
|
+
preservePageHeight: {
|
|
155
|
+
type: Boolean,
|
|
156
|
+
default: !0
|
|
157
|
+
},
|
|
158
|
+
page: { default: void 0 },
|
|
159
|
+
defaultPage: { default: 1 },
|
|
160
|
+
pageSize: { default: void 0 },
|
|
161
|
+
defaultPageSize: { default: 10 },
|
|
162
|
+
pageSizeOptions: { default: () => [
|
|
163
|
+
10,
|
|
164
|
+
20,
|
|
165
|
+
50,
|
|
166
|
+
100
|
|
167
|
+
] },
|
|
168
|
+
total: { default: void 0 },
|
|
169
|
+
sortKey: { default: void 0 },
|
|
170
|
+
defaultSortKey: { default: null },
|
|
171
|
+
sortOrder: { default: void 0 },
|
|
172
|
+
defaultSortOrder: { default: null },
|
|
173
|
+
rowClass: {
|
|
174
|
+
type: [String, Function],
|
|
175
|
+
default: void 0
|
|
176
|
+
},
|
|
177
|
+
ariaLabel: { default: void 0 }
|
|
178
|
+
},
|
|
179
|
+
emits: [
|
|
180
|
+
"update:selectedRowKeys",
|
|
181
|
+
"selection-change",
|
|
182
|
+
"update:expandedRowKeys",
|
|
183
|
+
"expand-change",
|
|
184
|
+
"update:columnWidths",
|
|
185
|
+
"column-resize",
|
|
186
|
+
"update:columnOrder",
|
|
187
|
+
"column-reorder",
|
|
188
|
+
"update:hiddenColumnKeys",
|
|
189
|
+
"column-visibility-change",
|
|
190
|
+
"update:columnFixed",
|
|
191
|
+
"column-fixed-change",
|
|
192
|
+
"update:page",
|
|
193
|
+
"update:pageSize",
|
|
194
|
+
"page-change",
|
|
195
|
+
"update:sortKey",
|
|
196
|
+
"update:sortOrder",
|
|
197
|
+
"sort-change",
|
|
198
|
+
"row-click",
|
|
199
|
+
"scroll"
|
|
200
|
+
],
|
|
201
|
+
setup(p, { expose: rt, emit: it }) {
|
|
202
|
+
let at = t(), { playClickFeedback: ot } = n(), C = p, w = it, st = e(() => C.size), T = _(!1), E = c(() => C.loading || T.value), ct = we(C.data), lt = _(C.total), ut = _(null), dt = c(() => E.value ? ct.value : C.data), D, ft = 0, pt = _(null), mt = fe(pt, Ji);
|
|
203
|
+
xe(de, mt);
|
|
204
|
+
let O = _(null), k = _(null), ht = _(null), gt = _(null), _t = _(!1), vt = _([...C.defaultSelectedRowKeys]), yt = _([...C.defaultExpandedRowKeys]), { localColumnWidths: bt, localColumnFixed: xt, allColumns: St, visibleColumns: A, effectiveColumnOrder: Ct, effectiveHiddenColumnKeySet: wt, getColumnByKey: Tt, getColumnFixed: j, applyColumnFixed: Et, applyColumnOrderValue: Dt, applyColumnWidthsValue: Ot, applyHiddenColumnKeys: kt, reorderColumns: At, resetColumns: jt } = se(C, w), Mt = _(Math.max(1, C.defaultPage)), Nt = _(Math.max(1, C.defaultPageSize)), Pt = _(C.defaultSortKey), Ft = _(C.defaultSortOrder), It = _(0), Lt = _(0), Rt = _(0), zt = _(0), Bt = _(0), M = _(0), Vt = _(0), N = _(0), Ht = _(!1), P = _(null), Ut = _(null), Wt = _(null), Gt = _(!1), F = _(null), Kt = _(!1), qt = _(!1), I = _(null), Jt = _(!1), Yt = _(null), Xt = _(void 0), Zt = _(null), Qt = {
|
|
205
|
+
duration: 190,
|
|
206
|
+
easing: "cubic-bezier(0.22, 1, 0.36, 1)"
|
|
207
|
+
}, $t = [je.configure({
|
|
208
|
+
activationConstraints: [new Ae.Distance({
|
|
209
|
+
value: 6,
|
|
210
|
+
tolerance: {
|
|
211
|
+
x: 2,
|
|
212
|
+
y: 4
|
|
213
|
+
}
|
|
214
|
+
})],
|
|
215
|
+
preventActivation: (e) => {
|
|
216
|
+
let t = e.target;
|
|
217
|
+
return t instanceof Element && !!t.closest("[data-bing-table-dnd-ignore]");
|
|
218
|
+
}
|
|
219
|
+
})], en = (e) => e.filter((e) => e !== Oe).map((e) => e === ke ? ke.configure({ dropAnimation: Qt }) : e), L, tn, nn, R, z, rn, an, on, sn, cn, B, V, ln, un = "", dn = "", H = c(() => Math.max(32, Math.floor(C.virtualRowHeight ?? {
|
|
220
|
+
sm: 36,
|
|
221
|
+
md: 40,
|
|
222
|
+
lg: 44
|
|
223
|
+
}[st.value]), Lt.value)), fn = c(() => Math.max(0, Math.floor(C.virtualOverscan))), pn = c(() => Math.max(0, Math.floor(C.virtualThreshold))), mn = c(() => Math.max(0, Math.floor(C.indentSize))), U = c(() => Math.max(42, Math.floor(C.selectionColumnWidth))), hn = c(() => [
|
|
224
|
+
"bing-table",
|
|
225
|
+
`bing-table--${st.value}`,
|
|
226
|
+
{
|
|
227
|
+
"is-bordered": C.bordered,
|
|
228
|
+
"is-striped": C.striped,
|
|
229
|
+
"is-loading": E.value,
|
|
230
|
+
"is-virtual": J.value,
|
|
231
|
+
"is-preserving-page-height": Wn.value,
|
|
232
|
+
"has-horizontal-scrollbar": ur.value,
|
|
233
|
+
"has-vertical-scrollbar": Ht.value,
|
|
234
|
+
"has-selection": C.selectable,
|
|
235
|
+
"has-column-panel": _t.value,
|
|
236
|
+
"has-reorderable-columns": C.reorderableColumns,
|
|
237
|
+
"is-resizing-column": !!Wt.value,
|
|
238
|
+
"is-reordering-columns": !!P.value,
|
|
239
|
+
"is-page-size-transitioning": qt.value,
|
|
240
|
+
"is-pagination-floating": Jt.value
|
|
241
|
+
}
|
|
242
|
+
]), gn = c(() => {
|
|
243
|
+
let e = {
|
|
244
|
+
"--bing-table-row-height": `${H.value}px`,
|
|
245
|
+
"--bing-table-selection-width": `${U.value}px`,
|
|
246
|
+
"--bing-table-vertical-scrollbar-gutter": `${et}px`
|
|
247
|
+
};
|
|
248
|
+
return Yt.value !== null && (e.paddingBottom = `${Yt.value}px`), e;
|
|
249
|
+
}), _n = c(() => C.height), vn = c(() => C.maxHeight ?? (J.value ? 520 : void 0)), yn = c(() => E.value && ut.value !== null ? { height: `${ut.value}px` } : F.value ? { height: F.value } : void 0), bn = c(() => new Map(A.value.map((e) => [e.key, {
|
|
250
|
+
body: Cr(e),
|
|
251
|
+
header: Cr(e, !0)
|
|
252
|
+
}]))), xn = c(() => new Map(A.value.map((e) => [e.key, {
|
|
253
|
+
body: Er(e),
|
|
254
|
+
header: Er(e, !0)
|
|
255
|
+
}]))), Sn = c(() => {
|
|
256
|
+
if (A.value.length) return C.treeColumnKey ? A.value.find((e) => e.key === C.treeColumnKey) : A.value[0];
|
|
257
|
+
}), Cn = c(() => A.value.length + +!!C.selectable), wn = c(() => C.selectedRowKeys ?? vt.value), Tn = c(() => new Set(wn.value)), En = c(() => C.expandedRowKeys ?? yt.value), Dn = c(() => new Set(En.value)), W = c(() => Math.max(1, C.page ?? Mt.value)), G = c(() => Math.max(1, C.pageSize ?? Nt.value)), On = c(() => C.sortKey === void 0 ? Pt.value : C.sortKey), kn = c(() => C.sortOrder === void 0 ? Ft.value : C.sortOrder), An = c(() => {
|
|
258
|
+
let e = On.value, t = kn.value;
|
|
259
|
+
if (C.remoteSort || !e || !t) return dt.value;
|
|
260
|
+
let n = St.value.find((t) => t.key === e);
|
|
261
|
+
return n ? [...dt.value].sort((e, r) => {
|
|
262
|
+
let i = n.sorter ? n.sorter(e, r) : Lr(Fr(e, n), Fr(r, n));
|
|
263
|
+
return t === "asc" ? i : -i;
|
|
264
|
+
}) : dt.value;
|
|
265
|
+
}), K = c(() => (E.value ? lt.value : C.total) ?? An.value.length), jn = c(() => C.pagination ? Math.max(1, Math.ceil(K.value / G.value)) : 1), Mn = c(() => {
|
|
266
|
+
if (!C.pagination || C.remotePagination) return An.value;
|
|
267
|
+
let e = (W.value - 1) * G.value;
|
|
268
|
+
return An.value.slice(e, e + G.value);
|
|
269
|
+
}), q = c(() => Pr(Mn.value, !1)), Nn = c(() => Pr(An.value, !0)), Pn = c(() => !!C.treeColumnKey || Nn.value.some((e) => e.hasChildren || e.level > 0)), Fn = c(() => qt.value && I.value ? I.value : q.value), In = c(() => I.value ? Math.max(0, I.value.length - q.value.length) : 0), Ln = c(() => q.value.filter((e) => !e.disabled)), Rn = c(() => !C.selectable || !Ln.value.length || C.selectionMode === "single" ? !1 : Ln.value.every((e) => Tn.value.has(e.key))), zn = c(() => !C.selectable || !Ln.value.length || C.selectionMode === "single" ? !1 : Ln.value.some((e) => Tn.value.has(e.key)) && !Rn.value), J = c(() => C.virtual === !0 ? q.value.length > 0 : C.virtual === !1 ? !1 : q.value.length > pn.value), Bn = c(() => J.value ? Z(Math.floor(It.value / H.value) - fn.value, 0, q.value.length) : 0), Vn = c(() => {
|
|
270
|
+
if (!J.value) return q.value.length;
|
|
271
|
+
let e = H.value * 10, t = Rt.value || e;
|
|
272
|
+
return Z(Math.ceil((It.value + t) / H.value) + fn.value, Bn.value, q.value.length);
|
|
273
|
+
}), Hn = c(() => J.value ? q.value.slice(Bn.value, Vn.value) : Fn.value), Un = c(() => A.value.length > 0 && Hn.value.length > 0), Wn = c(() => C.preservePageHeight && C.pagination && C.height === void 0 && !J.value), Gn = c(() => {
|
|
274
|
+
if (!Wn.value || !A.value.length || !q.value.length || K.value === 0) return 0;
|
|
275
|
+
let e = Math.min(G.value, K.value);
|
|
276
|
+
return Math.max(0, e - q.value.length);
|
|
277
|
+
}), Kn = c(() => [
|
|
278
|
+
C.pagination ? "paginated" : "plain",
|
|
279
|
+
E.value ? "loading" : "ready",
|
|
280
|
+
C.height === void 0 ? "auto-height" : "fixed-height",
|
|
281
|
+
J.value ? "virtual" : "static",
|
|
282
|
+
W.value,
|
|
283
|
+
G.value,
|
|
284
|
+
q.value.length,
|
|
285
|
+
Gn.value,
|
|
286
|
+
A.value.length
|
|
287
|
+
].join("|")), qn = c(() => J.value ? Bn.value * H.value : 0), Jn = c(() => J.value ? Math.max(0, q.value.length - Vn.value) * H.value : 0), Yn = c(() => {
|
|
288
|
+
let e = C.selectable ? U.value : 0, t = A.value.reduce((e, t) => e + Q(t), 0);
|
|
289
|
+
return Math.max(e + t, 320);
|
|
290
|
+
}), Xn = c(() => {
|
|
291
|
+
let e = {}, t = C.selectable && C.selectionFixed ? U.value : 0;
|
|
292
|
+
return A.value.forEach((n) => {
|
|
293
|
+
j(n) === "left" && (e[n.key] = t, t += Q(n));
|
|
294
|
+
}), e;
|
|
295
|
+
}), Zn = c(() => {
|
|
296
|
+
let e = {}, t = 0;
|
|
297
|
+
return A.value.slice().reverse().forEach((n) => {
|
|
298
|
+
j(n) === "right" && (e[n.key] = t, t += Q(n));
|
|
299
|
+
}), e;
|
|
300
|
+
}), Qn = c(() => {
|
|
301
|
+
let e = C.selectable && C.selectionFixed ? U.value : 0;
|
|
302
|
+
return A.value.forEach((t) => {
|
|
303
|
+
j(t) === "left" && (e += Q(t));
|
|
304
|
+
}), e;
|
|
305
|
+
}), $n = c(() => A.value.reduce((e, t) => j(t) === "right" ? e + Q(t) : e, 0)), er = c(() => nt * Z(Vt.value / tt, 0, 1)), tr = c(() => nt * Z((N.value - Vt.value) / tt, 0, 1)), nr = c(() => ({
|
|
306
|
+
left: `${Qn.value}px`,
|
|
307
|
+
opacity: er.value
|
|
308
|
+
})), rr = c(() => ({
|
|
309
|
+
right: `${$n.value}px`,
|
|
310
|
+
opacity: tr.value
|
|
311
|
+
})), ir = c(() => ({ width: C.selectable && fr.value ? `${U.value}px` : "0px" })), ar = c(() => ({
|
|
312
|
+
right: "0px",
|
|
313
|
+
width: `${$n.value}px`
|
|
314
|
+
})), or = c(() => Un.value && C.selectable && fr.value), sr = c(() => Un.value && $n.value > 0), cr = c(() => Un.value && Qn.value > 0 && N.value > 1), lr = c(() => Un.value && $n.value > 0 && N.value > 1), ur = c(() => N.value > 1), dr = c(() => {
|
|
315
|
+
if (!ur.value || M.value <= 0 || zt.value <= 0 || Bt.value <= 0) return {
|
|
316
|
+
width: "0px",
|
|
317
|
+
transform: "translate3d(0, 0, 0)"
|
|
318
|
+
};
|
|
319
|
+
let e = Z(zt.value / Bt.value * M.value, 36, M.value), t = Math.max(0, M.value - e), n = N.value > 0 ? Vt.value / N.value * t : 0;
|
|
320
|
+
return {
|
|
321
|
+
width: `${e}px`,
|
|
322
|
+
transform: `translate3d(${Z(n, 0, t)}px, 0, 0)`
|
|
323
|
+
};
|
|
324
|
+
}), fr = c(() => C.selectionFixed && (!J.value || ur.value)), pr = c(() => {
|
|
325
|
+
let e = jn.value, t = Z(Z(W.value, 1, e) - 2, 1, Math.max(1, e - 4)), n = Math.min(e, t + 4), r = [];
|
|
326
|
+
for (let e = t; e <= n; e += 1) r.push(e);
|
|
327
|
+
return r;
|
|
328
|
+
}), mr = c(() => ({
|
|
329
|
+
page: Z(W.value, 1, jn.value),
|
|
330
|
+
pageCount: jn.value,
|
|
331
|
+
pageNumbers: pr.value
|
|
332
|
+
})), Y = c(() => Zt.value ?? mr.value), hr = c(() => {
|
|
333
|
+
let e = C.pageSizeOptions.map((e) => Math.round(e)).filter((e) => e > 0), t = Math.max(1, Math.round(C.defaultPageSize)), n = C.pageSize === void 0 ? void 0 : Math.max(1, Math.round(C.pageSize));
|
|
334
|
+
return [...new Set([
|
|
335
|
+
...e,
|
|
336
|
+
t,
|
|
337
|
+
n
|
|
338
|
+
])].filter((e) => typeof e == "number").sort((e, t) => e - t);
|
|
339
|
+
}), gr = c(() => hr.value.map((e) => ({
|
|
340
|
+
label: String(e),
|
|
341
|
+
value: e
|
|
342
|
+
}))), _r = c(() => !C.pagination || K.value === 0 ? `共 ${q.value.length} 条` : `${Math.min(K.value, (W.value - 1) * G.value + 1)}-${Math.min(K.value, W.value * G.value)} / 共 ${K.value} 条`);
|
|
343
|
+
function X() {
|
|
344
|
+
return typeof window < "u" && typeof document < "u";
|
|
345
|
+
}
|
|
346
|
+
function Z(e, t, n) {
|
|
347
|
+
return Math.min(n, Math.max(t, e));
|
|
348
|
+
}
|
|
349
|
+
function vr(e, t) {
|
|
350
|
+
return !!(e && Object.prototype.hasOwnProperty.call(e, t));
|
|
351
|
+
}
|
|
352
|
+
function yr(e, t) {
|
|
353
|
+
if (typeof e == "number" && Number.isFinite(e)) return e;
|
|
354
|
+
if (typeof e == "string") {
|
|
355
|
+
let t = Number.parseFloat(e);
|
|
356
|
+
if (Number.isFinite(t)) return t;
|
|
357
|
+
}
|
|
358
|
+
return t;
|
|
359
|
+
}
|
|
360
|
+
function Q(e) {
|
|
361
|
+
let t = yr(e.width, e.minWidth ?? 160);
|
|
362
|
+
return vr(C.columnWidths, e.key) ? xr(e, C.columnWidths?.[e.key] ?? t) : vr(bt.value, e.key) ? xr(e, bt.value[e.key] ?? t) : xr(e, t);
|
|
363
|
+
}
|
|
364
|
+
function br(e) {
|
|
365
|
+
return `${Q(e)}px`;
|
|
366
|
+
}
|
|
367
|
+
function xr(e, t) {
|
|
368
|
+
let n = Math.max(48, e.minWidth ?? 96), r = e.maxWidth ?? Infinity;
|
|
369
|
+
return Math.round(Z(t, n, r));
|
|
370
|
+
}
|
|
371
|
+
function Sr(e, t = !1) {
|
|
372
|
+
return bn.value.get(e.key)?.[t ? "header" : "body"] ?? Cr(e, t);
|
|
373
|
+
}
|
|
374
|
+
function Cr(e, t = !1) {
|
|
375
|
+
let n = j(e), r = {
|
|
376
|
+
width: br(e),
|
|
377
|
+
minWidth: br(e),
|
|
378
|
+
maxWidth: e.maxWidth ? `${e.maxWidth}px` : void 0,
|
|
379
|
+
textAlign: t ? e.headerAlign ?? e.align ?? "left" : e.align ?? "left"
|
|
380
|
+
};
|
|
381
|
+
return n === "left" && (r.left = `${Xn.value[e.key] ?? 0}px`), n === "right" && (r.right = `${Zn.value[e.key] ?? 0}px`), r;
|
|
382
|
+
}
|
|
383
|
+
function wr() {
|
|
384
|
+
return fr.value ? {
|
|
385
|
+
left: "0px",
|
|
386
|
+
width: `${U.value}px`,
|
|
387
|
+
minWidth: `${U.value}px`
|
|
388
|
+
} : {
|
|
389
|
+
width: `${U.value}px`,
|
|
390
|
+
minWidth: `${U.value}px`
|
|
391
|
+
};
|
|
392
|
+
}
|
|
393
|
+
function Tr(e, t = !1) {
|
|
394
|
+
return xn.value.get(e.key)?.[t ? "header" : "body"] ?? Er(e, t);
|
|
395
|
+
}
|
|
396
|
+
function Er(e, t = !1) {
|
|
397
|
+
let n = j(e);
|
|
398
|
+
return [
|
|
399
|
+
t ? e.headerClass : e.class,
|
|
400
|
+
`is-align-${t ? e.headerAlign ?? e.align ?? "left" : e.align ?? "left"}`,
|
|
401
|
+
{
|
|
402
|
+
"is-fixed-left": n === "left",
|
|
403
|
+
"is-fixed-right": n === "right",
|
|
404
|
+
"is-last-left-fixed": n === "left" && Dr(e.key),
|
|
405
|
+
"is-first-right-fixed": n === "right" && Or(e.key),
|
|
406
|
+
"is-last-right-fixed": n === "right" && kr(e.key),
|
|
407
|
+
"is-before-right-fixed": n !== "right" && Ar(e.key),
|
|
408
|
+
"is-sorting": On.value === e.key && !!kn.value,
|
|
409
|
+
"is-dragging": P.value === e.key,
|
|
410
|
+
"is-drag-over": Ut.value === e.key,
|
|
411
|
+
"is-resizing": Wt.value === e.key,
|
|
412
|
+
"is-ellipsis": e.ellipsis !== !1
|
|
413
|
+
}
|
|
414
|
+
];
|
|
415
|
+
}
|
|
416
|
+
function Dr(e) {
|
|
417
|
+
let t = A.value.findIndex((t) => t.key === e);
|
|
418
|
+
return !A.value.slice(t + 1).some((e) => j(e) === "left");
|
|
419
|
+
}
|
|
420
|
+
function Or(e) {
|
|
421
|
+
let t = A.value.findIndex((t) => t.key === e);
|
|
422
|
+
return !A.value.slice(0, t).some((e) => j(e) === "right");
|
|
423
|
+
}
|
|
424
|
+
function kr(e) {
|
|
425
|
+
let t = A.value.findIndex((t) => t.key === e);
|
|
426
|
+
return !A.value.slice(t + 1).some((e) => j(e) === "right");
|
|
427
|
+
}
|
|
428
|
+
function Ar(e) {
|
|
429
|
+
let t = A.value.findIndex((e) => j(e) === "right");
|
|
430
|
+
return t > 0 && A.value[t - 1]?.key === e;
|
|
431
|
+
}
|
|
432
|
+
function jr(e) {
|
|
433
|
+
let t = e[C.childrenKey];
|
|
434
|
+
return Array.isArray(t) ? t : [];
|
|
435
|
+
}
|
|
436
|
+
function Mr(e, t, n) {
|
|
437
|
+
if (typeof C.rowKey == "function") return C.rowKey(e, t, n);
|
|
438
|
+
let r = e[C.rowKey];
|
|
439
|
+
return typeof r == "string" || typeof r == "number" ? r : n.join("-");
|
|
440
|
+
}
|
|
441
|
+
function Nr(e, t) {
|
|
442
|
+
return C.rowDisabled ? typeof C.rowDisabled == "function" ? C.rowDisabled(e, t) : !!e[C.rowDisabled] : !1;
|
|
443
|
+
}
|
|
444
|
+
function Pr(e, t) {
|
|
445
|
+
let n = [];
|
|
446
|
+
function r(e, i, a, ee) {
|
|
447
|
+
e.forEach((e, te) => {
|
|
448
|
+
let ne = [...ee, te], re = Mr(e, n.length, ne), o = jr(e), ie = o.length > 0, ae = Dn.value.has(re), oe = {
|
|
449
|
+
row: e,
|
|
450
|
+
key: re,
|
|
451
|
+
level: i,
|
|
452
|
+
parentKey: a,
|
|
453
|
+
index: n.length,
|
|
454
|
+
path: ne,
|
|
455
|
+
disabled: Nr(e, n.length),
|
|
456
|
+
hasChildren: ie,
|
|
457
|
+
expanded: ae
|
|
458
|
+
};
|
|
459
|
+
n.push(oe), ie && (t || ae) && r(o, i + 1, re, ne);
|
|
460
|
+
});
|
|
461
|
+
}
|
|
462
|
+
return r(e, 0, null, []), n;
|
|
463
|
+
}
|
|
464
|
+
function Fr(e, t) {
|
|
465
|
+
return e[t.dataKey ?? t.key];
|
|
466
|
+
}
|
|
467
|
+
function Ir(e) {
|
|
468
|
+
if (e == null) return "";
|
|
469
|
+
if (e instanceof Date) return e.toLocaleString();
|
|
470
|
+
if (typeof e == "object") try {
|
|
471
|
+
return JSON.stringify(e);
|
|
472
|
+
} catch {
|
|
473
|
+
return String(e);
|
|
474
|
+
}
|
|
475
|
+
return String(e);
|
|
476
|
+
}
|
|
477
|
+
function Lr(e, t) {
|
|
478
|
+
return e === t ? 0 : e == null ? 1 : t == null ? -1 : typeof e == "number" && typeof t == "number" ? e - t : String(e).localeCompare(String(t), void 0, {
|
|
479
|
+
numeric: !0,
|
|
480
|
+
sensitivity: "base"
|
|
481
|
+
});
|
|
482
|
+
}
|
|
483
|
+
function Rr(e) {
|
|
484
|
+
return [typeof C.rowClass == "function" ? C.rowClass(e.row, e.index) : C.rowClass, {
|
|
485
|
+
"is-striped-row": e.index % 2 == 1,
|
|
486
|
+
"is-selected": Tn.value.has(e.key),
|
|
487
|
+
"is-disabled": e.disabled,
|
|
488
|
+
"is-expanded": e.expanded,
|
|
489
|
+
"has-children": e.hasChildren
|
|
490
|
+
}];
|
|
491
|
+
}
|
|
492
|
+
function zr(e) {
|
|
493
|
+
return (q.value.length + e - 1) % 2 == 1;
|
|
494
|
+
}
|
|
495
|
+
function Br(e) {
|
|
496
|
+
return Pn.value && Sn.value?.key === e.key;
|
|
497
|
+
}
|
|
498
|
+
function Vr(e) {
|
|
499
|
+
let t = e.filter((t, n) => e.indexOf(t) === n);
|
|
500
|
+
C.selectedRowKeys === void 0 && (vt.value = t), w("update:selectedRowKeys", t), w("selection-change", {
|
|
501
|
+
keys: t,
|
|
502
|
+
rows: Nn.value.filter((e) => t.includes(e.key)).map((e) => e.row)
|
|
503
|
+
});
|
|
504
|
+
}
|
|
505
|
+
function Hr(e, t) {
|
|
506
|
+
let n = Nn.value.find((t) => t.key === e);
|
|
507
|
+
if (!n || n.disabled) return;
|
|
508
|
+
let r = Tn.value.has(e), i = t ?? !r;
|
|
509
|
+
if (C.selectionMode === "single") {
|
|
510
|
+
Vr(i ? [e] : []);
|
|
511
|
+
return;
|
|
512
|
+
}
|
|
513
|
+
Vr(i ? [...wn.value, e] : wn.value.filter((t) => t !== e));
|
|
514
|
+
}
|
|
515
|
+
function Ur(e) {
|
|
516
|
+
if (C.selectionMode === "single") return;
|
|
517
|
+
let t = Ln.value.map((e) => e.key), n = wn.value.filter((e) => !t.includes(e));
|
|
518
|
+
Vr(e ? [...n, ...t] : n);
|
|
519
|
+
}
|
|
520
|
+
function Wr() {
|
|
521
|
+
Vr([]);
|
|
522
|
+
}
|
|
523
|
+
function Gr(e, t, n = !1) {
|
|
524
|
+
let r = e.filter((t, n) => e.indexOf(t) === n);
|
|
525
|
+
C.expandedRowKeys === void 0 && (yt.value = r), w("update:expandedRowKeys", r), t && w("expand-change", {
|
|
526
|
+
key: t.key,
|
|
527
|
+
row: t.row,
|
|
528
|
+
expanded: n,
|
|
529
|
+
expandedRowKeys: r
|
|
530
|
+
});
|
|
531
|
+
}
|
|
532
|
+
function Kr(e, t) {
|
|
533
|
+
let n = Nn.value.find((t) => t.key === e);
|
|
534
|
+
if (!n || !n.hasChildren) return;
|
|
535
|
+
let r = Dn.value.has(e), i = t ?? !r;
|
|
536
|
+
Gr(i ? [...En.value, e] : En.value.filter((t) => t !== e), n, i);
|
|
537
|
+
}
|
|
538
|
+
function qr(e) {
|
|
539
|
+
if (!e.sortable) return;
|
|
540
|
+
let t = e.key, n = "asc";
|
|
541
|
+
On.value === e.key && (kn.value === "asc" ? n = "desc" : kn.value === "desc" && (t = null, n = null)), C.sortKey === void 0 && (Pt.value = t), C.sortOrder === void 0 && (Ft.value = n), w("update:sortKey", t), w("update:sortOrder", n), w("sort-change", {
|
|
542
|
+
key: t,
|
|
543
|
+
order: n,
|
|
544
|
+
column: t ? e : void 0
|
|
545
|
+
});
|
|
546
|
+
}
|
|
547
|
+
function Jr(e, t, n) {
|
|
548
|
+
C.columnWidths === void 0 && (bt.value = e), w("update:columnWidths", e), w("column-resize", {
|
|
549
|
+
key: t,
|
|
550
|
+
width: n,
|
|
551
|
+
widths: e
|
|
552
|
+
});
|
|
553
|
+
}
|
|
554
|
+
function Yr(e, t) {
|
|
555
|
+
let n = St.value.find((t) => t.key === e);
|
|
556
|
+
if (!n) return;
|
|
557
|
+
let r = xr(n, t);
|
|
558
|
+
r !== Q(n) && Jr({
|
|
559
|
+
...C.columnWidths ?? bt.value,
|
|
560
|
+
[e]: r
|
|
561
|
+
}, e, r);
|
|
562
|
+
}
|
|
563
|
+
function Xr(e) {
|
|
564
|
+
return C.resizableColumns && e.resizable !== !1;
|
|
565
|
+
}
|
|
566
|
+
function Zr(e, t) {
|
|
567
|
+
!Xr(e) || t.button !== 0 || (t.preventDefault(), B = {
|
|
568
|
+
key: e.key,
|
|
569
|
+
startClientX: t.clientX,
|
|
570
|
+
startWidth: Q(e)
|
|
571
|
+
}, Wt.value = e.key, ai(), ri());
|
|
572
|
+
}
|
|
573
|
+
function Qr(e) {
|
|
574
|
+
B && (e.preventDefault(), nn = B.startWidth + e.clientX - B.startClientX, tn === void 0 && (X() && typeof window.requestAnimationFrame == "function" ? tn = window.requestAnimationFrame(ei) : ei()));
|
|
575
|
+
}
|
|
576
|
+
function $r() {
|
|
577
|
+
tn !== void 0 && X() && window.cancelAnimationFrame(tn), tn = void 0;
|
|
578
|
+
}
|
|
579
|
+
function ei() {
|
|
580
|
+
$r();
|
|
581
|
+
let e = nn;
|
|
582
|
+
nn = void 0, B && e !== void 0 && Yr(B.key, e);
|
|
583
|
+
}
|
|
584
|
+
function ti() {
|
|
585
|
+
B && (ei(), B = void 0, Wt.value = null, ii(), oi());
|
|
586
|
+
}
|
|
587
|
+
function ni(e, t) {
|
|
588
|
+
if (!Xr(e) || t.key !== "ArrowLeft" && t.key !== "ArrowRight") return;
|
|
589
|
+
t.preventDefault();
|
|
590
|
+
let n = t.key === "ArrowRight" ? 12 : -12;
|
|
591
|
+
Yr(e.key, Q(e) + n);
|
|
592
|
+
}
|
|
593
|
+
function ri() {
|
|
594
|
+
X() && (window.addEventListener("pointermove", Qr), window.addEventListener("pointerup", ti), window.addEventListener("pointercancel", ti));
|
|
595
|
+
}
|
|
596
|
+
function ii() {
|
|
597
|
+
X() && (window.removeEventListener("pointermove", Qr), window.removeEventListener("pointerup", ti), window.removeEventListener("pointercancel", ti));
|
|
598
|
+
}
|
|
599
|
+
function ai() {
|
|
600
|
+
X() && (un = document.documentElement.style.cursor, dn = document.documentElement.style.userSelect, document.documentElement.style.cursor = "col-resize", document.documentElement.style.userSelect = "none");
|
|
601
|
+
}
|
|
602
|
+
function oi() {
|
|
603
|
+
X() && (document.documentElement.style.cursor = un, document.documentElement.style.userSelect = dn);
|
|
604
|
+
}
|
|
605
|
+
function si() {
|
|
606
|
+
ln?.(), k.value?.stop();
|
|
607
|
+
let e = pt.value?.ownerDocument;
|
|
608
|
+
if (!e) return;
|
|
609
|
+
let t = (e) => {
|
|
610
|
+
e.preventDefault(), e.stopPropagation();
|
|
611
|
+
}, n = (e) => {
|
|
612
|
+
[
|
|
613
|
+
"ArrowUp",
|
|
614
|
+
"ArrowDown",
|
|
615
|
+
"ArrowLeft",
|
|
616
|
+
"ArrowRight",
|
|
617
|
+
"PageUp",
|
|
618
|
+
"PageDown",
|
|
619
|
+
"Home",
|
|
620
|
+
"End",
|
|
621
|
+
" ",
|
|
622
|
+
"Enter"
|
|
623
|
+
].includes(e.key) && t(e);
|
|
624
|
+
};
|
|
625
|
+
e.addEventListener("wheel", t, {
|
|
626
|
+
capture: !0,
|
|
627
|
+
passive: !1
|
|
628
|
+
}), e.addEventListener("touchmove", t, {
|
|
629
|
+
capture: !0,
|
|
630
|
+
passive: !1
|
|
631
|
+
}), e.addEventListener("keydown", n, !0), e.addEventListener("keyup", n, !0), ln = () => {
|
|
632
|
+
e.removeEventListener("wheel", t, !0), e.removeEventListener("touchmove", t, !0), e.removeEventListener("keydown", n, !0), e.removeEventListener("keyup", n, !0), ln = void 0;
|
|
633
|
+
};
|
|
634
|
+
}
|
|
635
|
+
function ci() {
|
|
636
|
+
ln?.(), P.value = null, Ut.value = null;
|
|
637
|
+
}
|
|
638
|
+
function li(e) {
|
|
639
|
+
let t = A.value.length - 1;
|
|
640
|
+
return t < 0 ? null : A.value[Math.min(t, Math.max(0, e))]?.key ?? null;
|
|
641
|
+
}
|
|
642
|
+
function ui(e) {
|
|
643
|
+
let { source: t } = e.operation;
|
|
644
|
+
!C.reorderableColumns || !Me(t) || (si(), P.value = String(t.id), Ut.value = li(t.index));
|
|
645
|
+
}
|
|
646
|
+
function di(e) {
|
|
647
|
+
let { source: t } = e.operation;
|
|
648
|
+
!C.reorderableColumns || !P.value || !Me(t) || (Ut.value = li(t.index));
|
|
649
|
+
}
|
|
650
|
+
function fi(e) {
|
|
651
|
+
let { source: t } = e.operation, n = P.value;
|
|
652
|
+
if (C.reorderableColumns && n && !e.canceled && Me(t)) {
|
|
653
|
+
let e = li(t.index);
|
|
654
|
+
e && At(n, e);
|
|
655
|
+
}
|
|
656
|
+
ci();
|
|
657
|
+
}
|
|
658
|
+
function pi(e) {
|
|
659
|
+
let t = Z(Math.round(e), 1, jn.value);
|
|
660
|
+
C.page === void 0 && (Mt.value = t), w("update:page", t), w("page-change", {
|
|
661
|
+
page: t,
|
|
662
|
+
pageSize: G.value
|
|
663
|
+
});
|
|
664
|
+
}
|
|
665
|
+
function mi(e) {
|
|
666
|
+
let t = Math.max(1, Math.round(e));
|
|
667
|
+
(t !== G.value || W.value !== 1) && Mi(t), C.pageSize === void 0 && (Nt.value = t), C.page === void 0 && (Mt.value = 1), w("update:pageSize", t), w("update:page", 1), w("page-change", {
|
|
668
|
+
page: 1,
|
|
669
|
+
pageSize: t
|
|
670
|
+
});
|
|
671
|
+
}
|
|
672
|
+
function hi(e) {
|
|
673
|
+
Array.isArray(e) || e === null || mi(Number(e));
|
|
674
|
+
}
|
|
675
|
+
function gi(e, t) {
|
|
676
|
+
w("row-click", e.row, t), !(t.defaultPrevented || t.target instanceof Element && t.target.closest("button,a[href],input,label,select,textarea,[role=\"button\"],[role=\"combobox\"],[contenteditable]:not([contenteditable=\"false\"]),[data-bing-table-row-click-ignore]")) && C.selectable && C.selectOnRowClick && !e.disabled && (ot(t), Hr(e.key));
|
|
677
|
+
}
|
|
678
|
+
function _i(e) {
|
|
679
|
+
let t = e.target;
|
|
680
|
+
It.value = t.scrollTop, Vt.value = t.scrollLeft, zt.value = t.clientWidth, Bt.value = t.scrollWidth, N.value = Ri(t), Ht.value = zi(t) > 0, vi(), w("scroll", e);
|
|
681
|
+
}
|
|
682
|
+
function vi() {
|
|
683
|
+
M.value = ht.value?.clientWidth ?? 0;
|
|
684
|
+
}
|
|
685
|
+
function $() {
|
|
686
|
+
let e = k.value?.viewport;
|
|
687
|
+
Rt.value = e?.clientHeight ?? 0, zt.value = e?.clientWidth ?? 0, Bt.value = e?.scrollWidth ?? 0, Vt.value = e?.scrollLeft ?? 0, N.value = e ? Ri(e) : 0, Ht.value = e ? zi(e) > 0 : !1, vi();
|
|
688
|
+
}
|
|
689
|
+
function yi() {
|
|
690
|
+
ve(() => {
|
|
691
|
+
k.value?.update(), $(), !(!X() || typeof window.requestAnimationFrame != "function") && (R !== void 0 && window.cancelAnimationFrame(R), R = window.requestAnimationFrame(() => {
|
|
692
|
+
R = void 0, k.value?.update(), $();
|
|
693
|
+
}));
|
|
694
|
+
});
|
|
695
|
+
}
|
|
696
|
+
function bi(e) {
|
|
697
|
+
let t = e.querySelector(":scope > .bing-table__scroll"), n = e.querySelector(":scope > .bing-table__horizontal-scrollbar");
|
|
698
|
+
return (t?.getBoundingClientRect().height ?? 0) + (n?.getBoundingClientRect().height ?? 0);
|
|
699
|
+
}
|
|
700
|
+
function xi() {
|
|
701
|
+
return In.value * H.value;
|
|
702
|
+
}
|
|
703
|
+
function Si() {
|
|
704
|
+
if (!X()) {
|
|
705
|
+
an = void 0;
|
|
706
|
+
return;
|
|
707
|
+
}
|
|
708
|
+
an !== void 0 && (window.clearTimeout(an), an = void 0);
|
|
709
|
+
}
|
|
710
|
+
function Ci() {
|
|
711
|
+
return !!O.value && C.height === void 0 && !J.value && !at();
|
|
712
|
+
}
|
|
713
|
+
function wi() {
|
|
714
|
+
let e = pt.value, t = O.value, n = gt.value;
|
|
715
|
+
if (!e || !t || !n) return;
|
|
716
|
+
let r = e.getBoundingClientRect(), i = t.getBoundingClientRect(), a = n.getBoundingClientRect();
|
|
717
|
+
if (!(a.width <= 0 || a.height <= 0)) return {
|
|
718
|
+
top: a.top - r.top,
|
|
719
|
+
left: a.left - r.left,
|
|
720
|
+
width: a.width,
|
|
721
|
+
reserve: Math.max(0, a.bottom - i.bottom)
|
|
722
|
+
};
|
|
723
|
+
}
|
|
724
|
+
function Ti(e, t, n = "none") {
|
|
725
|
+
return {
|
|
726
|
+
position: "absolute",
|
|
727
|
+
top: `${e.top}px`,
|
|
728
|
+
left: `${e.left}px`,
|
|
729
|
+
width: `${e.width}px`,
|
|
730
|
+
transform: t,
|
|
731
|
+
transition: n
|
|
732
|
+
};
|
|
733
|
+
}
|
|
734
|
+
function Ei() {
|
|
735
|
+
on !== void 0 && X() && window.cancelAnimationFrame(on), on = void 0, sn = void 0, Yt.value = null, Xt.value = void 0, Jt.value = !1;
|
|
736
|
+
}
|
|
737
|
+
function Di() {
|
|
738
|
+
Ei();
|
|
739
|
+
let e = wi();
|
|
740
|
+
e && (sn = e, Yt.value = e.reserve, Xt.value = Ti(e, "translate3d(0, 0, 0)"), Jt.value = !0);
|
|
741
|
+
}
|
|
742
|
+
function Oi(e, t) {
|
|
743
|
+
let n = sn, r = t - e;
|
|
744
|
+
if (!n || !Jt.value || Math.abs(r) < 1) return;
|
|
745
|
+
let i = `translate3d(0, ${r}px, 0)`, a = "transform 260ms var(--bing-ease-smooth)";
|
|
746
|
+
if (!X() || typeof window.requestAnimationFrame != "function") {
|
|
747
|
+
Xt.value = Ti(n, i, a);
|
|
748
|
+
return;
|
|
749
|
+
}
|
|
750
|
+
on = window.requestAnimationFrame(() => {
|
|
751
|
+
on = void 0, Xt.value = Ti(n, i, a);
|
|
752
|
+
});
|
|
753
|
+
}
|
|
754
|
+
function ki(e) {
|
|
755
|
+
return {
|
|
756
|
+
page: e.page,
|
|
757
|
+
pageCount: e.pageCount,
|
|
758
|
+
pageNumbers: [...e.pageNumbers]
|
|
759
|
+
};
|
|
760
|
+
}
|
|
761
|
+
function Ai() {
|
|
762
|
+
Si(), Ei(), cn = void 0, Zt.value = null, I.value = null, qt.value = !1;
|
|
763
|
+
}
|
|
764
|
+
function ji(e) {
|
|
765
|
+
I.value = null, !(!C.pagination || C.remotePagination || C.loading || J.value || e >= G.value || q.value.length <= e) && (I.value = [...q.value]);
|
|
766
|
+
}
|
|
767
|
+
function Mi(e) {
|
|
768
|
+
if (!Ci()) {
|
|
769
|
+
I.value = null;
|
|
770
|
+
return;
|
|
771
|
+
}
|
|
772
|
+
Si(), ji(e), cn = O.value?.getBoundingClientRect().height, Di(), Zt.value = ki(mr.value), qt.value = !0, X() && (an = window.setTimeout(Ai, 420));
|
|
773
|
+
}
|
|
774
|
+
function Ni() {
|
|
775
|
+
if (!X()) {
|
|
776
|
+
z = void 0, rn = void 0;
|
|
777
|
+
return;
|
|
778
|
+
}
|
|
779
|
+
z !== void 0 && (window.cancelAnimationFrame(z), z = void 0), rn !== void 0 && (window.clearTimeout(rn), rn = void 0);
|
|
780
|
+
}
|
|
781
|
+
function Pi() {
|
|
782
|
+
Ni(), F.value = null, Kt.value = !1, Ai(), yi();
|
|
783
|
+
}
|
|
784
|
+
function Fi(e) {
|
|
785
|
+
if (!X() || typeof window.requestAnimationFrame != "function") {
|
|
786
|
+
e();
|
|
787
|
+
return;
|
|
788
|
+
}
|
|
789
|
+
z = window.requestAnimationFrame(() => {
|
|
790
|
+
if (!qt.value) {
|
|
791
|
+
z = void 0, e();
|
|
792
|
+
return;
|
|
793
|
+
}
|
|
794
|
+
z = window.requestAnimationFrame(() => {
|
|
795
|
+
z = void 0, e();
|
|
796
|
+
});
|
|
797
|
+
});
|
|
798
|
+
}
|
|
799
|
+
function Ii() {
|
|
800
|
+
let e = O.value;
|
|
801
|
+
if (!e || E.value || C.height !== void 0 || J.value || at()) return;
|
|
802
|
+
let t = cn ?? e.getBoundingClientRect().height;
|
|
803
|
+
cn = void 0, !(t <= 0) && (Ni(), F.value = `${t}px`, Kt.value = !0, ve(() => {
|
|
804
|
+
let e = O.value;
|
|
805
|
+
if (!e) {
|
|
806
|
+
Pi();
|
|
807
|
+
return;
|
|
808
|
+
}
|
|
809
|
+
let n = Math.max(0, bi(e) - xi());
|
|
810
|
+
if (n <= 0 || Math.abs(n - t) < 1) {
|
|
811
|
+
Pi();
|
|
812
|
+
return;
|
|
813
|
+
}
|
|
814
|
+
if (!X() || typeof window.requestAnimationFrame != "function") {
|
|
815
|
+
F.value = `${n}px`, Pi();
|
|
816
|
+
return;
|
|
817
|
+
}
|
|
818
|
+
Fi(() => {
|
|
819
|
+
Oi(t, n), F.value = `${n}px`, rn = window.setTimeout(Pi, 340);
|
|
820
|
+
});
|
|
821
|
+
}));
|
|
822
|
+
}
|
|
823
|
+
function Li(e) {
|
|
824
|
+
e.target !== O.value || e.propertyName !== "height" || Pi();
|
|
825
|
+
}
|
|
826
|
+
function Ri(e) {
|
|
827
|
+
let t = Math.max(0, e.scrollWidth - e.clientWidth);
|
|
828
|
+
return t > Ze ? t : 0;
|
|
829
|
+
}
|
|
830
|
+
function zi(e) {
|
|
831
|
+
let t = Math.max(0, e.scrollHeight - e.clientHeight);
|
|
832
|
+
return t > Ze ? t : 0;
|
|
833
|
+
}
|
|
834
|
+
function Bi(e) {
|
|
835
|
+
let t = k.value?.viewport;
|
|
836
|
+
t && (t.scrollLeft = Z(e, 0, Ri(t)), $());
|
|
837
|
+
}
|
|
838
|
+
function Vi() {
|
|
839
|
+
if (M.value <= 0 || zt.value <= 0 || Bt.value <= 0) return 0;
|
|
840
|
+
let e = Z(zt.value / Bt.value * M.value, 36, M.value);
|
|
841
|
+
return Math.max(0, M.value - e);
|
|
842
|
+
}
|
|
843
|
+
function Hi(e) {
|
|
844
|
+
if (!ur.value || !ht.value) return;
|
|
845
|
+
e.preventDefault(), k.value?.stop(), vi();
|
|
846
|
+
let t = ht.value.getBoundingClientRect(), n = Vi();
|
|
847
|
+
if (n <= 0) return;
|
|
848
|
+
let r = M.value - n;
|
|
849
|
+
Bi(Z(e.clientX - t.left - r / 2, 0, n) / n * Math.max(1, N.value));
|
|
850
|
+
}
|
|
851
|
+
function Ui(e) {
|
|
852
|
+
if (!ur.value) return;
|
|
853
|
+
k.value?.stop(), vi();
|
|
854
|
+
let t = Vi();
|
|
855
|
+
t <= 0 || !X() || (e.preventDefault(), e.stopPropagation(), V = {
|
|
856
|
+
maxScrollLeft: N.value,
|
|
857
|
+
startClientX: e.clientX,
|
|
858
|
+
startScrollLeft: Vt.value,
|
|
859
|
+
thumbTravel: t
|
|
860
|
+
}, Gt.value = !0, un = document.documentElement.style.cursor, dn = document.documentElement.style.userSelect, document.documentElement.style.cursor = "grabbing", document.documentElement.style.userSelect = "none", window.addEventListener("pointermove", Wi), window.addEventListener("pointerup", Gi), window.addEventListener("pointercancel", Gi));
|
|
861
|
+
}
|
|
862
|
+
function Wi(e) {
|
|
863
|
+
if (!V) return;
|
|
864
|
+
let t = (e.clientX - V.startClientX) / V.thumbTravel * V.maxScrollLeft;
|
|
865
|
+
Bi(V.startScrollLeft + t);
|
|
866
|
+
}
|
|
867
|
+
function Gi() {
|
|
868
|
+
if (!V || !X()) {
|
|
869
|
+
V = void 0, Gt.value = !1;
|
|
870
|
+
return;
|
|
871
|
+
}
|
|
872
|
+
V = void 0, Gt.value = !1, document.documentElement.style.cursor = un, document.documentElement.style.userSelect = dn, window.removeEventListener("pointermove", Wi), window.removeEventListener("pointerup", Gi), window.removeEventListener("pointercancel", Gi);
|
|
873
|
+
}
|
|
874
|
+
function Ki(e) {
|
|
875
|
+
k.value && (k.value.scrollTo(Math.max(0, e)), It.value = k.value.viewport?.scrollTop ?? 0, $());
|
|
876
|
+
}
|
|
877
|
+
function qi() {
|
|
878
|
+
if (L?.disconnect(), L = void 0, !X() || typeof ResizeObserver > "u") {
|
|
879
|
+
$(), window.addEventListener("resize", $);
|
|
880
|
+
return;
|
|
881
|
+
}
|
|
882
|
+
L = new ResizeObserver($), k.value?.viewport && L.observe(k.value.viewport), ht.value && L.observe(ht.value), $();
|
|
883
|
+
}
|
|
884
|
+
x(() => [st.value, C.virtualRowHeight], () => {
|
|
885
|
+
Lt.value = 0, mt.invalidate();
|
|
886
|
+
}, { flush: "sync" }), x(J, () => mt.invalidate());
|
|
887
|
+
function Ji(e) {
|
|
888
|
+
if (!J.value || !X()) return;
|
|
889
|
+
let t = H.value;
|
|
890
|
+
for (let n of e) {
|
|
891
|
+
let e = n.closest(".bing-table__cell-content");
|
|
892
|
+
if (!e?.parentElement) continue;
|
|
893
|
+
let r = window.getComputedStyle(e), i = (Number.parseFloat(r.paddingTop) || 0) + (Number.parseFloat(r.paddingBottom) || 0), a = Math.max(0, ...Array.from(e.children).map((e) => e.getBoundingClientRect().height)), ee = Number.parseFloat(window.getComputedStyle(e.parentElement).borderBottomWidth) || 0;
|
|
894
|
+
t = Math.max(t, Math.ceil(a + i + ee));
|
|
895
|
+
}
|
|
896
|
+
if (t <= H.value) return;
|
|
897
|
+
let n = It.value / H.value;
|
|
898
|
+
return () => {
|
|
899
|
+
Lt.value = t, ve(() => {
|
|
900
|
+
let e = k.value?.viewport;
|
|
901
|
+
e && (e.scrollTop = n * t, It.value = e.scrollTop);
|
|
902
|
+
});
|
|
903
|
+
};
|
|
904
|
+
}
|
|
905
|
+
function Yi(e) {
|
|
906
|
+
if (clearTimeout(D), D = void 0, e) {
|
|
907
|
+
T.value || (D = setTimeout(() => {
|
|
908
|
+
D = void 0, ft = Date.now(), T.value = !0;
|
|
909
|
+
}, Qe));
|
|
910
|
+
return;
|
|
911
|
+
}
|
|
912
|
+
let t = $e - (Date.now() - ft);
|
|
913
|
+
T.value && t > 0 ? D = setTimeout(() => {
|
|
914
|
+
D = void 0, T.value = !1;
|
|
915
|
+
}, t) : T.value = !1;
|
|
916
|
+
}
|
|
917
|
+
return x(() => [
|
|
918
|
+
E.value,
|
|
919
|
+
C.data,
|
|
920
|
+
C.total
|
|
921
|
+
], ([e, t, n]) => {
|
|
922
|
+
e || (ct.value = t, lt.value = n);
|
|
923
|
+
}), x(E, (e) => {
|
|
924
|
+
if (e) {
|
|
925
|
+
let e = O.value?.getBoundingClientRect().height ?? 0;
|
|
926
|
+
ut.value = e > 0 ? e : null, Ni(), F.value = null, Kt.value = !1, Ai();
|
|
927
|
+
} else ut.value = null;
|
|
928
|
+
}), x(() => [
|
|
929
|
+
C.defaultExpandAll,
|
|
930
|
+
dt.value,
|
|
931
|
+
C.childrenKey
|
|
932
|
+
], () => {
|
|
933
|
+
C.defaultExpandAll && C.expandedRowKeys === void 0 && (yt.value = Nn.value.filter((e) => e.hasChildren).map((e) => e.key)), yi();
|
|
934
|
+
}, {
|
|
935
|
+
deep: !0,
|
|
936
|
+
immediate: !0
|
|
937
|
+
}), x(Kn, () => {
|
|
938
|
+
Ii();
|
|
939
|
+
}, { flush: "pre" }), x(() => [
|
|
940
|
+
W.value,
|
|
941
|
+
G.value,
|
|
942
|
+
q.value.length
|
|
943
|
+
], () => {
|
|
944
|
+
Ki(0), yi();
|
|
945
|
+
}), x(Yn, () => {
|
|
946
|
+
yi();
|
|
947
|
+
}), x(jn, (e) => {
|
|
948
|
+
W.value > e && pi(e);
|
|
949
|
+
}), be(() => {
|
|
950
|
+
x(() => C.loading, Yi, { immediate: !0 }), ve(() => {
|
|
951
|
+
qi(), yi();
|
|
952
|
+
});
|
|
953
|
+
}), ye(() => {
|
|
954
|
+
clearTimeout(D), ci(), $r(), nn = void 0, ii(), oi(), Gi(), L?.disconnect(), L = void 0, R !== void 0 && X() && (window.cancelAnimationFrame(R), R = void 0), Ni(), Si(), Ei(), X() && window.removeEventListener("resize", $);
|
|
955
|
+
}), rt({
|
|
956
|
+
clearSelection: Wr,
|
|
957
|
+
toggleRowSelection: Hr,
|
|
958
|
+
toggleRowExpansion: Kr,
|
|
959
|
+
resetColumns: jt,
|
|
960
|
+
scrollTo: Ki
|
|
961
|
+
}), (e, t) => (g(), u("section", {
|
|
962
|
+
ref_key: "rootRef",
|
|
963
|
+
ref: pt,
|
|
964
|
+
class: m(hn.value),
|
|
965
|
+
style: h(gn.value),
|
|
966
|
+
"aria-busy": E.value
|
|
967
|
+
}, [
|
|
968
|
+
e.$slots.toolbar ? (g(), u("div", Pe, [d("div", Fe, [Se(e.$slots, "toolbar", {
|
|
969
|
+
selectedRowKeys: wn.value,
|
|
970
|
+
visibleColumns: b(A)
|
|
971
|
+
}, void 0, !0)])])) : l("", !0),
|
|
972
|
+
d("div", {
|
|
973
|
+
ref_key: "frameRef",
|
|
974
|
+
ref: O,
|
|
975
|
+
class: m(["bing-table__frame", { "is-height-animating": Kt.value }]),
|
|
976
|
+
style: h(yn.value),
|
|
977
|
+
onTransitionend: Li
|
|
978
|
+
}, [
|
|
979
|
+
f(b(Ee), {
|
|
980
|
+
sensors: $t,
|
|
981
|
+
plugins: en,
|
|
982
|
+
onDragStart: ui,
|
|
983
|
+
onDragMove: di,
|
|
984
|
+
onDragEnd: fi
|
|
985
|
+
}, {
|
|
986
|
+
default: S(() => [f(ie, {
|
|
987
|
+
ref_key: "scrollRef",
|
|
988
|
+
ref: k,
|
|
989
|
+
class: "bing-table__scroll",
|
|
990
|
+
height: _n.value,
|
|
991
|
+
"max-height": vn.value,
|
|
992
|
+
"overflow-tolerance": Ze,
|
|
993
|
+
smooth: p.smoothScroll,
|
|
994
|
+
horizontal: "",
|
|
995
|
+
vertical: "",
|
|
996
|
+
always: "",
|
|
997
|
+
"aria-label": p.ariaLabel,
|
|
998
|
+
inert: E.value,
|
|
999
|
+
onScroll: _i
|
|
1000
|
+
}, {
|
|
1001
|
+
default: S(() => [d("table", {
|
|
1002
|
+
class: "bing-table__table",
|
|
1003
|
+
style: h({ minWidth: `${Yn.value}px` })
|
|
1004
|
+
}, [
|
|
1005
|
+
d("colgroup", null, [p.selectable ? (g(), u("col", {
|
|
1006
|
+
key: 0,
|
|
1007
|
+
style: h({ width: `${U.value}px` })
|
|
1008
|
+
}, null, 4)) : l("", !0), (g(!0), u(s, null, v(b(A), (e) => (g(), u("col", {
|
|
1009
|
+
key: e.key,
|
|
1010
|
+
style: h({ width: br(e) })
|
|
1011
|
+
}, null, 4))), 128))]),
|
|
1012
|
+
d("thead", Ie, [d("tr", null, [p.selectable ? (g(), u("th", {
|
|
1013
|
+
key: 0,
|
|
1014
|
+
class: m(["bing-table__selection-cell bing-table__selection-cell--head", { "is-fixed-left": fr.value }]),
|
|
1015
|
+
style: h(wr()),
|
|
1016
|
+
scope: "col"
|
|
1017
|
+
}, [p.selectionMode === "multiple" ? (g(), he(ae, {
|
|
1018
|
+
key: 0,
|
|
1019
|
+
size: "sm",
|
|
1020
|
+
"model-value": Rn.value,
|
|
1021
|
+
indeterminate: zn.value,
|
|
1022
|
+
"aria-label": "选择当前页的所有行",
|
|
1023
|
+
onChange: Ur
|
|
1024
|
+
}, null, 8, ["model-value", "indeterminate"])) : l("", !0)], 6)) : l("", !0), (g(!0), u(s, null, v(b(A), (t, n) => (g(), he(Ce(p.reorderableColumns ? le : "th"), _e({ key: t.key }, { ref_for: !0 }, p.reorderableColumns ? {
|
|
1025
|
+
columnKey: t.key,
|
|
1026
|
+
index: n
|
|
1027
|
+
} : {}, {
|
|
1028
|
+
"data-bing-table-sortable-key": t.key,
|
|
1029
|
+
class: ["bing-table__header-cell", Tr(t, !0)],
|
|
1030
|
+
style: Sr(t, !0),
|
|
1031
|
+
scope: "col"
|
|
1032
|
+
}), {
|
|
1033
|
+
default: S(() => [f(ue, {
|
|
1034
|
+
column: t,
|
|
1035
|
+
reorderable: p.reorderableColumns,
|
|
1036
|
+
resizable: Xr(t),
|
|
1037
|
+
"sort-order": On.value === t.key ? kn.value : null,
|
|
1038
|
+
onSort: (e) => qr(t),
|
|
1039
|
+
onResizeStart: (e) => Zr(t, e),
|
|
1040
|
+
onResizeKeydown: (e) => ni(t, e)
|
|
1041
|
+
}, {
|
|
1042
|
+
default: S(() => [Se(e.$slots, `header-${t.key}`, { column: t }, () => [ge(y(t.title || t.key), 1)], !0)]),
|
|
1043
|
+
_: 2
|
|
1044
|
+
}, 1032, [
|
|
1045
|
+
"column",
|
|
1046
|
+
"reorderable",
|
|
1047
|
+
"resizable",
|
|
1048
|
+
"sort-order",
|
|
1049
|
+
"onSort",
|
|
1050
|
+
"onResizeStart",
|
|
1051
|
+
"onResizeKeydown"
|
|
1052
|
+
])]),
|
|
1053
|
+
_: 2
|
|
1054
|
+
}, 1040, [
|
|
1055
|
+
"data-bing-table-sortable-key",
|
|
1056
|
+
"class",
|
|
1057
|
+
"style"
|
|
1058
|
+
]))), 128))])]),
|
|
1059
|
+
!Fn.value.length || !b(A).length ? (g(), u("tbody", Le, [d("tr", null, [d("td", {
|
|
1060
|
+
class: "bing-table__state-cell",
|
|
1061
|
+
colspan: Cn.value
|
|
1062
|
+
}, [E.value ? l("", !0) : (g(), u("span", ze, y(p.emptyText), 1))], 8, Re)])])) : (g(), u("tbody", Be, [
|
|
1063
|
+
J.value && qn.value > 0 ? (g(), u("tr", Ve, [d("td", {
|
|
1064
|
+
colspan: Cn.value,
|
|
1065
|
+
style: h({ height: `${qn.value}px` })
|
|
1066
|
+
}, null, 12, He)])) : l("", !0),
|
|
1067
|
+
(g(!0), u(s, null, v(Hn.value, (n) => (g(), u("tr", {
|
|
1068
|
+
key: n.key,
|
|
1069
|
+
class: m(["bing-table__row", Rr(n)]),
|
|
1070
|
+
"aria-selected": p.selectable ? Tn.value.has(n.key) : void 0,
|
|
1071
|
+
onClick: (e) => gi(n, e)
|
|
1072
|
+
}, [p.selectable ? (g(), u("td", {
|
|
1073
|
+
key: 0,
|
|
1074
|
+
class: m(["bing-table__selection-cell", { "is-fixed-left": fr.value }]),
|
|
1075
|
+
style: h(wr())
|
|
1076
|
+
}, [d("span", {
|
|
1077
|
+
class: "bing-table__selection-wrap",
|
|
1078
|
+
onClick: t[0] ||= Te(() => {}, ["stop"])
|
|
1079
|
+
}, [f(ae, {
|
|
1080
|
+
size: "sm",
|
|
1081
|
+
"model-value": Tn.value.has(n.key),
|
|
1082
|
+
disabled: n.disabled,
|
|
1083
|
+
"aria-label": `选择行 ${n.key}`,
|
|
1084
|
+
onChange: (e) => Hr(n.key, e)
|
|
1085
|
+
}, null, 8, [
|
|
1086
|
+
"model-value",
|
|
1087
|
+
"disabled",
|
|
1088
|
+
"aria-label",
|
|
1089
|
+
"onChange"
|
|
1090
|
+
])])], 6)) : l("", !0), (g(!0), u(s, null, v(b(A), (t) => (g(), u("td", {
|
|
1091
|
+
key: t.key,
|
|
1092
|
+
class: m(["bing-table__cell", Tr(t)]),
|
|
1093
|
+
style: h(Sr(t))
|
|
1094
|
+
}, [d("div", {
|
|
1095
|
+
class: m(["bing-table__cell-content", { "is-tree-cell": Br(t) }]),
|
|
1096
|
+
style: h(Br(t) ? { paddingLeft: `calc(var(--bing-table-cell-padding-x) + ${n.level * mn.value}px)` } : void 0)
|
|
1097
|
+
}, [Br(t) && n.hasChildren ? (g(), he(r, {
|
|
1098
|
+
key: 0,
|
|
1099
|
+
variant: "ghost",
|
|
1100
|
+
size: "xs",
|
|
1101
|
+
rounded: "sm",
|
|
1102
|
+
throttle: !1,
|
|
1103
|
+
class: "bing-table__expander",
|
|
1104
|
+
"aria-expanded": n.expanded,
|
|
1105
|
+
"aria-label": n.expanded ? "收起行" : "展开行",
|
|
1106
|
+
onClick: Te((e) => Kr(n.key), ["stop"])
|
|
1107
|
+
}, {
|
|
1108
|
+
prefix: S(() => [f(o, {
|
|
1109
|
+
icon: n.expanded ? b(i) : b(ee),
|
|
1110
|
+
size: "xs",
|
|
1111
|
+
"stroke-width": 1.75
|
|
1112
|
+
}, null, 8, ["icon"])]),
|
|
1113
|
+
_: 2
|
|
1114
|
+
}, 1032, [
|
|
1115
|
+
"aria-expanded",
|
|
1116
|
+
"aria-label",
|
|
1117
|
+
"onClick"
|
|
1118
|
+
])) : Br(t) ? (g(), u("span", We)) : l("", !0), f(pe, {
|
|
1119
|
+
ellipsis: t.ellipsis !== !1,
|
|
1120
|
+
disabled: E.value
|
|
1121
|
+
}, {
|
|
1122
|
+
default: S(() => [Se(e.$slots, `cell-${t.key}`, {
|
|
1123
|
+
row: n.row,
|
|
1124
|
+
column: t,
|
|
1125
|
+
value: Fr(n.row, t),
|
|
1126
|
+
rowIndex: n.index,
|
|
1127
|
+
level: n.level
|
|
1128
|
+
}, () => [Se(e.$slots, "cell", {
|
|
1129
|
+
row: n.row,
|
|
1130
|
+
column: t,
|
|
1131
|
+
value: Fr(n.row, t),
|
|
1132
|
+
rowIndex: n.index,
|
|
1133
|
+
level: n.level
|
|
1134
|
+
}, () => [ge(y(Ir(Fr(n.row, t))), 1)], !0)], !0)]),
|
|
1135
|
+
_: 2
|
|
1136
|
+
}, 1032, ["ellipsis", "disabled"])], 6)], 6))), 128))], 10, Ue))), 128)),
|
|
1137
|
+
(g(!0), u(s, null, v(Gn.value, (e) => (g(), u("tr", {
|
|
1138
|
+
key: `__bing-page-filler-${e}`,
|
|
1139
|
+
class: m(["bing-table__row bing-table__row--filler", { "is-striped-row": zr(e) }]),
|
|
1140
|
+
"aria-hidden": "true"
|
|
1141
|
+
}, [p.selectable ? (g(), u("td", {
|
|
1142
|
+
key: 0,
|
|
1143
|
+
class: m(["bing-table__selection-cell", { "is-fixed-left": fr.value }]),
|
|
1144
|
+
style: h(wr())
|
|
1145
|
+
}, [...t[10] ||= [d("span", { class: "bing-table__selection-placeholder" }, null, -1)]], 6)) : l("", !0), (g(!0), u(s, null, v(b(A), (e) => (g(), u("td", {
|
|
1146
|
+
key: e.key,
|
|
1147
|
+
class: m(["bing-table__cell", Tr(e)]),
|
|
1148
|
+
style: h(Sr(e))
|
|
1149
|
+
}, [...t[11] ||= [d("div", {
|
|
1150
|
+
class: "bing-table__cell-content",
|
|
1151
|
+
"aria-hidden": "true"
|
|
1152
|
+
}, null, -1)]], 6))), 128))], 2))), 128)),
|
|
1153
|
+
J.value && Jn.value > 0 ? (g(), u("tr", Ge, [d("td", {
|
|
1154
|
+
colspan: Cn.value,
|
|
1155
|
+
style: h({ height: `${Jn.value}px` })
|
|
1156
|
+
}, null, 12, Ke)])) : l("", !0)
|
|
1157
|
+
]))
|
|
1158
|
+
], 4)]),
|
|
1159
|
+
_: 3
|
|
1160
|
+
}, 8, [
|
|
1161
|
+
"height",
|
|
1162
|
+
"max-height",
|
|
1163
|
+
"smooth",
|
|
1164
|
+
"aria-label",
|
|
1165
|
+
"inert"
|
|
1166
|
+
]), f(b(De), {
|
|
1167
|
+
class: "bing-table__column-drag-overlay",
|
|
1168
|
+
"drop-animation": Qt,
|
|
1169
|
+
style: h({
|
|
1170
|
+
"--bing-table-column-drop-duration": `${Qt.duration}ms`,
|
|
1171
|
+
"--bing-table-column-drop-easing": Qt.easing
|
|
1172
|
+
})
|
|
1173
|
+
}, {
|
|
1174
|
+
default: S(({ source: t }) => [t ? (g(), u("div", {
|
|
1175
|
+
key: 0,
|
|
1176
|
+
class: m(["bing-table__header-cell bing-table__column-drag-card", [Tr(b(Tt)(String(t.id)) ?? { key: String(t.id) }, !0), { "is-landing": !P.value }]]),
|
|
1177
|
+
"aria-hidden": "true",
|
|
1178
|
+
inert: ""
|
|
1179
|
+
}, [f(ue, {
|
|
1180
|
+
column: b(Tt)(String(t.id)) ?? { key: String(t.id) },
|
|
1181
|
+
"sort-order": On.value === String(t.id) ? kn.value : null,
|
|
1182
|
+
preview: ""
|
|
1183
|
+
}, {
|
|
1184
|
+
default: S(({ column: t }) => [Se(e.$slots, `header-${t.key}`, { column: t }, () => [ge(y(t.title || t.key), 1)], !0)]),
|
|
1185
|
+
_: 3
|
|
1186
|
+
}, 8, ["column", "sort-order"])], 2)) : l("", !0)]),
|
|
1187
|
+
_: 3
|
|
1188
|
+
}, 8, ["style"])]),
|
|
1189
|
+
_: 3
|
|
1190
|
+
}),
|
|
1191
|
+
d("div", {
|
|
1192
|
+
class: m(["bing-table__horizontal-scrollbar", {
|
|
1193
|
+
"is-visible": ur.value,
|
|
1194
|
+
"is-dragging": Gt.value
|
|
1195
|
+
}]),
|
|
1196
|
+
"aria-hidden": "true"
|
|
1197
|
+
}, [d("div", {
|
|
1198
|
+
ref_key: "horizontalRailRef",
|
|
1199
|
+
ref: ht,
|
|
1200
|
+
class: "bing-table__horizontal-rail",
|
|
1201
|
+
onPointerdown: Hi
|
|
1202
|
+
}, [d("div", {
|
|
1203
|
+
class: "bing-table__horizontal-thumb",
|
|
1204
|
+
style: h(dr.value),
|
|
1205
|
+
onPointerdown: Ui
|
|
1206
|
+
}, null, 36)], 544)], 2),
|
|
1207
|
+
or.value ? (g(), u("div", {
|
|
1208
|
+
key: 0,
|
|
1209
|
+
class: "bing-table__fixed-mask bing-table__fixed-mask--left",
|
|
1210
|
+
style: h(ir.value),
|
|
1211
|
+
"aria-hidden": "true"
|
|
1212
|
+
}, null, 4)) : l("", !0),
|
|
1213
|
+
sr.value ? (g(), u("div", {
|
|
1214
|
+
key: 1,
|
|
1215
|
+
class: "bing-table__fixed-mask bing-table__fixed-mask--right",
|
|
1216
|
+
style: h(ar.value),
|
|
1217
|
+
"aria-hidden": "true"
|
|
1218
|
+
}, null, 4)) : l("", !0),
|
|
1219
|
+
cr.value ? (g(), u("div", {
|
|
1220
|
+
key: 2,
|
|
1221
|
+
class: "bing-table__fixed-shadow bing-table__fixed-shadow--left",
|
|
1222
|
+
style: h(nr.value),
|
|
1223
|
+
"aria-hidden": "true"
|
|
1224
|
+
}, null, 4)) : l("", !0),
|
|
1225
|
+
lr.value ? (g(), u("div", {
|
|
1226
|
+
key: 3,
|
|
1227
|
+
class: "bing-table__fixed-shadow bing-table__fixed-shadow--right",
|
|
1228
|
+
style: h(rr.value),
|
|
1229
|
+
"aria-hidden": "true"
|
|
1230
|
+
}, null, 4)) : l("", !0),
|
|
1231
|
+
E.value ? (g(), u("div", {
|
|
1232
|
+
key: 4,
|
|
1233
|
+
class: m(["bing-table__loading-overlay", { "is-visible": T.value }])
|
|
1234
|
+
}, [T.value ? (g(), u("span", qe, [d("span", Je, [f(o, {
|
|
1235
|
+
icon: b(re),
|
|
1236
|
+
size: "sm",
|
|
1237
|
+
"stroke-width": 1.75
|
|
1238
|
+
}, null, 8, ["icon"])]), ge(" " + y(p.loadingText), 1)])) : l("", !0)], 2)) : l("", !0)
|
|
1239
|
+
], 38),
|
|
1240
|
+
p.pagination || p.showColumnControls ? (g(), u("footer", {
|
|
1241
|
+
key: 1,
|
|
1242
|
+
ref_key: "paginationRef",
|
|
1243
|
+
ref: gt,
|
|
1244
|
+
class: m(["bing-table__pagination", { "is-layout-floating": Jt.value }]),
|
|
1245
|
+
style: h(Xt.value)
|
|
1246
|
+
}, [
|
|
1247
|
+
p.showColumnControls ? (g(), he(ce, {
|
|
1248
|
+
key: 0,
|
|
1249
|
+
open: _t.value,
|
|
1250
|
+
"onUpdate:open": t[1] ||= (e) => _t.value = e,
|
|
1251
|
+
placement: "top-start",
|
|
1252
|
+
columns: p.columns,
|
|
1253
|
+
"column-widths": p.columnWidths ?? b(bt),
|
|
1254
|
+
"default-column-widths": p.defaultColumnWidths,
|
|
1255
|
+
"column-order": b(Ct),
|
|
1256
|
+
"default-column-order": p.defaultColumnOrder,
|
|
1257
|
+
"hidden-column-keys": [...b(wt)],
|
|
1258
|
+
"default-hidden-column-keys": p.defaultHiddenColumnKeys,
|
|
1259
|
+
"column-fixed": p.columnFixed ?? b(xt),
|
|
1260
|
+
"default-column-fixed": p.defaultColumnFixed,
|
|
1261
|
+
"reorderable-columns": p.reorderableColumns,
|
|
1262
|
+
"smooth-scroll": p.smoothScroll,
|
|
1263
|
+
"onUpdate:columnWidths": b(Ot),
|
|
1264
|
+
"onUpdate:columnOrder": b(Dt),
|
|
1265
|
+
"onUpdate:hiddenColumnKeys": b(kt),
|
|
1266
|
+
"onUpdate:columnFixed": b(Et),
|
|
1267
|
+
onColumnReorder: t[2] ||= (e) => w("column-reorder", e),
|
|
1268
|
+
onColumnVisibilityChange: t[3] ||= (e) => w("column-visibility-change", e),
|
|
1269
|
+
onColumnFixedChange: t[4] ||= (e) => w("column-fixed-change", e),
|
|
1270
|
+
onDragStart: t[5] ||= (e) => P.value = String(e.key),
|
|
1271
|
+
onDragEnd: ci
|
|
1272
|
+
}, null, 8, [
|
|
1273
|
+
"open",
|
|
1274
|
+
"columns",
|
|
1275
|
+
"column-widths",
|
|
1276
|
+
"default-column-widths",
|
|
1277
|
+
"column-order",
|
|
1278
|
+
"default-column-order",
|
|
1279
|
+
"hidden-column-keys",
|
|
1280
|
+
"default-hidden-column-keys",
|
|
1281
|
+
"column-fixed",
|
|
1282
|
+
"default-column-fixed",
|
|
1283
|
+
"reorderable-columns",
|
|
1284
|
+
"smooth-scroll",
|
|
1285
|
+
"onUpdate:columnWidths",
|
|
1286
|
+
"onUpdate:columnOrder",
|
|
1287
|
+
"onUpdate:hiddenColumnKeys",
|
|
1288
|
+
"onUpdate:columnFixed"
|
|
1289
|
+
])) : l("", !0),
|
|
1290
|
+
p.pagination ? (g(), u("span", Ye, y(_r.value), 1)) : l("", !0),
|
|
1291
|
+
p.pagination ? (g(), u("label", Xe, [t[12] ||= d("span", null, "每页条数", -1), f(oe, {
|
|
1292
|
+
class: "bing-table__page-size-select",
|
|
1293
|
+
"model-value": G.value,
|
|
1294
|
+
options: gr.value,
|
|
1295
|
+
clearable: !1,
|
|
1296
|
+
"show-select-all": !1,
|
|
1297
|
+
searchable: !1,
|
|
1298
|
+
width: 88,
|
|
1299
|
+
"min-width": 0,
|
|
1300
|
+
disabled: E.value,
|
|
1301
|
+
size: "sm",
|
|
1302
|
+
"aria-label": "每页条数",
|
|
1303
|
+
"onUpdate:modelValue": hi
|
|
1304
|
+
}, null, 8, [
|
|
1305
|
+
"model-value",
|
|
1306
|
+
"options",
|
|
1307
|
+
"disabled"
|
|
1308
|
+
])])) : l("", !0),
|
|
1309
|
+
p.pagination ? (g(), he(me, {
|
|
1310
|
+
key: 3,
|
|
1311
|
+
name: "bing-table-page",
|
|
1312
|
+
tag: "div",
|
|
1313
|
+
class: "bing-table__pager",
|
|
1314
|
+
"aria-label": "分页"
|
|
1315
|
+
}, {
|
|
1316
|
+
default: S(() => [
|
|
1317
|
+
f(r, {
|
|
1318
|
+
variant: "ghost",
|
|
1319
|
+
size: "xs",
|
|
1320
|
+
rounded: "sm",
|
|
1321
|
+
throttle: !1,
|
|
1322
|
+
key: "first",
|
|
1323
|
+
class: "bing-table__page-button",
|
|
1324
|
+
disabled: E.value || Y.value.page <= 1,
|
|
1325
|
+
"aria-label": "首页",
|
|
1326
|
+
onClick: t[6] ||= (e) => pi(1)
|
|
1327
|
+
}, {
|
|
1328
|
+
prefix: S(() => [f(o, {
|
|
1329
|
+
icon: b(te),
|
|
1330
|
+
size: "xs",
|
|
1331
|
+
"stroke-width": 1.75
|
|
1332
|
+
}, null, 8, ["icon"])]),
|
|
1333
|
+
_: 1
|
|
1334
|
+
}, 8, ["disabled"]),
|
|
1335
|
+
f(r, {
|
|
1336
|
+
variant: "ghost",
|
|
1337
|
+
size: "xs",
|
|
1338
|
+
rounded: "sm",
|
|
1339
|
+
throttle: !1,
|
|
1340
|
+
key: "previous",
|
|
1341
|
+
class: "bing-table__page-button",
|
|
1342
|
+
disabled: E.value || Y.value.page <= 1,
|
|
1343
|
+
"aria-label": "上一页",
|
|
1344
|
+
onClick: t[7] ||= (e) => pi(W.value - 1)
|
|
1345
|
+
}, {
|
|
1346
|
+
prefix: S(() => [f(o, {
|
|
1347
|
+
icon: b(a),
|
|
1348
|
+
size: "xs",
|
|
1349
|
+
"stroke-width": 1.75
|
|
1350
|
+
}, null, 8, ["icon"])]),
|
|
1351
|
+
_: 1
|
|
1352
|
+
}, 8, ["disabled"]),
|
|
1353
|
+
(g(!0), u(s, null, v(Y.value.pageNumbers, (e) => (g(), he(r, {
|
|
1354
|
+
variant: "ghost",
|
|
1355
|
+
size: "xs",
|
|
1356
|
+
rounded: "sm",
|
|
1357
|
+
throttle: !1,
|
|
1358
|
+
key: `page-${e}`,
|
|
1359
|
+
class: m(["bing-table__page-button", { "is-active": e === Y.value.page }]),
|
|
1360
|
+
"aria-current": e === Y.value.page ? "page" : void 0,
|
|
1361
|
+
disabled: E.value,
|
|
1362
|
+
onClick: (t) => pi(e)
|
|
1363
|
+
}, {
|
|
1364
|
+
default: S(() => [ge(y(e), 1)]),
|
|
1365
|
+
_: 2
|
|
1366
|
+
}, 1032, [
|
|
1367
|
+
"class",
|
|
1368
|
+
"aria-current",
|
|
1369
|
+
"disabled",
|
|
1370
|
+
"onClick"
|
|
1371
|
+
]))), 128)),
|
|
1372
|
+
f(r, {
|
|
1373
|
+
variant: "ghost",
|
|
1374
|
+
size: "xs",
|
|
1375
|
+
rounded: "sm",
|
|
1376
|
+
throttle: !1,
|
|
1377
|
+
key: "next",
|
|
1378
|
+
class: "bing-table__page-button",
|
|
1379
|
+
disabled: E.value || Y.value.page >= Y.value.pageCount,
|
|
1380
|
+
"aria-label": "下一页",
|
|
1381
|
+
onClick: t[8] ||= (e) => pi(W.value + 1)
|
|
1382
|
+
}, {
|
|
1383
|
+
prefix: S(() => [f(o, {
|
|
1384
|
+
icon: b(ee),
|
|
1385
|
+
size: "xs",
|
|
1386
|
+
"stroke-width": 1.75
|
|
1387
|
+
}, null, 8, ["icon"])]),
|
|
1388
|
+
_: 1
|
|
1389
|
+
}, 8, ["disabled"]),
|
|
1390
|
+
f(r, {
|
|
1391
|
+
variant: "ghost",
|
|
1392
|
+
size: "xs",
|
|
1393
|
+
rounded: "sm",
|
|
1394
|
+
throttle: !1,
|
|
1395
|
+
key: "last",
|
|
1396
|
+
class: "bing-table__page-button",
|
|
1397
|
+
disabled: E.value || Y.value.page >= Y.value.pageCount,
|
|
1398
|
+
"aria-label": "末页",
|
|
1399
|
+
onClick: t[9] ||= (e) => pi(jn.value)
|
|
1400
|
+
}, {
|
|
1401
|
+
prefix: S(() => [f(o, {
|
|
1402
|
+
icon: b(ne),
|
|
1403
|
+
size: "xs",
|
|
1404
|
+
"stroke-width": 1.75
|
|
1405
|
+
}, null, 8, ["icon"])]),
|
|
1406
|
+
_: 1
|
|
1407
|
+
}, 8, ["disabled"])
|
|
1408
|
+
]),
|
|
1409
|
+
_: 1
|
|
1410
|
+
})) : l("", !0)
|
|
1411
|
+
], 6)) : l("", !0)
|
|
1412
|
+
], 14, Ne));
|
|
1413
|
+
}
|
|
1414
|
+
});
|
|
1415
|
+
//#endregion
|
|
1416
|
+
export { rt as default };
|