@kp-ui/lowcode 2.15.0-alpha.15 → 2.15.0-alpha.16
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/package.json +1 -1
- package/src/components/form-designer/setting-panel/property-editor/container-data-table/data-table-tableColumns-editor.vue.js +3 -3
- package/src/components/form-designer/setting-panel/property-editor/container-data-table/data-table-tableColumns-editor.vue2.js +49 -47
- package/src/components/form-designer/widget-panel/advanced/data-table.js +7 -19
- package/src/lang/zh-CN.js +4 -3
- package/stats.html +1 -1
- package/styles/style.css +1 -1
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import o from "./data-table-tableColumns-editor.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
|
-
import
|
|
4
|
-
const e = /* @__PURE__ */ o
|
|
3
|
+
import a from "../../../../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
const e = /* @__PURE__ */ a(o, [["__scopeId", "data-v-ac7b3122"]]);
|
|
5
5
|
export {
|
|
6
6
|
e as default
|
|
7
7
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as N, mergeModels as V, ref as b, useModel as W, createVNode as i, resolveComponent as n, computed as E, createElementBlock as B, openBlock as O, Fragment as j, unref as s, withCtx as r, createTextVNode as m, toDisplayString as p, createElementVNode as F, nextTick as k, isVNode as L } from "vue";
|
|
2
2
|
import { useI18n as $ } from "../../../../../utils/i18n.js";
|
|
3
3
|
import q from "../../../../code-editor/code-modal-editor.vue.js";
|
|
4
4
|
import { cloneDeep as K } from "lodash-es";
|
|
@@ -8,14 +8,14 @@ import { useDesigner as Q } from "../../../form-widget/useFormDesigner.js";
|
|
|
8
8
|
const X = {
|
|
9
9
|
class: "add-btn t-flex t-justify-center t-mt-[10px]"
|
|
10
10
|
};
|
|
11
|
-
function
|
|
11
|
+
function f(u) {
|
|
12
12
|
return typeof u == "function" || Object.prototype.toString.call(u) === "[object Object]" && !L(u);
|
|
13
13
|
}
|
|
14
|
-
const
|
|
14
|
+
const oe = /* @__PURE__ */ N({
|
|
15
15
|
name: "tableColumns-editor",
|
|
16
16
|
inheritAttrs: !1,
|
|
17
17
|
__name: "data-table-tableColumns-editor",
|
|
18
|
-
props: /* @__PURE__ */
|
|
18
|
+
props: /* @__PURE__ */ V({
|
|
19
19
|
selectedWidget: {}
|
|
20
20
|
}, {
|
|
21
21
|
optionModel: {
|
|
@@ -27,12 +27,12 @@ const se = /* @__PURE__ */ V({
|
|
|
27
27
|
}),
|
|
28
28
|
emits: ["update:optionModel"],
|
|
29
29
|
setup(u, {
|
|
30
|
-
expose:
|
|
30
|
+
expose: _
|
|
31
31
|
}) {
|
|
32
32
|
Q();
|
|
33
33
|
const {
|
|
34
34
|
i18nt: l
|
|
35
|
-
} = $(), v = b(null), c = b(!1), h = b(), C =
|
|
35
|
+
} = $(), v = b(null), c = b(!1), h = b(), C = W(u, "optionModel"), y = [{
|
|
36
36
|
value: "left",
|
|
37
37
|
label: "left"
|
|
38
38
|
}, {
|
|
@@ -162,26 +162,28 @@ const se = /* @__PURE__ */ V({
|
|
|
162
162
|
}, {
|
|
163
163
|
field: "fixed",
|
|
164
164
|
title: l("designer.setting.fixedColumn"),
|
|
165
|
-
width:
|
|
165
|
+
width: 120,
|
|
166
166
|
slots: {
|
|
167
167
|
default({
|
|
168
168
|
row: e
|
|
169
169
|
}) {
|
|
170
|
-
let t,
|
|
171
|
-
return i(n("a-
|
|
170
|
+
let t, o, a;
|
|
171
|
+
return i(n("a-radio-group"), {
|
|
172
172
|
value: e.fixed,
|
|
173
|
-
"onUpdate:value": (d) => e.fixed = d
|
|
174
|
-
allowClear: !0,
|
|
175
|
-
style: "width: 100%"
|
|
173
|
+
"onUpdate:value": (d) => e.fixed = d
|
|
176
174
|
}, {
|
|
177
|
-
default: () => [i(n("a-
|
|
175
|
+
default: () => [i(n("a-radio-button"), {
|
|
178
176
|
value: "left"
|
|
179
|
-
},
|
|
177
|
+
}, f(t = l("designer.setting.fixedLeft")) ? t : {
|
|
180
178
|
default: () => [t]
|
|
181
|
-
}), i(n("a-
|
|
179
|
+
}), i(n("a-radio-button"), {
|
|
180
|
+
value: null
|
|
181
|
+
}, f(o = l("designer.setting.fixedNull")) ? o : {
|
|
182
|
+
default: () => [o]
|
|
183
|
+
}), i(n("a-radio-button"), {
|
|
182
184
|
value: "right"
|
|
183
|
-
},
|
|
184
|
-
default: () => [
|
|
185
|
+
}, f(a = l("designer.setting.fixedRight")) ? a : {
|
|
186
|
+
default: () => [a]
|
|
185
187
|
})]
|
|
186
188
|
});
|
|
187
189
|
}
|
|
@@ -197,7 +199,7 @@ const se = /* @__PURE__ */ V({
|
|
|
197
199
|
return i(n("a-select"), {
|
|
198
200
|
value: e.align,
|
|
199
201
|
"onUpdate:value": (t) => e.align = t,
|
|
200
|
-
options:
|
|
202
|
+
options: y,
|
|
201
203
|
style: "width: 100%"
|
|
202
204
|
}, null);
|
|
203
205
|
}
|
|
@@ -213,7 +215,7 @@ const se = /* @__PURE__ */ V({
|
|
|
213
215
|
row: e,
|
|
214
216
|
rowIndex: t
|
|
215
217
|
}) {
|
|
216
|
-
let
|
|
218
|
+
let o;
|
|
217
219
|
return i(n("a-button"), {
|
|
218
220
|
class: [{
|
|
219
221
|
"button-text-highlight": !!e.customRender
|
|
@@ -221,8 +223,8 @@ const se = /* @__PURE__ */ V({
|
|
|
221
223
|
onClick: () => M(e),
|
|
222
224
|
size: "small",
|
|
223
225
|
shape: "round"
|
|
224
|
-
},
|
|
225
|
-
default: () => [
|
|
226
|
+
}, f(o = l("designer.setting.edit")) ? o : {
|
|
227
|
+
default: () => [o]
|
|
226
228
|
});
|
|
227
229
|
}
|
|
228
230
|
}
|
|
@@ -241,12 +243,12 @@ const se = /* @__PURE__ */ V({
|
|
|
241
243
|
type: "link",
|
|
242
244
|
onClick: () => S(e),
|
|
243
245
|
size: "small"
|
|
244
|
-
},
|
|
246
|
+
}, f(t = l("designer.setting.delete")) ? t : {
|
|
245
247
|
default: () => [t]
|
|
246
248
|
});
|
|
247
249
|
}
|
|
248
250
|
}
|
|
249
|
-
}], T =
|
|
251
|
+
}], T = E(() => ({
|
|
250
252
|
columnConfig: {
|
|
251
253
|
resizable: !0
|
|
252
254
|
},
|
|
@@ -275,7 +277,7 @@ const se = /* @__PURE__ */ V({
|
|
|
275
277
|
}, U = (e) => {
|
|
276
278
|
h.value && (h.value.customRender = e);
|
|
277
279
|
}, D = async () => {
|
|
278
|
-
var t,
|
|
280
|
+
var t, o, a, d;
|
|
279
281
|
const e = {
|
|
280
282
|
isAutoWidth: !0,
|
|
281
283
|
columnId: (/* @__PURE__ */ new Date()).getTime(),
|
|
@@ -291,7 +293,7 @@ const se = /* @__PURE__ */ V({
|
|
|
291
293
|
ellipsis: !1,
|
|
292
294
|
showSorterTooltip: !1
|
|
293
295
|
};
|
|
294
|
-
await ((t = g.value) == null ? void 0 : t.insertAt(e, -1)), await k(), console.log((
|
|
296
|
+
await ((t = g.value) == null ? void 0 : t.insertAt(e, -1)), await k(), console.log((o = g.value) == null ? void 0 : o.getRowById(e.columnId)), (d = g.value) == null || d.scrollToRow((a = g.value) == null ? void 0 : a.getRowById(e.columnId));
|
|
295
297
|
}, S = (e) => {
|
|
296
298
|
var t;
|
|
297
299
|
if (w().length === 1)
|
|
@@ -304,52 +306,52 @@ const se = /* @__PURE__ */ V({
|
|
|
304
306
|
I(K(C.value.tableColumns));
|
|
305
307
|
}, 100);
|
|
306
308
|
};
|
|
307
|
-
return
|
|
309
|
+
return _({
|
|
308
310
|
openSetting: x
|
|
309
311
|
}), (e, t) => {
|
|
310
|
-
const
|
|
311
|
-
return O(), B(j, null, [i(
|
|
312
|
-
label:
|
|
312
|
+
const o = n("a-button"), a = n("a-form-item");
|
|
313
|
+
return O(), B(j, null, [i(a, {
|
|
314
|
+
label: s(l)("designer.setting.tableColEdit")
|
|
313
315
|
}, {
|
|
314
|
-
default:
|
|
316
|
+
default: r(() => [i(o, {
|
|
315
317
|
type: "primary",
|
|
316
318
|
shape: "round",
|
|
317
319
|
onClick: x
|
|
318
320
|
}, {
|
|
319
|
-
default:
|
|
321
|
+
default: r(() => [m(p(s(l)("designer.setting.editAction")), 1)]),
|
|
320
322
|
_: 1
|
|
321
323
|
})]),
|
|
322
324
|
_: 1
|
|
323
|
-
}, 8, ["label"]), i(
|
|
324
|
-
title:
|
|
325
|
+
}, 8, ["label"]), i(s(G), {
|
|
326
|
+
title: s(l)("designer.setting.tableColEdit"),
|
|
325
327
|
visible: c.value,
|
|
326
|
-
"onUpdate:visible": t[2] || (t[2] = (
|
|
328
|
+
"onUpdate:visible": t[2] || (t[2] = (d) => c.value = d),
|
|
327
329
|
width: "1280px",
|
|
328
330
|
height: "70vh"
|
|
329
331
|
}, {
|
|
330
|
-
footerRight:
|
|
332
|
+
footerRight: r(() => [i(o, {
|
|
331
333
|
size: "default",
|
|
332
|
-
onClick: t[1] || (t[1] = (
|
|
334
|
+
onClick: t[1] || (t[1] = (d) => c.value = !1)
|
|
333
335
|
}, {
|
|
334
|
-
default:
|
|
336
|
+
default: r(() => [m(p(s(l)("designer.hint.cancel")), 1)]),
|
|
335
337
|
_: 1
|
|
336
|
-
}), i(
|
|
338
|
+
}), i(o, {
|
|
337
339
|
size: "default",
|
|
338
340
|
type: "primary",
|
|
339
341
|
onClick: A
|
|
340
342
|
}, {
|
|
341
|
-
default:
|
|
343
|
+
default: r(() => [m(p(s(l)("designer.hint.confirm")), 1)]),
|
|
342
344
|
_: 1
|
|
343
345
|
})]),
|
|
344
|
-
default:
|
|
345
|
-
onRegister:
|
|
346
|
-
}, null, 8, ["onRegister"]), F("div", X, [i(
|
|
347
|
-
title:
|
|
346
|
+
default: r(() => [i(s(H), {
|
|
347
|
+
onRegister: s(z)
|
|
348
|
+
}, null, 8, ["onRegister"]), F("div", X, [i(o, {
|
|
349
|
+
title: s(l)("designer.setting.addTableColumn"),
|
|
348
350
|
type: "primary",
|
|
349
351
|
size: "medium",
|
|
350
|
-
onClick: t[0] || (t[0] = (
|
|
352
|
+
onClick: t[0] || (t[0] = (d) => D())
|
|
351
353
|
}, {
|
|
352
|
-
default:
|
|
354
|
+
default: r(() => [m(p(s(l)("designer.setting.addTableColumn")), 1)]),
|
|
353
355
|
_: 1
|
|
354
356
|
}, 8, ["title"])])]),
|
|
355
357
|
_: 1
|
|
@@ -357,12 +359,12 @@ const se = /* @__PURE__ */ V({
|
|
|
357
359
|
onSave: U,
|
|
358
360
|
ref_key: "CodeModalEditorRef",
|
|
359
361
|
ref: v,
|
|
360
|
-
title:
|
|
362
|
+
title: s(l)("designer.setting.renderFunction"),
|
|
361
363
|
"fn-params": "scope"
|
|
362
364
|
}, null, 8, ["title"])], 64);
|
|
363
365
|
};
|
|
364
366
|
}
|
|
365
367
|
});
|
|
366
368
|
export {
|
|
367
|
-
|
|
369
|
+
oe as default
|
|
368
370
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { getUuidKey as
|
|
2
|
-
const l = (
|
|
3
|
-
key:
|
|
1
|
+
import { getUuidKey as a } from "@kp-ui/tool";
|
|
2
|
+
const l = (t = {}) => ({
|
|
3
|
+
key: a(),
|
|
4
4
|
type: "data-table",
|
|
5
5
|
category: "container",
|
|
6
6
|
icon: "data-table",
|
|
@@ -57,23 +57,11 @@ const l = (a = {}) => ({
|
|
|
57
57
|
},
|
|
58
58
|
dataReqHandlerCode: "",
|
|
59
59
|
dataHandlerCode: "",
|
|
60
|
-
rowKey: "
|
|
60
|
+
rowKey: "_id",
|
|
61
61
|
childrenKey: "children",
|
|
62
|
-
dataSource: [
|
|
63
|
-
{
|
|
64
|
-
date: "2016-05-02",
|
|
65
|
-
date2: "2016-05-02 23:12:12",
|
|
66
|
-
date3: "2016-05-02 9:11:12",
|
|
67
|
-
name: "小二",
|
|
68
|
-
add: "上海市普陀区金沙江路 1518 弄",
|
|
69
|
-
age: 100
|
|
70
|
-
}
|
|
71
|
-
],
|
|
62
|
+
dataSource: [],
|
|
72
63
|
onCreated: "",
|
|
73
64
|
onMounted: "",
|
|
74
|
-
// onHideOperationButton: '',
|
|
75
|
-
// onDisableOperationButton: '',
|
|
76
|
-
// onOperationButtonClick: '',
|
|
77
65
|
customRow: {
|
|
78
66
|
onClick: "",
|
|
79
67
|
onDblclick: "",
|
|
@@ -97,7 +85,7 @@ const l = (a = {}) => ({
|
|
|
97
85
|
hasRowSelection: !1,
|
|
98
86
|
preserveSelectedRowKeys: !1,
|
|
99
87
|
fixed: !0,
|
|
100
|
-
onChange: "console.log(
|
|
88
|
+
onChange: "console.log(selectedRowKeys, selectedRows)",
|
|
101
89
|
columnWidth: 32,
|
|
102
90
|
getCheckboxProps: (e) => ({
|
|
103
91
|
disabled: e.name === "Disabled User",
|
|
@@ -105,7 +93,7 @@ const l = (a = {}) => ({
|
|
|
105
93
|
name: e.name
|
|
106
94
|
})
|
|
107
95
|
},
|
|
108
|
-
...
|
|
96
|
+
...t
|
|
109
97
|
}
|
|
110
98
|
});
|
|
111
99
|
export {
|
package/src/lang/zh-CN.js
CHANGED
|
@@ -203,7 +203,9 @@ const e = {
|
|
|
203
203
|
showSizeChanger: "是否展示 pageSize 切换器",
|
|
204
204
|
position: "分页器位置",
|
|
205
205
|
hasRowSelection: "启用左侧勾选设置",
|
|
206
|
-
fixedLeft: "
|
|
206
|
+
fixedLeft: "左",
|
|
207
|
+
fixedRight: "右",
|
|
208
|
+
fixedNull: "中",
|
|
207
209
|
preserveSelectedRowKeys: "当数据被删除时仍然保留选项的 key",
|
|
208
210
|
customColumnWidth: "自定义列表选择框宽度",
|
|
209
211
|
customColumnTitle: "自定义列表选择框标题",
|
|
@@ -303,8 +305,6 @@ const e = {
|
|
|
303
305
|
addColumn: "增加栅格",
|
|
304
306
|
responsive: "响应式布局",
|
|
305
307
|
customRender: "自定义渲染",
|
|
306
|
-
fixed: "固定位置",
|
|
307
|
-
fixedRight: "固定在右边",
|
|
308
308
|
labelBefore: "标签前面",
|
|
309
309
|
labelAfter: "标签后面",
|
|
310
310
|
tabPaneSetting: "选项卡设置",
|
|
@@ -418,6 +418,7 @@ const e = {
|
|
|
418
418
|
columnWidth: "列宽(px)",
|
|
419
419
|
visibleColumn: "是否显示",
|
|
420
420
|
sortableColumn: "是否排序",
|
|
421
|
+
fixed: "固定位置",
|
|
421
422
|
fixedColumn: "固定方式",
|
|
422
423
|
autoHeight: "自动高度",
|
|
423
424
|
alignTypeOfColumn: "对齐方式",
|