@aplus-frontend/ui 0.5.11 → 0.5.13

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 (81) hide show
  1. package/es/index.mjs +16 -12
  2. package/es/src/ap-descriptions/ap-descriptions.vue.mjs +35 -32
  3. package/es/src/ap-descriptions/formatter/index.mjs +31 -31
  4. package/es/src/ap-modal/index.d.ts +9 -2
  5. package/es/src/ap-modal/index.mjs +23 -8
  6. package/es/src/ap-modal/interface.d.ts +2 -1
  7. package/es/src/ap-modal/utils/createModal.mjs +43 -40
  8. package/es/src/ap-modal/utils/index.d.ts +1 -0
  9. package/es/src/ap-modal/utils/index.mjs +6 -4
  10. package/es/src/ap-modal/utils/methods.d.ts +3 -0
  11. package/es/src/ap-modal/utils/methods.mjs +34 -0
  12. package/es/src/ap-modal/utils/util.d.ts +1 -0
  13. package/es/src/ap-modal/utils/util.mjs +4 -0
  14. package/es/src/business/ap-ladder/ApLadder.vue.d.ts +2 -2
  15. package/es/src/business/ap-ladder/index.d.ts +6 -6
  16. package/es/src/config-provider/config-provider.d.ts +11 -0
  17. package/es/src/config-provider/css-var.d.ts +11 -0
  18. package/es/src/config-provider/css-var.mjs +35 -13
  19. package/es/src/config-provider/index.d.ts +55 -0
  20. package/es/src/index.d.ts +1 -0
  21. package/es/src/index.mjs +258 -253
  22. package/es/src/text/context.d.ts +10 -0
  23. package/es/src/text/context.mjs +17 -0
  24. package/es/src/text/group.vue.d.ts +28 -0
  25. package/es/src/text/group.vue.mjs +37 -0
  26. package/es/src/text/group.vue2.mjs +4 -0
  27. package/es/src/text/index.d.ts +4 -0
  28. package/es/src/text/index.mjs +3 -0
  29. package/es/src/text/index.vue.d.ts +34 -0
  30. package/es/src/text/index.vue.mjs +118 -0
  31. package/es/src/text/index.vue2.mjs +4 -0
  32. package/es/src/text/interface.d.ts +47 -0
  33. package/es/src/text/interface.mjs +1 -0
  34. package/es/src/utils/config-provider-preset.mjs +21 -17
  35. package/es/src/utils/index.d.ts +1 -0
  36. package/es/src/utils/index.mjs +25 -21
  37. package/lib/index.js +1 -1
  38. package/lib/src/ap-descriptions/ap-descriptions.vue.js +1 -1
  39. package/lib/src/ap-descriptions/formatter/index.js +1 -1
  40. package/lib/src/ap-modal/index.d.ts +9 -2
  41. package/lib/src/ap-modal/index.js +1 -1
  42. package/lib/src/ap-modal/interface.d.ts +2 -1
  43. package/lib/src/ap-modal/utils/createModal.js +1 -1
  44. package/lib/src/ap-modal/utils/index.d.ts +1 -0
  45. package/lib/src/ap-modal/utils/index.js +1 -1
  46. package/lib/src/ap-modal/utils/methods.d.ts +3 -0
  47. package/lib/src/ap-modal/utils/methods.js +1 -0
  48. package/lib/src/ap-modal/utils/util.d.ts +1 -0
  49. package/lib/src/ap-modal/utils/util.js +1 -0
  50. package/lib/src/business/ap-ladder/ApLadder.vue.d.ts +2 -2
  51. package/lib/src/business/ap-ladder/index.d.ts +6 -6
  52. package/lib/src/config-provider/config-provider.d.ts +11 -0
  53. package/lib/src/config-provider/css-var.d.ts +11 -0
  54. package/lib/src/config-provider/css-var.js +1 -1
  55. package/lib/src/config-provider/index.d.ts +55 -0
  56. package/lib/src/index.d.ts +1 -0
  57. package/lib/src/index.js +1 -1
  58. package/lib/src/text/context.d.ts +10 -0
  59. package/lib/src/text/context.js +1 -0
  60. package/lib/src/text/group.vue.d.ts +28 -0
  61. package/lib/src/text/group.vue.js +1 -0
  62. package/lib/src/text/group.vue2.js +1 -0
  63. package/lib/src/text/index.d.ts +4 -0
  64. package/lib/src/text/index.js +1 -0
  65. package/lib/src/text/index.vue.d.ts +34 -0
  66. package/lib/src/text/index.vue.js +1 -0
  67. package/lib/src/text/index.vue2.js +1 -0
  68. package/lib/src/text/interface.d.ts +47 -0
  69. package/lib/src/text/interface.js +1 -0
  70. package/lib/src/utils/config-provider-preset.js +1 -1
  71. package/lib/src/utils/index.d.ts +1 -0
  72. package/lib/src/utils/index.js +1 -1
  73. package/package.json +1 -1
  74. package/theme/ap-descriptions/ap-descriptions.css +3 -0
  75. package/theme/ap-descriptions/ap-descriptions.less +4 -0
  76. package/theme/index.css +61 -0
  77. package/theme/index.less +2 -0
  78. package/theme/text/group.css +14 -0
  79. package/theme/text/group.less +19 -0
  80. package/theme/text/index.css +44 -0
  81. package/theme/text/index.less +49 -0
