@unicom-cloud/ui 0.8.106 → 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 (197) hide show
  1. package/App.js +7 -0
  2. package/BackTop.js +2 -4
  3. package/Calendar.js +2 -2
  4. package/ColorPicker.js +15 -14
  5. package/Constant.js +4 -0
  6. package/Copy.js +4 -3
  7. package/Countdown.js +25 -0
  8. package/Grid.js +8 -10
  9. package/LiquidFill.js +4 -3
  10. package/List.js +7 -6
  11. package/Marquee.js +4 -3
  12. package/Modal.js +4 -2
  13. package/PageHeader.js +3 -2
  14. package/QrCode.js +4 -3
  15. package/RowCol.js +8 -0
  16. package/Segmented.js +14 -4
  17. package/Statistic.js +5 -4
  18. package/Tour.js +4 -3
  19. package/Transfer.js +4 -2
  20. package/anchor/Link.js +1 -1
  21. package/app/App.js +26 -0
  22. package/app/context.js +9 -0
  23. package/app/index.js +9 -0
  24. package/app/interface.js +1 -0
  25. package/app/useApp.js +8 -0
  26. package/avatar/Group.js +1 -1
  27. package/back-top/index.js +44 -56
  28. package/button/index.js +52 -51
  29. package/calendar/Lunar.js +71 -0
  30. package/calendar/index.js +11 -11
  31. package/cascader/base/node.js +22 -20
  32. package/cascader/base/store.js +10 -10
  33. package/cascader/util.js +29 -27
  34. package/color-picker/Mode.js +8 -7
  35. package/color-picker/hooks/useColorPicker.js +56 -55
  36. package/color-picker/index.js +49 -48
  37. package/color-picker/utils.js +58 -57
  38. package/components/common/empty/index.js +2 -2
  39. package/components/common/flex/index.js +64 -55
  40. package/components/common/flex/interface.js +6 -6
  41. package/components/common/hooks/useInterval.js +6 -6
  42. package/components/common/icons/file/index.js +13 -11
  43. package/components/common/space/index.js +53 -53
  44. package/components/common/utils/dayjs.js +114 -126
  45. package/components/common/utils/is.js +98 -104
  46. package/components/common/utils/setDir.js +12 -0
  47. package/components/common/utils/setTheme.js +13 -13
  48. package/components/common/utils/toArray.js +7 -5
  49. package/config-provider/ConfigProvider.js +32 -30
  50. package/constant/index.js +4 -0
  51. package/copy/index.js +2 -1
  52. package/countdown/index.js +113 -0
  53. package/countdown/interface.js +1 -0
  54. package/countdown/util.js +29 -0
  55. package/descriptions/index.js +45 -45
  56. package/divider/index.js +28 -20
  57. package/dropdown/Button.js +1 -1
  58. package/empty/index.js +1 -1
  59. package/flex/index.js +30 -29
  60. package/form/FormItem.js +126 -122
  61. package/grid/Grid.js +56 -90
  62. package/grid/Item.js +44 -65
  63. package/grid/context.js +2 -6
  64. package/grid/index.js +6 -8
  65. package/grid/util.js +6 -44
  66. package/hooks/useResponsiveState.js +54 -0
  67. package/index.js +614 -605
  68. package/input/Button.js +12 -12
  69. package/input/Group.js +11 -12
  70. package/input/Input.js +112 -102
  71. package/input/InputElement.js +25 -24
  72. package/input/Search.js +24 -24
  73. package/layout/Sider.js +1 -1
  74. package/liquid-fill/index.js +4 -3
  75. package/list/Item.js +21 -21
  76. package/list/index.js +53 -52
  77. package/marquee/index.js +20 -19
  78. package/marquee-/index.js +4 -3
  79. package/mentions/util.js +9 -8
  80. package/modal/Confirm.js +17 -17
  81. package/modal/Modal.js +247 -237
  82. package/modal/index.js +4 -2
  83. package/modal/use-modal/index.js +2 -2
  84. package/package.json +1 -1
  85. package/page-header/index.js +57 -56
  86. package/pagination/Pagination.js +89 -92
  87. package/qr-code/index.js +4 -3
  88. package/radio/Group.js +1 -1
  89. package/row-col/Col-.js +88 -0
  90. package/row-col/Col.js +159 -0
  91. package/row-col/Row.js +73 -0
  92. package/row-col/context.js +5 -0
  93. package/row-col/index.js +11 -0
  94. package/row-col/interface.js +1 -0
  95. package/segmented/index.js +257 -206
  96. package/select/Select.js +191 -191
  97. package/select/util.js +50 -50
  98. package/select-view/Core.js +31 -28
  99. package/space/index.js +15 -13
  100. package/splitter/SplitBar.js +44 -46
  101. package/statistic/index.js +56 -55
  102. package/statistic/interface.js +4 -1
  103. package/style.css +1 -1
  104. package/table/Table.js +198 -210
  105. package/table/hook/useColumns.js +27 -26
  106. package/table/hook/useStickyClassNames.js +9 -8
  107. package/table/hook/useThResizable.js +4 -3
  108. package/table/th-resizable/index.js +2 -2
  109. package/table/thead/index.js +18 -16
  110. package/time-picker/util.js +20 -30
  111. package/timeline/Item.js +1 -1
  112. package/tour/index.js +4 -3
  113. package/transfer/index.js +93 -91
  114. package/trigger/index.js +66 -66
  115. package/types/common/development/interface.d.ts +3 -3
  116. package/types/common/flex/index.d.ts +3 -9
  117. package/types/common/flex/interface.d.ts +15 -4
  118. package/types/common/space/index.d.ts +3 -5
  119. package/types/common/space/interface.d.ts +2 -0
  120. package/types/common/utils/dayjs.d.ts +3 -1
  121. package/types/common/utils/is.d.ts +3 -4
  122. package/types/common/utils/setDir.d.ts +2 -0
  123. package/types/pc/app/App.d.ts +6 -0
  124. package/types/pc/app/context.d.ts +4 -0
  125. package/types/pc/app/index.d.ts +5 -0
  126. package/types/pc/app/interface.d.ts +17 -0
  127. package/types/pc/app/useApp.d.ts +3 -0
  128. package/types/pc/back-top/interface.d.ts +4 -17
  129. package/types/pc/button/interface.d.ts +2 -2
  130. package/types/pc/calendar/Lunar.d.ts +17 -0
  131. package/types/pc/calendar/index.d.ts +1 -1
  132. package/types/pc/config-provider/interface.d.ts +17 -12
  133. package/types/pc/constant/index.d.ts +1 -0
  134. package/types/pc/countdown/interface.d.ts +65 -0
  135. package/types/pc/countdown/util.d.ts +7 -0
  136. package/types/pc/divider/interface.d.ts +1 -0
  137. package/types/pc/flex/index.d.ts +8 -6
  138. package/types/pc/flex/interface.d.ts +3 -10
  139. package/types/pc/form/FormItem.d.ts +1 -1
  140. package/types/pc/form/interface.d.ts +1 -1
  141. package/types/pc/grid/Grid.d.ts +2 -4
  142. package/types/pc/grid/Item.d.ts +1 -5
  143. package/types/pc/grid/context.d.ts +4 -15
  144. package/types/pc/grid/index.d.ts +4 -6
  145. package/types/pc/grid/interface.d.ts +14 -142
  146. package/types/pc/grid/util.d.ts +1 -10
  147. package/types/pc/hooks/useResponsiveState.d.ts +3 -0
  148. package/types/pc/index.d.ts +10 -4
  149. package/types/pc/input/Button.d.ts +2 -2
  150. package/types/pc/list/interface.d.ts +2 -1
  151. package/types/pc/message/index.d.ts +1 -9
  152. package/types/pc/message/interface.d.ts +8 -0
  153. package/types/pc/message/useMessage.d.ts +1 -2
  154. package/types/pc/modal/Modal.d.ts +1 -0
  155. package/types/pc/modal/config.d.ts +1 -2
  156. package/types/pc/modal/index.d.ts +2 -1
  157. package/types/pc/modal/interface.d.ts +17 -5
  158. package/types/pc/notification/index.d.ts +2 -9
  159. package/types/pc/notification/interface.d.ts +7 -0
  160. package/types/pc/notification/useNotification.d.ts +1 -2
  161. package/types/pc/pagination/PageOption.d.ts +0 -1
  162. package/types/pc/pagination/interface.d.ts +5 -6
  163. package/types/pc/{grid → row-col}/Col-.d.ts +1 -1
  164. package/types/pc/{grid → row-col}/Col.d.ts +1 -2
  165. package/types/pc/{grid → row-col}/Row.d.ts +1 -2
  166. package/types/pc/row-col/context.d.ts +6 -0
  167. package/types/pc/row-col/index.d.ts +7 -0
  168. package/types/pc/row-col/interface.d.ts +112 -0
  169. package/types/pc/segmented/index.d.ts +3 -7
  170. package/types/pc/segmented/interface.d.ts +38 -5
  171. package/types/pc/select-view/Core.d.ts +1 -8
  172. package/types/pc/select-view/index.d.ts +1 -8
  173. package/types/pc/select-view/interface.d.ts +9 -2
  174. package/types/pc/space/index.d.ts +5 -7
  175. package/types/pc/space/interface.d.ts +3 -10
  176. package/types/pc/statistic/index.d.ts +1 -1
  177. package/types/pc/statistic/interface.d.ts +1 -49
  178. package/types/pc/utils/is.d.ts +1 -1
  179. package/types/pc/utils/names.d.ts +422 -111
  180. package/types/pc/utils/responsiveObserve.d.ts +8 -8
  181. package/typography/Ellipsis.js +5 -4
  182. package/typography/Operations.js +4 -3
  183. package/utils/dayjs.js +13 -11
  184. package/utils/index.js +245 -244
  185. package/utils/is.js +65 -66
  186. package/utils/names.js +309 -150
  187. package/utils/responsiveObserve.js +43 -36
  188. package/version/index.js +1 -1
  189. package/grid/Col-.js +0 -86
  190. package/grid/Col.js +0 -169
  191. package/grid/Row.js +0 -96
  192. package/grid/hook/useResponsiveState.js +0 -38
  193. package/statistic/Countdown.js +0 -56
  194. package/statistic/util.js +0 -33
  195. package/types/pc/grid/hook/useResponsiveState.d.ts +0 -2
  196. package/types/pc/statistic/util.d.ts +0 -1
  197. /package/types/pc/{statistic/Countdown.d.ts → countdown/index.d.ts} +0 -0
