@aplus-frontend/ui 0.5.0-beta.1 → 0.5.0

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 (68) hide show
  1. package/es/src/ap-action/item-popconfirm/index.vue.d.ts +13 -0
  2. package/es/src/ap-form/hooks/use-watch.d.ts +4 -1
  3. package/es/src/ap-form/hooks/use-watch.mjs +31 -29
  4. package/es/src/ap-form/index.mjs +1 -1
  5. package/es/src/ap-form/search-form/index.vue.mjs +14 -15
  6. package/es/src/ap-grid/constants.d.ts +4 -4
  7. package/es/src/ap-grid/constants.mjs +8 -8
  8. package/es/src/ap-grid/index.vue.mjs +228 -188
  9. package/es/src/ap-grid/interface.d.ts +0 -1
  10. package/es/src/ap-grid/utils/table.mjs +12 -12
  11. package/es/src/ap-modal/enums/modalMessage.d.ts +6 -0
  12. package/es/src/ap-modal/enums/modalMessage.mjs +4 -0
  13. package/es/src/ap-modal/index.d.ts +2 -1
  14. package/es/src/ap-modal/index.mjs +2 -0
  15. package/es/src/ap-modal/interface.d.ts +126 -1
  16. package/es/src/ap-modal/utils/createModalStream.d.ts +2 -0
  17. package/es/src/ap-modal/utils/createModalStream.mjs +99 -0
  18. package/es/src/ap-modal/utils/index.d.ts +1 -0
  19. package/es/src/ap-modal/utils/index.mjs +4 -2
  20. package/es/src/ap-table/components/dynamic-component/index.vue2.mjs +4 -7
  21. package/es/src/ap-table/utils.d.ts +1 -4
  22. package/es/src/ap-table/utils.mjs +43 -41
  23. package/es/src/business/ap-attachment/ApAttachment.mjs +13 -13
  24. package/es/src/business/ap-batch-action-group/MenuItemGroup.vue2.mjs +13 -13
  25. package/es/src/business/ap-ladder/ApLadder.vue.d.ts +13 -0
  26. package/es/src/business/ap-ladder/index.d.ts +39 -0
  27. package/es/src/business/ap-summary/ap-summary.vue2.mjs +36 -38
  28. package/es/src/business/ap-table-modal/index.d.ts +3 -3
  29. package/es/src/business/ap-table-modal/table-modal.vue.d.ts +1 -1
  30. package/es/src/config-provider/config-provider.mjs +23 -23
  31. package/es/src/utils/config-provider-preset.d.ts +41 -0
  32. package/es/src/utils/config-provider-preset.mjs +24 -15
  33. package/lib/src/ap-action/item-popconfirm/index.vue.d.ts +13 -0
  34. package/lib/src/ap-form/hooks/use-watch.d.ts +4 -1
  35. package/lib/src/ap-form/hooks/use-watch.js +1 -1
  36. package/lib/src/ap-form/index.js +1 -1
  37. package/lib/src/ap-form/search-form/index.vue.js +1 -1
  38. package/lib/src/ap-grid/constants.d.ts +4 -4
  39. package/lib/src/ap-grid/constants.js +1 -1
  40. package/lib/src/ap-grid/index.vue.js +1 -1
  41. package/lib/src/ap-grid/interface.d.ts +0 -1
  42. package/lib/src/ap-grid/utils/table.js +1 -1
  43. package/lib/src/ap-modal/enums/modalMessage.d.ts +6 -0
  44. package/lib/src/ap-modal/enums/modalMessage.js +1 -0
  45. package/lib/src/ap-modal/index.d.ts +2 -1
  46. package/lib/src/ap-modal/index.js +1 -1
  47. package/lib/src/ap-modal/interface.d.ts +126 -1
  48. package/lib/src/ap-modal/utils/createModalStream.d.ts +2 -0
  49. package/lib/src/ap-modal/utils/createModalStream.js +1 -0
  50. package/lib/src/ap-modal/utils/index.d.ts +1 -0
  51. package/lib/src/ap-modal/utils/index.js +1 -1
  52. package/lib/src/ap-table/components/dynamic-component/index.vue2.js +1 -1
  53. package/lib/src/ap-table/utils.d.ts +1 -4
  54. package/lib/src/ap-table/utils.js +1 -1
  55. package/lib/src/business/ap-attachment/ApAttachment.js +1 -1
  56. package/lib/src/business/ap-batch-action-group/MenuItemGroup.vue2.js +1 -1
  57. package/lib/src/business/ap-ladder/ApLadder.vue.d.ts +13 -0
  58. package/lib/src/business/ap-ladder/index.d.ts +39 -0
  59. package/lib/src/business/ap-summary/ap-summary.vue2.js +1 -1
  60. package/lib/src/business/ap-table-modal/index.d.ts +3 -3
  61. package/lib/src/business/ap-table-modal/table-modal.vue.d.ts +1 -1
  62. package/lib/src/config-provider/config-provider.js +1 -1
  63. package/lib/src/utils/config-provider-preset.d.ts +41 -0
  64. package/lib/src/utils/config-provider-preset.js +1 -1
  65. package/package.json +6 -6
  66. package/theme/ap-grid/index.css +32 -0
  67. package/theme/ap-grid/index.less +42 -0
  68. package/theme/index.css +32 -0
