@unicom-cloud/ui 0.8.84 → 0.8.86

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 (104) hide show
  1. package/AutoComplete.js +1 -1
  2. package/Calendar.js +1 -1
  3. package/Cascader.js +1 -1
  4. package/Checkbox.js +1 -1
  5. package/ColorPicker.js +1 -1
  6. package/Form.js +13 -13
  7. package/List.js +1 -1
  8. package/Mentions.js +1 -1
  9. package/Pagination.js +1 -1
  10. package/Radio.js +1 -1
  11. package/Select.js +1 -1
  12. package/Space.js +2 -2
  13. package/Table.js +1 -1
  14. package/Transfer.js +1 -1
  15. package/Tree.js +1 -1
  16. package/TreeSelect.js +1 -1
  17. package/Typography.js +1 -1
  18. package/auto-complete/index.js +1 -1
  19. package/calendar/index.js +1 -1
  20. package/cascader/Cascader.js +1 -1
  21. package/cascader/index.js +1 -1
  22. package/cascader/util.js +1 -1
  23. package/checkbox/Checkbox.js +1 -1
  24. package/checkbox/Group.js +1 -1
  25. package/checkbox/GroupBlock.js +1 -1
  26. package/checkbox/index.js +2 -2
  27. package/chunk/BP4igg_F.js +213 -0
  28. package/chunk/{DO3k0z6J.js → DSXeBMp3.js} +11 -9
  29. package/color-picker/Panel.js +1 -1
  30. package/color-picker/index.js +1 -1
  31. package/development/index.js +1 -1
  32. package/form/Form.js +14 -158
  33. package/form/FormList.js +3 -2
  34. package/form/index.js +57 -56
  35. package/icons/file.js +67 -0
  36. package/index.js +288 -283
  37. package/list/index.js +1 -1
  38. package/mentions/index.js +1 -1
  39. package/package.json +1 -1
  40. package/pagination/PageOption.js +1 -1
  41. package/pagination/Pagination.js +1 -1
  42. package/pagination/index.js +1 -1
  43. package/radio/Group.js +1 -1
  44. package/radio/GroupBlock.js +1 -1
  45. package/radio/Radio.js +1 -1
  46. package/radio/index.js +2 -2
  47. package/select/Option.js +1 -1
  48. package/select/Select.js +1 -1
  49. package/select/index.js +2 -2
  50. package/select/util.js +1 -1
  51. package/space/index.js +132 -84
  52. package/space-/index.js +92 -0
  53. package/space-/interface.js +1 -0
  54. package/{space → space-}/toArray.js +2 -2
  55. package/style.css +1 -1
  56. package/table/Table.js +1 -1
  57. package/table/index.js +1 -1
  58. package/transfer/Item.js +1 -1
  59. package/transfer/List.js +1 -1
  60. package/transfer/index.js +1 -1
  61. package/tree/Animation.js +1 -1
  62. package/tree/Node.js +1 -1
  63. package/tree/NodeList.js +1 -1
  64. package/tree/Tree.js +1 -1
  65. package/tree/index.js +1 -1
  66. package/tree-select/List.js +1 -1
  67. package/tree-select/Select.js +1 -1
  68. package/tree-select/index.js +2 -2
  69. package/trigger/index.js +83 -83
  70. package/types/common/icons/file/index.d.ts +4 -0
  71. package/types/common/icons/file/interface.d.ts +20 -0
  72. package/types/common/space/index.d.ts +7 -0
  73. package/types/common/space/interface.d.ts +42 -0
  74. package/types/common/utils/color.d.ts +1 -0
  75. package/types/common/utils/computeScrollIntoView.d.ts +1 -0
  76. package/types/common/utils/index.d.ts +40 -0
  77. package/types/common/utils/is.d.ts +1 -1
  78. package/types/common/utils/math.d.ts +1 -0
  79. package/types/common/utils/reactTransitionGroup.d.ts +1 -0
  80. package/types/common/utils/tree.d.ts +1 -0
  81. package/types/common/utils/tween.d.ts +1 -0
  82. package/types/common/utils/uuid.d.ts +1 -0
  83. package/types/common/utils/validate.d.ts +1 -0
  84. package/types/pc/cascader/base/node.d.ts +1 -1
  85. package/types/pc/date-picker/RangePicker.d.ts +1 -1
  86. package/types/pc/form/FormList.d.ts +5 -5
  87. package/types/pc/form/hook/useForm.d.ts +5 -0
  88. package/types/pc/form/index.d.ts +3 -2
  89. package/types/pc/icons/file/index.d.ts +4 -0
  90. package/types/pc/icons/file/interface.d.ts +7 -0
  91. package/types/pc/index.d.ts +3 -0
  92. package/types/pc/space/index.d.ts +3 -5
  93. package/types/pc/space/interface.d.ts +10 -28
  94. package/types/pc/space-/index.d.ts +6 -0
  95. package/types/pc/space-/interface.d.ts +38 -0
  96. package/types/pc/space-/toArray.d.ts +3 -0
  97. package/types/pc/table/interface.d.ts +3 -1
  98. package/types/pc/table/util.d.ts +1 -1
  99. package/typography/Ellipsis.js +4 -2
  100. package/typography/index.js +1 -1
  101. package/version/index.js +1 -1
  102. package/form/useForm.js +0 -53
  103. package/types/pc/form/useForm.d.ts +0 -4
  104. package/types/pc/space/toArray.d.ts +0 -2
