@aplus-frontend/ui 0.3.10 → 0.3.12

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 (63) hide show
  1. package/es/index.mjs +231 -227
  2. package/es/src/ap-form/ap-form.vue.d.ts +13 -34
  3. package/es/src/ap-form/ap-form.vue2.mjs +143 -120
  4. package/es/src/ap-form/drawer-form/index.vue.d.ts +22 -40
  5. package/es/src/ap-form/drawer-form/index.vue.mjs +3 -3
  6. package/es/src/ap-form/index.d.ts +3 -1
  7. package/es/src/ap-form/index.mjs +26 -22
  8. package/es/src/ap-form/interface.d.ts +3 -1
  9. package/es/src/ap-form/modal-form/index.vue.d.ts +23 -41
  10. package/es/src/ap-form/modal-form/index.vue.mjs +64 -58
  11. package/es/src/ap-form/provider/context.d.ts +3 -0
  12. package/es/src/ap-form/provider/context.mjs +17 -0
  13. package/es/src/ap-form/provider/index.vue.d.ts +19 -0
  14. package/es/src/ap-form/provider/index.vue.mjs +39 -0
  15. package/es/src/ap-form/provider/index.vue2.mjs +4 -0
  16. package/es/src/ap-form/provider/interface.d.ts +22 -0
  17. package/es/src/ap-form/search-form/index.vue.d.ts +22 -40
  18. package/es/src/business/ap-select-layout/select-layout.vue2.mjs +33 -29
  19. package/es/src/business/ap-table-modal/interface.d.ts +2 -0
  20. package/es/src/business/ap-table-modal/table-modal.vue2.mjs +50 -48
  21. package/es/src/config-provider/config-provider-props.d.ts +0 -2
  22. package/es/src/config-provider/config-provider-props.mjs +2 -4
  23. package/es/src/config-provider/config-provider.d.ts +0 -6
  24. package/es/src/config-provider/config-provider.mjs +26 -25
  25. package/es/src/config-provider/constants.d.ts +2 -0
  26. package/es/src/config-provider/constants.mjs +3 -1
  27. package/es/src/config-provider/hooks/use-global-config.d.ts +0 -2
  28. package/es/src/config-provider/index.d.ts +0 -12
  29. package/es/src/config-provider/index.mjs +17 -15
  30. package/es/src/index.mjs +210 -206
  31. package/es/src/utils/slot.mjs +6 -8
  32. package/lib/index.js +1 -1
  33. package/lib/src/ap-form/ap-form.vue.d.ts +13 -34
  34. package/lib/src/ap-form/ap-form.vue2.js +1 -1
  35. package/lib/src/ap-form/drawer-form/index.vue.d.ts +22 -40
  36. package/lib/src/ap-form/drawer-form/index.vue.js +1 -1
  37. package/lib/src/ap-form/index.d.ts +3 -1
  38. package/lib/src/ap-form/index.js +1 -1
  39. package/lib/src/ap-form/interface.d.ts +3 -1
  40. package/lib/src/ap-form/modal-form/index.vue.d.ts +23 -41
  41. package/lib/src/ap-form/modal-form/index.vue.js +1 -1
  42. package/lib/src/ap-form/provider/context.d.ts +3 -0
  43. package/lib/src/ap-form/provider/context.js +1 -0
  44. package/lib/src/ap-form/provider/index.vue.d.ts +19 -0
  45. package/lib/src/ap-form/provider/index.vue.js +1 -0
  46. package/lib/src/ap-form/provider/index.vue2.js +1 -0
  47. package/lib/src/ap-form/provider/interface.d.ts +22 -0
  48. package/lib/src/ap-form/search-form/index.vue.d.ts +22 -40
  49. package/lib/src/business/ap-select-layout/select-layout.vue2.js +1 -1
  50. package/lib/src/business/ap-table-modal/interface.d.ts +2 -0
  51. package/lib/src/business/ap-table-modal/table-modal.vue2.js +1 -1
  52. package/lib/src/config-provider/config-provider-props.d.ts +0 -2
  53. package/lib/src/config-provider/config-provider-props.js +1 -1
  54. package/lib/src/config-provider/config-provider.d.ts +0 -6
  55. package/lib/src/config-provider/config-provider.js +1 -1
  56. package/lib/src/config-provider/constants.d.ts +2 -0
  57. package/lib/src/config-provider/constants.js +1 -1
  58. package/lib/src/config-provider/hooks/use-global-config.d.ts +0 -2
  59. package/lib/src/config-provider/index.d.ts +0 -12
  60. package/lib/src/config-provider/index.js +1 -1
  61. package/lib/src/index.js +1 -1
  62. package/lib/src/utils/slot.js +1 -1
  63. package/package.json +3 -3