@@ -1,45 +1,46 @@
1
- import { jsxs as l, Fragment as L, jsx as a } from "react/jsx-runtime";
2
- import { Tween as T } from "../dist/tween/src/tween.js";
3
- import W from "../dist/tween/src/easing.js";
4
- import z from "dayjs";
5
- import A from "lodash/isFunction";
1
+ import { jsxs as l, Fragment as k, jsx as a } from "react/jsx-runtime";
2
+ import { Tween as q } from "../dist/tween/src/tween.js";
3
+ import H from "../dist/tween/src/easing.js";
4
+ import W from "dayjs";
5
+ import X from "lodash/isFunction";
6
6
  import c from "lodash/isNumber";
7
- import { forwardRef as B, useContext as G, useRef as F, useState as J, useEffect as K, useImperativeHandle as Q, useMemo as X } from "react";
7
+ import { forwardRef as z, useContext as B, useRef as w, useState as G, useEffect as J, useImperativeHandle as K, useMemo as Q } from "react";
8
8
  import "../config-provider/ConfigProvider.js";
9
- import Y from "../components/common/hooks/useMergeProps.js";
10
- import Z from "../skeleton/index.js";
11
- import tt from "@unicom-cloud/utils/class-name";
12
- import { omit as et } from "../components/common/utils/omit.js";
13
- import ot from "./Countdown.js";
14
- import rt from "../config-provider/context.js";
15
- function nt(y, D) {
9
+ import Y from "../countdown/index.js";
10
+ import Z from "../components/common/hooks/useMergeProps.js";
11
+ import ee from "../skeleton/index.js";
12
+ import te from "@unicom-cloud/utils/class-name";
13
+ import { omit as oe } from "../components/common/utils/omit.js";
14
+ import { PREFIX_CLASS_STATISTIC as re } from "./interface.js";
15
+ import ne from "../config-provider/context.js";
16
+ function ie(y, D) {
16
17
  const R = {
17
18
  countFrom: 0,
18
19
  countDuration: 2e3
19
- }, { getPrefixCls: U, componentConfig: P, rtl: V } = G(rt), t = Y(
20
+ }, { getPrefixCls: P, componentConfig: U, rtl: I } = B(ne), e = Z(
20
21
  y,
21
22
  R,
22
- P?.Statistic
23
+ U?.Statistic
23
24
  ), {
24
- className: j,
25
- style: M,
25
+ className: T,
26
+ style: V,
26
27
  title: x,
27
- extra: g,
28
- groupSeparator: h,
28
+ extra: S,
29
+ groupSeparator: g,
29
30
  precision: s,
30
31
  prefix: m,
31
32
  suffix: u,
32
33
  format: p,
33
- renderFormat: S,
34
- styleValue: O,
35
- styleDecimal: _,
36
- loading: k,
37
- ...q
38
- } = t, i = F(), C = F(), [e, d] = J(
39
- "value" in t ? t.value : void 0
40
- ), o = U?.("statistic"), f = (n = t.countFrom, r = t.value) => {
41
- const { countDuration: N } = t;
42
- n !== r && (i.current = new T({
34
+ renderFormat: h,
35
+ styleValue: _,
36
+ styleDecimal: j,
37
+ loading: M,
38
+ ...A
39
+ } = e, i = w(), C = w(), [t, f] = G(
40
+ "value" in e ? e.value : void 0
41
+ ), o = P?.(re), d = (n = e.countFrom, r = e.value) => {
42
+ const { countDuration: N } = e;
43
+ n !== r && (i.current = new q({
43
44
  from: {
44
45
  value: n
45
46
  },
@@ -47,59 +48,59 @@ function nt(y, D) {
47
48
  value: r
48
49
  },
49
50
  duration: N,
50
- easing: W.quartOut,
51
- onUpdate: (I) => {
52
- d(I.value.toFixed(s));
51
+ easing: H.quartOut,
52
+ onUpdate: (O) => {
53
+ f(O.value.toFixed(s));
53
54
  },
54
55
  onFinish: () => {
55
- d(r);
56
+ f(r);
56
57
  }
57
58
  }), i.current.start());
58
59
  };
59
- K(() => (t.countUp ? (i.current && i.current.stop(), e !== t.value ? f(Number(e), t.value) : f()) : d(t.value), () => {
60
+ J(() => (e.countUp ? (i.current && i.current.stop(), t !== e.value ? d(Number(t), e.value) : d()) : f(e.value), () => {
60
61
  i.current && i.current.stop(), i.current = null;
61
- }), [t.value]), Q(D, () => ({
62
- countUp: f,
62
+ }), [e.value]), K(D, () => ({
63
+ countUp: d,
63
64
  getRootDOMNode: () => C.current
64
65
  }));
65
- const { int: E, decimal: v } = X(() => {
66
- let n = e;
67
- p && (n = z(e).format(p)), c(s) && s >= 0 && (n = Number(e).toFixed(s));
66
+ const { int: E, decimal: v } = Q(() => {
67
+ let n = t;
68
+ p && (n = W(t).format(p)), c(s) && s >= 0 && (n = Number(t).toFixed(s));
68
69
  let r = String(n).split(".")[0];
69
70
  const N = String(n).split(".")[1];
70
- return h && c(Number(e)) && (r = Number(r).toLocaleString("en-US")), {
71
+ return g && c(Number(t)) && (r = Number(r).toLocaleString("en-US")), {
71
72
  int: r,
72
73
  decimal: N
73
74
  };
74
- }, [p, h, s, e]), H = A(S) ? S : (n, r) => r, $ = c(Number(e)), w = /* @__PURE__ */ l(L, { children: [
75
+ }, [p, g, s, t]), L = X(h) ? h : (n, r) => r, F = c(Number(t)), $ = /* @__PURE__ */ l(k, { children: [
75
76
  m != null ? /* @__PURE__ */ a("span", { className: `${o}-value-prefix`, children: m }) : null,
76
- H(e, $ ? E : e)
77
+ L(t, F ? E : t)
77
78
  ] });
78
79
  return /* @__PURE__ */ l(
79
80
  "div",
80
81
  {
81
- className: tt(`${o}`, { [`${o}-rtl`]: V }, j),
82
- style: M,
83
- ...et(q, ["value", "countUp", "countFrom", "countDuration"]),
82
+ className: te(`${o}`, { [`${o}-rtl`]: I }, T),
83
+ style: V,
84
+ ...oe(A, ["value", "countUp", "countFrom", "countDuration"]),
84
85
  ref: C,
85
86
  children: [
86
87
  x && /* @__PURE__ */ a("div", { className: `${o}-title`, children: x }),
87
88
  /* @__PURE__ */ l("div", { className: `${o}-content`, children: [
88
89
  /* @__PURE__ */ a(
89
- Z,
90
+ ee,
90
91
  {
91
92
  animation: !0,
92
- loading: !!k,
93
+ loading: !!M,
93
94
  text: { rows: 1, width: "100%" },
94
- children: /* @__PURE__ */ l("div", { className: `${o}-value`, style: O, children: [
95
- $ ? /* @__PURE__ */ a("span", { className: `${o}-value-int`, children: w }) : w,
95
+ children: /* @__PURE__ */ l("div", { className: `${o}-value`, style: _, children: [
96
+ F ? /* @__PURE__ */ a("span", { className: `${o}-value-int`, children: $ }) : $,
96
97
  v !== void 0 || u ? /* @__PURE__ */ l(
97
98
  "span",
98
99
  {
99
100
  className: `${o}-value-decimal`,
100
- style: _,
101
+ style: j,
101
102
  children: [
102
- c(Number(e)) && v !== void 0 && `.${v}`,
103
+ c(Number(t)) && v !== void 0 && `.${v}`,
103
104
  u != null ? /* @__PURE__ */ a("span", { className: `${o}-value-suffix`, children: u }) : null
104
105
  ]
105
106
  }
@@ -107,16 +108,16 @@ function nt(y, D) {
107
108
  ] })
108
109
  }
109
110
  ),
110
- g && /* @__PURE__ */ a("div", { className: `${o}-extra`, children: g })
111
+ S && /* @__PURE__ */ a("div", { className: `${o}-extra`, children: S })
111
112
  ] })
112
113
  ]
113
114
  }
114
115
  );
115
116
  }
116
- const it = B(nt), b = it;
117
+ const ae = z(ie), b = ae;
117
118
  b.displayName = "Statistic";
118
- b.Countdown = ot;
119
+ b.Countdown = Y;
119
120
  export {
120
- ot as StatisticCountdown,
121
+ Y as StatisticCountdown,
121
122
  b as default
122
123
  };
@@ -1 +1,4 @@
1
-
1
+ const t = "statistic";
2
+ export {
3
+ t as PREFIX_CLASS_STATISTIC
4
+ };