@aplus-frontend/ui 0.1.15 → 0.1.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/es/index.mjs +56 -54
- package/es/src/ap-table/ap-table.vue.mjs +132 -129
- package/es/src/ap-table/interface.d.ts +20 -13
- package/es/src/ap-table/utils.d.ts +8340 -1
- package/es/src/ap-table/utils.mjs +135 -79
- package/es/src/business/index.d.ts +2 -0
- package/es/src/business/index.mjs +20 -18
- package/es/src/config-provider/config-provider-props.d.ts +5 -1
- package/es/src/config-provider/config-provider-props.mjs +4 -0
- package/es/src/config-provider/config-provider.d.ts +10 -1
- package/es/src/config-provider/config-provider.mjs +18 -17
- package/es/src/config-provider/constants.d.ts +6 -2
- package/es/src/config-provider/hooks/use-global-config.d.ts +5 -1
- package/es/src/config-provider/index.d.ts +20 -1
- package/es/src/editable-table/form-item.vue.mjs +85 -72
- package/es/src/editable-table/index.vue.mjs +99 -86
- package/es/src/editable-table/utils.mjs +31 -30
- package/es/src/index.mjs +45 -43
- package/es/src/theme/antd-global-overwrite/admin/form.css +10 -5
- package/es/src/theme/antd-global-overwrite/admin/index.css +117 -38
- package/es/src/theme/antd-global-overwrite/admin/pagination.css +54 -16
- package/es/src/theme/antd-global-overwrite/admin/table.css +53 -17
- package/es/src/theme/antd-global-overwrite/aplus/form.css +28 -14
- package/es/src/theme/antd-global-overwrite/aplus/index.css +159 -67
- package/es/src/theme/antd-global-overwrite/aplus/pagination.css +66 -20
- package/es/src/theme/antd-global-overwrite/aplus/table.css +65 -33
- package/es/src/utils/ap-trans-data/index.d.ts +9 -10
- package/es/src/utils/ap-trans-data/index.mjs +20 -0
- package/lib/index.js +1 -1
- package/lib/src/ap-table/ap-table.vue.js +1 -1
- package/lib/src/ap-table/interface.d.ts +20 -13
- package/lib/src/ap-table/utils.d.ts +8340 -1
- package/lib/src/ap-table/utils.js +1 -1
- package/lib/src/business/index.d.ts +2 -0
- package/lib/src/business/index.js +1 -1
- package/lib/src/config-provider/config-provider-props.d.ts +5 -1
- package/lib/src/config-provider/config-provider-props.js +1 -1
- package/lib/src/config-provider/config-provider.d.ts +10 -1
- package/lib/src/config-provider/config-provider.js +1 -1
- package/lib/src/config-provider/constants.d.ts +6 -2
- package/lib/src/config-provider/hooks/use-global-config.d.ts +5 -1
- package/lib/src/config-provider/index.d.ts +20 -1
- package/lib/src/editable-table/form-item.vue.js +1 -1
- package/lib/src/editable-table/index.vue.js +1 -1
- package/lib/src/editable-table/utils.js +1 -1
- package/lib/src/index.js +1 -1
- package/lib/src/theme/antd-global-overwrite/admin/form.css +10 -5
- package/lib/src/theme/antd-global-overwrite/admin/index.css +117 -38
- package/lib/src/theme/antd-global-overwrite/admin/pagination.css +54 -16
- package/lib/src/theme/antd-global-overwrite/admin/table.css +53 -17
- package/lib/src/theme/antd-global-overwrite/aplus/form.css +28 -14
- package/lib/src/theme/antd-global-overwrite/aplus/index.css +159 -67
- package/lib/src/theme/antd-global-overwrite/aplus/pagination.css +66 -20
- package/lib/src/theme/antd-global-overwrite/aplus/table.css +65 -33
- package/lib/src/utils/ap-trans-data/index.d.ts +9 -10
- package/lib/src/utils/ap-trans-data/index.js +1 -0
- package/package.json +1 -1
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { Table as
|
|
3
|
-
import { ApForm as
|
|
4
|
-
import { isNumber as
|
|
1
|
+
import { defineComponent as K, ref as y, unref as o, useSlots as q, watch as H, openBlock as u, createBlock as C, mergeProps as b, withCtx as m, createVNode as w, createSlots as I, createElementBlock as W, normalizeClass as $, createCommentVNode as R, createElementVNode as G, toDisplayString as M, normalizeStyle as Q, renderList as U, renderSlot as J, normalizeProps as X, guardReactiveProps as Y } from "vue";
|
|
2
|
+
import { Table as Z, Tooltip as ee } from "ant-design-vue";
|
|
3
|
+
import { ApForm as B } from "../ap-form/index.mjs";
|
|
4
|
+
import { isNumber as i, cloneDeep as f, omit as oe } from "lodash-unified";
|
|
5
5
|
import "../config-provider/index.mjs";
|
|
6
|
-
import { useInjectForm as
|
|
6
|
+
import { useInjectForm as te } from "../ap-form/context.mjs";
|
|
7
7
|
import "./style/index.css";
|
|
8
|
-
import { isDef as
|
|
9
|
-
import
|
|
10
|
-
import { scrollToRowIndex as
|
|
11
|
-
import {
|
|
12
|
-
|
|
8
|
+
import { isDef as p } from "../utils/index.mjs";
|
|
9
|
+
import ae from "./hooks/use-get-columns.mjs";
|
|
10
|
+
import { scrollToRowIndex as le, getColumnIsRequired as ne } from "./utils.mjs";
|
|
11
|
+
import { QuestionCircleOutlined as re } from "@ant-design/icons-vue";
|
|
12
|
+
import { useToken as se } from "ant-design-vue/es/theme/internal";
|
|
13
|
+
import { useNamespace as de } from "../config-provider/hooks/use-namespace.mjs";
|
|
14
|
+
const Re = /* @__PURE__ */ K({
|
|
13
15
|
name: "EditableTableInner",
|
|
14
16
|
__name: "form-item",
|
|
15
17
|
props: {
|
|
@@ -109,103 +111,114 @@ const ge = /* @__PURE__ */ V({
|
|
|
109
111
|
default: () => ({})
|
|
110
112
|
}
|
|
111
113
|
},
|
|
112
|
-
setup(
|
|
113
|
-
expose:
|
|
114
|
+
setup(k, {
|
|
115
|
+
expose: D
|
|
114
116
|
}) {
|
|
115
|
-
var
|
|
116
|
-
const
|
|
117
|
-
internalInstance:
|
|
118
|
-
model:
|
|
119
|
-
} =
|
|
120
|
-
|
|
121
|
-
var
|
|
122
|
-
r.value = e, (
|
|
117
|
+
var h;
|
|
118
|
+
const l = k, {
|
|
119
|
+
internalInstance: n,
|
|
120
|
+
model: v
|
|
121
|
+
} = te(), r = y(((h = o(v)) == null ? void 0 : h[l.name]) || []), L = q(), E = B.useWatch(l.name);
|
|
122
|
+
H(() => E.value, (e) => {
|
|
123
|
+
var t;
|
|
124
|
+
r.value = e, (t = l.onChange) == null || t.call(l, e);
|
|
123
125
|
}, {
|
|
124
126
|
deep: !0
|
|
125
127
|
});
|
|
126
128
|
const {
|
|
127
|
-
b:
|
|
128
|
-
em:
|
|
129
|
-
} =
|
|
130
|
-
function
|
|
129
|
+
b: F,
|
|
130
|
+
em: N
|
|
131
|
+
} = de("editable-table"), c = y(), [, S] = se(), T = ae(l);
|
|
132
|
+
function _(e, t) {
|
|
131
133
|
var d;
|
|
132
|
-
const a = ((d =
|
|
133
|
-
if (
|
|
134
|
+
const a = ((d = o(r)) == null ? void 0 : d.length) || 0;
|
|
135
|
+
if (p(l.maxLength) && a >= l.maxLength)
|
|
134
136
|
return;
|
|
135
|
-
const s = [...
|
|
136
|
-
|
|
137
|
+
const s = [...o(r) || []];
|
|
138
|
+
p(t) ? s.splice(t, 0, {
|
|
137
139
|
...e || {}
|
|
138
140
|
}) : s.push({
|
|
139
141
|
...e || {}
|
|
140
|
-
}),
|
|
142
|
+
}), n == null || n.setFieldValue(l.name, [...o(r) || [], e || {}]);
|
|
141
143
|
}
|
|
142
|
-
function
|
|
144
|
+
function z(e, t = "suffix") {
|
|
143
145
|
var g;
|
|
144
|
-
const a = ((g =
|
|
145
|
-
if (
|
|
146
|
+
const a = ((g = o(r)) == null ? void 0 : g.length) || 0, s = i(e) ? e : e.length;
|
|
147
|
+
if (p(l.maxLength) && a + s > l.maxLength)
|
|
146
148
|
return;
|
|
147
|
-
const d = [...
|
|
148
|
-
|
|
149
|
+
const d = [...o(r) || []], x = i(e) ? new Array(e).fill({}) : f(e);
|
|
150
|
+
t === "suffix" ? d.push(...x) : d.unshift(...x), n == null || n.setFieldValue(l.name, d);
|
|
149
151
|
}
|
|
150
|
-
function
|
|
151
|
-
let
|
|
152
|
-
const a =
|
|
153
|
-
|
|
152
|
+
function P(e) {
|
|
153
|
+
let t = f(o(r) || []);
|
|
154
|
+
const a = i(e) ? [e] : e;
|
|
155
|
+
t = t.filter((s, d) => !a.includes(d)), n == null || n.setFieldValue(l.name, t);
|
|
154
156
|
}
|
|
155
|
-
function
|
|
156
|
-
return
|
|
157
|
+
function j() {
|
|
158
|
+
return o(r);
|
|
157
159
|
}
|
|
158
|
-
function
|
|
159
|
-
var
|
|
160
|
-
return (
|
|
160
|
+
function O(e) {
|
|
161
|
+
var t;
|
|
162
|
+
return (t = o(r)) == null ? void 0 : t[e];
|
|
161
163
|
}
|
|
162
|
-
function
|
|
163
|
-
const a = f(
|
|
164
|
+
function V(e, t) {
|
|
165
|
+
const a = f(o(r));
|
|
164
166
|
a[e] && (a[e] = {
|
|
165
167
|
...a[e],
|
|
166
|
-
...
|
|
167
|
-
},
|
|
168
|
+
...t
|
|
169
|
+
}, n == null || n.setFieldValue(l.name, [...a]));
|
|
168
170
|
}
|
|
169
|
-
function
|
|
171
|
+
function A(e, t) {
|
|
170
172
|
var s;
|
|
171
173
|
const a = e === "end" ? r.value.length - 1 : e;
|
|
172
|
-
|
|
174
|
+
le(a, (s = c.value) == null ? void 0 : s.$el, t);
|
|
173
175
|
}
|
|
174
|
-
return
|
|
175
|
-
add:
|
|
176
|
-
remove:
|
|
177
|
-
getRowData:
|
|
178
|
-
getRowsData:
|
|
179
|
-
setRowData:
|
|
180
|
-
addMultiple:
|
|
181
|
-
scrollTo:
|
|
182
|
-
}), (e,
|
|
176
|
+
return D({
|
|
177
|
+
add: _,
|
|
178
|
+
remove: P,
|
|
179
|
+
getRowData: O,
|
|
180
|
+
getRowsData: j,
|
|
181
|
+
setRowData: V,
|
|
182
|
+
addMultiple: z,
|
|
183
|
+
scrollTo: A
|
|
184
|
+
}), (e, t) => (u(), C(o(B).FormItem, b(e.formItem, {
|
|
183
185
|
name: e.name,
|
|
184
186
|
label: e.label
|
|
185
187
|
}), {
|
|
186
|
-
default:
|
|
187
|
-
class:
|
|
188
|
-
columns:
|
|
188
|
+
default: m(() => [w(o(Z), b(o(oe)(l, ["name", "maxLength", "onChange"]), {
|
|
189
|
+
class: o(F)(),
|
|
190
|
+
columns: o(T),
|
|
189
191
|
"data-source": r.value,
|
|
190
192
|
ref_key: "tableRef",
|
|
191
|
-
ref:
|
|
192
|
-
}),
|
|
193
|
-
headerCell:
|
|
193
|
+
ref: c
|
|
194
|
+
}), I({
|
|
195
|
+
headerCell: m(({
|
|
194
196
|
column: a
|
|
195
|
-
}) => [
|
|
196
|
-
key: 0
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
197
|
+
}) => [o(ne)(a) ? (u(), W("span", {
|
|
198
|
+
key: 0,
|
|
199
|
+
class: $(o(N)("header-cell", "required"))
|
|
200
|
+
}, "*", 2)) : R("", !0), G("span", null, M(a.title), 1), a.tooltip ? (u(), C(o(ee), {
|
|
201
|
+
key: 1,
|
|
202
|
+
title: a.tooltip,
|
|
203
|
+
placement: "bottom"
|
|
204
|
+
}, {
|
|
205
|
+
default: m(() => [w(o(re), {
|
|
206
|
+
style: Q({
|
|
207
|
+
paddingLeft: "4px",
|
|
208
|
+
color: o(S).colorPrimary
|
|
209
|
+
})
|
|
210
|
+
}, null, 8, ["style"])]),
|
|
211
|
+
_: 2
|
|
212
|
+
}, 1032, ["title"])) : R("", !0)]),
|
|
200
213
|
_: 2
|
|
201
|
-
}, [U(
|
|
214
|
+
}, [U(L, (a, s) => ({
|
|
202
215
|
name: s,
|
|
203
|
-
fn:
|
|
216
|
+
fn: m((d) => [J(e.$slots, s, X(Y(d || {})))])
|
|
204
217
|
}))]), 1040, ["class", "columns", "data-source"])]),
|
|
205
218
|
_: 3
|
|
206
219
|
}, 16, ["name", "label"]));
|
|
207
220
|
}
|
|
208
221
|
});
|
|
209
222
|
export {
|
|
210
|
-
|
|
223
|
+
Re as default
|
|
211
224
|
};
|
|
@@ -1,16 +1,18 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { Table as
|
|
3
|
-
import { ApForm as
|
|
4
|
-
import { isEqual as
|
|
1
|
+
import { defineComponent as G, useSlots as Q, ref as R, watch as b, unref as o, openBlock as p, createBlock as B, withCtx as m, createVNode as x, mergeProps as J, createSlots as X, createElementBlock as Y, normalizeClass as Z, createCommentVNode as F, createElementVNode as ee, toDisplayString as te, normalizeStyle as ae, renderList as ne, renderSlot as oe, normalizeProps as le, guardReactiveProps as re } from "vue";
|
|
2
|
+
import { Table as se, Tooltip as ue } from "ant-design-vue";
|
|
3
|
+
import { ApForm as h } from "../ap-form/index.mjs";
|
|
4
|
+
import { isEqual as ie, isArray as k, isNumber as y, cloneDeep as g, omit as de } from "lodash-unified";
|
|
5
5
|
import "../config-provider/index.mjs";
|
|
6
6
|
import "../hooks/index.mjs";
|
|
7
|
-
import { isDef as
|
|
8
|
-
import { scrollToRowIndex as
|
|
9
|
-
import
|
|
7
|
+
import { isDef as C } from "../utils/index.mjs";
|
|
8
|
+
import { scrollToRowIndex as me, getColumnIsRequired as fe } from "./utils.mjs";
|
|
9
|
+
import ce from "./hooks/use-get-columns.mjs";
|
|
10
10
|
import "./style/index.css";
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
|
|
11
|
+
import { useToken as pe } from "ant-design-vue/es/theme/internal";
|
|
12
|
+
import { QuestionCircleOutlined as xe } from "@ant-design/icons-vue";
|
|
13
|
+
import { useNamespace as he } from "../config-provider/hooks/use-namespace.mjs";
|
|
14
|
+
import { useControllableValue as ye } from "../hooks/useControllableValue.mjs";
|
|
15
|
+
const De = /* @__PURE__ */ G({
|
|
14
16
|
name: "EditableTable",
|
|
15
17
|
__name: "index",
|
|
16
18
|
props: {
|
|
@@ -110,130 +112,141 @@ const Ee = /* @__PURE__ */ W({
|
|
|
110
112
|
},
|
|
111
113
|
emits: ["update:value"],
|
|
112
114
|
setup(E, {
|
|
113
|
-
expose:
|
|
114
|
-
emit:
|
|
115
|
+
expose: L,
|
|
116
|
+
emit: N
|
|
115
117
|
}) {
|
|
116
|
-
const
|
|
117
|
-
b:
|
|
118
|
-
em:
|
|
119
|
-
} =
|
|
118
|
+
const l = E, {
|
|
119
|
+
b: V,
|
|
120
|
+
em: _
|
|
121
|
+
} = he("editable-table"), D = Q(), S = N, v = R(), {
|
|
120
122
|
value: s,
|
|
121
|
-
updateValue:
|
|
122
|
-
} =
|
|
123
|
-
|
|
123
|
+
updateValue: T
|
|
124
|
+
} = ye(l, S), u = R(), [, A] = pe(), c = h.useWatch(l.name, u);
|
|
125
|
+
b(() => c.value, (e) => {
|
|
124
126
|
var t;
|
|
125
|
-
|
|
127
|
+
T(e), (t = l.onChange) == null || t.call(l, e);
|
|
126
128
|
}, {
|
|
127
129
|
deep: !0
|
|
128
|
-
}),
|
|
130
|
+
}), b(s, (e) => {
|
|
129
131
|
var t;
|
|
130
|
-
e !==
|
|
132
|
+
e !== o(c) && (ie(e, o(c)) || (t = u.value) == null || t.setFieldValue(l.name, e));
|
|
131
133
|
}, {
|
|
132
134
|
deep: !0
|
|
133
135
|
});
|
|
134
|
-
const
|
|
135
|
-
function
|
|
136
|
+
const z = ce(l);
|
|
137
|
+
function P() {
|
|
136
138
|
var e;
|
|
137
139
|
(e = u.value) == null || e.resetFields();
|
|
138
140
|
}
|
|
139
|
-
function
|
|
140
|
-
return e ? (
|
|
141
|
+
function I(e) {
|
|
142
|
+
return e ? (k(e) ? e : [e]).map((a) => k(a) ? [l.name, ...a] : [l.name, a]) : void 0;
|
|
141
143
|
}
|
|
142
|
-
async function
|
|
144
|
+
async function O(e, t) {
|
|
143
145
|
var n;
|
|
144
|
-
const a = await ((n = u.value) == null ? void 0 : n.validateFields(
|
|
145
|
-
return a == null ? void 0 : a[
|
|
146
|
+
const a = await ((n = u.value) == null ? void 0 : n.validateFields(I(e), t));
|
|
147
|
+
return a == null ? void 0 : a[l.name];
|
|
146
148
|
}
|
|
147
|
-
function
|
|
148
|
-
var r,
|
|
149
|
-
const a = ((r =
|
|
150
|
-
if (
|
|
149
|
+
function j(e, t) {
|
|
150
|
+
var r, i, d;
|
|
151
|
+
const a = ((r = o(s)) == null ? void 0 : r.length) || 0;
|
|
152
|
+
if (C(l.maxLength) && a >= l.maxLength)
|
|
151
153
|
return;
|
|
152
|
-
const n = [...
|
|
153
|
-
|
|
154
|
+
const n = [...o(s) || []];
|
|
155
|
+
C(t) ? n.splice(t, 0, {
|
|
154
156
|
...e || {}
|
|
155
157
|
}) : n.push({
|
|
156
158
|
...e || {}
|
|
157
|
-
}), (
|
|
159
|
+
}), (d = (i = u.value) == null ? void 0 : i.setFieldValue) == null || d.call(i, l.name, n);
|
|
158
160
|
}
|
|
159
|
-
function
|
|
160
|
-
var
|
|
161
|
-
const a = ((
|
|
162
|
-
if (
|
|
161
|
+
function q(e, t = "suffix") {
|
|
162
|
+
var d, f, w;
|
|
163
|
+
const a = ((d = o(s)) == null ? void 0 : d.length) || 0, n = y(e) ? e : e.length;
|
|
164
|
+
if (C(l.maxLength) && a + n > l.maxLength)
|
|
163
165
|
return;
|
|
164
|
-
const r = [...
|
|
165
|
-
t === "suffix" ? r.push(...
|
|
166
|
+
const r = [...o(s) || []], i = y(e) ? new Array(e).fill({}) : g(e);
|
|
167
|
+
t === "suffix" ? r.push(...i) : r.unshift(...i), (w = (f = u.value) == null ? void 0 : f.setFieldValue) == null || w.call(f, l.name, r);
|
|
166
168
|
}
|
|
167
|
-
function
|
|
169
|
+
function K(e) {
|
|
168
170
|
var n, r;
|
|
169
|
-
let t =
|
|
170
|
-
const a =
|
|
171
|
-
t = t.filter((
|
|
171
|
+
let t = g(o(s) || []);
|
|
172
|
+
const a = y(e) ? [e] : e;
|
|
173
|
+
t = t.filter((i, d) => !a.includes(d)), (r = (n = u.value) == null ? void 0 : n.setFieldValue) == null || r.call(n, l.name, t);
|
|
172
174
|
}
|
|
173
|
-
function
|
|
174
|
-
return
|
|
175
|
+
function H() {
|
|
176
|
+
return o(s);
|
|
175
177
|
}
|
|
176
|
-
function
|
|
178
|
+
function M(e) {
|
|
177
179
|
var t;
|
|
178
|
-
return (t =
|
|
180
|
+
return (t = o(s)) == null ? void 0 : t[e];
|
|
179
181
|
}
|
|
180
|
-
function
|
|
182
|
+
function U(e, t) {
|
|
181
183
|
var n, r;
|
|
182
|
-
const a =
|
|
184
|
+
const a = g(o(s));
|
|
183
185
|
a[e] && (a[e] = {
|
|
184
186
|
...a[e],
|
|
185
187
|
...t
|
|
186
|
-
}, (r = (n = u.value) == null ? void 0 : n.setFieldValue) == null || r.call(n,
|
|
188
|
+
}, (r = (n = u.value) == null ? void 0 : n.setFieldValue) == null || r.call(n, l.name, [...a]));
|
|
187
189
|
}
|
|
188
|
-
function
|
|
190
|
+
function W(e, t) {
|
|
189
191
|
var n;
|
|
190
192
|
const a = e === "end" ? s.value.length - 1 : e;
|
|
191
|
-
|
|
193
|
+
me(a, (n = v.value) == null ? void 0 : n.$el, t);
|
|
192
194
|
}
|
|
193
|
-
function
|
|
195
|
+
function $() {
|
|
194
196
|
var e, t;
|
|
195
|
-
(t = (e = u.value) == null ? void 0 : e.setFieldValue) == null || t.call(e,
|
|
197
|
+
(t = (e = u.value) == null ? void 0 : e.setFieldValue) == null || t.call(e, l.name, []);
|
|
196
198
|
}
|
|
197
|
-
return
|
|
198
|
-
resetFields:
|
|
199
|
-
validateFields:
|
|
200
|
-
add:
|
|
201
|
-
remove:
|
|
202
|
-
getRowData:
|
|
203
|
-
getRowsData:
|
|
204
|
-
setRowData:
|
|
205
|
-
addMultiple:
|
|
206
|
-
scrollTo:
|
|
207
|
-
clear:
|
|
208
|
-
}), (e, t) => (
|
|
199
|
+
return L({
|
|
200
|
+
resetFields: P,
|
|
201
|
+
validateFields: O,
|
|
202
|
+
add: j,
|
|
203
|
+
remove: K,
|
|
204
|
+
getRowData: M,
|
|
205
|
+
getRowsData: H,
|
|
206
|
+
setRowData: U,
|
|
207
|
+
addMultiple: q,
|
|
208
|
+
scrollTo: W,
|
|
209
|
+
clear: $
|
|
210
|
+
}), (e, t) => (p(), B(o(h), {
|
|
209
211
|
"initial-values": {
|
|
210
|
-
[
|
|
212
|
+
[l.name]: o(s)
|
|
211
213
|
},
|
|
212
214
|
ref_key: "formRef",
|
|
213
215
|
ref: u
|
|
214
216
|
}, {
|
|
215
|
-
default:
|
|
217
|
+
default: m(() => [x(o(h).FormItem, {
|
|
216
218
|
name: e.name,
|
|
217
219
|
"no-style": ""
|
|
218
220
|
}, {
|
|
219
|
-
default:
|
|
220
|
-
class:
|
|
221
|
-
columns:
|
|
222
|
-
"data-source":
|
|
221
|
+
default: m(() => [x(o(se), J(o(de)(l, ["name", "value", "onUpdate:value", "maxLength", "onChange"]), {
|
|
222
|
+
class: o(V)(),
|
|
223
|
+
columns: o(z),
|
|
224
|
+
"data-source": o(s),
|
|
223
225
|
ref_key: "tableRef",
|
|
224
|
-
ref:
|
|
225
|
-
}),
|
|
226
|
-
headerCell:
|
|
226
|
+
ref: v
|
|
227
|
+
}), X({
|
|
228
|
+
headerCell: m(({
|
|
227
229
|
column: a
|
|
228
|
-
}) => [
|
|
229
|
-
key: 0
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
230
|
+
}) => [o(fe)(a) ? (p(), Y("span", {
|
|
231
|
+
key: 0,
|
|
232
|
+
class: Z(o(_)("header-cell", "required"))
|
|
233
|
+
}, "*", 2)) : F("", !0), ee("span", null, te(a.title), 1), a.tooltip ? (p(), B(o(ue), {
|
|
234
|
+
key: 1,
|
|
235
|
+
title: a.tooltip,
|
|
236
|
+
placement: "bottom"
|
|
237
|
+
}, {
|
|
238
|
+
default: m(() => [x(o(xe), {
|
|
239
|
+
style: ae({
|
|
240
|
+
paddingLeft: "4px",
|
|
241
|
+
color: o(A).colorPrimary
|
|
242
|
+
})
|
|
243
|
+
}, null, 8, ["style"])]),
|
|
244
|
+
_: 2
|
|
245
|
+
}, 1032, ["title"])) : F("", !0)]),
|
|
233
246
|
_: 2
|
|
234
|
-
}, [
|
|
247
|
+
}, [ne(D, (a, n) => ({
|
|
235
248
|
name: n,
|
|
236
|
-
fn:
|
|
249
|
+
fn: m((r) => [oe(e.$slots, n, le(re(r || {})))])
|
|
237
250
|
}))]), 1040, ["class", "columns", "data-source"])]),
|
|
238
251
|
_: 3
|
|
239
252
|
}, 8, ["name"])]),
|
|
@@ -242,5 +255,5 @@ const Ee = /* @__PURE__ */ W({
|
|
|
242
255
|
}
|
|
243
256
|
});
|
|
244
257
|
export {
|
|
245
|
-
|
|
258
|
+
De as default
|
|
246
259
|
};
|
|
@@ -1,42 +1,43 @@
|
|
|
1
|
-
import { isVNode as f, createVNode as
|
|
2
|
-
import { isFunction as
|
|
3
|
-
import { apTableFormItemMap as c, noRenderAsFormItemValueList as
|
|
1
|
+
import { isVNode as f, createVNode as n, mergeProps as d } from "vue";
|
|
2
|
+
import { isFunction as p, isArray as s, isBoolean as a, omit as u } from "lodash-unified";
|
|
3
|
+
import { apTableFormItemMap as c, noRenderAsFormItemValueList as m, apTableRenderItemMap as y } from "../ap-table/constants.mjs";
|
|
4
4
|
import { isDef as b } from "../utils/index.mjs";
|
|
5
5
|
import { getValueStr as g } from "../ap-field/number/helper.mjs";
|
|
6
6
|
import T from "scroll-into-view-if-needed";
|
|
7
7
|
import { Typography as C } from "ant-design-vue";
|
|
8
8
|
import "../ap-form/index.mjs";
|
|
9
|
-
import I from "../ap-
|
|
10
|
-
|
|
9
|
+
import { objectToString as I } from "../ap-table/utils.mjs";
|
|
10
|
+
import P from "../ap-form/ap-form-item.vue.mjs";
|
|
11
|
+
function R(e) {
|
|
11
12
|
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !f(e);
|
|
12
13
|
}
|
|
13
|
-
function
|
|
14
|
+
function F(e) {
|
|
14
15
|
return c[e];
|
|
15
16
|
}
|
|
16
|
-
function
|
|
17
|
+
function N(e) {
|
|
17
18
|
if (!e.fieldProps)
|
|
18
19
|
return !1;
|
|
19
|
-
const r =
|
|
20
|
-
return b(r.required) ? r.required : (
|
|
20
|
+
const r = p(e.fieldProps) ? e.fieldProps({}) : e.fieldProps;
|
|
21
|
+
return b(r.required) ? r.required : (s(r.rules) ? r.rules : r.rules ? [r.rules] : []).some((t) => t.required);
|
|
21
22
|
}
|
|
22
|
-
function
|
|
23
|
+
function V(e, r) {
|
|
23
24
|
if (e.valueType === "text" || e.valueType === "textArea")
|
|
24
25
|
return r || "--";
|
|
25
26
|
if (e.valueType === "number") {
|
|
26
|
-
const o = e.fieldProps ?
|
|
27
|
+
const o = e.fieldProps ? p(e.fieldProps) ? e.fieldProps({}) : e.fieldProps : {};
|
|
27
28
|
return g(r, o) || "--";
|
|
28
29
|
}
|
|
29
|
-
return r;
|
|
30
|
+
return I(r);
|
|
30
31
|
}
|
|
31
|
-
function
|
|
32
|
+
function O(e, r) {
|
|
32
33
|
const o = [e];
|
|
33
34
|
if (r) {
|
|
34
|
-
const t =
|
|
35
|
+
const t = s(r) ? r : [r];
|
|
35
36
|
o.unshift(...t);
|
|
36
37
|
}
|
|
37
38
|
return o.join(" ");
|
|
38
39
|
}
|
|
39
|
-
function
|
|
40
|
+
function k(e, r = document.body, o = {}) {
|
|
40
41
|
const t = r.querySelectorAll("tr.ant-table-row")[e];
|
|
41
42
|
t && T(t, {
|
|
42
43
|
scrollMode: "if-needed",
|
|
@@ -45,8 +46,8 @@ function N(e, r = document.body, o = {}) {
|
|
|
45
46
|
...o
|
|
46
47
|
});
|
|
47
48
|
}
|
|
48
|
-
function
|
|
49
|
-
return
|
|
49
|
+
function h(e, r, o) {
|
|
50
|
+
return m.includes(e.valueType) ? o : e.copyable || e.ellipsis ? n(C.Paragraph, {
|
|
50
51
|
copyable: e.copyable ? {
|
|
51
52
|
text: r,
|
|
52
53
|
tooltip: !1
|
|
@@ -57,34 +58,34 @@ function V(e, r, o) {
|
|
|
57
58
|
...e.ellipsis,
|
|
58
59
|
tooltip: r
|
|
59
60
|
} : !1,
|
|
60
|
-
content: e.ellipsis ?
|
|
61
|
+
content: e.ellipsis ? V(e, r) : o
|
|
61
62
|
}, null) : o;
|
|
62
63
|
}
|
|
63
|
-
function
|
|
64
|
+
function B(e, r, o, t) {
|
|
64
65
|
let l;
|
|
65
66
|
if (e.valueType)
|
|
66
67
|
if (r) {
|
|
67
|
-
const i =
|
|
68
|
-
l =
|
|
68
|
+
const i = F(e.valueType);
|
|
69
|
+
l = n(i, o, null);
|
|
69
70
|
} else {
|
|
70
|
-
const i =
|
|
71
|
-
l =
|
|
71
|
+
const i = y[e.valueType];
|
|
72
|
+
l = h(e, t, n(i, d(o.field, {
|
|
72
73
|
mode: "read"
|
|
73
74
|
}), null));
|
|
74
75
|
}
|
|
75
76
|
if (e.customRenderFormItem) {
|
|
76
77
|
const i = e.customRenderFormItem(e, o.field, r);
|
|
77
|
-
l =
|
|
78
|
+
l = n(P, u(o, ["field"]), R(i) ? i : {
|
|
78
79
|
default: () => [i]
|
|
79
80
|
});
|
|
80
81
|
}
|
|
81
82
|
return l;
|
|
82
83
|
}
|
|
83
84
|
export {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
85
|
+
N as getColumnIsRequired,
|
|
86
|
+
F as getEditableComponent,
|
|
87
|
+
B as getFinalNode,
|
|
88
|
+
V as getRawDisplayValue,
|
|
89
|
+
O as mergeClass,
|
|
90
|
+
k as scrollToRowIndex
|
|
90
91
|
};
|