package/es/index.mjs CHANGED
@@ -117,12 +117,14 @@ import { default as Ut } from "./src/resize-observer/index.vue.mjs";
117
117
  import { default as Vt } from "./src/ap-grid/index.vue.mjs";
118
118
  import { default as _t } from "./src/ap-grid/editable/index.vue.mjs";
119
119
  import { default as $t } from "./src/ap-grid/editable/form-item.vue.mjs";
120
- import { useMessage as qt } from "./src/hooks/useMessage.mjs";
121
- import { useControllableValue as Qt } from "./src/hooks/useControllableValue.mjs";
122
- import { useManualRef as Yt } from "./src/hooks/useManualRef.mjs";
123
- import { useThrottleRef as ep } from "./src/hooks/useThrottleRef.mjs";
124
- import { useFullScreen as rp } from "./src/hooks/useFullScreen.mjs";
125
- import { useResize as pp } from "./src/hooks/useResize.mjs";
120
+ import { default as qt } from "./src/text/index.vue.mjs";
121
+ import { default as Qt } from "./src/text/group.vue.mjs";
122
+ import { useMessage as Yt } from "./src/hooks/useMessage.mjs";
123
+ import { useControllableValue as ep } from "./src/hooks/useControllableValue.mjs";
124
+ import { useManualRef as rp } from "./src/hooks/useManualRef.mjs";
125
+ import { useThrottleRef as pp } from "./src/hooks/useThrottleRef.mjs";
126
+ import { useFullScreen as fp } from "./src/hooks/useFullScreen.mjs";
127
+ import { useResize as lp } from "./src/hooks/useResize.mjs";
126
128
  const a = {
127
129
  install: (r) => {
128
130
  for (const t in o) {
@@ -213,6 +215,8 @@ export {
213
215
  Zo as ApTableModal,
214
216
  So as ApTag,
215
217
  go as ApTagGroup,
218
+ qt as ApText,
219
+ Qt as ApTextGroup,
216
220
  zr as ApTitle,
217
221
  Xo as ApTransformDataHelper,
218
222
  Ro as ApUpload,
@@ -261,20 +265,20 @@ export {
261
265
  l as pathMap,
262
266
  F as provideGlobalConfig,
263
267
  g as translate,
264
- Qt as useControllableValue,
265
- rp as useFullScreen,
268
+ ep as useControllableValue,
269
+ fp as useFullScreen,
266
270
  E as useGetDerivedNamespace,
267
271
  I as useGlobalConfig,
268
272
  D as useLocale,
269
- Yt as useManualRef,
270
- qt as useMessage,
273
+ rp as useManualRef,
274
+ Yt as useMessage,
271
275
  R as useNamespace,
272
276
  jr as usePageListApGrid,
273
277
  Wr as usePageListApTable,
274
- pp as useResize,
278
+ lp as useResize,
275
279
  or as useTableModal,
276
280
  It as useTablePaging,
277
281
  Hr as useTableRefresh,
278
282
  tr as useTableSelectModal,
279
- ep as useThrottleRef
283
+ pp as useThrottleRef
280
284
  };
@@ -1,13 +1,13 @@
1
- import { defineComponent as T, createElementBlock as i, openBlock as l, normalizeStyle as _, normalizeClass as d, unref as o, createVNode as w, mergeProps as E, withCtx as b, Fragment as p, renderList as M, createBlock as c, createCommentVNode as j, h as u, renderSlot as x, resolveDynamicComponent as z } from "vue";
2
- import { Descriptions as A, DescriptionsItem as m } from "@aplus-frontend/antdv";
3
- import { mixinsAttachmentExtraProps as F, transformValue as G, isEmptyWithType as L } from "./helper.mjs";
1
+ import { defineComponent as B, createElementBlock as i, openBlock as r, normalizeStyle as E, normalizeClass as d, unref as l, createVNode as _, mergeProps as w, withCtx as b, Fragment as p, renderList as M, createBlock as c, createCommentVNode as j, h as u, renderSlot as z, resolveDynamicComponent as A } from "vue";
2
+ import { Descriptions as F, DescriptionsItem as m } from "@aplus-frontend/antdv";
3
+ import { mixinsAttachmentExtraProps as G, transformValue as L, isEmptyWithType as R } from "./helper.mjs";
4
4
  import { get as S } from "lodash-unified";
5
5
  import "./help-message/index.vue.mjs";
6
6
  import "../config-provider/index.mjs";
7
7
  import { useGlobalConfig as f } from "../config-provider/hooks/use-global-config.mjs";
8
- import { useNamespace as R } from "../config-provider/hooks/use-namespace.mjs";
9
- import $ from "./help-message/index.vue2.mjs";
10
- const I = { key: 0 }, Y = /* @__PURE__ */ T({
8
+ import { useNamespace as $ } from "../config-provider/hooks/use-namespace.mjs";
9
+ import I from "./help-message/index.vue2.mjs";
10
+ const O = { key: 0 }, Z = /* @__PURE__ */ B({
11
11
  __name: "ap-descriptions",
12
12
  props: {
13
13
  descriptionsProps: {},
@@ -17,25 +17,28 @@ const I = { key: 0 }, Y = /* @__PURE__ */ T({
17
17
  className: {}
18
18
  },
19
19
  setup(g) {
20
- const n = g, v = f("uiMode", "admin"), C = f("apDescriptions"), k = f("downloadCenterTriggerConfig"), { m: P, b: N, be: D } = R("ap-descriptions"), V = (e = {}) => {
21
- var r;
22
- let s = "";
23
- return ((r = n.descriptionsProps) == null ? void 0 : r.layout) === "vertical" && (s = "start"), {
24
- justifyContent: s,
20
+ const n = g, v = f("uiMode", "admin"), C = f("apDescriptions"), k = f("downloadCenterTriggerConfig"), { m: P, b: N, be: D } = $("ap-descriptions"), T = (e = {}) => {
21
+ var s;
22
+ let o = "";
23
+ return ((s = n.descriptionsProps) == null ? void 0 : s.layout) === "vertical" && (o = "start"), {
24
+ justifyContent: o,
25
25
  ...e
26
26
  };
27
27
  }, y = (e) => {
28
28
  var t, a;
29
- const s = S(n.dataSource, e.field);
29
+ const o = S(n.dataSource, e.field);
30
30
  if (e.customRender)
31
31
  return e.customRender(n.dataSource);
32
- e.valueType === "attachment" && (e.extraProps = F(e.extraProps, {
32
+ e.valueType === "attachment" && (e.extraProps = G(e.extraProps, {
33
33
  fromConfig: (t = C.value) == null ? void 0 : t.downloadFile,
34
34
  fromGlobal: (a = k.value) == null ? void 0 : a.trigger
35
35
  }));
36
- const r = e.format ? e.format(s, n.dataSource || {}) : s;
37
- return G({ value: r, record: n.dataSource }, e);
38
- }, B = (e) => {
36
+ const s = e.format ? e.format(o, n.dataSource || {}) : o;
37
+ return L({ value: s, record: n.dataSource }, e);
38
+ }, V = (e) => {
39
+ var o;
40
+ return e.valueType === "text" && !!((o = e.extraProps) != null && o.ellipsis);
41
+ }, x = (e) => {
39
42
  if (e.visible != null) {
40
43
  if (typeof e.visible == "boolean")
41
44
  return e.visible;
@@ -47,29 +50,29 @@ const I = { key: 0 }, Y = /* @__PURE__ */ T({
47
50
  }
48
51
  return !0;
49
52
  };
50
- return (e, s) => {
51
- var r;
52
- return l(), i("div", {
53
- class: d([e.className, o(N)(), o(P)(o(v))]),
54
- style: _(e.style)
53
+ return (e, o) => {
54
+ var s;
55
+ return r(), i("div", {
56
+ class: d([e.className, l(N)(), l(P)(l(v))]),
57
+ style: E(e.style)
55
58
  }, [
56
- w(o(A), E(e.descriptionsProps, {
57
- "label-style": V({ ...((r = e.descriptionsProps) == null ? void 0 : r.labelStyle) || {} })
59
+ _(l(F), w(e.descriptionsProps, {
60
+ "label-style": T({ ...((s = e.descriptionsProps) == null ? void 0 : s.labelStyle) || {} })
58
61
  }), {
59
62
  default: b(() => [
60
- (l(!0), i(p, null, M(e.schemas, (t, a) => (l(), i(p, {
63
+ (r(!0), i(p, null, M(e.schemas, (t, a) => (r(), i(p, {
61
64
  key: t.field || "empty" + a
62
65
  }, [
63
- t.valueType === "empty" ? (l(), c(o(m), {
66
+ t.valueType === "empty" ? (r(), c(l(m), {
64
67
  key: 0,
65
68
  "content-style": t.contentStyle,
66
69
  "label-style": t.labelStyle,
67
70
  span: t.span
68
- }, null, 8, ["content-style", "label-style", "span"])) : B(t) ? (l(), c(o(m), {
71
+ }, null, 8, ["content-style", "label-style", "span"])) : x(t) ? (r(), c(l(m), {
69
72
  key: 1,
70
- class: d(o(D)("item", "ellipsis")),
73
+ class: d(V(t) ? l(D)("item", "ellipsis") : ""),
71
74
  label: t.label ? u(p, [
72
- u($, {
75
+ u(I, {
73
76
  helpMessage: t.helpMessage,
74
77
  label: t.label
75
78
  })
@@ -79,13 +82,13 @@ const I = { key: 0 }, Y = /* @__PURE__ */ T({
79
82
  "label-style": t.labelStyle
80
83
  }, {
81
84
  default: b(() => [
82
- o(L)(o(S)(e.dataSource, t.field), t) ? (l(), i("span", I, "--")) : (l(), i(p, { key: 1 }, [
83
- t.contentSlotName ? x(e.$slots, t.contentSlotName, {
85
+ l(R)(l(S)(e.dataSource, t.field), t) ? (r(), i("span", O, "--")) : (r(), i(p, { key: 1 }, [
86
+ t.contentSlotName ? z(e.$slots, t.contentSlotName, {
84
87
  key: 0,
85
88
  index: a,
86
89
  item: y(t),
87
90
  record: e.dataSource
88
- }) : (l(), c(z(
91
+ }) : (r(), c(A(
89
92
  u(p, [
90
93
  t.prefix,
91
94
  y(t),
@@ -105,5 +108,5 @@ const I = { key: 0 }, Y = /* @__PURE__ */ T({
105
108
  }
106
109
  });
107
110
  export {
108
- Y as default
111
+ Z as default
109
112
  };
@@ -1,13 +1,13 @@
1
- import { createVNode as p } from "vue";
1
+ import { createVNode as f } from "vue";
2
2
  import { getTimeFormatToZone as g } from "@aplus-frontend/utils";
3
- import { isBoolean as h, merge as f, get as l, debounce as Y } from "lodash-unified";
3
+ import { isBoolean as h, merge as p, get as l, debounce as Y } from "lodash-unified";
4
4
  import { formatString as A } from "./utils.mjs";
5
5
  import { toDecimalMark as b } from "@fruits-chain/utils";
6
6
  import { TypographyParagraph as M } from "@aplus-frontend/antdv";
7
7
  function S({
8
8
  value: t
9
9
  }, n) {
10
- if (!n)
10
+ if (!(n != null && n.ellipsis))
11
11
  return t;
12
12
  const r = {
13
13
  ...n,
@@ -20,7 +20,7 @@ function S({
20
20
  tooltip: t
21
21
  } : !1
22
22
  };
23
- return p(M, r, null);
23
+ return f(M, r, null);
24
24
  }
25
25
  function D({
26
26
  value: t
@@ -28,7 +28,7 @@ function D({
28
28
  var o;
29
29
  const {
30
30
  joinSymbol: r
31
- } = f({
31
+ } = p({
32
32
  joinSymbol: " "
33
33
  }, n);
34
34
  return (o = t == null ? void 0 : t.join) == null ? void 0 : o.call(t, r);
@@ -39,7 +39,7 @@ function u({
39
39
  const {
40
40
  zoneAlias: r,
41
41
  format: o
42
- } = f({
42
+ } = p({
43
43
  zoneAlias: "LA",
44
44
  format: "YYYY-MM-DD HH:mm:ss"
45
45
  }, n);
@@ -51,13 +51,13 @@ function y({
51
51
  }, r) {
52
52
  const {
53
53
  fieldList: o,
54
- templateString: e = "{0}",
55
- formatter: i
56
- } = r, s = (o == null ? void 0 : o.map((m, c) => {
57
- const a = l(n, m);
58
- return i ? i(a, c) : a;
54
+ templateString: i = "{0}",
55
+ formatter: e
56
+ } = r, s = (o == null ? void 0 : o.map((m, a) => {
57
+ const c = l(n, m);
58
+ return e ? e(c, a) : c;
59
59
  })) || [];
60
- return s.length === 0 && s.push(t), A(e, s);
60
+ return s.length === 0 && s.push(t), A(i, s);
61
61
  }
62
62
  function j({
63
63
  value: t,
@@ -65,22 +65,22 @@ function j({
65
65
  }, r) {
66
66
  const {
67
67
  fieldList: o,
68
- format: e = "YYYY-MM-DD HH:mm:ss",
69
- joinSymbol: i = "~",
68
+ format: i = "YYYY-MM-DD HH:mm:ss",
69
+ joinSymbol: e = "~",
70
70
  zoneAlias: s = "LA"
71
- } = r, m = Array.isArray(e) ? e : [e, e];
71
+ } = r, m = Array.isArray(i) ? i : [i, i];
72
72
  return y({
73
73
  value: t,
74
74
  record: n
75
75
  }, {
76
76
  fieldList: o,
77
- templateString: `{0} ${i} {1}`,
78
- formatter(c, a) {
77
+ templateString: `{0} ${e} {1}`,
78
+ formatter(a, c) {
79
79
  return u({
80
- value: c,
80
+ value: a,
81
81
  record: n
82
82
  }, {
83
- format: m[a],
83
+ format: m[c],
84
84
  zoneAlias: s
85
85
  });
86
86
  }
@@ -92,16 +92,16 @@ function k({
92
92
  const {
93
93
  urlPath: r = "url",
94
94
  namePath: o = "name",
95
- style: e,
96
- downloadFile: i,
95
+ style: i,
96
+ downloadFile: e,
97
97
  className: s
98
- } = n, m = l(t, o), c = l(t, r), a = Y(() => {
99
- i == null || i(c, m);
98
+ } = n, m = l(t, o), a = l(t, r), c = Y(() => {
99
+ e == null || e(a, m);
100
100
  }, 500);
101
- return p("span", {
102
- style: e,
101
+ return f("span", {
102
+ style: i,
103
103
  class: [s, "ap-descriptions-item-content__link "],
104
- onClick: a
104
+ onClick: c
105
105
  }, [m]);
106
106
  }
107
107
  function H({
@@ -111,16 +111,16 @@ function H({
111
111
  style: r = {},
112
112
  precision: o
113
113
  } = n;
114
- let e = "";
114
+ let i = "";
115
115
  try {
116
- e = b(t, o);
116
+ i = b(t, o);
117
117
  } catch {
118
- e = t;
118
+ i = t;
119
119
  }
120
- return p("span", {
120
+ return f("span", {
121
121
  style: r,
122
122
  class: "ap-descriptions-item-content__number"
123
- }, [e]);
123
+ }, [i]);
124
124
  }
125
125
  const N = {
126
126
  text: S,
@@ -1,9 +1,16 @@
1
1
  import { Modal as _Modal } from '@aplus-frontend/antdv';
2
- import { CreateModalFunc, CreateModalStreamFunc } from './interface';
2
+ import { ModalFunc } from '@aplus-frontend/antdv/es/modal/confirm';
3
+ import { ApModalType, CreateModalFunc, CreateModalStreamFunc } from './interface';
3
4
  export * from './interface';
4
- type ApModalMixedProps = typeof _Modal & {
5
+ type ApModalMixedProps = Omit<typeof _Modal, ApModalType | 'warn'> & {
5
6
  createModal: CreateModalFunc;
6
7
  createModalStream: CreateModalStreamFunc;
8
+ confirm: ModalFunc;
9
+ warning: ModalFunc;
10
+ warn: ModalFunc;
11
+ error: ModalFunc;
12
+ success: ModalFunc;
13
+ info: ModalFunc;
7
14
  };
8
15
  declare const ApModal: ApModalMixedProps;
9
16
  export { ApModal };
@@ -1,12 +1,27 @@
1
- import { Modal as r } from "@aplus-frontend/antdv";
1
+ import { Modal as a } from "@aplus-frontend/antdv";
2
2
  import "./utils/index.mjs";
3
+ import { omit as m } from "lodash-unified";
3
4
  import "./interface.mjs";
4
- import { createModal as a } from "./utils/createModal.mjs";
5
- import { createModalStream as t } from "./utils/createModalStream.mjs";
6
- const o = r;
7
- o.createModal = a;
8
- o.createModalStream = t;
9
- o.name = "ApModal";
5
+ import { createModal as e } from "./utils/createModal.mjs";
6
+ import { createModalStream as n } from "./utils/createModalStream.mjs";
7
+ import { methodsFn as o } from "./utils/methods.mjs";
8
+ const r = m(a, [
9
+ "confirm",
10
+ "warning",
11
+ "warn",
12
+ "error",
13
+ "success",
14
+ "info"
15
+ ]);
16
+ r.createModal = e;
17
+ r.createModalStream = n;
18
+ r.confirm = o("confirm");
19
+ r.warning = o("warning");
20
+ r.warn = o("warning");
21
+ r.error = o("error");
22
+ r.success = o("success");
23
+ r.info = o("info");
24
+ r.name = "ApModal";
10
25
  export {
11
- o as ApModal
26
+ r as ApModal
12
27
  };
@@ -1,5 +1,5 @@
1
1
  import { ModalProps, ModalFuncProps } from '@aplus-frontend/antdv';
2
- import { ModalFunc } from '@aplus-frontend/antdv/lib/modal/confirm';
2
+ import { ModalFunc, ModalStaticFunctions } from '@aplus-frontend/antdv/lib/modal/confirm';
3
3
  export type CreateModalFuncProps<ContentRecord = any> = Omit<ModalProps, 'open' | 'onUpdate:open' | 'destroyOnClose' | 'onCancel' | 'onOk' | 'getContainer' | 'icon'> & Partial<{
4
4
  /**
5
5
  * 点击取消回调
@@ -139,3 +139,4 @@ export type CreateModalStreamProps<ModalType extends ModalStreamTypeKey = ModalS
139
139
  props: (params: any) => Promise<ModalStreamType[ModalType]>;
140
140
  } : never;
141
141
  export type CreateModalStreamFunc<ModalType extends ModalStreamTypeKey = ModalStreamTypeKey> = (streamList: CreateModalStreamProps<ModalType>[], firstModalId?: string) => void;
142
+ export type ApModalType = keyof Omit<ModalStaticFunctions, 'warn'>;
@@ -1,38 +1,41 @@
1
- import { render as u, defineComponent as x, createVNode as h, mergeProps as k, h as v } from "vue";
2
- import { Modal as b } from "@aplus-frontend/antdv";
3
- import { ConfigProvider as P, globalConfigCached as N } from "../../config-provider/config-provider.mjs";
4
- import { omit as L } from "lodash-unified";
5
- import { isNumeric as E } from "@aplus-frontend/utils";
1
+ import { render as g, defineComponent as L, createVNode as u, mergeProps as E, h as H } from "vue";
2
+ import { Modal as M } from "@aplus-frontend/antdv";
3
+ import { ConfigProvider as T, globalConfigCached as O } from "../../config-provider/config-provider.mjs";
4
+ import { omit as D } from "lodash-unified";
5
+ import { isNumeric as U } from "@aplus-frontend/utils";
6
6
  import "../../config-provider/index.mjs";
7
- import { useNamespace as H } from "../../config-provider/hooks/use-namespace.mjs";
8
- const z = (d) => {
7
+ import { getContainerDom as w } from "./util.mjs";
8
+ import { getTopWindow as V } from "../../utils/index.mjs";
9
+ import { useNamespace as W } from "../../config-provider/hooks/use-namespace.mjs";
10
+ const J = (c) => {
11
+ var h, C;
9
12
  let n, t;
10
13
  const {
11
- destroyOnClose: c = !0,
14
+ destroyOnClose: d = !0,
12
15
  wrapperOffset: r = !1
13
- } = d, {
14
- b: l
15
- } = H("ap-modal");
16
- function m() {
16
+ } = c, {
17
+ b: m
18
+ } = W("ap-modal");
19
+ function l() {
17
20
  n && n(!1), setTimeout(() => {
18
21
  var e;
19
- u(null, s), (e = s.parentElement) == null || e.removeChild(s);
22
+ g(null, s), (e = s.parentElement) == null || e.removeChild(s);
20
23
  }, 500);
21
24
  }
22
- function C() {
25
+ function y() {
23
26
  n && n(!0);
24
27
  }
25
28
  function f() {
26
29
  n && n(!1);
27
30
  }
28
- function g(e) {
31
+ function v(e) {
29
32
  t && t(e);
30
33
  }
31
- const O = /* @__PURE__ */ x({
34
+ const x = /* @__PURE__ */ L({
32
35
  data() {
33
36
  return {
34
- open: c,
35
- props: d
37
+ open: d,
38
+ props: c
36
39
  };
37
40
  },
38
41
  created() {
@@ -47,25 +50,25 @@ const z = (d) => {
47
50
  },
48
51
  methods: {
49
52
  async handleCancel() {
50
- var e, o, a, p, i;
53
+ var e, o, a, i, p;
51
54
  if ((e = this.props) != null && e.onCancel) {
52
- const w = ((p = (a = (o = this.props) == null ? void 0 : o.content) == null ? void 0 : a.component) == null ? void 0 : p.exposed) ?? void 0;
53
- await ((i = this.props) == null ? void 0 : i.onCancel(w));
55
+ const N = ((i = (a = (o = this.props) == null ? void 0 : o.content) == null ? void 0 : a.component) == null ? void 0 : i.exposed) ?? void 0;
56
+ await ((p = this.props) == null ? void 0 : p.onCancel(N));
54
57
  }
55
- c ? m() : f();
58
+ d ? l() : f();
56
59
  },
57
60
  async handleOk() {
58
- var e, o, a, p;
61
+ var e, o, a, i;
59
62
  try {
60
63
  if (t({
61
64
  confirmLoading: !0
62
65
  }), (e = this.props) != null && e.onOk) {
63
- const i = ((p = (a = (o = this.props) == null ? void 0 : o.content) == null ? void 0 : a.component) == null ? void 0 : p.exposed) ?? void 0;
64
- await this.props.onOk(i);
66
+ const p = ((i = (a = (o = this.props) == null ? void 0 : o.content) == null ? void 0 : a.component) == null ? void 0 : i.exposed) ?? void 0;
67
+ await this.props.onOk(p);
65
68
  }
66
69
  t({
67
70
  confirmLoading: !1
68
- }), c ? m() : f();
71
+ }), d ? l() : f();
69
72
  } catch {
70
73
  t({
71
74
  confirmLoading: !1
@@ -74,12 +77,12 @@ const z = (d) => {
74
77
  }
75
78
  },
76
79
  render() {
77
- const e = L(this.props, ["onCancel", "onOk", "open", "onUpdate:open", "getContainer", "icon"]);
78
- return h(P, N.value, {
79
- default: () => [h(b, k({
80
+ const e = D(this.props, ["onCancel", "onOk", "open", "onUpdate:open", "getContainer", "icon"]);
81
+ return u(T, O.value, {
82
+ default: () => [u(M, E({
80
83
  class: {
81
- [l()]: !0,
82
- [l("wrapper")]: r
84
+ [m()]: !0,
85
+ [m("wrapper")]: r
83
86
  },
84
87
  open: this.open,
85
88
  onCancel: this.handleCancel,
@@ -87,26 +90,26 @@ const z = (d) => {
87
90
  }, e), {
88
91
  default: () => {
89
92
  var o;
90
- return [h("div", {
93
+ return [u("div", {
91
94
  class: {
92
- [l("body-wrapper")]: r
95
+ [m("body-wrapper")]: r
93
96
  },
94
97
  style: r === !1 ? {} : {
95
- maxHeight: `${window.innerHeight - (r === !0 ? 100 : E(r) ? Number(r) : 100) * 2}px`
98
+ maxHeight: `${window.innerHeight - (r === !0 ? 100 : U(r) ? Number(r) : 100) * 2}px`
96
99
  }
97
100
  }, [(o = this.props) == null ? void 0 : o.content])];
98
101
  }
99
102
  })]
100
103
  });
101
104
  }
102
- }), y = d.getContainer || document.body, s = document.createElement("div");
103
- return y.appendChild(s), u(v(O), s), {
104
- destroy: m,
105
- update: g,
106
- open: C,
105
+ }), k = w((C = (h = O) == null ? void 0 : h.value) == null ? void 0 : C.getPopupContainer), P = w(c.getContainer), b = k || P || V().document.body, s = document.createElement("div");
106
+ return b.appendChild(s), g(H(x), s), {
107
+ destroy: l,
108
+ update: v,
109
+ open: y,
107
110
  close: f
108
111
  };
109
112
  };
110
113
  export {
111
- z as createModal
114
+ J as createModal
112
115
  };
@@ -1,2 +1,3 @@
1
1
  export * from './createModal';
2
2
  export * from './createModalStream';
3
+ export * from './methods';
@@ -1,6 +1,8 @@
1
- import { createModal as o } from "./createModal.mjs";
2
- import { createModalStream as t } from "./createModalStream.mjs";
1
+ import { createModal as r } from "./createModal.mjs";
2
+ import { createModalStream as a } from "./createModalStream.mjs";
3
+ import { methodsFn as d } from "./methods.mjs";
3
4
  export {
4
- o as createModal,
5
- t as createModalStream
5
+ r as createModal,
6
+ a as createModalStream,
7
+ d as methodsFn
6
8
  };
@@ -0,0 +1,3 @@
1
+ import { ModalFunc } from '@aplus-frontend/antdv/es/modal/confirm';
2
+ import { ApModalType } from '../interface';
3
+ export declare const methodsFn: (modalType: ApModalType) => ModalFunc;
@@ -0,0 +1,34 @@
1
+ import { defineComponent as u, createVNode as C, render as f, h as g } from "vue";
2
+ import { Modal as h } from "@aplus-frontend/antdv";
3
+ import { ConfigProvider as x, globalConfigCached as m } from "../../config-provider/config-provider.mjs";
4
+ import { getContainerDom as a } from "./util.mjs";
5
+ import { getTopWindow as v } from "../../utils/index.mjs";
6
+ const D = (i) => (e) => {
7
+ var r, d;
8
+ let n;
9
+ const l = /* @__PURE__ */ u({
10
+ data() {
11
+ const [o, t] = h.useModal();
12
+ return {
13
+ modal: o,
14
+ contextHolder: t
15
+ };
16
+ },
17
+ mounted() {
18
+ var o, t;
19
+ n = (t = (o = this.modal) == null ? void 0 : o[i]) == null ? void 0 : t.call(o, e);
20
+ },
21
+ render() {
22
+ return C(x, m.value, {
23
+ default: () => {
24
+ var o;
25
+ return [(o = this.contextHolder) == null ? void 0 : o.call(this)];
26
+ }
27
+ });
28
+ }
29
+ }), c = a((d = (r = m) == null ? void 0 : r.value) == null ? void 0 : d.getPopupContainer), s = a(e.getContainer), p = c || s || v().document.body;
30
+ return f(g(l), p), n;
31
+ };
32
+ export {
33
+ D as methodsFn
34
+ };
@@ -0,0 +1 @@
1
+ export declare const getContainerDom: (params?: HTMLElement | Element | (() => HTMLElement | Element)) => Element | undefined;
@@ -0,0 +1,4 @@
1
+ const n = (t) => typeof t == "function" ? t == null ? void 0 : t() : t;
2
+ export {
3
+ n as getContainerDom
4
+ };
@@ -19,6 +19,8 @@ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
19
19
  declare const __VLS_component: DefineComponent<ApLadderProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<ApLadderProps> & Readonly<{}>, {
20
20
  layout: "vertical" | "horizontal";
21
21
  tooltip: boolean;
22
+ major: string;
23
+ minor: string;
22
24
  labelAlign: "left" | "right";
23
25
  tooltipProps: Partial<Pick<Partial< ExtractPropTypes<{
24
26
  title: VueTypeValidableDef<any>;
@@ -95,8 +97,6 @@ declare const __VLS_component: DefineComponent<ApLadderProps, {}, {}, {}, {}, Co
95
97
  default: boolean;
96
98
  };
97
99
  }>>, "title" | "placement" | "color" | "mouseEnterDelay" | "trigger" | "getPopupContainer" | "align" | "overlayStyle" | "overlayInnerStyle" | "overlayClassName" | "mouseLeaveDelay" | "arrowPointAtCenter" | "arrow" | "autoAdjustOverflow" | "destroyTooltipOnHide">>;
98
- major: string;
99
- minor: string;
100
100
  majorColor: string;
101
101
  majorStyles: string | false | CSSProperties | StyleValue[] | null;
102
102
  minorColor: string;