package/form/Form.js CHANGED
@@ -1,160 +1,16 @@
1
- import { jsx as p } from "react/jsx-runtime";
2
- import { p as O } from "../chunk/Coz3rCng.js";
3
- import A from "lodash/isPlainObject";
4
- import _ from "lodash/merge";
5
- import { forwardRef as H, useContext as V, useRef as U, useEffect as W, useImperativeHandle as X } from "react";
6
- import { a as B, b as G } from "../chunk/B44Hj5ad.js";
7
- import { u as J } from "../chunk/5_U1CBIu.js";
8
- import { u as K } from "../chunk/BFTV6myl.js";
9
- import L from "@unicom-cloud/utils/class-name";
10
- import { o as Q } from "../chunk/BKKEev13.js";
11
- import { FormProviderContext as Y, FormContext as Z } from "./context.js";
12
- import ee from "./useForm.js";
13
- import { ID_SUFFIX as oe } from "./util.js";
14
- function f(a, u) {
15
- const n = u.replace(/[[.]/g, "_").replace(/\]/g, "");
16
- return a ? `${a}-${n}` : `${n}`;
17
- }
18
- const re = {
19
- layout: "horizontal",
20
- labelCol: { span: 5, offset: 0 },
21
- labelAlign: "right",
22
- wrapperCol: { span: 19, offset: 0 },
23
- requiredSymbol: !0,
24
- wrapper: "form",
25
- validateTrigger: "onChange"
26
- }, te = (a, u) => {
27
- var h, S, $, y;
28
- const n = V(B), t = V(Y), d = U(null), [l] = ee(
29
- a.form
30
- ), e = K(
31
- a,
32
- re,
33
- (h = n.componentConfig) == null ? void 0 : h.Form
34
- ), {
35
- layout: g,
36
- labelCol: R,
37
- wrapperCol: w,
38
- wrapper: I,
39
- id: F,
40
- requiredSymbol: M,
41
- labelAlign: N,
42
- disabled: z,
43
- colon: T,
44
- className: E,
45
- validateTrigger: P,
46
- prefixCls: q,
47
- validateMessages: D,
48
- ...j
49
- } = e, m = q || ((S = n.getPrefixCls) == null ? void 0 : S.call(n, "form")), k = n.rtl, b = "size" in e ? e.size : n.size, C = l.getInnerMethods(!0);
50
- J(() => {
51
- C.innerSetInitialValues(e.initialValues);
52
- }), W(() => {
53
- let o;
54
- return t.register && (o = t.register(e.id, l)), o;
55
- }, [e.id, l]), l.scrollToField = (o, s) => {
56
- const r = d.current, i = e.id;
57
- if (!r)
58
- return;
59
- let c = r.querySelector(
60
- `#${f(i, o)}`
61
- );
62
- c || (c = r.querySelector(
63
- `#${f(i, o)}${oe}`
64
- )), c && O(c, {
65
- behavior: "smooth",
66
- block: "nearest",
67
- scrollMode: "if-needed",
68
- ...s
69
- });
70
- }, C.innerSetCallbacks({
71
- onValuesChange: (o, s) => {
72
- var r, i;
73
- (r = e.onValuesChange) == null || r.call(e, o, s), (i = t.onFormValuesChange) == null || i.call(t, e.id, o);
74
- },
75
- onChange: e.onChange,
76
- onValidateFail: (o) => {
77
- const s = e.scrollToFirstError;
78
- if (s) {
79
- const r = A(s) ? s : {};
80
- l.scrollToField(
81
- Object.keys(o)[0],
82
- r
83
- );
84
- }
85
- },
86
- onSubmitFailed: e.onSubmitFailed,
87
- onSubmit: (o) => {
88
- var r, i;
89
- const s = (r = e.onSubmit) == null ? void 0 : r.call(e, o);
90
- return (i = t.onFormSubmit) == null || i.call(t, e.id, o), s;
91
- },
92
- onReset: (o) => {
93
- var r, i;
94
- const s = (r = e.onReset) == null ? void 0 : r.call(e, o);
95
- return (i = t == null ? void 0 : t.onFormReset) == null || i.call(t, e.id, o), s;
96
- }
97
- });
98
- const v = {
99
- requiredSymbol: M,
100
- labelAlign: N,
101
- disabled: z,
102
- colon: T,
103
- labelCol: R,
104
- wrapperCol: w,
105
- layout: g,
106
- store: l,
107
- prefixCls: m,
108
- validateTrigger: P,
109
- validateMessages: _(
110
- {},
111
- (y = ($ = n.locale) == null ? void 0 : $.Form) == null ? void 0 : y.validateMessages,
112
- D
113
- ),
114
- getFormElementId: (o) => f(F, o)
115
- }, x = Z;
116
- return X(u, () => ({
117
- ...l,
118
- getRootDOMNode() {
119
- return d.current;
120
- }
121
- })), /* @__PURE__ */ p(G, { ...n, childrenName: "Form", size: b, children: /* @__PURE__ */ p(x.Provider, { value: v, children: /* @__PURE__ */ p(
122
- I,
123
- {
124
- ref: d,
125
- ...Q(j, [
126
- "form",
127
- "size",
128
- "initialValues",
129
- "onValuesChange",
130
- "onChange",
131
- "wrapperProps",
132
- "scrollToFirstError",
133
- "onSubmit",
134
- "onSubmitFailed",
135
- "onReset"
136
- ]),
137
- ...e.wrapperProps,
138
- className: L(
139
- m,
140
- `${m}-${g}`,
141
- `${m}-size-${b}`,
142
- { [`${m}-rtl`]: k },
143
- E
144
- ),
145
- style: e.style,
146
- onSubmit: (o) => {
147
- o.preventDefault(), o.stopPropagation(), l.submit();
148
- },
149
- onReset: (o) => {
150
- o.preventDefault(), o.stopPropagation(), l.resetFields();
151
- },
152
- id: F,
153
- children: e.children
154
- }
155
- ) }) });
156
- }, ne = H(te);
157
- ne.displayName = "Form";
1
+ import "react/jsx-runtime";
2
+ import "../chunk/Coz3rCng.js";
3
+ import "lodash/isPlainObject";
4
+ import "lodash/merge";
5
+ import "react";
6
+ import "../chunk/B44Hj5ad.js";
7
+ import "../chunk/5_U1CBIu.js";
8
+ import "../chunk/BFTV6myl.js";
9
+ import "@unicom-cloud/utils/class-name";
10
+ import "../chunk/BKKEev13.js";
11
+ import "./context.js";
12
+ import { F } from "../chunk/BP4igg_F.js";
13
+ import "./util.js";
158
14
  export {
159
- ne as default
15
+ F as default
160
16
  };
