@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,116 +1,110 @@
1
- import { isPlainObject as l } from "@unicom-cloud/utils/is";
2
- import { isArguments as L, isArray as v, isArrayBuffer as V, isArrayLike as W, isArrayLikeObject as h, isBlob as k, isBoolean as B, isBuffer as j, isColor as I, isColor2 as Y, isDate as q, isElement as z, isEmpty as U, isEmptyArray as H, isEmptyObject as J, isEmptyValue as G, isEqual as K, isEqualWith as Q, isError as X, isFile as Z, isFinite as ii, isFunction as si, isInteger as ri, isJSON as ei, isLength as ti, isMap as oi, isMatch as ai, isMatchWith as ni, isNaN as fi, isNative as ui, isNil as pi, isNull as li, isNumber as ci, isObject as yi, isObjectLike as di, isPlainObject as Ri, isPromise as Ei, isReadableByteStreamControllerSupported as mi, isReadableStream as Si, isReadableStreamDefaultControllerSupported as $i, isReadableStreamSupported as Ci, isReadableStreamSymbolAsyncIteratorSupported as Mi, isRegExp as bi, isSafeInteger as Ai, isSet as Ni, isString as Ti, isSymbol as Fi, isTypedArray as Pi, isUndefined as gi, isValidColor as Oi, isWeakMap as wi, isWeakSet as xi } from "@unicom-cloud/utils/is";
3
- import { isDayjs as c } from "dayjs";
1
+ import { isArguments as x, isArray as w, isArrayBuffer as O, isArrayLike as _, isArrayLikeObject as L, isBlob as v, isBoolean as W, isBuffer as h, isColor as k, isColor2 as B, isDate as D, isElement as V, isEmpty as I, isEmptyArray as Y, isEmptyObject as q, isEmptyValue as z, isEqual as U, isEqualWith as j, isError as J, isFile as G, isFinite as H, isFunction as K, isInteger as Q, isJSON as X, isLength as Z, isMap as ee, isMatch as ie, isMatchWith as re, isNaN as te, isNative as se, isNil as oe, isNull as ae, isNumber as ne, isObject as fe, isObjectLike as pe, isPlainObject as ue, isPromise as le, isReadableByteStreamControllerSupported as ye, isReadableStream as ce, isReadableStreamDefaultControllerSupported as me, isReadableStreamSupported as Re, isReadableStreamSymbolAsyncIteratorSupported as de, isRegExp as Ee, isSafeInteger as Se, isSet as Ce, isString as $e, isSymbol as be, isTypedArray as Ne, isUndefined as Te, isValidColor as Ae, isWeakMap as Fe, isWeakSet as Me } from "@unicom-cloud/utils/is";
2
+ import { isDayjs as ge } from "dayjs";
4
3
  import { isValidElement as o } from "react";
5
4
  import a from "react-dom";
