@aplus-frontend/ui 7.4.0 → 7.4.2

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 (55) hide show
  1. package/es/index.mjs +183 -181
  2. package/es/src/ag-grid/index.vue.mjs +207 -187
  3. package/es/src/ap-field/date/index.vue.mjs +68 -63
  4. package/es/src/ap-field/text/index.vue2.mjs +27 -23
  5. package/es/src/ap-field/text/password.vue.mjs +31 -27
  6. package/es/src/ap-form/item/index.vue.mjs +95 -86
  7. package/es/src/ap-modal/style/index.d.ts +3 -0
  8. package/es/src/ap-modal/style/index.mjs +20 -0
  9. package/es/src/ap-modal/utils/createModal.mjs +38 -39
  10. package/es/src/ap-pro-card/style/title.mjs +10 -10
  11. package/es/src/business/ag-grid-modal/hooks/use-ag-grid-modal.mjs +24 -22
  12. package/es/src/business/ag-grid-modal/hooks/use-ag-grid-select-modal.mjs +26 -24
  13. package/es/src/business/ag-grid-modal/interface.d.ts +2 -1
  14. package/es/src/business/ag-grid-modal/wrapper/index.vue.d.ts +3 -1
  15. package/es/src/business/ag-grid-modal/wrapper/index.vue2.mjs +16 -15
  16. package/es/src/business/ap-value-select-card/style/index.mjs +2 -2
  17. package/es/src/index.d.ts +1 -0
  18. package/es/src/index.mjs +302 -299
  19. package/es/src/render/index.d.ts +2 -0
  20. package/es/src/render/index.mjs +4 -0
  21. package/es/src/render/render.d.ts +15 -0
  22. package/es/src/render/render.mjs +17 -0
  23. package/es/src/utils/cssinjs/TokenUtil.mjs +1 -1
  24. package/es/src/version.d.ts +1 -1
  25. package/es/src/version.mjs +1 -1
  26. package/lib/index.js +1 -1
  27. package/lib/src/ag-grid/index.vue.js +1 -1
  28. package/lib/src/ap-field/date/index.vue.js +1 -1
  29. package/lib/src/ap-field/text/index.vue2.js +1 -1
  30. package/lib/src/ap-field/text/password.vue.js +1 -1
  31. package/lib/src/ap-form/item/index.vue.js +1 -1
  32. package/lib/src/ap-modal/style/index.d.ts +3 -0
  33. package/lib/src/ap-modal/style/index.js +1 -0
  34. package/lib/src/ap-modal/utils/createModal.js +1 -1
  35. package/lib/src/ap-pro-card/style/title.js +1 -1
  36. package/lib/src/business/ag-grid-modal/hooks/use-ag-grid-modal.js +1 -1
  37. package/lib/src/business/ag-grid-modal/hooks/use-ag-grid-select-modal.js +1 -1
  38. package/lib/src/business/ag-grid-modal/interface.d.ts +2 -1
  39. package/lib/src/business/ag-grid-modal/wrapper/index.vue.d.ts +3 -1
  40. package/lib/src/business/ag-grid-modal/wrapper/index.vue2.js +1 -1
  41. package/lib/src/business/ap-value-select-card/style/index.js +1 -1
  42. package/lib/src/index.d.ts +1 -0
  43. package/lib/src/index.js +1 -1
  44. package/lib/src/render/index.d.ts +2 -0
  45. package/lib/src/render/index.js +1 -0
  46. package/lib/src/render/render.d.ts +15 -0
  47. package/lib/src/render/render.js +1 -0
  48. package/lib/src/utils/cssinjs/TokenUtil.js +1 -1
  49. package/lib/src/version.d.ts +1 -1
  50. package/lib/src/version.js +1 -1
  51. package/package.json +3 -3
  52. package/es/src/portal/style/css.d.ts +0 -1
  53. package/es/src/portal/style/index.d.ts +0 -1
  54. package/lib/src/portal/style/css.d.ts +0 -1
  55. package/lib/src/portal/style/index.d.ts +0 -1
