@web-utils/form-ui 1.0.0-beta52 → 1.0.0-beta54
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/chunks/{C2zgFLYO.mjs → 4rnKCvCw.mjs} +35 -31
- package/chunks/{Dt3lfDnL.mjs → 7GmKqdbC.mjs} +48 -33
- package/chunks/{DitpKWMd.mjs → 9MExJqL-.mjs} +2 -2
- package/chunks/{DZJ-ShZA2.mjs → B3yVc-P62.mjs} +4 -4
- package/chunks/{DkXlFWjs.mjs → B6yWUT6z.mjs} +2 -2
- package/chunks/{CkjtCuMs.mjs → BEvOkSfB.mjs} +119 -118
- package/chunks/{D3mFJzGr.mjs → BHbMJZPp.mjs} +63 -62
- package/chunks/{BSU2FqMP2.mjs → BJYlobMz2.mjs} +2 -2
- package/chunks/{KuAMIZnG.mjs → BNXbI4OG.mjs} +1 -1
- package/chunks/{CzHaJsnD.mjs → BV-XUugQ.mjs} +3 -3
- package/chunks/{DcFllKOf2.mjs → BgTCTXs72.mjs} +4 -3
- package/chunks/{BshE3RnA.mjs → BjGlxyi6.mjs} +2 -2
- package/chunks/{BAw6wxW1.mjs → BqC_VU52.mjs} +2 -2
- package/chunks/{B1k8ydde.mjs → BqzJ6vY6.mjs} +2 -2
- package/chunks/{DhVmHzB7.mjs → ByTyNsWf.mjs} +1 -1
- package/chunks/{DVbw6xIr.mjs → CB9QUXUX.mjs} +2 -2
- package/chunks/{GMFHxPJq.mjs → CGuDBVCB.mjs} +4 -3
- package/chunks/{C7G-cAoI.mjs → CPvdsnRN.mjs} +1 -1
- package/chunks/{D2MB3CnR.mjs → CgN7m-1v.mjs} +4 -3
- package/chunks/{CtHmTtVP.mjs → D5EQJdPL.mjs} +3 -3
- package/chunks/{CGHcOyNC2.mjs → D7R9Or2m2.mjs} +3 -3
- package/chunks/D9IFsT272.mjs +513 -0
- package/chunks/{C6hLXCPk.mjs → DFFNxlqD.mjs} +3 -3
- package/chunks/{BWh6u1O0.mjs → DWMePN6q.mjs} +1 -1
- package/chunks/{CBFbSsTJ.mjs → DawYTjoT.mjs} +2 -2
- package/chunks/{JKFepPeL.mjs → DjnHvHXo.mjs} +2 -2
- package/chunks/{v-O82KSn.mjs → DwkOWXIR.mjs} +4 -4
- package/chunks/{BQyL45PF2.mjs → DyCO22Ia2.mjs} +1 -1
- package/chunks/{B75qfA0z.mjs → Dytof5EW.mjs} +2 -2
- package/chunks/{eBESsR-G.mjs → H70Z56YY.mjs} +9 -3
- package/chunks/{CVKPpQdS.mjs → XwerN1TU.mjs} +2 -2
- package/chunks/{BXVB-H8_.mjs → c0Niqotr.mjs} +2 -2
- package/chunks/{DLgFBI_X.mjs → z5FJgzdc.mjs} +4 -3
- package/constants/index.d.ts +1 -0
- package/editable-tree/index.mjs +1 -1
- package/form-cascader/index.mjs +1 -1
- package/form-checkbox/index.d.ts +2 -2
- package/form-checkbox/index.mjs +1 -1
- package/form-checkbox-group/index.mjs +1 -1
- package/form-date-picker/index.mjs +1 -1
- package/form-holder/index.mjs +1 -1
- package/form-image/index.mjs +1 -1
- package/form-input/index.mjs +1 -1
- package/form-input-cron-expression/index.mjs +1 -1
- package/form-input-email/index.mjs +1 -1
- package/form-input-id-card/index.mjs +1 -1
- package/form-input-number/index.mjs +1 -1
- package/form-input-phone-number/index.mjs +1 -1
- package/form-input-tag/index.mjs +1 -1
- package/form-input-time/index.mjs +1 -1
- package/form-item-x/index.mjs +1 -1
- package/form-item-x/style.css +1 -1
- package/form-radio-group/index.mjs +1 -1
- package/form-rate/index.mjs +1 -1
- package/form-select/index.mjs +1 -1
- package/form-slider/index.mjs +1 -1
- package/form-switch/index.mjs +1 -1
- package/form-table/index.mjs +1 -1
- package/form-table-plus/index.mjs +1 -1
- package/form-text/index.mjs +1 -1
- package/form-textarea/index.mjs +1 -1
- package/form-time-select/index.mjs +1 -1
- package/index.css +1 -1
- package/index.mjs +33 -33
- package/package.json +1 -1
- package/pageable-table/index.mjs +1 -1
- package/sub-table/index.mjs +1 -1
- package/sub-table-plus/index.mjs +1 -1
- package/table-view/index.mjs +5 -5
- package/toolbar/index.mjs +1 -1
- package/toolbar-button/index.mjs +1 -1
- package/toolbar-button/style.css +1 -0
- package/vue-cron/index.mjs +1 -1
- package/web-types.json +1 -1
- package/x-input-tag/index.mjs +1 -1
- package/chunks/CjRZ71IY2.mjs +0 -512
|
@@ -1,25 +1,23 @@
|
|
|
1
|
-
import e from "
|
|
2
|
-
import t from "
|
|
3
|
-
import { t as n } from "./
|
|
4
|
-
import {
|
|
5
|
-
import { t as i } from "./
|
|
6
|
-
import {
|
|
7
|
-
import { t as o } from "./
|
|
8
|
-
import { t as s } from "./
|
|
9
|
-
import { t as c } from "./
|
|
10
|
-
import { t as l } from "./
|
|
11
|
-
import { t as u } from "./
|
|
12
|
-
import { t as d } from "./
|
|
13
|
-
import
|
|
14
|
-
import { t as p } from "./
|
|
15
|
-
import m from "
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import { formContextKey as P, formItemContextKey as F } from "element-plus";
|
|
20
|
-
import { cloneDeep as I } from "@web-utils/integrations/lodash";
|
|
1
|
+
import { t as e } from "./DOZRzqlo.mjs";
|
|
2
|
+
import { t } from "./7GmKqdbC.mjs";
|
|
3
|
+
import { t as n } from "./CkOD-_VV.mjs";
|
|
4
|
+
import { n as r } from "./BHbMJZPp.mjs";
|
|
5
|
+
import { t as i } from "./CgN7m-1v.mjs";
|
|
6
|
+
import { t as a } from "./DwkOWXIR.mjs";
|
|
7
|
+
import { t as o } from "./BV-XUugQ.mjs";
|
|
8
|
+
import { t as s } from "./Dytof5EW.mjs";
|
|
9
|
+
import { t as c } from "./z5FJgzdc.mjs";
|
|
10
|
+
import { t as l } from "./B6yWUT6z.mjs";
|
|
11
|
+
import { t as u } from "./BjGlxyi6.mjs";
|
|
12
|
+
import { t as d } from "./ByTyNsWf.mjs";
|
|
13
|
+
import f from "../table-column-def/index.mjs";
|
|
14
|
+
import { t as p } from "./DFFNxlqD.mjs";
|
|
15
|
+
import { findTreeChildren as m, isFunction as h } from "@web-utils/core";
|
|
16
|
+
import { Fragment as g, createBlock as _, createCommentVNode as v, createElementBlock as y, createElementVNode as b, createSlots as x, createTextVNode as S, createVNode as C, mergeProps as w, openBlock as T, renderList as E, renderSlot as D, resolveComponent as O, toDisplayString as k, withCtx as A, withModifiers as j } from "vue";
|
|
17
|
+
import { formContextKey as M, formItemContextKey as N } from "element-plus";
|
|
18
|
+
import { cloneDeep as P } from "@web-utils/integrations/lodash";
|
|
21
19
|
//#region src/components/table/sub-table.ts
|
|
22
|
-
var
|
|
20
|
+
var F = {
|
|
23
21
|
modelValue: Array,
|
|
24
22
|
columns: Array,
|
|
25
23
|
allowEmpty: Boolean,
|
|
@@ -53,23 +51,23 @@ var L = {
|
|
|
53
51
|
selectionWidth: String,
|
|
54
52
|
fetchApi: Function,
|
|
55
53
|
delApi: Function
|
|
56
|
-
},
|
|
54
|
+
}, I = {
|
|
57
55
|
name: "SubTable",
|
|
58
56
|
emits: {
|
|
59
|
-
...
|
|
57
|
+
...r,
|
|
60
58
|
"add-row": null
|
|
61
59
|
},
|
|
62
60
|
inject: {
|
|
63
61
|
elForm: {
|
|
64
|
-
from:
|
|
62
|
+
from: M,
|
|
65
63
|
default: ""
|
|
66
64
|
},
|
|
67
65
|
elFormItem: {
|
|
68
|
-
from:
|
|
66
|
+
from: N,
|
|
69
67
|
default: ""
|
|
70
68
|
}
|
|
71
69
|
},
|
|
72
|
-
props: { ...
|
|
70
|
+
props: { ...F },
|
|
73
71
|
data() {
|
|
74
72
|
return {
|
|
75
73
|
rows: [],
|
|
@@ -111,7 +109,7 @@ var L = {
|
|
|
111
109
|
},
|
|
112
110
|
methods: {
|
|
113
111
|
getCellType(e, t) {
|
|
114
|
-
return
|
|
112
|
+
return h(t.getType) ? t.getType(e, t) : t.type;
|
|
115
113
|
},
|
|
116
114
|
getInputAttr(e, t, n) {
|
|
117
115
|
var r;
|
|
@@ -136,7 +134,7 @@ var L = {
|
|
|
136
134
|
} catch {}
|
|
137
135
|
},
|
|
138
136
|
add(e, t) {
|
|
139
|
-
let n =
|
|
137
|
+
let n = P(this.rowProps);
|
|
140
138
|
this.rows.splice(t + 1, 0, n);
|
|
141
139
|
},
|
|
142
140
|
addRow() {
|
|
@@ -167,37 +165,37 @@ var L = {
|
|
|
167
165
|
if (r) return r.name;
|
|
168
166
|
}
|
|
169
167
|
if (n.type === "cascader" && (i = n.attrs) != null && i.options) {
|
|
170
|
-
let [r] =
|
|
168
|
+
let [r] = m(n.attrs.options, (r) => r[n.attrs.valueKey || "value"] === e[t.property]);
|
|
171
169
|
if (r) return r[n.attrs.valueKey || "label"];
|
|
172
170
|
}
|
|
173
171
|
return e[t.property];
|
|
174
172
|
}
|
|
175
173
|
}
|
|
176
|
-
},
|
|
174
|
+
}, L = {
|
|
177
175
|
key: 0,
|
|
178
176
|
class: "table-header"
|
|
179
|
-
},
|
|
177
|
+
}, R = {
|
|
180
178
|
key: 0,
|
|
181
179
|
style: { color: "#f56c6c" }
|
|
182
|
-
},
|
|
183
|
-
function
|
|
184
|
-
let
|
|
185
|
-
return
|
|
180
|
+
}, z = ["onClick"];
|
|
181
|
+
function B(n, r, m, h, M, N) {
|
|
182
|
+
let P = t, F = a, I = l, B = O("FormInputUser"), V = O("FormInputDepartment"), H = u, U = s, W = i, G = o, K = c, q = p, J = e, Y = f, X = d;
|
|
183
|
+
return T(), _(X, w({
|
|
186
184
|
ref: "table",
|
|
187
185
|
class: "sub-table",
|
|
188
186
|
"auto-height": "",
|
|
189
|
-
data:
|
|
190
|
-
api:
|
|
191
|
-
"show-summary":
|
|
192
|
-
"selection-width":
|
|
193
|
-
},
|
|
187
|
+
data: M.rows,
|
|
188
|
+
api: n.fetchApi,
|
|
189
|
+
"show-summary": n.showSummary,
|
|
190
|
+
"selection-width": n.selectionWidth
|
|
191
|
+
}, n.$attrs, {
|
|
194
192
|
"hide-on-single-page": "",
|
|
195
|
-
selection:
|
|
196
|
-
"row-db-click":
|
|
197
|
-
onSelectionChange:
|
|
198
|
-
}),
|
|
199
|
-
default:
|
|
200
|
-
|
|
193
|
+
selection: N.enabled,
|
|
194
|
+
"row-db-click": n.rowDbClick,
|
|
195
|
+
onSelectionChange: N.onSelectionChange
|
|
196
|
+
}), x({
|
|
197
|
+
default: A(() => [
|
|
198
|
+
D(n.$slots, "columns", { columns: n.columns }, () => [(T(!0), y(g, null, E(N.filteredColumns, (e) => (T(), _(Y, {
|
|
201
199
|
key: e.prop,
|
|
202
200
|
label: e.label,
|
|
203
201
|
width: e.width,
|
|
@@ -206,88 +204,88 @@ function H(i, a, g, _, P, F) {
|
|
|
206
204
|
align: e.align,
|
|
207
205
|
prop: e.prop,
|
|
208
206
|
options: e.options,
|
|
209
|
-
"show-overflow-tooltip": !
|
|
207
|
+
"show-overflow-tooltip": !N.available && e.showOverflowTooltip
|
|
210
208
|
}, {
|
|
211
|
-
header:
|
|
212
|
-
default:
|
|
213
|
-
|
|
214
|
-
|
|
209
|
+
header: A(() => [!n.disabled && e.required ? (T(), y("span", R, "*")) : v("v-if", !0), S(" " + k(e.label), 1)]),
|
|
210
|
+
default: A(({ row: t, column: r, $index: i }) => [
|
|
211
|
+
v("tag 插槽"),
|
|
212
|
+
D(n.$slots, "tag", {
|
|
215
213
|
row: t,
|
|
216
|
-
column:
|
|
217
|
-
index:
|
|
214
|
+
column: r,
|
|
215
|
+
index: i
|
|
218
216
|
}),
|
|
219
|
-
|
|
220
|
-
|
|
217
|
+
v("列默认插槽,名字和 prop 保持一致"),
|
|
218
|
+
D(n.$slots, e.prop, {
|
|
221
219
|
row: t,
|
|
222
|
-
column:
|
|
223
|
-
index:
|
|
220
|
+
column: r,
|
|
221
|
+
index: i
|
|
224
222
|
}, () => {
|
|
225
|
-
var
|
|
226
|
-
return [
|
|
223
|
+
var n;
|
|
224
|
+
return [N.available ? (T(), y(g, { key: 0 }, [N.getCellType(t, e) === "input" ? (T(), _(F, w({
|
|
227
225
|
key: 0,
|
|
228
226
|
ref_for: !0
|
|
229
|
-
},
|
|
227
|
+
}, N.getInputAttr(t, e, i), { onInput: (n) => N.onInput(t, n, e) }), null, 16, ["onInput"])) : N.getCellType(t, e) === "inputPhoneNumber" ? (T(), _(I, w({
|
|
230
228
|
key: 1,
|
|
231
229
|
ref_for: !0
|
|
232
|
-
},
|
|
230
|
+
}, N.getInputAttr(t, e, i), { onInput: (n) => N.onInput(t, n, e) }), null, 16, ["onInput"])) : N.getCellType(t, e) === "user" ? (T(), y(g, { key: 2 }, [e.single ? (T(), _(B, w({
|
|
233
231
|
key: 0,
|
|
234
232
|
ref_for: !0
|
|
235
|
-
},
|
|
233
|
+
}, N.getInputAttr(t, e, i), { onInput: (n) => N.onInput(t, n, e) }), null, 16, ["onInput"])) : (T(), _(B, w({
|
|
236
234
|
key: 1,
|
|
237
235
|
ref_for: !0
|
|
238
|
-
},
|
|
236
|
+
}, N.getInputAttr(t, e, i), { onInput: (n) => N.onInput(t, n, e) }), null, 16, ["onInput"]))], 64)) : N.getCellType(t, e) === "department" ? (T(), y(g, { key: 3 }, [e.single ? (T(), _(V, w({
|
|
239
237
|
key: 0,
|
|
240
238
|
ref_for: !0
|
|
241
|
-
},
|
|
242
|
-
name: t[
|
|
243
|
-
"onUpdate:name": (e) => t[
|
|
244
|
-
onInput: (n) =>
|
|
239
|
+
}, N.getInputAttr(t, e, i), {
|
|
240
|
+
name: t[r.property],
|
|
241
|
+
"onUpdate:name": (e) => t[r.property] = e,
|
|
242
|
+
onInput: (n) => N.onInput(t, n, e)
|
|
245
243
|
}), null, 16, [
|
|
246
244
|
"name",
|
|
247
245
|
"onUpdate:name",
|
|
248
246
|
"onInput"
|
|
249
|
-
])) : (
|
|
247
|
+
])) : (T(), _(V, w({
|
|
250
248
|
key: 1,
|
|
251
249
|
ref_for: !0
|
|
252
|
-
},
|
|
253
|
-
disabled:
|
|
254
|
-
onInput: (n) =>
|
|
255
|
-
}), null, 16, ["disabled", "onInput"]))], 64)) :
|
|
250
|
+
}, N.getInputAttr(t, e, i), {
|
|
251
|
+
disabled: N.isInputDisabled(t, e),
|
|
252
|
+
onInput: (n) => N.onInput(t, n, e)
|
|
253
|
+
}), null, 16, ["disabled", "onInput"]))], 64)) : N.getCellType(t, e) === "select" ? (T(), _(H, w({
|
|
256
254
|
key: 4,
|
|
257
255
|
ref_for: !0
|
|
258
|
-
},
|
|
256
|
+
}, N.getInputAttr(t, e, i), { onInput: (n) => N.onInput(t, n, e) }), null, 16, ["onInput"])) : N.getCellType(t, e) === "datePicker" ? (T(), _(U, w({
|
|
259
257
|
key: 5,
|
|
260
258
|
ref_for: !0
|
|
261
|
-
},
|
|
259
|
+
}, N.getInputAttr(t, e, i), {
|
|
262
260
|
start: t[e.start],
|
|
263
261
|
"onUpdate:start": (n) => t[e.start] = n,
|
|
264
262
|
end: t[e.end],
|
|
265
263
|
"onUpdate:end": (n) => t[e.end] = n,
|
|
266
|
-
onInput: (n) =>
|
|
264
|
+
onInput: (n) => N.onInput(t, n, e)
|
|
267
265
|
}), null, 16, [
|
|
268
266
|
"start",
|
|
269
267
|
"onUpdate:start",
|
|
270
268
|
"end",
|
|
271
269
|
"onUpdate:end",
|
|
272
270
|
"onInput"
|
|
273
|
-
])) :
|
|
271
|
+
])) : N.getCellType(t, e) === "cascader" ? (T(), _(W, w({
|
|
274
272
|
key: 6,
|
|
275
273
|
ref_for: !0
|
|
276
|
-
},
|
|
274
|
+
}, N.getInputAttr(t, e, i), { onInput: (n) => N.onInput(t, n, e) }), null, 16, ["onInput"])) : N.getCellType(t, e) === "checkbox" ? (T(), _(G, w({
|
|
277
275
|
key: 7,
|
|
278
276
|
ref_for: !0
|
|
279
|
-
},
|
|
277
|
+
}, N.getInputAttr(t, e, i), { onInput: (n) => N.onInput(t, n, e) }), null, 16, ["onInput"])) : N.getCellType(t, e) === "number" ? (T(), _(K, w({
|
|
280
278
|
key: 8,
|
|
281
279
|
ref_for: !0
|
|
282
|
-
},
|
|
280
|
+
}, N.getInputAttr(t, e, i), { onInput: (n) => N.onInput(t, n, e) }), null, 16, ["onInput"])) : N.getCellType(t, e) === "textarea" ? (T(), _(q, w({
|
|
283
281
|
key: 9,
|
|
284
282
|
ref_for: !0
|
|
285
|
-
},
|
|
283
|
+
}, N.getInputAttr(t, e, i), { onInput: (n) => N.onInput(t, n, e) }), null, 16, ["onInput"])) : (T(), y(g, { key: 10 }, [S(k(N.getVal(t, r, e)), 1)], 64))], 64)) : e.dicType || (n = e.options) != null && n.length ? (T(), _(J, {
|
|
286
284
|
key: 1,
|
|
287
285
|
"dict-type": e.dicType,
|
|
288
286
|
"id-as-value": e.idAsValue,
|
|
289
287
|
"label-as-value": e.labelAsValue,
|
|
290
|
-
column:
|
|
288
|
+
column: r,
|
|
291
289
|
row: t,
|
|
292
290
|
options: e.options
|
|
293
291
|
}, null, 8, [
|
|
@@ -297,7 +295,7 @@ function H(i, a, g, _, P, F) {
|
|
|
297
295
|
"column",
|
|
298
296
|
"row",
|
|
299
297
|
"options"
|
|
300
|
-
])) : (
|
|
298
|
+
])) : (T(), y(g, { key: 2 }, [S(k(N.getVal(t, r, e)), 1)], 64))];
|
|
301
299
|
})
|
|
302
300
|
]),
|
|
303
301
|
_: 2
|
|
@@ -311,13 +309,13 @@ function H(i, a, g, _, P, F) {
|
|
|
311
309
|
"options",
|
|
312
310
|
"show-overflow-tooltip"
|
|
313
311
|
]))), 128))]),
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
add:
|
|
317
|
-
remove:
|
|
312
|
+
v(" 自定义操作列 "),
|
|
313
|
+
D(n.$slots, "handle", {
|
|
314
|
+
add: N.add,
|
|
315
|
+
remove: N.remove
|
|
318
316
|
}),
|
|
319
|
-
|
|
320
|
-
(!
|
|
317
|
+
v(" 操作列 "),
|
|
318
|
+
(!n.modelValue || n.modelValue.length < n.limit) && !n.disabled && N.enabled && n.editable && n.handleColumn ? (T(), _(Y, {
|
|
321
319
|
key: 0,
|
|
322
320
|
label: "操作",
|
|
323
321
|
fixed: "right",
|
|
@@ -325,11 +323,11 @@ function H(i, a, g, _, P, F) {
|
|
|
325
323
|
align: "center",
|
|
326
324
|
prop: "menu"
|
|
327
325
|
}, {
|
|
328
|
-
header:
|
|
326
|
+
header: A(({ column: e, $index: t }) => [D(n.$slots, "handle-column-header", {
|
|
329
327
|
column: e,
|
|
330
328
|
index: t
|
|
331
|
-
}, () => [
|
|
332
|
-
default:
|
|
329
|
+
}, () => [S(k(e.label), 1)])]),
|
|
330
|
+
default: A(({ row: e, $index: t }) => [n.showHandleColumnAddButton && n.modelValue.length < n.maxLimit ? (T(), y("i", {
|
|
333
331
|
key: 0,
|
|
334
332
|
class: "el-icon-circle-plus sub-table-handle-button table-button-add",
|
|
335
333
|
style: {
|
|
@@ -338,8 +336,8 @@ function H(i, a, g, _, P, F) {
|
|
|
338
336
|
cursor: "pointer"
|
|
339
337
|
},
|
|
340
338
|
title: "添加",
|
|
341
|
-
onClick:
|
|
342
|
-
}, null, 8,
|
|
339
|
+
onClick: j((n) => N.add(e, t), ["stop"])
|
|
340
|
+
}, null, 8, z)) : v("v-if", !0), n.modelValue && n.modelValue.length > 1 || n.allowEmpty ? (T(), _(P, {
|
|
343
341
|
key: 1,
|
|
344
342
|
class: "el-icon-error sub-table-handle-button table-button-remove",
|
|
345
343
|
style: {
|
|
@@ -347,58 +345,61 @@ function H(i, a, g, _, P, F) {
|
|
|
347
345
|
cursor: "pointer"
|
|
348
346
|
},
|
|
349
347
|
title: "删除",
|
|
348
|
+
confirm: "",
|
|
349
|
+
text: "",
|
|
350
350
|
message: "您确定要删除该行吗?",
|
|
351
|
-
onClick:
|
|
352
|
-
}, null, 8, ["onClick"])) :
|
|
351
|
+
onClick: j((n) => N.remove(e, t), ["stop"])
|
|
352
|
+
}, null, 8, ["onClick"])) : v("v-if", !0)]),
|
|
353
353
|
_: 3
|
|
354
|
-
})) :
|
|
354
|
+
})) : v("v-if", !0)
|
|
355
355
|
]),
|
|
356
356
|
_: 2
|
|
357
|
-
}, [
|
|
357
|
+
}, [n.editable ? void 0 : {
|
|
358
358
|
name: "toolbar",
|
|
359
|
-
fn:
|
|
360
|
-
addRow:
|
|
361
|
-
delRow:
|
|
362
|
-
refresh:
|
|
363
|
-
}, () => [
|
|
359
|
+
fn: A(() => [N.enabled || n.fetchApi ? (T(), y("div", L, [D(n.$slots, "toolbar", {
|
|
360
|
+
addRow: N.addRow,
|
|
361
|
+
delRow: N.delRow,
|
|
362
|
+
refresh: N.refresh
|
|
363
|
+
}, () => [N.enabled ? (T(), y(g, { key: 0 }, [C(P, {
|
|
364
364
|
class: "table-header-button add",
|
|
365
365
|
icon: "el-icon-circle-plus",
|
|
366
366
|
type: "text",
|
|
367
|
-
onClick:
|
|
367
|
+
onClick: N.addRow
|
|
368
368
|
}, {
|
|
369
|
-
default:
|
|
369
|
+
default: A(() => [...r[1] || (r[1] = [S(" 添加 ", -1)])]),
|
|
370
370
|
_: 1
|
|
371
|
-
}, 8, ["onClick"]),
|
|
371
|
+
}, 8, ["onClick"]), C(P, {
|
|
372
372
|
class: "table-header-button remove",
|
|
373
|
+
confirm: "",
|
|
373
374
|
message: "您确定要删除选中的记录吗?",
|
|
374
375
|
icon: "el-icon-error",
|
|
375
|
-
|
|
376
|
-
onClick:
|
|
376
|
+
text: "",
|
|
377
|
+
onClick: N.delRow
|
|
377
378
|
}, {
|
|
378
|
-
default:
|
|
379
|
+
default: A(() => [...r[2] || (r[2] = [S(" 删除 ", -1)])]),
|
|
379
380
|
_: 1
|
|
380
|
-
}, 8, ["onClick"])], 64)) :
|
|
381
|
+
}, 8, ["onClick"])], 64)) : v("v-if", !0), n.fetchApi ? (T(), _(P, {
|
|
381
382
|
key: 1,
|
|
382
383
|
class: "table-header-button refresh",
|
|
383
384
|
icon: "el-icon-refresh-left",
|
|
384
|
-
|
|
385
|
+
text: "",
|
|
385
386
|
disabled: !1,
|
|
386
|
-
onClick:
|
|
387
|
+
onClick: N.refresh
|
|
387
388
|
}, {
|
|
388
|
-
default:
|
|
389
|
+
default: A(() => [...r[3] || (r[3] = [S(" 刷新 ", -1)])]),
|
|
389
390
|
_: 1
|
|
390
|
-
}, 8, ["onClick"])) :
|
|
391
|
+
}, 8, ["onClick"])) : v("v-if", !0)])])) : v("v-if", !0)]),
|
|
391
392
|
key: "0"
|
|
392
|
-
},
|
|
393
|
+
}, n.allowEmpty && !n.disabled && n.showEmptyAddButton ? {
|
|
393
394
|
name: "empty",
|
|
394
|
-
fn:
|
|
395
|
+
fn: A(() => [b("i", {
|
|
395
396
|
class: "el-icon-circle-plus sub-table-handle-button table-button-add",
|
|
396
397
|
style: {
|
|
397
398
|
"font-size": "20px",
|
|
398
399
|
cursor: "pointer"
|
|
399
400
|
},
|
|
400
401
|
title: "添加",
|
|
401
|
-
onClick:
|
|
402
|
+
onClick: r[0] || (r[0] = j((e) => N.add(null, 0), ["stop"]))
|
|
402
403
|
})]),
|
|
403
404
|
key: "1"
|
|
404
405
|
} : void 0]), 1040, [
|
|
@@ -411,6 +412,6 @@ function H(i, a, g, _, P, F) {
|
|
|
411
412
|
"onSelectionChange"
|
|
412
413
|
]);
|
|
413
414
|
}
|
|
414
|
-
var
|
|
415
|
+
var V = /* @__PURE__ */ n(I, [["render", B]]);
|
|
415
416
|
//#endregion
|
|
416
|
-
export {
|
|
417
|
+
export { F as n, V as t };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { f as e, o as t, p as n } from "./DcTVYqeJ.mjs";
|
|
2
|
-
import { formHolderContextKey as r, formItemConfigProviderContextKey as i, formItemGroupContextKey as a } from "../constants/index.mjs";
|
|
3
|
-
import { isArray as
|
|
4
|
-
import { computed as
|
|
5
|
-
import { ElCol as
|
|
6
|
-
import { ElCol as
|
|
2
|
+
import { formHolderContextKey as r, formItemConfigProviderContextKey as i, formItemGroupContextKey as a, formViewContextKey as o } from "../constants/index.mjs";
|
|
3
|
+
import { isArray as s, isPlainObject as c, isString as l } from "@web-utils/core";
|
|
4
|
+
import { computed as u, createVNode as d, h as f, inject as p, mergeProps as m, nextTick as h, unref as g, useTemplateRef as _ } from "vue";
|
|
5
|
+
import { ElCol as v, rowContextKey as y } from "element-plus";
|
|
6
|
+
import { ElCol as b, ElFormItem as x, ElTooltip as S } from "element-plus/es";
|
|
7
7
|
//#region src/components/form/props/form-item.ts
|
|
8
|
-
var
|
|
8
|
+
var C = {
|
|
9
9
|
prop: [String, Array],
|
|
10
10
|
label: String,
|
|
11
11
|
labelPosition: {
|
|
@@ -54,7 +54,7 @@ var S = {
|
|
|
54
54
|
inputColspan: [Number, String],
|
|
55
55
|
labelRowspan: [Number, String],
|
|
56
56
|
inputRowspan: [Number, String]
|
|
57
|
-
},
|
|
57
|
+
}, w = {
|
|
58
58
|
required: !0,
|
|
59
59
|
rules: !0,
|
|
60
60
|
messagePrefix: !0,
|
|
@@ -72,7 +72,7 @@ var S = {
|
|
|
72
72
|
inputColspan: !0,
|
|
73
73
|
labelRowspan: !0,
|
|
74
74
|
inputRowspan: !0
|
|
75
|
-
},
|
|
75
|
+
}, T = (e) => C[e] !== void 0 && w[e] !== !0, E = (e, { emit: n, events: r, predicate: i }) => u(() => t(e, i, r, n)), D = {
|
|
76
76
|
span: {
|
|
77
77
|
type: Number,
|
|
78
78
|
default: 12
|
|
@@ -98,34 +98,34 @@ var S = {
|
|
|
98
98
|
type: String,
|
|
99
99
|
default: "div"
|
|
100
100
|
}
|
|
101
|
-
},
|
|
102
|
-
let t =
|
|
103
|
-
return
|
|
104
|
-
},
|
|
105
|
-
|
|
106
|
-
},
|
|
107
|
-
let s =
|
|
108
|
-
return
|
|
109
|
-
let c = { message: o }, l =
|
|
101
|
+
}, O = { span: !0 }, k = (e) => D[e] !== void 0 && O[e] !== !0, A = (e, { emit: n, events: r, predicate: i }) => u(() => t(e, i, r, n)), j = (e) => {
|
|
102
|
+
let t = p(r, null);
|
|
103
|
+
return u(() => e.required === !0 ? !0 : (t == null ? void 0 : t.requiredFieldsMap[e.prop]) === !0);
|
|
104
|
+
}, M = (e, t) => {
|
|
105
|
+
l(t) ? e.push(t) : s(t) ? e.push(...t) : c(t) && e.push(t);
|
|
106
|
+
}, N = (e, { rules: t, attrs: n, block: r, class: i, messagePrefix: a, message: o } = {}) => {
|
|
107
|
+
let s = j(e);
|
|
108
|
+
return u(() => {
|
|
109
|
+
let c = { message: o }, l = g(t);
|
|
110
110
|
Object.keys({
|
|
111
|
-
...
|
|
112
|
-
...
|
|
111
|
+
...C,
|
|
112
|
+
...D
|
|
113
113
|
}).forEach((t) => {
|
|
114
114
|
t === "rules" ? e[t] && l ? c[t] = [...e[t], ...l] : e[t] ? c[t] = e[t] : l && (c[t] = l) : t === "messagePrefix" ? c[t] = e.messagePrefix || a : t === "block" ? c[t] = r ?? e.block : c[t] = e[t];
|
|
115
115
|
});
|
|
116
116
|
let u = [];
|
|
117
|
-
return
|
|
117
|
+
return M(u, g(n == null ? void 0 : n.class)), M(u, g(i)), c.required = s.value, c.class = u, c.style = n == null ? void 0 : n.style, c;
|
|
118
118
|
});
|
|
119
|
-
},
|
|
119
|
+
}, P = {
|
|
120
120
|
name: "FormItemX",
|
|
121
121
|
inheritAttrs: !1,
|
|
122
122
|
props: {
|
|
123
|
-
...
|
|
124
|
-
...
|
|
123
|
+
...C,
|
|
124
|
+
...D
|
|
125
125
|
},
|
|
126
126
|
setup(e, { attrs: t, slots: n, expose: a }) {
|
|
127
|
-
let o =
|
|
128
|
-
if (
|
|
127
|
+
let o = p(y, null), s = p(i, null), c = p(r, null), l = t.embed ? u(() => t.disabled) : I(e), f = E(e, { predicate: T }), g = A(e, { predicate: k }), v = u(() => (s == null ? void 0 : s.reactive) === !0 && s.block === !1 && e.fixedSpan === void 0 && !e.half), C = j(e), w = _("formItem"), D = u(() => (s == null ? void 0 : s.wrapCol) === !1 ? !1 : !!o && e.wrapCol), O = u(() => c != null && c.tableForm ? "" : s != null && s.block ? "100%" : e.half && D.value ? `calc(50% - ${o.gutter.value / 2}px)` : ""), M = u(() => (s == null ? void 0 : s.block) === !0 || e.block || e.half ? 24 : e.span), N = u(() => {
|
|
128
|
+
if (l.value) return [];
|
|
129
129
|
if (C.value) {
|
|
130
130
|
let t = {
|
|
131
131
|
required: !0,
|
|
@@ -138,31 +138,31 @@ var S = {
|
|
|
138
138
|
return a({
|
|
139
139
|
clearValidate: async () => {
|
|
140
140
|
var e;
|
|
141
|
-
await
|
|
141
|
+
await h(), (e = w.value) == null || e.clearValidate();
|
|
142
142
|
},
|
|
143
143
|
validate: async () => {
|
|
144
144
|
var e;
|
|
145
|
-
await
|
|
145
|
+
await h(), (e = w.value) == null || e.validate();
|
|
146
146
|
}
|
|
147
147
|
}), () => {
|
|
148
148
|
var r;
|
|
149
|
-
let i = n.tips || e.tips, a = i ?
|
|
149
|
+
let i = n.tips || e.tips, a = i ? d(S, {
|
|
150
150
|
effect: "light",
|
|
151
151
|
content: e.tips,
|
|
152
152
|
offset: 4
|
|
153
153
|
}, {
|
|
154
|
-
default: () =>
|
|
154
|
+
default: () => d("i", { class: "el-icon-info form-item-input-info" }, null),
|
|
155
155
|
content: n.tips ? n.tips : null
|
|
156
|
-
}) : null, o =
|
|
156
|
+
}) : null, o = d(x, m(f.value, t, {
|
|
157
157
|
ref: "formItem",
|
|
158
|
-
style: { width:
|
|
158
|
+
style: { width: O.value },
|
|
159
159
|
class: [
|
|
160
160
|
"form-item",
|
|
161
161
|
e.formItemClass,
|
|
162
162
|
{
|
|
163
163
|
"form-item-hide-label": e.hideLabel,
|
|
164
164
|
"with-tips": !e.tipsAfterLabel && i,
|
|
165
|
-
required:
|
|
165
|
+
required: l.value === !1 && C.value
|
|
166
166
|
}
|
|
167
167
|
],
|
|
168
168
|
rules: N.value
|
|
@@ -171,13 +171,13 @@ var S = {
|
|
|
171
171
|
default: () => {
|
|
172
172
|
var t;
|
|
173
173
|
return [(t = n.default) == null ? void 0 : t.call(n, {
|
|
174
|
-
disabled:
|
|
174
|
+
disabled: l.value,
|
|
175
175
|
required: C.value
|
|
176
176
|
}), i && !e.tipsAfterLabel ? a : null];
|
|
177
177
|
},
|
|
178
178
|
label: () => [n.label ? n.label() : e.label, e.tipsAfterLabel ? a : null]
|
|
179
179
|
}), s = [o, (r = n.below) == null ? void 0 : r.call(n)];
|
|
180
|
-
return e.unwrap ? s : D.value ?
|
|
180
|
+
return e.unwrap ? s : D.value ? d(b, m(g.value, v.value ? {
|
|
181
181
|
xs: 24,
|
|
182
182
|
sm: 12,
|
|
183
183
|
md: 12,
|
|
@@ -186,9 +186,9 @@ var S = {
|
|
|
186
186
|
} : {}, { span: M.value }), { default: () => s }) : o;
|
|
187
187
|
};
|
|
188
188
|
}
|
|
189
|
-
},
|
|
190
|
-
let t =
|
|
191
|
-
return
|
|
189
|
+
}, F = "update:modelValue", I = (e) => {
|
|
190
|
+
let t = p(r, null), n = p(a, null);
|
|
191
|
+
return u(() => {
|
|
192
192
|
if (e.disabled !== void 0) return e.disabled;
|
|
193
193
|
if (t) {
|
|
194
194
|
if (t.requiredFieldsMap[e.prop] === !0 || t.enabledFieldsMap[e.prop] === !0) return !1;
|
|
@@ -196,7 +196,7 @@ var S = {
|
|
|
196
196
|
}
|
|
197
197
|
return (n == null ? void 0 : n.enabled) === !0 ? !1 : (n == null ? void 0 : n.disabled) === !0 ? !0 : (t == null ? void 0 : t.disabled) === !0;
|
|
198
198
|
});
|
|
199
|
-
},
|
|
199
|
+
}, L = { [F]: null }, R = (e, t) => e(F, t), z = (e, { vNodes: t, formItemProps: n, slots: r, disabled: i }) => e.wrapFormItem ? f(P, {
|
|
200
200
|
...n.value,
|
|
201
201
|
embed: !0,
|
|
202
202
|
disabled: i == null ? void 0 : i.value
|
|
@@ -206,31 +206,32 @@ var S = {
|
|
|
206
206
|
error: r.error,
|
|
207
207
|
tips: r.tips,
|
|
208
208
|
below: r.below
|
|
209
|
-
}) : t,
|
|
210
|
-
let
|
|
211
|
-
rules:
|
|
212
|
-
block:
|
|
213
|
-
attrs:
|
|
214
|
-
class:
|
|
215
|
-
message:
|
|
216
|
-
messagePrefix:
|
|
217
|
-
...
|
|
218
|
-
}),
|
|
219
|
-
vNodes:
|
|
220
|
-
formItemProps:
|
|
209
|
+
}) : t, B = (r, { emit: i, slots: a, events: s, predicate: c, removeOn: l = !1, attrs: d, block: m, class: h, rules: g, messagePrefix: _ = "请输入", extraFormItemProps: y }) => {
|
|
210
|
+
let b = I(r), x = p(o, null), S = u(() => b.value ? "" : `${_}${r.label}`), C = N(r, {
|
|
211
|
+
rules: g,
|
|
212
|
+
block: m === void 0 ? r.type === "textarea" && r.block === void 0 ? !0 : r.block : m,
|
|
213
|
+
attrs: d,
|
|
214
|
+
class: h,
|
|
215
|
+
message: S.value,
|
|
216
|
+
messagePrefix: _,
|
|
217
|
+
...y
|
|
218
|
+
}), w = (e) => R(i, e), T = (e) => r.col ? f(v, { span: r.block ? 24 : r.span }, { default: () => e }) : e, E = ({ vNodes: e }) => z(r, {
|
|
219
|
+
vNodes: T(e),
|
|
220
|
+
formItemProps: C,
|
|
221
221
|
slots: a,
|
|
222
|
-
disabled:
|
|
223
|
-
}),
|
|
222
|
+
disabled: b
|
|
223
|
+
}), D = u(() => t(r, c, s, i)), O = n({ removeOn: l });
|
|
224
224
|
return {
|
|
225
|
-
emitInput:
|
|
226
|
-
render:
|
|
227
|
-
placeholder:
|
|
228
|
-
disabled:
|
|
229
|
-
formItemProps:
|
|
230
|
-
autoBind:
|
|
231
|
-
inputProps: e(r,
|
|
232
|
-
listeners:
|
|
225
|
+
emitInput: w,
|
|
226
|
+
render: E,
|
|
227
|
+
placeholder: S,
|
|
228
|
+
disabled: b,
|
|
229
|
+
formItemProps: C,
|
|
230
|
+
autoBind: D,
|
|
231
|
+
inputProps: e(r, c),
|
|
232
|
+
listeners: O,
|
|
233
|
+
printing: u(() => (x == null ? void 0 : x.printing) === !0)
|
|
233
234
|
};
|
|
234
|
-
},
|
|
235
|
+
}, V = (e) => e.icon ? f("i", { class: e.icon }) : null;
|
|
235
236
|
//#endregion
|
|
236
|
-
export {
|
|
237
|
+
export { P as a, C as c, B as i, L as n, N as o, z as r, D as s, V as t };
|