6
- import { isForwardRef as n, ForwardRef as t, Memo as y } from "react-is";
7
- import { isAsyncMode as Di, isConcurrentMode as Li, isContextConsumer as vi, isContextProvider as Vi, isElement as Wi, isForwardRef as hi, isFragment as ki, isLazy as Bi, isMemo as ji, isPortal as Ii, isProfiler as Yi, isStrictMode as qi, isSuspense as zi, isValidElementType as Ui } from "react-is";
8
- function T(i) {
9
- return i == null;
5
+ import { isForwardRef as n, ForwardRef as s, Memo as l } from "react-is";
6
+ import { isContextConsumer as we, isContextProvider as Oe, isElement as _e, isForwardRef as Le, isFragment as ve, isLazy as We, isMemo as he, isPortal as ke, isProfiler as Be, isStrictMode as De, isSuspense as Ve, isValidElementType as Ie } from "react-is";
7
+ function b(e) {
8
+ return e == null;
10
9
  }
11
- function F(i, s) {
12
- return i == null || i === !1 || typeof i == "string" && (s ? i.trim() === "" : i === "");
10
+ function N(e, i) {
11
+ return e == null || e === !1 || typeof e == "string" && (i ? e.trim() === "" : e === "");
13
12
  }
14
- function P(i) {
15
- return i || i === 0;
13
+ function T(e) {
14
+ return e || e === 0;
16
15
  }
17
- function g(i) {
18
- return i === window;
16
+ function A(e) {
17
+ return e === window;
19
18
  }
20
- function O(i) {
21
- return i && c(i) && typeof i.isValid == "function" && i.isValid() && l(i) && "$y" in i && "$M" in i && "$D" in i && "$d" in i && "$H" in i && "$m" in i && "$s" in i;
22
- }
23
- const f = (i) => i && o(i) && typeof i.type == "function", d = (i) => f(i) && !!i.type.prototype?.isReactComponent, R = (i) => o(i) && typeof i.type == "string", w = Number(a.version?.split(".")[0]) > 17, E = Number(a.version?.split(".")[0]) > 18, m = (i) => {
24
- if (!E)
25
- return n(i);
26
- const s = Symbol.for("react.element"), u = Symbol.for("react.transitional.element"), p = Symbol.for("react.forward_ref");
27
- if (typeof i == "object" && i !== null) {
28
- const r = i.$$typeof;
29
- if (r === s || r === u) {
30
- const e = i.type;
31
- return (e && e.$$typeof) === p;
19
+ const f = (e) => e && o(e) && typeof e.type == "function", y = (e) => f(e) && !!e.type.prototype?.isReactComponent, c = (e) => o(e) && typeof e.type == "string", F = Number(a.version?.split(".")[0]) > 17, m = Number(a.version?.split(".")[0]) > 18, R = (e) => {
20
+ if (!m)
21
+ return n(e);
22
+ const i = Symbol.for("react.element"), p = Symbol.for("react.transitional.element"), u = Symbol.for("react.forward_ref");
23
+ if (typeof e == "object" && e !== null) {
24
+ const r = e.$$typeof;
25
+ if (r === i || r === p) {
26
+ const t = e.type;
27
+ return (t && t.$$typeof) === u;
32
28
  }
33
29
  }
34
30
  return !1;
35
- }, S = (i) => i ? R(i) || m(i) || n(i) || i.$$typeof === t ? !0 : i.$$typeof === y ? i.type?.$$typeof === t : f(i) ? d(i) : !1 : !1, x = S;
31
+ }, d = (e) => e ? c(e) || R(e) || n(e) || e.$$typeof === s ? !0 : e.$$typeof === l ? e.type?.$$typeof === s : f(e) ? y(e) : !1 : !1, M = d;
36
32
  export {
37
- L as isArguments,
38
- v as isArray,
39
- V as isArrayBuffer,
40
- W as isArrayLike,
41
- h as isArrayLikeObject,
42
- k as isBlob,
43
- B as isBoolean,
44
- j as isBuffer,
45
- d as isClassComponent,
46
- I as isColor,
47
- Y as isColor2,
48
- R as isDOMElement,
49
- q as isDate,
50
- O as isDayjs,
51
- z as isElement,
52
- U as isEmpty,
53
- H as isEmptyArray,
54
- J as isEmptyObject,
55
- F as isEmptyReactNode,
56
- G as isEmptyValue,
57
- K as isEqual,
58
- Q as isEqualWith,
59
- X as isError,
60
- P as isExist,
61
- Z as isFile,
62
- ii as isFinite,
63
- m as isForwardRefReact,
64
- si as isFunction,
65
- ri as isInteger,
66
- ei as isJSON,
67
- ti as isLength,
68
- oi as isMap,
69
- ai as isMatch,
70
- ni as isMatchWith,
71
- fi as isNaN,
72
- ui as isNative,
73
- pi as isNil,
74
- li as isNull,
75
- T as isNullOrUndefined,
76
- ci as isNumber,
77
- yi as isObject,
78
- di as isObjectLike,
79
- Ri as isPlainObject,
80
- Ei as isPromise,
81
- w as isReact18,
82
- E as isReact19,
83
- Di as isReactAsyncMode,
33
+ x as isArguments,
34
+ w as isArray,
35
+ O as isArrayBuffer,
36
+ _ as isArrayLike,
37
+ L as isArrayLikeObject,
38
+ v as isBlob,
39
+ W as isBoolean,
40
+ h as isBuffer,
41
+ y as isClassComponent,
42
+ k as isColor,
43
+ B as isColor2,
44
+ c as isDOMElement,
45
+ D as isDate,
46
+ ge as isDayjs,
47
+ V as isElement,
48
+ I as isEmpty,
49
+ Y as isEmptyArray,
50
+ q as isEmptyObject,
51
+ N as isEmptyReactNode,
52
+ z as isEmptyValue,
53
+ U as isEqual,
54
+ j as isEqualWith,
55
+ J as isError,
56
+ T as isExist,
57
+ G as isFile,
58
+ H as isFinite,
59
+ R as isForwardRefReact,
60
+ K as isFunction,
61
+ Q as isInteger,
62
+ X as isJSON,
63
+ Z as isLength,
64
+ ee as isMap,
65
+ ie as isMatch,
66
+ re as isMatchWith,
67
+ te as isNaN,
68
+ se as isNative,
69
+ oe as isNil,
70
+ ae as isNull,
71
+ b as isNullOrUndefined,
72
+ ne as isNumber,
73
+ fe as isObject,
74
+ pe as isObjectLike,
75
+ ue as isPlainObject,
76
+ le as isPromise,
77
+ F as isReact18,
78
+ m as isReact19,
84
79
  f as isReactComponent,
85
- Li as isReactConcurrentMode,
86
- vi as isReactContextConsumer,
87
- Vi as isReactContextProvider,
88
- Wi as isReactElement,
89
- hi as isReactForwardRef,
90
- ki as isReactFragment,
91
- Bi as isReactLazy,
92
- ji as isReactMemo,
93
- Ii as isReactPortal,
94
- Yi as isReactProfiler,
95
- qi as isReactStrictMode,
96
- zi as isReactSuspense,
97
- Ui as isReactValidElementType,
98
- mi as isReadableByteStreamControllerSupported,
99
- Si as isReadableStream,
100
- $i as isReadableStreamDefaultControllerSupported,
101
- Ci as isReadableStreamSupported,
102
- Mi as isReadableStreamSymbolAsyncIteratorSupported,
103
- bi as isRegExp,
104
- Ai as isSafeInteger,
105
- Ni as isSet,
106
- Ti as isString,
107
- x as isSupportRef,
108
- Fi as isSymbol,
109
- Pi as isTypedArray,
110
- gi as isUndefined,
111
- Oi as isValidColor,
112
- wi as isWeakMap,
113
- xi as isWeakSet,
114
- g as isWindow,
115
- S as supportRef
80
+ we as isReactContextConsumer,
81
+ Oe as isReactContextProvider,
82
+ _e as isReactElement,
83
+ Le as isReactForwardRef,
84
+ ve as isReactFragment,
85
+ We as isReactLazy,
86
+ he as isReactMemo,
87
+ ke as isReactPortal,
88
+ Be as isReactProfiler,
89
+ De as isReactStrictMode,
90
+ Ve as isReactSuspense,
91
+ Ie as isReactValidElementType,
92
+ ye as isReadableByteStreamControllerSupported,
93
+ ce as isReadableStream,
94
+ me as isReadableStreamDefaultControllerSupported,
95
+ Re as isReadableStreamSupported,
96
+ de as isReadableStreamSymbolAsyncIteratorSupported,
97
+ Ee as isRegExp,
98
+ Se as isSafeInteger,
99
+ Ce as isSet,
100
+ $e as isString,
101
+ M as isSupportRef,
102
+ be as isSymbol,
103
+ Ne as isTypedArray,
104
+ Te as isUndefined,
105
+ Ae as isValidColor,
106
+ Fe as isWeakMap,
107
+ Me as isWeakSet,
108
+ A as isWindow,
109
+ d as supportRef
116
110
  };
@@ -0,0 +1,12 @@
1
+ import { UI_PC_PREFIX as i } from "@unicom-cloud/utils/constant/ui.js";
2
+ import s from "lodash/isPlainObject";
3
+ import { CSS_VARIABLE_ELEMENT as o } from "./constant.js";
4
+ function n(r) {
5
+ if (!s(r)) return;
6
+ const { prefix: l = i, dir: e = "ltr" } = r, t = o;
7
+ t.setAttribute("dir", e), t.classList.remove("ltr"), t.classList.remove("rtl"), t.classList.add(e);
8
+ }
9
+ export {
10
+ n as default,
11
+ n as setDir
12
+ };
@@ -1,10 +1,10 @@
1
- import { UI_PC_PREFIX as f } from "@unicom-cloud/utils/constant/ui.js";
2
- import n from "@unicom-cloud/utils/tinycolor";
3
- import $ from "lodash/isPlainObject";
1
+ import { UI_PC_PREFIX as $ } from "@unicom-cloud/utils/constant/ui.js";
2
+ import a from "@unicom-cloud/utils/tinycolor";
3
+ import m from "lodash/isPlainObject";
4
4
  import { CSS_VARIABLE_ELEMENT as p } from "./constant.js";
5
- function P(s) {
6
- if (!$(s)) return;
7
- const { prefix: e = f, ...i } = s, c = {
5
+ function b(s) {
6
+ if (!m(s)) return;
7
+ const { prefix: e = $, element: f, ...i } = s, c = {
8
8
  primary: {
9
9
  default: `--${e}-primary-6`,
10
10
  hover: `--${e}-primary-5`,
@@ -36,19 +36,19 @@ function P(s) {
36
36
  active: `--${e}-red-7`
37
37
  }
38
38
  };
39
- Object.entries(c).forEach(([o, r], m, h) => {
39
+ Object.entries(c).forEach(([o, r], h, d) => {
40
40
  c[`${o}Color`] = r;
41
41
  const l = i[o];
42
42
  if (!l) return;
43
- const a = new n(l), t = p;
44
- t.style.setProperty(r.default, a.toRgbArrayString());
43
+ const n = new a(l), t = f || p;
44
+ t.style.setProperty(r.default, n.toRgbArrayString());
45
45
  const y = i[`${o}Hover`];
46
- y ? t.style.setProperty(r.hover, new n(y).toRgbArrayString()) : t.style.setProperty(r.hover, a.lighten(10).toRgbArrayString());
46
+ y ? t.style.setProperty(r.hover, new a(y).toRgbArrayString()) : t.style.setProperty(r.hover, n.lighten(7).toRgbArrayString());
47
47
  const g = i[`${o}Active`];
48
- g ? t.style.setProperty(r.active, new n(g).toRgbArrayString()) : t.style.setProperty(r.active, a.lighten(-10).toRgbArrayString());
48
+ g ? t.style.setProperty(r.active, new a(g).toRgbArrayString()) : t.style.setProperty(r.active, n.lighten(-7).toRgbArrayString());
49
49
  });
50
50
  }
51
51
  export {
52
- P as default,
53
- P as setTheme
52
+ b as default,
53
+ b as setTheme
54
54
  };
@@ -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 {
@@ -1,58 +1,60 @@
1
- import { jsx as u } from "react/jsx-runtime";
1
+ import { jsx as a } from "react/jsx-runtime";
2
2
  import b from "@unicom-cloud/icons/context";
3
3
  import { UI_PC_PREFIX as e } from "@unicom-cloud/utils/constant/ui";
4
- import a from "lodash/merge";
4
+ import d from "lodash/merge";
5
5
  import { useEffect as t } from "react";
6
+ import { setDir as D } from "../components/common/utils/setDir.js";
6
7
  import { setTheme as E } from "../components/common/utils/setTheme.js";
7
8
  import G from "../components/common/hooks/useMergeProps.js";
8
9
  import R from "../message/index.js";
9
10
  import { setConfigProviderProps as _ } from "../modal/config.js";
10
11
  import $ from "../notification/index.js";
11
- import f, { ConfigProviderDefaultProps as j } from "./context.js";
12
+ import n, { ConfigProviderDefaultProps as j } from "./context.js";
12
13
  const k = j;
13
- let i = {};
14
+ let f = {};
14
15
  const y = {};
15
- function d(P) {
16
- const n = G(
17
- P,
16
+ function P(x) {
17
+ const m = G(
18
+ x,
18
19
  k,
19
20
  y
20
21
  ), {
21
- theme: m,
22
+ theme: s,
22
23
  prefixCls: o = e,
23
- locale: s,
24
+ locale: p,
24
25
  rtl: r,
25
26
  effectGlobalNotice: c = !0,
26
- effectGlobalModal: p = !0
27
- } = n, {
28
- children: l,
29
- isRootConfig: v,
30
- keepConfig: x,
27
+ effectGlobalModal: l = !0
28
+ } = m, {
29
+ children: C,
30
+ isRootConfig: i,
31
+ keepConfig: v,
31
32
  // 潘启宝添加
32
- ...C
33
- } = n;
34
- (v || x) && (i = a({}, i, C));
35
- const h = a({}, i, C, {
33
+ ...g
34
+ } = m;
35
+ (i || v) && (f = d({}, f, g));
36
+ const h = d({}, f, g, {
36
37
  getPrefixCls: I
37
38
  });
38
39
  function I(M, N) {
39
40
  return `${N || o || e}-${M}`;
40
41
  }
41
- t(() => (E({ prefix: e, theme: m }), () => {
42
- }), [m]), t(() => {
42
+ t(() => (i && D({ prefix: e, dir: r ? "rtl" : "ltr" }), () => {
43
+ }), [i, r]), t(() => (E({ prefix: e, ...s }), () => {
44
+ }), [s]), t(() => {
43
45
  c && (R.config({ prefixCls: o, rtl: r }), $.config({ prefixCls: o, rtl: r }));
44
46
  }, [o, r, c]), t(() => {
45
- p && _({ locale: s, prefixCls: o, rtl: r });
46
- }, [s, o, r, p]);
47
- let g = l;
48
- return o && o !== e && (g = /* @__PURE__ */ u(b.Provider, { value: { prefixCls: o }, children: l })), /* @__PURE__ */ u(f.Provider, { value: h, children: g });
47
+ l && _({ locale: p, prefixCls: o, rtl: r });
48
+ }, [p, o, r, l]);
49
+ let u = C;
50
+ return o && o !== e && (u = /* @__PURE__ */ a(b.Provider, { value: { prefixCls: o }, children: C })), /* @__PURE__ */ a(n.Provider, { value: h, children: u });
49
51
  }
50
- d.ConfigContext = f;
51
- d.displayName = "ConfigProvider";
52
- const J = f.Consumer;
52
+ P.ConfigContext = n;
53
+ P.displayName = "ConfigProvider";
54
+ const L = n.Consumer;
53
55
  export {
54
- J as ConfigConsumer,
55
- f as ConfigContext,
56
+ L as ConfigConsumer,
57
+ n as ConfigContext,
56
58
  j as ConfigProviderDefaultProps,
57
- d as default
59
+ P as default
58
60
  };
@@ -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
+ };