@aplus-frontend/ui 0.6.0-beta.2 → 0.6.0-beta.4
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/src/ap-form/search-form/components/popover-sorter/index.vue2.mjs +39 -34
- package/es/src/ap-grid/editable/form-item.vue.mjs +94 -83
- package/es/src/ap-grid/editable/index.vue.mjs +89 -78
- package/es/src/ap-grid/index.vue.mjs +47 -43
- package/es/src/ap-grid/interface.d.ts +1 -1
- package/es/src/ap-grid/utils/table.mjs +32 -32
- package/es/src/ap-table/ap-table.vue2.mjs +2 -0
- package/es/src/ap-table/components/setting/tree-select/index.vue2.mjs +1 -1
- package/es/src/business/ap-status/interface.d.ts +1 -1
- package/es/src/editable-table/form-item.vue.d.ts +2 -14
- package/es/src/editable-table/form-item.vue.mjs +84 -76
- package/es/src/editable-table/index.vue.d.ts +2 -16
- package/es/src/editable-table/index.vue.mjs +91 -83
- package/es/src/editable-table/interface.d.ts +7 -0
- package/lib/src/ap-form/search-form/components/popover-sorter/index.vue2.js +1 -1
- package/lib/src/ap-grid/editable/form-item.vue.js +1 -1
- package/lib/src/ap-grid/editable/index.vue.js +1 -1
- package/lib/src/ap-grid/index.vue.js +1 -1
- package/lib/src/ap-grid/interface.d.ts +1 -1
- package/lib/src/ap-grid/utils/table.js +1 -1
- package/lib/src/ap-table/ap-table.vue2.js +1 -1
- package/lib/src/ap-table/components/setting/tree-select/index.vue2.js +1 -1
- package/lib/src/business/ap-status/interface.d.ts +1 -1
- package/lib/src/editable-table/form-item.vue.d.ts +2 -14
- package/lib/src/editable-table/form-item.vue.js +1 -1
- package/lib/src/editable-table/index.vue.d.ts +2 -16
- package/lib/src/editable-table/index.vue.js +1 -1
- package/lib/src/editable-table/interface.d.ts +7 -0
- package/package.json +4 -4
- package/theme/antd-global-overwrite/admin/index.css +4 -17
- package/theme/antd-global-overwrite/admin/modal.css +4 -17
- package/theme/antd-global-overwrite/admin/modal.less +4 -19
- package/theme/antd-global-overwrite/aplus/index.css +4 -11
- package/theme/antd-global-overwrite/aplus/modal.css +4 -11
- package/theme/antd-global-overwrite/aplus/modal.less +4 -14
- package/theme/ap-form/ap-form-item.css +2 -2
- package/theme/ap-form/ap-form-item.less +2 -2
- package/theme/ap-form/index.css +5 -2
- package/theme/ap-form/search-form.css +5 -2
- package/theme/ap-form/search-form.less +3 -0
- package/theme/ap-grid/index.css +5 -2
- package/theme/ap-table/ap-table.css +8 -5
- package/theme/ap-table/setting/index.css +3 -3
- package/theme/ap-table/setting/modal.css +1 -2
- package/theme/ap-table/setting/modal.less +1 -2
- package/theme/ap-table/setting/select-group.css +2 -1
- package/theme/ap-table/setting/select-group.less +2 -1
- package/theme/ap-table-modal/index.css +8 -5
- package/theme/ap-tag/ap-tag.css +1 -1
- package/theme/ap-tag/ap-tag.less +1 -1
- package/theme/editable-table/index.css +5 -2
- package/theme/index.css +9 -6
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as Be, useSlots as Fe, getCurrentInstance as Ie, ref as B, computed as n, unref as o, watch as F, createElementBlock as I, openBlock as s, normalizeStyle as V, normalizeClass as g, createCommentVNode as S, createElementVNode as E, createVNode as X, mergeProps as h, createSlots as J, withCtx as v, Fragment as Q, renderList as L, createBlock as p, resolveDynamicComponent as D, renderSlot as O, normalizeProps as Ee, guardReactiveProps as Pe } from "vue";
|
|
2
2
|
import { VxeTable as Ne, VxeColumn as Y } from "vxe-table";
|
|
3
3
|
import "vxe-table/es/style.css";
|
|
4
4
|
import "vxe-pc-ui/es/style.css";
|
|
@@ -24,7 +24,7 @@ import { useNamespace as Ze } from "../config-provider/hooks/use-namespace.mjs";
|
|
|
24
24
|
import { useGlobalConfig as eo } from "../config-provider/hooks/use-global-config.mjs";
|
|
25
25
|
import { useLocale as oo } from "../config-provider/hooks/use-locale.mjs";
|
|
26
26
|
import ao from "../scroll-bar/index.vue.mjs";
|
|
27
|
-
const No = /* @__PURE__ */
|
|
27
|
+
const No = /* @__PURE__ */ Be({
|
|
28
28
|
name: "ApGrid",
|
|
29
29
|
__name: "index",
|
|
30
30
|
props: {
|
|
@@ -87,6 +87,7 @@ const No = /* @__PURE__ */ Fe({
|
|
|
87
87
|
loadingConfig: {},
|
|
88
88
|
headerCellConfig: {},
|
|
89
89
|
footerCellConfig: {},
|
|
90
|
+
round: { type: Boolean, default: void 0 },
|
|
90
91
|
columns: {},
|
|
91
92
|
rowSelection: { type: Boolean },
|
|
92
93
|
card: { type: Boolean, default: !1 },
|
|
@@ -114,15 +115,15 @@ const No = /* @__PURE__ */ Fe({
|
|
|
114
115
|
},
|
|
115
116
|
setup(re, { expose: te }) {
|
|
116
117
|
var G;
|
|
117
|
-
const C =
|
|
118
|
+
const C = Fe(), a = re, x = (G = Ie()) == null ? void 0 : G.appContext.app;
|
|
118
119
|
x && !x.__VXE_PC_UI_INSTALLED__ && (x.use(Z), x.__VXE_PC_UI_INSTALLED__ = !0);
|
|
119
|
-
const { e: P, b:
|
|
120
|
+
const { e: P, b: u, be: le } = Ze("ap-grid"), ne = eo("valueTypeMap"), i = B([]), $ = B([]), m = B(), y = B(a.size), [, d] = Je(), { t: se } = oo();
|
|
120
121
|
Z.setConfig({
|
|
121
122
|
i18n: (e, r) => se(`ap.${e}`, r)
|
|
122
123
|
});
|
|
123
124
|
const { renderConfig: ie, updateSignal: de } = Xe(i);
|
|
124
125
|
let K = 0;
|
|
125
|
-
const
|
|
126
|
+
const ue = n(() => {
|
|
126
127
|
if (m.value)
|
|
127
128
|
return m.value.$el.querySelector(
|
|
128
129
|
".vxe-table--header-inner-wrapper"
|
|
@@ -131,39 +132,41 @@ const No = /* @__PURE__ */ Fe({
|
|
|
131
132
|
var e, r, l;
|
|
132
133
|
return K++, ((l = (r = (e = a.columns) == null ? void 0 : e.filter(
|
|
133
134
|
(t) => !t.hideInSearch && t.dataIndex && (t.valueType || t.customRenderFormItem) && !_e.includes(t.valueType)
|
|
134
|
-
)) == null ? void 0 : r.sort((t,
|
|
135
|
-
let
|
|
136
|
-
return ee(
|
|
135
|
+
)) == null ? void 0 : r.sort((t, c) => {
|
|
136
|
+
let b = ee(t.order);
|
|
137
|
+
return ee(c.order) - b;
|
|
137
138
|
})) == null ? void 0 : l.map((t) => {
|
|
138
|
-
const
|
|
139
|
+
const c = Ae(
|
|
139
140
|
t,
|
|
140
141
|
Ve(t.fieldProps, {})
|
|
141
|
-
),
|
|
142
|
+
), b = {
|
|
142
143
|
...t,
|
|
143
144
|
fieldProps: {
|
|
144
145
|
label: t.title,
|
|
145
146
|
name: t.dataIndex,
|
|
146
|
-
|
|
147
|
+
// tips: 在表格中的查询表单项默认是带边框的
|
|
148
|
+
bordered: !0,
|
|
149
|
+
...c || {},
|
|
147
150
|
_signal: K
|
|
148
151
|
},
|
|
149
152
|
renderNode: void 0
|
|
150
153
|
};
|
|
151
|
-
return
|
|
152
|
-
|
|
154
|
+
return b.renderNode = Le(
|
|
155
|
+
b,
|
|
153
156
|
o(ne)
|
|
154
|
-
),
|
|
157
|
+
), b;
|
|
155
158
|
})) || [];
|
|
156
|
-
}),
|
|
159
|
+
}), ce = n(() => {
|
|
157
160
|
var r;
|
|
158
161
|
return Qe(a.manual) ? a.manual : Ye(((r = C.searchFormExtra) == null ? void 0 : r.call(C)) || []).some((l) => {
|
|
159
162
|
var t;
|
|
160
163
|
return ((t = l.type) == null ? void 0 : t.name) === "ApView";
|
|
161
164
|
});
|
|
162
165
|
}), pe = n(() => [
|
|
163
|
-
|
|
164
|
-
a.card ? null :
|
|
165
|
-
a.adaptive ?
|
|
166
|
-
a.sticky ?
|
|
166
|
+
u(),
|
|
167
|
+
a.card ? null : u("wrapper"),
|
|
168
|
+
a.adaptive ? u("adaptive") : null,
|
|
169
|
+
a.sticky ? u("sticky") : null
|
|
167
170
|
].filter(Boolean)), j = n(() => oe(o(i), (e) => {
|
|
168
171
|
if (e.sorter === !0)
|
|
169
172
|
return e.key || e.dataIndex;
|
|
@@ -200,7 +203,7 @@ const No = /* @__PURE__ */ Fe({
|
|
|
200
203
|
sortFields: j,
|
|
201
204
|
defaultParams: a.params,
|
|
202
205
|
defaultData: a.defaultData,
|
|
203
|
-
manual: o(
|
|
206
|
+
manual: o(ce),
|
|
204
207
|
formatParams: a.beforeSearchSubmit,
|
|
205
208
|
pagination: a.pagination
|
|
206
209
|
}), { sortChangeEvent: he, filterChangeEvent: ve, paginationChangeEvent: Ce } = $e(ge);
|
|
@@ -229,13 +232,13 @@ const No = /* @__PURE__ */ Fe({
|
|
|
229
232
|
() => i.value.some(
|
|
230
233
|
(e) => e.fixed === "left" || e.fixed === !0
|
|
231
234
|
) ? "left" : void 0
|
|
232
|
-
), Se = n(
|
|
233
|
-
() => w(a.loading) ? f.loading : a.loading
|
|
234
235
|
), be = n(
|
|
236
|
+
() => w(a.loading) ? f.loading : a.loading
|
|
237
|
+
), Se = n(
|
|
235
238
|
() => w(a.dataSource) ? f.records : a.dataSource
|
|
236
239
|
), { selectedRows: R, rowSelection: k, ...we } = He({
|
|
237
240
|
...a.rowSelection === !0 ? {} : a.rowSelection,
|
|
238
|
-
dataSource:
|
|
241
|
+
dataSource: Se,
|
|
239
242
|
rowKey: a.rowKey
|
|
240
243
|
}), _ = () => {
|
|
241
244
|
const e = m.value;
|
|
@@ -256,9 +259,9 @@ const No = /* @__PURE__ */ Fe({
|
|
|
256
259
|
(t = (l = (r = N.value) == null ? void 0 : r.apForm) == null ? void 0 : l.setFieldsValue) == null || t.call(l, e);
|
|
257
260
|
}
|
|
258
261
|
function U(e = !1) {
|
|
259
|
-
var l, t,
|
|
262
|
+
var l, t, c;
|
|
260
263
|
const r = e ? "getFieldsValueTransformed" : "getFieldsValue";
|
|
261
|
-
return (
|
|
264
|
+
return (c = (t = (l = N.value) == null ? void 0 : l.apForm) == null ? void 0 : t[r]) == null ? void 0 : c.call(t, !0);
|
|
262
265
|
}
|
|
263
266
|
function A() {
|
|
264
267
|
we.clearAll();
|
|
@@ -271,7 +274,7 @@ const No = /* @__PURE__ */ Fe({
|
|
|
271
274
|
if (l)
|
|
272
275
|
return (t = m.value) == null ? void 0 : t.scrollToRow(l, r);
|
|
273
276
|
}
|
|
274
|
-
return
|
|
277
|
+
return F(
|
|
275
278
|
() => [a.columnResizable, a.columns],
|
|
276
279
|
() => {
|
|
277
280
|
var r;
|
|
@@ -282,19 +285,19 @@ const No = /* @__PURE__ */ Fe({
|
|
|
282
285
|
deep: !0,
|
|
283
286
|
immediate: !0
|
|
284
287
|
}
|
|
285
|
-
),
|
|
288
|
+
), F(
|
|
286
289
|
() => a.dataSource,
|
|
287
290
|
(e) => {
|
|
288
291
|
fe(e);
|
|
289
292
|
},
|
|
290
293
|
{ immediate: !0, deep: !0 }
|
|
291
|
-
),
|
|
294
|
+
), F(
|
|
292
295
|
() => o(f).loading,
|
|
293
296
|
(e) => {
|
|
294
297
|
var r;
|
|
295
298
|
(r = a.onLoadingChange) == null || r.call(a, e);
|
|
296
299
|
}
|
|
297
|
-
),
|
|
300
|
+
), F(
|
|
298
301
|
() => a.size,
|
|
299
302
|
(e) => {
|
|
300
303
|
y.value = e;
|
|
@@ -349,13 +352,13 @@ const No = /* @__PURE__ */ Fe({
|
|
|
349
352
|
key: "0"
|
|
350
353
|
} : void 0
|
|
351
354
|
]), 1040, ["submit-loading", "onSubmit", "onReset"])
|
|
352
|
-
], 6)) :
|
|
355
|
+
], 6)) : S("", !0),
|
|
353
356
|
E("div", {
|
|
354
357
|
class: g([o(P)("table-wrapper"), e.card ? o(P)("table-wrapper-card") : null]),
|
|
355
358
|
style: V(e.tableWrapperStyle)
|
|
356
359
|
}, [
|
|
357
360
|
E("div", {
|
|
358
|
-
class: g(o(
|
|
361
|
+
class: g(o(u)("header-wrapper"))
|
|
359
362
|
}, [
|
|
360
363
|
O(e.$slots, "title", {
|
|
361
364
|
selectedRows: o(R),
|
|
@@ -365,7 +368,7 @@ const No = /* @__PURE__ */ Fe({
|
|
|
365
368
|
})
|
|
366
369
|
], 2),
|
|
367
370
|
E("div", {
|
|
368
|
-
class: g(o(
|
|
371
|
+
class: g(o(u)("vxe-wrapper"))
|
|
369
372
|
}, [
|
|
370
373
|
(s(), p(o(Ne), h(o(Ke)(a), {
|
|
371
374
|
ref_key: "tableRef",
|
|
@@ -374,7 +377,7 @@ const No = /* @__PURE__ */ Fe({
|
|
|
374
377
|
data: o(f).records,
|
|
375
378
|
"sort-config": { remote: j.value.length > 0 },
|
|
376
379
|
"filter-config": { remote: H.value.length > 0 },
|
|
377
|
-
loading:
|
|
380
|
+
loading: be.value,
|
|
378
381
|
style: {
|
|
379
382
|
"--vxe-ui-table-row-checkbox-checked-background-color": o(d).controlItemBgActive,
|
|
380
383
|
"--vxe-ui-table-row-hover-checkbox-checked-background-color": o(d).controlItemBgActiveHover,
|
|
@@ -387,7 +390,8 @@ const No = /* @__PURE__ */ Fe({
|
|
|
387
390
|
"--vxe-ui-font-color": o(d).colorTextBase,
|
|
388
391
|
"--vxe-ui-table-border-color": o(d).colorBorderSecondary,
|
|
389
392
|
"--vxe-ui-table-header-font-color": o(d).colorTextBase,
|
|
390
|
-
"--vxe-ui-table-cell-padding-mini": "8px"
|
|
393
|
+
"--vxe-ui-table-cell-padding-mini": "8px",
|
|
394
|
+
"--vxe-ui-table-row-line-height": "18px"
|
|
391
395
|
},
|
|
392
396
|
size: y.value,
|
|
393
397
|
onSortChange: o(he),
|
|
@@ -408,8 +412,8 @@ const No = /* @__PURE__ */ Fe({
|
|
|
408
412
|
(s(), p(D(a.expandable.renderContent(l))))
|
|
409
413
|
]),
|
|
410
414
|
_: 1
|
|
411
|
-
}, 16, ["fixed"])) :
|
|
412
|
-
a.rowSelection ? (s(), p(o(Y), h({ key: 1 }, o(je)(o(k), i.value), { field: o(Ge) }), null, 16, ["field"])) :
|
|
415
|
+
}, 16, ["fixed"])) : S("", !0),
|
|
416
|
+
a.rowSelection ? (s(), p(o(Y), h({ key: 1 }, o(je)(o(k), i.value), { field: o(Ge) }), null, 16, ["field"])) : S("", !0),
|
|
413
417
|
(s(!0), I(Q, null, L(o(ie), (l) => (s(), p(D(l), {
|
|
414
418
|
key: l.props.colId
|
|
415
419
|
}))), 128))
|
|
@@ -418,25 +422,25 @@ const No = /* @__PURE__ */ Fe({
|
|
|
418
422
|
}, [
|
|
419
423
|
L(o(Te)(C, ["searchFormExtra"]), (l, t) => ({
|
|
420
424
|
name: t,
|
|
421
|
-
fn: v((
|
|
422
|
-
O(e.$slots, t, Ee(Pe(
|
|
425
|
+
fn: v((c) => [
|
|
426
|
+
O(e.$slots, t, Ee(Pe(c || {})))
|
|
423
427
|
])
|
|
424
428
|
}))
|
|
425
429
|
]), 1040, ["data", "sort-config", "filter-config", "loading", "style", "size", "onSortChange", "onFilterChange"]))
|
|
426
430
|
], 2),
|
|
427
431
|
E("div", {
|
|
428
|
-
class: g(o(
|
|
432
|
+
class: g(o(u)("pagination-wrapper"))
|
|
429
433
|
}, [
|
|
430
434
|
e.sticky ? (s(), p(o(ao), {
|
|
431
435
|
key: 0,
|
|
432
436
|
direction: "horizontal",
|
|
433
|
-
"scroll-container":
|
|
437
|
+
"scroll-container": ue.value,
|
|
434
438
|
"extra-size": -4.2
|
|
435
|
-
}, null, 8, ["scroll-container"])) :
|
|
439
|
+
}, null, 8, ["scroll-container"])) : S("", !0),
|
|
436
440
|
e.pagination !== !1 ? (s(), p(o(Oe), h({
|
|
437
441
|
key: 1,
|
|
438
|
-
class: o(
|
|
439
|
-
}, o(M).pagination, { onChange: o(Ce) }), null, 16, ["class", "onChange"])) :
|
|
442
|
+
class: o(u)("pagination")
|
|
443
|
+
}, o(M).pagination, { onChange: o(Ce) }), null, 16, ["class", "onChange"])) : S("", !0)
|
|
440
444
|
], 2)
|
|
441
445
|
], 6)
|
|
442
446
|
], 6));
|
|
@@ -119,7 +119,7 @@ export type ApGridRowSelection<RecordType> = Pick<TableRowSelection<RecordType>,
|
|
|
119
119
|
*/
|
|
120
120
|
range?: boolean;
|
|
121
121
|
};
|
|
122
|
-
export type ApGridProps<RecordType = any, ParamsType = any> = Omit<TableProps<RecordType>, 'columns' | 'pagination' | 'dataSource' | 'size' | 'rowSelection' | 'rowKey' | 'rowClassName' | 'footer' | 'loading'> & Pick<VxeTableProps<RecordType>, 'rowClassName' | 'stripe' | 'headerRowClassName' | 'footerRowClassName' | 'cellClassName' | 'headerCellClassName' | 'footerCellClassName' | 'rowStyle' | 'headerRowStyle' | 'footerRowStyle' | 'cellStyle' | 'headerCellStyle' | 'footerCellStyle' | 'height' | 'minHeight' | 'maxHeight' | 'mergeCells' | 'mergeFooterItems' | 'cellConfig' | 'loading' | 'loadingConfig' | 'headerCellConfig' | 'footerCellConfig'> & {
|
|
122
|
+
export type ApGridProps<RecordType = any, ParamsType = any> = Omit<TableProps<RecordType>, 'columns' | 'pagination' | 'dataSource' | 'size' | 'rowSelection' | 'rowKey' | 'rowClassName' | 'footer' | 'loading'> & Pick<VxeTableProps<RecordType>, 'rowClassName' | 'stripe' | 'headerRowClassName' | 'footerRowClassName' | 'cellClassName' | 'headerCellClassName' | 'footerCellClassName' | 'rowStyle' | 'headerRowStyle' | 'footerRowStyle' | 'cellStyle' | 'headerCellStyle' | 'footerCellStyle' | 'height' | 'minHeight' | 'maxHeight' | 'mergeCells' | 'mergeFooterItems' | 'cellConfig' | 'loading' | 'loadingConfig' | 'headerCellConfig' | 'footerCellConfig' | 'round'> & {
|
|
123
123
|
/**
|
|
124
124
|
* 列配置
|
|
125
125
|
*/
|
|
@@ -1,20 +1,23 @@
|
|
|
1
|
-
import { omit as
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { omit as u, isUndefined as l, isFunction as h, isNumber as m } from "lodash-unified";
|
|
2
|
+
import { isDef as w } from "../../utils/index.mjs";
|
|
3
|
+
const y = 20, C = 50, b = (e) => e.some((t) => !!t.html);
|
|
4
|
+
function v(e) {
|
|
4
5
|
var i;
|
|
5
6
|
const t = {
|
|
6
|
-
...
|
|
7
|
+
...u(e, [
|
|
7
8
|
"columns",
|
|
8
9
|
"request",
|
|
9
10
|
"searchForm",
|
|
10
11
|
"dataSource",
|
|
11
12
|
"rowKey",
|
|
12
|
-
"value"
|
|
13
|
+
"value",
|
|
14
|
+
"round"
|
|
13
15
|
])
|
|
14
16
|
};
|
|
15
|
-
if (
|
|
16
|
-
|
|
17
|
-
|
|
17
|
+
if (t.rowConfig = {
|
|
18
|
+
isHover: !0,
|
|
19
|
+
keyField: e.rowKey
|
|
20
|
+
}, t.columnConfig = {}, b(e.columns || []) && (t.rowConfig.useKey = !0, t.columnConfig.useKey = !0), e.adaptive && (t.autoResize = !0, t.height = "100%"), e.columnResizable && (t.columnConfig.resizable = !0), e.rowSelection) {
|
|
18
21
|
const o = e.rowSelection === !0 ? {} : e.rowSelection;
|
|
19
22
|
o.type === "radio" ? t.radioConfig = {
|
|
20
23
|
highlight: !0,
|
|
@@ -25,7 +28,7 @@ function R(e) {
|
|
|
25
28
|
return o.shown ? o.shown(r) : !0;
|
|
26
29
|
},
|
|
27
30
|
checkRowKey: (i = o.defaultSelectedRowKeys) == null ? void 0 : i[0],
|
|
28
|
-
reserve:
|
|
31
|
+
reserve: l(o.preserveSelectedRowKeys) ? !0 : o.preserveSelectedRowKeys
|
|
29
32
|
} : t.checkboxConfig = {
|
|
30
33
|
highlight: !0,
|
|
31
34
|
checkMethod({ row: r }) {
|
|
@@ -35,11 +38,11 @@ function R(e) {
|
|
|
35
38
|
return o.shown ? o.shown(r) : !0;
|
|
36
39
|
},
|
|
37
40
|
checkRowKeys: o.defaultSelectedRowKeys,
|
|
38
|
-
reserve:
|
|
41
|
+
reserve: l(o.preserveSelectedRowKeys) ? !0 : o.preserveSelectedRowKeys,
|
|
39
42
|
range: o.range || !1
|
|
40
43
|
};
|
|
41
44
|
}
|
|
42
|
-
return t.border = e.bordered === !1 ? "inner" : !0, e.expandable && (t.expandConfig =
|
|
45
|
+
return t.border = e.bordered === !1 ? "inner" : !0, e.expandable && (t.expandConfig = u(e.expandable, [
|
|
43
46
|
"renderContent",
|
|
44
47
|
"width",
|
|
45
48
|
"title"
|
|
@@ -47,34 +50,31 @@ function R(e) {
|
|
|
47
50
|
enabled: !1
|
|
48
51
|
}, t.virtualYConfig = {
|
|
49
52
|
enabled: !1
|
|
50
|
-
}) : (
|
|
51
|
-
isHover: !0,
|
|
52
|
-
keyField: e.rowKey
|
|
53
|
-
}, t.round = !0, t;
|
|
53
|
+
}) : (f(t, "X", e.virtual), f(t, "Y", e.virtual)), t.round = w(e.round) ? e.round : !e.card, t;
|
|
54
54
|
}
|
|
55
|
-
function
|
|
56
|
-
const
|
|
57
|
-
e[
|
|
58
|
-
enabled:
|
|
55
|
+
function f(e, t, n) {
|
|
56
|
+
const i = t === "X", o = i ? "x" : "y", r = i ? "virtualXConfig" : "virtualYConfig", d = n == null ? void 0 : n[o], a = d !== !1, s = i ? y : C, c = m(d) && d >= 0 ? d : s;
|
|
57
|
+
e[r] = {
|
|
58
|
+
enabled: a,
|
|
59
59
|
gt: c,
|
|
60
|
-
oSize: (
|
|
60
|
+
oSize: (n == null ? void 0 : n.oSize) || 0
|
|
61
61
|
};
|
|
62
62
|
}
|
|
63
63
|
function x(e) {
|
|
64
64
|
return e === !0 ? "left" : e;
|
|
65
65
|
}
|
|
66
|
-
function
|
|
67
|
-
const
|
|
68
|
-
let
|
|
69
|
-
return
|
|
70
|
-
(
|
|
66
|
+
function K(e, t) {
|
|
67
|
+
const n = e === !0 || !e.type ? "checkbox" : e.type, i = e === !0 ? 60 : e.columnWidth || 60;
|
|
68
|
+
let o = e === !0 ? void 0 : x(e.fixed);
|
|
69
|
+
return o || (o === !1 ? o = void 0 : o = t.some(
|
|
70
|
+
(r) => r.fixed === "left" || r.fixed === !0
|
|
71
71
|
) ? "left" : void 0), {
|
|
72
|
-
type:
|
|
73
|
-
width:
|
|
74
|
-
fixed:
|
|
72
|
+
type: n,
|
|
73
|
+
width: i,
|
|
74
|
+
fixed: o
|
|
75
75
|
};
|
|
76
76
|
}
|
|
77
|
-
function
|
|
77
|
+
function k(e) {
|
|
78
78
|
const t = (e == null ? void 0 : e.width) || "auto";
|
|
79
79
|
return {
|
|
80
80
|
type: "expand",
|
|
@@ -83,7 +83,7 @@ function g(e) {
|
|
|
83
83
|
};
|
|
84
84
|
}
|
|
85
85
|
export {
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
86
|
+
k as getRowExpandProps,
|
|
87
|
+
K as getRowSelectionProps,
|
|
88
|
+
v as toVxeProps
|
|
89
89
|
};
|
|
@@ -10,7 +10,7 @@ type ApStatusGroupItemUnion = Pick<ApStatusProps, 'text' | 'color'> & {
|
|
|
10
10
|
};
|
|
11
11
|
export type ApStatusGroupItemProps = Required<ApStatusGroupItemUnion>;
|
|
12
12
|
export type ApStatusGroupProps = {
|
|
13
|
-
padding
|
|
13
|
+
padding?: number;
|
|
14
14
|
currentValue: number | string;
|
|
15
15
|
statusList: ApStatusGroupItemProps[] | null;
|
|
16
16
|
style?: object;
|
|
@@ -1,20 +1,8 @@
|
|
|
1
|
-
import { EditableColumnType, EditableTableFormItemProps } from './interface';
|
|
2
|
-
import { StandardBehaviorOptions } from '../../node_modules/scroll-into-view-if-needed';
|
|
1
|
+
import { EditableColumnType, EditableTableFormItemExpose, EditableTableFormItemProps } from './interface';
|
|
3
2
|
import { VNodeProps, AllowedComponentProps, ComponentCustomProps, PublicProps, ShallowUnwrapRef, VNode } from 'vue';
|
|
4
|
-
import { UnwrapRefSimple } from '@vue/reactivity';
|
|
5
3
|
declare const _default: <RecordType = any>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
6
4
|
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{} & VNodeProps & AllowedComponentProps & ComponentCustomProps, never>, never> & EditableTableFormItemProps<RecordType> & Partial<{}>> & PublicProps;
|
|
7
|
-
expose(exposed: ShallowUnwrapRef<
|
|
8
|
-
add: (defaultValue?: any, insertIndex?: number) => void;
|
|
9
|
-
remove: (index: number | number[]) => void;
|
|
10
|
-
getRowData: (index: number) => RecordType | UnwrapRefSimple<RecordType>;
|
|
11
|
-
getRowsData: () => RecordType[] | UnwrapRefSimple<RecordType>[];
|
|
12
|
-
setRowData: (index: number, payload: any, merge?: boolean) => void;
|
|
13
|
-
addMultiple: (list: number | Partial<RecordType>[], insetIn?: "prefix" | "suffix") => void;
|
|
14
|
-
scrollTo: (index: number | "end", options?: StandardBehaviorOptions) => void;
|
|
15
|
-
setTableData: (nextTableData: RecordType[]) => void;
|
|
16
|
-
clear: () => void;
|
|
17
|
-
}>): void;
|
|
5
|
+
expose(exposed: ShallowUnwrapRef<EditableTableFormItemExpose>): void;
|
|
18
6
|
attrs: any;
|
|
19
7
|
slots: Readonly<{
|
|
20
8
|
default: any;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { Table as
|
|
3
|
-
import { ApForm as
|
|
4
|
-
import { isArray as
|
|
1
|
+
import { defineComponent as G, ref as c, unref as s, useSlots as H, toRef as U, watch as W, nextTick as $, createBlock as q, openBlock as J, mergeProps as h, withCtx as w, createVNode as Q, createSlots as X, renderList as Y, renderSlot as Z, normalizeProps as I, guardReactiveProps as M } from "vue";
|
|
2
|
+
import { Table as ee } from "@aplus-frontend/antdv";
|
|
3
|
+
import { ApForm as x } from "../ap-form/index.mjs";
|
|
4
|
+
import { isArray as g, isUndefined as oe, isNumber as m, cloneDeep as te, omit as y } from "lodash-unified";
|
|
5
5
|
import "../config-provider/index.mjs";
|
|
6
|
-
import { useInjectForm as
|
|
6
|
+
import { useInjectForm as ae } from "../ap-form/context.mjs";
|
|
7
7
|
import { isDef as b } from "../utils/index.mjs";
|
|
8
|
-
import
|
|
9
|
-
import { scrollToRowIndex as
|
|
8
|
+
import le from "./hooks/use-get-columns.mjs";
|
|
9
|
+
import { scrollToRowIndex as ue } from "./utils.mjs";
|
|
10
10
|
import { useNamespace as ne } from "../config-provider/hooks/use-namespace.mjs";
|
|
11
|
-
import { useGlobalConfig as
|
|
12
|
-
const
|
|
11
|
+
import { useGlobalConfig as fe } from "../config-provider/hooks/use-global-config.mjs";
|
|
12
|
+
const ye = /* @__PURE__ */ G({
|
|
13
13
|
name: "EditableTableInner",
|
|
14
14
|
__name: "form-item",
|
|
15
15
|
props: {
|
|
@@ -109,119 +109,127 @@ const we = /* @__PURE__ */ O({
|
|
|
109
109
|
default: () => ({})
|
|
110
110
|
}
|
|
111
111
|
},
|
|
112
|
-
setup(
|
|
113
|
-
expose:
|
|
112
|
+
setup(C, {
|
|
113
|
+
expose: R
|
|
114
114
|
}) {
|
|
115
|
-
const l =
|
|
116
|
-
function
|
|
117
|
-
return
|
|
115
|
+
const l = C;
|
|
116
|
+
function B(e, a) {
|
|
117
|
+
return g(a) ? a.reduce((u, t) => u == null ? void 0 : u[t], e) : e == null ? void 0 : e[a];
|
|
118
118
|
}
|
|
119
119
|
const {
|
|
120
|
-
internalInstance:
|
|
121
|
-
model:
|
|
122
|
-
} =
|
|
123
|
-
|
|
124
|
-
var
|
|
125
|
-
await
|
|
120
|
+
internalInstance: o,
|
|
121
|
+
model: F
|
|
122
|
+
} = ae(), d = c(B(s(F), l.name) || []), T = H(), D = U(l, "name"), V = x.useWatch(D);
|
|
123
|
+
W(() => V.value, async (e) => {
|
|
124
|
+
var a;
|
|
125
|
+
await $(), d.value = e, (a = l.onChange) == null || a.call(l, e);
|
|
126
126
|
}, {
|
|
127
127
|
deep: !0
|
|
128
128
|
});
|
|
129
129
|
const {
|
|
130
130
|
b: L
|
|
131
|
-
} = ne("editable-table"), p = c(),
|
|
132
|
-
function
|
|
133
|
-
var
|
|
134
|
-
const
|
|
135
|
-
if (b(l.maxLength) &&
|
|
131
|
+
} = ne("editable-table"), p = c(), S = fe("valueTypeMap"), v = le(l, S);
|
|
132
|
+
function N(e, a) {
|
|
133
|
+
var n;
|
|
134
|
+
const u = ((n = s(d)) == null ? void 0 : n.length) || 0;
|
|
135
|
+
if (b(l.maxLength) && u >= l.maxLength)
|
|
136
136
|
return;
|
|
137
|
-
const
|
|
137
|
+
const t = {
|
|
138
138
|
...e || {}
|
|
139
139
|
};
|
|
140
|
-
|
|
141
|
-
if (!r
|
|
142
|
-
r
|
|
140
|
+
o == null || o.setFieldValue(l.name, t, !0, (f, r) => {
|
|
141
|
+
if (!f[r]) {
|
|
142
|
+
f[r] = [t];
|
|
143
143
|
return;
|
|
144
144
|
}
|
|
145
|
-
|
|
145
|
+
oe(a) ? f[r].push(t) : f[r].splice(a, 0, t);
|
|
146
146
|
});
|
|
147
147
|
}
|
|
148
|
-
function
|
|
149
|
-
var
|
|
150
|
-
const
|
|
151
|
-
if (b(l.maxLength) &&
|
|
148
|
+
function E(e, a = "suffix") {
|
|
149
|
+
var f;
|
|
150
|
+
const u = ((f = s(d)) == null ? void 0 : f.length) || 0, t = m(e) ? e : e.length;
|
|
151
|
+
if (b(l.maxLength) && u + t > l.maxLength)
|
|
152
152
|
return;
|
|
153
|
-
const
|
|
154
|
-
|
|
155
|
-
if (!
|
|
156
|
-
|
|
153
|
+
const n = m(e) ? new Array(e).fill(0).map(() => ({})) : te(e);
|
|
154
|
+
o == null || o.setFieldValue(l.name, n, !0, (r, i) => {
|
|
155
|
+
if (!r[i]) {
|
|
156
|
+
r[i] = [...n];
|
|
157
157
|
return;
|
|
158
158
|
}
|
|
159
|
-
|
|
159
|
+
a === "suffix" ? r[i].push(...n) : r[i].unshift(...n);
|
|
160
160
|
});
|
|
161
161
|
}
|
|
162
|
-
function
|
|
163
|
-
const
|
|
164
|
-
|
|
165
|
-
|
|
162
|
+
function _(e) {
|
|
163
|
+
const a = new Set(m(e) ? [e] : e);
|
|
164
|
+
o == null || o.setFieldValue(l.name, void 0, !0, (u, t) => {
|
|
165
|
+
u[t] = u[t].filter((n, f) => !a.has(f));
|
|
166
166
|
});
|
|
167
167
|
}
|
|
168
|
-
function
|
|
168
|
+
function k(e) {
|
|
169
|
+
var u;
|
|
170
|
+
const a = new Set(g(e) ? e : [e]);
|
|
171
|
+
a.size !== 0 && ((u = o == null ? void 0 : o.setFieldValue) == null || u.call(o, l.name, void 0, !0, (t, n) => {
|
|
172
|
+
t[n] = t[n].filter((f) => !a.has(f[l.rowKey]));
|
|
173
|
+
}));
|
|
174
|
+
}
|
|
175
|
+
function j() {
|
|
169
176
|
return s(d);
|
|
170
177
|
}
|
|
171
|
-
function
|
|
172
|
-
var
|
|
173
|
-
return (
|
|
178
|
+
function z(e) {
|
|
179
|
+
var a;
|
|
180
|
+
return (a = s(d)) == null ? void 0 : a[e];
|
|
174
181
|
}
|
|
175
|
-
function
|
|
176
|
-
|
|
177
|
-
!
|
|
178
|
-
...
|
|
179
|
-
...
|
|
182
|
+
function K(e, a, u = !0) {
|
|
183
|
+
o == null || o.setFieldValue(l.name, void 0, !0, (t, n) => {
|
|
184
|
+
!t[n] || !t[n][e] || (t[n][e] = {
|
|
185
|
+
...u ? t[n][e] : {},
|
|
186
|
+
...a
|
|
180
187
|
});
|
|
181
188
|
});
|
|
182
189
|
}
|
|
183
190
|
function P(e) {
|
|
184
|
-
|
|
191
|
+
o == null || o.setFieldValue(l.name, e);
|
|
185
192
|
}
|
|
186
|
-
function
|
|
187
|
-
var
|
|
188
|
-
const
|
|
189
|
-
|
|
193
|
+
function A(e, a) {
|
|
194
|
+
var t;
|
|
195
|
+
const u = e === "end" ? d.value.length - 1 : e;
|
|
196
|
+
ue(u, (t = p.value) == null ? void 0 : t.$el, a);
|
|
190
197
|
}
|
|
191
|
-
function
|
|
198
|
+
function O() {
|
|
192
199
|
var e;
|
|
193
|
-
(e =
|
|
200
|
+
(e = o == null ? void 0 : o.setFieldValue) == null || e.call(o, l.name, []);
|
|
194
201
|
}
|
|
195
|
-
return
|
|
196
|
-
add:
|
|
197
|
-
remove:
|
|
198
|
-
getRowData:
|
|
199
|
-
getRowsData:
|
|
200
|
-
setRowData:
|
|
201
|
-
addMultiple:
|
|
202
|
-
scrollTo:
|
|
202
|
+
return R({
|
|
203
|
+
add: N,
|
|
204
|
+
remove: _,
|
|
205
|
+
getRowData: z,
|
|
206
|
+
getRowsData: j,
|
|
207
|
+
setRowData: K,
|
|
208
|
+
addMultiple: E,
|
|
209
|
+
scrollTo: A,
|
|
203
210
|
setTableData: P,
|
|
204
|
-
clear:
|
|
205
|
-
|
|
211
|
+
clear: O,
|
|
212
|
+
removeByKey: k
|
|
213
|
+
}), (e, a) => (J(), q(s(x).FormItem, h(e.formItem, {
|
|
206
214
|
name: e.name,
|
|
207
215
|
label: e.label
|
|
208
216
|
}), {
|
|
209
|
-
default:
|
|
217
|
+
default: w(() => [Q(s(ee), h(s(y)(l, ["name", "maxLength", "onChange"]), {
|
|
210
218
|
ref_key: "tableRef",
|
|
211
219
|
ref: p,
|
|
212
220
|
class: s(L)(),
|
|
213
|
-
columns: s(
|
|
221
|
+
columns: s(v),
|
|
214
222
|
"data-source": d.value
|
|
215
|
-
}),
|
|
223
|
+
}), X({
|
|
216
224
|
_: 2
|
|
217
|
-
}, [
|
|
218
|
-
name:
|
|
219
|
-
fn:
|
|
225
|
+
}, [Y(s(y)(T, ["headerCell"]), (u, t) => ({
|
|
226
|
+
name: t,
|
|
227
|
+
fn: w((n) => [Z(e.$slots, t, I(M(n || {})))])
|
|
220
228
|
}))]), 1040, ["class", "columns", "data-source"])]),
|
|
221
229
|
_: 3
|
|
222
230
|
}, 16, ["name", "label"]));
|
|
223
231
|
}
|
|
224
232
|
});
|
|
225
233
|
export {
|
|
226
|
-
|
|
234
|
+
ye as default
|
|
227
235
|
};
|