@@ -316,6 +316,19 @@ declare const __VLS_component: DefineComponent<ApActionItemPopconfirmProps, {},
316
316
  'onUpdate:visible': PropType<(vis: boolean) => void>;
317
317
  onOpenChange: PropType<(vis: boolean) => void>;
318
318
  'onUpdate:open': PropType<(vis: boolean) => void>;
319
+ mask: {
320
+ type: BooleanConstructor;
321
+ default: boolean;
322
+ };
323
+ maskStyle: {
324
+ type: PropType<CSSProperties>;
325
+ default: CSSProperties;
326
+ };
327
+ maskTransitionName: StringConstructor;
328
+ maskClosable: {
329
+ type: BooleanConstructor;
330
+ default: boolean;
331
+ };
319
332
  }>>;
320
333
  }, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
321
334
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
@@ -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
- declare const useWatch: <ValueType = any, StoreType = any>(name: NamePath | Ref<NamePath>, form?: Ref<ApFormIns<StoreType> | undefined>) => Ref<ValueType | undefined, ValueType | undefined>;
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 V } from "../context.mjs";
2
- import { ref as N, watchEffect as A, unref as l, watch as M } from "vue";
3
- import { isArray as R } from "lodash-unified";
4
- import { INTERNAL_FORM_INSTANCE_MARK as y } from "../constant.mjs";
5
- function w(t, e) {
6
- return R(e) ? e.reduce((n, u) => n == null ? void 0 : n[u], t) : t == null ? void 0 : t[e];
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 I(t) {
8
+ function V(e) {
9
9
  try {
10
- return JSON.stringify(t);
10
+ return JSON.stringify(e);
11
11
  } catch {
12
12
  return Math.random();
13
13
  }
14
14
  }
15
- const F = (t, e) => {
16
- const { internalInstance: n, model: u } = V(), i = N();
17
- let a = "", o = !0;
18
- return A((s) => {
19
- var f;
20
- const r = ((f = e == null ? void 0 : e.value) == null ? void 0 : f.getInternalInstance(y)) || n;
21
- if (!r) {
22
- o = !1;
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 = r.registerWatch((S) => {
26
- const g = w(S, l(t)), h = I(g);
27
- h !== a && (i.value = g, a = h);
28
- }, o);
29
- s(c);
30
- }), M(
31
- () => l(t),
32
- (s) => {
33
- const r = w(l(u), s), c = I(r);
34
- c !== a && (i.value = r, a = 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
- ), i;
37
- };
37
+ ), r;
38
+ }
38
39
  export {
39
- F as default
40
+ W as default,
41
+ W as useWatch
40
42
  };
@@ -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 ce, ref as ue, 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";
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 c = ce(), n = h, G = H, {
112
- value: u,
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 = ue();
121
+ } = Ae(), g = ce();
122
122
  function X() {
123
- J(!o(u));
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(c.default())), d = M((I = c.extra) == null ? void 0 : I.call(c)), k = S(() => Math.floor(r / n.countPerRow));
135
- D(() => c.default(), (e) => {
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 = c.extra) == null ? void 0 : e.call(c);
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(u) && V > 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(u) && t.lastRowOnlyIncludeActionAndExtra && !(o(d) && n.extraInAction) ? "flex-end" : "space-between"
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(u) ? 90 : -90
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(u) ? t.actualExtraSpan : t.defaultExtraSpan,
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(u) && (t.defaultExtraSpan === r || t.lastRowOnlyIncludeActionAndExtra) ? "start" : "flex-end"
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(u) && t.lastRowOnlyIncludeActionAndExtra ? a(F, null, [l || i, s]) : a(F, null, [s, l]);
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))
@@ -1,9 +1,9 @@
1
1
  export declare const sizeMap: {
2
- readonly mini: undefined;
2
+ readonly mini: "small";
3
3
  readonly small: "small";
4
- readonly medium: "middle";
4
+ readonly medium: "small";
5
5
  };
6
6
  export declare const sizeReverseMap: {
7
- readonly small: "small";
8
- readonly middle: "medium";
7
+ readonly small: "medium";
8
+ readonly middle: undefined;
9
9
  };
@@ -1,12 +1,12 @@
1
- const m = {
2
- mini: void 0,
1
+ const l = {
2
+ mini: "small",
3
3
  small: "small",
4
- medium: "middle"
5
- }, e = {
6
- small: "small",
7
- middle: "medium"
4
+ medium: "small"
5
+ }, m = {
6
+ small: "medium",
7
+ middle: void 0
8
8
  };
9
9
  export {
10
- m as sizeMap,
11
- e as sizeReverseMap
10
+ l as sizeMap,
11
+ m as sizeReverseMap
12
12
  };