@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.
Files changed (29) hide show
  1. package/es/index.mjs +222 -220
  2. package/es/src/ap-form/ap-form.vue.d.ts +1 -3
  3. package/es/src/ap-form/ap-form.vue2.mjs +101 -95
  4. package/es/src/business/ap-select-layout/select-layout.vue2.mjs +33 -29
  5. package/es/src/config-provider/config-provider-props.d.ts +0 -2
  6. package/es/src/config-provider/config-provider-props.mjs +2 -4
  7. package/es/src/config-provider/config-provider.d.ts +0 -6
  8. package/es/src/config-provider/config-provider.mjs +26 -25
  9. package/es/src/config-provider/constants.d.ts +2 -0
  10. package/es/src/config-provider/constants.mjs +3 -1
  11. package/es/src/config-provider/hooks/use-global-config.d.ts +0 -2
  12. package/es/src/config-provider/index.d.ts +0 -12
  13. package/es/src/config-provider/index.mjs +17 -15
  14. package/es/src/index.mjs +207 -205
  15. package/lib/index.js +1 -1
  16. package/lib/src/ap-form/ap-form.vue.d.ts +1 -3
  17. package/lib/src/ap-form/ap-form.vue2.js +1 -1
  18. package/lib/src/business/ap-select-layout/select-layout.vue2.js +1 -1
  19. package/lib/src/config-provider/config-provider-props.d.ts +0 -2
  20. package/lib/src/config-provider/config-provider-props.js +1 -1
  21. package/lib/src/config-provider/config-provider.d.ts +0 -6
  22. package/lib/src/config-provider/config-provider.js +1 -1
  23. package/lib/src/config-provider/constants.d.ts +2 -0
  24. package/lib/src/config-provider/constants.js +1 -1
  25. package/lib/src/config-provider/hooks/use-global-config.d.ts +0 -2
  26. package/lib/src/config-provider/index.d.ts +0 -12
  27. package/lib/src/config-provider/index.js +1 -1
  28. package/lib/src/index.js +1 -1
  29. package/package.json +2 -2
