tabula-vue 1.0.0 → 1.0.1
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/es/component.mjs +2 -0
- package/es/components/dialog/index.d.ts +30 -30
- package/es/components/dialog/src/index.vue.d.ts +2 -2
- package/es/components/dialog-form/index.d.ts +2 -2
- package/es/components/dialog-form/src/index.vue.d.ts +2 -2
- package/es/components/display-item/index.d.ts +25 -25
- package/es/components/display-item/src/index.vue.d.ts +7 -7
- package/es/components/drawer-form/index.d.ts +50 -50
- package/es/components/drawer-form/src/index.vue.d.ts +10 -10
- package/es/components/form/index.d.ts +99 -99
- package/es/components/form/src/form-content.vue.d.ts +12 -12
- package/es/components/form/src/index.vue.d.ts +11 -11
- package/es/components/form-item/index.d.ts +80 -80
- package/es/components/form-item/src/index.vue.d.ts +9 -9
- package/es/components/index.d.ts +1 -0
- package/es/components/index.mjs +5 -0
- package/es/components/input-tag/index.d.ts +6 -6
- package/es/components/input-tag/src/index.vue.d.ts +6 -6
- package/es/components/layout/index.d.ts +30 -30
- package/es/components/layout/src/index.vue.d.ts +10 -10
- package/es/components/page/index.d.ts +1613 -1123
- package/es/components/page/src/index.vue.d.ts +618 -430
- package/es/components/page/src/index.vue2.mjs +31 -10
- package/es/components/popover/index.d.ts +49 -49
- package/es/components/popover/src/index.vue.d.ts +3 -3
- package/es/components/render/index.d.ts +14 -14
- package/es/components/render/src/index.vue.d.ts +1 -1
- package/es/components/search/index.d.ts +298 -298
- package/es/components/search/src/index.vue.d.ts +84 -84
- package/es/components/sidebar/index.d.ts +31 -31
- package/es/components/sidebar/src/index.vue.d.ts +5 -5
- package/es/components/table/index.d.ts +165 -180
- package/es/components/table/index.mjs +3 -0
- package/es/components/table/src/index.vue.d.ts +12 -21
- package/es/components/table/src/index.vue2.mjs +11 -34
- package/es/components/table/src/table-action-bar-content.vue.d.ts +78 -0
- package/es/components/table/src/table-action-bar-content.vue.mjs +6 -0
- package/es/components/table/src/table-action-bar-content.vue2.mjs +395 -0
- package/es/components/table/src/table-action-bar.vue.d.ts +4 -4
- package/es/components/table/src/table-action-bar.vue2.mjs +30 -353
- package/es/components/table/src/table-column-drag-sort.vue.d.ts +1 -1
- package/es/components/table/src/table-column-index.vue.d.ts +1 -1
- package/es/components/table/src/table-column.vue.d.ts +22 -29
- package/es/components/table/src/table-column.vue2.mjs +4 -57
- package/es/components/table/src/table-title-bar.vue.d.ts +2 -2
- package/es/components/table/src/type.d.ts +0 -11
- package/es/components/table/src/use-columns.d.ts +26 -0
- package/es/components/table/src/use-columns.mjs +40 -0
- package/es/components/table-v2/index.d.ts +174 -0
- package/es/components/table-v2/index.mjs +7 -0
- package/es/components/table-v2/src/column-converter.d.ts +27 -0
- package/es/components/table-v2/src/column-converter.mjs +42 -0
- package/es/components/table-v2/src/index.vue.d.ts +157 -0
- package/es/components/table-v2/src/index.vue.mjs +6 -0
- package/es/components/table-v2/src/index.vue2.mjs +491 -0
- package/es/components/table-v2/src/special-columns.d.ts +61 -0
- package/es/components/table-v2/src/special-columns.mjs +76 -0
- package/es/components/table-v2/src/table-v2-cell.d.ts +104 -0
- package/es/components/table-v2/src/table-v2-cell.mjs +139 -0
- package/es/components/table-v2/src/table-v2-header-cell.vue.d.ts +61 -0
- package/es/components/table-v2/src/table-v2-header-cell.vue.mjs +6 -0
- package/es/components/table-v2/src/table-v2-header-cell.vue2.mjs +92 -0
- package/es/components/table-v2/src/type.d.ts +95 -0
- package/es/components/table-v2/src/type.mjs +1 -0
- package/es/components/table-v2/src/use-table-v2-columns.d.ts +43 -0
- package/es/components/table-v2/src/use-table-v2-columns.mjs +47 -0
- package/es/components/table-v2/style/css.d.ts +17 -0
- package/es/components/table-v2/style/css.mjs +17 -0
- package/es/components/table-v2/style/index.d.ts +17 -0
- package/es/components/table-v2/style/index.mjs +17 -0
- package/es/index.mjs +5 -0
- package/es/version.d.ts +1 -1
- package/es/version.mjs +1 -1
- package/index.css +1 -1
- package/index.js +1111 -218
- package/index.min.js +5 -6
- package/index.min.mjs +5 -6
- package/index.mjs +1109 -221
- package/lib/component.js +40 -38
- package/lib/components/dialog/index.d.ts +30 -30
- package/lib/components/dialog/src/index.vue.d.ts +2 -2
- package/lib/components/dialog-form/index.d.ts +2 -2
- package/lib/components/dialog-form/src/index.vue.d.ts +2 -2
- package/lib/components/display-item/index.d.ts +25 -25
- package/lib/components/display-item/src/index.vue.d.ts +7 -7
- package/lib/components/drawer-form/index.d.ts +50 -50
- package/lib/components/drawer-form/src/index.vue.d.ts +10 -10
- package/lib/components/form/index.d.ts +99 -99
- package/lib/components/form/src/form-content.vue.d.ts +12 -12
- package/lib/components/form/src/index.vue.d.ts +11 -11
- package/lib/components/form-item/index.d.ts +80 -80
- package/lib/components/form-item/src/index.vue.d.ts +9 -9
- package/lib/components/index.d.ts +1 -0
- package/lib/components/index.js +49 -39
- package/lib/components/input-tag/index.d.ts +6 -6
- package/lib/components/input-tag/src/index.vue.d.ts +6 -6
- package/lib/components/layout/index.d.ts +30 -30
- package/lib/components/layout/src/index.vue.d.ts +10 -10
- package/lib/components/page/index.d.ts +1613 -1123
- package/lib/components/page/src/index.vue.d.ts +618 -430
- package/lib/components/page/src/index.vue2.js +34 -13
- package/lib/components/popover/index.d.ts +49 -49
- package/lib/components/popover/src/index.vue.d.ts +3 -3
- package/lib/components/render/index.d.ts +14 -14
- package/lib/components/render/src/index.vue.d.ts +1 -1
- package/lib/components/search/index.d.ts +298 -298
- package/lib/components/search/src/index.vue.d.ts +84 -84
- package/lib/components/sidebar/index.d.ts +31 -31
- package/lib/components/sidebar/src/index.vue.d.ts +5 -5
- package/lib/components/table/index.d.ts +165 -180
- package/lib/components/table/index.js +6 -0
- package/lib/components/table/src/index.vue.d.ts +12 -21
- package/lib/components/table/src/index.vue2.js +10 -33
- package/lib/components/table/src/table-action-bar-content.vue.d.ts +78 -0
- package/lib/components/table/src/table-action-bar-content.vue.js +10 -0
- package/lib/components/table/src/table-action-bar-content.vue2.js +399 -0
- package/lib/components/table/src/table-action-bar.vue.d.ts +4 -4
- package/lib/components/table/src/table-action-bar.vue2.js +28 -351
- package/lib/components/table/src/table-column-drag-sort.vue.d.ts +1 -1
- package/lib/components/table/src/table-column-index.vue.d.ts +1 -1
- package/lib/components/table/src/table-column.vue.d.ts +22 -29
- package/lib/components/table/src/table-column.vue2.js +2 -55
- package/lib/components/table/src/table-title-bar.vue.d.ts +2 -2
- package/lib/components/table/src/type.d.ts +0 -11
- package/lib/components/table/src/use-columns.d.ts +26 -0
- package/lib/components/table/src/use-columns.js +42 -0
- package/lib/components/table-v2/index.d.ts +174 -0
- package/lib/components/table-v2/index.js +10 -0
- package/lib/components/table-v2/src/column-converter.d.ts +27 -0
- package/lib/components/table-v2/src/column-converter.js +44 -0
- package/lib/components/table-v2/src/index.vue.d.ts +157 -0
- package/lib/components/table-v2/src/index.vue.js +10 -0
- package/lib/components/table-v2/src/index.vue2.js +495 -0
- package/lib/components/table-v2/src/special-columns.d.ts +61 -0
- package/lib/components/table-v2/src/special-columns.js +80 -0
- package/lib/components/table-v2/src/table-v2-cell.d.ts +104 -0
- package/lib/components/table-v2/src/table-v2-cell.js +143 -0
- package/lib/components/table-v2/src/table-v2-header-cell.vue.d.ts +61 -0
- package/lib/components/table-v2/src/table-v2-header-cell.vue.js +10 -0
- package/lib/components/table-v2/src/table-v2-header-cell.vue2.js +96 -0
- package/lib/components/table-v2/src/type.d.ts +95 -0
- package/lib/components/table-v2/src/type.js +2 -0
- package/lib/components/table-v2/src/use-table-v2-columns.d.ts +43 -0
- package/lib/components/table-v2/src/use-table-v2-columns.js +51 -0
- package/lib/components/table-v2/style/css.d.ts +17 -0
- package/lib/components/table-v2/style/css.js +20 -0
- package/lib/components/table-v2/style/index.d.ts +17 -0
- package/lib/components/table-v2/style/index.js +20 -0
- package/lib/index.js +49 -39
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/locale/en.js +1 -1
- package/locale/en.min.js +1 -1
- package/locale/en.min.mjs +1 -1
- package/locale/en.mjs +1 -1
- package/locale/ja.js +1 -1
- package/locale/ja.min.js +1 -1
- package/locale/ja.min.mjs +1 -1
- package/locale/ja.mjs +1 -1
- package/locale/ko.js +1 -1
- package/locale/ko.min.js +1 -1
- package/locale/ko.min.mjs +1 -1
- package/locale/ko.mjs +1 -1
- package/locale/zh-cn.js +1 -1
- package/locale/zh-cn.min.js +1 -1
- package/locale/zh-cn.min.mjs +1 -1
- package/locale/zh-cn.mjs +1 -1
- package/locale/zh-hk.js +1 -1
- package/locale/zh-hk.min.js +1 -1
- package/locale/zh-hk.min.mjs +1 -1
- package/locale/zh-hk.mjs +1 -1
- package/locale/zh-tw.js +1 -1
- package/locale/zh-tw.min.js +1 -1
- package/locale/zh-tw.min.mjs +1 -1
- package/locale/zh-tw.mjs +1 -1
- package/package.json +1 -1
- package/theme-chalk/index.css +1 -1
- package/theme-chalk/plus-table-v2.css +1 -0
- package/theme-chalk/src/index.scss +1 -0
- package/theme-chalk/src/table-v2.scss +71 -0
|
@@ -0,0 +1,399 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var vue = require('vue');
|
|
6
|
+
var iconsVue = require('@element-plus/icons-vue');
|
|
7
|
+
var elementPlus = require('element-plus');
|
|
8
|
+
require('../../utils/index.js');
|
|
9
|
+
require('../../../hooks/index.js');
|
|
10
|
+
require('../../../constants/index.js');
|
|
11
|
+
var useLocale = require('../../../hooks/useLocale.js');
|
|
12
|
+
var form = require('../../../constants/form.js');
|
|
13
|
+
var is = require('../../utils/is.js');
|
|
14
|
+
|
|
15
|
+
const _hoisted_1 = {
|
|
16
|
+
key: 0,
|
|
17
|
+
class: "plus-table-action-bar__dropdown__link"
|
|
18
|
+
};
|
|
19
|
+
const _hoisted_2 = { class: "plus-table-action-bar__dropdown__link" };
|
|
20
|
+
const _hoisted_3 = { class: "plus-table-action-bar__more-text" };
|
|
21
|
+
var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
22
|
+
...{
|
|
23
|
+
name: "PlusTableActionBarContent"
|
|
24
|
+
},
|
|
25
|
+
__name: "table-action-bar-content",
|
|
26
|
+
props: {
|
|
27
|
+
row: {},
|
|
28
|
+
index: {},
|
|
29
|
+
rest: { default: () => ({}) },
|
|
30
|
+
showNumber: { type: [Number, Function], default: 3 },
|
|
31
|
+
showLimitIncludeMore: { type: Boolean, default: false },
|
|
32
|
+
type: { default: "link" },
|
|
33
|
+
buttons: { default: () => [] },
|
|
34
|
+
confirmType: { default: "messageBox" },
|
|
35
|
+
moreType: { default: "text" }
|
|
36
|
+
},
|
|
37
|
+
emits: ["clickAction", "clickActionConfirmCancel"],
|
|
38
|
+
setup(__props, { emit: __emit }) {
|
|
39
|
+
const props = __props;
|
|
40
|
+
const emit = __emit;
|
|
41
|
+
const { t } = useLocale.useLocale();
|
|
42
|
+
const hideOnClick = vue.ref(true);
|
|
43
|
+
const formRefs = vue.inject(form.TableFormRefInjectionKey);
|
|
44
|
+
const getButtonKey = (buttonRow, row, index) => {
|
|
45
|
+
var _a, _b;
|
|
46
|
+
const text = is.isFunction(buttonRow.text) ? buttonRow.text(row, index, buttonRow) : buttonRow.text;
|
|
47
|
+
return String((_b = (_a = vue.unref(text)) != null ? _a : buttonRow.code) != null ? _b : "");
|
|
48
|
+
};
|
|
49
|
+
const getSubButtons = (row, index) => {
|
|
50
|
+
const data = props.buttons.filter((item) => {
|
|
51
|
+
if (is.isFunction(item.show)) {
|
|
52
|
+
const tempFunction = item.show;
|
|
53
|
+
const isShow = tempFunction(row, index, item);
|
|
54
|
+
return vue.unref(isShow) !== false;
|
|
55
|
+
}
|
|
56
|
+
return vue.unref(item.show) !== false;
|
|
57
|
+
});
|
|
58
|
+
const showNumber = is.isFunction(props.showNumber) ? props.showNumber(row, index) : props.showNumber;
|
|
59
|
+
const showMore = data.length > showNumber;
|
|
60
|
+
if (!showMore) {
|
|
61
|
+
return {
|
|
62
|
+
showMore,
|
|
63
|
+
preButtons: data,
|
|
64
|
+
nextButtons: []
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
if (props.showLimitIncludeMore) {
|
|
68
|
+
return {
|
|
69
|
+
showMore,
|
|
70
|
+
preButtons: data.slice(0, showNumber - 1),
|
|
71
|
+
nextButtons: data.slice(showNumber - 1)
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
return {
|
|
75
|
+
showMore,
|
|
76
|
+
preButtons: data.slice(0, showNumber),
|
|
77
|
+
nextButtons: data.slice(showNumber)
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
const createCallbackParams = (params, e) => {
|
|
81
|
+
var _a;
|
|
82
|
+
return {
|
|
83
|
+
/**
|
|
84
|
+
* 解析后的按钮数据中的text
|
|
85
|
+
* @version v0.1.17
|
|
86
|
+
*/
|
|
87
|
+
text: params.text,
|
|
88
|
+
row: params.row,
|
|
89
|
+
buttonRow: params.buttonRow,
|
|
90
|
+
index: params.index,
|
|
91
|
+
rowIndex: params.index,
|
|
92
|
+
e,
|
|
93
|
+
formRefs: (_a = formRefs == null ? void 0 : formRefs.value) == null ? void 0 : _a[params.index],
|
|
94
|
+
...params.rest
|
|
95
|
+
};
|
|
96
|
+
};
|
|
97
|
+
const getConfirmMsg = (buttonRow, callbackParams) => {
|
|
98
|
+
var _a, _b;
|
|
99
|
+
let message = t("plus.table.confirmToPerformThisOperation");
|
|
100
|
+
let title = t("plus.table.prompt");
|
|
101
|
+
let options = void 0;
|
|
102
|
+
let appContext = null;
|
|
103
|
+
if (is.isPlainObject(buttonRow.confirm)) {
|
|
104
|
+
const tempTitle = is.isFunction(buttonRow.confirm.title) ? buttonRow.confirm.title(callbackParams) : buttonRow.confirm.title;
|
|
105
|
+
if (tempTitle) {
|
|
106
|
+
title = tempTitle;
|
|
107
|
+
}
|
|
108
|
+
const tempMessage = is.isFunction(buttonRow.confirm.message) ? buttonRow.confirm.message(callbackParams) : buttonRow.confirm.message;
|
|
109
|
+
if (tempMessage) {
|
|
110
|
+
message = tempMessage;
|
|
111
|
+
}
|
|
112
|
+
options = (_a = buttonRow.confirm) == null ? void 0 : _a.options;
|
|
113
|
+
appContext = (_b = buttonRow.confirm) == null ? void 0 : _b.appContext;
|
|
114
|
+
}
|
|
115
|
+
return { message, title, options, appContext };
|
|
116
|
+
};
|
|
117
|
+
const render = (row, buttonRow, index, rest) => {
|
|
118
|
+
var _a;
|
|
119
|
+
const buttonRowProps = is.isFunction(buttonRow.props) ? buttonRow.props(row, index, buttonRow) : vue.unref(buttonRow.props);
|
|
120
|
+
const text = is.isFunction(buttonRow.text) ? vue.unref(buttonRow.text(row, index, buttonRow)) : vue.unref(buttonRow.text);
|
|
121
|
+
const params = {
|
|
122
|
+
text,
|
|
123
|
+
row,
|
|
124
|
+
buttonRow,
|
|
125
|
+
index,
|
|
126
|
+
rest
|
|
127
|
+
};
|
|
128
|
+
const getPopconfirmTitle = () => props.confirmType === "popconfirm" && buttonRow.confirm ? getConfirmMsg(buttonRow, createCallbackParams(params)).message : text;
|
|
129
|
+
if (props.type === "icon") {
|
|
130
|
+
return vue.h(
|
|
131
|
+
elementPlus.ElTooltip,
|
|
132
|
+
{ placement: "top", content: text, ...buttonRow.tooltipProps },
|
|
133
|
+
() => {
|
|
134
|
+
var _a2;
|
|
135
|
+
return props.confirmType === "popconfirm" && buttonRow.confirm ? vue.h(
|
|
136
|
+
"span",
|
|
137
|
+
{
|
|
138
|
+
class: "el-icon"
|
|
139
|
+
},
|
|
140
|
+
vue.h(
|
|
141
|
+
elementPlus.ElPopconfirm,
|
|
142
|
+
{
|
|
143
|
+
trigger: "click",
|
|
144
|
+
...is.isPlainObject(buttonRow.confirm) ? (_a2 = buttonRow.confirm) == null ? void 0 : _a2.popconfirmProps : {},
|
|
145
|
+
title: getPopconfirmTitle(),
|
|
146
|
+
onConfirm: (event) => handleConfirm(createCallbackParams(params, event)),
|
|
147
|
+
onCancel: (event) => handleCancel(createCallbackParams(params, event))
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
reference: () => vue.withDirectives(
|
|
151
|
+
vue.h(
|
|
152
|
+
elementPlus.ElIcon,
|
|
153
|
+
{
|
|
154
|
+
size: 16,
|
|
155
|
+
style: { margin: 0 },
|
|
156
|
+
...buttonRowProps,
|
|
157
|
+
onClick: () => {
|
|
158
|
+
hideOnClick.value = false;
|
|
159
|
+
if (is.isFunction(buttonRow.onClick)) {
|
|
160
|
+
buttonRow.onClick(createCallbackParams(params));
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
},
|
|
164
|
+
() => buttonRow.icon ? vue.h(buttonRow.icon) : ""
|
|
165
|
+
),
|
|
166
|
+
buttonRow.directives || []
|
|
167
|
+
)
|
|
168
|
+
}
|
|
169
|
+
)
|
|
170
|
+
) : vue.withDirectives(
|
|
171
|
+
vue.h(
|
|
172
|
+
elementPlus.ElIcon,
|
|
173
|
+
{
|
|
174
|
+
size: 16,
|
|
175
|
+
...buttonRowProps,
|
|
176
|
+
onClick: (event) => handleClickAction(createCallbackParams(params, event))
|
|
177
|
+
},
|
|
178
|
+
() => buttonRow.icon ? vue.h(buttonRow.icon) : ""
|
|
179
|
+
),
|
|
180
|
+
buttonRow.directives || []
|
|
181
|
+
);
|
|
182
|
+
}
|
|
183
|
+
);
|
|
184
|
+
} else {
|
|
185
|
+
const Tag = props.type === "button" ? elementPlus.ElButton : elementPlus.ElLink;
|
|
186
|
+
const defaultProps = props.type === "link" ? { href: "javaScript:;" } : {};
|
|
187
|
+
return props.confirmType === "popconfirm" && buttonRow.confirm ? vue.h(
|
|
188
|
+
elementPlus.ElPopconfirm,
|
|
189
|
+
{
|
|
190
|
+
trigger: "click",
|
|
191
|
+
...is.isPlainObject(buttonRow.confirm) ? (_a = buttonRow.confirm) == null ? void 0 : _a.popconfirmProps : {},
|
|
192
|
+
title: getPopconfirmTitle(),
|
|
193
|
+
onConfirm: (event) => handleConfirm(createCallbackParams(params, event)),
|
|
194
|
+
onCancel: (event) => handleCancel(createCallbackParams(params, event))
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
reference: () => vue.withDirectives(
|
|
198
|
+
vue.h(
|
|
199
|
+
Tag,
|
|
200
|
+
{
|
|
201
|
+
size: "small",
|
|
202
|
+
...defaultProps,
|
|
203
|
+
...buttonRowProps,
|
|
204
|
+
onClick: () => {
|
|
205
|
+
hideOnClick.value = false;
|
|
206
|
+
if (is.isFunction(buttonRow.onClick)) {
|
|
207
|
+
buttonRow.onClick(createCallbackParams(params));
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
},
|
|
211
|
+
() => text
|
|
212
|
+
),
|
|
213
|
+
buttonRow.directives || []
|
|
214
|
+
)
|
|
215
|
+
}
|
|
216
|
+
) : vue.withDirectives(
|
|
217
|
+
vue.h(
|
|
218
|
+
Tag,
|
|
219
|
+
{
|
|
220
|
+
size: "small",
|
|
221
|
+
...defaultProps,
|
|
222
|
+
...buttonRowProps,
|
|
223
|
+
onClick: (event) => handleClickAction(createCallbackParams(params, event))
|
|
224
|
+
},
|
|
225
|
+
() => text
|
|
226
|
+
),
|
|
227
|
+
buttonRow.directives || []
|
|
228
|
+
);
|
|
229
|
+
}
|
|
230
|
+
};
|
|
231
|
+
const handleConfirm = (callbackParams) => {
|
|
232
|
+
if (is.isFunction(callbackParams.buttonRow.onConfirm)) {
|
|
233
|
+
callbackParams.buttonRow.onConfirm(callbackParams);
|
|
234
|
+
}
|
|
235
|
+
emit("clickAction", callbackParams);
|
|
236
|
+
};
|
|
237
|
+
const handleCancel = (callbackParams) => {
|
|
238
|
+
if (is.isFunction(callbackParams.buttonRow.onCancel)) {
|
|
239
|
+
callbackParams.buttonRow.onCancel(callbackParams);
|
|
240
|
+
}
|
|
241
|
+
emit("clickActionConfirmCancel", callbackParams);
|
|
242
|
+
};
|
|
243
|
+
const handleClickAction = (callbackParams) => {
|
|
244
|
+
hideOnClick.value = true;
|
|
245
|
+
const { buttonRow } = callbackParams;
|
|
246
|
+
if (is.isFunction(buttonRow.onClick)) {
|
|
247
|
+
buttonRow.onClick(callbackParams);
|
|
248
|
+
}
|
|
249
|
+
if (buttonRow.confirm) {
|
|
250
|
+
if (props.confirmType === "messageBox") {
|
|
251
|
+
const { message, title, options, appContext } = getConfirmMsg(buttonRow, callbackParams);
|
|
252
|
+
elementPlus.ElMessageBox.confirm(message, title, options, appContext).then(() => {
|
|
253
|
+
if (is.isFunction(buttonRow.onConfirm)) {
|
|
254
|
+
buttonRow.onConfirm(callbackParams);
|
|
255
|
+
}
|
|
256
|
+
emit("clickAction", callbackParams);
|
|
257
|
+
}).catch(() => {
|
|
258
|
+
if (is.isFunction(buttonRow.onCancel)) {
|
|
259
|
+
buttonRow.onCancel(callbackParams);
|
|
260
|
+
}
|
|
261
|
+
emit("clickActionConfirmCancel", callbackParams);
|
|
262
|
+
});
|
|
263
|
+
}
|
|
264
|
+
} else {
|
|
265
|
+
emit("clickAction", callbackParams);
|
|
266
|
+
}
|
|
267
|
+
};
|
|
268
|
+
return (_ctx, _cache) => {
|
|
269
|
+
return vue.openBlock(), vue.createElementBlock(
|
|
270
|
+
vue.Fragment,
|
|
271
|
+
null,
|
|
272
|
+
[
|
|
273
|
+
vue.createCommentVNode("\n \u7528\u5355\u5143\u7D20\u6570\u7EC4\u8BA9 getSubButtons \u6BCF\u884C\u53EA\u6267\u884C\u4E00\u6B21\uFF1A\n preButtons / showMore / nextButtons \u5171\u7528\u540C\u4E00\u4EFD\u8BA1\u7B97\u7ED3\u679C\n "),
|
|
274
|
+
(vue.openBlock(true), vue.createElementBlock(
|
|
275
|
+
vue.Fragment,
|
|
276
|
+
null,
|
|
277
|
+
vue.renderList([getSubButtons(_ctx.row, _ctx.index)], (cell) => {
|
|
278
|
+
return vue.openBlock(), vue.createElementBlock(
|
|
279
|
+
vue.Fragment,
|
|
280
|
+
{
|
|
281
|
+
key: cell.preButtons.length
|
|
282
|
+
},
|
|
283
|
+
[
|
|
284
|
+
vue.createCommentVNode(" \u663E\u793A\u51FA\u6765\u7684\u6309\u94AE "),
|
|
285
|
+
(vue.openBlock(true), vue.createElementBlock(
|
|
286
|
+
vue.Fragment,
|
|
287
|
+
null,
|
|
288
|
+
vue.renderList(cell.preButtons, (buttonRow) => {
|
|
289
|
+
return vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(render(_ctx.row, buttonRow, _ctx.index, _ctx.rest)), {
|
|
290
|
+
key: getButtonKey(buttonRow, _ctx.row, _ctx.index)
|
|
291
|
+
});
|
|
292
|
+
}),
|
|
293
|
+
128
|
|
294
|
+
/* KEYED_FRAGMENT */
|
|
295
|
+
)),
|
|
296
|
+
vue.createCommentVNode(" \u9690\u85CF\u7684\u6309\u94AE "),
|
|
297
|
+
cell.showMore ? (vue.openBlock(), vue.createBlock(vue.unref(elementPlus.ElDropdown), {
|
|
298
|
+
key: 0,
|
|
299
|
+
persistent: false,
|
|
300
|
+
trigger: "click",
|
|
301
|
+
class: "plus-table-action-bar__dropdown",
|
|
302
|
+
"hide-on-click": hideOnClick.value
|
|
303
|
+
}, {
|
|
304
|
+
dropdown: vue.withCtx(() => [
|
|
305
|
+
vue.createVNode(
|
|
306
|
+
vue.unref(elementPlus.ElDropdownMenu),
|
|
307
|
+
null,
|
|
308
|
+
{
|
|
309
|
+
default: vue.withCtx(() => [
|
|
310
|
+
(vue.openBlock(true), vue.createElementBlock(
|
|
311
|
+
vue.Fragment,
|
|
312
|
+
null,
|
|
313
|
+
vue.renderList(cell.nextButtons, (buttonRow) => {
|
|
314
|
+
return vue.openBlock(), vue.createBlock(
|
|
315
|
+
vue.unref(elementPlus.ElDropdownItem),
|
|
316
|
+
{
|
|
317
|
+
key: getButtonKey(buttonRow, _ctx.row, _ctx.index)
|
|
318
|
+
},
|
|
319
|
+
{
|
|
320
|
+
default: vue.withCtx(() => [
|
|
321
|
+
(vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(render(_ctx.row, buttonRow, _ctx.index, _ctx.rest))))
|
|
322
|
+
]),
|
|
323
|
+
_: 2
|
|
324
|
+
/* DYNAMIC */
|
|
325
|
+
},
|
|
326
|
+
1024
|
|
327
|
+
/* DYNAMIC_SLOTS */
|
|
328
|
+
);
|
|
329
|
+
}),
|
|
330
|
+
128
|
|
331
|
+
/* KEYED_FRAGMENT */
|
|
332
|
+
))
|
|
333
|
+
]),
|
|
334
|
+
_: 2
|
|
335
|
+
/* DYNAMIC */
|
|
336
|
+
},
|
|
337
|
+
1024
|
|
338
|
+
/* DYNAMIC_SLOTS */
|
|
339
|
+
)
|
|
340
|
+
]),
|
|
341
|
+
default: vue.withCtx(() => [
|
|
342
|
+
_ctx.moreType === "icon" ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_1, [
|
|
343
|
+
vue.renderSlot(_ctx.$slots, "action-bar-more-icon", {}, () => [
|
|
344
|
+
vue.createVNode(vue.unref(elementPlus.ElIcon), null, {
|
|
345
|
+
default: vue.withCtx(() => [
|
|
346
|
+
vue.createVNode(vue.unref(iconsVue.MoreFilled))
|
|
347
|
+
]),
|
|
348
|
+
_: 1
|
|
349
|
+
/* STABLE */
|
|
350
|
+
})
|
|
351
|
+
])
|
|
352
|
+
])) : (vue.openBlock(), vue.createElementBlock(
|
|
353
|
+
vue.Fragment,
|
|
354
|
+
{ key: 1 },
|
|
355
|
+
[
|
|
356
|
+
vue.createCommentVNode(" \u9ED8\u8BA4 "),
|
|
357
|
+
vue.createElementVNode("span", _hoisted_2, [
|
|
358
|
+
vue.createElementVNode(
|
|
359
|
+
"span",
|
|
360
|
+
_hoisted_3,
|
|
361
|
+
vue.toDisplayString(vue.unref(t)("plus.table.more")),
|
|
362
|
+
1
|
|
363
|
+
/* TEXT */
|
|
364
|
+
),
|
|
365
|
+
vue.renderSlot(_ctx.$slots, "action-bar-more-icon", {}, () => [
|
|
366
|
+
vue.createVNode(vue.unref(elementPlus.ElIcon), null, {
|
|
367
|
+
default: vue.withCtx(() => [
|
|
368
|
+
vue.createVNode(vue.unref(iconsVue.ArrowDownBold))
|
|
369
|
+
]),
|
|
370
|
+
_: 1
|
|
371
|
+
/* STABLE */
|
|
372
|
+
})
|
|
373
|
+
])
|
|
374
|
+
])
|
|
375
|
+
],
|
|
376
|
+
64
|
|
377
|
+
/* STABLE_FRAGMENT */
|
|
378
|
+
))
|
|
379
|
+
]),
|
|
380
|
+
_: 2
|
|
381
|
+
/* DYNAMIC */
|
|
382
|
+
}, 1032, ["hide-on-click"])) : vue.createCommentVNode("v-if", true)
|
|
383
|
+
],
|
|
384
|
+
64
|
|
385
|
+
/* STABLE_FRAGMENT */
|
|
386
|
+
);
|
|
387
|
+
}),
|
|
388
|
+
128
|
|
389
|
+
/* KEYED_FRAGMENT */
|
|
390
|
+
))
|
|
391
|
+
],
|
|
392
|
+
2112
|
|
393
|
+
/* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
|
|
394
|
+
);
|
|
395
|
+
};
|
|
396
|
+
}
|
|
397
|
+
});
|
|
398
|
+
|
|
399
|
+
exports.default = _sfc_main;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { RecordType } from 'tabula-vue';
|
|
1
2
|
import { TableColumnCtx } from 'element-plus';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { ComputedRef, DefineComponent, ComponentOptionsMixin, PublicProps, ExtractPropTypes, PropType } from 'vue';
|
|
3
|
+
import { DefineComponent, ComponentOptionsMixin, PublicProps, ExtractPropTypes, ComputedRef, PropType } from 'vue';
|
|
4
|
+
import { ActionBarProps, ButtonsCallBackParams, ActionBarButtonsRow } from './type';
|
|
5
5
|
|
|
6
6
|
export interface PlusTableActionBarEmits {
|
|
7
7
|
(e: 'clickAction', data: ButtonsCallBackParams): void;
|
|
@@ -40,10 +40,10 @@ declare const _default: __VLS_WithTemplateSlots< DefineComponent<__VLS_WithDefau
|
|
|
40
40
|
type: "link" | "icon" | "button";
|
|
41
41
|
label: string | ComputedRef<string>;
|
|
42
42
|
fixed: string;
|
|
43
|
+
actionBarTableColumnProps: Partial< TableColumnCtx<RecordType>>;
|
|
43
44
|
showNumber: number | ((row: RecordType, index: number) => number);
|
|
44
45
|
showLimitIncludeMore: boolean;
|
|
45
46
|
buttons: ActionBarButtonsRow[];
|
|
46
|
-
actionBarTableColumnProps: Partial< TableColumnCtx<RecordType>>;
|
|
47
47
|
confirmType: "messageBox" | "popconfirm";
|
|
48
48
|
moreType: "text" | "icon";
|
|
49
49
|
}, {}>, {
|