@aplus-frontend/ui 0.6.6 → 0.6.8
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 +28 -26
- package/es/src/ap-form/interface.d.ts +4 -0
- package/es/src/ap-form/list/index.vue.d.ts +2 -1
- package/es/src/ap-form/list/index.vue.mjs +31 -27
- package/es/src/ap-form/search-form/index.vue.d.ts +1 -0
- package/es/src/ap-form/search-form/index.vue.mjs +53 -48
- package/es/src/ap-grid/editable/form-item.vue.mjs +25 -24
- package/es/src/ap-grid/editable/index.vue.mjs +1 -0
- package/es/src/ap-grid/index.d.ts +1 -0
- package/es/src/ap-grid/index.mjs +4 -2
- package/es/src/ap-grid/index.vue.mjs +2 -1
- package/es/src/ap-grid/interface.d.ts +12 -0
- package/es/src/ap-grid/utils/col.mjs +44 -44
- package/es/src/ap-grid/utils/renderer.mjs +9 -9
- package/es/src/ap-grid/utils/table.mjs +15 -9
- package/es/src/ap-grid/utils/to-tree-array.d.ts +13 -0
- package/es/src/ap-grid/utils/to-tree-array.mjs +19 -0
- package/es/src/business/ap-copy/ApCopy.mjs +27 -25
- package/es/src/business/ap-label/ApLabel.d.ts +4 -3
- package/es/src/business/ap-label/ApLabel.mjs +18 -17
- package/es/src/business/ap-label/constans.d.ts +2 -2
- package/es/src/business/ap-label/constans.mjs +1 -1
- package/es/src/business/ap-label/index.d.ts +7 -7
- package/es/src/business/ap-label/interface.d.ts +1 -1
- package/es/src/business/ap-product-info/ApProductInfo.d.ts +3 -3
- package/es/src/business/ap-product-info/ApProductInfo.mjs +55 -40
- package/es/src/business/ap-product-info/interface.d.ts +2 -0
- package/es/src/business/ap-radio-group/ap-radio-group.vue.d.ts +1 -1
- package/es/src/business/ap-radio-group/index.d.ts +3 -3
- package/es/src/business/ap-summary/interface.d.ts +1 -1
- package/es/src/business/hooks/useKeepAliveFlag.d.ts +14 -0
- package/es/src/business/hooks/useKeepAliveFlag.mjs +18 -0
- package/es/src/business/hooks/usePageListApGrid.d.ts +4 -0
- package/es/src/business/hooks/usePageListApGrid.mjs +42 -31
- package/es/src/index.mjs +24 -22
- 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-form/interface.d.ts +4 -0
- package/lib/src/ap-form/list/index.vue.d.ts +2 -1
- package/lib/src/ap-form/list/index.vue.js +1 -1
- package/lib/src/ap-form/search-form/index.vue.d.ts +1 -0
- package/lib/src/ap-form/search-form/index.vue.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.d.ts +1 -0
- package/lib/src/ap-grid/index.js +1 -1
- package/lib/src/ap-grid/index.vue.js +1 -1
- package/lib/src/ap-grid/interface.d.ts +12 -0
- package/lib/src/ap-grid/utils/col.js +1 -1
- package/lib/src/ap-grid/utils/renderer.js +1 -1
- package/lib/src/ap-grid/utils/table.js +1 -1
- package/lib/src/ap-grid/utils/to-tree-array.d.ts +13 -0
- package/lib/src/ap-grid/utils/to-tree-array.js +1 -0
- package/lib/src/business/ap-copy/ApCopy.js +1 -1
- package/lib/src/business/ap-label/ApLabel.d.ts +4 -3
- package/lib/src/business/ap-label/ApLabel.js +1 -1
- package/lib/src/business/ap-label/constans.d.ts +2 -2
- package/lib/src/business/ap-label/constans.js +1 -1
- package/lib/src/business/ap-label/index.d.ts +7 -7
- package/lib/src/business/ap-label/interface.d.ts +1 -1
- package/lib/src/business/ap-product-info/ApProductInfo.d.ts +3 -3
- package/lib/src/business/ap-product-info/ApProductInfo.js +1 -1
- package/lib/src/business/ap-product-info/interface.d.ts +2 -0
- package/lib/src/business/ap-radio-group/ap-radio-group.vue.d.ts +1 -1
- package/lib/src/business/ap-radio-group/index.d.ts +3 -3
- package/lib/src/business/ap-summary/interface.d.ts +1 -1
- package/lib/src/business/hooks/useKeepAliveFlag.d.ts +14 -0
- package/lib/src/business/hooks/useKeepAliveFlag.js +1 -0
- package/lib/src/business/hooks/usePageListApGrid.d.ts +4 -0
- package/lib/src/business/hooks/usePageListApGrid.js +1 -1
- package/lib/src/index.js +1 -1
- package/lib/src/version.d.ts +1 -1
- package/lib/src/version.js +1 -1
- package/package.json +3 -3
- package/theme/ap-grid/index.css +12 -0
- package/theme/ap-grid/index.less +16 -0
- package/theme/ap-label/ap-label.css +4 -0
- package/theme/ap-label/ap-label.less +5 -1
- package/theme/ap-product-info/ap-product-info.less +0 -1
- package/theme/font/aplusuiiconfont.otf +0 -0
- package/theme/font/font.css +5 -0
- package/theme/font/font.less +6 -0
- package/theme/index.css +21 -0
- package/theme/index.less +1 -0
package/es/index.mjs
CHANGED
|
@@ -128,19 +128,20 @@ import { default as dp } from "./src/portal/index.vue.mjs";
|
|
|
128
128
|
import { default as up } from "./src/full-screen/index.vue.mjs";
|
|
129
129
|
import { default as ip } from "./src/resize-observer/index.vue.mjs";
|
|
130
130
|
import { ROW_SELECTION_FIELD as cp } from "./src/ap-grid/constants.mjs";
|
|
131
|
-
import {
|
|
132
|
-
import { default as Sp } from "./src/ap-grid/
|
|
133
|
-
import { default as Cp } from "./src/ap-grid/editable/
|
|
134
|
-
import { default as Dp } from "./src/
|
|
135
|
-
import { default as Gp } from "./src/text/
|
|
136
|
-
import { default as Ep } from "./src/
|
|
137
|
-
import {
|
|
138
|
-
import {
|
|
139
|
-
import {
|
|
140
|
-
import {
|
|
141
|
-
import {
|
|
142
|
-
import {
|
|
143
|
-
import {
|
|
131
|
+
import { toTreeArray as Ip } from "./src/ap-grid/utils/to-tree-array.mjs";
|
|
132
|
+
import { default as Sp } from "./src/ap-grid/index.vue.mjs";
|
|
133
|
+
import { default as Cp } from "./src/ap-grid/editable/index.vue.mjs";
|
|
134
|
+
import { default as Dp } from "./src/ap-grid/editable/form-item.vue.mjs";
|
|
135
|
+
import { default as Gp } from "./src/text/index.vue.mjs";
|
|
136
|
+
import { default as Ep } from "./src/text/group.vue.mjs";
|
|
137
|
+
import { default as Lp } from "./src/mask/index.vue.mjs";
|
|
138
|
+
import { Splitter as vp } from "./src/splitter/index.mjs";
|
|
139
|
+
import { useMessage as yp } from "./src/hooks/useMessage.mjs";
|
|
140
|
+
import { useControllableValue as kp } from "./src/hooks/useControllableValue.mjs";
|
|
141
|
+
import { useManualRef as Kp } from "./src/hooks/useManualRef.mjs";
|
|
142
|
+
import { useThrottleRef as Up } from "./src/hooks/useThrottleRef.mjs";
|
|
143
|
+
import { useFullScreen as _p } from "./src/hooks/useFullScreen.mjs";
|
|
144
|
+
import { useResize as Wp } from "./src/hooks/useResize.mjs";
|
|
144
145
|
const a = console.log;
|
|
145
146
|
a(`APlus-UI version ${p}`);
|
|
146
147
|
const l = {
|
|
@@ -215,7 +216,7 @@ export {
|
|
|
215
216
|
Re as ApFormProvider,
|
|
216
217
|
ne as ApFormSearchForm,
|
|
217
218
|
be as ApFormSet,
|
|
218
|
-
|
|
219
|
+
Sp as ApGrid,
|
|
219
220
|
ct as ApGroupSearch,
|
|
220
221
|
vr as ApImage,
|
|
221
222
|
vo as ApInfoLayout,
|
|
@@ -240,8 +241,8 @@ export {
|
|
|
240
241
|
fr as ApTableModal,
|
|
241
242
|
Eo as ApTag,
|
|
242
243
|
Lo as ApTagGroup,
|
|
243
|
-
|
|
244
|
-
|
|
244
|
+
Gp as ApText,
|
|
245
|
+
Ep as ApTextGroup,
|
|
245
246
|
qr as ApTitle,
|
|
246
247
|
pr as ApTransformDataHelper,
|
|
247
248
|
ko as ApUpload,
|
|
@@ -254,21 +255,21 @@ export {
|
|
|
254
255
|
n as DEFAULT_NAMESPACE,
|
|
255
256
|
c as DEFAULT_UIMODE,
|
|
256
257
|
bo as DictCode,
|
|
257
|
-
|
|
258
|
-
|
|
258
|
+
Cp as EditableGrid,
|
|
259
|
+
Dp as EditableGridFormItem,
|
|
259
260
|
Qt as EditableTable,
|
|
260
261
|
Yt as EditableTableFormItem,
|
|
261
262
|
up as FullScreen,
|
|
262
263
|
fp as InternalScrollBar,
|
|
263
264
|
Ut as LruCacher,
|
|
264
|
-
|
|
265
|
+
Lp as Mask,
|
|
265
266
|
yo as NeedNameKeyDefault,
|
|
266
267
|
dp as Portal,
|
|
267
268
|
cp as ROW_SELECTION_FIELD,
|
|
268
269
|
ip as ResizeObserver,
|
|
269
270
|
pp as ScrollBar,
|
|
270
271
|
lp as ScrollView,
|
|
271
|
-
|
|
272
|
+
vp as Splitter,
|
|
272
273
|
Go as WorkOrderModal,
|
|
273
274
|
mo as adminToken,
|
|
274
275
|
lo as aplusToken,
|
|
@@ -296,23 +297,24 @@ export {
|
|
|
296
297
|
L as namespaceContextKey,
|
|
297
298
|
s as pathMap,
|
|
298
299
|
S as provideGlobalConfig,
|
|
300
|
+
Ip as toTreeArray,
|
|
299
301
|
G as translate,
|
|
300
302
|
_t as useApKeepAliveInject,
|
|
301
|
-
|
|
302
|
-
|
|
303
|
+
kp as useControllableValue,
|
|
304
|
+
_p as useFullScreen,
|
|
303
305
|
M as useGetDerivedNamespace,
|
|
304
306
|
b as useGlobalConfig,
|
|
305
307
|
rt as useGridRefresh,
|
|
306
308
|
P as useLocale,
|
|
307
|
-
|
|
308
|
-
|
|
309
|
+
Kp as useManualRef,
|
|
310
|
+
yp as useMessage,
|
|
309
311
|
v as useNamespace,
|
|
310
312
|
et as usePageListApGrid,
|
|
311
313
|
Qr as usePageListApTable,
|
|
312
|
-
|
|
314
|
+
Wp as useResize,
|
|
313
315
|
lr as useTableModal,
|
|
314
316
|
jt as useTablePaging,
|
|
315
317
|
Yr as useTableRefresh,
|
|
316
318
|
dr as useTableSelectModal,
|
|
317
|
-
|
|
319
|
+
Up as useThrottleRef
|
|
318
320
|
};
|
|
@@ -166,6 +166,10 @@ export type ApFormSearchFormProps = ApFormProps & {
|
|
|
166
166
|
* 尺寸监听目标元素(用于响应式)
|
|
167
167
|
*/
|
|
168
168
|
resizeTarget?: HTMLElement | null;
|
|
169
|
+
/**
|
|
170
|
+
* 查询按钮loading延迟(默认300ms)
|
|
171
|
+
*/
|
|
172
|
+
loadingDelay?: number;
|
|
169
173
|
};
|
|
170
174
|
export type ApFormSearchFormPopoverFilterProps = {
|
|
171
175
|
config: Array<{
|
|
@@ -7,8 +7,9 @@ type FormListField = {
|
|
|
7
7
|
fieldName: number;
|
|
8
8
|
};
|
|
9
9
|
type FormListActions = {
|
|
10
|
-
add: (defaultValue?: any) =>
|
|
10
|
+
add: (defaultValue?: any) => number;
|
|
11
11
|
remove: (name: number) => void;
|
|
12
|
+
getFieldKeys: () => number[];
|
|
12
13
|
};
|
|
13
14
|
type ApFormListSlots = {
|
|
14
15
|
default(props: {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useInjectForm as
|
|
3
|
-
import { isArray as
|
|
4
|
-
const
|
|
1
|
+
import { defineComponent as v, onMounted as V, computed as p, unref as i, renderSlot as K } from "vue";
|
|
2
|
+
import { useInjectForm as g } from "../context.mjs";
|
|
3
|
+
import { isArray as h } from "lodash-unified";
|
|
4
|
+
const b = /* @__PURE__ */ v({
|
|
5
5
|
name: "ApFormList",
|
|
6
6
|
__name: "index",
|
|
7
7
|
props: {
|
|
@@ -9,43 +9,47 @@ const g = /* @__PURE__ */ V({
|
|
|
9
9
|
initialValue: {},
|
|
10
10
|
transform: { type: [Function, Object] }
|
|
11
11
|
},
|
|
12
|
-
setup(
|
|
13
|
-
let
|
|
14
|
-
const a = [], t =
|
|
15
|
-
|
|
12
|
+
setup(y) {
|
|
13
|
+
let s = 1;
|
|
14
|
+
const a = [], t = y, { model: u, updateModel: o, internalInstance: c } = g();
|
|
15
|
+
V(() => {
|
|
16
16
|
c == null || c.registerField({
|
|
17
17
|
name: t.name,
|
|
18
18
|
initialValue: t.initialValue,
|
|
19
19
|
transform: t.transform
|
|
20
20
|
});
|
|
21
21
|
});
|
|
22
|
-
const
|
|
23
|
-
function
|
|
24
|
-
const n =
|
|
25
|
-
a.push(
|
|
22
|
+
const m = p(() => t.name ? h(t.name) ? t.name.reduce((e, n) => e == null ? void 0 : e[n], i(u)) : u == null ? void 0 : u.value[t.name] : null);
|
|
23
|
+
function d(e = void 0) {
|
|
24
|
+
const n = i(m) ? [...i(m), e] : [e], r = s;
|
|
25
|
+
return a.push(r), s += 1, o == null || o(t.name, n), r;
|
|
26
26
|
}
|
|
27
|
-
function
|
|
28
|
-
let n =
|
|
29
|
-
n = [...n.slice(0, e), ...n.slice(e + 1)], a.splice(e, 1),
|
|
27
|
+
function F(e) {
|
|
28
|
+
let n = i(m) || [];
|
|
29
|
+
n = [...n.slice(0, e), ...n.slice(e + 1)], a.splice(e, 1), o == null || o(t.name, n);
|
|
30
30
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
31
|
+
function _() {
|
|
32
|
+
return f.value.map((e) => e.key);
|
|
33
|
+
}
|
|
34
|
+
const k = {
|
|
35
|
+
add: d,
|
|
36
|
+
remove: F,
|
|
37
|
+
getFieldKeys: _
|
|
38
|
+
}, f = p(() => (i(m) || []).map((n, r) => {
|
|
39
|
+
let l = a[r];
|
|
40
|
+
return typeof l > "u" && (a[r] = s, l = s, s += 1), {
|
|
37
41
|
key: l,
|
|
38
|
-
fieldName:
|
|
39
|
-
name: [t.name,
|
|
42
|
+
fieldName: r,
|
|
43
|
+
name: [t.name, r].flat(),
|
|
40
44
|
value: n
|
|
41
45
|
};
|
|
42
46
|
}));
|
|
43
|
-
return (e, n) =>
|
|
44
|
-
fields:
|
|
45
|
-
actions:
|
|
47
|
+
return (e, n) => K(e.$slots, "default", {
|
|
48
|
+
fields: f.value,
|
|
49
|
+
actions: k
|
|
46
50
|
});
|
|
47
51
|
}
|
|
48
52
|
});
|
|
49
53
|
export {
|
|
50
|
-
|
|
54
|
+
b as default
|
|
51
55
|
};
|
|
@@ -858,6 +858,7 @@ declare const __VLS_component: DefineComponent<ApFormSearchFormProps, {
|
|
|
858
858
|
forceExpand: boolean;
|
|
859
859
|
maxRows: number;
|
|
860
860
|
sortable: boolean;
|
|
861
|
+
loadingDelay: number;
|
|
861
862
|
}, {}, {}, {}, string, ComponentProvideOptions, false, {
|
|
862
863
|
apForm: ({
|
|
863
864
|
$: ComponentInternalInstance;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { isVNode as le, defineComponent as re, useSlots as se, ref as
|
|
2
|
-
import { Col as w, Flex as N, Button as
|
|
1
|
+
import { isVNode as le, defineComponent as re, useSlots as se, ref as D, shallowRef as U, computed as S, unref as n, watch as W, createVNode as o, Fragment as _, createBlock as g, openBlock as d, mergeProps as ie, withCtx as B, resolveDynamicComponent as I, createElementBlock as ue, renderList as ce } from "vue";
|
|
2
|
+
import { Col as w, Flex as N, Button as M, Row as pe } 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 z } from "../item-group/helper.mjs";
|
|
6
6
|
import "../../config-provider/index.mjs";
|
|
7
|
-
import { isArray as de, isBoolean as
|
|
7
|
+
import { isArray as de, isBoolean as fe, omit as me } from "lodash-unified";
|
|
8
8
|
import { isDef as q } from "../../utils/index.mjs";
|
|
9
9
|
import { execFunc as H, diffFormItem as he } from "./utils.mjs";
|
|
10
10
|
import "./components/popover-filter.vue.mjs";
|
|
@@ -17,10 +17,10 @@ import G from "../item/index.vue.mjs";
|
|
|
17
17
|
import Ce from "./components/popover-filter.vue2.mjs";
|
|
18
18
|
import Se from "./components/popover-sorter/index.vue2.mjs";
|
|
19
19
|
import _e from "../ap-form.vue2.mjs";
|
|
20
|
-
function we(
|
|
21
|
-
return typeof
|
|
20
|
+
function we(f) {
|
|
21
|
+
return typeof f == "function" || Object.prototype.toString.call(f) === "[object Object]" && !le(f);
|
|
22
22
|
}
|
|
23
|
-
const s = 24,
|
|
23
|
+
const s = 24, ze = /* @__PURE__ */ re({
|
|
24
24
|
name: "ApFormSearchForm",
|
|
25
25
|
__name: "index",
|
|
26
26
|
props: {
|
|
@@ -110,36 +110,39 @@ const s = 24, De = /* @__PURE__ */ re({
|
|
|
110
110
|
type: Boolean,
|
|
111
111
|
default: !0
|
|
112
112
|
},
|
|
113
|
-
resizeTarget: {}
|
|
113
|
+
resizeTarget: {},
|
|
114
|
+
loadingDelay: {
|
|
115
|
+
default: 300
|
|
116
|
+
}
|
|
114
117
|
},
|
|
115
|
-
setup(
|
|
118
|
+
setup(f, {
|
|
116
119
|
expose: J
|
|
117
120
|
}) {
|
|
118
121
|
var L;
|
|
119
|
-
const i = se(),
|
|
120
|
-
b:
|
|
122
|
+
const i = se(), t = f, {
|
|
123
|
+
b: m
|
|
121
124
|
} = ye("ap-form-search-form"), {
|
|
122
125
|
t: k
|
|
123
|
-
} = ve(), K = xe(
|
|
126
|
+
} = ve(), K = xe(t), y = D(), Q = D();
|
|
124
127
|
function T() {
|
|
125
128
|
var a;
|
|
126
129
|
const e = (a = y.value) == null ? void 0 : a.getFieldsValueTransformed(!0);
|
|
127
|
-
H(
|
|
130
|
+
H(t.onSubmit, e);
|
|
128
131
|
}
|
|
129
132
|
function X() {
|
|
130
133
|
var e, a;
|
|
131
|
-
|
|
134
|
+
t.customReset || (a = (e = y.value) == null ? void 0 : e.resetFields) == null || a.call(e), H(t.onReset);
|
|
132
135
|
}
|
|
133
136
|
const Y = (e) => q(e) ? (de(e) ? e : [e]).join("") : Date.now();
|
|
134
137
|
let E = [];
|
|
135
|
-
const h =
|
|
138
|
+
const h = U(z(i.default())), c = U((L = i.extra) == null ? void 0 : L.call(i)), P = S(() => Math.floor(s / n(K))), {
|
|
136
139
|
items: R,
|
|
137
140
|
sorted: O,
|
|
138
141
|
handleClickConfirm: b
|
|
139
142
|
} = ge(h);
|
|
140
|
-
|
|
141
|
-
E = h.value, h.value = he(E,
|
|
142
|
-
}),
|
|
143
|
+
W(() => i.default(), (e) => {
|
|
144
|
+
E = h.value, h.value = he(E, z(e)), O.value = !1;
|
|
145
|
+
}), W(() => {
|
|
143
146
|
var e;
|
|
144
147
|
return (e = i.extra) == null ? void 0 : e.call(i);
|
|
145
148
|
}, (e) => {
|
|
@@ -148,10 +151,10 @@ const s = 24, De = /* @__PURE__ */ re({
|
|
|
148
151
|
const l = S(() => {
|
|
149
152
|
const e = h.value, a = [], r = [], x = [], u = n(P);
|
|
150
153
|
let v = 0, F = 0;
|
|
151
|
-
const te = s *
|
|
154
|
+
const te = s * t.maxRows - u * (n(c) && !t.extraInAction ? 2 : 1);
|
|
152
155
|
e.forEach((A, ne) => {
|
|
153
156
|
const p = A.props;
|
|
154
|
-
if (
|
|
157
|
+
if (fe(p.hidden) ? !!p.hidden : q(p.hidden))
|
|
155
158
|
a.push(A);
|
|
156
159
|
else {
|
|
157
160
|
let C = p.span || u;
|
|
@@ -165,7 +168,7 @@ const s = 24, De = /* @__PURE__ */ re({
|
|
|
165
168
|
});
|
|
166
169
|
const $ = s - (F + u) % s, oe = F % s < u, ae = $ < u ? s : $;
|
|
167
170
|
return {
|
|
168
|
-
hideNode:
|
|
171
|
+
hideNode: o(_, null, [a]),
|
|
169
172
|
nodes: x,
|
|
170
173
|
collapseNodes: r,
|
|
171
174
|
extraSpan: ae,
|
|
@@ -173,63 +176,65 @@ const s = 24, De = /* @__PURE__ */ re({
|
|
|
173
176
|
};
|
|
174
177
|
}), Z = S(() => {
|
|
175
178
|
let e;
|
|
176
|
-
const a = l.value.collapseNodes.length ||
|
|
179
|
+
const a = l.value.collapseNodes.length || t.sortable && h.value.length, r = o(w, {
|
|
177
180
|
span: n(P),
|
|
178
181
|
key: "actionWrapper"
|
|
179
182
|
}, {
|
|
180
|
-
default: () => [
|
|
181
|
-
default: () => [
|
|
183
|
+
default: () => [o(G, null, {
|
|
184
|
+
default: () => [o(N, {
|
|
182
185
|
wrap: "wrap",
|
|
183
|
-
justify: l.value.lastRowOnlyIncludeActionAndExtra && !(n(c) &&
|
|
186
|
+
justify: l.value.lastRowOnlyIncludeActionAndExtra && !(n(c) && t.extraInAction) ? "flex-end" : "space-between"
|
|
184
187
|
}, {
|
|
185
|
-
default: () => [
|
|
188
|
+
default: () => [o(N, {
|
|
186
189
|
gap: 8,
|
|
187
190
|
wrap: "wrap"
|
|
188
191
|
}, {
|
|
189
|
-
default: () => [a ?
|
|
190
|
-
class:
|
|
191
|
-
}, [l.value.collapseNodes.length ?
|
|
192
|
+
default: () => [a ? o("div", {
|
|
193
|
+
class: m("column-setting-trigger-wrapper")
|
|
194
|
+
}, [l.value.collapseNodes.length ? o(Ce, {
|
|
192
195
|
onSubmit: T,
|
|
193
196
|
config: l.value.collapseNodes,
|
|
194
|
-
submitLoading:
|
|
195
|
-
}, null) : null,
|
|
197
|
+
submitLoading: t.submitLoading
|
|
198
|
+
}, null) : null, t.sortable && R.value.length ? o(Se, {
|
|
196
199
|
ref: "sorterIns",
|
|
197
200
|
items: R.value,
|
|
198
201
|
onClickConfirm: b,
|
|
199
202
|
sorted: O.value
|
|
200
|
-
}, null) : null]) : null,
|
|
203
|
+
}, null) : null]) : null, o(M, {
|
|
201
204
|
type: "primary",
|
|
202
205
|
onClick: T,
|
|
203
|
-
loading:
|
|
206
|
+
loading: t.submitLoading ? {
|
|
207
|
+
delay: t.loadingDelay
|
|
208
|
+
} : !1,
|
|
204
209
|
htmlType: "submit",
|
|
205
|
-
class:
|
|
210
|
+
class: m("action-btn")
|
|
206
211
|
}, {
|
|
207
|
-
default: () => [
|
|
208
|
-
}),
|
|
212
|
+
default: () => [t.searchText || k("ap.apForm.search.search")]
|
|
213
|
+
}), o(M, {
|
|
209
214
|
onClick: X,
|
|
210
215
|
type: "text",
|
|
211
|
-
class: [
|
|
216
|
+
class: [m("action-btn"), m("action-btn-reset")]
|
|
212
217
|
}, {
|
|
213
|
-
default: () => [
|
|
218
|
+
default: () => [t.resetText || k("ap.apForm.search.reset")]
|
|
214
219
|
})]
|
|
215
|
-
}),
|
|
220
|
+
}), t.extraInAction ? n(c) : null]
|
|
216
221
|
})]
|
|
217
222
|
})]
|
|
218
|
-
}), x = !
|
|
223
|
+
}), x = !t.extraInAction && n(c) ? o(w, {
|
|
219
224
|
span: l.value.extraSpan,
|
|
220
225
|
key: "extraNode"
|
|
221
226
|
}, {
|
|
222
|
-
default: () => [
|
|
223
|
-
default: () => [
|
|
227
|
+
default: () => [o(G, null, {
|
|
228
|
+
default: () => [o(N, {
|
|
224
229
|
justify: l.value.extraSpan === s || l.value.lastRowOnlyIncludeActionAndExtra ? "start" : "flex-end"
|
|
225
230
|
}, we(e = n(c)) ? e : {
|
|
226
231
|
default: () => [e]
|
|
227
232
|
})]
|
|
228
233
|
})]
|
|
229
|
-
}) : null, u =
|
|
234
|
+
}) : null, u = o(w, {
|
|
230
235
|
span: l.value.extraSpan
|
|
231
236
|
}, null);
|
|
232
|
-
return l.value.lastRowOnlyIncludeActionAndExtra ?
|
|
237
|
+
return l.value.lastRowOnlyIncludeActionAndExtra ? o(_, null, [x || u, r]) : o(_, null, [r, x]);
|
|
233
238
|
});
|
|
234
239
|
function ee() {
|
|
235
240
|
var a;
|
|
@@ -244,9 +249,9 @@ const s = 24, De = /* @__PURE__ */ re({
|
|
|
244
249
|
}), (e, a) => (d(), g(_e, ie({
|
|
245
250
|
ref_key: "apForm",
|
|
246
251
|
ref: y,
|
|
247
|
-
class: n(
|
|
248
|
-
}, n(
|
|
249
|
-
default: B(() => [(d(), g(I(l.value.hideNode))),
|
|
252
|
+
class: n(m)()
|
|
253
|
+
}, n(me)(t, ["collapse", "defaultCollapse", "onUpdate:collapse", "searchText", "resetText", "onSubmit", "onReset", "extraInAction", "forceExpand", "countPerRow"])), {
|
|
254
|
+
default: B(() => [(d(), g(I(l.value.hideNode))), o(n(pe), {
|
|
250
255
|
gutter: 8
|
|
251
256
|
}, {
|
|
252
257
|
default: B(() => [(d(!0), ue(_, null, ce(l.value.nodes, (r) => (d(), g(n(w), {
|
|
@@ -263,5 +268,5 @@ const s = 24, De = /* @__PURE__ */ re({
|
|
|
263
268
|
}
|
|
264
269
|
});
|
|
265
270
|
export {
|
|
266
|
-
|
|
271
|
+
ze as default
|
|
267
272
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as P, useSlots as A, toRef as W, ref as h, unref as
|
|
1
|
+
import { defineComponent as P, useSlots as A, toRef as W, ref as h, unref as u, watch as G, nextTick as U, createBlock as $, openBlock as q, mergeProps as y, withCtx as g, createVNode as J, createSlots as Q, renderList as X, renderSlot as Y, normalizeProps as Z, guardReactiveProps as I } from "vue";
|
|
2
2
|
import { ApForm as C } from "../../ap-form/index.mjs";
|
|
3
3
|
import { isArray as w, isUndefined as M, isNumber as m, cloneDeep as ee, omit as oe } from "lodash-unified";
|
|
4
4
|
import "../../config-provider/index.mjs";
|
|
@@ -148,6 +148,7 @@ const Ce = /* @__PURE__ */ P({
|
|
|
148
148
|
rowHighlightable: {
|
|
149
149
|
type: [Boolean, Function]
|
|
150
150
|
},
|
|
151
|
+
treeConfig: {},
|
|
151
152
|
columns: {},
|
|
152
153
|
defaultValue: {},
|
|
153
154
|
"onUpdate:value": {},
|
|
@@ -172,7 +173,7 @@ const Ce = /* @__PURE__ */ P({
|
|
|
172
173
|
const {
|
|
173
174
|
internalInstance: o,
|
|
174
175
|
model: v
|
|
175
|
-
} = ae(), p = W(l.name), d = h(F(
|
|
176
|
+
} = ae(), p = W(l.name), d = h(F(u(v), p.value) || []), N = C.useWatch(p);
|
|
176
177
|
G(() => N.value, async (e) => {
|
|
177
178
|
var t;
|
|
178
179
|
await U(), d.value = e, (t = l.onChange) == null || t.call(l, e);
|
|
@@ -182,61 +183,61 @@ const Ce = /* @__PURE__ */ P({
|
|
|
182
183
|
const c = h(), D = ne("valueTypeMap"), V = te(l, D);
|
|
183
184
|
function L(e, t) {
|
|
184
185
|
var f;
|
|
185
|
-
const n = ((f =
|
|
186
|
+
const n = ((f = u(d)) == null ? void 0 : f.length) || 0;
|
|
186
187
|
if (b(l.maxLength) && n >= l.maxLength)
|
|
187
188
|
return;
|
|
188
189
|
const a = {
|
|
189
190
|
...e || {}
|
|
190
191
|
};
|
|
191
|
-
o == null || o.setFieldValue(l.name, a, !0, (
|
|
192
|
-
if (!s
|
|
193
|
-
s
|
|
192
|
+
o == null || o.setFieldValue(l.name, a, !0, (r, s) => {
|
|
193
|
+
if (!r[s]) {
|
|
194
|
+
r[s] = [a];
|
|
194
195
|
return;
|
|
195
196
|
}
|
|
196
|
-
M(t) ? s
|
|
197
|
+
M(t) ? r[s].push(a) : r[s].splice(t, 0, a);
|
|
197
198
|
});
|
|
198
199
|
}
|
|
199
200
|
function T(e, t = "suffix") {
|
|
200
|
-
var
|
|
201
|
-
const n = ((
|
|
201
|
+
var r;
|
|
202
|
+
const n = ((r = u(d)) == null ? void 0 : r.length) || 0, a = m(e) ? e : e.length;
|
|
202
203
|
if (b(l.maxLength) && n + a > l.maxLength)
|
|
203
204
|
return;
|
|
204
205
|
const f = m(e) ? new Array(e).fill(0).map(() => ({})) : ee(e);
|
|
205
|
-
o == null || o.setFieldValue(l.name, f, !0, (
|
|
206
|
-
if (!
|
|
207
|
-
|
|
206
|
+
o == null || o.setFieldValue(l.name, f, !0, (s, i) => {
|
|
207
|
+
if (!s[i]) {
|
|
208
|
+
s[i] = [...f];
|
|
208
209
|
return;
|
|
209
210
|
}
|
|
210
|
-
t === "suffix" ?
|
|
211
|
+
t === "suffix" ? s[i].push(...f) : s[i].unshift(...f);
|
|
211
212
|
});
|
|
212
213
|
}
|
|
213
214
|
function k(e) {
|
|
214
215
|
const t = new Set(m(e) ? [e] : e);
|
|
215
216
|
o == null || o.setFieldValue(l.name, void 0, !0, (n, a) => {
|
|
216
|
-
n[a] = n[a].filter((f,
|
|
217
|
+
n[a] = n[a].filter((f, r) => !t.has(r));
|
|
217
218
|
});
|
|
218
219
|
}
|
|
219
220
|
function _(e) {
|
|
220
221
|
var n;
|
|
221
222
|
const t = new Set(w(e) ? e : [e]);
|
|
222
223
|
t.size !== 0 && ((n = o == null ? void 0 : o.setFieldValue) == null || n.call(o, l.name, void 0, !0, (a, f) => {
|
|
223
|
-
a[f] = a[f].filter((
|
|
224
|
+
a[f] = a[f].filter((r) => !t.has(r[l.rowKey]));
|
|
224
225
|
}));
|
|
225
226
|
}
|
|
226
227
|
function j() {
|
|
227
|
-
return
|
|
228
|
+
return u(d);
|
|
228
229
|
}
|
|
229
230
|
function E(e) {
|
|
230
231
|
var t;
|
|
231
|
-
return (t =
|
|
232
|
+
return (t = u(d)) == null ? void 0 : t[e];
|
|
232
233
|
}
|
|
233
234
|
function O(e, t, n = !0) {
|
|
234
235
|
o == null || o.setFieldValue(l.name, void 0, !0, (a, f) => {
|
|
235
236
|
if (!(!a[f] || !a[f][e])) {
|
|
236
237
|
if (!n) {
|
|
237
|
-
const
|
|
238
|
-
for (const
|
|
239
|
-
|
|
238
|
+
const r = Object.keys(a[f][e]);
|
|
239
|
+
for (const s of r)
|
|
240
|
+
s !== l.rowKey && delete a[f][e][s];
|
|
240
241
|
}
|
|
241
242
|
Object.assign(a[f][e], {
|
|
242
243
|
...t
|
|
@@ -267,15 +268,15 @@ const Ce = /* @__PURE__ */ P({
|
|
|
267
268
|
setTableData: z,
|
|
268
269
|
clear: H,
|
|
269
270
|
removeByKey: _
|
|
270
|
-
}), (e, t) => (q(), $(
|
|
271
|
+
}), (e, t) => (q(), $(u(C).FormItem, y(e.formItem, {
|
|
271
272
|
name: e.name,
|
|
272
273
|
label: e.label
|
|
273
274
|
}), {
|
|
274
|
-
default: g(() => [J(fe, y(
|
|
275
|
+
default: g(() => [J(fe, y(u(oe)(l, ["name", "value", "onUpdate:value", "maxLength", "onChange", "defaultValue", "formItem"]), {
|
|
275
276
|
ref_key: "tableRef",
|
|
276
277
|
ref: c,
|
|
277
|
-
class:
|
|
278
|
-
columns:
|
|
278
|
+
class: u(S)(),
|
|
279
|
+
columns: u(V),
|
|
279
280
|
"data-source": d.value,
|
|
280
281
|
"search-form": !1
|
|
281
282
|
}), Q({
|
package/es/src/ap-grid/index.mjs
CHANGED
|
@@ -3,7 +3,9 @@ import "./editable/index.vue2.mjs";
|
|
|
3
3
|
import "./editable/form-item.vue2.mjs";
|
|
4
4
|
import "./interface.mjs";
|
|
5
5
|
import "./editable/interface.mjs";
|
|
6
|
-
import { ROW_SELECTION_FIELD as
|
|
6
|
+
import { ROW_SELECTION_FIELD as E } from "./constants.mjs";
|
|
7
|
+
import { toTreeArray as x } from "./utils/to-tree-array.mjs";
|
|
7
8
|
export {
|
|
8
|
-
|
|
9
|
+
E as ROW_SELECTION_FIELD,
|
|
10
|
+
x as toTreeArray
|
|
9
11
|
};
|
|
@@ -111,7 +111,8 @@ const Go = /* @__PURE__ */ Oe({
|
|
|
111
111
|
virtual: { type: [Boolean, Object], default: void 0 },
|
|
112
112
|
expandable: {},
|
|
113
113
|
value: {},
|
|
114
|
-
rowHighlightable: { type: [Boolean, Function], default: !1 }
|
|
114
|
+
rowHighlightable: { type: [Boolean, Function], default: !1 },
|
|
115
|
+
treeConfig: {}
|
|
115
116
|
},
|
|
116
117
|
setup(se, { expose: ie }) {
|
|
117
118
|
var Y;
|
|
@@ -65,6 +65,14 @@ export type ApGridColumnType<RecordType = any, ExtraValueType = 'text', ValueTyp
|
|
|
65
65
|
* 指定渲染内容是否为html
|
|
66
66
|
*/
|
|
67
67
|
html?: boolean;
|
|
68
|
+
/**
|
|
69
|
+
* 指定当前列是否是VxeTable内置的序号列
|
|
70
|
+
*/
|
|
71
|
+
seq?: boolean;
|
|
72
|
+
/**
|
|
73
|
+
* 指定当前列为树节点
|
|
74
|
+
*/
|
|
75
|
+
treeNode?: boolean;
|
|
68
76
|
/**
|
|
69
77
|
* 值类型额外配置的参数(用于查询表单渲染)
|
|
70
78
|
*/
|
|
@@ -244,6 +252,10 @@ export type ApGridProps<RecordType = any, ParamsType = any> = Omit<TableProps<Re
|
|
|
244
252
|
* 行是否可以被高亮(传入函数可以获取当前被选中的行)
|
|
245
253
|
*/
|
|
246
254
|
rowHighlightable?: boolean | ((current: RecordType) => void);
|
|
255
|
+
/**
|
|
256
|
+
* 树形表格设置(部分vxe-table.treeConfig配置)
|
|
257
|
+
*/
|
|
258
|
+
treeConfig?: Omit<VxeTablePropTypes.TreeConfig<RecordType>, 'transform' | 'iconOpen' | 'iconClose' | 'iconLoaded'>;
|
|
247
259
|
};
|
|
248
260
|
export type ApGridVirtualConfig = {
|
|
249
261
|
x?: false | number;
|