@@ -1,13 +1,13 @@
1
- import { defineComponent as $, ref as M, reactive as G, unref as m, nextTick as H, toRaw as O, computed as J, openBlock as Q, createBlock as X, mergeProps as Y, withCtx as Z, renderSlot as ee } from "vue";
2
- import { Form as te } from "@aplus-frontend/antdv";
3
- import { useProvideForm as le } from "./context.mjs";
4
- import { isArray as f, cloneDeep as oe, isFunction as V, isPlainObject as R, omit as re } from "lodash-unified";
5
- import { useUrlSearchParams as se } from "@vueuse/core";
6
- import { INTERNAL_FORM_INSTANCE_MARK as ie } from "./constant.mjs";
7
- import { getRouteType as ne, isDef as U } from "../utils/index.mjs";
8
- import ae from "./utils/set.mjs";
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 ye = /* @__PURE__ */ $({
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
- const s = E;
42
- function y(e, t, l = !0) {
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 o = f(e) ? e[0] : e;
52
- l && ((i = s.onValuesChange) == null || i.call(s, { [o]: n[o] }, n, e)), g();
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 = M(), v = se(ne()), B = M(
55
- s.syncToUrl ? _(s.syncToUrl, v, "get") : {}
57
+ const a = b(), m = ie(ae()), v = b(
58
+ o.syncToUrl ? _(o.syncToUrl, m, "get") : {}
56
59
  );
57
- let h = oe(I()), d = {};
58
- const n = G(I());
60
+ let p = oe(B()), d = {};
61
+ const n = H(B());
59
62
  let F = [];
60
- function I() {
61
- const e = s.initialValues || {};
62
- return s.syncToUrlPriority ? {
63
+ function B() {
64
+ const e = o.initialValues || {};
65
+ return o.syncToUrlPriority ? {
63
66
  ...e,
64
- ...m(B)
67
+ ...g(v)
65
68
  } : {
66
- ...m(B),
69
+ ...g(v),
67
70
  ...e
68
71
  };
69
72
  }
70
- function x(e) {
73
+ function A(e) {
71
74
  var l;
72
- const t = p(e, d);
73
- s.syncToUrl && w(v, _(s.syncToUrl, t, "set")), (l = s.onFinish) == null || l.call(s, t);
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 A = async () => {
78
+ const N = async () => {
76
79
  var e;
77
- (e = a.value) == null || e.resetFields(), await H(() => {
78
- Object.keys(n).forEach((t) => delete n[t]), Object.assign(n, h), g(), s.syncToUrl && w(
79
- v,
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
- s.syncToUrl,
82
- p(h, d),
84
+ o.syncToUrl,
85
+ h(p, d),
83
86
  "set"
84
87
  )
85
88
  );
86
89
  });
87
- }, N = (e) => {
90
+ }, S = (e) => {
88
91
  var t;
89
92
  (t = a.value) == null || t.clearValidate(e);
90
- }, S = (e, t) => {
93
+ }, W = (e, t) => {
91
94
  var l;
92
95
  return (l = a.value) == null ? void 0 : l.validateFields(e, t);
93
- }, W = async (e, t) => {
94
- var o;
95
- const l = await ((o = a.value) == null ? void 0 : o.validateFields(
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 p(l, d);
100
- }, q = (e) => {
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
- }, z = (e) => {
106
+ }, C = (e) => {
104
107
  var l;
105
108
  const t = (l = a.value) == null ? void 0 : l.getFieldsValue(e);
106
- return p(t, d);
107
- }, C = (e, t) => {
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
- }, D = (e, t = {}) => {
113
+ }, L = (e, t = {}) => {
111
114
  var l;
112
115
  (l = a.value) == null || l.scrollToField(e, t);
113
- }, L = (e) => {
114
- Object.assign(n, e), g();
115
- }, P = (e, t, l = !0) => {
116
- y(e, t, l), g();
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 T(e, t) {
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 b({ initialValue: e, name: t, transform: l }) {
124
- if (U(e) && U(t))
125
- if (y(t, e, !1), f(t)) {
126
- let o = h;
127
- for (let i = 0; i < t.length - 1; i++)
128
- U(o[t[i]]) || (o[t[i]] = {}), o = o[t[i]];
129
- o[t[t.length - 1]] = e;
130
- } else
131
- h[t] = e;
132
- l && (d = ae(
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 k(e) {
140
- if (e !== ie) {
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: b,
146
- registerWatch: T
151
+ registerField: M,
152
+ registerWatch: U
147
153
  };
148
154
  }
149
- function g() {
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 p(e, t) {
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((o) => {
162
- const i = e[o], r = t == null ? void 0 : t[o], u = V(r) ? r : r == null ? void 0 : r.transformer, K = V(r) ? !0 : r == null ? void 0 : r.flat;
163
- if (V(u)) {
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
- K ? f(c) && f(l) ? l = [...l, ...c] : R(c) && R(l) ? l = {
171
+ $ ? f(c) && f(l) ? l = [...l, ...c] : R(c) && R(l) ? l = {
166
172
  ...l,
167
173
  ...c
168
- } : l[o] = c : l[o] = c;
174
+ } : l[s] = c : l[s] = c;
169
175
  } else if (R(i) || f(i)) {
170
- const c = p(
176
+ const c = h(
171
177
  i,
172
178
  r
173
179
  );
174
- l[o] = c;
180
+ l[s] = c;
175
181
  } else
176
- l[o] = i;
182
+ l[s] = i;
177
183
  }), l;
178
184
  }
179
- return le({
180
- model: J(() => n),
181
- updateModel: y,
185
+ return re({
186
+ model: Q(() => n),
187
+ updateModel: V,
182
188
  internalInstance: {
183
- registerWatch: T,
184
- registerField: b,
185
- setFieldValue: P
189
+ registerWatch: U,
190
+ registerField: M,
191
+ setFieldValue: I
186
192
  }
187
193
  }), j({
188
- resetFields: A,
189
- clearValidate: N,
190
- validateFields: S,
191
- getFieldsValue: q,
192
- validate: C,
193
- scrollToField: D,
194
- setFieldsValue: L,
195
- setFieldValue: P,
196
- registerWatch: T,
197
- validateFieldsReturnTransformed: W,
198
- getFieldsValueTransformed: z,
199
- getInternalInstance: k
200
- }), (e, t) => (Q(), X(m(te), Y({
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
- }, m(re)(s, ["initialValues", "onValuesChange", "onFinish"]), {
209
+ }, g(se)(o, ["initialValues", "onValuesChange", "onFinish"]), {
204
210
  model: n,
205
- onFinish: x
211
+ onFinish: A
206
212
  }), {
207
- default: Z(() => [
208
- ee(e.$slots, "default")
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
- ye as default
221
+ Ve as default
216
222
  };
@@ -1,8 +1,8 @@
1
- import { defineComponent as O, ref as r, 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 c, withDirectives as V, createElementVNode as s, toDisplayString as E, createTextVNode as $, Fragment as R, renderList as _, renderSlot as x, vShow as A, createCommentVNode as j } from "vue";
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 N, TypographyText as J } from "@aplus-frontend/antdv";
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(w, { emit: B }) {
20
- const { b: h, be: y, bem: u } = P("ap-select-layout"), o = w, C = B, g = r(), v = r(o.defaultFold), S = r(!o.defaultFold), T = r(), b = r(), k = r(), f = r(o.defaultValue), L = () => {
21
- v.value = !v.value, T.value = !1, b.value = !1;
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
- f.value = (e = l.target) == null ? void 0 : e.value;
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 i, n;
31
- return o != null && o.onSearch ? (i = o.onSearch) == null ? void 0 : i.call(o, e, f.value) : (n = e == null ? void 0 : e.name) == null ? void 0 : n.includes(f.value);
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 e;
41
- g.value = l, F((e = g.value) == null ? void 0 : e[0]);
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 i;
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: c(() => [
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(u)("side", "header", "imgWrap"))
66
+ class: a(t(i)("side", "header", "imgWrap"))
63
67
  }, [
64
- d(t(N), {
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: c(() => e[2] || (e[2] = [
72
+ title: v(() => e[2] || (e[2] = [
69
73
  $("收起")
70
74
  ])),
71
- default: c(() => [
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(u)("side", "body", "search"))
86
+ class: a(t(i)("side", "body", "search"))
83
87
  }, [
84
88
  d(t(Q), {
85
89
  placeholder: "请输入",
86
- value: f.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(u)("side", "body", "scroll"))
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(u)("side", "body", "scroll-item")} ${k.value === n ? "active" : ""}`),
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
- [A, S.value]
109
+ [N, S.value]
106
110
  ])), 128))
107
111
  ], 2)
108
112
  ], 2)
109
113
  ], 2), [
110
- [A, !v.value]
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
- v.value ? (p(), m("div", {
125
+ f.value ? (p(), m("div", {
122
126
  key: 0,
123
- class: a(t(u)("content", "header", "imgWrap"))
127
+ class: a(t(i)("content", "header", "imgWrap"))
124
128
  }, [
125
- d(t(N), {
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: c(() => e[3] || (e[3] = [
133
+ title: v(() => e[3] || (e[3] = [
130
134
  $("展开")
131
135
  ])),
132
- default: c(() => [
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(u)("content", "header", "title"))
140
- }, E((i = k.value) == null ? void 0 : i.name), 3)
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 u, ref as c, defineComponent as s, computed as m, watch as i, createVNode as p, renderSlot as g } from "vue";
2
- import { ConfigProvider as C } from "@aplus-frontend/antdv";
3
- import { provideGlobalConfig as v } from "./hooks/use-global-config.mjs";
4
- import { configProviderProps as V } from "./config-provider-props.mjs";
5
- import { mergeAntdProvideConfig as P } from "../utils/config-provider-preset.mjs";
6
- import { generateCssVar as b, aplusCssVar as w, adminCssVar as y, setCSSVariables as M } from "./css-var.mjs";
7
- function S(e) {
8
- return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !u(e);
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 a = c({}), F = /* @__PURE__ */ s({
11
+ const c = V({}), $ = /* @__PURE__ */ M({
11
12
  name: "AplusConfigProvider",
12
- props: V(),
13
+ props: S(),
13
14
  setup(e, {
14
- slots: r
15
+ slots: l
15
16
  }) {
16
- const n = m(() => ({
17
- namespace: e.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: e.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 = v(n);
27
- return i(() => e, (o) => {
28
- a.value = P(o);
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" && i(() => [e.uiMode, e.cssVar], ([o, d]) => {
33
- const l = b(d), f = {
34
- ...o === "aplus" ? w : y,
35
- ...l
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
- M(f);
38
+ E(g);
38
39
  }, {
39
40
  immediate: !0
40
41
  }), () => {
41
42
  let o;
42
- return p(C, a.value, S(o = g(r, "default", {
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
- F as ConfigProvider,
52
- a as globalConfigCached
52
+ $ as ConfigProvider,
53
+ c as globalConfigCached
53
54
  };
@@ -47,4 +47,6 @@ export type ExportField = boolean | {
47
47
  [key: string]: string[];
48
48
  };
49
49
  };
50
+ export declare const DEFAULT_NAMESPACE = "aplus";
51
+ export declare const DEFAULT_UIMODE = "aplus";
50
52
  export {};
@@ -1,4 +1,6 @@
1
- const o = Symbol();
1
+ const o = Symbol(), t = "aplus", n = "aplus";
2
2
  export {
3
+ t as DEFAULT_NAMESPACE,
4
+ n as DEFAULT_UIMODE,
3
5
  o as configProviderContextKey
4
6
  };
@@ -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>;