@unicom-cloud/ui 0.8.107 → 0.8.108

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 (137) hide show
  1. package/ColorPicker.js +15 -14
  2. package/Constant.js +4 -0
  3. package/Copy.js +4 -3
  4. package/Countdown.js +25 -0
  5. package/Grid.js +8 -10
  6. package/LiquidFill.js +4 -3
  7. package/List.js +7 -6
  8. package/Marquee.js +4 -3
  9. package/PageHeader.js +3 -2
  10. package/QrCode.js +4 -3
  11. package/RowCol.js +8 -0
  12. package/Segmented.js +14 -4
  13. package/Statistic.js +5 -4
  14. package/Tour.js +4 -3
  15. package/Transfer.js +4 -2
  16. package/anchor/Link.js +1 -1
  17. package/avatar/Group.js +1 -1
  18. package/button/index.js +52 -51
  19. package/calendar/Lunar.js +21 -21
  20. package/cascader/base/node.js +22 -20
  21. package/cascader/base/store.js +10 -10
  22. package/cascader/util.js +29 -27
  23. package/color-picker/Mode.js +8 -7
  24. package/color-picker/hooks/useColorPicker.js +56 -55
  25. package/color-picker/index.js +54 -53
  26. package/color-picker/utils.js +58 -57
  27. package/components/common/empty/index.js +2 -2
  28. package/components/common/flex/index.js +64 -55
  29. package/components/common/flex/interface.js +6 -6
  30. package/components/common/hooks/useInterval.js +6 -6
  31. package/components/common/space/index.js +53 -53
  32. package/components/common/utils/dayjs.js +75 -62
  33. package/components/common/utils/toArray.js +7 -5
  34. package/constant/index.js +4 -0
  35. package/copy/index.js +2 -1
  36. package/countdown/index.js +113 -0
  37. package/countdown/interface.js +1 -0
  38. package/countdown/util.js +29 -0
  39. package/descriptions/index.js +26 -26
  40. package/dropdown/Button.js +1 -1
  41. package/flex/index.js +30 -29
  42. package/form/FormItem.js +126 -122
  43. package/grid/Grid.js +40 -41
  44. package/grid/Item.js +37 -37
  45. package/grid/context.js +2 -3
  46. package/grid/index.js +6 -8
  47. package/hooks/useResponsiveState.js +54 -0
  48. package/index.js +614 -610
  49. package/input/InputElement.js +25 -24
  50. package/layout/Sider.js +1 -1
  51. package/liquid-fill/index.js +4 -3
  52. package/list/Item.js +21 -21
  53. package/list/index.js +53 -52
  54. package/marquee/index.js +20 -19
  55. package/marquee-/index.js +4 -3
  56. package/mentions/util.js +9 -8
  57. package/package.json +1 -1
  58. package/page-header/index.js +57 -56
  59. package/pagination/Pagination.js +89 -92
  60. package/qr-code/index.js +4 -3
  61. package/radio/Group.js +1 -1
  62. package/row-col/Col-.js +88 -0
  63. package/row-col/Col.js +159 -0
  64. package/row-col/Row.js +73 -0
  65. package/row-col/context.js +5 -0
  66. package/row-col/index.js +11 -0
  67. package/row-col/interface.js +1 -0
  68. package/segmented/index.js +257 -206
  69. package/select/Select.js +191 -191
  70. package/select/util.js +50 -50
  71. package/space/index.js +15 -13
  72. package/statistic/index.js +56 -55
  73. package/statistic/interface.js +4 -1
  74. package/style.css +1 -1
  75. package/table/hook/useColumns.js +27 -26
  76. package/table/hook/useStickyClassNames.js +9 -8
  77. package/table/hook/useThResizable.js +4 -3
  78. package/table/th-resizable/index.js +11 -10
  79. package/table/thead/index.js +18 -16
  80. package/timeline/Item.js +1 -1
  81. package/tour/index.js +4 -3
  82. package/transfer/index.js +93 -91
  83. package/trigger/index.js +66 -66
  84. package/types/common/flex/index.d.ts +3 -9
  85. package/types/common/flex/interface.d.ts +15 -4
  86. package/types/common/space/index.d.ts +3 -5
  87. package/types/common/space/interface.d.ts +2 -0
  88. package/types/common/utils/dayjs.d.ts +3 -1
  89. package/types/pc/button/interface.d.ts +2 -2
  90. package/types/pc/config-provider/interface.d.ts +16 -11
  91. package/types/pc/constant/index.d.ts +1 -0
  92. package/types/pc/countdown/interface.d.ts +65 -0
  93. package/types/pc/countdown/util.d.ts +7 -0
  94. package/types/pc/flex/index.d.ts +8 -6
  95. package/types/pc/flex/interface.d.ts +3 -10
  96. package/types/pc/form/FormItem.d.ts +1 -1
  97. package/types/pc/form/interface.d.ts +1 -1
  98. package/types/pc/grid/Grid.d.ts +1 -2
  99. package/types/pc/grid/Item.d.ts +1 -2
  100. package/types/pc/grid/context.d.ts +0 -5
  101. package/types/pc/grid/index.d.ts +4 -6
  102. package/types/pc/grid/interface.d.ts +7 -125
  103. package/types/pc/hooks/useResponsiveState.d.ts +3 -0
  104. package/types/pc/index.d.ts +7 -3
  105. package/types/pc/list/interface.d.ts +2 -1
  106. package/types/pc/pagination/PageOption.d.ts +0 -1
  107. package/types/pc/pagination/interface.d.ts +5 -6
  108. package/types/pc/{grid → row-col}/Col-.d.ts +1 -1
  109. package/types/pc/{grid → row-col}/Col.d.ts +1 -2
  110. package/types/pc/{grid → row-col}/Row.d.ts +1 -2
  111. package/types/pc/row-col/context.d.ts +6 -0
  112. package/types/pc/row-col/index.d.ts +7 -0
  113. package/types/pc/row-col/interface.d.ts +112 -0
  114. package/types/pc/segmented/index.d.ts +3 -7
  115. package/types/pc/segmented/interface.d.ts +38 -5
  116. package/types/pc/space/index.d.ts +5 -7
  117. package/types/pc/space/interface.d.ts +3 -10
  118. package/types/pc/statistic/index.d.ts +1 -1
  119. package/types/pc/statistic/interface.d.ts +1 -49
  120. package/types/pc/utils/names.d.ts +121 -113
  121. package/types/pc/utils/responsiveObserve.d.ts +8 -8
  122. package/typography/Ellipsis.js +5 -4
  123. package/typography/Operations.js +4 -3
  124. package/utils/dayjs.js +13 -11
  125. package/utils/index.js +244 -242
  126. package/utils/names.js +15 -10
  127. package/utils/responsiveObserve.js +43 -36
  128. package/version/index.js +1 -1
  129. package/grid/Col-.js +0 -86
  130. package/grid/Col.js +0 -169
  131. package/grid/Row.js +0 -96
  132. package/grid/hook/useResponsiveState.js +0 -35
  133. package/statistic/Countdown.js +0 -56
  134. package/statistic/util.js +0 -33
  135. package/types/pc/grid/hook/useResponsiveState.d.ts +0 -2
  136. package/types/pc/statistic/util.d.ts +0 -1
  137. /package/types/pc/{statistic/Countdown.d.ts → countdown/index.d.ts} +0 -0
