@aplus-frontend/ui 0.3.10 → 0.3.11
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 +222 -220
- package/es/src/ap-form/ap-form.vue.d.ts +1 -3
- package/es/src/ap-form/ap-form.vue2.mjs +101 -95
- package/es/src/business/ap-select-layout/select-layout.vue2.mjs +33 -29
- package/es/src/config-provider/config-provider-props.d.ts +0 -2
- package/es/src/config-provider/config-provider-props.mjs +2 -4
- package/es/src/config-provider/config-provider.d.ts +0 -6
- package/es/src/config-provider/config-provider.mjs +26 -25
- package/es/src/config-provider/constants.d.ts +2 -0
- package/es/src/config-provider/constants.mjs +3 -1
- package/es/src/config-provider/hooks/use-global-config.d.ts +0 -2
- package/es/src/config-provider/index.d.ts +0 -12
- package/es/src/config-provider/index.mjs +17 -15
- package/es/src/index.mjs +207 -205
- package/lib/index.js +1 -1
- package/lib/src/ap-form/ap-form.vue.d.ts +1 -3
- package/lib/src/ap-form/ap-form.vue2.js +1 -1
- package/lib/src/business/ap-select-layout/select-layout.vue2.js +1 -1
- package/lib/src/config-provider/config-provider-props.d.ts +0 -2
- package/lib/src/config-provider/config-provider-props.js +1 -1
- package/lib/src/config-provider/config-provider.d.ts +0 -6
- package/lib/src/config-provider/config-provider.js +1 -1
- package/lib/src/config-provider/constants.d.ts +2 -0
- package/lib/src/config-provider/constants.js +1 -1
- package/lib/src/config-provider/hooks/use-global-config.d.ts +0 -2
- package/lib/src/config-provider/index.d.ts +0 -12
- package/lib/src/config-provider/index.js +1 -1
- package/lib/src/index.js +1 -1
- package/package.json +2 -2
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { Form as
|
|
3
|
-
import { useProvideForm as
|
|
4
|
-
import { isArray as f, cloneDeep as oe, isFunction as
|
|
5
|
-
import { useUrlSearchParams as
|
|
6
|
-
import { INTERNAL_FORM_INSTANCE_MARK as
|
|
7
|
-
import { getRouteType as
|
|
8
|
-
import
|
|
1
|
+
import { defineComponent as G, ref as b, reactive as H, unref as g, nextTick as J, toRaw as O, computed as Q, openBlock as X, createBlock as Y, mergeProps as Z, withCtx as ee, renderSlot as te } from "vue";
|
|
2
|
+
import { Form as le } from "@aplus-frontend/antdv";
|
|
3
|
+
import { useProvideForm as re } from "./context.mjs";
|
|
4
|
+
import { isArray as f, cloneDeep as oe, isFunction as P, isPlainObject as R, omit as se } from "lodash-unified";
|
|
5
|
+
import { useUrlSearchParams as ie } from "@vueuse/core";
|
|
6
|
+
import { INTERNAL_FORM_INSTANCE_MARK as ne } from "./constant.mjs";
|
|
7
|
+
import { getRouteType as ae, isDef as T } from "../utils/index.mjs";
|
|
8
|
+
import ue from "./utils/set.mjs";
|
|
9
9
|
import { genParams as _, setToParams as w } from "./utils/params.mjs";
|
|
10
|
-
const
|
|
10
|
+
const Ve = /* @__PURE__ */ G({
|
|
11
11
|
__name: "ap-form",
|
|
12
12
|
props: {
|
|
13
13
|
layout: { default: "horizontal" },
|
|
@@ -38,8 +38,11 @@ const ye = /* @__PURE__ */ $({
|
|
|
38
38
|
syncToUrlPriority: { type: Boolean }
|
|
39
39
|
},
|
|
40
40
|
setup(E, { expose: j }) {
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
function x(e, t) {
|
|
42
|
+
return f(t) ? t.reduce((l, s) => l == null ? void 0 : l[s], e) : e == null ? void 0 : e[t];
|
|
43
|
+
}
|
|
44
|
+
const o = E;
|
|
45
|
+
function V(e, t, l = !0) {
|
|
43
46
|
var i;
|
|
44
47
|
if (f(e)) {
|
|
45
48
|
let r = n;
|
|
@@ -48,105 +51,108 @@ const ye = /* @__PURE__ */ $({
|
|
|
48
51
|
r[e[e.length - 1]] = t;
|
|
49
52
|
} else
|
|
50
53
|
n[e] = t;
|
|
51
|
-
let
|
|
52
|
-
l && ((i =
|
|
54
|
+
let s = f(e) ? e[0] : e;
|
|
55
|
+
l && ((i = o.onValuesChange) == null || i.call(o, { [s]: n[s] }, n, e)), y();
|
|
53
56
|
}
|
|
54
|
-
const a =
|
|
55
|
-
|
|
57
|
+
const a = b(), m = ie(ae()), v = b(
|
|
58
|
+
o.syncToUrl ? _(o.syncToUrl, m, "get") : {}
|
|
56
59
|
);
|
|
57
|
-
let
|
|
58
|
-
const n =
|
|
60
|
+
let p = oe(B()), d = {};
|
|
61
|
+
const n = H(B());
|
|
59
62
|
let F = [];
|
|
60
|
-
function
|
|
61
|
-
const e =
|
|
62
|
-
return
|
|
63
|
+
function B() {
|
|
64
|
+
const e = o.initialValues || {};
|
|
65
|
+
return o.syncToUrlPriority ? {
|
|
63
66
|
...e,
|
|
64
|
-
...
|
|
67
|
+
...g(v)
|
|
65
68
|
} : {
|
|
66
|
-
...
|
|
69
|
+
...g(v),
|
|
67
70
|
...e
|
|
68
71
|
};
|
|
69
72
|
}
|
|
70
|
-
function
|
|
73
|
+
function A(e) {
|
|
71
74
|
var l;
|
|
72
|
-
const t =
|
|
73
|
-
|
|
75
|
+
const t = h(e, d);
|
|
76
|
+
o.syncToUrl && w(m, _(o.syncToUrl, t, "set")), (l = o.onFinish) == null || l.call(o, t);
|
|
74
77
|
}
|
|
75
|
-
const
|
|
78
|
+
const N = async () => {
|
|
76
79
|
var e;
|
|
77
|
-
(e = a.value) == null || e.resetFields(), await
|
|
78
|
-
Object.keys(n).forEach((t) => delete n[t]), Object.assign(n,
|
|
79
|
-
|
|
80
|
+
(e = a.value) == null || e.resetFields(), await J(() => {
|
|
81
|
+
Object.keys(n).forEach((t) => delete n[t]), Object.assign(n, p), y(), o.syncToUrl && w(
|
|
82
|
+
m,
|
|
80
83
|
_(
|
|
81
|
-
|
|
82
|
-
p
|
|
84
|
+
o.syncToUrl,
|
|
85
|
+
h(p, d),
|
|
83
86
|
"set"
|
|
84
87
|
)
|
|
85
88
|
);
|
|
86
89
|
});
|
|
87
|
-
},
|
|
90
|
+
}, S = (e) => {
|
|
88
91
|
var t;
|
|
89
92
|
(t = a.value) == null || t.clearValidate(e);
|
|
90
|
-
},
|
|
93
|
+
}, W = (e, t) => {
|
|
91
94
|
var l;
|
|
92
95
|
return (l = a.value) == null ? void 0 : l.validateFields(e, t);
|
|
93
|
-
},
|
|
94
|
-
var
|
|
95
|
-
const l = await ((
|
|
96
|
+
}, q = async (e, t) => {
|
|
97
|
+
var s;
|
|
98
|
+
const l = await ((s = a.value) == null ? void 0 : s.validateFields(
|
|
96
99
|
e,
|
|
97
100
|
t
|
|
98
101
|
));
|
|
99
|
-
return
|
|
100
|
-
},
|
|
102
|
+
return h(l, d);
|
|
103
|
+
}, z = (e) => {
|
|
101
104
|
var t;
|
|
102
105
|
return (t = a.value) == null ? void 0 : t.getFieldsValue(e);
|
|
103
|
-
},
|
|
106
|
+
}, C = (e) => {
|
|
104
107
|
var l;
|
|
105
108
|
const t = (l = a.value) == null ? void 0 : l.getFieldsValue(e);
|
|
106
|
-
return
|
|
107
|
-
},
|
|
109
|
+
return h(t, d);
|
|
110
|
+
}, D = (e, t) => {
|
|
108
111
|
var l;
|
|
109
112
|
return (l = a.value) == null ? void 0 : l.validate(e, t);
|
|
110
|
-
},
|
|
113
|
+
}, L = (e, t = {}) => {
|
|
111
114
|
var l;
|
|
112
115
|
(l = a.value) == null || l.scrollToField(e, t);
|
|
113
|
-
},
|
|
114
|
-
Object.assign(n, e),
|
|
115
|
-
},
|
|
116
|
-
|
|
116
|
+
}, k = (e) => {
|
|
117
|
+
Object.assign(n, e), y();
|
|
118
|
+
}, I = (e, t, l = !0) => {
|
|
119
|
+
V(e, t, l), y();
|
|
117
120
|
};
|
|
118
|
-
function
|
|
121
|
+
function U(e, t) {
|
|
119
122
|
return t || e(O(n)), F.push(e), () => {
|
|
120
123
|
F = F.filter((l) => l !== e);
|
|
121
124
|
};
|
|
122
125
|
}
|
|
123
|
-
function
|
|
124
|
-
if (
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
126
|
+
function M({ initialValue: e, name: t, transform: l }) {
|
|
127
|
+
if (T(e) && T(t)) {
|
|
128
|
+
const s = x(g(v), t);
|
|
129
|
+
if (!T(s) || !o.syncToUrlPriority)
|
|
130
|
+
if (V(t, e, !1), f(t)) {
|
|
131
|
+
let i = p;
|
|
132
|
+
for (let r = 0; r < t.length - 1; r++)
|
|
133
|
+
T(i[t[r]]) || (i[t[r]] = {}), i = i[t[r]];
|
|
134
|
+
i[t[t.length - 1]] = e;
|
|
135
|
+
} else
|
|
136
|
+
p[t] = e;
|
|
137
|
+
}
|
|
138
|
+
l && (d = ue(
|
|
133
139
|
d,
|
|
134
140
|
[t].flat(1),
|
|
135
141
|
l,
|
|
136
142
|
!0
|
|
137
143
|
));
|
|
138
144
|
}
|
|
139
|
-
function
|
|
140
|
-
if (e !==
|
|
145
|
+
function K(e) {
|
|
146
|
+
if (e !== ne) {
|
|
141
147
|
console.warn("getInternalInstance should only used at internal");
|
|
142
148
|
return;
|
|
143
149
|
}
|
|
144
150
|
return {
|
|
145
|
-
registerField:
|
|
146
|
-
registerWatch:
|
|
151
|
+
registerField: M,
|
|
152
|
+
registerWatch: U
|
|
147
153
|
};
|
|
148
154
|
}
|
|
149
|
-
function
|
|
155
|
+
function y() {
|
|
150
156
|
if (F.length) {
|
|
151
157
|
const e = O(n);
|
|
152
158
|
F.forEach((t) => {
|
|
@@ -154,63 +160,63 @@ const ye = /* @__PURE__ */ $({
|
|
|
154
160
|
});
|
|
155
161
|
}
|
|
156
162
|
}
|
|
157
|
-
function
|
|
163
|
+
function h(e, t) {
|
|
158
164
|
if (e == null)
|
|
159
165
|
return;
|
|
160
166
|
let l = f(e) ? [] : {};
|
|
161
|
-
return Object.keys(e).forEach((
|
|
162
|
-
const i = e[
|
|
163
|
-
if (
|
|
167
|
+
return Object.keys(e).forEach((s) => {
|
|
168
|
+
const i = e[s], r = t == null ? void 0 : t[s], u = P(r) ? r : r == null ? void 0 : r.transformer, $ = P(r) ? !0 : r == null ? void 0 : r.flat;
|
|
169
|
+
if (P(u)) {
|
|
164
170
|
const c = u(i);
|
|
165
|
-
|
|
171
|
+
$ ? f(c) && f(l) ? l = [...l, ...c] : R(c) && R(l) ? l = {
|
|
166
172
|
...l,
|
|
167
173
|
...c
|
|
168
|
-
} : l[
|
|
174
|
+
} : l[s] = c : l[s] = c;
|
|
169
175
|
} else if (R(i) || f(i)) {
|
|
170
|
-
const c =
|
|
176
|
+
const c = h(
|
|
171
177
|
i,
|
|
172
178
|
r
|
|
173
179
|
);
|
|
174
|
-
l[
|
|
180
|
+
l[s] = c;
|
|
175
181
|
} else
|
|
176
|
-
l[
|
|
182
|
+
l[s] = i;
|
|
177
183
|
}), l;
|
|
178
184
|
}
|
|
179
|
-
return
|
|
180
|
-
model:
|
|
181
|
-
updateModel:
|
|
185
|
+
return re({
|
|
186
|
+
model: Q(() => n),
|
|
187
|
+
updateModel: V,
|
|
182
188
|
internalInstance: {
|
|
183
|
-
registerWatch:
|
|
184
|
-
registerField:
|
|
185
|
-
setFieldValue:
|
|
189
|
+
registerWatch: U,
|
|
190
|
+
registerField: M,
|
|
191
|
+
setFieldValue: I
|
|
186
192
|
}
|
|
187
193
|
}), j({
|
|
188
|
-
resetFields:
|
|
189
|
-
clearValidate:
|
|
190
|
-
validateFields:
|
|
191
|
-
getFieldsValue:
|
|
192
|
-
validate:
|
|
193
|
-
scrollToField:
|
|
194
|
-
setFieldsValue:
|
|
195
|
-
setFieldValue:
|
|
196
|
-
registerWatch:
|
|
197
|
-
validateFieldsReturnTransformed:
|
|
198
|
-
getFieldsValueTransformed:
|
|
199
|
-
getInternalInstance:
|
|
200
|
-
}), (e, t) => (
|
|
194
|
+
resetFields: N,
|
|
195
|
+
clearValidate: S,
|
|
196
|
+
validateFields: W,
|
|
197
|
+
getFieldsValue: z,
|
|
198
|
+
validate: D,
|
|
199
|
+
scrollToField: L,
|
|
200
|
+
setFieldsValue: k,
|
|
201
|
+
setFieldValue: I,
|
|
202
|
+
registerWatch: U,
|
|
203
|
+
validateFieldsReturnTransformed: q,
|
|
204
|
+
getFieldsValueTransformed: C,
|
|
205
|
+
getInternalInstance: K
|
|
206
|
+
}), (e, t) => (X(), Y(g(le), Z({
|
|
201
207
|
ref_key: "formRef",
|
|
202
208
|
ref: a
|
|
203
|
-
},
|
|
209
|
+
}, g(se)(o, ["initialValues", "onValuesChange", "onFinish"]), {
|
|
204
210
|
model: n,
|
|
205
|
-
onFinish:
|
|
211
|
+
onFinish: A
|
|
206
212
|
}), {
|
|
207
|
-
default:
|
|
208
|
-
|
|
213
|
+
default: ee(() => [
|
|
214
|
+
te(e.$slots, "default")
|
|
209
215
|
]),
|
|
210
216
|
_: 3
|
|
211
217
|
}, 16, ["model"]));
|
|
212
218
|
}
|
|
213
219
|
});
|
|
214
220
|
export {
|
|
215
|
-
|
|
221
|
+
Ve as default
|
|
216
222
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { defineComponent as O, ref as
|
|
1
|
+
import { defineComponent as O, ref as u, computed as U, onMounted as W, openBlock as p, createElementBlock as m, normalizeClass as a, unref as t, createVNode as d, Transition as z, withCtx as v, withDirectives as V, createElementVNode as s, toDisplayString as E, createTextVNode as $, Fragment as R, renderList as _, renderSlot as x, vShow as N, createCommentVNode as j } from "vue";
|
|
2
2
|
import "../../ap-field/index.mjs";
|
|
3
3
|
import { IconApLeftarrow as G, IconApMenu as H } from "@aplus-frontend/icon";
|
|
4
4
|
import "../../config-provider/index.mjs";
|
|
5
|
-
import { Tooltip as
|
|
5
|
+
import { Tooltip as w, TypographyText as J } from "@aplus-frontend/antdv";
|
|
6
6
|
import { debounce as K } from "lodash-unified";
|
|
7
7
|
import { useNamespace as P } from "../../config-provider/hooks/use-namespace.mjs";
|
|
8
8
|
import { ApFieldText as Q } from "../../ap-field/text/index.mjs";
|
|
@@ -16,19 +16,19 @@ const X = ["onClick"], re = /* @__PURE__ */ O({
|
|
|
16
16
|
defaultValue: { default: "" }
|
|
17
17
|
},
|
|
18
18
|
emits: ["onSelect", "afterEnter", "afterLeave"],
|
|
19
|
-
setup(
|
|
20
|
-
const { b: h, be: y, bem:
|
|
21
|
-
|
|
19
|
+
setup(A, { emit: B }) {
|
|
20
|
+
const { b: h, be: y, bem: i } = P("ap-select-layout"), o = A, C = B, g = u(), f = u(o.defaultFold), S = u(!o.defaultFold), T = u(), b = u(), k = u(), c = u(o.defaultValue), L = () => {
|
|
21
|
+
f.value = !f.value, T.value = !1, b.value = !1;
|
|
22
22
|
}, F = (l) => {
|
|
23
23
|
k.value = l, C("onSelect", l);
|
|
24
24
|
}, q = K((l) => {
|
|
25
25
|
var e;
|
|
26
|
-
|
|
26
|
+
c.value = (e = l.target) == null ? void 0 : e.value;
|
|
27
27
|
}, 500), D = U(() => {
|
|
28
28
|
var l;
|
|
29
29
|
return (l = g.value) == null ? void 0 : l.filter((e) => {
|
|
30
|
-
var
|
|
31
|
-
return o != null && o.onSearch ? (
|
|
30
|
+
var r, n;
|
|
31
|
+
return o != null && o.onSearch ? (r = o.onSearch) == null ? void 0 : r.call(o, e, c.value) : (n = e == null ? void 0 : e.name) == null ? void 0 : n.includes(c.value);
|
|
32
32
|
});
|
|
33
33
|
}), I = (l) => {
|
|
34
34
|
S.value = !0, C("afterEnter", l);
|
|
@@ -37,11 +37,15 @@ const X = ["onClick"], re = /* @__PURE__ */ O({
|
|
|
37
37
|
};
|
|
38
38
|
return W(() => {
|
|
39
39
|
o.request().then((l) => {
|
|
40
|
-
var
|
|
41
|
-
g.value = l
|
|
40
|
+
var r;
|
|
41
|
+
g.value = l;
|
|
42
|
+
let e = (r = g.value) == null ? void 0 : r.filter(
|
|
43
|
+
(n) => n.name.includes(c.value)
|
|
44
|
+
);
|
|
45
|
+
F(e == null ? void 0 : e[0]);
|
|
42
46
|
});
|
|
43
47
|
}), (l, e) => {
|
|
44
|
-
var
|
|
48
|
+
var r;
|
|
45
49
|
return p(), m("div", {
|
|
46
50
|
class: a(t(h)())
|
|
47
51
|
}, [
|
|
@@ -50,7 +54,7 @@ const X = ["onClick"], re = /* @__PURE__ */ O({
|
|
|
50
54
|
onAfterEnter: I,
|
|
51
55
|
onAfterLeave: M
|
|
52
56
|
}, {
|
|
53
|
-
default:
|
|
57
|
+
default: v(() => [
|
|
54
58
|
V(s("div", {
|
|
55
59
|
class: a(t(h)("side"))
|
|
56
60
|
}, [
|
|
@@ -59,16 +63,16 @@ const X = ["onClick"], re = /* @__PURE__ */ O({
|
|
|
59
63
|
}, [
|
|
60
64
|
s("h3", null, E(o.title), 1),
|
|
61
65
|
s("div", {
|
|
62
|
-
class: a(t(
|
|
66
|
+
class: a(t(i)("side", "header", "imgWrap"))
|
|
63
67
|
}, [
|
|
64
|
-
d(t(
|
|
68
|
+
d(t(w), {
|
|
65
69
|
open: T.value,
|
|
66
70
|
"onUpdate:open": e[0] || (e[0] = (n) => T.value = n)
|
|
67
71
|
}, {
|
|
68
|
-
title:
|
|
72
|
+
title: v(() => e[2] || (e[2] = [
|
|
69
73
|
$("收起")
|
|
70
74
|
])),
|
|
71
|
-
default:
|
|
75
|
+
default: v(() => [
|
|
72
76
|
d(t(G), { onClick: L })
|
|
73
77
|
]),
|
|
74
78
|
_: 1
|
|
@@ -79,20 +83,20 @@ const X = ["onClick"], re = /* @__PURE__ */ O({
|
|
|
79
83
|
class: a(t(y)("side", "body"))
|
|
80
84
|
}, [
|
|
81
85
|
s("div", {
|
|
82
|
-
class: a(t(
|
|
86
|
+
class: a(t(i)("side", "body", "search"))
|
|
83
87
|
}, [
|
|
84
88
|
d(t(Q), {
|
|
85
89
|
placeholder: "请输入",
|
|
86
|
-
value:
|
|
90
|
+
value: c.value,
|
|
87
91
|
onChange: t(q)
|
|
88
92
|
}, null, 8, ["value", "onChange"])
|
|
89
93
|
], 2),
|
|
90
94
|
s("div", {
|
|
91
|
-
class: a(t(
|
|
95
|
+
class: a(t(i)("side", "body", "scroll"))
|
|
92
96
|
}, [
|
|
93
97
|
(p(!0), m(R, null, _(D.value, (n) => V((p(), m("div", {
|
|
94
98
|
key: n.value,
|
|
95
|
-
class: a(`${t(
|
|
99
|
+
class: a(`${t(i)("side", "body", "scroll-item")} ${k.value === n ? "active" : ""}`),
|
|
96
100
|
onClick: (Y) => F(n)
|
|
97
101
|
}, [
|
|
98
102
|
x(l.$slots, "itemRender", { item: n }, () => [
|
|
@@ -102,12 +106,12 @@ const X = ["onClick"], re = /* @__PURE__ */ O({
|
|
|
102
106
|
}, null, 8, ["ellipsis", "content"])
|
|
103
107
|
])
|
|
104
108
|
], 10, X)), [
|
|
105
|
-
[
|
|
109
|
+
[N, S.value]
|
|
106
110
|
])), 128))
|
|
107
111
|
], 2)
|
|
108
112
|
], 2)
|
|
109
113
|
], 2), [
|
|
110
|
-
[
|
|
114
|
+
[N, !f.value]
|
|
111
115
|
])
|
|
112
116
|
]),
|
|
113
117
|
_: 3
|
|
@@ -118,26 +122,26 @@ const X = ["onClick"], re = /* @__PURE__ */ O({
|
|
|
118
122
|
s("div", {
|
|
119
123
|
class: a(t(y)("content", "header"))
|
|
120
124
|
}, [
|
|
121
|
-
|
|
125
|
+
f.value ? (p(), m("div", {
|
|
122
126
|
key: 0,
|
|
123
|
-
class: a(t(
|
|
127
|
+
class: a(t(i)("content", "header", "imgWrap"))
|
|
124
128
|
}, [
|
|
125
|
-
d(t(
|
|
129
|
+
d(t(w), {
|
|
126
130
|
open: b.value,
|
|
127
131
|
"onUpdate:open": e[1] || (e[1] = (n) => b.value = n)
|
|
128
132
|
}, {
|
|
129
|
-
title:
|
|
133
|
+
title: v(() => e[3] || (e[3] = [
|
|
130
134
|
$("展开")
|
|
131
135
|
])),
|
|
132
|
-
default:
|
|
136
|
+
default: v(() => [
|
|
133
137
|
d(t(H), { onClick: L })
|
|
134
138
|
]),
|
|
135
139
|
_: 1
|
|
136
140
|
}, 8, ["open"])
|
|
137
141
|
], 2)) : j("", !0),
|
|
138
142
|
s("div", {
|
|
139
|
-
class: a(t(
|
|
140
|
-
}, E((
|
|
143
|
+
class: a(t(i)("content", "header", "title"))
|
|
144
|
+
}, E((r = k.value) == null ? void 0 : r.name), 3)
|
|
141
145
|
], 2),
|
|
142
146
|
x(l.$slots, "default")
|
|
143
147
|
], 2)
|
|
@@ -131,7 +131,6 @@ export declare const configProviderProps: () => {
|
|
|
131
131
|
};
|
|
132
132
|
namespace: {
|
|
133
133
|
type: StringConstructor;
|
|
134
|
-
default: string;
|
|
135
134
|
};
|
|
136
135
|
api: {
|
|
137
136
|
type: PropType<ApiType>;
|
|
@@ -139,7 +138,6 @@ export declare const configProviderProps: () => {
|
|
|
139
138
|
};
|
|
140
139
|
uiMode: {
|
|
141
140
|
type: PropType<"aplus" | "admin">;
|
|
142
|
-
default: string;
|
|
143
141
|
};
|
|
144
142
|
apUpload: {
|
|
145
143
|
type: PropType<ApUploadConfig>;
|
|
@@ -7,16 +7,14 @@ const p = () => ({
|
|
|
7
7
|
type: Object
|
|
8
8
|
},
|
|
9
9
|
namespace: {
|
|
10
|
-
type: String
|
|
11
|
-
default: "aplus"
|
|
10
|
+
type: String
|
|
12
11
|
},
|
|
13
12
|
api: {
|
|
14
13
|
type: Object,
|
|
15
14
|
default: () => ({})
|
|
16
15
|
},
|
|
17
16
|
uiMode: {
|
|
18
|
-
type: String
|
|
19
|
-
default: "aplus"
|
|
17
|
+
type: String
|
|
20
18
|
},
|
|
21
19
|
apUpload: {
|
|
22
20
|
type: Object,
|
|
@@ -131,7 +131,6 @@ export declare const ConfigProvider: DefineComponent<ExtractPropTypes<{
|
|
|
131
131
|
};
|
|
132
132
|
namespace: {
|
|
133
133
|
type: StringConstructor;
|
|
134
|
-
default: string;
|
|
135
134
|
};
|
|
136
135
|
api: {
|
|
137
136
|
type: PropType<ApiType>;
|
|
@@ -139,7 +138,6 @@ export declare const ConfigProvider: DefineComponent<ExtractPropTypes<{
|
|
|
139
138
|
};
|
|
140
139
|
uiMode: {
|
|
141
140
|
type: PropType<"aplus" | "admin">;
|
|
142
|
-
default: string;
|
|
143
141
|
};
|
|
144
142
|
apUpload: {
|
|
145
143
|
type: PropType<ApUploadConfig>;
|
|
@@ -283,7 +281,6 @@ export declare const ConfigProvider: DefineComponent<ExtractPropTypes<{
|
|
|
283
281
|
};
|
|
284
282
|
namespace: {
|
|
285
283
|
type: StringConstructor;
|
|
286
|
-
default: string;
|
|
287
284
|
};
|
|
288
285
|
api: {
|
|
289
286
|
type: PropType<ApiType>;
|
|
@@ -291,7 +288,6 @@ export declare const ConfigProvider: DefineComponent<ExtractPropTypes<{
|
|
|
291
288
|
};
|
|
292
289
|
uiMode: {
|
|
293
290
|
type: PropType<"aplus" | "admin">;
|
|
294
|
-
default: string;
|
|
295
291
|
};
|
|
296
292
|
apUpload: {
|
|
297
293
|
type: PropType<ApUploadConfig>;
|
|
@@ -349,9 +345,7 @@ export declare const ConfigProvider: DefineComponent<ExtractPropTypes<{
|
|
|
349
345
|
wave: {
|
|
350
346
|
disabled?: boolean;
|
|
351
347
|
};
|
|
352
|
-
namespace: string;
|
|
353
348
|
api: ApiType;
|
|
354
|
-
uiMode: "aplus" | "admin";
|
|
355
349
|
apUpload: ApUploadConfig;
|
|
356
350
|
apDescriptions: ApDescriptionsConfig;
|
|
357
351
|
valueTypeMap: Record<string, ValueTypeRenderConfig>;
|
|
@@ -1,45 +1,46 @@
|
|
|
1
|
-
import { isVNode as
|
|
2
|
-
import { ConfigProvider as
|
|
3
|
-
import { provideGlobalConfig as
|
|
4
|
-
import { configProviderProps as
|
|
5
|
-
import { mergeAntdProvideConfig as
|
|
6
|
-
import { generateCssVar as
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { isVNode as v, ref as V, defineComponent as M, computed as n, unref as r, watch as d, createVNode as P, renderSlot as b } from "vue";
|
|
2
|
+
import { ConfigProvider as U } from "@aplus-frontend/antdv";
|
|
3
|
+
import { useGlobalConfig as f, provideGlobalConfig as A } from "./hooks/use-global-config.mjs";
|
|
4
|
+
import { configProviderProps as S } from "./config-provider-props.mjs";
|
|
5
|
+
import { mergeAntdProvideConfig as T } from "../utils/config-provider-preset.mjs";
|
|
6
|
+
import { generateCssVar as w, aplusCssVar as y, adminCssVar as D, setCSSVariables as E } from "./css-var.mjs";
|
|
7
|
+
import { DEFAULT_NAMESPACE as N, DEFAULT_UIMODE as F } from "./constants.mjs";
|
|
8
|
+
function L(e) {
|
|
9
|
+
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !v(e);
|
|
9
10
|
}
|
|
10
|
-
const
|
|
11
|
+
const c = V({}), $ = /* @__PURE__ */ M({
|
|
11
12
|
name: "AplusConfigProvider",
|
|
12
|
-
props:
|
|
13
|
+
props: S(),
|
|
13
14
|
setup(e, {
|
|
14
|
-
slots:
|
|
15
|
+
slots: l
|
|
15
16
|
}) {
|
|
16
|
-
const n = m(() => ({
|
|
17
|
-
namespace:
|
|
17
|
+
const i = f("namespace"), a = f("uiMode"), s = n(() => e.namespace ? e.namespace : r(i) ? r(i) : N), u = n(() => e.uiMode ? e.uiMode : r(a) ? r(a) : F), m = n(() => ({
|
|
18
|
+
namespace: r(s),
|
|
18
19
|
aplusLocale: e.aplusLocale,
|
|
19
20
|
api: e.api,
|
|
20
|
-
uiMode:
|
|
21
|
+
uiMode: r(u),
|
|
21
22
|
apUpload: e.apUpload,
|
|
22
23
|
apDescriptions: e.apDescriptions,
|
|
23
24
|
valueTypeMap: e.valueTypeMap,
|
|
24
25
|
downloadCenterTriggerConfig: e.downloadCenterTriggerConfig,
|
|
25
26
|
exportField: e.exportField
|
|
26
|
-
})), t =
|
|
27
|
-
return
|
|
28
|
-
|
|
27
|
+
})), t = A(m);
|
|
28
|
+
return d(() => e, (o) => {
|
|
29
|
+
c.value = T(o);
|
|
29
30
|
}, {
|
|
30
31
|
deep: !0,
|
|
31
32
|
immediate: !0
|
|
32
|
-
}), typeof window < "u" &&
|
|
33
|
-
const
|
|
34
|
-
...o === "aplus" ?
|
|
35
|
-
...
|
|
33
|
+
}), typeof window < "u" && d(() => [r(u), e.cssVar], ([o, p]) => {
|
|
34
|
+
const C = w(p), g = {
|
|
35
|
+
...o === "aplus" ? y : D,
|
|
36
|
+
...C
|
|
36
37
|
};
|
|
37
|
-
|
|
38
|
+
E(g);
|
|
38
39
|
}, {
|
|
39
40
|
immediate: !0
|
|
40
41
|
}), () => {
|
|
41
42
|
let o;
|
|
42
|
-
return
|
|
43
|
+
return P(U, c.value, L(o = b(l, "default", {
|
|
43
44
|
config: t == null ? void 0 : t.value
|
|
44
45
|
})) ? o : {
|
|
45
46
|
default: () => [o]
|
|
@@ -48,6 +49,6 @@ const a = c({}), F = /* @__PURE__ */ s({
|
|
|
48
49
|
}
|
|
49
50
|
});
|
|
50
51
|
export {
|
|
51
|
-
|
|
52
|
-
|
|
52
|
+
$ as ConfigProvider,
|
|
53
|
+
c as globalConfigCached
|
|
53
54
|
};
|
|
@@ -133,7 +133,6 @@ export declare const provideGlobalConfig: (config: MaybeRef<ConfigProviderContex
|
|
|
133
133
|
};
|
|
134
134
|
namespace: {
|
|
135
135
|
type: StringConstructor;
|
|
136
|
-
default: string;
|
|
137
136
|
};
|
|
138
137
|
api: {
|
|
139
138
|
type: PropType<ApiType>;
|
|
@@ -141,7 +140,6 @@ export declare const provideGlobalConfig: (config: MaybeRef<ConfigProviderContex
|
|
|
141
140
|
};
|
|
142
141
|
uiMode: {
|
|
143
142
|
type: PropType<"aplus" | "admin">;
|
|
144
|
-
default: string;
|
|
145
143
|
};
|
|
146
144
|
apUpload: {
|
|
147
145
|
type: PropType<ApUploadConfig>;
|