ep-craft 0.1.32 → 0.1.34
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/button/index.d.ts +12 -0
- package/dist/components/button-group/index.d.ts +3 -2
- package/dist/components/button-group/index.js +7 -3
- package/dist/components/button-group/src/button-group.d.ts +48 -0
- package/dist/components/button-group/src/button-group.js +7 -0
- package/dist/components/button-group/src/button-group.vue.d.ts +16 -0
- package/dist/components/button-group/src/button-group.vue.js +42 -0
- package/dist/components/button-group/src/button-group2.vue.js +4 -0
- package/dist/components/checkbox/index.js +6 -5
- package/dist/components/collection/index.d.ts +8 -0
- package/dist/components/collection/src/collection-item.vue.d.ts +2 -0
- package/dist/components/collection/src/collection-item.vue.js +10 -0
- package/dist/components/collection/src/collection-item2.vue.js +8 -0
- package/dist/components/collection/src/collection.d.ts +39 -0
- package/dist/components/collection/src/collection.js +52 -0
- package/dist/components/collection/src/collection.vue.d.ts +2 -0
- package/dist/components/collection/src/collection.vue.js +10 -0
- package/dist/components/collection/src/collection2.vue.js +7 -0
- package/dist/components/collection/src/tokens.d.ts +18 -0
- package/dist/components/divider/index.d.ts +24 -2
- package/dist/components/divider/index.js +8 -3
- package/dist/components/divider/src/divider.d.ts +30 -0
- package/dist/components/divider/src/divider.js +34 -0
- package/dist/components/divider/src/divider.vue.d.ts +24 -0
- package/dist/components/divider/src/divider.vue.js +39 -0
- package/dist/components/divider/src/divider2.vue.js +4 -0
- package/dist/components/dropdown/index.d.ts +3017 -3
- package/dist/components/dropdown/index.js +23 -3
- package/dist/components/dropdown/src/dropdown-item-impl.vue.d.ts +79 -0
- package/dist/components/dropdown/src/dropdown-item-impl.vue.js +40 -0
- package/dist/components/dropdown/src/dropdown-item-impl2.vue.js +68 -0
- package/dist/components/dropdown/src/dropdown-item.vue.d.ts +169 -0
- package/dist/components/dropdown/src/dropdown-item.vue.js +35 -0
- package/dist/components/dropdown/src/dropdown-item2.vue.js +63 -0
- package/dist/components/dropdown/src/dropdown-menu.vue.d.ts +27 -0
- package/dist/components/dropdown/src/dropdown-menu.vue.js +24 -0
- package/dist/components/dropdown/src/dropdown-menu2.vue.js +75 -0
- package/dist/components/dropdown/src/dropdown.d.ts +200 -0
- package/dist/components/dropdown/src/dropdown.js +201 -0
- package/dist/components/dropdown/src/dropdown.vue.d.ts +1126 -0
- package/dist/components/dropdown/src/dropdown.vue.js +127 -0
- package/dist/components/dropdown/src/dropdown2.vue.js +127 -0
- package/dist/components/dropdown/src/instance.d.ts +2 -0
- package/dist/components/dropdown/src/tokens.d.ts +13 -0
- package/dist/components/dropdown/src/tokens.js +5 -0
- package/dist/components/dropdown/src/useDropdown.d.ts +5 -0
- package/dist/components/dropdown/src/useDropdown.js +15 -0
- package/dist/components/dropdown-item/index.d.ts +1 -4
- package/dist/components/dropdown-menu/index.d.ts +1 -4
- package/dist/components/index.js +129 -131
- package/dist/components/popover/index.d.ts +121 -3
- package/dist/components/popover/index.js +19 -4
- package/dist/components/popover/src/directive.d.ts +4 -0
- package/dist/components/popover/src/directive.js +15 -0
- package/dist/components/popover/src/popover.d.ts +291 -0
- package/dist/components/popover/src/popover.js +168 -0
- package/dist/components/popover/src/popover.vue.d.ts +53 -0
- package/dist/components/popover/src/popover.vue.js +125 -0
- package/dist/components/popover/src/popover2.vue.js +4 -0
- package/dist/components/progress/index.d.ts +35 -2
- package/dist/components/progress/index.js +10 -4
- package/dist/components/progress/src/progress.d.ts +97 -0
- package/dist/components/progress/src/progress.js +104 -0
- package/dist/components/progress/src/progress.vue.d.ts +30 -0
- package/dist/components/progress/src/progress.vue.js +179 -0
- package/dist/components/progress/src/progress2.vue.js +4 -0
- package/dist/components/roving-focus-group/index.d.ts +14 -0
- package/dist/components/roving-focus-group/index.js +15 -0
- package/dist/components/roving-focus-group/src/roving-focus-group-impl.vue.d.ts +50 -0
- package/dist/components/roving-focus-group/src/roving-focus-group-impl.vue.js +10 -0
- package/dist/components/roving-focus-group/src/roving-focus-group-impl2.vue.js +115 -0
- package/dist/components/roving-focus-group/src/roving-focus-group.d.ts +56 -0
- package/dist/components/roving-focus-group/src/roving-focus-group.js +43 -0
- package/dist/components/roving-focus-group/src/roving-focus-group.vue.d.ts +67 -0
- package/dist/components/roving-focus-group/src/roving-focus-group.vue.js +13 -0
- package/dist/components/roving-focus-group/src/roving-focus-group2.vue.js +21 -0
- package/dist/components/roving-focus-group/src/roving-focus-item.vue.d.ts +43 -0
- package/dist/components/roving-focus-group/src/roving-focus-item.vue.js +20 -0
- package/dist/components/roving-focus-group/src/roving-focus-item2.vue.js +78 -0
- package/dist/components/roving-focus-group/src/tokens.d.ts +28 -0
- package/dist/components/roving-focus-group/src/tokens.js +5 -0
- package/dist/components/roving-focus-group/src/utils.d.ts +8 -0
- package/dist/components/roving-focus-group/src/utils.js +28 -0
- package/dist/components/table/index.d.ts +56 -3
- package/dist/components/table/index.js +20 -4
- package/dist/components/table/src/composables/use-scrollbar.d.ts +6 -0
- package/dist/components/table/src/composables/use-scrollbar.js +24 -0
- package/dist/components/table/src/config.d.ts +87 -0
- package/dist/components/table/src/config.js +210 -0
- package/dist/components/table/src/filter-panel.vue.d.ts +837 -0
- package/dist/components/table/src/filter-panel.vue.js +130 -0
- package/dist/components/table/src/filter-panel2.vue.js +155 -0
- package/dist/components/table/src/h-helper.d.ts +13 -0
- package/dist/components/table/src/h-helper.js +30 -0
- package/dist/components/table/src/layout-observer.d.ts +8 -0
- package/dist/components/table/src/layout-observer.js +49 -0
- package/dist/components/table/src/store/current.d.ts +15 -0
- package/dist/components/table/src/store/current.js +45 -0
- package/dist/components/table/src/store/expand.d.ts +14 -0
- package/dist/components/table/src/store/expand.js +55 -0
- package/dist/components/table/src/store/helper.d.ts +548 -0
- package/dist/components/table/src/store/helper.js +61 -0
- package/dist/components/table/src/store/index.d.ts +1107 -0
- package/dist/components/table/src/store/index.js +123 -0
- package/dist/components/table/src/store/tree.d.ts +27 -0
- package/dist/components/table/src/store/tree.js +153 -0
- package/dist/components/table/src/store/watcher.d.ts +88 -0
- package/dist/components/table/src/store/watcher.js +483 -0
- package/dist/components/table/src/table/defaults.d.ts +560 -0
- package/dist/components/table/src/table/defaults.js +236 -0
- package/dist/components/table/src/table/key-render-helper.d.ts +2 -0
- package/dist/components/table/src/table/key-render-helper.js +18 -0
- package/dist/components/table/src/table/style-helper.d.ts +51 -0
- package/dist/components/table/src/table/style-helper.js +169 -0
- package/dist/components/table/src/table/utils-helper.d.ts +16 -0
- package/dist/components/table/src/table/utils-helper.js +36 -0
- package/dist/components/table/src/table-body/defaults.d.ts +39 -0
- package/dist/components/table/src/table-body/defaults.js +25 -0
- package/dist/components/table/src/table-body/events-helper.d.ts +19 -0
- package/dist/components/table/src/table-body/events-helper.js +126 -0
- package/dist/components/table/src/table-body/index.d.ts +84 -0
- package/dist/components/table/src/table-body/index.js +77 -0
- package/dist/components/table/src/table-body/render-helper.d.ts +18 -0
- package/dist/components/table/src/table-body/render-helper.js +188 -0
- package/dist/components/table/src/table-body/styles-helper.d.ts +15 -0
- package/dist/components/table/src/table-body/styles-helper.js +98 -0
- package/dist/components/table/src/table-body/td-wrapper.vue.d.ts +33 -0
- package/dist/components/table/src/table-body/td-wrapper.vue.js +26 -0
- package/dist/components/table/src/table-body/td-wrapper2.vue.js +4 -0
- package/dist/components/table/src/table-column/defaults.d.ts +348 -0
- package/dist/components/table/src/table-column/defaults.js +152 -0
- package/dist/components/table/src/table-column/index.d.ts +2 -0
- package/dist/components/table/src/table-column/index.vue.d.ts +32 -0
- package/dist/components/table/src/table-column/index.vue.js +161 -0
- package/dist/components/table/src/table-column/index2.vue.js +4 -0
- package/dist/components/table/src/table-column/render-helper.d.ts +17 -0
- package/dist/components/table/src/table-column/render-helper.js +116 -0
- package/dist/components/table/src/table-column/watcher-helper.d.ts +8 -0
- package/dist/components/table/src/table-column/watcher-helper.js +85 -0
- package/dist/components/table/src/table-footer/index.d.ts +79 -0
- package/dist/components/table/src/table-footer/index.js +110 -0
- package/dist/components/table/src/table-footer/mapState-helper.d.ts +9 -0
- package/dist/components/table/src/table-footer/mapState-helper.js +16 -0
- package/dist/components/table/src/table-footer/style-helper.d.ts +9 -0
- package/dist/components/table/src/table-footer/style-helper.js +42 -0
- package/dist/components/table/src/table-header/event-helper.d.ts +14 -0
- package/dist/components/table/src/table-header/event-helper.js +113 -0
- package/dist/components/table/src/table-header/index.d.ts +361 -0
- package/dist/components/table/src/table-header/index.js +255 -0
- package/dist/components/table/src/table-header/style.helper.d.ts +10 -0
- package/dist/components/table/src/table-header/style.helper.js +73 -0
- package/dist/components/table/src/table-header/utils-helper.d.ts +10 -0
- package/dist/components/table/src/table-header/utils-helper.js +45 -0
- package/dist/components/table/src/table-layout.d.ts +37 -0
- package/dist/components/table/src/table-layout.js +144 -0
- package/dist/components/table/src/table.vue.d.ts +734 -0
- package/dist/components/table/src/table.vue.js +443 -0
- package/dist/components/table/src/table2.vue.js +4 -0
- package/dist/components/table/src/tableColumn.d.ts +2 -0
- package/dist/components/table/src/tokens.d.ts +3 -0
- package/dist/components/table/src/tokens.js +4 -0
- package/dist/components/table/src/util.d.ts +55 -0
- package/dist/components/table/src/util.js +310 -0
- package/dist/components/table-column/index.d.ts +40 -3
- package/dist/components/table-column/index.js +6 -3
- package/dist/components/upload/index.d.ts +45 -2
- package/dist/components/upload/index.js +23 -4
- package/dist/components/upload/src/ajax.d.ts +9 -0
- package/dist/components/upload/src/ajax.js +58 -0
- package/dist/components/upload/src/constants.d.ts +5 -0
- package/dist/components/upload/src/constants.js +4 -0
- package/dist/components/upload/src/upload-content.d.ts +136 -0
- package/dist/components/upload/src/upload-content.js +53 -0
- package/dist/components/upload/src/upload-content.vue.d.ts +38 -0
- package/dist/components/upload/src/upload-content.vue.js +186 -0
- package/dist/components/upload/src/upload-content2.vue.js +4 -0
- package/dist/components/upload/src/upload-dragger.d.ts +22 -0
- package/dist/components/upload/src/upload-dragger.js +19 -0
- package/dist/components/upload/src/upload-dragger.vue.d.ts +19 -0
- package/dist/components/upload/src/upload-dragger.vue.js +91 -0
- package/dist/components/upload/src/upload-dragger2.vue.js +4 -0
- package/dist/components/upload/src/upload-list.d.ts +45 -0
- package/dist/components/upload/src/upload-list.js +39 -0
- package/dist/components/upload/src/upload-list.vue.d.ts +28 -0
- package/dist/components/upload/src/upload-list.vue.js +182 -0
- package/dist/components/upload/src/upload-list2.vue.js +4 -0
- package/dist/components/upload/src/upload.d.ts +361 -0
- package/dist/components/upload/src/upload.js +216 -0
- package/dist/components/upload/src/upload.vue.d.ts +64 -0
- package/dist/components/upload/src/upload.vue.js +150 -0
- package/dist/components/upload/src/upload2.vue.js +4 -0
- package/dist/components/upload/src/use-handlers.d.ts +60 -0
- package/dist/components/upload/src/use-handlers.js +111 -0
- package/dist/directives/mousewheel/index.js +28 -0
- package/dist/ep-craft.js +277 -236
- package/dist/index.d.ts +67 -0
- package/dist/utils/dom/event.js +12 -11
- package/dist/utils/objects.js +10 -9
- package/dist/utils/vue/install.js +21 -18
- package/dist/utils/vue/refs.js +8 -0
- package/dist/vendored-components.d.ts +1 -1
- package/dist/vendored-components.js +44 -4
- package/package.json +1 -1
- package/dist/components/dropdown-item/index.js +0 -6
- package/dist/components/dropdown-menu/index.js +0 -6
|
@@ -0,0 +1,443 @@
|
|
|
1
|
+
import { defineComponent as ye, getCurrentInstance as be, provide as he, computed as p, onBeforeUnmount as we, openBlock as d, createElementBlock as f, unref as e, normalizeStyle as h, normalizeClass as a, createElementVNode as u, renderSlot as H, withDirectives as L, createVNode as m, createCommentVNode as c, withCtx as ge, createBlock as Y, createTextVNode as ve, toDisplayString as Se, vShow as J } from "vue";
|
|
2
|
+
import { debounce as xe } from "lodash-unified";
|
|
3
|
+
import "../../../directives/click-outside/index.js";
|
|
4
|
+
import "@vue/shared";
|
|
5
|
+
import "@vueuse/core";
|
|
6
|
+
import "@element-plus/icons-vue";
|
|
7
|
+
import X from "../../../directives/mousewheel/index.js";
|
|
8
|
+
import { useNamespace as Ce } from "../../../hooks/use-namespace/index.js";
|
|
9
|
+
import { useLocale as Be } from "../../../hooks/use-locale/index.js";
|
|
10
|
+
import "../../../hooks/use-size/index.js";
|
|
11
|
+
import "@popperjs/core";
|
|
12
|
+
import "../../../hooks/use-z-index/index.js";
|
|
13
|
+
import "../../../hooks/use-delayed-toggle/index.js";
|
|
14
|
+
import "../../../hooks/use-aria/index.js";
|
|
15
|
+
import "../../../hooks/use-model-toggle/index.js";
|
|
16
|
+
import "../../../hooks/use-empty-values/index.js";
|
|
17
|
+
import "../../config-provider/index.js";
|
|
18
|
+
import { EpScrollbar as Te } from "../../scrollbar/index.js";
|
|
19
|
+
import { createStore as ke } from "./store/helper.js";
|
|
20
|
+
import Ee from "./table-layout.js";
|
|
21
|
+
import q from "./table-header/index.js";
|
|
22
|
+
import Re from "./table-body/index.js";
|
|
23
|
+
import Q from "./table-footer/index.js";
|
|
24
|
+
import { createTableId as He } from "./util.js";
|
|
25
|
+
import Le from "./table/utils-helper.js";
|
|
26
|
+
import { convertToRows as Ne } from "./table-header/utils-helper.js";
|
|
27
|
+
import De from "./table/style-helper.js";
|
|
28
|
+
import Oe from "./table/key-render-helper.js";
|
|
29
|
+
import { TABLE_INJECTION_KEY as Ve } from "./tokens.js";
|
|
30
|
+
import { hColgroup as N } from "./h-helper.js";
|
|
31
|
+
import { useScrollbar as ze } from "./composables/use-scrollbar.js";
|
|
32
|
+
import { useGlobalConfig as Ie } from "../../config-provider/src/hooks/use-global-config.js";
|
|
33
|
+
const Me = ["data-prefix"], Fe = {
|
|
34
|
+
ref: "hiddenColumns",
|
|
35
|
+
class: "hidden-columns"
|
|
36
|
+
}, ht = /* @__PURE__ */ ye({
|
|
37
|
+
// 上游为 'ElTable';本仓自持组件统一以 Ep* 命名(见文件头注释)。
|
|
38
|
+
name: "EpTable",
|
|
39
|
+
__name: "table",
|
|
40
|
+
props: {
|
|
41
|
+
data: { default: () => [] },
|
|
42
|
+
size: {},
|
|
43
|
+
width: {},
|
|
44
|
+
height: {},
|
|
45
|
+
maxHeight: {},
|
|
46
|
+
fit: { type: Boolean, default: !0 },
|
|
47
|
+
stripe: { type: Boolean },
|
|
48
|
+
border: { type: Boolean },
|
|
49
|
+
rowKey: {},
|
|
50
|
+
context: {},
|
|
51
|
+
showHeader: { type: Boolean, default: !0 },
|
|
52
|
+
showSummary: { type: Boolean },
|
|
53
|
+
sumText: {},
|
|
54
|
+
summaryMethod: {},
|
|
55
|
+
rowClassName: {},
|
|
56
|
+
rowStyle: {},
|
|
57
|
+
cellClassName: {},
|
|
58
|
+
cellStyle: {},
|
|
59
|
+
headerRowClassName: {},
|
|
60
|
+
headerRowStyle: {},
|
|
61
|
+
headerCellClassName: {},
|
|
62
|
+
headerCellStyle: {},
|
|
63
|
+
highlightCurrentRow: { type: Boolean },
|
|
64
|
+
currentRowKey: {},
|
|
65
|
+
emptyText: {},
|
|
66
|
+
expandRowKeys: {},
|
|
67
|
+
defaultExpandAll: { type: Boolean },
|
|
68
|
+
rowExpandable: {},
|
|
69
|
+
defaultSort: {},
|
|
70
|
+
tooltipEffect: {},
|
|
71
|
+
tooltipOptions: {},
|
|
72
|
+
spanMethod: {},
|
|
73
|
+
selectOnIndeterminate: { type: Boolean, default: !0 },
|
|
74
|
+
indent: { default: 16 },
|
|
75
|
+
treeProps: { default: () => ({
|
|
76
|
+
hasChildren: "hasChildren",
|
|
77
|
+
children: "children",
|
|
78
|
+
checkStrictly: !1
|
|
79
|
+
}) },
|
|
80
|
+
lazy: { type: Boolean },
|
|
81
|
+
load: {},
|
|
82
|
+
className: { default: "" },
|
|
83
|
+
style: { type: [Boolean, null, String, Object, Array], default: () => ({}) },
|
|
84
|
+
tableLayout: { default: "fixed" },
|
|
85
|
+
scrollbarAlwaysOn: { type: Boolean },
|
|
86
|
+
flexible: { type: Boolean },
|
|
87
|
+
showOverflowTooltip: { type: [Boolean, Object], default: void 0 },
|
|
88
|
+
tooltipFormatter: {},
|
|
89
|
+
appendFilterPanelTo: {},
|
|
90
|
+
scrollbarTabindex: { default: void 0 },
|
|
91
|
+
allowDragLastColumn: { type: Boolean, default: !0 },
|
|
92
|
+
preserveExpandedContent: { type: Boolean },
|
|
93
|
+
nativeScrollbar: { type: Boolean }
|
|
94
|
+
},
|
|
95
|
+
emits: ["select", "select-all", "selection-change", "cell-mouse-enter", "cell-mouse-leave", "cell-dblclick", "cell-contextmenu", "cell-click", "row-dblclick", "row-click", "row-contextmenu", "header-click", "header-contextmenu", "sort-change", "filter-change", "current-change", "header-dragend", "expand-change", "scroll"],
|
|
96
|
+
setup(t, { expose: Z }) {
|
|
97
|
+
const i = t, { t: g } = Be(), l = Ce("table"), D = Ie("table"), r = be();
|
|
98
|
+
he(Ve, r);
|
|
99
|
+
const o = ke(r, i);
|
|
100
|
+
r.store = o;
|
|
101
|
+
const y = new Ee({
|
|
102
|
+
store: r.store,
|
|
103
|
+
table: r,
|
|
104
|
+
fit: i.fit,
|
|
105
|
+
showHeader: i.showHeader
|
|
106
|
+
});
|
|
107
|
+
r.layout = y;
|
|
108
|
+
const v = p(() => (o.states.data.value || []).length === 0), {
|
|
109
|
+
setCurrentRow: _,
|
|
110
|
+
getSelectionRows: ee,
|
|
111
|
+
getHalfSelectionRows: te,
|
|
112
|
+
toggleRowSelection: le,
|
|
113
|
+
clearSelection: oe,
|
|
114
|
+
clearFilter: ae,
|
|
115
|
+
toggleAllSelection: re,
|
|
116
|
+
toggleRowExpansion: se,
|
|
117
|
+
clearSort: ne,
|
|
118
|
+
sort: ie,
|
|
119
|
+
updateKeyChildren: de
|
|
120
|
+
} = Le(o), {
|
|
121
|
+
isHidden: O,
|
|
122
|
+
renderExpanded: ue,
|
|
123
|
+
setDragVisible: S,
|
|
124
|
+
isGroup: b,
|
|
125
|
+
handleMouseLeave: x,
|
|
126
|
+
handleHeaderFooterMousewheel: C,
|
|
127
|
+
tableSize: V,
|
|
128
|
+
emptyBlockStyle: z,
|
|
129
|
+
resizeProxyVisible: I,
|
|
130
|
+
bodyWidth: M,
|
|
131
|
+
resizeState: F,
|
|
132
|
+
doLayout: B,
|
|
133
|
+
tableBodyStyles: T,
|
|
134
|
+
tableLayout: n,
|
|
135
|
+
scrollbarViewStyle: W,
|
|
136
|
+
scrollbarStyle: A
|
|
137
|
+
} = De(i, y, o, r), { scrollBarRef: K, scrollTo: me, setScrollLeft: ce, setScrollTop: pe } = ze(), k = xe(B, 50), P = He(l.namespace.value), $ = r;
|
|
138
|
+
r.tableId = P, r.state = {
|
|
139
|
+
isGroup: b,
|
|
140
|
+
resizeState: F,
|
|
141
|
+
doLayout: B,
|
|
142
|
+
debouncedUpdateLayout: k
|
|
143
|
+
};
|
|
144
|
+
const E = p(() => i.sumText ?? g("el.table.sumText")), U = p(() => i.emptyText ?? g("el.table.emptyText")), j = p(
|
|
145
|
+
() => {
|
|
146
|
+
var s;
|
|
147
|
+
return i.tooltipEffect ?? ((s = D.value) == null ? void 0 : s.tooltipEffect);
|
|
148
|
+
}
|
|
149
|
+
), G = p(
|
|
150
|
+
() => {
|
|
151
|
+
var s;
|
|
152
|
+
return i.tooltipOptions ?? ((s = D.value) == null ? void 0 : s.tooltipOptions);
|
|
153
|
+
}
|
|
154
|
+
), fe = p(() => Ne(o.states.originColumns.value)[0]);
|
|
155
|
+
return Oe(r), we(() => {
|
|
156
|
+
k.cancel();
|
|
157
|
+
}), Z({
|
|
158
|
+
ns: l,
|
|
159
|
+
layout: y,
|
|
160
|
+
store: o,
|
|
161
|
+
columns: fe,
|
|
162
|
+
handleHeaderFooterMousewheel: C,
|
|
163
|
+
handleMouseLeave: x,
|
|
164
|
+
tableId: P,
|
|
165
|
+
tableSize: V,
|
|
166
|
+
isHidden: O,
|
|
167
|
+
isEmpty: v,
|
|
168
|
+
renderExpanded: ue,
|
|
169
|
+
resizeProxyVisible: I,
|
|
170
|
+
resizeState: F,
|
|
171
|
+
isGroup: b,
|
|
172
|
+
bodyWidth: M,
|
|
173
|
+
tableBodyStyles: T,
|
|
174
|
+
emptyBlockStyle: z,
|
|
175
|
+
debouncedUpdateLayout: k,
|
|
176
|
+
/**
|
|
177
|
+
* @description used in single selection Table, set a certain row selected. If called without any parameter, it will clear selection
|
|
178
|
+
*/
|
|
179
|
+
setCurrentRow: _,
|
|
180
|
+
/**
|
|
181
|
+
* @description returns the currently selected rows
|
|
182
|
+
*/
|
|
183
|
+
getSelectionRows: ee,
|
|
184
|
+
/**
|
|
185
|
+
* @description returns the currently half-selected rows
|
|
186
|
+
*/
|
|
187
|
+
getHalfSelectionRows: te,
|
|
188
|
+
/**
|
|
189
|
+
* @description used in multiple selection Table, toggle if a certain row is selected. With the second parameter, you can directly set if this row is selected
|
|
190
|
+
*/
|
|
191
|
+
toggleRowSelection: le,
|
|
192
|
+
/**
|
|
193
|
+
* @description used in multiple selection Table, clear user selection
|
|
194
|
+
*/
|
|
195
|
+
clearSelection: oe,
|
|
196
|
+
/**
|
|
197
|
+
* @description clear filters of the columns whose `columnKey` are passed in. If no params, clear all filters
|
|
198
|
+
*/
|
|
199
|
+
clearFilter: ae,
|
|
200
|
+
/**
|
|
201
|
+
* @description used in multiple selection Table, toggle select all and deselect all
|
|
202
|
+
*/
|
|
203
|
+
toggleAllSelection: re,
|
|
204
|
+
/**
|
|
205
|
+
* @description used in expandable Table or tree Table, toggle if a certain row is expanded. With the second parameter, you can directly set if this row is expanded or collapsed
|
|
206
|
+
*/
|
|
207
|
+
toggleRowExpansion: se,
|
|
208
|
+
/**
|
|
209
|
+
* @description clear sorting, restore data to the original order
|
|
210
|
+
*/
|
|
211
|
+
clearSort: ne,
|
|
212
|
+
/**
|
|
213
|
+
* @description refresh the layout of Table. When the visibility of Table changes, you may need to call this method to get a correct layout
|
|
214
|
+
*/
|
|
215
|
+
doLayout: B,
|
|
216
|
+
/**
|
|
217
|
+
* @description sort Table manually. Property `prop` is used to set sort column, property `order` is used to set sort order
|
|
218
|
+
*/
|
|
219
|
+
sort: ie,
|
|
220
|
+
/**
|
|
221
|
+
* @description used in lazy Table, must set `rowKey`, update key children
|
|
222
|
+
*/
|
|
223
|
+
updateKeyChildren: de,
|
|
224
|
+
t: g,
|
|
225
|
+
setDragVisible: S,
|
|
226
|
+
context: $,
|
|
227
|
+
computedSumText: E,
|
|
228
|
+
computedEmptyText: U,
|
|
229
|
+
computedTooltipEffect: j,
|
|
230
|
+
computedTooltipOptions: G,
|
|
231
|
+
tableLayout: n,
|
|
232
|
+
scrollbarViewStyle: W,
|
|
233
|
+
scrollbarStyle: A,
|
|
234
|
+
scrollBarRef: K,
|
|
235
|
+
/**
|
|
236
|
+
* @description scrolls to a particular set of coordinates
|
|
237
|
+
*/
|
|
238
|
+
scrollTo: me,
|
|
239
|
+
/**
|
|
240
|
+
* @description set horizontal scroll position
|
|
241
|
+
*/
|
|
242
|
+
setScrollLeft: ce,
|
|
243
|
+
/**
|
|
244
|
+
* @description set vertical scroll position
|
|
245
|
+
*/
|
|
246
|
+
setScrollTop: pe,
|
|
247
|
+
/**
|
|
248
|
+
* @description whether to allow drag the last column
|
|
249
|
+
*/
|
|
250
|
+
allowDragLastColumn: i.allowDragLastColumn
|
|
251
|
+
}), (s, w) => (d(), f("div", {
|
|
252
|
+
ref: "tableWrapper",
|
|
253
|
+
class: a([
|
|
254
|
+
{
|
|
255
|
+
[e(l).m("fit")]: t.fit,
|
|
256
|
+
[e(l).m("striped")]: t.stripe,
|
|
257
|
+
[e(l).m("border")]: t.border || e(b),
|
|
258
|
+
[e(l).m("hidden")]: e(O),
|
|
259
|
+
[e(l).m("group")]: e(b),
|
|
260
|
+
[e(l).m("fluid-height")]: t.maxHeight,
|
|
261
|
+
[e(l).m("scrollable-x")]: e(y).scrollX.value,
|
|
262
|
+
[e(l).m("scrollable-y")]: e(y).scrollY.value,
|
|
263
|
+
[e(l).m("enable-row-hover")]: !e(o).states.isComplex.value,
|
|
264
|
+
[e(l).m("enable-row-transition")]: (e(o).states.data.value || []).length !== 0 && (e(o).states.data.value || []).length < 100,
|
|
265
|
+
"has-footer": t.showSummary
|
|
266
|
+
},
|
|
267
|
+
e(l).m(e(V)),
|
|
268
|
+
t.className,
|
|
269
|
+
e(l).b(),
|
|
270
|
+
e(l).m(`layout-${e(n)}`)
|
|
271
|
+
]),
|
|
272
|
+
style: h(t.style),
|
|
273
|
+
"data-prefix": e(l).namespace.value,
|
|
274
|
+
onMouseleave: w[1] || (w[1] = //@ts-ignore
|
|
275
|
+
(...R) => e(x) && e(x)(...R))
|
|
276
|
+
}, [
|
|
277
|
+
u("div", {
|
|
278
|
+
ref: "tableInnerWrapper",
|
|
279
|
+
class: a(e(l).e("inner-wrapper"))
|
|
280
|
+
}, [
|
|
281
|
+
u("div", Fe, [
|
|
282
|
+
H(s.$slots, "default")
|
|
283
|
+
], 512),
|
|
284
|
+
t.showHeader && e(n) === "fixed" ? L((d(), f("div", {
|
|
285
|
+
key: 0,
|
|
286
|
+
ref: "headerWrapper",
|
|
287
|
+
class: a(e(l).e("header-wrapper"))
|
|
288
|
+
}, [
|
|
289
|
+
u("table", {
|
|
290
|
+
ref: "tableHeader",
|
|
291
|
+
class: a(e(l).e("header")),
|
|
292
|
+
style: h(e(T)),
|
|
293
|
+
border: "0",
|
|
294
|
+
cellpadding: "0",
|
|
295
|
+
cellspacing: "0"
|
|
296
|
+
}, [
|
|
297
|
+
m(e(N), {
|
|
298
|
+
columns: e(o).states.columns.value,
|
|
299
|
+
"table-layout": e(n)
|
|
300
|
+
}, null, 8, ["columns", "table-layout"]),
|
|
301
|
+
m(e(q), {
|
|
302
|
+
ref: "tableHeaderRef",
|
|
303
|
+
border: t.border,
|
|
304
|
+
"default-sort": t.defaultSort,
|
|
305
|
+
store: e(o),
|
|
306
|
+
"append-filter-panel-to": t.appendFilterPanelTo,
|
|
307
|
+
"allow-drag-last-column": t.allowDragLastColumn,
|
|
308
|
+
onSetDragVisible: e(S)
|
|
309
|
+
}, null, 8, ["border", "default-sort", "store", "append-filter-panel-to", "allow-drag-last-column", "onSetDragVisible"])
|
|
310
|
+
], 6)
|
|
311
|
+
], 2)), [
|
|
312
|
+
[e(X), e(C)]
|
|
313
|
+
]) : c("", !0),
|
|
314
|
+
u("div", {
|
|
315
|
+
ref: "bodyWrapper",
|
|
316
|
+
class: a(e(l).e("body-wrapper"))
|
|
317
|
+
}, [
|
|
318
|
+
m(e(Te), {
|
|
319
|
+
ref_key: "scrollBarRef",
|
|
320
|
+
ref: K,
|
|
321
|
+
"view-style": e(W),
|
|
322
|
+
"wrap-style": e(A),
|
|
323
|
+
always: t.scrollbarAlwaysOn,
|
|
324
|
+
tabindex: t.scrollbarTabindex,
|
|
325
|
+
native: t.nativeScrollbar,
|
|
326
|
+
onScroll: w[0] || (w[0] = (R) => s.$emit("scroll", R))
|
|
327
|
+
}, {
|
|
328
|
+
default: ge(() => [
|
|
329
|
+
u("table", {
|
|
330
|
+
ref: "tableBody",
|
|
331
|
+
class: a(e(l).e("body")),
|
|
332
|
+
cellspacing: "0",
|
|
333
|
+
cellpadding: "0",
|
|
334
|
+
border: "0",
|
|
335
|
+
style: h({
|
|
336
|
+
width: e(M),
|
|
337
|
+
tableLayout: e(n)
|
|
338
|
+
})
|
|
339
|
+
}, [
|
|
340
|
+
m(e(N), {
|
|
341
|
+
columns: e(o).states.columns.value,
|
|
342
|
+
"table-layout": e(n)
|
|
343
|
+
}, null, 8, ["columns", "table-layout"]),
|
|
344
|
+
t.showHeader && e(n) === "auto" ? (d(), Y(e(q), {
|
|
345
|
+
key: 0,
|
|
346
|
+
ref: "tableHeaderRef",
|
|
347
|
+
class: a(e(l).e("body-header")),
|
|
348
|
+
border: t.border,
|
|
349
|
+
"default-sort": t.defaultSort,
|
|
350
|
+
store: e(o),
|
|
351
|
+
"append-filter-panel-to": t.appendFilterPanelTo,
|
|
352
|
+
onSetDragVisible: e(S)
|
|
353
|
+
}, null, 8, ["class", "border", "default-sort", "store", "append-filter-panel-to", "onSetDragVisible"])) : c("", !0),
|
|
354
|
+
m(e(Re), {
|
|
355
|
+
context: e($),
|
|
356
|
+
highlight: t.highlightCurrentRow,
|
|
357
|
+
"row-class-name": t.rowClassName,
|
|
358
|
+
"tooltip-effect": j.value,
|
|
359
|
+
"tooltip-options": G.value,
|
|
360
|
+
"row-style": t.rowStyle,
|
|
361
|
+
store: e(o),
|
|
362
|
+
stripe: t.stripe
|
|
363
|
+
}, null, 8, ["context", "highlight", "row-class-name", "tooltip-effect", "tooltip-options", "row-style", "store", "stripe"]),
|
|
364
|
+
t.showSummary && e(n) === "auto" ? (d(), Y(e(Q), {
|
|
365
|
+
key: 1,
|
|
366
|
+
class: a(e(l).e("body-footer")),
|
|
367
|
+
border: t.border,
|
|
368
|
+
"default-sort": t.defaultSort,
|
|
369
|
+
store: e(o),
|
|
370
|
+
"sum-text": E.value,
|
|
371
|
+
"summary-method": t.summaryMethod
|
|
372
|
+
}, null, 8, ["class", "border", "default-sort", "store", "sum-text", "summary-method"])) : c("", !0)
|
|
373
|
+
], 6),
|
|
374
|
+
v.value ? (d(), f("div", {
|
|
375
|
+
key: 0,
|
|
376
|
+
ref: "emptyBlock",
|
|
377
|
+
style: h(e(z)),
|
|
378
|
+
class: a(e(l).e("empty-block"))
|
|
379
|
+
}, [
|
|
380
|
+
u("span", {
|
|
381
|
+
class: a(e(l).e("empty-text"))
|
|
382
|
+
}, [
|
|
383
|
+
H(s.$slots, "empty", {}, () => [
|
|
384
|
+
ve(Se(U.value), 1)
|
|
385
|
+
])
|
|
386
|
+
], 2)
|
|
387
|
+
], 6)) : c("", !0),
|
|
388
|
+
s.$slots.append ? (d(), f("div", {
|
|
389
|
+
key: 1,
|
|
390
|
+
ref: "appendWrapper",
|
|
391
|
+
class: a(e(l).e("append-wrapper"))
|
|
392
|
+
}, [
|
|
393
|
+
H(s.$slots, "append")
|
|
394
|
+
], 2)) : c("", !0)
|
|
395
|
+
]),
|
|
396
|
+
_: 3
|
|
397
|
+
}, 8, ["view-style", "wrap-style", "always", "tabindex", "native"])
|
|
398
|
+
], 2),
|
|
399
|
+
t.showSummary && e(n) === "fixed" ? L((d(), f("div", {
|
|
400
|
+
key: 1,
|
|
401
|
+
ref: "footerWrapper",
|
|
402
|
+
class: a(e(l).e("footer-wrapper"))
|
|
403
|
+
}, [
|
|
404
|
+
u("table", {
|
|
405
|
+
class: a(e(l).e("footer")),
|
|
406
|
+
cellspacing: "0",
|
|
407
|
+
cellpadding: "0",
|
|
408
|
+
border: "0",
|
|
409
|
+
style: h(e(T))
|
|
410
|
+
}, [
|
|
411
|
+
m(e(N), {
|
|
412
|
+
columns: e(o).states.columns.value,
|
|
413
|
+
"table-layout": e(n)
|
|
414
|
+
}, null, 8, ["columns", "table-layout"]),
|
|
415
|
+
m(e(Q), {
|
|
416
|
+
border: t.border,
|
|
417
|
+
"default-sort": t.defaultSort,
|
|
418
|
+
store: e(o),
|
|
419
|
+
"sum-text": E.value,
|
|
420
|
+
"summary-method": t.summaryMethod
|
|
421
|
+
}, null, 8, ["border", "default-sort", "store", "sum-text", "summary-method"])
|
|
422
|
+
], 6)
|
|
423
|
+
], 2)), [
|
|
424
|
+
[J, !v.value],
|
|
425
|
+
[e(X), e(C)]
|
|
426
|
+
]) : c("", !0),
|
|
427
|
+
t.border || e(b) ? (d(), f("div", {
|
|
428
|
+
key: 2,
|
|
429
|
+
class: a(e(l).e("border-left-patch"))
|
|
430
|
+
}, null, 2)) : c("", !0)
|
|
431
|
+
], 2),
|
|
432
|
+
L(u("div", {
|
|
433
|
+
ref: "resizeProxy",
|
|
434
|
+
class: a(e(l).e("column-resize-proxy"))
|
|
435
|
+
}, null, 2), [
|
|
436
|
+
[J, e(I)]
|
|
437
|
+
])
|
|
438
|
+
], 46, Me));
|
|
439
|
+
}
|
|
440
|
+
});
|
|
441
|
+
export {
|
|
442
|
+
ht as default
|
|
443
|
+
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { UseTooltipProps } from '@element-plus/components/tooltip';
|
|
2
|
+
import type { DefaultRow, Table, TreeProps } from './table/defaults';
|
|
3
|
+
import type { TableColumnCtx } from './table-column/defaults';
|
|
4
|
+
import type { CSSProperties, VNode, VNodeArrayChildren } from 'vue';
|
|
5
|
+
export declare const createTableId: (namespace: string) => string;
|
|
6
|
+
export declare const createTableColumnId: (parentId: string) => string;
|
|
7
|
+
export type TableOverflowTooltipOptions = Partial<Omit<UseTooltipProps, 'content' | 'rawContent' | 'persistent' | 'visible' | 'autoClose' | 'referenceEl' | 'triggerTargetEl' | 'virtualRef' | 'virtualTriggering'>>;
|
|
8
|
+
export type TableOverflowTooltipFormatter<T extends DefaultRow> = (data: {
|
|
9
|
+
row: T;
|
|
10
|
+
column: TableColumnCtx<T>;
|
|
11
|
+
cellValue: any;
|
|
12
|
+
}) => VNode | string;
|
|
13
|
+
type RemovePopperFn = (() => void) & {
|
|
14
|
+
trigger?: HTMLElement;
|
|
15
|
+
vm?: VNode;
|
|
16
|
+
};
|
|
17
|
+
export declare const getCell: (event: Event) => HTMLTableCellElement | null;
|
|
18
|
+
export declare const orderBy: <T extends DefaultRow>(array: T[], sortKey: string | null, reverse: string | number | null, sortMethod: TableColumnCtx<T>["sortMethod"] | null, sortBy: string | string[] | ((a: T, index: number, array?: T[]) => string)) => T[];
|
|
19
|
+
export declare const getColumnById: <T extends DefaultRow>(table: {
|
|
20
|
+
columns: TableColumnCtx<T>[];
|
|
21
|
+
}, columnId: string) => null | TableColumnCtx<T>;
|
|
22
|
+
export declare const getColumnByKey: <T extends DefaultRow>(table: {
|
|
23
|
+
columns: TableColumnCtx<T>[];
|
|
24
|
+
}, columnKey: string) => TableColumnCtx<T>;
|
|
25
|
+
export declare const getColumnByCell: <T extends DefaultRow>(table: {
|
|
26
|
+
columns: TableColumnCtx<T>[];
|
|
27
|
+
}, cell: HTMLElement, namespace: string) => null | TableColumnCtx<T>;
|
|
28
|
+
export declare const getRowIdentity: <T extends DefaultRow>(row: T, rowKey: string | ((row: T) => string) | null) => string;
|
|
29
|
+
export declare const getKeysMap: <T extends DefaultRow>(array: T[], rowKey: string | null, flatten?: boolean, childrenKey?: string) => Record<PropertyKey, {
|
|
30
|
+
row: T;
|
|
31
|
+
index: number;
|
|
32
|
+
}>;
|
|
33
|
+
export declare function mergeOptions<T extends DefaultRow, K extends DefaultRow>(defaults: T, config: K): T & K;
|
|
34
|
+
export declare function parseWidth(width?: number | string): number | string;
|
|
35
|
+
export declare function parseMinWidth(minWidth: number | string): number | string;
|
|
36
|
+
export declare function parseHeight(height: number | string | null): string | number | null;
|
|
37
|
+
export declare function compose(...funcs: ((...args: any[]) => void)[]): (...args: any[]) => void;
|
|
38
|
+
export declare function toggleRowStatus<T extends DefaultRow>(statusArr: T[], row: T, newVal?: boolean, tableTreeProps?: TreeProps, selectable?: ((row: T, index: number) => boolean) | null, rowIndex?: number, rowKey?: string | null): boolean;
|
|
39
|
+
export declare function walkTreeNode<T extends DefaultRow>(root: T[], cb: (parent: any, children: T | T[] | null, level: number) => void, childrenKey?: string, lazyKey?: string, lazy?: boolean): void;
|
|
40
|
+
export declare let removePopper: RemovePopperFn | null;
|
|
41
|
+
export declare function createTablePopper<T extends DefaultRow>(props: TableOverflowTooltipOptions, popperContent: string, row: T, column: TableColumnCtx<T> | null, trigger: HTMLElement | null, table: Table<DefaultRow>): void;
|
|
42
|
+
export declare const isFixedColumn: <T extends DefaultRow>(index: number, fixed: string | boolean | undefined, store: any, realColumns?: TableColumnCtx<T>[]) => {
|
|
43
|
+
direction: string;
|
|
44
|
+
start: number;
|
|
45
|
+
after: number;
|
|
46
|
+
} | {
|
|
47
|
+
direction?: undefined;
|
|
48
|
+
start?: undefined;
|
|
49
|
+
after?: undefined;
|
|
50
|
+
};
|
|
51
|
+
export declare const getFixedColumnsClass: <T extends DefaultRow>(namespace: string, index: number, fixed: string | boolean | undefined, store: any, realColumns?: TableColumnCtx<T>[], offset?: number) => string[];
|
|
52
|
+
export declare const getFixedColumnOffset: <T extends DefaultRow>(index: number, fixed: string | boolean | undefined, store: any, realColumns?: TableColumnCtx<T>[]) => CSSProperties | undefined;
|
|
53
|
+
export declare const ensurePosition: <T extends CSSProperties>(style: T | undefined, key: keyof T) => void;
|
|
54
|
+
export declare function ensureValidVNode(vnodes: VNodeArrayChildren): VNodeArrayChildren | null;
|
|
55
|
+
export {};
|