@@ -1,21 +1,21 @@
1
- import i, { isDayjs as w } from "dayjs";
2
- import j from "dayjs/plugin/advancedFormat";
3
- import F from "dayjs/plugin/customParseFormat";
4
- import Y from "dayjs/plugin/isBetween";
1
+ import i, { isDayjs as p } from "dayjs";
2
+ import v from "dayjs/plugin/advancedFormat";
3
+ import j from "dayjs/plugin/customParseFormat";
4
+ import M from "dayjs/plugin/isBetween";
5
5
  import k from "dayjs/plugin/quarterOfYear";
6
6
  import A from "dayjs/plugin/timezone";
7
- import M from "dayjs/plugin/utc";
7
+ import H from "dayjs/plugin/utc";
8
8
  import S from "dayjs/plugin/weekOfYear";
9
9
  import $ from "dayjs/plugin/weekYear";
10
- import d from "lodash/isArray";
11
- import m from "lodash/isUndefined";
12
- i.extend(F);
13
- i.extend(Y);
14
- i.extend(S);
10
+ import "./is.js";
11
+ import { isArray as d, isUndefined as m } from "@unicom-cloud/utils/is";
15
12
  i.extend(j);
13
+ i.extend(M);
14
+ i.extend(S);
15
+ i.extend(v);
16
16
  i.extend($);
17
17
  i.extend(k);
