ep-craft 0.1.37 → 0.1.38
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/dist/components/badge/index.js +6 -5
- package/dist/components/calendar/EpCalendar.vue.d.ts +50 -0
- package/dist/components/calendar/EpCalendar.vue.js +154 -0
- package/dist/components/calendar/EpCalendar2.vue.js +4 -0
- package/dist/components/calendar/EpDateTable.vue.d.ts +27 -0
- package/dist/components/calendar/EpDateTable.vue.js +89 -0
- package/dist/components/calendar/EpDateTable2.vue.js +4 -0
- package/dist/components/calendar/EpSelectController.vue.d.ts +8 -0
- package/dist/components/calendar/EpSelectController.vue.js +88 -0
- package/dist/components/calendar/EpSelectController2.vue.js +4 -0
- package/dist/components/calendar/calendar.d.ts +54 -0
- package/dist/components/calendar/calendar.js +45 -0
- package/dist/components/calendar/date-table.d.ts +53 -0
- package/dist/components/calendar/date-table.js +41 -0
- package/dist/components/calendar/index.d.ts +13 -2
- package/dist/components/calendar/index.js +9 -4
- package/dist/components/calendar/instance.d.ts +5 -0
- package/dist/components/calendar/select-controller.d.ts +31 -0
- package/dist/components/calendar/select-controller.js +21 -0
- package/dist/components/calendar/use-calendar.d.ts +13 -0
- package/dist/components/calendar/use-calendar.js +84 -0
- package/dist/components/calendar/use-date-table.d.ts +18 -0
- package/dist/components/calendar/use-date-table.js +99 -0
- package/dist/components/carousel/EpCarousel.vue.d.ts +1 -1
- package/dist/components/cascader/EpCascader.vue.d.ts +4 -4
- package/dist/components/config-provider/index.js +5 -4
- package/dist/components/config-provider/src/config-provider-props.d.ts +3 -6
- package/dist/components/config-provider/src/config-provider-props.js +1 -1
- package/dist/components/config-provider/src/hooks/use-global-config.js +75 -47
- package/dist/components/date-picker-panel/src/composables/use-basic-date-table.d.ts +1 -1
- package/dist/components/date-picker-panel/src/date-picker-panel.d.ts +1 -1
- package/dist/components/dialog/EpDialog.vue.d.ts +61 -0
- package/dist/components/dialog/EpDialog.vue.js +214 -0
- package/dist/components/dialog/EpDialog2.vue.js +4 -0
- package/dist/components/dialog/EpDialogContent.vue.d.ts +31 -0
- package/dist/components/dialog/EpDialogContent.vue.js +108 -0
- package/dist/components/dialog/EpDialogContent2.vue.js +4 -0
- package/dist/components/dialog/constants.d.ts +12 -0
- package/dist/components/dialog/constants.js +5 -0
- package/dist/components/dialog/dialog-content.d.ts +84 -0
- package/dist/components/dialog/dialog-content.js +90 -0
- package/dist/components/dialog/dialog.d.ts +173 -0
- package/dist/components/dialog/dialog.js +156 -0
- package/dist/components/dialog/index.d.ts +20 -2
- package/dist/components/dialog/index.js +24 -4
- package/dist/components/dialog/instance.d.ts +2 -0
- package/dist/components/dialog/use-dialog.d.ts +35 -0
- package/dist/components/dialog/use-dialog.js +176 -0
- package/dist/components/drawer/EpDrawer.vue.d.ts +67 -0
- package/dist/components/drawer/EpDrawer.vue.js +234 -0
- package/dist/components/drawer/EpDrawer2.vue.js +4 -0
- package/dist/components/drawer/drawer.d.ts +105 -0
- package/dist/components/drawer/drawer.js +42 -0
- package/dist/components/drawer/index.d.ts +14 -2
- package/dist/components/drawer/index.js +9 -4
- package/dist/components/drawer/instance.d.ts +2 -0
- package/dist/components/drawer/useResizable.d.ts +7 -0
- package/dist/components/drawer/useResizable.js +50 -0
- package/dist/components/dropdown/src/dropdown-item-impl2.vue.js +2 -2
- package/dist/components/dropdown/src/dropdown-item2.vue.js +2 -2
- package/dist/components/dropdown/src/dropdown-menu2.vue.js +2 -2
- package/dist/components/dropdown/src/dropdown2.vue.js +2 -2
- package/dist/components/empty/index.js +2 -1
- package/dist/components/form/index.js +11 -9
- package/dist/components/form/src/form-item.js +5 -5
- package/dist/components/form/src/form.js +5 -6
- package/dist/components/form-item/index.js +6 -5
- package/dist/components/infinite-scroll/index.d.ts +26 -0
- package/dist/components/infinite-scroll/index.js +15 -0
- package/dist/components/infinite-scroll/src/index.d.ts +20 -0
- package/dist/components/infinite-scroll/src/index.js +109 -0
- package/dist/components/loading/index.d.ts +15 -0
- package/dist/components/loading/index.js +13 -0
- package/dist/components/loading/src/directive.d.ts +13 -0
- package/dist/components/loading/src/directive.js +62 -0
- package/dist/components/loading/src/loading.d.ts +34 -0
- package/dist/components/loading/src/loading.js +121 -0
- package/dist/components/loading/src/service.d.ts +8 -0
- package/dist/components/loading/src/service.js +67 -0
- package/dist/components/loading/src/types.d.ts +47 -0
- package/dist/components/message/index.d.ts +3 -0
- package/dist/components/message/index.js +18 -0
- package/dist/components/message/src/instance.d.ts +18 -0
- package/dist/components/message/src/instance.js +18 -0
- package/dist/components/message/src/message.d.ts +175 -0
- package/dist/components/message/src/message.js +160 -0
- package/dist/components/message/src/message.vue.d.ts +38 -0
- package/dist/components/message/src/message.vue.js +156 -0
- package/dist/components/message/src/message2.vue.js +4 -0
- package/dist/components/message/src/method.d.ts +5 -0
- package/dist/components/message/src/method.js +123 -0
- package/dist/components/message-box/index.d.ts +6 -0
- package/dist/components/message-box/index.js +9 -0
- package/dist/components/message-box/src/index.vue.d.ts +5517 -0
- package/dist/components/message-box/src/index.vue.js +203 -0
- package/dist/components/message-box/src/index2.vue.js +237 -0
- package/dist/components/message-box/src/message-box.type.d.ts +167 -0
- package/dist/components/message-box/src/messageBox.d.ts +3 -0
- package/dist/components/message-box/src/messageBox.js +102 -0
- package/dist/components/notification/index.d.ts +3 -0
- package/dist/components/notification/index.js +15 -0
- package/dist/components/notification/src/notification.d.ts +157 -0
- package/dist/components/notification/src/notification.js +127 -0
- package/dist/components/notification/src/notification.vue.d.ts +34 -0
- package/dist/components/notification/src/notification.vue.js +146 -0
- package/dist/components/notification/src/notification2.vue.js +4 -0
- package/dist/components/notification/src/notify.d.ts +15 -0
- package/dist/components/notification/src/notify.js +100 -0
- package/dist/components/option/index.js +3 -3
- package/dist/components/overlay/index.d.ts +8 -0
- package/dist/components/overlay/overlay.d.ts +73 -0
- package/dist/components/overlay/overlay.js +80 -0
- package/dist/components/page-header/EpPageHeader.vue.d.ts +30 -0
- package/dist/components/page-header/EpPageHeader.vue.js +109 -0
- package/dist/components/page-header/EpPageHeader2.vue.js +4 -0
- package/dist/components/page-header/index.d.ts +13 -2
- package/dist/components/page-header/index.js +9 -4
- package/dist/components/page-header/instance.d.ts +2 -0
- package/dist/components/page-header/page-header.d.ts +26 -0
- package/dist/components/page-header/page-header.js +33 -0
- package/dist/components/popconfirm/EpPopconfirm.vue.d.ts +36 -0
- package/dist/components/popconfirm/EpPopconfirm.vue.js +146 -0
- package/dist/components/popconfirm/EpPopconfirm2.vue.js +4 -0
- package/dist/components/popconfirm/index.d.ts +14 -2
- package/dist/components/popconfirm/index.js +9 -4
- package/dist/components/popconfirm/instance.d.ts +2 -0
- package/dist/components/popconfirm/popconfirm.d.ts +106 -0
- package/dist/components/popconfirm/popconfirm.js +103 -0
- package/dist/components/progress/src/progress.vue.d.ts +1 -1
- package/dist/components/roving-focus-group/index.js +2 -2
- package/dist/components/roving-focus-group/src/roving-focus-group.vue.js +19 -11
- package/dist/components/roving-focus-group/src/roving-focus-group2.vue.js +11 -19
- package/dist/components/roving-focus-group/src/roving-focus-item.vue.js +76 -18
- package/dist/components/roving-focus-group/src/roving-focus-item2.vue.js +18 -76
- package/dist/components/select/index.d.ts +21 -21
- package/dist/components/select/select.vue.d.ts +7 -7
- package/dist/components/select/select2.vue.js +12 -12
- package/dist/components/select/src/option.vue.js +5 -5
- package/dist/components/select-v2/src/select.vue.d.ts +8 -8
- package/dist/components/table-v2/index.d.ts +21 -2
- package/dist/components/table-v2/index.js +11 -4
- package/dist/components/table-v2/src/EpTableV2.d.ts +359 -0
- package/dist/components/table-v2/src/EpTableV2.js +287 -0
- package/dist/components/table-v2/src/cell.d.ts +27 -0
- package/dist/components/table-v2/src/common.d.ts +42 -0
- package/dist/components/table-v2/src/common.js +38 -0
- package/dist/components/table-v2/src/components/cell.d.ts +4 -0
- package/dist/components/table-v2/src/components/cell.js +20 -0
- package/dist/components/table-v2/src/components/expand-icon.d.ts +15 -0
- package/dist/components/table-v2/src/components/expand-icon.js +30 -0
- package/dist/components/table-v2/src/components/header-cell.d.ts +4 -0
- package/dist/components/table-v2/src/components/header-cell.js +15 -0
- package/dist/components/table-v2/src/components/header-row.d.ts +59 -0
- package/dist/components/table-v2/src/components/header-row.js +41 -0
- package/dist/components/table-v2/src/components/header.d.ts +105 -0
- package/dist/components/table-v2/src/components/header.js +98 -0
- package/dist/components/table-v2/src/components/index.d.ts +11 -0
- package/dist/components/table-v2/src/components/row.d.ts +166 -0
- package/dist/components/table-v2/src/components/row.js +176 -0
- package/dist/components/table-v2/src/components/sort-icon.d.ts +9 -0
- package/dist/components/table-v2/src/components/sort-icon.js +21 -0
- package/dist/components/table-v2/src/composables/index.d.ts +11 -0
- package/dist/components/table-v2/src/composables/use-columns.d.ts +128 -0
- package/dist/components/table-v2/src/composables/use-columns.js +73 -0
- package/dist/components/table-v2/src/composables/use-data.d.ts +14 -0
- package/dist/components/table-v2/src/composables/use-data.js +33 -0
- package/dist/components/table-v2/src/composables/use-row.d.ts +31 -0
- package/dist/components/table-v2/src/composables/use-row.js +83 -0
- package/dist/components/table-v2/src/composables/use-scrollbar.d.ts +31 -0
- package/dist/components/table-v2/src/composables/use-scrollbar.js +53 -0
- package/dist/components/table-v2/src/composables/use-styles.d.ts +23 -0
- package/dist/components/table-v2/src/composables/use-styles.js +66 -0
- package/dist/components/table-v2/src/composables/utils.d.ts +3 -0
- package/dist/components/table-v2/src/composables/utils.js +19 -0
- package/dist/components/table-v2/src/constants.d.ts +18 -0
- package/dist/components/table-v2/src/constants.js +12 -0
- package/dist/components/table-v2/src/grid.d.ts +105 -0
- package/dist/components/table-v2/src/grid.js +56 -0
- package/dist/components/table-v2/src/header-cell.d.ts +13 -0
- package/dist/components/table-v2/src/header-row.d.ts +26 -0
- package/dist/components/table-v2/src/header-row.js +20 -0
- package/dist/components/table-v2/src/header.d.ts +44 -0
- package/dist/components/table-v2/src/header.js +35 -0
- package/dist/components/table-v2/src/private.d.ts +1 -0
- package/dist/components/table-v2/src/private.js +4 -0
- package/dist/components/table-v2/src/renderers/cell.d.ts +11 -0
- package/dist/components/table-v2/src/renderers/cell.js +101 -0
- package/dist/components/table-v2/src/renderers/empty.d.ts +7 -0
- package/dist/components/table-v2/src/renderers/empty.js +15 -0
- package/dist/components/table-v2/src/renderers/footer.d.ts +7 -0
- package/dist/components/table-v2/src/renderers/footer.js +14 -0
- package/dist/components/table-v2/src/renderers/header-cell.d.ts +14 -0
- package/dist/components/table-v2/src/renderers/header-cell.js +77 -0
- package/dist/components/table-v2/src/renderers/header.d.ts +9 -0
- package/dist/components/table-v2/src/renderers/header.js +53 -0
- package/dist/components/table-v2/src/renderers/left-table.d.ts +8 -0
- package/dist/components/table-v2/src/renderers/left-table.js +22 -0
- package/dist/components/table-v2/src/renderers/main-table.d.ts +8 -0
- package/dist/components/table-v2/src/renderers/main-table.js +21 -0
- package/dist/components/table-v2/src/renderers/overlay.d.ts +3 -0
- package/dist/components/table-v2/src/renderers/overlay.js +14 -0
- package/dist/components/table-v2/src/renderers/right-table.d.ts +8 -0
- package/dist/components/table-v2/src/renderers/right-table.js +22 -0
- package/dist/components/table-v2/src/renderers/row.d.ts +11 -0
- package/dist/components/table-v2/src/renderers/row.js +98 -0
- package/dist/components/table-v2/src/row.d.ts +101 -0
- package/dist/components/table-v2/src/row.js +53 -0
- package/dist/components/table-v2/src/table-grid.d.ts +236 -0
- package/dist/components/table-v2/src/table-grid.js +240 -0
- package/dist/components/table-v2/src/table.d.ts +194 -0
- package/dist/components/table-v2/src/table.js +134 -0
- package/dist/components/table-v2/src/tokens.d.ts +9 -0
- package/dist/components/table-v2/src/tokens.js +5 -0
- package/dist/components/table-v2/src/types.d.ts +99 -0
- package/dist/components/table-v2/src/use-table.d.ts +98 -0
- package/dist/components/table-v2/src/use-table.js +162 -0
- package/dist/components/table-v2/src/utils.d.ts +8 -0
- package/dist/components/table-v2/src/utils.js +15 -0
- package/dist/components/time-picker/src/time-picker-com/panel-time-pick.vue.d.ts +2 -2
- package/dist/components/time-picker/src/time-picker-com/panel-time-range.vue.d.ts +2 -2
- package/dist/components/tour/EpTour.vue.d.ts +1 -1
- package/dist/components/tree-select/src/tree-select.vue.d.ts +10 -10
- package/dist/components/tree-v2/EpTreeNode.vue.d.ts +17 -0
- package/dist/components/tree-v2/EpTreeNode.vue.js +127 -0
- package/dist/components/tree-v2/EpTreeNode2.vue.js +4 -0
- package/dist/components/tree-v2/EpTreeV2.vue.d.ts +61 -0
- package/dist/components/tree-v2/EpTreeV2.vue.js +168 -0
- package/dist/components/tree-v2/EpTreeV22.vue.js +4 -0
- package/dist/components/tree-v2/composables/useCheck.d.ts +15 -0
- package/dist/components/tree-v2/composables/useCheck.js +142 -0
- package/dist/components/tree-v2/composables/useFilter.d.ts +8 -0
- package/dist/components/tree-v2/composables/useFilter.js +50 -0
- package/dist/components/tree-v2/composables/useTree.d.ts +404 -0
- package/dist/components/tree-v2/composables/useTree.js +228 -0
- package/dist/components/tree-v2/index.d.ts +11 -2
- package/dist/components/tree-v2/index.js +5 -2
- package/dist/components/tree-v2/instance.d.ts +2 -0
- package/dist/components/tree-v2/tree-node-content.d.ts +20 -0
- package/dist/components/tree-v2/tree-node-content.js +33 -0
- package/dist/components/tree-v2/types.d.ts +97 -0
- package/dist/components/tree-v2/virtual-tree.d.ts +122 -0
- package/dist/components/tree-v2/virtual-tree.js +140 -0
- package/dist/components/virtual-list/src/builders/build-grid.d.ts +211 -0
- package/dist/components/virtual-list/src/builders/build-grid.js +449 -0
- package/dist/components/virtual-list/src/components/dynamic-size-grid.d.ts +212 -0
- package/dist/components/virtual-list/src/components/dynamic-size-grid.js +200 -0
- package/dist/components/virtual-list/src/components/fixed-size-grid.d.ts +199 -0
- package/dist/components/virtual-list/src/components/fixed-size-grid.js +126 -0
- package/dist/components/virtual-list/src/hooks/use-grid-touch.d.ts +8 -0
- package/dist/components/virtual-list/src/hooks/use-grid-touch.js +40 -0
- package/dist/components/virtual-list/src/hooks/use-grid-wheel.d.ts +13 -0
- package/dist/components/virtual-list/src/hooks/use-grid-wheel.js +30 -0
- package/dist/components/virtual-list/src/props.js +16 -17
- package/dist/components/virtual-list/src/utils.js +14 -13
- package/dist/components/watermark/EpWatermark.vue.d.ts +18 -0
- package/dist/components/watermark/EpWatermark.vue.js +174 -0
- package/dist/components/watermark/EpWatermark2.vue.js +4 -0
- package/dist/components/watermark/index.d.ts +13 -2
- package/dist/components/watermark/index.js +8 -4
- package/dist/components/watermark/instance.d.ts +2 -0
- package/dist/components/watermark/useClips.d.ts +6 -0
- package/dist/components/watermark/useClips.js +91 -0
- package/dist/components/watermark/utils.d.ts +8 -0
- package/dist/components/watermark/utils.js +21 -0
- package/dist/components/watermark/watermark.d.ts +71 -0
- package/dist/components/watermark/watermark.js +60 -0
- package/dist/constants/date.js +9 -0
- package/dist/directives/index.d.ts +11 -0
- package/dist/directives/index.js +25 -0
- package/dist/directives/trap-focus/index.js +40 -0
- package/dist/ep-craft.js +410 -373
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/use-draggable/index.d.ts +6 -0
- package/dist/hooks/use-draggable/index.js +51 -0
- package/dist/hooks/use-locale/index.js +12 -12
- package/dist/hooks/use-namespace/index.js +23 -23
- package/dist/hooks/use-same-target/index.d.ts +5 -0
- package/dist/hooks/use-same-target/index.js +20 -0
- package/dist/hooks/use-z-index/index.js +15 -15
- package/dist/index.d.ts +32 -2
- package/dist/utils/dom/aria.js +16 -12
- package/dist/utils/vue/icon.js +10 -6
- package/dist/utils/vue/install.js +23 -20
- package/dist/vendored-components.d.ts +1 -1
- package/dist/vendored-components.js +23 -3
- package/package.json +1 -1
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import { defineComponent as M, unref as d, createVNode as I, mergeProps as R, inject as N, ref as S, computed as E, onMounted as H, nextTick as K } from "vue";
|
|
2
|
+
import { isNumber as P } from "../../../../utils/types.js";
|
|
3
|
+
import "lodash-unified";
|
|
4
|
+
import "@vueuse/core";
|
|
5
|
+
import { isArray as T, isFunction as V } from "@vue/shared";
|
|
6
|
+
import "@element-plus/icons-vue";
|
|
7
|
+
import { tableV2RowProps as C } from "../row.js";
|
|
8
|
+
import { TableV2InjectionKey as j } from "../tokens.js";
|
|
9
|
+
import { placeholderSign as k } from "../private.js";
|
|
10
|
+
const D = (n) => {
|
|
11
|
+
const {
|
|
12
|
+
isScrolling: g
|
|
13
|
+
} = N(j), f = S(!1), w = S(), h = E(() => P(n.estimatedRowHeight) && n.rowIndex >= 0), y = (c = !1) => {
|
|
14
|
+
const r = d(w);
|
|
15
|
+
if (!r) return;
|
|
16
|
+
const {
|
|
17
|
+
columns: s,
|
|
18
|
+
onRowHeightChange: l,
|
|
19
|
+
rowKey: m,
|
|
20
|
+
rowIndex: a,
|
|
21
|
+
style: o
|
|
22
|
+
} = n, {
|
|
23
|
+
height: t
|
|
24
|
+
} = r.getBoundingClientRect();
|
|
25
|
+
f.value = !0, K(() => {
|
|
26
|
+
if (c || t !== Number.parseInt(o.height)) {
|
|
27
|
+
const e = s[0], i = (e == null ? void 0 : e.placeholderSign) === k;
|
|
28
|
+
l == null || l({
|
|
29
|
+
rowKey: m,
|
|
30
|
+
height: t,
|
|
31
|
+
rowIndex: a
|
|
32
|
+
}, e && !i && e.fixed);
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
}, p = E(() => {
|
|
36
|
+
const {
|
|
37
|
+
rowData: c,
|
|
38
|
+
rowIndex: r,
|
|
39
|
+
rowKey: s,
|
|
40
|
+
onRowHover: l
|
|
41
|
+
} = n, m = n.rowEventHandlers || {}, a = {};
|
|
42
|
+
return Object.entries(m).forEach(([o, t]) => {
|
|
43
|
+
V(t) && (a[o] = (e) => {
|
|
44
|
+
t({
|
|
45
|
+
event: e,
|
|
46
|
+
rowData: c,
|
|
47
|
+
rowIndex: r,
|
|
48
|
+
rowKey: s
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
}), l && [{
|
|
52
|
+
name: "onMouseleave",
|
|
53
|
+
hovered: !1
|
|
54
|
+
}, {
|
|
55
|
+
name: "onMouseenter",
|
|
56
|
+
hovered: !0
|
|
57
|
+
}].forEach(({
|
|
58
|
+
name: o,
|
|
59
|
+
hovered: t
|
|
60
|
+
}) => {
|
|
61
|
+
const e = a[o];
|
|
62
|
+
a[o] = (i) => {
|
|
63
|
+
l({
|
|
64
|
+
event: i,
|
|
65
|
+
hovered: t,
|
|
66
|
+
rowData: c,
|
|
67
|
+
rowIndex: r,
|
|
68
|
+
rowKey: s
|
|
69
|
+
}), e == null || e(i);
|
|
70
|
+
};
|
|
71
|
+
}), a;
|
|
72
|
+
}), b = (c) => {
|
|
73
|
+
const {
|
|
74
|
+
onRowExpand: r,
|
|
75
|
+
rowData: s,
|
|
76
|
+
rowIndex: l,
|
|
77
|
+
rowKey: m
|
|
78
|
+
} = n;
|
|
79
|
+
r == null || r({
|
|
80
|
+
expanded: c,
|
|
81
|
+
rowData: s,
|
|
82
|
+
rowIndex: l,
|
|
83
|
+
rowKey: m
|
|
84
|
+
});
|
|
85
|
+
};
|
|
86
|
+
return H(() => {
|
|
87
|
+
d(h) && y(!0);
|
|
88
|
+
}), {
|
|
89
|
+
isScrolling: g,
|
|
90
|
+
measurable: h,
|
|
91
|
+
measured: f,
|
|
92
|
+
rowRef: w,
|
|
93
|
+
eventHandlers: p,
|
|
94
|
+
onExpand: b
|
|
95
|
+
};
|
|
96
|
+
}, O = "EpTableV2TableRow", L = /* @__PURE__ */ M({
|
|
97
|
+
name: O,
|
|
98
|
+
props: C,
|
|
99
|
+
setup(n, {
|
|
100
|
+
expose: g,
|
|
101
|
+
slots: f,
|
|
102
|
+
attrs: w
|
|
103
|
+
}) {
|
|
104
|
+
const {
|
|
105
|
+
eventHandlers: h,
|
|
106
|
+
isScrolling: y,
|
|
107
|
+
measurable: p,
|
|
108
|
+
measured: b,
|
|
109
|
+
rowRef: c,
|
|
110
|
+
onExpand: r
|
|
111
|
+
} = D(n);
|
|
112
|
+
return g({
|
|
113
|
+
/**
|
|
114
|
+
* @description manually dispatching expand action on row.
|
|
115
|
+
*/
|
|
116
|
+
onExpand: r
|
|
117
|
+
}), () => {
|
|
118
|
+
const {
|
|
119
|
+
columns: s,
|
|
120
|
+
columnsStyles: l,
|
|
121
|
+
expandColumnKey: m,
|
|
122
|
+
depth: a,
|
|
123
|
+
rowData: o,
|
|
124
|
+
rowIndex: t,
|
|
125
|
+
style: e
|
|
126
|
+
} = n;
|
|
127
|
+
let i = s.map((u, x) => {
|
|
128
|
+
const v = T(o.children) && o.children.length > 0 && u.key === m;
|
|
129
|
+
return f.cell({
|
|
130
|
+
column: u,
|
|
131
|
+
columns: s,
|
|
132
|
+
columnIndex: x,
|
|
133
|
+
depth: a,
|
|
134
|
+
style: l[u.key],
|
|
135
|
+
rowData: o,
|
|
136
|
+
rowIndex: t,
|
|
137
|
+
isScrolling: d(y),
|
|
138
|
+
expandIconProps: v ? {
|
|
139
|
+
rowData: o,
|
|
140
|
+
rowIndex: t,
|
|
141
|
+
onExpand: r
|
|
142
|
+
} : void 0
|
|
143
|
+
});
|
|
144
|
+
});
|
|
145
|
+
if (f.row && (i = f.row({
|
|
146
|
+
cells: i.map((u) => T(u) && u.length === 1 ? u[0] : u),
|
|
147
|
+
style: e,
|
|
148
|
+
columns: s,
|
|
149
|
+
depth: a,
|
|
150
|
+
rowData: o,
|
|
151
|
+
rowIndex: t,
|
|
152
|
+
isScrolling: d(y)
|
|
153
|
+
})), d(p)) {
|
|
154
|
+
const {
|
|
155
|
+
height: u,
|
|
156
|
+
...x
|
|
157
|
+
} = e || {}, v = d(b);
|
|
158
|
+
return I("div", R({
|
|
159
|
+
ref: c,
|
|
160
|
+
class: n.class,
|
|
161
|
+
style: v ? e : x,
|
|
162
|
+
role: "row"
|
|
163
|
+
}, w, d(h)), [i]);
|
|
164
|
+
}
|
|
165
|
+
return I("div", R(w, {
|
|
166
|
+
ref: c,
|
|
167
|
+
class: n.class,
|
|
168
|
+
style: e,
|
|
169
|
+
role: "row"
|
|
170
|
+
}, d(h)), [i]);
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
});
|
|
174
|
+
export {
|
|
175
|
+
L as default
|
|
176
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { SortOrder } from '../constants';
|
|
2
|
+
import type { FunctionalComponent, HTMLAttributes } from 'vue';
|
|
3
|
+
export type SortIconProps = {
|
|
4
|
+
sortOrder: SortOrder;
|
|
5
|
+
ariaLabel?: string;
|
|
6
|
+
class?: HTMLAttributes['class'];
|
|
7
|
+
};
|
|
8
|
+
declare const SortIcon: FunctionalComponent<SortIconProps>;
|
|
9
|
+
export default SortIcon;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { createVNode as r } from "vue";
|
|
2
|
+
import { EpIcon as l } from "../../../icon/index.js";
|
|
3
|
+
import { SortUp as e, SortDown as a } from "@element-plus/icons-vue";
|
|
4
|
+
import { SortOrder as n } from "../constants.js";
|
|
5
|
+
const s = (t) => {
|
|
6
|
+
const {
|
|
7
|
+
sortOrder: o
|
|
8
|
+
} = t;
|
|
9
|
+
return r("button", {
|
|
10
|
+
type: "button",
|
|
11
|
+
"aria-label": t.ariaLabel,
|
|
12
|
+
class: t.class
|
|
13
|
+
}, [r(l, {
|
|
14
|
+
size: 14
|
|
15
|
+
}, {
|
|
16
|
+
default: () => [o === n.ASC ? r(e, null, null) : r(a, null, null)]
|
|
17
|
+
})]);
|
|
18
|
+
};
|
|
19
|
+
export {
|
|
20
|
+
s as default
|
|
21
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export { useScrollbar } from './use-scrollbar';
|
|
2
|
+
export type { ScrollPos } from './use-scrollbar';
|
|
3
|
+
export { useColumns } from './use-columns';
|
|
4
|
+
export type { UseColumnsReturn } from './use-columns';
|
|
5
|
+
export { useData } from './use-data';
|
|
6
|
+
export type { UseDataReturn } from './use-data';
|
|
7
|
+
export { useRow } from './use-row';
|
|
8
|
+
export type { UseRowReturn } from './use-row';
|
|
9
|
+
export { useStyles } from './use-styles';
|
|
10
|
+
export type { UseStyleReturn } from './use-styles';
|
|
11
|
+
export type { Alignment as ScrollStrategy } from '../../../virtual-list';
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import type { CSSProperties, Ref } from 'vue';
|
|
2
|
+
import type { TableV2Props } from '../table';
|
|
3
|
+
import type { AnyColumns, Column, KeyType } from '../types';
|
|
4
|
+
declare function useColumns(props: TableV2Props, columns: Ref<AnyColumns>, fixed: Ref<boolean>): {
|
|
5
|
+
columns: import("vue").ComputedRef<{
|
|
6
|
+
key: KeyType;
|
|
7
|
+
align?: import("../types").Alignment;
|
|
8
|
+
class?: string | import("../types").ClassNameGetter<any> | undefined;
|
|
9
|
+
dataKey?: KeyType;
|
|
10
|
+
fixed?: true | import("../types").FixedDirection;
|
|
11
|
+
flexGrow?: CSSProperties["flexGrow"];
|
|
12
|
+
flexShrink?: CSSProperties["flexShrink"];
|
|
13
|
+
title?: string;
|
|
14
|
+
hidden?: boolean;
|
|
15
|
+
headerClass?: string | import("../types").HeaderClassGetter<any> | undefined;
|
|
16
|
+
maxWidth?: number;
|
|
17
|
+
minWidth?: number;
|
|
18
|
+
style?: CSSProperties;
|
|
19
|
+
sortable?: boolean;
|
|
20
|
+
width: number;
|
|
21
|
+
cellRenderer?: import("../types").CellRenderer<any> | undefined;
|
|
22
|
+
headerCellRenderer?: import("../types").HeaderCellRenderer<any> | undefined;
|
|
23
|
+
}[]>;
|
|
24
|
+
columnsStyles: import("vue").ComputedRef<Record<KeyType, CSSProperties>>;
|
|
25
|
+
columnsTotalWidth: import("vue").ComputedRef<number>;
|
|
26
|
+
fixedColumnsOnLeft: import("vue").ComputedRef<{
|
|
27
|
+
key: KeyType;
|
|
28
|
+
align?: import("../types").Alignment;
|
|
29
|
+
class?: string | import("../types").ClassNameGetter<any> | undefined;
|
|
30
|
+
dataKey?: KeyType;
|
|
31
|
+
fixed?: true | import("../types").FixedDirection;
|
|
32
|
+
flexGrow?: CSSProperties["flexGrow"];
|
|
33
|
+
flexShrink?: CSSProperties["flexShrink"];
|
|
34
|
+
title?: string;
|
|
35
|
+
hidden?: boolean;
|
|
36
|
+
headerClass?: string | import("../types").HeaderClassGetter<any> | undefined;
|
|
37
|
+
maxWidth?: number;
|
|
38
|
+
minWidth?: number;
|
|
39
|
+
style?: CSSProperties;
|
|
40
|
+
sortable?: boolean;
|
|
41
|
+
width: number;
|
|
42
|
+
cellRenderer?: import("../types").CellRenderer<any> | undefined;
|
|
43
|
+
headerCellRenderer?: import("../types").HeaderCellRenderer<any> | undefined;
|
|
44
|
+
}[]>;
|
|
45
|
+
fixedColumnsOnRight: import("vue").ComputedRef<{
|
|
46
|
+
key: KeyType;
|
|
47
|
+
align?: import("../types").Alignment;
|
|
48
|
+
class?: string | import("../types").ClassNameGetter<any> | undefined;
|
|
49
|
+
dataKey?: KeyType;
|
|
50
|
+
fixed?: true | import("../types").FixedDirection;
|
|
51
|
+
flexGrow?: CSSProperties["flexGrow"];
|
|
52
|
+
flexShrink?: CSSProperties["flexShrink"];
|
|
53
|
+
title?: string;
|
|
54
|
+
hidden?: boolean;
|
|
55
|
+
headerClass?: string | import("../types").HeaderClassGetter<any> | undefined;
|
|
56
|
+
maxWidth?: number;
|
|
57
|
+
minWidth?: number;
|
|
58
|
+
style?: CSSProperties;
|
|
59
|
+
sortable?: boolean;
|
|
60
|
+
width: number;
|
|
61
|
+
cellRenderer?: import("../types").CellRenderer<any> | undefined;
|
|
62
|
+
headerCellRenderer?: import("../types").HeaderCellRenderer<any> | undefined;
|
|
63
|
+
}[]>;
|
|
64
|
+
hasFixedColumns: import("vue").ComputedRef<number>;
|
|
65
|
+
mainColumns: import("vue").ComputedRef<AnyColumns>;
|
|
66
|
+
normalColumns: import("vue").ComputedRef<{
|
|
67
|
+
key: KeyType;
|
|
68
|
+
align?: import("../types").Alignment;
|
|
69
|
+
class?: string | import("../types").ClassNameGetter<any> | undefined;
|
|
70
|
+
dataKey?: KeyType;
|
|
71
|
+
fixed?: true | import("../types").FixedDirection;
|
|
72
|
+
flexGrow?: CSSProperties["flexGrow"];
|
|
73
|
+
flexShrink?: CSSProperties["flexShrink"];
|
|
74
|
+
title?: string;
|
|
75
|
+
hidden?: boolean;
|
|
76
|
+
headerClass?: string | import("../types").HeaderClassGetter<any> | undefined;
|
|
77
|
+
maxWidth?: number;
|
|
78
|
+
minWidth?: number;
|
|
79
|
+
style?: CSSProperties;
|
|
80
|
+
sortable?: boolean;
|
|
81
|
+
width: number;
|
|
82
|
+
cellRenderer?: import("../types").CellRenderer<any> | undefined;
|
|
83
|
+
headerCellRenderer?: import("../types").HeaderCellRenderer<any> | undefined;
|
|
84
|
+
}[]>;
|
|
85
|
+
visibleColumns: import("vue").ComputedRef<{
|
|
86
|
+
key: KeyType;
|
|
87
|
+
align?: import("../types").Alignment;
|
|
88
|
+
class?: string | import("../types").ClassNameGetter<any> | undefined;
|
|
89
|
+
dataKey?: KeyType;
|
|
90
|
+
fixed?: true | import("../types").FixedDirection;
|
|
91
|
+
flexGrow?: CSSProperties["flexGrow"];
|
|
92
|
+
flexShrink?: CSSProperties["flexShrink"];
|
|
93
|
+
title?: string;
|
|
94
|
+
hidden?: boolean;
|
|
95
|
+
headerClass?: string | import("../types").HeaderClassGetter<any> | undefined;
|
|
96
|
+
maxWidth?: number;
|
|
97
|
+
minWidth?: number;
|
|
98
|
+
style?: CSSProperties;
|
|
99
|
+
sortable?: boolean;
|
|
100
|
+
width: number;
|
|
101
|
+
cellRenderer?: import("../types").CellRenderer<any> | undefined;
|
|
102
|
+
headerCellRenderer?: import("../types").HeaderCellRenderer<any> | undefined;
|
|
103
|
+
}[]>;
|
|
104
|
+
getColumn: (key: KeyType) => {
|
|
105
|
+
key: KeyType;
|
|
106
|
+
align?: import("../types").Alignment;
|
|
107
|
+
class?: string | import("../types").ClassNameGetter<any> | undefined;
|
|
108
|
+
dataKey?: KeyType;
|
|
109
|
+
fixed?: true | import("../types").FixedDirection;
|
|
110
|
+
flexGrow?: CSSProperties["flexGrow"];
|
|
111
|
+
flexShrink?: CSSProperties["flexShrink"];
|
|
112
|
+
title?: string;
|
|
113
|
+
hidden?: boolean;
|
|
114
|
+
headerClass?: string | import("../types").HeaderClassGetter<any> | undefined;
|
|
115
|
+
maxWidth?: number;
|
|
116
|
+
minWidth?: number;
|
|
117
|
+
style?: CSSProperties;
|
|
118
|
+
sortable?: boolean;
|
|
119
|
+
width: number;
|
|
120
|
+
cellRenderer?: import("../types").CellRenderer<any> | undefined;
|
|
121
|
+
headerCellRenderer?: import("../types").HeaderCellRenderer<any> | undefined;
|
|
122
|
+
} | undefined;
|
|
123
|
+
getColumnStyle: (key: KeyType) => CSSProperties;
|
|
124
|
+
updateColumnWidth: (column: Column<any>, width: number) => void;
|
|
125
|
+
onColumnSorted: (e: MouseEvent) => void;
|
|
126
|
+
};
|
|
127
|
+
export { useColumns };
|
|
128
|
+
export type UseColumnsReturn = ReturnType<typeof useColumns>;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { computed as o, unref as r } from "vue";
|
|
2
|
+
import { isObject as T } from "@vue/shared";
|
|
3
|
+
import "lodash-unified";
|
|
4
|
+
import "@vueuse/core";
|
|
5
|
+
import "@element-plus/icons-vue";
|
|
6
|
+
import { SortOrder as W, oppositeOrderMap as C } from "../constants.js";
|
|
7
|
+
import { placeholderSign as x } from "../private.js";
|
|
8
|
+
import { calcColumnStyle as j } from "./utils.js";
|
|
9
|
+
function _(n, y, S) {
|
|
10
|
+
const u = o(
|
|
11
|
+
() => r(y).map((t, e) => ({
|
|
12
|
+
...t,
|
|
13
|
+
key: t.key ?? t.dataKey ?? e
|
|
14
|
+
}))
|
|
15
|
+
), i = o(() => r(u).filter((t) => !t.hidden)), s = o(
|
|
16
|
+
() => r(i).filter(
|
|
17
|
+
(t) => t.fixed === "left" || t.fixed === !0
|
|
18
|
+
)
|
|
19
|
+
), l = o(
|
|
20
|
+
() => r(i).filter((t) => t.fixed === "right")
|
|
21
|
+
), c = o(
|
|
22
|
+
() => r(i).filter((t) => !t.fixed)
|
|
23
|
+
), g = o(() => {
|
|
24
|
+
const t = [];
|
|
25
|
+
return r(s).forEach((e) => {
|
|
26
|
+
t.push({
|
|
27
|
+
...e,
|
|
28
|
+
placeholderSign: x
|
|
29
|
+
});
|
|
30
|
+
}), r(c).forEach((e) => {
|
|
31
|
+
t.push(e);
|
|
32
|
+
}), r(l).forEach((e) => {
|
|
33
|
+
t.push({
|
|
34
|
+
...e,
|
|
35
|
+
placeholderSign: x
|
|
36
|
+
});
|
|
37
|
+
}), t;
|
|
38
|
+
}), p = o(() => r(s).length || r(l).length), d = o(() => r(u).reduce(
|
|
39
|
+
(t, e) => (t[e.key] = j(e, r(S), n.fixed), t),
|
|
40
|
+
{}
|
|
41
|
+
)), k = o(() => r(i).reduce(
|
|
42
|
+
(t, e) => t + e.width,
|
|
43
|
+
0
|
|
44
|
+
)), f = (t) => r(u).find((e) => e.key === t), O = (t) => r(d)[t], E = (t, e) => {
|
|
45
|
+
t.width = e;
|
|
46
|
+
};
|
|
47
|
+
function b(t) {
|
|
48
|
+
var h;
|
|
49
|
+
const { key: e } = t.currentTarget.dataset;
|
|
50
|
+
if (!e) return;
|
|
51
|
+
const { sortState: a, sortBy: w } = n;
|
|
52
|
+
let m = W.ASC;
|
|
53
|
+
T(a) ? m = C[a[e]] : m = C[w.order], (h = n.onColumnSort) == null || h.call(n, { column: f(e), key: e, order: m });
|
|
54
|
+
}
|
|
55
|
+
return {
|
|
56
|
+
columns: u,
|
|
57
|
+
columnsStyles: d,
|
|
58
|
+
columnsTotalWidth: k,
|
|
59
|
+
fixedColumnsOnLeft: s,
|
|
60
|
+
fixedColumnsOnRight: l,
|
|
61
|
+
hasFixedColumns: p,
|
|
62
|
+
mainColumns: g,
|
|
63
|
+
normalColumns: c,
|
|
64
|
+
visibleColumns: i,
|
|
65
|
+
getColumn: f,
|
|
66
|
+
getColumnStyle: O,
|
|
67
|
+
updateColumnWidth: E,
|
|
68
|
+
onColumnSorted: b
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
export {
|
|
72
|
+
_ as useColumns
|
|
73
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { TableV2Props } from '../table';
|
|
2
|
+
import type { KeyType } from '../types';
|
|
3
|
+
import type { UseRowReturn } from './use-row';
|
|
4
|
+
type UseDataProps = {
|
|
5
|
+
expandedRowKeys: UseRowReturn['expandedRowKeys'];
|
|
6
|
+
lastRenderedRowIndex: UseRowReturn['lastRenderedRowIndex'];
|
|
7
|
+
resetAfterIndex: UseRowReturn['resetAfterIndex'];
|
|
8
|
+
};
|
|
9
|
+
export declare const useData: (props: TableV2Props, { expandedRowKeys, lastRenderedRowIndex, resetAfterIndex }: UseDataProps) => {
|
|
10
|
+
data: import("vue").ComputedRef<any[]>;
|
|
11
|
+
depthMap: import("vue").Ref<Record<KeyType, number>, Record<KeyType, number>>;
|
|
12
|
+
};
|
|
13
|
+
export type UseDataReturn = ReturnType<typeof useData>;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { ref as g, computed as l, unref as f, watch as x } from "vue";
|
|
2
|
+
import { isArray as E } from "@vue/shared";
|
|
3
|
+
import "lodash-unified";
|
|
4
|
+
import "@vueuse/core";
|
|
5
|
+
import "@element-plus/icons-vue";
|
|
6
|
+
const A = (c, { expandedRowKeys: p, lastRenderedRowIndex: u, resetAfterIndex: m }) => {
|
|
7
|
+
const s = g({}), y = l(() => {
|
|
8
|
+
const e = {}, { data: r, rowKey: n } = c, o = f(p);
|
|
9
|
+
if (!o || !o.length) return r;
|
|
10
|
+
const h = [], i = /* @__PURE__ */ new Set();
|
|
11
|
+
o.forEach((t) => i.add(t));
|
|
12
|
+
let a = r.slice();
|
|
13
|
+
for (a.forEach((t) => e[t[n]] = 0); a.length > 0; ) {
|
|
14
|
+
const t = a.shift();
|
|
15
|
+
h.push(t), i.has(t[n]) && E(t.children) && t.children.length > 0 && (a = [...t.children, ...a], t.children.forEach(
|
|
16
|
+
(w) => e[w[n]] = e[t[n]] + 1
|
|
17
|
+
));
|
|
18
|
+
}
|
|
19
|
+
return s.value = e, h;
|
|
20
|
+
}), d = l(() => {
|
|
21
|
+
const { data: e, expandColumnKey: r } = c;
|
|
22
|
+
return r ? f(y) : e;
|
|
23
|
+
});
|
|
24
|
+
return x(d, (e, r) => {
|
|
25
|
+
e !== r && (u.value = -1, m(0, !0));
|
|
26
|
+
}), {
|
|
27
|
+
data: d,
|
|
28
|
+
depthMap: s
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
export {
|
|
32
|
+
A as useData
|
|
33
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { ComponentInternalInstance, Ref, ShallowRef } from 'vue';
|
|
2
|
+
import type { TableV2Props } from '../table';
|
|
3
|
+
import type { RowExpandParams, RowHeightChangedParams, RowHoverParams } from '../row';
|
|
4
|
+
import type { FixedDirection, KeyType } from '../types';
|
|
5
|
+
import type { onRowRenderedParams } from '../grid';
|
|
6
|
+
import type { TableGridInstance } from '../table-grid';
|
|
7
|
+
import type { UseNamespaceReturn } from '../../../../hooks';
|
|
8
|
+
type Heights = Record<KeyType, number>;
|
|
9
|
+
type GridInstanceRef = Ref<TableGridInstance | undefined>;
|
|
10
|
+
type UseRowProps = {
|
|
11
|
+
mainTableRef: GridInstanceRef;
|
|
12
|
+
leftTableRef: GridInstanceRef;
|
|
13
|
+
rightTableRef: GridInstanceRef;
|
|
14
|
+
tableInstance: ComponentInternalInstance;
|
|
15
|
+
ns: UseNamespaceReturn;
|
|
16
|
+
isScrolling: ShallowRef<boolean>;
|
|
17
|
+
};
|
|
18
|
+
export declare const useRow: (props: TableV2Props, { mainTableRef, leftTableRef, rightTableRef, tableInstance, ns, isScrolling, }: UseRowProps) => {
|
|
19
|
+
expandedRowKeys: Ref<KeyType[], KeyType[]>;
|
|
20
|
+
lastRenderedRowIndex: Ref<number, number>;
|
|
21
|
+
isDynamic: import("vue").ComputedRef<boolean>;
|
|
22
|
+
isResetting: ShallowRef<boolean, boolean>;
|
|
23
|
+
rowHeights: Ref<Heights, Heights>;
|
|
24
|
+
resetAfterIndex: (index: number, forceUpdate?: boolean) => void;
|
|
25
|
+
onRowExpanded: ({ expanded, rowData, rowIndex, rowKey, }: RowExpandParams) => void;
|
|
26
|
+
onRowHovered: ({ hovered, rowKey }: RowHoverParams) => void;
|
|
27
|
+
onRowsRendered: (params: onRowRenderedParams) => void;
|
|
28
|
+
onRowHeightChange: ({ rowKey, height, rowIndex }: RowHeightChangedParams, fixedDir: FixedDirection) => void;
|
|
29
|
+
};
|
|
30
|
+
export type UseRowReturn = ReturnType<typeof useRow>;
|
|
31
|
+
export {};
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { getCurrentInstance as M, shallowRef as u, ref as f, computed as N, unref as a, nextTick as O } from "vue";
|
|
2
|
+
import { debounce as _ } from "lodash-unified";
|
|
3
|
+
import { isNumber as j } from "../../../../utils/types.js";
|
|
4
|
+
import "@vueuse/core";
|
|
5
|
+
import "@vue/shared";
|
|
6
|
+
import "@element-plus/icons-vue";
|
|
7
|
+
import { FixedDir as z } from "../constants.js";
|
|
8
|
+
const K = (s, {
|
|
9
|
+
mainTableRef: g,
|
|
10
|
+
leftTableRef: x,
|
|
11
|
+
rightTableRef: w,
|
|
12
|
+
tableInstance: H,
|
|
13
|
+
ns: r,
|
|
14
|
+
isScrolling: q
|
|
15
|
+
}) => {
|
|
16
|
+
const E = M(), { emit: y } = E, v = u(!1), R = f(s.defaultExpandedRowKeys || []), h = f(-1), l = u(null), d = f({}), m = f({}), b = u({}), C = u({}), I = u({}), S = N(() => j(s.estimatedRowHeight));
|
|
17
|
+
function L(e) {
|
|
18
|
+
var n;
|
|
19
|
+
(n = s.onRowsRendered) == null || n.call(s, e), e.rowCacheEnd > a(h) && (h.value = e.rowCacheEnd);
|
|
20
|
+
}
|
|
21
|
+
function U({ hovered: e, rowKey: n }) {
|
|
22
|
+
if (q.value)
|
|
23
|
+
return;
|
|
24
|
+
H.vnode.el.querySelectorAll(`[rowkey="${String(n)}"]`).forEach((i) => {
|
|
25
|
+
e ? i.classList.add(r.is("hovered")) : i.classList.remove(r.is("hovered"));
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
function T({
|
|
29
|
+
expanded: e,
|
|
30
|
+
rowData: n,
|
|
31
|
+
rowIndex: o,
|
|
32
|
+
rowKey: t
|
|
33
|
+
}) {
|
|
34
|
+
var k, A;
|
|
35
|
+
const i = [...a(R)], c = i.indexOf(t);
|
|
36
|
+
e ? c === -1 && i.push(t) : c > -1 && i.splice(c, 1), R.value = i, y("update:expandedRowKeys", i), (k = s.onRowExpand) == null || k.call(s, {
|
|
37
|
+
expanded: e,
|
|
38
|
+
rowData: n,
|
|
39
|
+
rowIndex: o,
|
|
40
|
+
rowKey: t
|
|
41
|
+
}), (A = s.onExpandedRowsChange) == null || A.call(s, i), H.vnode.el.querySelector(
|
|
42
|
+
`.${r.is("hovered")}[rowkey="${String(t)}"]`
|
|
43
|
+
) && O(() => U({ hovered: !0, rowKey: t }));
|
|
44
|
+
}
|
|
45
|
+
const D = _(() => {
|
|
46
|
+
var e, n, o, t;
|
|
47
|
+
v.value = !0, d.value = { ...a(d), ...a(m) }, $(a(l), !1), m.value = {}, l.value = null, (e = g.value) == null || e.forceUpdate(), (n = x.value) == null || n.forceUpdate(), (o = w.value) == null || o.forceUpdate(), (t = E.proxy) == null || t.$forceUpdate(), v.value = !1;
|
|
48
|
+
}, 0);
|
|
49
|
+
function $(e, n = !1) {
|
|
50
|
+
a(S) && [g, x, w].forEach((o) => {
|
|
51
|
+
const t = a(o);
|
|
52
|
+
t && t.resetAfterRowIndex(e, n);
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
function F(e, n, o) {
|
|
56
|
+
const t = a(l);
|
|
57
|
+
(t === null || t > o) && (l.value = o), m.value[e] = n;
|
|
58
|
+
}
|
|
59
|
+
function G({ rowKey: e, height: n, rowIndex: o }, t) {
|
|
60
|
+
t ? t === z.RIGHT ? I.value[e] = n : b.value[e] = n : C.value[e] = n;
|
|
61
|
+
const i = Math.max(
|
|
62
|
+
...[b, I, C].map(
|
|
63
|
+
(c) => c.value[e] || 0
|
|
64
|
+
)
|
|
65
|
+
);
|
|
66
|
+
a(d)[e] !== i && (F(e, i, o), D());
|
|
67
|
+
}
|
|
68
|
+
return {
|
|
69
|
+
expandedRowKeys: R,
|
|
70
|
+
lastRenderedRowIndex: h,
|
|
71
|
+
isDynamic: S,
|
|
72
|
+
isResetting: v,
|
|
73
|
+
rowHeights: d,
|
|
74
|
+
resetAfterIndex: $,
|
|
75
|
+
onRowExpanded: T,
|
|
76
|
+
onRowHovered: U,
|
|
77
|
+
onRowsRendered: L,
|
|
78
|
+
onRowHeightChange: G
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
export {
|
|
82
|
+
K as useRow
|
|
83
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { Ref } from 'vue';
|
|
2
|
+
import type { Alignment as ScrollStrategy } from '../../../virtual-list';
|
|
3
|
+
import type { TableV2Props } from '../table';
|
|
4
|
+
import type { TableGridInstance } from '../table-grid';
|
|
5
|
+
export type ScrollPos = {
|
|
6
|
+
scrollLeft: number;
|
|
7
|
+
scrollTop: number;
|
|
8
|
+
};
|
|
9
|
+
type GridInstanceRef = Ref<TableGridInstance | undefined>;
|
|
10
|
+
type UseScrollBarProps = {
|
|
11
|
+
mainTableRef: GridInstanceRef;
|
|
12
|
+
leftTableRef: GridInstanceRef;
|
|
13
|
+
rightTableRef: GridInstanceRef;
|
|
14
|
+
onMaybeEndReached: () => void;
|
|
15
|
+
};
|
|
16
|
+
export type { ScrollStrategy };
|
|
17
|
+
export declare const useScrollbar: (props: TableV2Props, { mainTableRef, leftTableRef, rightTableRef, onMaybeEndReached, }: UseScrollBarProps) => {
|
|
18
|
+
scrollPos: Ref<{
|
|
19
|
+
scrollLeft: number;
|
|
20
|
+
scrollTop: number;
|
|
21
|
+
}, ScrollPos | {
|
|
22
|
+
scrollLeft: number;
|
|
23
|
+
scrollTop: number;
|
|
24
|
+
}>;
|
|
25
|
+
scrollTo: (params: ScrollPos) => void;
|
|
26
|
+
scrollToLeft: (scrollLeft: number) => void;
|
|
27
|
+
scrollToTop: (scrollTop: number) => void;
|
|
28
|
+
scrollToRow: (row: number, strategy?: ScrollStrategy) => void;
|
|
29
|
+
onScroll: (params: ScrollPos) => void;
|
|
30
|
+
onVerticalScroll: ({ scrollTop }: ScrollPos) => void;
|
|
31
|
+
};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { ref as x, watch as P, unref as n } from "vue";
|
|
2
|
+
const g = (t, {
|
|
3
|
+
mainTableRef: u,
|
|
4
|
+
leftTableRef: v,
|
|
5
|
+
rightTableRef: S,
|
|
6
|
+
onMaybeEndReached: w
|
|
7
|
+
}) => {
|
|
8
|
+
const c = x({ scrollLeft: 0, scrollTop: 0 });
|
|
9
|
+
function s(o) {
|
|
10
|
+
var r, f, i;
|
|
11
|
+
const { scrollTop: l } = o;
|
|
12
|
+
(r = u.value) == null || r.scrollTo(o), (f = v.value) == null || f.scrollToTop(l), (i = S.value) == null || i.scrollToTop(l);
|
|
13
|
+
}
|
|
14
|
+
function T(o) {
|
|
15
|
+
c.value = o, s(o);
|
|
16
|
+
}
|
|
17
|
+
function e(o) {
|
|
18
|
+
c.value.scrollTop = o, s(n(c));
|
|
19
|
+
}
|
|
20
|
+
function L(o) {
|
|
21
|
+
var l, r;
|
|
22
|
+
c.value.scrollLeft = o, (r = (l = u.value) == null ? void 0 : l.scrollTo) == null || r.call(l, n(c));
|
|
23
|
+
}
|
|
24
|
+
function a(o) {
|
|
25
|
+
var l;
|
|
26
|
+
T(o), (l = t.onScroll) == null || l.call(t, o);
|
|
27
|
+
}
|
|
28
|
+
function d({ scrollTop: o }) {
|
|
29
|
+
const { scrollTop: l } = n(c);
|
|
30
|
+
o !== l && e(o);
|
|
31
|
+
}
|
|
32
|
+
function h(o, l = "auto") {
|
|
33
|
+
var r;
|
|
34
|
+
(r = u.value) == null || r.scrollToRow(o, l);
|
|
35
|
+
}
|
|
36
|
+
return P(
|
|
37
|
+
() => n(c).scrollTop,
|
|
38
|
+
(o, l) => {
|
|
39
|
+
o > l && w();
|
|
40
|
+
}
|
|
41
|
+
), {
|
|
42
|
+
scrollPos: c,
|
|
43
|
+
scrollTo: T,
|
|
44
|
+
scrollToLeft: L,
|
|
45
|
+
scrollToTop: e,
|
|
46
|
+
scrollToRow: h,
|
|
47
|
+
onScroll: a,
|
|
48
|
+
onVerticalScroll: d
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
export {
|
|
52
|
+
g as useScrollbar
|
|
53
|
+
};
|