@@ -1,15 +1,15 @@
1
- import { defineComponent as z, computed as r, unref as t, createElementBlock as B, createBlock as y, openBlock as i, Fragment as g, createTextVNode as k, toDisplayString as w, normalizeStyle as E, withCtx as p, createCommentVNode as N, createVNode as j, isRef as I, renderList as P, mergeProps as U, createSlots as H, renderSlot as K, normalizeProps as W, guardReactiveProps as $ } from "vue";
1
+ import { defineComponent as E, computed as r, unref as t, createElementBlock as B, createBlock as y, openBlock as i, Fragment as g, createTextVNode as k, toDisplayString as w, normalizeStyle as N, withCtx as s, createVNode as P, createCommentVNode as I, isRef as j, renderList as b, mergeProps as U, createSlots as H, renderSlot as K, normalizeProps as W, guardReactiveProps as $ } from "vue";
2
2
  import u from "dayjs";
3
- import { InputGroup as G, Select as L, SelectOption as Y, DatePicker as Z } from "@aplus-frontend/antdv";
4
- import { ApFieldDatePresetFormats as q, PRESET_FORMAT_MAP as b, PRESET_FORMAT_PICK_MAP as J, PRESET_FORMAT_TIME_MAP as Q } from "./constant.mjs";
3
+ import { InputGroup as G, FormItemRest as L, Select as Y, SelectOption as Z, DatePicker as q } from "@aplus-frontend/antdv";
4
+ import { ApFieldDatePresetFormats as J, PRESET_FORMAT_MAP as C, PRESET_FORMAT_PICK_MAP as Q, PRESET_FORMAT_TIME_MAP as X } from "./constant.mjs";
5
5
  import "../../hooks/index.mjs";
