@aplus-frontend/ui 0.0.22 → 0.0.23
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/check-card/group.vue.d.ts +1 -1
- package/es/src/check-card/group.vue.mjs +1 -1
- package/es/src/check-card/index.vue.d.ts +1 -1
- package/es/src/check-card/index.vue2.mjs +40 -36
- package/es/src/check-card/interface.d.ts +1 -1
- package/es/src/editable-table/form-item.vue.d.ts +755 -105
- package/es/src/editable-table/form-item.vue.mjs +81 -64
- package/es/src/editable-table/index.vue.d.ts +527 -112
- package/es/src/editable-table/index.vue.mjs +93 -76
- package/es/src/editable-table/interface.d.ts +11 -5
- package/lib/src/check-card/group.vue.d.ts +1 -1
- package/lib/src/check-card/group.vue.js +1 -1
- package/lib/src/check-card/index.vue.d.ts +1 -1
- package/lib/src/check-card/index.vue2.js +1 -1
- package/lib/src/check-card/interface.d.ts +1 -1
- package/lib/src/editable-table/form-item.vue.d.ts +755 -105
- package/lib/src/editable-table/form-item.vue.js +1 -1
- package/lib/src/editable-table/index.vue.d.ts +527 -112
- package/lib/src/editable-table/index.vue.js +1 -1
- package/lib/src/editable-table/interface.d.ts +11 -5
- package/package.json +3 -3
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { Table as
|
|
3
|
-
import { ApForm as
|
|
4
|
-
import { cloneDeep as
|
|
1
|
+
import { defineComponent as V, ref as A, unref as o, useSlots as O, watch as T, openBlock as C, createBlock as K, mergeProps as w, withCtx as u, createVNode as M, createSlots as q, createElementBlock as G, Fragment as H, createElementVNode as b, normalizeClass as W, toDisplayString as U, createCommentVNode as $, renderList as J, renderSlot as Q, normalizeProps as X, guardReactiveProps as Y } from "vue";
|
|
2
|
+
import { Table as Z } from "ant-design-vue";
|
|
3
|
+
import { ApForm as y } from "../ap-form/index.mjs";
|
|
4
|
+
import { isNumber as p, cloneDeep as m, omit as I } from "lodash-unified";
|
|
5
5
|
import "../config-provider/index.mjs";
|
|
6
|
-
import { useInjectForm as
|
|
6
|
+
import { useInjectForm as ee } from "../ap-form/context.mjs";
|
|
7
7
|
import "./style/index.css";
|
|
8
|
-
import { isDef as
|
|
9
|
-
import
|
|
10
|
-
import { useNamespace as
|
|
11
|
-
import { useGlobalConfig as
|
|
12
|
-
const
|
|
8
|
+
import { isDef as f } from "../utils/index.mjs";
|
|
9
|
+
import te from "./hooks/use-get-columns.mjs";
|
|
10
|
+
import { useNamespace as ae } from "../config-provider/hooks/use-namespace.mjs";
|
|
11
|
+
import { useGlobalConfig as oe } from "../config-provider/hooks/use-global-config.mjs";
|
|
12
|
+
const he = /* @__PURE__ */ V({
|
|
13
13
|
name: "EditableTableInner",
|
|
14
14
|
__name: "form-item",
|
|
15
15
|
props: {
|
|
@@ -109,81 +109,98 @@ const pe = /* @__PURE__ */ P({
|
|
|
109
109
|
default: () => ({})
|
|
110
110
|
}
|
|
111
111
|
},
|
|
112
|
-
setup(
|
|
113
|
-
expose:
|
|
112
|
+
setup(R, {
|
|
113
|
+
expose: B
|
|
114
114
|
}) {
|
|
115
|
-
var
|
|
116
|
-
const
|
|
115
|
+
var h;
|
|
116
|
+
const r = R, {
|
|
117
117
|
formInstance: t,
|
|
118
|
-
model:
|
|
119
|
-
} =
|
|
120
|
-
|
|
118
|
+
model: D
|
|
119
|
+
} = ee(), s = A(((h = o(D)) == null ? void 0 : h[r.name]) || []), F = O(), E = y.useWatch(r.name);
|
|
120
|
+
T(() => E.value, (e) => {
|
|
121
121
|
var l;
|
|
122
|
-
|
|
122
|
+
s.value = e, (l = r.onChange) == null || l.call(r, e);
|
|
123
123
|
});
|
|
124
124
|
const {
|
|
125
|
-
b:
|
|
126
|
-
em:
|
|
127
|
-
} =
|
|
128
|
-
function
|
|
129
|
-
var
|
|
130
|
-
const
|
|
131
|
-
|
|
125
|
+
b: c,
|
|
126
|
+
em: L
|
|
127
|
+
} = ae("editable-table"), v = oe("uiMode", "aplus"), N = te(r);
|
|
128
|
+
function S(e, l) {
|
|
129
|
+
var d, i;
|
|
130
|
+
const a = ((d = o(s)) == null ? void 0 : d.length) || 0;
|
|
131
|
+
if (f(r.maxLength) && a >= r.maxLength)
|
|
132
|
+
return;
|
|
133
|
+
const n = [...o(s) || []];
|
|
134
|
+
f(l) ? n.splice(l, 0, {
|
|
135
|
+
...e || {}
|
|
136
|
+
}) : n.push({
|
|
137
|
+
...e || {}
|
|
138
|
+
}), (i = t == null ? void 0 : t.setFieldValue) == null || i.call(t, r.name, [...o(s) || [], e || {}]);
|
|
132
139
|
}
|
|
133
|
-
function
|
|
134
|
-
var
|
|
135
|
-
const
|
|
136
|
-
|
|
140
|
+
function k(e, l = "suffix") {
|
|
141
|
+
var g, x;
|
|
142
|
+
const a = ((g = o(s)) == null ? void 0 : g.length) || 0, n = p(e) ? e : e.length;
|
|
143
|
+
if (f(r.maxLength) && a + n > r.maxLength)
|
|
144
|
+
return;
|
|
145
|
+
const d = [...o(s) || []], i = p(e) ? new Array(e).fill({}) : m(e);
|
|
146
|
+
l === "suffix" ? d.push(...i) : d.unshift(...i), (x = t == null ? void 0 : t.setFieldValue) == null || x.call(t, r.name, d);
|
|
137
147
|
}
|
|
138
|
-
function
|
|
139
|
-
|
|
148
|
+
function P(e) {
|
|
149
|
+
var n;
|
|
150
|
+
let l = m(o(s) || []);
|
|
151
|
+
const a = p(e) ? [e] : e;
|
|
152
|
+
l = l.filter((d, i) => !a.includes(i)), (n = t == null ? void 0 : t.setFieldValue) == null || n.call(t, r.name, l);
|
|
140
153
|
}
|
|
141
|
-
function
|
|
154
|
+
function _() {
|
|
155
|
+
return o(s);
|
|
156
|
+
}
|
|
157
|
+
function j(e) {
|
|
142
158
|
var l;
|
|
143
|
-
return (l = o(
|
|
159
|
+
return (l = o(s)) == null ? void 0 : l[e];
|
|
144
160
|
}
|
|
145
|
-
function
|
|
146
|
-
var
|
|
147
|
-
const
|
|
148
|
-
e
|
|
149
|
-
...e
|
|
161
|
+
function z(e, l) {
|
|
162
|
+
var n;
|
|
163
|
+
const a = m(o(s));
|
|
164
|
+
a[e] && (a[e] = {
|
|
165
|
+
...a[e],
|
|
150
166
|
...l
|
|
151
|
-
}, (
|
|
167
|
+
}, (n = t == null ? void 0 : t.setFieldValue) == null || n.call(t, r.name, [...a]));
|
|
152
168
|
}
|
|
153
|
-
return
|
|
154
|
-
add:
|
|
155
|
-
remove:
|
|
156
|
-
getRowData:
|
|
157
|
-
getRowsData:
|
|
158
|
-
setRowData:
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
169
|
+
return B({
|
|
170
|
+
add: S,
|
|
171
|
+
remove: P,
|
|
172
|
+
getRowData: j,
|
|
173
|
+
getRowsData: _,
|
|
174
|
+
setRowData: z,
|
|
175
|
+
addMultiple: k
|
|
176
|
+
}), (e, l) => (C(), K(o(y).FormItem, w(e.formItem, {
|
|
177
|
+
name: e.name,
|
|
178
|
+
label: e.label
|
|
162
179
|
}), {
|
|
163
|
-
default:
|
|
164
|
-
class: [o(
|
|
165
|
-
columns: o(
|
|
166
|
-
"data-source":
|
|
167
|
-
}),
|
|
168
|
-
headerCell:
|
|
169
|
-
column:
|
|
180
|
+
default: u(() => [M(o(Z), w(o(I)(r, ["name", "maxLength"]), {
|
|
181
|
+
class: [o(c)(), o(v) === "admin" ? o(c)("admin") : null],
|
|
182
|
+
columns: o(N),
|
|
183
|
+
"data-source": s.value
|
|
184
|
+
}), q({
|
|
185
|
+
headerCell: u(({
|
|
186
|
+
column: a
|
|
170
187
|
}) => {
|
|
171
|
-
var
|
|
172
|
-
return [(
|
|
188
|
+
var n, d, i;
|
|
189
|
+
return [(n = a == null ? void 0 : a.fieldProps) != null && n.required || (i = (d = a == null ? void 0 : a.fieldProps) == null ? void 0 : d.rules) != null && i.length ? (C(), G(H, {
|
|
173
190
|
key: 0
|
|
174
|
-
}, [
|
|
175
|
-
class:
|
|
176
|
-
}, "*", 2),
|
|
191
|
+
}, [b("span", {
|
|
192
|
+
class: W(o(L)("header-cell", "required"))
|
|
193
|
+
}, "*", 2), b("span", null, U(a.title), 1)], 64)) : $("", !0)];
|
|
177
194
|
}),
|
|
178
195
|
_: 2
|
|
179
|
-
}, [
|
|
180
|
-
name:
|
|
181
|
-
fn:
|
|
196
|
+
}, [J(F, (a, n) => ({
|
|
197
|
+
name: n,
|
|
198
|
+
fn: u((d) => [Q(e.$slots, n, X(Y(d || {})))])
|
|
182
199
|
}))]), 1040, ["class", "columns", "data-source"])]),
|
|
183
200
|
_: 3
|
|
184
201
|
}, 16, ["name", "label"]));
|
|
185
202
|
}
|
|
186
203
|
});
|
|
187
204
|
export {
|
|
188
|
-
|
|
205
|
+
he as default
|
|
189
206
|
};
|