@aplus-frontend/ui 7.7.2 → 7.7.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/index.mjs +62 -60
- package/es/src/ap-field/checkbox/index.vue.mjs +18 -8
- package/es/src/ap-field/number/index.vue.mjs +19 -19
- package/es/src/ap-field/radio/index.vue.mjs +24 -24
- package/es/src/ap-field/rate/index.vue.mjs +10 -10
- package/es/src/ap-field/select/index.vue.mjs +74 -71
- package/es/src/ap-field/slider/index.vue.d.ts +4 -2
- package/es/src/ap-field/slider/index.vue.mjs +12 -12
- package/es/src/ap-field/switch/index.vue.mjs +20 -20
- package/es/src/ap-field/text/index.vue2.mjs +23 -23
- package/es/src/ap-field/text/password.vue.mjs +9 -9
- package/es/src/ap-field/text-area/index.vue.mjs +24 -20
- package/es/src/ap-field/tree-select/index.vue.mjs +17 -17
- package/es/src/ap-form/ap-form.vue2.mjs +64 -64
- package/es/src/ap-form/drawer-form/index.vue.mjs +41 -41
- package/es/src/ap-form/item/index.vue.mjs +64 -64
- package/es/src/ap-form/items/number/index.vue.mjs +10 -10
- package/es/src/ap-form/items/radio/index.vue.mjs +3 -3
- package/es/src/ap-form/items/select/index.vue.mjs +5 -5
- package/es/src/ap-form/items/text/index.vue.d.ts +2 -2
- package/es/src/ap-form/items/text/index.vue2.mjs +6 -6
- package/es/src/ap-form/items/text/password.vue.mjs +7 -7
- package/es/src/ap-form/items/text-area/index.vue.mjs +5 -5
- package/es/src/ap-form/items/tree-select/index.vue.mjs +7 -7
- package/es/src/ap-form/search-form/index.vue.mjs +63 -63
- package/es/src/ap-form/style/item.mjs +17 -10
- package/es/src/ap-list/index.vue.mjs +6 -6
- package/es/src/ap-table/constants.d.ts +1 -1
- package/es/src/business/ap-descriptions/index.d.ts +1 -0
- package/es/src/business/ap-descriptions/index.mjs +4 -0
- package/es/src/business/ap-value-select-card/style/index.mjs +1 -1
- package/es/src/business/batch-input-group/index.vue.d.ts +1 -1
- package/es/src/editable-table/form-item.vue.mjs +64 -64
- package/es/src/editable-table/index.vue.mjs +66 -66
- package/es/src/editable-table/style/index.mjs +5 -5
- package/es/src/index.mjs +46 -44
- package/es/src/scroll-bar/index.vue.d.ts +7 -7
- package/es/src/scroll-bar/index.vue.mjs +21 -21
- package/es/src/scroll-bar/internal.vue.d.ts +4 -4
- package/es/src/scroll-bar/internal.vue.mjs +20 -20
- package/es/src/scroll-view/hooks/use-scroll-wrapper.d.ts +4 -4
- package/es/src/scroll-view/hooks/use-scroll-wrapper.mjs +13 -13
- package/es/src/scroll-view/index.vue.d.ts +25 -25
- package/es/src/version.d.ts +1 -1
- package/es/src/version.mjs +1 -1
- package/lib/index.js +1 -1
- package/lib/src/ap-field/checkbox/index.vue.js +1 -1
- package/lib/src/ap-field/number/index.vue.js +1 -1
- package/lib/src/ap-field/radio/index.vue.js +1 -1
- package/lib/src/ap-field/rate/index.vue.js +1 -1
- package/lib/src/ap-field/select/index.vue.js +1 -1
- package/lib/src/ap-field/slider/index.vue.d.ts +4 -2
- package/lib/src/ap-field/slider/index.vue.js +1 -1
- package/lib/src/ap-field/switch/index.vue.js +1 -1
- package/lib/src/ap-field/text/index.vue2.js +1 -1
- package/lib/src/ap-field/text/password.vue.js +1 -1
- package/lib/src/ap-field/text-area/index.vue.js +1 -1
- package/lib/src/ap-field/tree-select/index.vue.js +1 -1
- package/lib/src/ap-form/ap-form.vue2.js +1 -1
- package/lib/src/ap-form/drawer-form/index.vue.js +1 -1
- package/lib/src/ap-form/item/index.vue.js +1 -1
- package/lib/src/ap-form/items/number/index.vue.js +1 -1
- package/lib/src/ap-form/items/radio/index.vue.js +1 -1
- package/lib/src/ap-form/items/select/index.vue.js +1 -1
- package/lib/src/ap-form/items/text/index.vue.d.ts +2 -2
- package/lib/src/ap-form/items/text/index.vue2.js +1 -1
- package/lib/src/ap-form/items/text/password.vue.js +1 -1
- package/lib/src/ap-form/items/text-area/index.vue.js +1 -1
- package/lib/src/ap-form/items/tree-select/index.vue.js +1 -1
- package/lib/src/ap-form/search-form/index.vue.js +1 -1
- package/lib/src/ap-form/style/item.js +1 -1
- package/lib/src/ap-list/index.vue.js +1 -1
- package/lib/src/ap-table/constants.d.ts +1 -1
- package/lib/src/business/ap-descriptions/index.d.ts +1 -0
- package/lib/src/business/ap-descriptions/index.js +1 -1
- package/lib/src/business/ap-value-select-card/style/index.js +1 -1
- package/lib/src/business/batch-input-group/index.vue.d.ts +1 -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/style/index.js +1 -1
- package/lib/src/index.js +1 -1
- package/lib/src/scroll-bar/index.vue.d.ts +7 -7
- package/lib/src/scroll-bar/index.vue.js +1 -1
- package/lib/src/scroll-bar/internal.vue.d.ts +4 -4
- package/lib/src/scroll-bar/internal.vue.js +1 -1
- package/lib/src/scroll-view/hooks/use-scroll-wrapper.d.ts +4 -4
- package/lib/src/scroll-view/hooks/use-scroll-wrapper.js +1 -1
- package/lib/src/scroll-view/index.vue.d.ts +25 -25
- package/lib/src/version.d.ts +1 -1
- package/lib/src/version.js +1 -1
- package/package.json +3 -3
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { isVNode as
|
|
2
|
-
import { Col as
|
|
1
|
+
import { isVNode as ie, defineComponent as ce, useSlots as ue, ref as pe, shallowRef as w, computed as R, unref as a, watch as M, createVNode as o, Fragment as _, createBlock as x, openBlock as p, mergeProps as de, withCtx as I, resolveDynamicComponent as T, createElementBlock as fe, renderList as me, normalizeStyle as he } from "vue";
|
|
2
|
+
import { Col as b, Flex as k, Button as q, Row as ge } from "@aplus-frontend/antdv";
|
|
3
3
|
import "../ap-form.vue.mjs";
|
|
4
4
|
import "../item/index.vue2.mjs";
|
|
5
|
-
import { genRealChildren as
|
|
5
|
+
import { genRealChildren as H } from "../item-group/helper.mjs";
|
|
6
6
|
import "../../config-provider/index.mjs";
|
|
7
7
|
import { isArray as xe, isBoolean as ye, omit as ve } from "lodash-unified";
|
|
8
8
|
import "../../utils/index.mjs";
|
|
9
|
-
import { execFunc as
|
|
9
|
+
import { execFunc as G, diffFormItem as Se } from "./utils.mjs";
|
|
10
10
|
import "./components/popover-filter.vue.mjs";
|
|
11
11
|
import { useCountPerRow as Ce } from "./hooks/use-count-per-row.mjs";
|
|
12
12
|
import "./components/popover-sorter/index.vue.mjs";
|
|
@@ -14,18 +14,18 @@ import { useSorter as we } from "./hooks/use-sorter.mjs";
|
|
|
14
14
|
import { getTargetNode as Re } from "./hooks/use-collapse-input-count.mjs";
|
|
15
15
|
import { useDevWarning as _e } from "../../utils/warning.mjs";
|
|
16
16
|
import be from "../style/search-form.mjs";
|
|
17
|
-
import { floorWith as
|
|
17
|
+
import { floorWith as J } from "../../utils/format.mjs";
|
|
18
18
|
import { useNamespace as Fe } from "../../config-provider/hooks/use-namespace.mjs";
|
|
19
19
|
import { useLocale as Ae } from "../../config-provider/hooks/use-locale.mjs";
|
|
20
|
-
import { isDef as
|
|
21
|
-
import
|
|
20
|
+
import { isDef as K } from "../../utils/is.mjs";
|
|
21
|
+
import Q from "../item/index.vue.mjs";
|
|
22
22
|
import Ne from "./components/popover-filter.vue2.mjs";
|
|
23
23
|
import Be from "./components/popover-sorter/index.vue2.mjs";
|
|
24
24
|
import Ie from "../ap-form.vue2.mjs";
|
|
25
25
|
function Te(d) {
|
|
26
|
-
return typeof d == "function" || Object.prototype.toString.call(d) === "[object Object]" && !
|
|
26
|
+
return typeof d == "function" || Object.prototype.toString.call(d) === "[object Object]" && !ie(d);
|
|
27
27
|
}
|
|
28
|
-
const r = 100, nt = /* @__PURE__ */
|
|
28
|
+
const r = 100, nt = /* @__PURE__ */ ce({
|
|
29
29
|
name: "ApFormSearchForm",
|
|
30
30
|
__name: "index",
|
|
31
31
|
props: {
|
|
@@ -123,73 +123,73 @@ const r = 100, nt = /* @__PURE__ */ ue({
|
|
|
123
123
|
}
|
|
124
124
|
},
|
|
125
125
|
setup(d, {
|
|
126
|
-
expose:
|
|
126
|
+
expose: X
|
|
127
127
|
}) {
|
|
128
|
-
const y =
|
|
128
|
+
const y = ue(), t = d;
|
|
129
129
|
_e("SearchForm").deprecated(typeof t.resizeTarget < "u", "resizeTarget", "resize.target");
|
|
130
|
-
const
|
|
130
|
+
const Y = be("ap-form-search-form"), {
|
|
131
131
|
b: f
|
|
132
132
|
} = Fe("ap-form-search-form"), {
|
|
133
133
|
t: P
|
|
134
|
-
} = Ae(), v =
|
|
134
|
+
} = Ae(), v = pe(), E = w(), Z = Ce(t, E), W = w();
|
|
135
135
|
function z() {
|
|
136
136
|
const e = v.value?.getFieldsValueTransformed(!0);
|
|
137
|
-
|
|
137
|
+
G(t.onSubmit, e);
|
|
138
138
|
}
|
|
139
|
-
function
|
|
140
|
-
t.customReset || v.value?.resetFields?.(),
|
|
139
|
+
function ee() {
|
|
140
|
+
t.customReset || v.value?.resetFields?.(), G(t.onReset);
|
|
141
141
|
}
|
|
142
|
-
const
|
|
142
|
+
const te = (e) => K(e) ? (xe(e) ? e : [e]).join("") : Date.now();
|
|
143
143
|
let O = [];
|
|
144
|
-
const m =
|
|
145
|
-
items:
|
|
144
|
+
const m = w(H(y.default())), c = w(y.extra?.()), L = R(() => J(r / a(Z), 4)), {
|
|
145
|
+
items: F,
|
|
146
146
|
sorted: $,
|
|
147
|
-
handleClickConfirm:
|
|
147
|
+
handleClickConfirm: A
|
|
148
148
|
} = we(m);
|
|
149
|
-
|
|
150
|
-
O = m.value, m.value = Se(O,
|
|
151
|
-
}),
|
|
149
|
+
M(() => y.default(), (e) => {
|
|
150
|
+
O = m.value, m.value = Se(O, H(e)), $.value = !1;
|
|
151
|
+
}), M(() => y.extra?.(), (e) => {
|
|
152
152
|
c.value = e;
|
|
153
153
|
});
|
|
154
|
-
function
|
|
155
|
-
return
|
|
154
|
+
function oe(e) {
|
|
155
|
+
return J(e * (r / 24), 4);
|
|
156
156
|
}
|
|
157
|
-
const n =
|
|
157
|
+
const n = R(() => {
|
|
158
158
|
const e = m.value, u = [], l = [], g = [], s = a(L);
|
|
159
|
-
let S = 0,
|
|
160
|
-
const
|
|
161
|
-
e.forEach((
|
|
162
|
-
const D = Re(
|
|
159
|
+
let S = 0, N = 0;
|
|
160
|
+
const le = r * t.maxRows - s * (a(c) && !t.extraInAction ? 2 : 1);
|
|
161
|
+
e.forEach((B) => {
|
|
162
|
+
const D = Re(B);
|
|
163
163
|
if (!D)
|
|
164
164
|
return;
|
|
165
165
|
const i = D.props;
|
|
166
|
-
if (ye(i.hidden) ? !!i.hidden :
|
|
167
|
-
u.push(
|
|
166
|
+
if (ye(i.hidden) ? !!i.hidden : K(i.hidden))
|
|
167
|
+
u.push(B);
|
|
168
168
|
else {
|
|
169
|
-
let C = i.span ?
|
|
169
|
+
let C = i.span ? oe(i.span) : s;
|
|
170
170
|
const V = {
|
|
171
|
-
node:
|
|
171
|
+
node: B,
|
|
172
172
|
span: C,
|
|
173
|
-
key: `ApFormSearchFormItem-${
|
|
173
|
+
key: `ApFormSearchFormItem-${te(i.name)}-${i._signal}`
|
|
174
174
|
}, U = r - S % r;
|
|
175
|
-
U < C && (C += U), S += C, S >
|
|
175
|
+
U < C && (C += U), S += C, S > le ? l.push(V) : (N = S, g.push(V));
|
|
176
176
|
}
|
|
177
177
|
});
|
|
178
|
-
const j = r - (
|
|
178
|
+
const j = r - (N + s) % r, re = Math.ceil(N) % r < s, se = j < s ? r : j;
|
|
179
179
|
return {
|
|
180
|
-
hideNode: o(
|
|
180
|
+
hideNode: o(_, null, [u]),
|
|
181
181
|
nodes: g,
|
|
182
182
|
collapseNodes: l,
|
|
183
|
-
extraSpan:
|
|
184
|
-
lastRowOnlyIncludeActionAndExtra:
|
|
183
|
+
extraSpan: se,
|
|
184
|
+
lastRowOnlyIncludeActionAndExtra: re
|
|
185
185
|
};
|
|
186
|
-
}), h = (e) => `${e}%`,
|
|
186
|
+
}), h = (e) => `${e}%`, ae = R(() => {
|
|
187
187
|
let e;
|
|
188
|
-
const u = n.value.collapseNodes.length || t.sortable && m.value.length, l = o(
|
|
188
|
+
const u = n.value.collapseNodes.length || t.sortable && m.value.length, l = o(b, {
|
|
189
189
|
flex: h(a(L)),
|
|
190
190
|
key: "actionWrapper"
|
|
191
191
|
}, {
|
|
192
|
-
default: () => [o(
|
|
192
|
+
default: () => [o(Q, null, {
|
|
193
193
|
default: () => [o(k, {
|
|
194
194
|
wrap: "wrap",
|
|
195
195
|
justify: n.value.lastRowOnlyIncludeActionAndExtra && !(a(c) && t.extraInAction) ? "flex-end" : "space-between"
|
|
@@ -204,12 +204,12 @@ const r = 100, nt = /* @__PURE__ */ ue({
|
|
|
204
204
|
onSubmit: z,
|
|
205
205
|
config: n.value.collapseNodes,
|
|
206
206
|
submitLoading: t.submitLoading
|
|
207
|
-
}, null) : null, t.sortable &&
|
|
207
|
+
}, null) : null, t.sortable && F.value.length ? o(Be, {
|
|
208
208
|
ref: W,
|
|
209
|
-
items:
|
|
210
|
-
onClickConfirm:
|
|
209
|
+
items: F.value,
|
|
210
|
+
onClickConfirm: A,
|
|
211
211
|
sorted: $.value
|
|
212
|
-
}, null) : null]) : null, o(
|
|
212
|
+
}, null) : null]) : null, o(q, {
|
|
213
213
|
type: "primary",
|
|
214
214
|
onClick: z,
|
|
215
215
|
loading: t.submitLoading ? {
|
|
@@ -219,8 +219,8 @@ const r = 100, nt = /* @__PURE__ */ ue({
|
|
|
219
219
|
class: f("action-btn")
|
|
220
220
|
}, {
|
|
221
221
|
default: () => [t.searchText || P("ap.apForm.search.search")]
|
|
222
|
-
}), o(
|
|
223
|
-
onClick:
|
|
222
|
+
}), o(q, {
|
|
223
|
+
onClick: ee,
|
|
224
224
|
type: "text",
|
|
225
225
|
class: [f("action-btn"), f("action-btn-reset")]
|
|
226
226
|
}, {
|
|
@@ -229,42 +229,42 @@ const r = 100, nt = /* @__PURE__ */ ue({
|
|
|
229
229
|
}), t.extraInAction ? a(c) : null]
|
|
230
230
|
})]
|
|
231
231
|
})]
|
|
232
|
-
}), g = !t.extraInAction && a(c) ? o(
|
|
232
|
+
}), g = !t.extraInAction && a(c) ? o(b, {
|
|
233
233
|
flex: h(n.value.extraSpan),
|
|
234
234
|
key: "extraNode"
|
|
235
235
|
}, {
|
|
236
|
-
default: () => [o(
|
|
236
|
+
default: () => [o(Q, null, {
|
|
237
237
|
default: () => [o(k, {
|
|
238
238
|
justify: n.value.extraSpan === r || n.value.lastRowOnlyIncludeActionAndExtra ? "start" : "flex-end"
|
|
239
239
|
}, Te(e = a(c)) ? e : {
|
|
240
240
|
default: () => [e]
|
|
241
241
|
})]
|
|
242
242
|
})]
|
|
243
|
-
}) : null, s = o(
|
|
243
|
+
}) : null, s = o(b, {
|
|
244
244
|
flex: h(n.value.extraSpan)
|
|
245
245
|
}, null);
|
|
246
|
-
return n.value.lastRowOnlyIncludeActionAndExtra ? o(
|
|
246
|
+
return n.value.lastRowOnlyIncludeActionAndExtra ? o(_, null, [g || s, l]) : o(_, null, [l, g]);
|
|
247
247
|
});
|
|
248
|
-
function
|
|
248
|
+
function ne() {
|
|
249
249
|
const e = W.value?.getCachedList();
|
|
250
|
-
|
|
250
|
+
A(e);
|
|
251
251
|
}
|
|
252
|
-
return
|
|
253
|
-
apForm:
|
|
254
|
-
getSorterItems: () =>
|
|
255
|
-
setSorterItems:
|
|
256
|
-
resetSorterItems:
|
|
252
|
+
return X({
|
|
253
|
+
apForm: R(() => a(v)),
|
|
254
|
+
getSorterItems: () => F.value,
|
|
255
|
+
setSorterItems: A,
|
|
256
|
+
resetSorterItems: ne
|
|
257
257
|
}), (e, u) => (p(), x(Ie, de({
|
|
258
258
|
ref_key: "apForm",
|
|
259
259
|
ref: v,
|
|
260
|
-
class: [a(f)(), a(
|
|
260
|
+
class: [a(f)(), a(Y)]
|
|
261
261
|
}, a(ve)(t, ["collapse", "defaultCollapse", "onUpdate:collapse", "searchText", "resetText", "onSubmit", "onReset", "extraInAction", "forceExpand", "countPerRow"])), {
|
|
262
262
|
default: I(() => [(p(), x(T(n.value.hideNode))), o(a(ge), {
|
|
263
263
|
ref_key: "contentWrapperRef",
|
|
264
264
|
ref: E,
|
|
265
265
|
gutter: 8
|
|
266
266
|
}, {
|
|
267
|
-
default: I(() => [(p(!0), fe(
|
|
267
|
+
default: I(() => [(p(!0), fe(_, null, me(n.value.nodes, (l) => (p(), x(a(b), {
|
|
268
268
|
key: l.key,
|
|
269
269
|
flex: h(l.span),
|
|
270
270
|
style: he({
|
|
@@ -273,7 +273,7 @@ const r = 100, nt = /* @__PURE__ */ ue({
|
|
|
273
273
|
}, {
|
|
274
274
|
default: I(() => [(p(), x(T(l.node)))]),
|
|
275
275
|
_: 2
|
|
276
|
-
}, 1032, ["flex", "style"]))), 128)), (p(), x(T(
|
|
276
|
+
}, 1032, ["flex", "style"]))), 128)), (p(), x(T(ae.value)))]),
|
|
277
277
|
_: 1
|
|
278
278
|
}, 512)]),
|
|
279
279
|
_: 1
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { genComponentStyleHook as
|
|
2
|
-
const
|
|
3
|
-
const { componentCls:
|
|
1
|
+
import { genComponentStyleHook as i } from "../../utils/cssinjs/index.mjs";
|
|
2
|
+
const r = (n) => {
|
|
3
|
+
const { componentCls: a, namespace: t } = n, e = `${a}--disabled`;
|
|
4
4
|
return {
|
|
5
|
-
[
|
|
5
|
+
[a]: {
|
|
6
6
|
// bordered
|
|
7
7
|
"&--bordered": {
|
|
8
8
|
boxSizing: "border-box",
|
|
@@ -12,7 +12,7 @@ const i = (n) => {
|
|
|
12
12
|
".ant-input-affix-wrapper": {
|
|
13
13
|
padding: 0
|
|
14
14
|
},
|
|
15
|
-
[`&:has(.${
|
|
15
|
+
[`&:has(.${t}-batch-input-group):has(.ant-select)`]: {
|
|
16
16
|
".ant-input-affix-wrapper": {
|
|
17
17
|
paddingInlineEnd: n.space
|
|
18
18
|
}
|
|
@@ -23,6 +23,12 @@ const i = (n) => {
|
|
|
23
23
|
paddingInlineStart: 0
|
|
24
24
|
}
|
|
25
25
|
},
|
|
26
|
+
[`&:has(div.${t}-batch-input-group .ant-input)`]: {
|
|
27
|
+
paddingInlineEnd: n.space,
|
|
28
|
+
".ant-input": {
|
|
29
|
+
paddingInlineStart: 0
|
|
30
|
+
}
|
|
31
|
+
},
|
|
26
32
|
".ant-picker": {
|
|
27
33
|
padding: 0
|
|
28
34
|
},
|
|
@@ -77,19 +83,20 @@ const i = (n) => {
|
|
|
77
83
|
height: "unset"
|
|
78
84
|
}
|
|
79
85
|
},
|
|
80
|
-
|
|
86
|
+
[`&:hover:not(${e})`]: {
|
|
81
87
|
borderColor: n.hoverColorBase
|
|
82
88
|
},
|
|
83
89
|
"&:focus": {
|
|
84
90
|
borderColor: n.activeColorBase,
|
|
85
91
|
boxShadow: "0 0 0 2px rgba(5, 155, 255, 0.1)"
|
|
86
92
|
},
|
|
87
|
-
[`.${
|
|
93
|
+
[`.${t}-batch-input-group-popover-input__popover`]: {
|
|
88
94
|
width: "calc(100% + 12px)"
|
|
89
95
|
}
|
|
90
96
|
},
|
|
91
97
|
// disabled
|
|
92
98
|
"&--disabled": {
|
|
99
|
+
cursor: "not-allowed",
|
|
93
100
|
backgroundColor: n.colorBgDisabled,
|
|
94
101
|
".ant-select-selector": {
|
|
95
102
|
backgroundColor: "transparent !important"
|
|
@@ -125,8 +132,8 @@ const i = (n) => {
|
|
|
125
132
|
}
|
|
126
133
|
}
|
|
127
134
|
};
|
|
128
|
-
},
|
|
135
|
+
}, p = i("ApForm", (n) => [r(n)]);
|
|
129
136
|
export {
|
|
130
|
-
|
|
131
|
-
|
|
137
|
+
p as default,
|
|
138
|
+
r as genApFormItemStyle
|
|
132
139
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as Z,
|
|
1
|
+
import { defineComponent as Z, shallowRef as _, toRef as x, unref as e, computed as p, watch as ee, createElementBlock as s, openBlock as o, normalizeStyle as h, normalizeClass as i, renderSlot as u, createElementVNode as te, createCommentVNode as P, createVNode as g, Fragment as z, createBlock as C, withCtx as b, renderList as ae, mergeProps as ne } from "vue";
|
|
2
2
|
import { Empty as F, Spin as re, Pagination as oe } from "@aplus-frontend/antdv";
|
|
3
3
|
import { useTablePaging as ie } from "../ap-table/hooks/use-table-paging-ng.mjs";
|
|
4
4
|
import "../config-provider/index.mjs";
|
|
@@ -29,8 +29,8 @@ const De = /* @__PURE__ */ Z({
|
|
|
29
29
|
rowKey: {},
|
|
30
30
|
adaptive: { type: Boolean, default: !1 }
|
|
31
31
|
},
|
|
32
|
-
setup(E, { expose:
|
|
33
|
-
const
|
|
32
|
+
setup(E, { expose: R }) {
|
|
33
|
+
const L = F.PRESENTED_IMAGE_SIMPLE, a = E, { b: d, e: y, bm: O, m: N } = pe("ap-list"), T = fe("ap-list"), k = _(), {
|
|
34
34
|
formRef: S,
|
|
35
35
|
submit: I,
|
|
36
36
|
reset: w,
|
|
@@ -88,7 +88,7 @@ const De = /* @__PURE__ */ Z({
|
|
|
88
88
|
function X(t) {
|
|
89
89
|
S.value?.apForm?.setFieldsValue?.(t);
|
|
90
90
|
}
|
|
91
|
-
return
|
|
91
|
+
return R({
|
|
92
92
|
submit: () => I(),
|
|
93
93
|
reset: () => w(),
|
|
94
94
|
refresh: () => A(),
|
|
@@ -110,7 +110,7 @@ const De = /* @__PURE__ */ Z({
|
|
|
110
110
|
te("div", {
|
|
111
111
|
class: i([
|
|
112
112
|
e(d)("content-container"),
|
|
113
|
-
{ [e(
|
|
113
|
+
{ [e(O)("content-container", "spinning")]: c.value }
|
|
114
114
|
])
|
|
115
115
|
}, [
|
|
116
116
|
c.value ? (o(), s("div", {
|
|
@@ -123,7 +123,7 @@ const De = /* @__PURE__ */ Z({
|
|
|
123
123
|
key: 1,
|
|
124
124
|
loading: c.value
|
|
125
125
|
}, () => [
|
|
126
|
-
g(e(F), { image: e(
|
|
126
|
+
g(e(F), { image: e(L) }, null, 8, ["image"])
|
|
127
127
|
]) : (o(), s("div", {
|
|
128
128
|
key: 2,
|
|
129
129
|
ref_key: "contentRef",
|
|
@@ -1773,7 +1773,7 @@ export declare const apTableFormItemMap: {
|
|
|
1773
1773
|
allowClear: boolean;
|
|
1774
1774
|
}> & Omit<Readonly< ApFieldTextProps> & Readonly<{
|
|
1775
1775
|
"onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
|
1776
|
-
}>, "blur" | "focus" | "input" | "select" | ("type" | "mode" | "disabled" | "bordered" | "emptyText" | "lazy" | "allowClear")
|
|
1776
|
+
}>, "blur" | "focus" | "input" | "select" | "setSelectionRange" | ("type" | "mode" | "disabled" | "bordered" | "emptyText" | "lazy" | "allowClear")> & ShallowUnwrapRef<{
|
|
1777
1777
|
focus: (options?: InputFocusOptions) => void;
|
|
1778
1778
|
blur: () => void;
|
|
1779
1779
|
input: any;
|
|
@@ -74,7 +74,7 @@ const l = (r) => {
|
|
|
74
74
|
border: `${r.lineWidth} ${r.lineType} ${r.borderColorBase}`
|
|
75
75
|
},
|
|
76
76
|
"&.select": {
|
|
77
|
-
backgroundColor: r.
|
|
77
|
+
backgroundColor: r.calc(r.colorPrimary).colorMix(5, "#fff"),
|
|
78
78
|
borderColor: r.colorPrimary,
|
|
79
79
|
cursor: "pointer"
|
|
80
80
|
}
|
|
@@ -139,7 +139,7 @@ declare const _default: DefineComponent<BatchInputGroupProps, {}, {}, {}, {}, Co
|
|
|
139
139
|
allowClear: boolean;
|
|
140
140
|
}> & Omit<Readonly< ApFieldTextProps> & Readonly<{
|
|
141
141
|
"onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
|
142
|
-
}>, "blur" | "focus" | "input" | "select" | ("type" | "mode" | "disabled" | "bordered" | "emptyText" | "lazy" | "allowClear")
|
|
142
|
+
}>, "blur" | "focus" | "input" | "select" | "setSelectionRange" | ("type" | "mode" | "disabled" | "bordered" | "emptyText" | "lazy" | "allowClear")> & ShallowUnwrapRef<{
|
|
143
143
|
focus: (options?: InputFocusOptions) => void;
|
|
144
144
|
blur: () => void;
|
|
145
145
|
input: any;
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { Table as
|
|
3
|
-
import { ApForm as
|
|
4
|
-
import { isUndefined as
|
|
1
|
+
import { defineComponent as z, ref as A, unref as s, useSlots as K, toRef as O, watch as G, nextTick as W, shallowRef as H, createBlock as U, openBlock as $, mergeProps as p, withCtx as c, createVNode as q, createSlots as J, renderList as Q, renderSlot as X, normalizeProps as Y, guardReactiveProps as Z } from "vue";
|
|
2
|
+
import { Table as M } from "@aplus-frontend/antdv";
|
|
3
|
+
import { ApForm as h } from "../ap-form/index.mjs";
|
|
4
|
+
import { isUndefined as ee, isNumber as d, cloneDeep as te, isArray as ae, omit as b } from "lodash-unified";
|
|
5
5
|
import "../config-provider/index.mjs";
|
|
6
|
-
import { useInjectForm as
|
|
6
|
+
import { useInjectForm as oe } from "../ap-form/context.mjs";
|
|
7
7
|
import "../utils/index.mjs";
|
|
8
|
-
import
|
|
9
|
-
import { scrollToRowIndex as
|
|
10
|
-
import { getModelValue as
|
|
11
|
-
import { useDevWarning as
|
|
12
|
-
import
|
|
13
|
-
import { useNamespace as
|
|
14
|
-
import { useGlobalConfig as
|
|
15
|
-
import { isDef as
|
|
16
|
-
const
|
|
8
|
+
import ne from "./hooks/use-get-columns.mjs";
|
|
9
|
+
import { scrollToRowIndex as le } from "./utils.mjs";
|
|
10
|
+
import { getModelValue as se } from "../ap-form/utils/get.mjs";
|
|
11
|
+
import { useDevWarning as re } from "../utils/warning.mjs";
|
|
12
|
+
import ie from "./style/index.mjs";
|
|
13
|
+
import { useNamespace as ue } from "../config-provider/hooks/use-namespace.mjs";
|
|
14
|
+
import { useGlobalConfig as fe } from "../config-provider/hooks/use-global-config.mjs";
|
|
15
|
+
import { isDef as g } from "../utils/is.mjs";
|
|
16
|
+
const ve = /* @__PURE__ */ z({
|
|
17
17
|
name: "EditableTableFormItem",
|
|
18
18
|
__name: "form-item",
|
|
19
19
|
props: {
|
|
@@ -114,26 +114,26 @@ const Te = /* @__PURE__ */ A({
|
|
|
114
114
|
default: () => ({})
|
|
115
115
|
}
|
|
116
116
|
},
|
|
117
|
-
setup(
|
|
118
|
-
expose:
|
|
117
|
+
setup(w, {
|
|
118
|
+
expose: x
|
|
119
119
|
}) {
|
|
120
|
-
const o =
|
|
121
|
-
|
|
120
|
+
const o = w;
|
|
121
|
+
re("EditableTableFormItem")(!1, "breaking", "EditableTableFormItem has been EOL, Please use EditableAgGridFormItem(https://aplus.aplnk.com/aplus-ui/components/ag-grid/editable/) instead.");
|
|
122
122
|
const {
|
|
123
123
|
internalInstance: i,
|
|
124
|
-
model:
|
|
125
|
-
} =
|
|
126
|
-
G(() =>
|
|
124
|
+
model: y
|
|
125
|
+
} = oe(), u = A(se(s(y), o.name) || []), C = K(), R = O(o, "name"), F = h.useWatch(R);
|
|
126
|
+
G(() => F.value, async (e) => {
|
|
127
127
|
await W(), u.value = e, o.onChange?.(e);
|
|
128
128
|
}, {
|
|
129
129
|
deep: !0
|
|
130
130
|
});
|
|
131
131
|
const {
|
|
132
|
-
b:
|
|
133
|
-
} =
|
|
134
|
-
function
|
|
132
|
+
b: B
|
|
133
|
+
} = ue("editable-table"), I = ie("editable-table"), m = H(), T = fe("valueTypeMap"), v = ne(o, T);
|
|
134
|
+
function D(e, n) {
|
|
135
135
|
const l = s(u)?.length || 0;
|
|
136
|
-
if (
|
|
136
|
+
if (g(o.maxLength) && l >= o.maxLength)
|
|
137
137
|
return;
|
|
138
138
|
const t = {
|
|
139
139
|
...e || {}
|
|
@@ -143,41 +143,41 @@ const Te = /* @__PURE__ */ A({
|
|
|
143
143
|
a[r] = [t];
|
|
144
144
|
return;
|
|
145
145
|
}
|
|
146
|
-
|
|
146
|
+
ee(n) ? a[r].push(t) : a[r].splice(n, 0, t);
|
|
147
147
|
});
|
|
148
148
|
}
|
|
149
|
-
function
|
|
150
|
-
const l = s(u)?.length || 0, t =
|
|
151
|
-
if (
|
|
149
|
+
function E(e, n = "suffix") {
|
|
150
|
+
const l = s(u)?.length || 0, t = d(e) ? e : e.length;
|
|
151
|
+
if (g(o.maxLength) && l + t > o.maxLength)
|
|
152
152
|
return;
|
|
153
|
-
const a =
|
|
154
|
-
i?.setFieldValue(o.name, a, !0, (r,
|
|
155
|
-
if (!r[
|
|
156
|
-
r[
|
|
153
|
+
const a = d(e) ? new Array(e).fill(0).map(() => ({})) : te(e);
|
|
154
|
+
i?.setFieldValue(o.name, a, !0, (r, f) => {
|
|
155
|
+
if (!r[f]) {
|
|
156
|
+
r[f] = [...a];
|
|
157
157
|
return;
|
|
158
158
|
}
|
|
159
|
-
n === "suffix" ? r[
|
|
159
|
+
n === "suffix" ? r[f].push(...a) : r[f].unshift(...a);
|
|
160
160
|
});
|
|
161
161
|
}
|
|
162
|
-
function
|
|
163
|
-
const n = new Set(
|
|
162
|
+
function S(e) {
|
|
163
|
+
const n = new Set(d(e) ? [e] : e);
|
|
164
164
|
i?.setFieldValue(o.name, void 0, !0, (l, t) => {
|
|
165
165
|
l[t] = l[t].filter((a, r) => !n.has(r));
|
|
166
166
|
});
|
|
167
167
|
}
|
|
168
|
-
function
|
|
169
|
-
const n = new Set(
|
|
168
|
+
function L(e) {
|
|
169
|
+
const n = new Set(ae(e) ? e : [e]);
|
|
170
170
|
n.size !== 0 && i?.setFieldValue?.(o.name, void 0, !0, (l, t) => {
|
|
171
171
|
l[t] = l[t].filter((a) => !n.has(a[o.rowKey]));
|
|
172
172
|
});
|
|
173
173
|
}
|
|
174
|
-
function
|
|
174
|
+
function V() {
|
|
175
175
|
return s(u);
|
|
176
176
|
}
|
|
177
|
-
function
|
|
177
|
+
function k(e) {
|
|
178
178
|
return s(u)?.[e];
|
|
179
179
|
}
|
|
180
|
-
function
|
|
180
|
+
function N(e, n, l = !0) {
|
|
181
181
|
i?.setFieldValue(o.name, void 0, !0, (t, a) => {
|
|
182
182
|
!t[a] || !t[a][e] || (t[a][e] = {
|
|
183
183
|
...l ? t[a][e] : {},
|
|
@@ -185,47 +185,47 @@ const Te = /* @__PURE__ */ A({
|
|
|
185
185
|
});
|
|
186
186
|
});
|
|
187
187
|
}
|
|
188
|
-
function
|
|
188
|
+
function _(e) {
|
|
189
189
|
i?.setFieldValue(o.name, e);
|
|
190
190
|
}
|
|
191
|
-
function
|
|
191
|
+
function P(e, n) {
|
|
192
192
|
const l = e === "end" ? u.value.length - 1 : e;
|
|
193
|
-
|
|
193
|
+
le(l, m.value?.$el, n);
|
|
194
194
|
}
|
|
195
|
-
function
|
|
195
|
+
function j() {
|
|
196
196
|
i?.setFieldValue?.(o.name, []);
|
|
197
197
|
}
|
|
198
|
-
return
|
|
199
|
-
add:
|
|
200
|
-
remove:
|
|
201
|
-
getRowData:
|
|
202
|
-
getRowsData:
|
|
203
|
-
setRowData:
|
|
204
|
-
addMultiple:
|
|
205
|
-
scrollTo:
|
|
206
|
-
setTableData:
|
|
207
|
-
clear:
|
|
208
|
-
removeByKey:
|
|
209
|
-
}), (e, n) => (
|
|
198
|
+
return x({
|
|
199
|
+
add: D,
|
|
200
|
+
remove: S,
|
|
201
|
+
getRowData: k,
|
|
202
|
+
getRowsData: V,
|
|
203
|
+
setRowData: N,
|
|
204
|
+
addMultiple: E,
|
|
205
|
+
scrollTo: P,
|
|
206
|
+
setTableData: _,
|
|
207
|
+
clear: j,
|
|
208
|
+
removeByKey: L
|
|
209
|
+
}), (e, n) => ($(), U(s(h).FormItem, p(e.formItem, {
|
|
210
210
|
name: e.name,
|
|
211
211
|
label: e.label
|
|
212
212
|
}), {
|
|
213
|
-
default:
|
|
213
|
+
default: c(() => [q(s(M), p(s(b)(o, ["name", "maxLength", "onChange"]), {
|
|
214
214
|
ref_key: "tableRef",
|
|
215
215
|
ref: m,
|
|
216
|
-
class: [s(
|
|
217
|
-
columns: s(
|
|
216
|
+
class: [s(B)(), s(I)],
|
|
217
|
+
columns: s(v),
|
|
218
218
|
"data-source": u.value
|
|
219
|
-
}),
|
|
219
|
+
}), J({
|
|
220
220
|
_: 2
|
|
221
|
-
}, [
|
|
221
|
+
}, [Q(s(b)(C, ["headerCell"]), (l, t) => ({
|
|
222
222
|
name: t,
|
|
223
|
-
fn:
|
|
223
|
+
fn: c((a) => [X(e.$slots, t, Y(Z(a || {})))])
|
|
224
224
|
}))]), 1040, ["class", "columns", "data-source"])]),
|
|
225
225
|
_: 3
|
|
226
226
|
}, 16, ["name", "label"]));
|
|
227
227
|
}
|
|
228
228
|
});
|
|
229
229
|
export {
|
|
230
|
-
|
|
230
|
+
ve as default
|
|
231
231
|
};
|