package/form/FormList.js CHANGED
@@ -7,7 +7,8 @@ import G from "../utils/warning.js";
7
7
  import b from "./FormItem.js";
8
8
  import { FormListContext as I } from "./context.js";
9
9
  import { isFieldMatch as O, isSyntheticEvent as R } from "./util.js";
10
- const L = (i, n) => !S(i) && i >= 0 && i < n.length, U = (i) => {
10
+ const L = (i, n) => !S(i) && i >= 0 && i < n.length;
11
+ function U(i) {
11
12
  const { field: n, children: v, initialValue: k } = i, p = j({
12
13
  id: 0,
13
14
  keys: []
@@ -93,7 +94,7 @@ const L = (i, n) => !S(i) && i >= 0 && i < n.length, U = (i) => {
93
94
  )
94
95
  }
95
96
  );
96
- };
97
+ }
97
98
  U.displayName = "FormList";
98
99
  export {
99
100
  U as default
package/form/index.js CHANGED
@@ -1,107 +1,108 @@
1
- import M from "./Form.js";
2
- import y from "./Control.js";
1
+ import { F as M, g as y, u as E } from "../chunk/BP4igg_F.js";
2
+ import J from "./Control.js";
3
3
  import L from "./FormItem.js";
4
- import E from "./FormList.js";
5
- import J from "./FormProvider.js";
6
- import { useContext as g, useRef as d, useCallback as R, useEffect as C, useState as w } from "react";
4
+ import N from "./FormList.js";
5
+ import O from "./FormProvider.js";
6
+ import { useContext as g, useRef as S, useCallback as R, useEffect as C, useState as w } from "react";
7
7
  import { FormContext as b } from "./context.js";
8
- import { u as N } from "../chunk/CQ_WOOmf.js";
8
+ import { u as P } from "../chunk/CQ_WOOmf.js";
9
9
  import V from "../utils/warning.js";
10
- import { SubmitStatus as O } from "./interface.js";
11
- import P from "lodash/isEqualWith";
10
+ import { SubmitStatus as U } from "./interface.js";
11
+ import h from "lodash/isEqualWith";
12
12
  import v from "lodash/get";
13
- import U from "lodash/isArray";
14
- import h from "lodash/isString";
15
- import k from "./useForm.js";
16
- const q = () => {
17
- const s = g(b), r = s.store, a = d(!1), t = N(), f = R(() => {
18
- var u, o, e;
19
- const { submitStatus: i } = ((e = (o = (u = r == null ? void 0 : r.getInnerMethods) == null ? void 0 : u.call(r, !0)) == null ? void 0 : o.innerGetStoreStatus) == null ? void 0 : e.call(o)) ?? {}, n = i === O.submitting;
13
+ import k from "lodash/isArray";
14
+ import q from "lodash/isString";
15
+ const A = () => {
16
+ const s = g(b), o = s.store, a = S(!1), t = P(), f = R(() => {
17
+ var u, e, r;
18
+ const { submitStatus: i } = ((r = (e = (u = o == null ? void 0 : o.getInnerMethods) == null ? void 0 : u.call(o, !0)) == null ? void 0 : e.innerGetStoreStatus) == null ? void 0 : r.call(e)) ?? {}, n = i === U.submitting;
20
19
  n !== a.current && (a.current = n, t());
21
20
  }, []);
22
21
  return C(() => {
23
- var o;
24
- if (!r) {
22
+ var e;
23
+ if (!o) {
25
24
  V(!0, "formInstance is not available");
26
25
  return;
27
26
  }
28
- const { registerFormWatcher: i } = ((o = r == null ? void 0 : r.getInnerMethods) == null ? void 0 : o.call(r, !0)) ?? {}, n = () => f();
27
+ const { registerFormWatcher: i } = ((e = o == null ? void 0 : o.getInnerMethods) == null ? void 0 : e.call(o, !0)) ?? {}, n = () => f();
29
28
  n();
30
29
  const u = (i == null ? void 0 : i(n)) ?? {};
31
30
  return () => {
32
31
  u == null || u();
33
32
  };
34
33
  }, []), {
35
- form: r,
34
+ form: o,
36
35
  disabled: s.disabled,
37
36
  isSubmitting: a.current
38
37
  };
39
- }, A = (s, r) => {
40
- const a = g(b), t = r || a.store, f = d(s);
38
+ }, G = (s, o) => {
39
+ const a = g(b), t = o || a.store, f = S(s);
41
40
  f.current = s;
42
41
  const i = R(() => {
43
- const e = f.current, m = t.getFieldsState([e]);
44
- return m == null ? void 0 : m[e];
45
- }, []), [n, u] = w(i), o = d(n);
42
+ const r = f.current, m = t.getFieldsState([r]);
43
+ return m == null ? void 0 : m[r];
44
+ }, []), [n, u] = w(i), e = S(n);
46
45
  return C(() => {
47
46
  var p;
48
47
  if (!t) {
49
48
  V(!0, "formInstance is not available");
50
49
  return;
51
50
  }
52
- const { registerStateWatcher: e } = ((p = t == null ? void 0 : t.getInnerMethods) == null ? void 0 : p.call(t, !0)) ?? {}, m = () => {
53
- const S = i();
54
- P(o.current, S) || (u(S), o.current = S);
51
+ const { registerStateWatcher: r } = ((p = t == null ? void 0 : t.getInnerMethods) == null ? void 0 : p.call(t, !0)) ?? {}, m = () => {
52
+ const F = i();
53
+ h(e.current, F) || (u(F), e.current = F);
55
54
  };
56
55
  m();
57
- const l = e == null ? void 0 : e(m);
56
+ const l = r == null ? void 0 : r(m);
58
57
  return () => {
59
58
  l == null || l();
60
59
  };
61
60
  }, []), n;
62
- }, G = (s, r) => {
63
- const a = g(b), t = r || a.store, [f, i] = w(() => {
64
- const o = t == null ? void 0 : t.getFieldsValue([].concat(s));
65
- return h(s) ? v(o, s) : o;
66
- }), n = d(s);
61
+ }, j = (s, o) => {
62
+ const a = g(b), t = o || a.store, [f, i] = w(() => {
63
+ const e = t == null ? void 0 : t.getFieldsValue([].concat(s));
64
+ return q(s) ? v(e, s) : e;
65
+ }), n = S(s);
67
66
  n.current = s;
68
- const u = d(JSON.stringify(f));
67
+ const u = S(JSON.stringify(f));
69
68
  return C(() => {
70
69
  var l;
71
70
  if (!t) {
72
71
  V(!0, "formInstance is not available");
73
72
  return;
74
73
  }
75
- const { registerWatcher: o } = ((l = t == null ? void 0 : t.getInnerMethods) == null ? void 0 : l.call(t, !0)) ?? {}, e = () => {
76
- const p = n.current, S = t.getFieldsValue([].concat(p));
77
- let F = S;
78
- U(p) || (F = v(S, p));
79
- const x = JSON.stringify(F);
80
- u.current !== x && (i(F), u.current = x);
74
+ const { registerWatcher: e } = ((l = t == null ? void 0 : t.getInnerMethods) == null ? void 0 : l.call(t, !0)) ?? {}, r = () => {
75
+ const p = n.current, F = t.getFieldsValue([].concat(p));
76
+ let d = F;
77
+ k(p) || (d = v(F, p));
78
+ const x = JSON.stringify(d);
79
+ u.current !== x && (i(d), u.current = x);
81
80
  };
82
- e();
83
- const m = o == null ? void 0 : o(e);
81
+ r();
82
+ const m = e == null ? void 0 : e(r);
84
83
  return () => {
85
84
  m == null || m();
86
85
  };
87
86
  }, []), f;
88
87
  }, c = M;
89
- c.Provider = J;
88
+ c.Provider = O;
90
89
  c.Item = L;
91
- c.List = E;
92
- c.Control = y;
93
- c.useForm = k;
94
- c.useFormContext = q;
95
- c.useWatch = G;
96
- c.useFormState = A;
90
+ c.List = N;
91
+ c.Control = J;
92
+ c.getFormInstance = y;
93
+ c.useForm = E;
94
+ c.useFormContext = A;
95
+ c.useWatch = j;
96
+ c.useFormState = G;
97
97
  export {
98
- y as FormControl,
98
+ J as FormControl,
99
99
  L as FormItem,
100
- E as FormList,
101
- J as FormProvider,
100
+ N as FormList,
101
+ O as FormProvider,
102
102
  c as default,
103
- k as useForm,
104
- q as useFormContext,
105
- A as useFormState,
106
- G as useWatch
103
+ y as getFormInstance,
104
+ E as useForm,
105
+ A as useFormContext,
106
+ G as useFormState,
107
+ j as useWatch
107
108
  };
package/icons/file.js ADDED
@@ -0,0 +1,67 @@
1
+ import { jsx as l, jsxs as N } from "react/jsx-runtime";
2
+ import { forwardRef as m, useContext as d } from "react";
3
+ import { UI_COMMON_PREFIX as x } from "@unicom-cloud/utils/constant/ui";
4
+ import f from "@unicom-cloud/utils/class-name";
5
+ import { a as g } from "../chunk/B44Hj5ad.js";
6
+ function $(e, c) {
7
+ const { style: s, className: i, backgroundColor: r, color: t, text: a, ...n } = e, o = `${x}-icons-file`;
8
+ return /* @__PURE__ */ l("div", { className: f(o, i), children: /* @__PURE__ */ N(
9
+ "svg",
10
+ {
11
+ ref: c,
12
+ className: `${o}-svg`,
13
+ style: s,
14
+ ...n,
15
+ width: "100%",
16
+ height: "100%",
17
+ viewBox: "0 0 166 200",
18
+ version: "1.1",
19
+ children: [
20
+ /* @__PURE__ */ l(
21
+ "path",
22
+ {
23
+ className: `${o}-svg-bg`,
24
+ d: "M9.911,0c-5.4,0.149 -9.792,4.556 -9.911,9.944l0,179.114c-0.012,2.627 1.066,5.147 2.976,6.956c1.811,1.889 4.312,2.968 6.931,2.991l145.363,-0c2.623,0.008 5.134,-1.075 6.928,-2.985c1.88,-1.833 2.952,-4.34 2.976,-6.962l0,-132.696l-56.159,-56.362l-99.111,0l0.007,0Z",
25
+ style: {
26
+ fill: r
27
+ }
28
+ }
29
+ ),
30
+ /* @__PURE__ */ l(
31
+ "path",
32
+ {
33
+ className: `${o}-svg-tr`,
34
+ d: "M165.174,55.97l-46.193,0c-5.379,-0.13 -9.768,-4.505 -9.904,-9.872l0,-46.098l56.088,55.97l0.009,0Z"
35
+ }
36
+ ),
37
+ /* @__PURE__ */ l(
38
+ "text",
39
+ {
40
+ className: `${o}-svg-text`,
41
+ x: "16.351px",
42
+ y: "142.967px",
43
+ style: {
44
+ fill: t
45
+ },
46
+ children: a ?? "doc"
47
+ }
48
+ )
49
+ ]
50
+ }
51
+ ) });
52
+ }
53
+ const p = m($);
54
+ p.displayName = "IconFile";
55
+ function h(e, c) {
56
+ const {
57
+ getPrefixCls: s,
58
+ locale: i,
59
+ componentConfig: r
60
+ } = d(g), { className: t, ...a } = e, n = s == null ? void 0 : s("icons-file");
61
+ return /* @__PURE__ */ l(p, { ref: c, ...a, className: f(n, t) });
62
+ }
63
+ const v = m(h);
64
+ v.displayName = "IconFile";
65
+ export {
66
+ v as default
67
+ };