6
- import { isNil as C, omit as X } from "lodash-unified";
7
- import { formatDayWithTimezone as ee } from "./helper.mjs";
8
- import { getTimeFormatToZone as oe } from "@aplus-frontend/utils";
9
- import { useDefaultPlaceholder as te } from "../hooks/use-default-placeholder.mjs";
10
- import { useDateTimezone as ae } from "../hooks/use-date-timezone.mjs";
11
- import { useControllableValue as ne } from "../../hooks/useControllableValue.mjs";
12
- const ye = /* @__PURE__ */ z({
6
+ import { isNil as S, omit as ee } from "lodash-unified";
7
+ import { formatDayWithTimezone as oe } from "./helper.mjs";
8
+ import { getTimeFormatToZone as te } from "@aplus-frontend/utils";
9
+ import { useDefaultPlaceholder as ae } from "../hooks/use-default-placeholder.mjs";
10
+ import { useDateTimezone as ne } from "../hooks/use-date-timezone.mjs";
11
+ import { useControllableValue as le } from "../../hooks/useControllableValue.mjs";
12
+ const he = /* @__PURE__ */ E({
13
13
  name: "ApFieldDate",
14
14
  __name: "index",
15
15
  props: {
@@ -91,23 +91,23 @@ const ye = /* @__PURE__ */ z({
91
91
  timezone: {}
92
92
  },
93
93
  emits: ["update:value"],
94
- setup(S, { emit: T }) {
95
- const e = S, O = T, { value: f, updateValue: h } = ne(
94
+ setup(T, { emit: F }) {
95
+ const e = T, O = F, { value: f, updateValue: h } = le(
96
96
  e,
97
97
  O
98
- ), F = te("Date", e), { currentTimezone: d } = ae(e), l = r(
99
- () => q.indexOf(e.format) > -1
100
- ), A = r(() => e.shownFormat ? e.shownFormat : l.value ? b[e.format] : e.format), s = r(
101
- () => l.value ? b[e.format] : e.format
98
+ ), _ = ae("Date", e), { currentTimezone: d } = ne(e), l = r(
99
+ () => J.indexOf(e.format) > -1
100
+ ), A = r(() => e.shownFormat ? e.shownFormat : l.value ? C[e.format] : e.format), m = r(
101
+ () => l.value ? C[e.format] : e.format
102
102
  ), c = r(() => {
103
- if (C(t(f)))
103
+ if (S(t(f)))
104
104
  return;
105
105
  let o = u(t(f));
106
- return e.timezone && (o = u(oe(t(f), d.value))), o;
107
- }), _ = r(() => t(l) ? e.picker ?? J[e.format] : e.picker), R = r(() => {
108
- const o = t(l) ? Q[e.format] : {};
106
+ return e.timezone && (o = u(te(t(f), d.value))), o;
107
+ }), R = r(() => t(l) ? e.picker ?? Q[e.format] : e.picker), M = r(() => {
108
+ const o = t(l) ? X[e.format] : {};
109
109
  return {
110
- ...X(e, [
110
+ ...ee(e, [
111
111
  "value",
112
112
  "defaultValue",
113
113
  "onChange",
@@ -116,12 +116,12 @@ const ye = /* @__PURE__ */ z({
116
116
  "onUpdate:value",
117
117
  "mode"
118
118
  ]),
119
- placeholder: t(F),
119
+ placeholder: t(_),
120
120
  ...o
121
121
  };
122
- }), v = (o, n, a = !0) => ee(d.value)(o, n, a);
123
- function M(o) {
124
- if (C(o)) {
122
+ }), v = (o, n, a = !0) => oe(d.value)(o, n, a);
123
+ function D(o) {
124
+ if (S(o)) {
125
125
  h(null);
126
126
  return;
127
127
  }
@@ -129,71 +129,76 @@ const ye = /* @__PURE__ */ z({
129
129
  h(
130
130
  v(
131
131
  n,
132
- t(l) ? t(s) : void 0,
132
+ t(l) ? t(m) : void 0,
133
133
  e.formatBegins
134
134
  )
135
135
  );
136
136
  }
137
- function D(o, n) {
138
- const a = u(o), m = o ? v(
137
+ function V(o, n) {
138
+ const a = u(o), p = o ? v(
139
139
  a,
140
- t(l) ? t(s) : void 0,
140
+ t(l) ? t(m) : void 0,
141
141
  e.formatBegins
142
142
  ) : null;
143
- e.onChange?.(m, n);
143
+ e.onChange?.(p, n);
144
144
  }
145
- function V(o) {
145
+ function x(o) {
146
146
  const n = u(o), a = o ? v(
147
147
  n,
148
- t(l) ? t(s) : void 0,
148
+ t(l) ? t(m) : void 0,
149
149
  e.formatBegins
150
150
  ) : null;
151
151
  e.onOk?.(a);
152
152
  }
153
153
  return (o, n) => o.mode === "read" ? (i(), B(g, { key: 0 }, [
154
- k(w(c.value ? t(u)(c.value).format(s.value) : o.emptyText), 1)
154
+ k(w(c.value ? t(u)(c.value).format(m.value) : o.emptyText), 1)
155
155
  ], 64)) : (i(), y(t(G), {
156
156
  key: 1,
157
157
  compact: "",
158
- style: E({
158
+ style: N({
159
159
  display: Array.isArray(e.timezone) && e.timezone.length ? "flex" : "block"
160
160
  })
161
161
  }, {
162
- default: p(() => [
163
- Array.isArray(e.timezone) && e.timezone.length ? (i(), y(t(L), {
164
- key: 0,
165
- value: t(d),
166
- "onUpdate:value": n[0] || (n[0] = (a) => I(d) ? d.value = a : null),
167
- "default-active-first-option": "",
168
- "dropdown-match-select-width": !1,
169
- style: { "max-width": "50%" },
170
- disabled: o.disabled
171
- }, {
172
- default: p(() => [
173
- (i(!0), B(g, null, P(e.timezone, (a) => (i(), y(t(Y), {
174
- key: a?.value,
175
- value: a?.value
162
+ default: s(() => [
163
+ P(t(L), null, {
164
+ default: s(() => [
165
+ Array.isArray(e.timezone) && e.timezone.length ? (i(), y(t(Y), {
166
+ key: 0,
167
+ value: t(d),
168
+ "onUpdate:value": n[0] || (n[0] = (a) => j(d) ? d.value = a : null),
169
+ "default-active-first-option": "",
170
+ "dropdown-match-select-width": !1,
171
+ style: { "max-width": "50%" },
172
+ disabled: o.disabled
176
173
  }, {
177
- default: p(() => [
178
- k(w(a?.label ?? a?.value), 1)
174
+ default: s(() => [
175
+ (i(!0), B(g, null, b(e.timezone, (a) => (i(), y(t(Z), {
176
+ key: a?.value,
177
+ value: a?.value
178
+ }, {
179
+ default: s(() => [
180
+ k(w(a?.label ?? a?.value), 1)
181
+ ]),
182
+ _: 2
183
+ }, 1032, ["value"]))), 128))
179
184
  ]),
180
- _: 2
181
- }, 1032, ["value"]))), 128))
185
+ _: 1
186
+ }, 8, ["value", "disabled"])) : I("", !0)
182
187
  ]),
183
188
  _: 1
184
- }, 8, ["value", "disabled"])) : N("", !0),
185
- j(t(Z), U(R.value, {
189
+ }),
190
+ P(t(q), U(M.value, {
186
191
  value: c.value,
187
192
  format: A.value,
188
- picker: _.value,
189
- "onUpdate:value": M,
190
- onChange: D,
191
- onOk: V
193
+ picker: R.value,
194
+ "onUpdate:value": D,
195
+ onChange: V,
196
+ onOk: x
192
197
  }), H({ _: 2 }, [
193
- P(o.$slots, (a, m) => ({
194
- name: m,
195
- fn: p((x) => [
196
- K(o.$slots, m, W($(x || {})))
198
+ b(o.$slots, (a, p) => ({
199
+ name: p,
200
+ fn: s((z) => [
201
+ K(o.$slots, p, W($(z || {})))
197
202
  ])
198
203
  }))
199
204
  ]), 1040, ["value", "format", "picker"])
@@ -203,5 +208,5 @@ const ye = /* @__PURE__ */ z({
203
208
  }
204
209
  });
205
210
  export {
206
- ye as default
211
+ he as default
207
212
  };
@@ -1,13 +1,15 @@
1
- import { isVNode as g, defineComponent as C, ref as S, useSlots as _, createVNode as i, mergeProps as V, unref as r, computed as w, createBlock as R, openBlock as T, resolveDynamicComponent as j } from "vue";
2
- import { Input as U } from "@aplus-frontend/antdv";
1
+ import { isVNode as g, defineComponent as C, ref as S, useSlots as _, createVNode as i, mergeProps as R, unref as r, computed as V, createBlock as w, openBlock as T } from "vue";
2
+ import { Input as j } from "@aplus-frontend/antdv";
3
3
  import "../../hooks/index.mjs";
4
- import { omit as z } from "lodash-unified";
5
- import { useDefaultPlaceholder as F } from "../hooks/use-default-placeholder.mjs";
6
- import { useControllableValue as M } from "../../hooks/useControllableValue.mjs";
4
+ import { omit as U } from "lodash-unified";
5
+ import { useDefaultPlaceholder as z } from "../hooks/use-default-placeholder.mjs";
6
+ import "../../render/index.mjs";
7
+ import { useControllableValue as F } from "../../hooks/useControllableValue.mjs";
8
+ import M from "../../render/render.mjs";
7
9
  function N(n) {
8
10
  return typeof n == "function" || Object.prototype.toString.call(n) === "[object Object]" && !g(n);
9
11
  }
10
- const K = /* @__PURE__ */ C({
12
+ const $ = /* @__PURE__ */ C({
11
13
  name: "ApFieldText",
12
14
  __name: "index",
13
15
  props: {
@@ -95,43 +97,45 @@ const K = /* @__PURE__ */ C({
95
97
  emits: ["update:value"],
96
98
  setup(n, {
97
99
  expose: d,
98
- emit: c
100
+ emit: f
99
101
  }) {
100
- const t = S(), l = _(), f = (o) => {
102
+ const t = S(), u = _(), c = (o) => {
101
103
  t.value?.focus(o);
102
104
  }, m = () => {
103
105
  t.value?.blur();
104
- }, y = (o, u, a) => {
105
- t.value?.setSelectionRange(o, u, a);
106
- }, v = () => {
106
+ }, y = (o, l, a) => {
107
+ t.value?.setSelectionRange(o, l, a);
108
+ }, x = () => {
107
109
  t.value?.select();
108
- }, x = c, e = n, {
110
+ }, v = f, e = n, {
109
111
  value: p,
110
112
  updateValue: B
111
- } = M(e, x), b = F("Text", e);
113
+ } = F(e, v), b = z("Text", e);
112
114
  function h(o) {
113
- const u = o.target.value || "", a = e.beforeInput ? e.beforeInput?.(u) : u, s = t.value?.$el?.querySelector("input");
115
+ const l = o.target.value || "", a = e.beforeInput ? e.beforeInput?.(l) : l, s = t.value?.$el?.querySelector("input");
114
116
  s && (s.value = a), B(a);
115
117
  }
116
118
  function I() {
117
- return e.mode === "edit" ? i(U, V(z(e, ["mode", "emptyText", "value", "onUpdate:value", "beforeInput"]), {
119
+ return e.mode === "edit" ? i(j, R(U(e, ["mode", "emptyText", "value", "onUpdate:value", "beforeInput"]), {
118
120
  placeholder: r(b),
119
121
  value: r(p),
120
122
  onInput: h,
121
123
  ref: t
122
- }), N(l) ? l : {
123
- default: () => [l]
124
- }) : i("span", null, [e.prefix || l?.prefix?.(), r(p) || e.emptyText, e.suffix || l?.suffix?.()]);
124
+ }), N(u) ? u : {
125
+ default: () => [u]
126
+ }) : i("span", null, [e.prefix || u?.prefix?.(), r(p) || e.emptyText, e.suffix || u?.suffix?.()]);
125
127
  }
126
128
  return d({
127
- focus: f,
129
+ focus: c,
128
130
  blur: m,
129
131
  setSelectionRange: y,
130
- select: v,
131
- input: w(() => t.value?.input)
132
- }), (o, u) => (T(), R(j(I())));
132
+ select: x,
133
+ input: V(() => t.value?.input)
134
+ }), (o, l) => (T(), w(r(M), {
135
+ renderer: I
136
+ }));
133
137
  }
134
138
  });
135
139
  export {
136
- K as default
140
+ $ as default
137
141
  };
@@ -1,14 +1,16 @@
1
- import { isVNode as x, defineComponent as h, useSlots as C, ref as g, unref as i, createVNode as e, mergeProps as w, Fragment as P, createBlock as U, openBlock as V, resolveDynamicComponent as _ } from "vue";
2
- import { Input as S, Space as T } from "@aplus-frontend/antdv";
1
+ import { isVNode as x, defineComponent as h, useSlots as g, ref as C, unref as a, createVNode as e, mergeProps as w, Fragment as P, createBlock as U, openBlock as V } from "vue";
2
+ import { Input as _, Space as S } from "@aplus-frontend/antdv";
3
3
  import "../../hooks/index.mjs";
4
- import { omit as I } from "lodash-unified";
5
- import { EyeOutlined as O, EyeInvisibleOutlined as j } from "@ant-design/icons-vue";
6
- import { useDefaultPlaceholder as k } from "../hooks/use-default-placeholder.mjs";
7
- import { useControllableValue as d } from "../../hooks/useControllableValue.mjs";
4
+ import { omit as T } from "lodash-unified";
5
+ import { EyeOutlined as I, EyeInvisibleOutlined as O } from "@ant-design/icons-vue";
6
+ import { useDefaultPlaceholder as j } from "../hooks/use-default-placeholder.mjs";
7
+ import "../../render/index.mjs";
8
+ import { useControllableValue as p } from "../../hooks/useControllableValue.mjs";
9
+ import k from "../../render/render.mjs";
8
10
  function E(t) {
9
11
  return typeof t == "function" || Object.prototype.toString.call(t) === "[object Object]" && !x(t);
10
12
  }
11
- const G = /* @__PURE__ */ h({
13
+ const J = /* @__PURE__ */ h({
12
14
  name: "ApFieldTextPassword",
13
15
  __name: "password",
14
16
  props: {
@@ -110,48 +112,50 @@ const G = /* @__PURE__ */ h({
110
112
  expose: c,
111
113
  emit: f
112
114
  }) {
113
- const s = f, o = t, a = C(), u = g(), {
115
+ const r = f, o = t, u = g(), i = C(), {
114
116
  value: m,
115
117
  updateValue: v
116
- } = d(o, s), y = k("TextPassword", o), {
118
+ } = p(o, r), y = j("TextPassword", o), {
117
119
  value: b,
118
- updateValue: r
119
- } = d(o, s, {
120
+ updateValue: s
121
+ } = p(o, r, {
120
122
  valuePropName: "visible"
121
123
  });
122
124
  function B() {
123
- const n = i(m), l = i(b);
125
+ const n = a(m), l = a(b);
124
126
  if (o.mode === "edit")
125
- return e(S.Password, w(I(o, ["mode", "emptyText", "value", "onUpdate:value", "visible", "onUpdate:visible"]), {
126
- placeholder: i(y),
127
+ return e(_.Password, w(T(o, ["mode", "emptyText", "value", "onUpdate:value", "visible", "onUpdate:visible"]), {
128
+ placeholder: a(y),
127
129
  value: n,
128
130
  "onUpdate:value": v,
129
131
  visible: l,
130
- "onUpdate:visible": r,
131
- ref: u
132
- }), E(a) ? a : {
133
- default: () => [a]
132
+ "onUpdate:visible": s,
133
+ ref: i
134
+ }), E(u) ? u : {
135
+ default: () => [u]
134
136
  });
135
- let p = e(P, null, [o.emptyText]);
136
- return n && (p = e(T, null, {
137
+ let d = e(P, null, [o.emptyText]);
138
+ return n && (d = e(S, null, {
137
139
  default: () => [e("span", null, [l ? n : "********"]), e("span", {
138
140
  style: {
139
141
  cursor: "pointer"
140
142
  },
141
- onClick: () => r(!l)
142
- }, [l ? e(O, null, null) : e(j, null, null)])]
143
- })), p;
143
+ onClick: () => s(!l)
144
+ }, [l ? e(I, null, null) : e(O, null, null)])]
145
+ })), d;
144
146
  }
145
147
  return c({
146
148
  focus: () => {
147
- u.value?.focus();
149
+ i.value?.focus();
148
150
  },
149
151
  blur: () => {
150
- u.value?.blur();
152
+ i.value?.blur();
151
153
  }
152
- }), (n, l) => (V(), U(_(B())));
154
+ }), (n, l) => (V(), U(a(k), {
155
+ renderer: B
156
+ }));
153
157
  }
154
158
  });
155
159
  export {
156
- G as default
160
+ J as default
157
161
  };
@@ -1,16 +1,16 @@
1
- import { defineComponent as L, useSlots as _, ref as c, onMounted as M, computed as $, unref as t, cloneVNode as j, createBlock as b, openBlock as v, mergeProps as q, createSlots as E, withCtx as a, resolveDynamicComponent as K, renderList as O, createElementVNode as Q, normalizeClass as U, createVNode as u, normalizeStyle as Y, renderSlot as G, normalizeProps as H, guardReactiveProps as J } from "vue";
2
- import { Form as W, Tooltip as X, TypographyText as Z } from "@aplus-frontend/antdv";
3
- import { useToken as ee } from "@aplus-frontend/antdv/es/theme/internal";
4
- import { isFunction as y, cloneDeep as oe, isArray as te, omit as F } from "lodash-unified";
1
+ import { defineComponent as _, useSlots as j, ref as y, onMounted as E, computed as M, unref as r, cloneVNode as O, createBlock as b, openBlock as v, mergeProps as $, createSlots as q, withCtx as i, resolveDynamicComponent as K, renderList as Q, createElementVNode as U, normalizeClass as Y, createVNode as f, normalizeStyle as G, renderSlot as H, normalizeProps as J, guardReactiveProps as W } from "vue";
2
+ import { Form as X, Tooltip as Z, TypographyText as ee } from "@aplus-frontend/antdv";
3
+ import { useToken as oe } from "@aplus-frontend/antdv/es/theme/internal";
4
+ import { isFunction as F, cloneDeep as te, isArray as re, omit as V } from "lodash-unified";
5
5
  import { apFormItemColPropKeys as le } from "../constant.mjs";
6
- import { QuestionCircleOutlined as re } from "@ant-design/icons-vue";
6
+ import { QuestionCircleOutlined as ne } from "@ant-design/icons-vue";
7
7
  import "../../config-provider/index.mjs";
8
8
  import { useInjectForm as ae } from "../context.mjs";
9
- import { isPromise as ne } from "@fruits-chain/utils";
10
- import { getValidVNodeList as ie } from "../../utils/slot.mjs";
11
- import se from "../style/item.mjs";
12
- import { useNamespace as ue } from "../../config-provider/hooks/use-namespace.mjs";
13
- const Be = /* @__PURE__ */ L({
9
+ import { isPromise as ie } from "@fruits-chain/utils";
10
+ import { getValidVNodeList as se } from "../../utils/slot.mjs";
11
+ import ue from "../style/item.mjs";
12
+ import { useNamespace as de } from "../../config-provider/hooks/use-namespace.mjs";
13
+ const Ce = /* @__PURE__ */ _({
14
14
  name: "ApFormItem",
15
15
  __name: "index",
16
16
  props: {
@@ -57,100 +57,109 @@ const Be = /* @__PURE__ */ L({
57
57
  customFilled: {},
58
58
  disabled: { type: Boolean }
59
59
  },
60
- setup(V, { expose: g }) {
61
- const e = V, d = _(), { model: m, updateModel: h, internalInstance: B } = ae(), { m: i, b: C } = ue("ap-form-item"), k = se("ap-form-item"), s = c(!1), r = c(), [, x] = ee();
62
- M(async () => {
63
- let o = y(e.initialValue) ? e.initialValue() : e.initialValue;
64
- ne(o) && (o = await o), B?.registerField({
65
- name: e.name,
66
- initialValue: oe(o),
67
- transform: e.transform
60
+ setup(g, { expose: h }) {
61
+ const o = g, m = j(), { model: p, updateModel: B, internalInstance: C } = ae(), { m: u, b: k } = de("ap-form-item"), P = ue("ap-form-item"), d = y(!1), a = y(), [, x] = oe();
62
+ E(async () => {
63
+ let e = F(o.initialValue) ? o.initialValue() : o.initialValue;
64
+ ie(e) && (e = await e), C?.registerField({
65
+ name: o.name,
66
+ initialValue: te(e),
67
+ transform: o.transform
68
68
  });
69
69
  });
70
- const f = $(() => e.name ? te(e.name) ? e.name.reduce((o, l) => o?.[l], t(m)) : m?.value[e.name] : null);
71
- function I() {
72
- const o = d.default?.() || [];
73
- if (!e.name)
74
- return o[0];
75
- const l = ie(o)[0];
76
- return l ? j(l, {
77
- [e.valuePropName]: t(f),
78
- [`onUpdate:${e.valuePropName}`]: N,
79
- variant: e.bordered ? "borderless" : l?.props?.variant,
80
- bordered: e.bordered ? !1 : l?.props?.bordered,
81
- onFocus: P,
82
- onBlur: S
83
- }) : null;
84
- }
85
- function N(o) {
86
- h?.(e.name, o);
70
+ const c = M(() => o.name ? re(o.name) ? o.name.reduce((e, t) => e?.[t], r(p)) : p?.value[o.name] : null);
71
+ function N(e, t) {
72
+ const l = Object.keys(t), n = { ...t };
73
+ return l.forEach((s) => {
74
+ s in e || delete n[s];
75
+ }), n;
87
76
  }
88
- function P() {
89
- s.value = !0;
77
+ function I() {
78
+ const e = m.default?.() || [];
79
+ if (!o.name)
80
+ return e[0];
81
+ const t = se(e)[0];
82
+ if (!t)
83
+ return null;
84
+ const l = t?.type?.props ?? {}, n = {
85
+ [o.valuePropName]: r(c),
86
+ [`onUpdate:${o.valuePropName}`]: S,
87
+ variant: o.bordered ? "borderless" : t?.props?.variant,
88
+ bordered: o.bordered ? !1 : t?.props?.bordered,
89
+ onFocus: T,
90
+ onBlur: w
91
+ };
92
+ return O(t, N(l, n));
90
93
  }
91
- function S() {
92
- s.value = !1;
94
+ function S(e) {
95
+ B?.(o.name, e);
93
96
  }
94
97
  function T() {
95
- r.value?.onFieldBlur();
98
+ d.value = !0;
96
99
  }
97
100
  function w() {
98
- r.value?.onFieldChange();
101
+ d.value = !1;
99
102
  }
100
103
  function z() {
101
- r.value?.clearValidate();
104
+ a.value?.onFieldBlur();
102
105
  }
103
106
  function R() {
104
- r.value?.resetField();
107
+ a.value?.onFieldChange();
108
+ }
109
+ function A() {
110
+ a.value?.clearValidate();
111
+ }
112
+ function D() {
113
+ a.value?.resetField();
105
114
  }
106
- function A(o = !1) {
107
- const l = t(f);
108
- if (!o || !e.transform)
109
- return l;
110
- const n = y(e.transform) ? e.transform : e.transform.transformer;
111
- return e.transform ? n(l) : l;
115
+ function L(e = !1) {
116
+ const t = r(c);
117
+ if (!e || !o.transform)
118
+ return t;
119
+ const l = F(o.transform) ? o.transform : o.transform.transformer;
120
+ return o.transform ? l(t) : t;
112
121
  }
113
- return g({
114
- onFieldBlur: T,
115
- onFieldChange: w,
116
- clearValidate: z,
117
- resetField: R,
118
- getFieldValue: A
119
- }), (o, l) => (v(), b(t(W).Item, q(
122
+ return h({
123
+ onFieldBlur: z,
124
+ onFieldChange: R,
125
+ clearValidate: A,
126
+ resetField: D,
127
+ getFieldValue: L
128
+ }), (e, t) => (v(), b(r(X).Item, $(
120
129
  {
121
130
  ref_key: "formItemRef",
122
- ref: r
131
+ ref: a
123
132
  },
124
- t(F)(e, [...t(le), "tooltip", "label", "description"]),
133
+ r(V)(o, [...r(le), "tooltip", "label", "description"]),
125
134
  {
126
135
  class: {
127
- [t(i)("bordered")]: o.bordered,
128
- [t(i)("focused")]: o.bordered && s.value,
129
- [t(i)("disabled")]: o.bordered && o.disabled,
130
- [t(C)()]: !0,
131
- [t(k)]: !0
136
+ [r(u)("bordered")]: e.bordered,
137
+ [r(u)("focused")]: e.bordered && d.value,
138
+ [r(u)("disabled")]: e.bordered && e.disabled,
139
+ [r(k)()]: !0,
140
+ [r(P)]: !0
132
141
  },
133
- colon: o.bordered ? !1 : e.colon
142
+ colon: e.bordered ? !1 : o.colon
134
143
  }
135
- ), E({
136
- default: a(() => [
144
+ ), q({
145
+ default: i(() => [
137
146
  (v(), b(K(I())))
138
147
  ]),
139
148
  _: 2
140
149
  }, [
141
- e.tooltip ? {
150
+ o.tooltip ? {
142
151
  name: "tooltip",
143
- fn: a(({ class: n }) => [
144
- Q("span", {
145
- class: U(n)
152
+ fn: i(({ class: l }) => [
153
+ U("span", {
154
+ class: Y(l)
146
155
  }, [
147
- u(t(X), {
148
- title: e.tooltip
156
+ f(r(Z), {
157
+ title: o.tooltip
149
158
  }, {
150
- default: a(() => [
151
- u(t(re), {
152
- style: Y({
153
- color: t(x).colorTextTertiary,
159
+ default: i(() => [
160
+ f(r(ne), {
161
+ style: G({
162
+ color: r(x).colorTextTertiary,
154
163
  fontSize: "14px",
155
164
  transform: "translateY(1px)"
156
165
  })
@@ -162,26 +171,26 @@ const Be = /* @__PURE__ */ L({
162
171
  ]),
163
172
  key: "0"
164
173
  } : void 0,
165
- o.label ? {
174
+ e.label ? {
166
175
  name: "label",
167
- fn: a(() => [
168
- u(t(Z), {
169
- content: o.label,
170
- ellipsis: { tooltip: o.label },
176
+ fn: i(() => [
177
+ f(r(ee), {
178
+ content: e.label,
179
+ ellipsis: { tooltip: e.label },
171
180
  style: { "min-width": "0px", flex: "1" }
172
181
  }, null, 8, ["content", "ellipsis"])
173
182
  ]),
174
183
  key: "1"
175
184
  } : void 0,
176
- O(t(F)(d, "default"), (n, p) => ({
177
- name: p,
178
- fn: a((D) => [
179
- G(o.$slots, p, H(J(D || {})))
185
+ Q(r(V)(m, "default"), (l, n) => ({
186
+ name: n,
187
+ fn: i((s) => [
188
+ H(e.$slots, n, J(W(s || {})))
180
189
  ])
181
190
  }))
182
191
  ]), 1040, ["class", "colon"]));
183
192
  }
184
193
  });
185
194
  export {
186
- Be as default
195
+ Ce as default
187
196
  };
@@ -0,0 +1,3 @@
1
+ import { ComputedRef } from 'vue';
2
+ declare const _default: (prefixCls: string) => ComputedRef<string>;
3
+ export default _default;
@@ -0,0 +1,20 @@
1
+ import { genComponentStyleHook as n } from "../../utils/cssinjs/index.mjs";
2
+ const t = (o) => {
3
+ const { componentCls: e } = o;
4
+ return {
5
+ [e]: {
6
+ [`${e}-body-wrapper`]: {
7
+ "scrollbar-width": "none",
8
+ "-ms-overflow-style": "none",
9
+ "&::-webkit-scrollbar": {
10
+ display: "none"
11
+ }
12
+ }
13
+ }
14
+ };
15
+ }, r = n("ApModal", (o) => [
16
+ t(o)
17
+ ]);
18
+ export {
19
+ r as default
20
+ };