@@ -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)
@@ -24,6 +24,8 @@ export interface ApTableModalProps<TableRowType = any> extends Omit<ModalProps,
24
24
  rowSelection?: TableProps['rowSelection'];
25
25
  /** 表格布局配置 */
26
26
  tableLayoutConfig?: TableLayoutConfig;
27
+ /** 渲染头部信息 */
28
+ renderHeader?: () => VNodeChild;
27
29
  }
28
30
  /** useCreateTableModal参数类型 */
29
31
  export interface UseCreateTableModalProps extends ApTableModalProps {
@@ -1,17 +1,17 @@
1
- import { defineComponent as F, ref as m, unref as s, computed as U, h as q, openBlock as $, createBlock as z, mergeProps as b, withCtx as k, createVNode as T } from "vue";
2
- import { message as h, Modal as H } from "@aplus-frontend/antdv";
1
+ import { defineComponent as U, ref as m, unref as s, computed as q, h as V, openBlock as k, createBlock as T, mergeProps as y, withCtx as h, resolveDynamicComponent as $, createCommentVNode as z, createVNode as S } from "vue";
2
+ import { message as B, Modal as W } from "@aplus-frontend/antdv";
3
3
  import "../../index.mjs";
4
- import { cloneDeep as V, omit as S } from "lodash-unified";
5
- import { transformTableParams as W } from "@aplus-frontend/utils";
4
+ import { cloneDeep as Y, omit as R } from "lodash-unified";
5
+ import { transformTableParams as J } from "@aplus-frontend/utils";
6
6
  import "./modal-title.vue.mjs";
7
- import { AsyncOpenResultError as x } from "./interface.mjs";
7
+ import { AsyncOpenResultError as b } from "./interface.mjs";
8
8
  import "./table-layout/index.vue.mjs";
9
- import { useGlobalConfig as Y } from "../../config-provider/hooks/use-global-config.mjs";
10
- import { useLocale as J } from "../../config-provider/hooks/use-locale.mjs";
11
- import Q from "./modal-title.vue2.mjs";
12
- import X from "./table-layout/index.vue2.mjs";
13
- import { ApTable as Z } from "../../ap-table/index.mjs";
14
- const fe = /* @__PURE__ */ F({
9
+ import { useGlobalConfig as Q } from "../../config-provider/hooks/use-global-config.mjs";
10
+ import { useLocale as X } from "../../config-provider/hooks/use-locale.mjs";
11
+ import Z from "./modal-title.vue2.mjs";
12
+ import j from "./table-layout/index.vue2.mjs";
13
+ import { ApTable as ee } from "../../ap-table/index.mjs";
14
+ const pe = /* @__PURE__ */ U({
15
15
  __name: "table-modal",
16
16
  props: {
17
17
  columns: {},
@@ -24,6 +24,7 @@ const fe = /* @__PURE__ */ F({
24
24
  disabledCheckbox: { type: [Boolean, Function] },
25
25
  rowSelection: {},
26
26
  tableLayoutConfig: {},
27
+ renderHeader: {},
27
28
  prefixCls: {},
28
29
  confirmLoading: { type: Boolean, default: void 0 },
29
30
  title: {},
@@ -61,12 +62,12 @@ const fe = /* @__PURE__ */ F({
61
62
  mousePosition: {}
62
63
  },
63
64
  emits: ["finish"],
64
- setup(B, { expose: R, emit: M }) {
65
- const e = B, P = M, i = m(!1), y = m({}), d = m(null), a = m([]), C = m();
65
+ setup(M, { expose: P, emit: K }) {
66
+ const e = M, _ = K, i = m(!1), x = m({}), d = m(null), a = m([]), C = m();
66
67
  let c = null, n = null;
67
- const K = Y("uiMode", "admin"), { t: g } = J(), _ = async (o = [], t = {}) => {
68
+ const I = Q("uiMode", "admin"), { t: g } = X(), D = async (o = [], t = {}) => {
68
69
  var l, r, u;
69
- switch (a.value = [...o], i.value = !0, y.value = t == null ? void 0 : t.extraParams, C.value = t.apTableDataSources || ((l = e.apTableProps) == null ? void 0 : l.dataSource), t.refreshMode || "reset") {
70
+ switch (a.value = [...o], i.value = !0, x.value = t == null ? void 0 : t.extraParams, C.value = t.apTableDataSources || ((l = e.apTableProps) == null ? void 0 : l.dataSource), t.refreshMode || "reset") {
70
71
  case "reset":
71
72
  (r = d.value) == null || r.reset();
72
73
  break;
@@ -80,31 +81,31 @@ const fe = /* @__PURE__ */ F({
80
81
  c = p, n = f;
81
82
  });
82
83
  }, w = () => {
83
- i.value = !1, c = null, n == null || n(x.ModalCancel), n = null;
84
- }, I = async (o) => {
85
- o = W({
84
+ i.value = !1, c = null, n == null || n(b.ModalCancel), n = null;
85
+ }, L = async (o) => {
86
+ o = J({
86
87
  ...o,
87
- ...y.value
88
+ ...x.value
88
89
  });
89
90
  const t = e.api, { records: l, total: r } = await t(o);
90
91
  return {
91
92
  data: l,
92
93
  total: r
93
94
  };
94
- }, L = () => {
95
+ }, N = () => {
95
96
  if (a.value.length > e.maxCount) {
96
- n == null || n(x.ExceedMaxCount);
97
+ n == null || n(b.ExceedMaxCount);
97
98
  return;
98
99
  }
99
100
  if (e.getRowKey) {
100
- const o = V(s(a)), t = o.map(e.getRowKey);
101
- P("finish", t, o), c == null || c({ keys: t, rows: o });
101
+ const o = Y(s(a)), t = o.map(e.getRowKey);
102
+ _("finish", t, o), c == null || c({ keys: t, rows: o });
102
103
  } else {
103
- n == null || n(x.NotFineGetRowKey);
104
+ n == null || n(b.NotFineGetRowKey);
104
105
  return;
105
106
  }
106
107
  i.value = !1;
107
- }, A = U(() => {
108
+ }, A = q(() => {
108
109
  if (!e.getRowKey) return;
109
110
  const o = e.getRowKey;
110
111
  return {
@@ -115,14 +116,14 @@ const fe = /* @__PURE__ */ F({
115
116
  onSelectAll(t, l) {
116
117
  var u, p;
117
118
  if (l.length > e.maxCount) {
118
- h.warning(
119
+ B.warning(
119
120
  g("ap.apTableModal.messageMaxCount", { maxCount: e.maxCount })
120
121
  );
121
122
  return;
122
123
  }
123
124
  const r = (u = d.value) == null ? void 0 : u.dataSource;
124
125
  if (t) {
125
- const f = s(r).filter((v) => !a.value.some((E) => o(E) === o(v)));
126
+ const f = s(r).filter((v) => !a.value.some((F) => o(F) === o(v)));
126
127
  a.value = a.value.concat(f);
127
128
  } else
128
129
  a.value = (p = a.value) == null ? void 0 : p.filter((f) => !r.some((v) => o(v) === o(f)));
@@ -130,7 +131,7 @@ const fe = /* @__PURE__ */ F({
130
131
  onSelect(t, l) {
131
132
  if (l) {
132
133
  if (a.value.length >= e.maxCount) {
133
- h.warning(
134
+ B.warning(
134
135
  g("ap.apTableModal.messageMaxCount", { maxCount: e.maxCount })
135
136
  );
136
137
  return;
@@ -149,8 +150,8 @@ const fe = /* @__PURE__ */ F({
149
150
  }),
150
151
  ...e.rowSelection || {}
151
152
  };
152
- }), D = () => e.isRenderModalTitleSuffix ? q(
153
- Q,
153
+ }), O = () => e.isRenderModalTitleSuffix ? V(
154
+ Z,
154
155
  {
155
156
  title: e.title,
156
157
  count: a.value.length || 0,
@@ -159,9 +160,9 @@ const fe = /* @__PURE__ */ F({
159
160
  {
160
161
  default: e.renderModalTitleSuffix ?? void 0
161
162
  }
162
- ) : e.title, N = () => d.value, O = () => {
163
+ ) : e.title, G = () => d.value, H = () => {
163
164
  a.value = [];
164
- }, G = (o) => {
165
+ }, E = (o) => {
165
166
  const t = e.getRowKey;
166
167
  if (!t) return;
167
168
  const l = a.value.findIndex(
@@ -169,16 +170,16 @@ const fe = /* @__PURE__ */ F({
169
170
  );
170
171
  a.value.splice(l, 1);
171
172
  };
172
- return R({
173
- open: _,
173
+ return P({
174
+ open: D,
174
175
  close: w,
175
- getApTableInstance: N
176
- }), (o, t) => ($(), z(s(H), b(
176
+ getApTableInstance: G
177
+ }), (o, t) => (k(), T(s(W), y(
177
178
  {
178
179
  open: i.value,
179
180
  "onUpdate:open": t[0] || (t[0] = (l) => i.value = l)
180
181
  },
181
- s(S)(e, [
182
+ s(R)(e, [
182
183
  "api",
183
184
  "getRowKey",
184
185
  "centered",
@@ -193,30 +194,31 @@ const fe = /* @__PURE__ */ F({
193
194
  "tableLayoutConfig"
194
195
  ]),
195
196
  {
196
- title: D(),
197
+ title: O(),
197
198
  "body-style": { maxHeight: "calc(100vh - 205px)", overflowY: "scroll" },
198
199
  centered: e.centered ?? !0,
199
- onOk: L,
200
+ onOk: N,
200
201
  onCancel: w
201
202
  }
202
203
  ), {
203
- default: k(() => [
204
- T(X, b(e.tableLayoutConfig || {}, {
204
+ default: h(() => [
205
+ e.renderHeader ? (k(), T($(e.renderHeader), { key: 0 })) : z("", !0),
206
+ S(j, y(e.tableLayoutConfig || {}, {
205
207
  "selected-list": a.value,
206
- onClear: O,
207
- onDeleteItem: G
208
+ onClear: H,
209
+ onDeleteItem: E
208
210
  }), {
209
- default: k(() => [
210
- T(s(Z), b(s(S)(e.apTableProps, "dataSource"), {
211
+ default: h(() => [
212
+ S(s(ee), y(s(R)(e.apTableProps, "dataSource"), {
211
213
  ref_key: "apTableRef",
212
214
  ref: d,
213
215
  scroll: { y: "100%" },
214
216
  style: { padding: "0px" },
215
217
  columns: o.columns,
216
- request: I,
218
+ request: L,
217
219
  "row-key": o.getRowKey,
218
220
  "row-selection": A.value,
219
- bordered: s(K) === "admin",
221
+ bordered: s(I) === "admin",
220
222
  "data-source": C.value
221
223
  }), null, 16, ["columns", "row-key", "row-selection", "bordered", "data-source"])
222
224
  ]),
@@ -228,5 +230,5 @@ const fe = /* @__PURE__ */ F({
228
230
  }
229
231
  });
230
232
  export {
231
- fe as default
233
+ pe as default
232
234
  };
@@ -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>;
@@ -136,7 +136,6 @@ export declare const APConfigProvider: {
136
136
  };
137
137
  namespace: {
138
138
  type: StringConstructor;
139
- default: string;
140
139
  };
141
140
  api: {
142
141
  type: PropType<ApiType>;
@@ -144,7 +143,6 @@ export declare const APConfigProvider: {
144
143
  };
145
144
  uiMode: {
146
145
  type: PropType<"aplus" | "admin">;
147
- default: string;
148
146
  };
149
147
  apUpload: {
150
148
  type: PropType<ApUploadConfig>;
@@ -303,9 +301,7 @@ export declare const APConfigProvider: {
303
301
  wave: {
304
302
  disabled?: boolean;
305
303
  };
306
- namespace: string;
307
304
  api: ApiType;
308
- uiMode: "aplus" | "admin";
309
305
  apUpload: ApUploadConfig;
310
306
  apDescriptions: ApDescriptionsConfig;
311
307
  valueTypeMap: Record<string, ValueTypeRenderConfig>;
@@ -538,7 +534,6 @@ export declare const APConfigProvider: {
538
534
  };
539
535
  namespace: {
540
536
  type: StringConstructor;
541
- default: string;
542
537
  };
543
538
  api: {
544
539
  type: PropType<ApiType>;
@@ -546,7 +541,6 @@ export declare const APConfigProvider: {
546
541
  };
547
542
  uiMode: {
548
543
  type: PropType<"aplus" | "admin">;
549
- default: string;
550
544
  };
551
545
  apUpload: {
552
546
  type: PropType<ApUploadConfig>;
@@ -705,9 +699,7 @@ export declare const APConfigProvider: {
705
699
  wave: {
706
700
  disabled?: boolean;
707
701
  };
708
- namespace: string;
709
702
  api: ApiType;
710
- uiMode: "aplus" | "admin";
711
703
  apUpload: ApUploadConfig;
712
704
  apDescriptions: ApDescriptionsConfig;
713
705
  valueTypeMap: Record<string, ValueTypeRenderConfig>;
@@ -937,7 +929,6 @@ export declare const APConfigProvider: {
937
929
  };
938
930
  namespace: {
939
931
  type: StringConstructor;
940
- default: string;
941
932
  };
942
933
  api: {
943
934
  type: PropType<ApiType>;
@@ -945,7 +936,6 @@ export declare const APConfigProvider: {
945
936
  };
946
937
  uiMode: {
947
938
  type: PropType<"aplus" | "admin">;
948
- default: string;
949
939
  };
950
940
  apUpload: {
951
941
  type: PropType<ApUploadConfig>;
@@ -1003,9 +993,7 @@ export declare const APConfigProvider: {
1003
993
  wave: {
1004
994
  disabled?: boolean;
1005
995
  };
1006
- namespace: string;
1007
996
  api: ApiType;
1008
- uiMode: "aplus" | "admin";
1009
997
  apUpload: ApUploadConfig;
1010
998
  apDescriptions: ApDescriptionsConfig;
1011
999
  valueTypeMap: Record<string, ValueTypeRenderConfig>;