@aplus-frontend/ui 0.5.0-beta.1 → 0.5.0-beta.2
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/ap-form/hooks/use-watch.d.ts +4 -1
- package/es/src/ap-form/hooks/use-watch.mjs +31 -29
- package/es/src/ap-form/index.mjs +1 -1
- package/es/src/ap-form/search-form/index.vue.mjs +14 -15
- package/es/src/ap-grid/index.vue.mjs +191 -166
- package/es/src/ap-grid/interface.d.ts +0 -1
- package/es/src/ap-grid/utils/table.mjs +12 -12
- package/es/src/ap-modal/enums/modalMessage.d.ts +6 -0
- package/es/src/ap-modal/enums/modalMessage.mjs +4 -0
- package/es/src/ap-modal/index.d.ts +2 -1
- package/es/src/ap-modal/index.mjs +2 -0
- package/es/src/ap-modal/interface.d.ts +126 -1
- package/es/src/ap-modal/utils/createModalStream.d.ts +2 -0
- package/es/src/ap-modal/utils/createModalStream.mjs +99 -0
- package/es/src/ap-modal/utils/index.d.ts +1 -0
- package/es/src/ap-modal/utils/index.mjs +4 -2
- package/es/src/ap-table/components/dynamic-component/index.vue2.mjs +4 -7
- package/es/src/ap-table/utils.d.ts +1 -4
- package/es/src/ap-table/utils.mjs +43 -41
- package/es/src/business/ap-attachment/ApAttachment.mjs +13 -13
- package/es/src/business/ap-batch-action-group/MenuItemGroup.vue2.mjs +13 -13
- package/lib/src/ap-form/hooks/use-watch.d.ts +4 -1
- package/lib/src/ap-form/hooks/use-watch.js +1 -1
- package/lib/src/ap-form/index.js +1 -1
- package/lib/src/ap-form/search-form/index.vue.js +1 -1
- package/lib/src/ap-grid/index.vue.js +1 -1
- package/lib/src/ap-grid/interface.d.ts +0 -1
- package/lib/src/ap-grid/utils/table.js +1 -1
- package/lib/src/ap-modal/enums/modalMessage.d.ts +6 -0
- package/lib/src/ap-modal/enums/modalMessage.js +1 -0
- package/lib/src/ap-modal/index.d.ts +2 -1
- package/lib/src/ap-modal/index.js +1 -1
- package/lib/src/ap-modal/interface.d.ts +126 -1
- package/lib/src/ap-modal/utils/createModalStream.d.ts +2 -0
- package/lib/src/ap-modal/utils/createModalStream.js +1 -0
- package/lib/src/ap-modal/utils/index.d.ts +1 -0
- package/lib/src/ap-modal/utils/index.js +1 -1
- package/lib/src/ap-table/components/dynamic-component/index.vue2.js +1 -1
- package/lib/src/ap-table/utils.d.ts +1 -4
- package/lib/src/ap-table/utils.js +1 -1
- package/lib/src/business/ap-attachment/ApAttachment.js +1 -1
- package/lib/src/business/ap-batch-action-group/MenuItemGroup.vue2.js +1 -1
- package/package.json +4 -4
- package/theme/ap-grid/index.css +31 -0
- package/theme/ap-grid/index.less +41 -0
- package/theme/index.css +31 -0
|
@@ -2,5 +2,8 @@ import { NamePath } from '@aplus-frontend/antdv/es/form/interface';
|
|
|
2
2
|
import { ApFormExpose } from '../interface';
|
|
3
3
|
import { Ref } from 'vue';
|
|
4
4
|
type ApFormIns<T> = ApFormExpose<T>;
|
|
5
|
-
|
|
5
|
+
type WatchOptions<ValueType> = {
|
|
6
|
+
initialValue: ValueType;
|
|
7
|
+
};
|
|
8
|
+
export declare function useWatch<ValueType = any, StoreType = any>(name: NamePath | Ref<NamePath>, formOrOptions?: Ref<ApFormIns<StoreType> | undefined> | WatchOptions<ValueType>, options?: WatchOptions<ValueType>): Ref<ValueType | undefined, ValueType | undefined>;
|
|
6
9
|
export default useWatch;
|
|
@@ -1,40 +1,42 @@
|
|
|
1
|
-
import { useInjectForm as
|
|
2
|
-
import { ref as
|
|
3
|
-
import { isArray as
|
|
4
|
-
import { INTERNAL_FORM_INSTANCE_MARK as
|
|
5
|
-
function
|
|
6
|
-
return
|
|
1
|
+
import { useInjectForm as M } from "../context.mjs";
|
|
2
|
+
import { ref as R, watchEffect as d, unref as s, watch as y } from "vue";
|
|
3
|
+
import { isArray as E } from "lodash-unified";
|
|
4
|
+
import { INTERNAL_FORM_INSTANCE_MARK as _ } from "../constant.mjs";
|
|
5
|
+
function N(e, t) {
|
|
6
|
+
return E(t) ? t.reduce((n, l) => n == null ? void 0 : n[l], e) : e == null ? void 0 : e[t];
|
|
7
7
|
}
|
|
8
|
-
function
|
|
8
|
+
function V(e) {
|
|
9
9
|
try {
|
|
10
|
-
return JSON.stringify(
|
|
10
|
+
return JSON.stringify(e);
|
|
11
11
|
} catch {
|
|
12
12
|
return Math.random();
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
|
-
|
|
16
|
-
const { internalInstance:
|
|
17
|
-
let
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
15
|
+
function W(e, t, n) {
|
|
16
|
+
const { internalInstance: l, model: v } = M(), g = (n == null ? void 0 : n.initialValue) || (t == null ? void 0 : t.initialValue) || void 0, r = R(g);
|
|
17
|
+
let u = V(g), h = !0;
|
|
18
|
+
const i = t && "value" in t ? t : void 0;
|
|
19
|
+
return d((f) => {
|
|
20
|
+
var w;
|
|
21
|
+
const a = ((w = i == null ? void 0 : i.value) == null ? void 0 : w.getInternalInstance(_)) || l;
|
|
22
|
+
if (!a) {
|
|
23
|
+
h = !1;
|
|
23
24
|
return;
|
|
24
25
|
}
|
|
25
|
-
const c =
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
},
|
|
29
|
-
|
|
30
|
-
}),
|
|
31
|
-
() =>
|
|
32
|
-
(
|
|
33
|
-
const
|
|
34
|
-
c !==
|
|
26
|
+
const c = a.registerWatch((A) => {
|
|
27
|
+
const I = N(A, s(e)), S = V(I);
|
|
28
|
+
S !== u && (r.value = I, u = S);
|
|
29
|
+
}, h);
|
|
30
|
+
f(c);
|
|
31
|
+
}), y(
|
|
32
|
+
() => s(e),
|
|
33
|
+
(f) => {
|
|
34
|
+
const a = N(s(v), f), c = V(a);
|
|
35
|
+
c !== u && (r.value = a, u = c);
|
|
35
36
|
}
|
|
36
|
-
),
|
|
37
|
-
}
|
|
37
|
+
), r;
|
|
38
|
+
}
|
|
38
39
|
export {
|
|
39
|
-
|
|
40
|
+
W as default,
|
|
41
|
+
W as useWatch
|
|
40
42
|
};
|
package/es/src/ap-form/index.mjs
CHANGED
|
@@ -4,7 +4,7 @@ import "./item-group/index.vue2.mjs";
|
|
|
4
4
|
import "./list/index.vue2.mjs";
|
|
5
5
|
import "./search-form/index.vue2.mjs";
|
|
6
6
|
import "./modal-form/index.vue2.mjs";
|
|
7
|
-
import m from "./hooks/use-watch.mjs";
|
|
7
|
+
import { useWatch as m } from "./hooks/use-watch.mjs";
|
|
8
8
|
import "./dependency/index.vue2.mjs";
|
|
9
9
|
import "./set/index.vue2.mjs";
|
|
10
10
|
import "./drawer-form/index.vue2.mjs";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isVNode as se, defineComponent as ie, useSlots as
|
|
1
|
+
import { isVNode as se, defineComponent as ie, useSlots as ue, ref as ce, unref as o, shallowRef as M, computed as S, watch as D, cloneVNode as pe, createVNode as a, Fragment as F, createBlock as C, openBlock as m, mergeProps as de, withCtx as E, resolveDynamicComponent as b, createElementBlock as fe, renderList as me } from "vue";
|
|
2
2
|
import { Col as B, Flex as $, Space as he, Button as v, Row as xe } from "@aplus-frontend/antdv";
|
|
3
3
|
import "../ap-form.vue.mjs";
|
|
4
4
|
import "../item/index.vue2.mjs";
|
|
@@ -108,8 +108,8 @@ const r = 24, ze = /* @__PURE__ */ ie({
|
|
|
108
108
|
emit: H
|
|
109
109
|
}) {
|
|
110
110
|
var I;
|
|
111
|
-
const
|
|
112
|
-
value:
|
|
111
|
+
const u = ue(), n = h, G = H, {
|
|
112
|
+
value: c,
|
|
113
113
|
updateValue: J
|
|
114
114
|
} = Fe(n, G, {
|
|
115
115
|
valuePropName: "collapse",
|
|
@@ -118,9 +118,9 @@ const r = 24, ze = /* @__PURE__ */ ie({
|
|
|
118
118
|
b: K
|
|
119
119
|
} = Be("ap-form-search-form"), Q = Re("uiMode"), {
|
|
120
120
|
t: w
|
|
121
|
-
} = Ae(), g =
|
|
121
|
+
} = Ae(), g = ce();
|
|
122
122
|
function X() {
|
|
123
|
-
J(!o(
|
|
123
|
+
J(!o(c));
|
|
124
124
|
}
|
|
125
125
|
function Y() {
|
|
126
126
|
var e, t;
|
|
@@ -131,12 +131,12 @@ const r = 24, ze = /* @__PURE__ */ ie({
|
|
|
131
131
|
n.customReset || (t = (e = g.value) == null ? void 0 : e.resetFields) == null || t.call(e), W(n.onReset);
|
|
132
132
|
}
|
|
133
133
|
let N = [];
|
|
134
|
-
const R = M(L(
|
|
135
|
-
D(() =>
|
|
134
|
+
const R = M(L(u.default())), d = M((I = u.extra) == null ? void 0 : I.call(u)), k = S(() => Math.floor(r / n.countPerRow));
|
|
135
|
+
D(() => u.default(), (e) => {
|
|
136
136
|
N = R.value, R.value = Se(N, L(e));
|
|
137
137
|
}), D(() => {
|
|
138
138
|
var e;
|
|
139
|
-
return (e =
|
|
139
|
+
return (e = u.extra) == null ? void 0 : e.call(u);
|
|
140
140
|
}, (e) => {
|
|
141
141
|
d.value = e;
|
|
142
142
|
});
|
|
@@ -158,9 +158,8 @@ const r = 24, ze = /* @__PURE__ */ ie({
|
|
|
158
158
|
let V = 0, j = 0;
|
|
159
159
|
const le = s.map((p, f) => {
|
|
160
160
|
const x = p.props, y = x.span || l;
|
|
161
|
-
if (V += y, !n.forceExpand && o(
|
|
161
|
+
if (V += y, !n.forceExpand && o(c) && V > O) {
|
|
162
162
|
t.push(pe(p, {
|
|
163
|
-
class: "ant-form-item-hidden",
|
|
164
163
|
hidden: !0
|
|
165
164
|
}));
|
|
166
165
|
return;
|
|
@@ -187,7 +186,7 @@ const r = 24, ze = /* @__PURE__ */ ie({
|
|
|
187
186
|
}, {
|
|
188
187
|
default: () => [a(q, null, {
|
|
189
188
|
default: () => [a($, {
|
|
190
|
-
justify: !o(
|
|
189
|
+
justify: !o(c) && t.lastRowOnlyIncludeActionAndExtra && !(o(d) && n.extraInAction) ? "flex-end" : "space-between"
|
|
191
190
|
}, {
|
|
192
191
|
default: () => [a(he, null, {
|
|
193
192
|
default: () => [a(v, {
|
|
@@ -205,19 +204,19 @@ const r = 24, ze = /* @__PURE__ */ ie({
|
|
|
205
204
|
onClick: X,
|
|
206
205
|
icon: a(ye, {
|
|
207
206
|
style: Q.value === "aplus" ? "color:#B8C3D1" : "color:#BFBFBF",
|
|
208
|
-
rotate: o(
|
|
207
|
+
rotate: o(c) ? 90 : -90
|
|
209
208
|
}, null)
|
|
210
209
|
}, null) : null]
|
|
211
210
|
}), n.extraInAction ? o(d) : null]
|
|
212
211
|
})]
|
|
213
212
|
})]
|
|
214
213
|
}), l = !n.extraInAction && o(d) ? a(B, {
|
|
215
|
-
span: o(
|
|
214
|
+
span: o(c) ? t.actualExtraSpan : t.defaultExtraSpan,
|
|
216
215
|
key: "extraNode"
|
|
217
216
|
}, {
|
|
218
217
|
default: () => [a(q, null, {
|
|
219
218
|
default: () => [a($, {
|
|
220
|
-
justify: !o(
|
|
219
|
+
justify: !o(c) && (t.defaultExtraSpan === r || t.lastRowOnlyIncludeActionAndExtra) ? "start" : "flex-end"
|
|
221
220
|
}, be(e = o(d)) ? e : {
|
|
222
221
|
default: () => [e]
|
|
223
222
|
})]
|
|
@@ -225,7 +224,7 @@ const r = 24, ze = /* @__PURE__ */ ie({
|
|
|
225
224
|
}) : null, i = a(B, {
|
|
226
225
|
span: t.defaultExtraSpan
|
|
227
226
|
}, null);
|
|
228
|
-
return !o(
|
|
227
|
+
return !o(c) && t.lastRowOnlyIncludeActionAndExtra ? a(F, null, [l || i, s]) : a(F, null, [s, l]);
|
|
229
228
|
});
|
|
230
229
|
return z({
|
|
231
230
|
apForm: S(() => o(g))
|