18
- i.extend(M);
18
+ i.extend(H);
19
19
  i.extend(A);
20
20
  const s = i, y = {
21
21
  add(t, e, n) {
@@ -43,9 +43,9 @@ const s = i, y = {
43
43
  hour: 3,
44
44
  minute: 4,
45
45
  second: 5
46
- }, D = {}, H = (t, e) => {
46
+ }, x = {}, P = (t, e) => {
47
47
  const n = `${t}|short`;
48
- let r = D[n];
48
+ let r = x[n];
49
49
  return r || (r = new Intl.DateTimeFormat("en-US", {
50
50
  hour12: !1,
51
51
  timeZone: t,
@@ -55,15 +55,15 @@ const s = i, y = {
55
55
  hour: "2-digit",
56
56
  minute: "2-digit",
57
57
  second: "2-digit"
58
- }), D[n] = r), r;
59
- }, P = (t, e) => {
58
+ }), x[n] = r), r;
59
+ }, b = (t, e) => {
60
60
  const n = new Date(t);
61
- return H(e).formatToParts(n);
61
+ return P(e).formatToParts(n);
62
62
  }, g = (t, e) => {
63
- const n = P(t, e), r = [];
63
+ const n = b(t, e), r = [];
64
64
  for (let c = 0; c < n.length; c += 1) {
65
- const { type: l, value: v } = n[c], x = C[l];
66
- x >= 0 && (r[x] = parseInt(v, 10));
65
+ const { type: O, value: F } = n[c], T = C[O];
66
+ T >= 0 && (r[T] = parseInt(F, 10));
67
67
  }
68
68
  const o = r[3], f = o === 24 ? 0 : o, u = Date.UTC(
69
69
  r[0],
@@ -75,9 +75,9 @@ const s = i, y = {
75
75
  0
76
76
  );
77
77
  let a = +t;
78
- const O = a % 1e3;
79
- return a -= O, (u - a) / (60 * 1e3);
80
- }, b = (t, e, n) => {
78
+ const l = a % 1e3;
79
+ return a -= l, (u - a) / (60 * 1e3);
80
+ }, U = (t, e, n) => {
81
81
  let r = t - e * 60 * 1e3;
82
82
  const o = g(r, n);
83
83
  if (e === o)
@@ -86,29 +86,29 @@ const s = i, y = {
86
86
  const f = g(r, n);
87
87
  return o === f ? [r, o] : [t - Math.min(o, f) * 60 * 1e3, Math.max(o, f)];
88
88
  };
89
- function T(t, e) {
89
+ function Y(t, e) {
90
90
  const n = g(t, e);
91
- return b(t, n, e)[1];
91
+ return U(t, n, e)[1];
92
92
  }
93
- function E(t, e) {
94
- return m(t) && !e ? s() : h(s(), t, e);
93
+ function K(t, e) {
94
+ return m(t) && !e ? s() : D(s(), t, e);
95
95
  }
96
- function h(t, e, n, r) {
96
+ function D(t, e, n, r) {
97
97
  if (!t || m(e) && !n)
98
98
  return t;
99
- const o = -t.toDate().getTimezoneOffset(), f = m(e) ? n ? T(t.valueOf(), n) : o : e, u = Math.abs(f) <= 16 ? f * 60 : f, a = r ? o - u : u - o, O = n ? T(s(t).valueOf() + a * 60 * 1e3, n) : f, c = a - (f - O), l = r || !m(e) ? a : c;
100
- return s(s(t).valueOf() + l * 60 * 1e3);
99
+ const o = -t.toDate().getTimezoneOffset(), f = m(e) ? n ? Y(t.valueOf(), n) : o : e, u = Math.abs(f) <= 16 ? f * 60 : f, a = r ? o - u : u - o, l = n ? Y(s(t).valueOf() + a * 60 * 1e3, n) : f, c = a - (f - l), O = r || !m(e) ? a : c;
100
+ return s(s(t).valueOf() + O * 60 * 1e3);
101
101
  }
102
- function J(t, e, n) {
103
- return h(t, e, n, !0);
102
+ function X(t, e, n) {
103
+ return D(t, e, n, !0);
104
104
  }
105
- function K(t) {
105
+ function _(t) {
106
106
  const e = ["H", "h", "m", "s", "A", "a"];
107
107
  let n = "";
108
108
  return e.some((r) => t.indexOf(r) !== -1 ? (n = `${r}${t.split(` ${r}`)[1]}`, !0) : !1), n || "HH:mm:ss";
109
109
  }
110
- function U(t, e) {
111
- if (w(t))
110
+ function I(t, e = "YYYY-MM-DD HH:mm:ss") {
111
+ if (p(t))
112
112
  return s(t.valueOf());
113
113
  if (typeof t == "string") {
114
114
  const n = s(t, e);
@@ -116,19 +116,30 @@ function U(t, e) {
116
116
  }
117
117
  return s(t);
118
118
  }
119
- function p(t, e, n, r) {
120
- let o = U(t, e);
121
- return (n !== void 0 || r) && (o = h(o, n, r)), o;
119
+ function w(t, e, n, r) {
120
+ let o = I(t, e);
121
+ return (n !== void 0 || r) && (o = D(o, n, r)), o;
122
122
  }
123
- function X(t, e, n, r) {
124
- if (!t) return;
125
- const o = d(e) ? e : [e];
126
- return d(t) ? t.map((f, u, a) => {
127
- if (f)
128
- return p(f, o[u], n, r);
129
- }) : p(t, o[0], n, r);
123
+ function z(t, e, n, r) {
124
+ if (t)
125
+ return d(t) ? t.map((o, f, u) => {
126
+ if (o)
127
+ return w(
128
+ o,
129
+ h(e, f),
130
+ n,
131
+ r
132
+ );
133
+ }) : w(t, h(e, 0), n, r);
130
134
  }
131
- function z(t, e) {
135
+ function h(t = [], e = 0) {
136
+ const n = d(t) ? t : [t];
137
+ let r = n[e];
138
+ for (; !r && n.length > 0 && e > 0; )
139
+ r = n[--e];
140
+ return r;
141
+ }
142
+ function V(t, e) {
132
143
  const n = t.year(), r = t.month(), o = t.date();
133
144
  if (e) {
134
145
  let f = e;
@@ -136,33 +147,35 @@ function z(t, e) {
136
147
  }
137
148
  return t;
138
149
  }
139
- function V(t) {
150
+ function tt(t) {
140
151
  if (!d(t) || !(t[0] && t[1]) || !(t[0].valueOf() > t[1].valueOf())) return t;
141
152
  const e = [...t];
142
153
  return e.sort((n, r) => n.valueOf() - r.valueOf()), e;
143
154
  }
144
- function tt(t, e) {
155
+ function et(t, e) {
145
156
  return e === void 0 && t === void 0 ? !1 : e && !t || !e && t || s(e).valueOf() !== s(t).valueOf();
146
157
  }
147
- function et(t, e) {
148
- return e === void 0 && t === void 0 ? !1 : e && !t || !e && t || d(e) && d(t) && s(e[0]).valueOf() !== s(t[0]).valueOf() || s(e[1]).valueOf() !== s(t[1]).valueOf();
158
+ function nt(t, e) {
159
+ return e === void 0 && t === void 0 ? !1 : e && !t || !e && t || d(e) && d(t) && s(e[0]).valueOf() !== s(t[0]).valueOf() || s(e?.[1]).valueOf() !== s(t?.[1]).valueOf();
149
160
  }
150
- function nt(t, e, n) {
151
- return typeof t == "string" && s(t, e).format(d(e) ? e[n] : e) === t;
161
+ function rt(t, e, n) {
162
+ return typeof t == "string" && s(t, e).format(h(e, n ?? 0)) === t;
152
163
  }
153
164
  export {
154
165
  s as dayjs,
155
166
  s as default,
156
- X as getDayjsValue,
157
- E as getNow,
158
- V as getSortedDayjsArray,
159
- K as getTimeFormat,
160
- z as getValueWithTime,
161
- et as isDayjsArrayChange,
162
- tt as isDayjsChange,
163
- nt as isValidTimeString,
167
+ I as formatValue,
168
+ z as getDayjsValue,
169
+ K as getNow,
170
+ w as getRealTime,
171
+ tt as getSortedDayjsArray,
172
+ _ as getTimeFormat,
173
+ V as getValueWithTime,
174
+ nt as isDayjsArrayChange,
175
+ et as isDayjsChange,
176
+ rt as isValidTimeString,
164
177
  y as methods,
165
- T as timezoneToOffset,
166
- J as toLocal,
167
- h as toTimezone
178
+ Y as timezoneToOffset,
179
+ X as toLocal,
180
+ D as toTimezone
168
181
  };
@@ -1,9 +1,11 @@
1
- import o from "react";
2
- import { isFragment as a } from "react-is";
3
- function t(s, p = {}) {
1
+ import s from "react";
2
+ import { isFragment as f } from "react-is";
3
+ import "./is.js";
4
+ import { isArray as m } from "@unicom-cloud/utils/is";
5
+ function t(o, p = {}) {
4
6
  const e = [];
5
- return o.Children.forEach(s, (r) => {
6
- r == null && !p.keepEmpty || (Array.isArray(r) ? e.push(...t(r, p)) : a(r) && "props" in r && r.props ? e.push(...t(r.props.children, p)) : e.push(r));
7
+ return s.Children.forEach(o, (r) => {
8
+ r == null && !p.keepEmpty || (m(r) ? e.push(...t(r, p)) : f(r) && "props" in r && r.props ? e.push(...t(r.props.children, p)) : e.push(r));
7
9
  }), e;
8
10
  }
9
11
  export {
@@ -0,0 +1,4 @@
1
+ const o = 24;
2
+ export {
3
+ o as COLS
4
+ };
package/copy/index.js CHANGED
@@ -44,7 +44,7 @@ import "../dist/react-transition-group/src/SwitchTransition.js";
44
44
  import "../dist/react-transition-group/chunk/CPfP7aNL.js";
45
45
  import "../dist/react-transition-group/src/TransitionGroup.js";
46
46
  import "../components/common/utils/reactDOM.js";
47
- import "uuid";
47
+ import "../utils/responsiveObserve.js";
48
48
  import "@unicom-cloud/utils/file/saveAs";
49
49
  import "@unicom-cloud/utils/screenfull";
50
50
  import "@unicom-cloud/utils/tinycolor";
@@ -54,6 +54,7 @@ import "lodash/isPlainObject";
54
54
  import "react-is";
55
55
  import "@unicom-cloud/utils/tree";
56
56
  import { isFunction as v } from "@unicom-cloud/utils/is";
57
+ import "uuid";
57
58
  import "../dist/validate/src/index.js";
58
59
  import "@unicom-cloud/utils/constant/keyboardCode";
59
60
  import F from "../config-provider/context.js";
@@ -0,0 +1,113 @@
1
+ import { jsxs as _, jsx as m } from "react/jsx-runtime";
2
+ import a from "dayjs";
3
+ import { forwardRef as A, useContext as E, useRef as H, useState as M, useEffect as x } from "react";
4
+ import "../config-provider/ConfigProvider.js";
5
+ import "lodash/isEqualWith";
6
+ import "../components/common/utils/is.js";
7
+ import "@unicom-cloud/utils/constant/keyboardCode";
8
+ import "lodash/isNumber";
9
+ import "lodash/merge";
10
+ import "../components/common/utils/dom.js";
11
+ import "../components/common/hooks/useIntersectionObserver.js";
12
+ import O from "../components/common/hooks/useMergeProps.js";
13
+ import "../components/common/utils/reactDOM.js";
14
+ import "@unicom-cloud/utils/constant";
15
+ import "lodash/debounce";
16
+ import { PREFIX_CLASS_STATISTIC as b } from "../statistic/interface.js";
17
+ import l from "@unicom-cloud/utils/class-name";
18
+ import { getDayjsValue as k, getNow as L } from "../components/common/utils/dayjs.js";
19
+ import { getDateString as X } from "./util.js";
20
+ import q from "../config-provider/context.js";
21
+ import { isFunction as y } from "@unicom-cloud/utils/is";
22
+ function z(N, S) {
23
+ const { getPrefixCls: f, componentConfig: $, rtl: u } = E(q), h = O(
24
+ N,
25
+ {
26
+ noStyle: !1,
27
+ start: !0
28
+ },
29
+ $?.Countdown
30
+ ), {
31
+ style: D,
32
+ className: P,
33
+ title: c,
34
+ styleValue: T,
35
+ value: j,
36
+ format: p = "HH:mm:ss",
37
+ start: d = !0,
38
+ noStyle: F,
39
+ loop: I,
40
+ renderFormat: C,
41
+ onFinish: v
42
+ } = h, t = !F && f?.(b), e = f?.("countdown"), o = H(null), [w, R] = M(r()());
43
+ function r() {
44
+ const i = a().valueOf() + a(j).valueOf(), s = k(i, p) || a();
45
+ return () => s.diff(L());
46
+ }
47
+ function n() {
48
+ o.current === null || (window.clearInterval(o.current), o.current = null);
49
+ }
50
+ function V() {
51
+ let i = r();
52
+ o.current = window.setInterval(() => {
53
+ const s = i();
54
+ s <= 0 && (I ? i = r() : n(), y(v) && v()), R(s);
55
+ }, 1e3 / 30);
56
+ }
57
+ const g = X(Math.max(w, 0), p);
58
+ return x(() => (d && o.current === null && r()() > 0 ? V() : n(), () => {
59
+ n();
60
+ }), [d]), x(() => () => {
61
+ n();
62
+ }, []), /* @__PURE__ */ _(
63
+ "div",
64
+ {
65
+ ref: S,
66
+ style: D,
67
+ className: l(
68
+ !!t && t,
69
+ { [`${t}-rtl`]: !!t && u },
70
+ e,
71
+ { [`${e}-rtl`]: u },
72
+ P
73
+ ),
74
+ children: [
75
+ c && /* @__PURE__ */ m(
76
+ "div",
77
+ {
78
+ className: l(
79
+ !!t && `${t}-title`,
80
+ `${e}-title`
81
+ ),
82
+ children: c
83
+ }
84
+ ),
85
+ /* @__PURE__ */ m(
86
+ "div",
87
+ {
88
+ className: l(
89
+ !!t && `${t}-content`,
90
+ `${e}-content`
91
+ ),
92
+ children: /* @__PURE__ */ m(
93
+ "div",
94
+ {
95
+ style: T,
96
+ className: l(
97
+ !!t && `${t}-value`,
98
+ `${e}-value`
99
+ ),
100
+ children: y(C) ? C(w, g) : g
101
+ }
102
+ )
103
+ }
104
+ )
105
+ ]
106
+ }
107
+ );
108
+ }
109
+ const B = A(z);
110
+ B.displayName = "Countdown";
111
+ export {
112
+ B as default
113
+ };
@@ -0,0 +1 @@
1
+
@@ -0,0 +1,29 @@
1
+ import { padStart as a } from "../components/common/utils/pad.js";
2
+ const p = [
3
+ ["Y", 1e3 * 60 * 60 * 24 * 365],
4
+ // 年
5
+ ["M", 1e3 * 60 * 60 * 24 * 30],
6
+ // 月
7
+ ["D", 1e3 * 60 * 60 * 24],
8
+ // 日
9
+ ["H", 1e3 * 60 * 60],
10
+ // 小时
11
+ ["m", 1e3 * 60],
12
+ // 分钟
13
+ ["s", 1e3],
14
+ // 秒
15
+ ["S", 1]
16
+ // 毫秒
17
+ ];
18
+ function f(c, g) {
19
+ let t = c;
20
+ return p.reduce((e, [r, n]) => {
21
+ if (!e.includes(r))
22
+ return e;
23
+ const o = Math.floor(t / n);
24
+ return t -= o * n, e.replace(new RegExp(`${r}+`, "g"), (i) => a(o.toString(), i.length, "0"));
25
+ }, g);
26
+ }
27
+ export {
28
+ f as getDateString
29
+ };
@@ -18,7 +18,7 @@ function Y(u) {
18
18
  getPrefixCls: f,
19
19
  componentConfig: h,
20
20
  rtl: I,
21
- size: d
21
+ size: v
22
22
  } = B(W), w = Q(
23
23
  u,
24
24
  X,
@@ -27,17 +27,17 @@ function Y(u) {
27
27
  style: D,
28
28
  className: L,
29
29
  column: p,
30
- title: v,
30
+ title: g,
31
31
  data: b,
32
32
  border: O,
33
33
  labelStyle: $,
34
34
  valueStyle: y,
35
35
  colon: N,
36
36
  layout: m,
37
- size: g,
37
+ size: S,
38
38
  tableLayout: j
39
- } = w, n = f?.("descriptions"), [A, E] = G(), S = J(null);
40
- K(() => (S.current = P.subscribe((s) => {
39
+ } = w, n = f?.("descriptions"), [A, E] = G(), d = J();
40
+ K(() => (d.current = P.subscribe((s) => {
41
41
  for (let t = 0; t < k.length; t++) {
42
42
  const e = k[t];
43
43
  if (s[e]) {
@@ -46,41 +46,41 @@ function Y(u) {
46
46
  }
47
47
  }
48
48
  }), () => {
49
- P.unsubscribe(S.current);
49
+ d.current && P.unsubscribe(d.current);
50
50
  }), []);
51
- let l = 3;
52
- q(p) && (l = p[A] || 3), V(p) && p > 0 && (l = p);
51
+ let r = 3;
52
+ q(p) && (r = p[A] || 3), V(p) && p > 0 && (r = p);
53
53
  const i = [];
54
- if (C(b) && b.length > 0 && l) {
54
+ if (C(b) && b.length > 0 && r) {
55
55
  b.forEach((e) => {
56
- const o = i[i.length - 1], r = z(o);
57
- r === 0 ? i.push([
56
+ const o = i[i.length - 1], l = z(o);
57
+ l === 0 ? i.push([
58
58
  {
59
59
  ...e,
60
- span: e.span ? e.span > l ? l : e.span : 1
60
+ span: e.span ? e.span > r ? r : e.span : 1
61
61
  }
62
- ]) : r === l ? i.push([
62
+ ]) : l === r ? i.push([
63
63
  {
64
64
  ...e,
65
- span: e.span ? e.span > l ? l : e.span : 1
65
+ span: e.span ? e.span > r ? r : e.span : 1
66
66
  }
67
67
  ]) : o.push({
68
68
  ...e,
69
- span: e.span ? e.span + r > l ? l - r : e.span : 1
69
+ span: e.span ? e.span + l > r ? r - l : e.span : 1
70
70
  });
71
71
  });
72
72
  const s = i[i.length - 1], t = z(s);
73
- t < l && (s[s.length - 1].span = s[s.length - 1].span + l - t);
73
+ t < r && (s[s.length - 1].span = s[s.length - 1].span + r - t);
74
74
  }
75
75
  function F(s, t) {
76
76
  return /* @__PURE__ */ c(x, { children: [
77
77
  /* @__PURE__ */ a("tr", { className: `${n}-row`, children: s.map((e, o) => {
78
- const r = e.span > 1 ? { colSpan: e.span } : {};
78
+ const l = e.span > 1 ? { colSpan: e.span } : {};
79
79
  return /* @__PURE__ */ c(
80
80
  "td",
81
81
  {
82
82
  className: `${n}-item-label`,
83
- ...r,
83
+ ...l,
84
84
  style: $,
85
85
  children: [
86
86
  e.label,
@@ -91,12 +91,12 @@ function Y(u) {
91
91
  );
92
92
  }) }),
93
93
  /* @__PURE__ */ a("tr", { className: `${n}-row`, children: s.map((e, o) => {
94
- const r = e.span > 1 ? { colSpan: e.span } : {};
94
+ const l = e.span > 1 ? { colSpan: e.span } : {};
95
95
  return /* @__PURE__ */ a(
96
96
  "td",
97
97
  {
98
98
  className: `${n}-item-value`,
99
- ...r,
99
+ ...l,
100
100
  style: y,
101
101
  children: e.value
102
102
  },
@@ -107,7 +107,7 @@ function Y(u) {
107
107
  }
108
108
  function H(s, t) {
109
109
  return /* @__PURE__ */ a("tr", { className: `${n}-row`, children: s.map((e, o) => {
110
- const r = e.span > 1 ? { colSpan: e.span * 2 - 1 } : {};
110
+ const l = e.span > 1 ? { colSpan: e.span * 2 - 1 } : {};
111
111
  return /* @__PURE__ */ c(x, { children: [
112
112
  /* @__PURE__ */ c("td", { className: `${n}-item-label`, style: $, children: [
113
113
  e.label,
@@ -117,7 +117,7 @@ function Y(u) {
117
117
  "td",
118
118
  {
119
119
  className: `${n}-item-value`,
120
- ...r,
120
+ ...l,
121
121
  style: y,
122
122
  children: e.value
123
123
  }
@@ -127,11 +127,11 @@ function Y(u) {
127
127
  }
128
128
  function M(s, t) {
129
129
  return /* @__PURE__ */ a("tr", { className: `${n}-row`, children: s.map((e, o) => {
130
- const r = e.span > 1 ? { colSpan: e.span } : {};
130
+ const l = e.span > 1 ? { colSpan: e.span } : {};
131
131
  return /* @__PURE__ */ c(
132
132
  "td",
133
133
  {
134
- ...r,
134
+ ...l,
135
135
  className: `${n}-item`,
136
136
  children: [
137
137
  /* @__PURE__ */ c(
@@ -167,14 +167,14 @@ function Y(u) {
167
167
  {
168
168
  [`${n}-border`]: O,
169
169
  [`${n}-layout-${m}`]: m,
170
- [`${n}-size-${g || d}`]: g || d,
170
+ [`${n}-size-${S || v}`]: S || v,
171
171
  [`${n}-table-layout-fixed`]: j === "fixed"
172
172
  },
173
173
  I ? `${n}-rtl` : `${n}-ltr`,
174
174
  L
175
175
  );
176
176
  return /* @__PURE__ */ c("div", { className: T, style: D, children: [
177
- v && /* @__PURE__ */ a("div", { className: `${n}-title`, children: v }),
177
+ g && /* @__PURE__ */ a("div", { className: `${n}-title`, children: g }),
178
178
  /* @__PURE__ */ a("div", { className: `${n}-body`, children: /* @__PURE__ */ a("table", { className: `${n}-table`, cellPadding: 0, cellSpacing: 0, children: /* @__PURE__ */ a("tbody", { children: i.map((s, t) => R(s, t)) }) }) })
179
179
  ] });
180
180
  }
@@ -18,7 +18,7 @@ function z(f, l) {
18
18
  const { componentConfig: c } = R(N), i = k(
19
19
  f,
20
20
  v,
21
- c?.["Dropdown.Button"]
21
+ c?.DropdownButton
22
22
  ), {
23
23
  className: a,
24
24
  style: g,
package/flex/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import { jsx as e } from "react/jsx-runtime";
2
- import { forwardRef as m, useContext as x } from "react";
1
+ import { jsx as s } from "react/jsx-runtime";
2
+ import { forwardRef as i, useContext as x } from "react";
3
3
  import d from "../components/common/flex/index.js";
4
4
  import "../config-provider/ConfigProvider.js";
5
5
  import "lodash/isEqualWith";
@@ -9,39 +9,40 @@ import "lodash/isNumber";
9
9
  import "lodash/merge";
10
10
  import "../components/common/utils/dom.js";
11
11
  import "../components/common/hooks/useIntersectionObserver.js";
12
- import C from "../components/common/hooks/useMergeProps.js";
12
+ import u from "../components/common/hooks/useMergeProps.js";
13
13
  import "../components/common/utils/reactDOM.js";
14
14
  import "@unicom-cloud/utils/constant";
15
15
  import "lodash/debounce";
16
- import F from "@unicom-cloud/utils/class-name";
17
- import u from "../config-provider/context.js";
16
+ import C from "@unicom-cloud/utils/class-name";
17
+ import F from "../config-provider/context.js";
18
18
  const N = {
19
19
  children: void 0
20
- }, r = m(
21
- (o, t) => {
22
- const { getPrefixCls: s, componentConfig: p, rtl: l } = x(u), n = C(
23
- o,
24
- N,
25
- p?.Flex
26
- ), { className: a, ...c } = n, f = s?.("flex");
27
- return /* @__PURE__ */ e(
28
- d,
29
- {
30
- ref: t,
31
- className: F(f, a),
32
- rtl: l,
33
- ...c
34
- }
35
- );
36
- }
37
- );
38
- r.displayName = "Flex";
39
- const i = m((o, t) => /* @__PURE__ */ e(r, { ref: t, direction: "column", ...o }));
40
- i.displayName = "FlexVertical";
41
- const B = Object.assign(r, {
42
- Vertical: i
20
+ }, m = i((o, t) => {
21
+ const { getPrefixCls: r, componentConfig: e, rtl: l } = x(F), n = u(
22
+ o,
23
+ N,
24
+ e?.Flex
25
+ ), { className: c, ...a } = n, f = r?.("flex");
26
+ return /* @__PURE__ */ s(
27
+ d,
28
+ {
29
+ ref: t,
30
+ className: C(f, c),
31
+ rtl: l,
32
+ ...a
33
+ }
34
+ );
35
+ });
36
+ m.displayName = "Flex";
37
+ const p = i((o, t) => {
38
+ const { direction: r = "column", ...e } = o;
39
+ return /* @__PURE__ */ s(m, { ...e, ref: t, direction: r });
40
+ });
41
+ p.displayName = "FlexVertical";
42
+ const B = Object.assign(m, {
43
+ Vertical: p
43
44
  });
44
45
  export {
45
- i as FlexVertical,
46
+ p as FlexVertical,
46
47
  B as default
47
48
  };