@unicom-cloud/ui 0.8.99 → 0.8.101

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 (293) hide show
  1. package/Anchor.js +3 -1
  2. package/Badge.js +7 -6
  3. package/Copy.js +49 -2
  4. package/Details.js +13 -2
  5. package/Divider.js +3 -2
  6. package/Flex.js +22 -0
  7. package/Grid.js +1 -1
  8. package/LiquidFill.js +3 -2
  9. package/Loading.js +16 -3
  10. package/Marquee.js +3 -2
  11. package/QrCode.js +3 -2
  12. package/Space.js +3 -3
  13. package/Splitter.js +5 -5
  14. package/SuspenseFallbackTest.js +2 -4
  15. package/Tag.js +3 -2
  16. package/Tour.js +3 -2
  17. package/alert/index.js +61 -64
  18. package/anchor/index.js +5 -3
  19. package/back-top/index.js +32 -33
  20. package/badge/index.js +19 -18
  21. package/calendar/index.js +85 -84
  22. package/components/common/development/index.js +44 -29
  23. package/components/common/empty/index.js +35 -23
  24. package/components/common/flex/index.js +64 -0
  25. package/components/common/flex/interface.js +9 -0
  26. package/components/common/higher-order/with-speech-synthesis/index.js +79 -55
  27. package/components/common/space/index.js +71 -91
  28. package/components/common/suspense-fallback-test/index.js +16 -0
  29. package/components/common/utils/toArray.js +12 -0
  30. package/copy/index.js +83 -35
  31. package/details/index.js +102 -62
  32. package/divider/index.js +27 -21
  33. package/empty/index.js +13 -13
  34. package/flex/index.js +47 -0
  35. package/flex/interface.js +1 -0
  36. package/grid/{GridItem.js → Item.js} +15 -15
  37. package/grid/index.js +1 -1
  38. package/icon/interface.js +1 -0
  39. package/icon-hover/interface.js +1 -0
  40. package/index.js +610 -599
  41. package/input/Button.js +39 -34
  42. package/input/Textarea.js +108 -104
  43. package/liquid-fill/index.js +3 -2
  44. package/loading/index.js +72 -53
  45. package/loading/interface.js +1 -0
  46. package/marquee/index.js +3 -2
  47. package/modal/Modal.js +73 -74
  48. package/package.json +1 -1
  49. package/portal/interface.js +1 -0
  50. package/qr-code/index.js +3 -2
  51. package/segmented/index.js +113 -105
  52. package/space/index.js +41 -35
  53. package/speech-synthesis/interface.js +1 -0
  54. package/spin/index.js +75 -62
  55. package/splitter/Panel.js +39 -0
  56. package/splitter/SplitBar.js +157 -0
  57. package/splitter/Splitter.js +135 -0
  58. package/splitter/hooks/useEvent.js +12 -0
  59. package/splitter/hooks/useItems.js +26 -0
  60. package/splitter/hooks/useResizable.js +26 -0
  61. package/splitter/hooks/useResize.js +68 -0
  62. package/splitter/hooks/useSizes.js +60 -0
  63. package/splitter/index.js +6 -115
  64. package/style.css +1 -1
  65. package/suspense-fallback-test/index.js +2 -11
  66. package/suspense-fallback-test/interface.js +1 -0
  67. package/table/Table.js +38 -38
  68. package/table/hook/useThResizable.js +72 -26
  69. package/table/tbody/Td.js +80 -77
  70. package/table/th-resizable/index.js +92 -35
  71. package/tag/index.js +42 -41
  72. package/tooltip/index.js +89 -82
  73. package/tour/index.js +5 -6
  74. package/trigger/index.js +67 -70
  75. package/types/common/development/index.d.ts +7 -1
  76. package/types/common/development/interface.d.ts +22 -0
  77. package/types/common/empty/index.d.ts +2 -1
  78. package/types/common/flex/index.d.ts +14 -0
  79. package/types/common/flex/interface.d.ts +62 -0
  80. package/types/common/higher-order/with-speech-synthesis/index.d.ts +6 -1
  81. package/types/common/higher-order/with-speech-synthesis/interface.d.ts +13 -0
  82. package/types/common/space/index.d.ts +4 -3
  83. package/types/common/space/interface.d.ts +10 -18
  84. package/types/common/suspense-fallback-test/index.d.ts +7 -0
  85. package/types/common/suspense-fallback-test/interface.d.ts +1 -0
  86. package/types/common/utils/PqbCSSTransition.d.ts +1 -1
  87. package/types/common/utils/toArray.d.ts +13 -0
  88. package/types/pc/affix/interface.d.ts +0 -2
  89. package/types/pc/alert/index.d.ts +3 -2
  90. package/types/pc/alert/interface.d.ts +7 -1
  91. package/types/pc/anchor/index.d.ts +2 -1
  92. package/types/pc/anchor/interface.d.ts +0 -2
  93. package/types/pc/auto-complete/interface.d.ts +0 -6
  94. package/types/pc/avatar/interface.d.ts +0 -4
  95. package/types/pc/badge/Count.d.ts +1 -1
  96. package/types/pc/breadcrumb/Item.d.ts +1 -1
  97. package/types/pc/breadcrumb/interface.d.ts +0 -3
  98. package/types/pc/calendar/Month.d.ts +1 -1
  99. package/types/pc/calendar/WeekList.d.ts +1 -1
  100. package/types/pc/calendar/Year.d.ts +1 -1
  101. package/types/pc/calendar/header/Panel.d.ts +1 -1
  102. package/types/pc/calendar/header/index.d.ts +1 -1
  103. package/types/pc/calendar/index.d.ts +1 -1
  104. package/types/pc/calendar/interface.d.ts +2 -1
  105. package/types/pc/carousel/interface.d.ts +2 -6
  106. package/types/pc/cascader/interface.d.ts +7 -19
  107. package/types/pc/cascader/panel/List.d.ts +1 -1
  108. package/types/pc/cascader/panel/Option.d.ts +1 -1
  109. package/types/pc/cascader/panel/Search.d.ts +1 -1
  110. package/types/pc/checkbox/Group.d.ts +2 -2
  111. package/types/pc/checkbox/GroupBlock.d.ts +1 -1
  112. package/types/pc/checkbox/IconCheck.d.ts +1 -1
  113. package/types/pc/checkbox/interface.d.ts +0 -1
  114. package/types/pc/collapse/interface.d.ts +0 -2
  115. package/types/pc/color-picker/InputRgb.d.ts +1 -1
  116. package/types/pc/color-picker/Palette.d.ts +1 -1
  117. package/types/pc/color-picker/interface.d.ts +0 -2
  118. package/types/pc/config-provider/ConfigProvider.d.ts +1 -1
  119. package/types/pc/config-provider/interface.d.ts +17 -17
  120. package/types/pc/copy/index.d.ts +1 -1
  121. package/types/pc/copy/interface.d.ts +2 -1
  122. package/types/pc/date-picker/interface.d.ts +0 -17
  123. package/types/pc/date-picker/panel/Body.d.ts +1 -1
  124. package/types/pc/date-picker/panel/Footer.d.ts +1 -1
  125. package/types/pc/date-picker/panel/Header.d.ts +1 -1
  126. package/types/pc/date-picker/panel/WeekList.d.ts +1 -1
  127. package/types/pc/date-picker/panel/date/index.d.ts +1 -1
  128. package/types/pc/date-picker/panel/month/index.d.ts +1 -1
  129. package/types/pc/date-picker/panel/quarter/index.d.ts +1 -1
  130. package/types/pc/date-picker/panel/range/index.d.ts +1 -1
  131. package/types/pc/date-picker/panel/week/index.d.ts +1 -1
  132. package/types/pc/date-picker/panel/year/index.d.ts +1 -1
  133. package/types/pc/descriptions/index.d.ts +1 -1
  134. package/types/pc/descriptions/interface.d.ts +0 -1
  135. package/types/pc/details/index.d.ts +3 -2
  136. package/types/pc/details/interface.d.ts +16 -0
  137. package/types/pc/development/index.d.ts +2 -1
  138. package/types/pc/development/interface.d.ts +15 -0
  139. package/types/pc/divider/index.d.ts +7 -2
  140. package/types/pc/draggable/Item.d.ts +1 -1
  141. package/types/pc/draggable/index.d.ts +1 -1
  142. package/types/pc/drawer/interface.d.ts +0 -7
  143. package/types/pc/dropdown/interface.d.ts +0 -1
  144. package/types/pc/flex/index.d.ts +9 -0
  145. package/types/pc/flex/interface.d.ts +16 -0
  146. package/types/pc/form/Control.d.ts +1 -1
  147. package/types/pc/form/FormList.d.ts +1 -1
  148. package/types/pc/form/IconSymbol.d.ts +1 -1
  149. package/types/pc/form/interface.d.ts +9 -22
  150. package/types/pc/form/util.d.ts +1 -1
  151. package/types/pc/grid/index.d.ts +3 -3
  152. package/types/pc/grid/interface.d.ts +1 -6
  153. package/types/pc/icon/addFromIconFontCn.d.ts +1 -7
  154. package/types/pc/icon/index.d.ts +2 -7
  155. package/types/pc/icon/interface.d.ts +13 -0
  156. package/types/pc/icon-hover/index.d.ts +2 -8
  157. package/types/pc/icon-hover/interface.d.ts +8 -0
  158. package/types/pc/image/ImageFooter.d.ts +1 -1
  159. package/types/pc/image/ImagePreviewArrow.d.ts +1 -1
  160. package/types/pc/image/TriggerForToolbar.d.ts +1 -1
  161. package/types/pc/image/interface.d.ts +0 -13
  162. package/types/pc/index.d.ts +63 -50
  163. package/types/pc/input/Textarea.d.ts +2 -6
  164. package/types/pc/input/interface.d.ts +5 -13
  165. package/types/pc/input-number/interface.d.ts +0 -4
  166. package/types/pc/input-tag/interface.d.ts +0 -13
  167. package/types/pc/layout/interface.d.ts +0 -1
  168. package/types/pc/link/interface.d.ts +0 -1
  169. package/types/pc/list/interface.d.ts +0 -4
  170. package/types/pc/loading/index.d.ts +4 -3
  171. package/types/pc/loading/interface.d.ts +6 -0
  172. package/types/pc/menu/Indent.d.ts +1 -1
  173. package/types/pc/menu/OverflowWrap.d.ts +1 -1
  174. package/types/pc/menu/interface.d.ts +0 -8
  175. package/types/pc/menu/sub-menu/Inline.d.ts +1 -1
  176. package/types/pc/menu/sub-menu/Pop.d.ts +1 -1
  177. package/types/pc/message/interface.d.ts +0 -2
  178. package/types/pc/modal/interface.d.ts +0 -5
  179. package/types/pc/notification/interface.d.ts +0 -1
  180. package/types/pc/overflow-ellipsis/OverflowItem.d.ts +1 -1
  181. package/types/pc/overflow-ellipsis/index.d.ts +1 -1
  182. package/types/pc/pagination/PageItem.d.ts +3 -3
  183. package/types/pc/pagination/PageJumper.d.ts +1 -1
  184. package/types/pc/pagination/PageOption.d.ts +1 -1
  185. package/types/pc/pagination/interface.d.ts +0 -2
  186. package/types/pc/popconfirm/interface.d.ts +8 -10
  187. package/types/pc/popover/interface.d.ts +0 -1
  188. package/types/pc/portal/Portal.d.ts +2 -6
  189. package/types/pc/portal/index.d.ts +2 -9
  190. package/types/pc/portal/interface.d.ts +14 -0
  191. package/types/pc/progress/CircleProgress.d.ts +1 -1
  192. package/types/pc/progress/LineProgess.d.ts +1 -1
  193. package/types/pc/progress/StepProgress.d.ts +1 -1
  194. package/types/pc/progress/interface.d.ts +0 -3
  195. package/types/pc/radio/Group.d.ts +2 -2
  196. package/types/pc/radio/GroupBlock.d.ts +1 -1
  197. package/types/pc/radio/Radio.d.ts +1 -1
  198. package/types/pc/resize-box/ResizeTrigger.d.ts +1 -1
  199. package/types/pc/resize-box/interface.d.ts +1 -7
  200. package/types/pc/result/403.d.ts +1 -1
  201. package/types/pc/result/404.d.ts +1 -1
  202. package/types/pc/result/500.d.ts +1 -1
  203. package/types/pc/segmented/interface.d.ts +6 -6
  204. package/types/pc/select/interface.d.ts +0 -12
  205. package/types/pc/select-view/interface.d.ts +0 -7
  206. package/types/pc/skeleton/Image.d.ts +1 -1
  207. package/types/pc/skeleton/Text.d.ts +2 -1
  208. package/types/pc/slider/Button.d.ts +1 -1
  209. package/types/pc/slider/Input.d.ts +1 -1
  210. package/types/pc/slider/Tick.d.ts +1 -1
  211. package/types/pc/slider/interface.d.ts +0 -4
  212. package/types/pc/space/index.d.ts +7 -5
  213. package/types/pc/speech-synthesis/index.d.ts +3 -1
  214. package/types/pc/speech-synthesis/interface.d.ts +7 -0
  215. package/types/pc/spin/DotLoading.d.ts +1 -1
  216. package/types/pc/spin/interface.d.ts +4 -1
  217. package/types/pc/splitter/Panel.d.ts +8 -0
  218. package/types/pc/splitter/SplitBar.d.ts +21 -0
  219. package/types/pc/splitter/Splitter.d.ts +4 -0
  220. package/types/pc/splitter/hooks/useEvent.d.ts +3 -0
  221. package/types/pc/splitter/hooks/useItems.d.ts +10 -0
  222. package/types/pc/splitter/hooks/useResizable.d.ts +8 -0
  223. package/types/pc/splitter/hooks/useResize.d.ts +4 -0
  224. package/types/pc/splitter/hooks/useSizes.d.ts +5 -0
  225. package/types/pc/splitter/index.d.ts +8 -3
  226. package/types/pc/splitter/interface.d.ts +181 -38
  227. package/types/pc/statistic/interface.d.ts +0 -4
  228. package/types/pc/steps/interface.d.ts +0 -3
  229. package/types/pc/suspense-fallback-test/index.d.ts +2 -3
  230. package/types/pc/suspense-fallback-test/interface.d.ts +2 -0
  231. package/types/pc/table/ColGroup.d.ts +1 -1
  232. package/types/pc/table/hook/useThResizable.d.ts +2 -2
  233. package/types/pc/table/interface.d.ts +4 -15
  234. package/types/pc/table/summary/Cell.d.ts +1 -1
  235. package/types/pc/table/summary/Row.d.ts +1 -1
  236. package/types/pc/table/tbody/Td.d.ts +1 -1
  237. package/types/pc/table/tbody/index.d.ts +1 -1
  238. package/types/pc/table/tfoot/index.d.ts +1 -1
  239. package/types/pc/table/th-resizable/index.d.ts +1 -1
  240. package/types/pc/table/thead/Column.d.ts +1 -1
  241. package/types/pc/table/thead/index.d.ts +1 -1
  242. package/types/pc/tabs/TabContent.d.ts +1 -1
  243. package/types/pc/tabs/interface.d.ts +0 -7
  244. package/types/pc/tabs/tab-header/DropdownIcon.d.ts +1 -1
  245. package/types/pc/tabs/tab-header/TabInk.d.ts +1 -1
  246. package/types/pc/tabs/tab-header/TabNavIcon.d.ts +1 -1
  247. package/types/pc/tag/index.d.ts +2 -0
  248. package/types/pc/tag/interface.d.ts +0 -1
  249. package/types/pc/time-picker/Picker.d.ts +1 -1
  250. package/types/pc/time-picker/RangePicker.d.ts +1 -1
  251. package/types/pc/time-picker/TimeColumn.d.ts +1 -1
  252. package/types/pc/time-picker/TimePicker.d.ts +1 -1
  253. package/types/pc/time-picker/index.d.ts +1 -1
  254. package/types/pc/time-picker/interface.d.ts +0 -7
  255. package/types/pc/tooltip/interface.d.ts +4 -1
  256. package/types/pc/transfer/Item.d.ts +1 -1
  257. package/types/pc/transfer/List.d.ts +1 -1
  258. package/types/pc/transfer/interface.d.ts +2 -9
  259. package/types/pc/tree/Animation.d.ts +1 -1
  260. package/types/pc/tree/interface.d.ts +2 -8
  261. package/types/pc/tree-select/interface.d.ts +0 -8
  262. package/types/pc/trigger/interface.d.ts +0 -5
  263. package/types/pc/typography/EditContent.d.ts +2 -1
  264. package/types/pc/typography/Operations.d.ts +1 -1
  265. package/types/pc/typography/interface.d.ts +45 -30
  266. package/types/pc/upload/interface.d.ts +6 -11
  267. package/types/pc/upload/list/index.d.ts +1 -1
  268. package/types/pc/utils/index.d.ts +1 -0
  269. package/types/pc/utils/names.d.ts +6 -0
  270. package/types/pc/utils/toArray.d.ts +3 -0
  271. package/types/pc/verification-code/VerificationCode.d.ts +1 -1
  272. package/types/pc/verification-code/interface.d.ts +0 -2
  273. package/types/pc/virtual-list/VirtualList.d.ts +2 -38
  274. package/types/pc/virtual-list/index.d.ts +2 -1
  275. package/types/pc/virtual-list/interface.d.ts +56 -0
  276. package/types/pc/watermark/Watermark.d.ts +1 -1
  277. package/types/pc/watermark/interface.d.ts +0 -2
  278. package/typography/Base.js +73 -73
  279. package/typography/EditContent.js +43 -33
  280. package/typography/Ellipsis.js +117 -184
  281. package/typography/Operations.js +97 -49
  282. package/typography/useCssEllipsis.js +7 -6
  283. package/utils/index.js +117 -115
  284. package/utils/names.js +4 -0
  285. package/utils/toArray.js +5 -0
  286. package/version/index.js +1 -1
  287. package/virtual-list/interface.js +1 -0
  288. package/components/common/space/toArray.js +0 -11
  289. package/loading/style/index.module.less.js +0 -4
  290. package/types/common/space/toArray.d.ts +0 -3
  291. package/types/pc/suspense-fallback-test/style/index.d.ts +0 -1
  292. /package/{suspense-fallback-test/style/index.less.js → development/interface.js} +0 -0
  293. /package/types/pc/grid/{GridItem.d.ts → Item.d.ts} +0 -0
package/badge/index.js CHANGED
@@ -4,7 +4,7 @@ import { forwardRef as z, useContext as H, useRef as O, useImperativeHandle as L
4
4
  import "../config-provider/ConfigProvider.js";
5
5
  import M from "../components/common/hooks/useMergeProps.js";
6
6
  import "@unicom-cloud/utils/case-name";
7
- import i from "@unicom-cloud/utils/class-name";
7
+ import n from "@unicom-cloud/utils/class-name";
8
8
  import "../dist/tinycolor/chunk/BOzCVdr0.js";
9
9
  import "@unicom-cloud/utils/constant/ui";
10
10
  import "../utils/contextHolder.js";
@@ -46,6 +46,7 @@ import "../dist/react-transition-group/src/TransitionGroup.js";
46
46
  import "@unicom-cloud/utils/file/saveAs";
47
47
  import "@unicom-cloud/utils/screenfull";
48
48
  import "@unicom-cloud/utils/constant/ui.js";
49
+ import "react-is";
49
50
  import "@unicom-cloud/utils/tree";
50
51
  import "@unicom-cloud/utils/is";
51
52
  import { v4 as F } from "uuid";
@@ -93,8 +94,8 @@ function Q(P, v) {
93
94
  status: p,
94
95
  children: u,
95
96
  ...y
96
- } = T, d = O(null), C = O(F()), t = A?.("badge"), n = { ...j || {} }, [h, S] = I || [];
97
- h && (n.marginRight = -h), S && (n.marginTop = S), L(v, () => ({
97
+ } = T, d = O(null), C = O(F()), t = A?.("badge"), i = { ...j || {} }, [h, S] = I || [];
98
+ h && (i.marginRight = -h), S && (i.marginTop = S), L(v, () => ({
98
99
  dom: d.current
99
100
  }));
100
101
  const k = () => {
@@ -102,8 +103,8 @@ function Q(P, v) {
102
103
  return /* @__PURE__ */ e(
103
104
  "span",
104
105
  {
105
- className: i(`${t}-custom-dot`, m),
106
- style: n,
106
+ className: n(`${t}-custom-dot`, m),
107
+ style: i,
107
108
  children: s
108
109
  }
109
110
  );
@@ -111,8 +112,8 @@ function Q(P, v) {
111
112
  return l && !r && !p ? /* @__PURE__ */ e(
112
113
  "span",
113
114
  {
114
- className: i(`${t}-text`, m),
115
- style: n,
115
+ className: n(`${t}-text`, m),
116
+ style: i,
116
117
  children: l
117
118
  }
118
119
  ) : p || r && typeof s == "number" && s <= 0 ? /* @__PURE__ */ c("span", { className: `${t}-status-wrapper`, children: [
@@ -120,7 +121,7 @@ function Q(P, v) {
120
121
  /* @__PURE__ */ e(
121
122
  "span",
122
123
  {
123
- className: i(
124
+ className: n(
124
125
  `${t}-status-dot`,
125
126
  {
126
127
  [`${t}-dot-pulse`]: x,
@@ -129,7 +130,7 @@ function Q(P, v) {
129
130
  },
130
131
  m
131
132
  ),
132
- style: { ...a, ...n }
133
+ style: { ...a, ...i }
133
134
  }
134
135
  ),
135
136
  !!l && /* @__PURE__ */ e("span", { className: `${t}-status-text`, children: l })
@@ -145,7 +146,7 @@ function Q(P, v) {
145
146
  children: /* @__PURE__ */ e(
146
147
  "span",
147
148
  {
148
- className: i(
149
+ className: n(
149
150
  `${t}-dot`,
150
151
  {
151
152
  [`${t}-dot-pulse`]: x,
@@ -153,7 +154,7 @@ function Q(P, v) {
153
154
  },
154
155
  m
155
156
  ),
156
- style: { ...a, ...n }
157
+ style: { ...a, ...i }
157
158
  }
158
159
  )
159
160
  }
@@ -161,8 +162,8 @@ function Q(P, v) {
161
162
  B,
162
163
  {
163
164
  prefixCls: t,
164
- className: i(`${t}-number`, m),
165
- style: { ...a, ...n },
165
+ className: n(`${t}-number`, m),
166
+ style: { ...a, ...i },
166
167
  maxCount: E,
167
168
  count: s
168
169
  }
@@ -173,7 +174,7 @@ function Q(P, v) {
173
174
  return /* @__PURE__ */ c(
174
175
  "div",
175
176
  {
176
- className: i(
177
+ className: n(
177
178
  `${t}-ribbon`,
178
179
  `${t}-ribbon-${_}`,
179
180
  {
@@ -205,7 +206,7 @@ function Q(P, v) {
205
206
  ) : /* @__PURE__ */ c(
206
207
  "span",
207
208
  {
208
- className: i(
209
+ className: n(
209
210
  t,
210
211
  {
211
212
  [`${t}-status`]: p,
@@ -228,7 +229,7 @@ function Q(P, v) {
228
229
  const D = z(Q);
229
230
  D.displayName = "Badge";
230
231
  D.Count = B;
231
- const Wt = f, Xt = [
232
+ const Xt = f, Yt = [
232
233
  "default",
233
234
  "processing",
234
235
  "success",
@@ -236,8 +237,8 @@ const Wt = f, Xt = [
236
237
  "error"
237
238
  ];
238
239
  export {
239
- Wt as BADGE_COLORS,
240
- Xt as BADGE_STATUS,
240
+ Xt as BADGE_COLORS,
241
+ Yt as BADGE_STATUS,
241
242
  B as BadgeCount,
242
243
  D as default
243
244
  };
package/calendar/index.js CHANGED
@@ -1,65 +1,65 @@
1
- import { jsxs as te, jsx as r } from "react/jsx-runtime";
2
- import ne from "lodash/merge";
3
- import { useContext as re, useState as M, useMemo as se } from "react";
1
+ import { jsxs as ne, jsx as r } from "react/jsx-runtime";
2
+ import re from "lodash/merge";
3
+ import { useContext as se, useState as M, useMemo as le } from "react";
4
4
  import "../config-provider/ConfigProvider.js";
5
- import le from "../components/common/hooks/useMergeProps.js";
5
+ import de from "../components/common/hooks/useMergeProps.js";
6
6
  import me from "@unicom-cloud/utils/class-name";
7
- import { getDayjsValue as u, getNow as $, methods as g } from "../components/common/utils/dayjs.js";
8
- import { pickDataAttributes as de } from "../components/common/utils/pick.js";
9
- import ce, { getAllDaysByTime as ie } from "./Month.js";
10
- import pe from "./Year.js";
11
- import fe from "./header/index.js";
12
- import he from "./header/Panel.js";
13
- import ue from "../config-provider/context.js";
14
- function ge(d, y) {
15
- return d === "month" || d === "year" && !y ? "YYYY-MM-DD" : "YYYY-MM";
7
+ import { getDayjsValue as u, getNow as A, methods as g } from "../components/common/utils/dayjs.js";
8
+ import { pickDataAttributes as ce } from "../components/common/utils/pick.js";
9
+ import ie, { getAllDaysByTime as pe } from "./Month.js";
10
+ import fe from "./Year.js";
11
+ import he from "./header/index.js";
12
+ import ue from "./header/Panel.js";
13
+ import ge from "../config-provider/context.js";
14
+ function ye(m, y) {
15
+ return m === "month" || m === "year" && !y ? "YYYY-MM-DD" : "YYYY-MM";
16
16
  }
17
- const ye = {
17
+ const Ce = {
18
18
  dayStartOfWeek: 0,
19
19
  panelWidth: 265,
20
20
  defaultMode: "month",
21
21
  headerType: "button",
22
22
  modes: ["month", "year"]
23
23
  };
24
- function Ce(d) {
24
+ function De(m) {
25
25
  const {
26
26
  getPrefixCls: y,
27
- locale: A,
28
- componentConfig: k,
29
- rtl: H
30
- } = re(ue), s = le(
31
- d,
32
- ye,
33
- k?.Calendar
27
+ locale: k,
28
+ componentConfig: H,
29
+ rtl: L
30
+ } = se(ge), s = de(
31
+ m,
32
+ Ce,
33
+ H?.Calendar
34
34
  ), {
35
- style: L,
36
- className: O,
37
- dayStartOfWeek: T,
38
- panel: m,
39
- locale: W,
40
- panelWidth: j,
41
- panelTodayBtn: B,
42
- defaultPageShowDate: E,
35
+ style: O,
36
+ className: T,
37
+ dayStartOfWeek: W,
38
+ panel: d,
39
+ locale: j,
40
+ panelWidth: B,
41
+ panelTodayBtn: E,
42
+ defaultPageShowDate: F,
43
43
  value: w,
44
- pageShowDate: F,
45
- defaultValue: R,
44
+ pageShowDate: R,
45
+ defaultValue: _,
46
46
  mode: S,
47
- defaultMode: _,
48
- onChange: q,
47
+ defaultMode: q,
48
+ onChange: z,
49
49
  onPanelChange: c,
50
50
  headerRender: P,
51
- headerType: z,
52
- modes: G,
53
- panelOperations: I
54
- } = s, l = ne(A.Calendar, W), o = y?.("calendar"), [J, K] = M(
55
- S || _
56
- ), a = S || J, i = ge(a, m), [Y, Q] = M(
57
- u(w || R, i)
58
- ), [U, p] = M(
59
- u(E, i) || Y || $()
60
- ), t = u(F, i) || U, C = "value" in s ? u(w, i) : Y, N = se(() => ie(s, t), [t.toString(), a, T]);
51
+ headerType: G,
52
+ modes: I,
53
+ panelOperations: J
54
+ } = s, l = re(k.Calendar, j), o = y?.("calendar"), [K, Q] = M(
55
+ S || q
56
+ ), a = S || K, i = ye(a, d), [Y, U] = M(
57
+ u(w || _, i)
58
+ ), [X, p] = M(
59
+ u(F, i) || Y || A()
60
+ ), t = u(R, i) || X, C = "value" in s ? u(w, i) : Y, N = le(() => pe(s, t), [t.toString(), a, W]);
61
61
  function f(e) {
62
- Q(e), q?.(e), v(e);
62
+ U(e), z?.(e), v(e);
63
63
  }
64
64
  function v(e) {
65
65
  p(e), c?.(e);
@@ -69,66 +69,67 @@ function Ce(d) {
69
69
  }
70
70
  let D = "";
71
71
  a === "month" ? D = l.formatMonth : a === "year" && (D = l.formatYear);
72
- function X(e, n) {
72
+ function Z(e, n) {
73
73
  let h;
74
74
  e === "prev" && (h = g.subtract(t, 1, n)), e === "next" && (h = g.add(t, 1, n)), p(h), c?.(h);
75
75
  }
76
- function Z(e) {
76
+ function ee(e) {
77
77
  const n = g.set(t, "year", e);
78
78
  p(n), c?.(n);
79
79
  }
80
- function ee(e) {
80
+ function ae(e) {
81
81
  const n = g.set(t, "month", e - 1);
82
82
  p(n), c?.(n);
83
83
  }
84
84
  function x(e) {
85
- K(e);
85
+ Q(e);
86
86
  }
87
- const ae = me(
87
+ const oe = me(
88
88
  o,
89
89
  a === "month" ? `${o}-mode-month` : `${o}-mode-year`,
90
90
  {
91
- [`${o}-panel`]: m && (a === "month" || a === "year"),
92
- [`${o}-rtl`]: H
91
+ [`${o}-panel`]: d && (a === "month" || a === "year"),
92
+ [`${o}-rtl`]: L
93
93
  },
94
- O
95
- ), oe = m ? { width: j } : {}, V = {
94
+ T
95
+ ), te = d ? { width: B } : {}, V = {
96
96
  prefixCls: o,
97
- changePageShowDate: X,
97
+ changePageShowDate: Z,
98
98
  headerValueFormat: D,
99
99
  mergedPageShowDate: t,
100
- modes: G,
100
+ modes: I,
101
101
  innerMode: a,
102
- panelOperations: I
103
- };
104
- return /* @__PURE__ */ te(
102
+ panelOperations: J
103
+ }, $ = d ? /* @__PURE__ */ r(ue, { ...V }) : /* @__PURE__ */ r(
104
+ he,
105
+ {
106
+ ...V,
107
+ CALENDAR_LOCALE: l,
108
+ move: f,
109
+ innerMode: a,
110
+ changeMode: x,
111
+ onChangeYear: ee,
112
+ onChangeMonth: ae,
113
+ headerType: G
114
+ }
115
+ );
116
+ return /* @__PURE__ */ ne(
105
117
  "div",
106
118
  {
107
- className: ae,
108
- style: { ...L, ...oe },
109
- ...de(s),
119
+ className: oe,
120
+ style: { ...O, ...te },
121
+ ...ce(s),
110
122
  children: [
111
123
  typeof P == "function" ? P({
112
124
  value: C,
113
125
  pageShowDate: t,
114
126
  onChangeMode: x,
115
127
  onChange: f,
116
- onChangePageDate: v
117
- }) : m ? /* @__PURE__ */ r(he, { ...V }) : /* @__PURE__ */ r(
118
- fe,
119
- {
120
- ...V,
121
- CALENDAR_LOCALE: l,
122
- move: f,
123
- innerMode: a,
124
- changeMode: x,
125
- onChangeYear: Z,
126
- onChangeMonth: ee,
127
- headerType: z
128
- }
129
- ),
128
+ onChangePageDate: v,
129
+ header: $
130
+ }) : $,
130
131
  a === "month" && /* @__PURE__ */ r("div", { className: `${o}-body`, children: /* @__PURE__ */ r(
131
- ce,
132
+ ie,
132
133
  {
133
134
  ...s,
134
135
  prefixCls: o,
@@ -141,7 +142,7 @@ function Ce(d) {
141
142
  }
142
143
  ) }),
143
144
  a === "year" && /* @__PURE__ */ r("div", { className: `${o}-body`, children: /* @__PURE__ */ r(
144
- pe,
145
+ fe,
145
146
  {
146
147
  ...s,
147
148
  prefixCls: o,
@@ -153,11 +154,11 @@ function Ce(d) {
153
154
  CALENDAR_LOCALE: l
154
155
  }
155
156
  ) }),
156
- B && m && /* @__PURE__ */ r(
157
+ E && d && /* @__PURE__ */ r(
157
158
  "div",
158
159
  {
159
160
  className: `${o}-footer-btn-wrapper`,
160
- onClick: () => f($()),
161
+ onClick: () => f(A()),
161
162
  children: l.today
162
163
  }
163
164
  )
@@ -165,9 +166,9 @@ function Ce(d) {
165
166
  }
166
167
  );
167
168
  }
168
- Ce.displayName = "Calendar";
169
+ De.displayName = "Calendar";
169
170
  export {
170
- ce as CalendarMonth,
171
- pe as CalendarYear,
172
- Ce as default
171
+ ie as CalendarMonth,
172
+ fe as CalendarYear,
173
+ De as default
173
174
  };
@@ -1,32 +1,47 @@
1
- import { jsxs as r, jsx as l } from "react/jsx-runtime";
2
- import n from "@unicom-cloud/icons/IconFluentFlatHourglassNotDone";
3
- import a from "@unicom-cloud/utils/class-name";
4
- import { UI_COMMON_PREFIX as o } from "@unicom-cloud/utils/constant/ui";
5
- import s from "lodash/uniqBy";
6
- import c from "lodash/uniqWith";
7
- import { forwardRef as f, useEffect as u, useImperativeHandle as x } from "react";
8
- function N(e, i) {
9
- c([], (t) => t.xxx), s([{ x: 1 }, { x: 2 }, { x: 1 }], "x");
10
- const m = `${o}-development`;
11
- return u(() => () => {
12
- }, []), x(i, () => ({})), /* @__PURE__ */ r("div", { className: a(m, e.className), children: [
13
- e.url ? /* @__PURE__ */ l(
14
- "img",
15
- {
16
- className: a(`${m}-img`, e.imgClassName),
17
- src: e.url
18
- },
19
- "img"
20
- ) : e.icon ?? /* @__PURE__ */ l(
21
- n,
22
- {
23
- className: a(`${m}-icon`, e.iconClassName)
24
- }
25
- ),
26
- /* @__PURE__ */ l("div", { className: a(`${m}-label`, e.labelClassName), children: e.tip ?? e.label ?? "等待开发" })
1
+ import { jsx as l, jsxs as u } from "react/jsx-runtime";
2
+ import C from "@unicom-cloud/icons/IconFluentFlatHourglassNotDone";
3
+ import s from "@unicom-cloud/utils/class-name";
4
+ import { UI_COMMON_PREFIX as v } from "@unicom-cloud/utils/constant/ui";
5
+ import { forwardRef as x, useMemo as b } from "react";
6
+ const g = (t, n) => {
7
+ const {
8
+ url: a,
9
+ // 图片地址
10
+ imgClassName: o,
11
+ // 图片自定义类名
12
+ icon: m,
13
+ // 自定义图标
14
+ iconClassName: r,
15
+ // 图标自定义类名
16
+ tip: c,
17
+ // 高优先级提示文字
18
+ label: i = "等待开发",
19
+ // 次要提示文字(默认值)
20
+ labelClassName: p,
21
+ // 文字容器类名
22
+ className: N
23
+ // 外层容器类名
24
+ } = t, e = `${v}-development`, d = b(() => a ? /* @__PURE__ */ l(
25
+ "img",
26
+ {
27
+ className: s(`${e}-img`, o),
28
+ src: a,
29
+ alt: "开发预览图"
30
+ }
31
+ ) : m ?? /* @__PURE__ */ l(
32
+ C,
33
+ {
34
+ className: s(`${e}-icon`, r)
35
+ }
36
+ ), [a, e, o, m, r]), f = c ?? i;
37
+ return /* @__PURE__ */ u("div", { ref: n, className: s(e, N), children: [
38
+ d,
39
+ /* @__PURE__ */ l("div", { className: s(`${e}-label`, p), children: f })
27
40
  ] });
28
- }
29
- const h = f(N);
41
+ }, D = x(
42
+ g
43
+ );
44
+ D.displayName = "Development";
30
45
  export {
31
- h as default
46
+ D as default
32
47
  };
@@ -1,37 +1,49 @@
1
- import { jsxs as N, jsx as t } from "react/jsx-runtime";
1
+ import { jsxs as N, jsx as s } from "react/jsx-runtime";
2
2
  import $ from "@unicom-cloud/icons/IconUiEmpty";
3
- import { UI_COMMON_PREFIX as y } from "@unicom-cloud/utils/constant/ui";
4
- import { memo as g, forwardRef as x } from "react";
5
- import { SpaceVertical as u } from "../space/index.js";
6
- import s from "@unicom-cloud/utils/class-name";
7
- function C(c, n) {
8
- const { style: a, className: p, description: m, icon: o, imgSrc: r, prefixCls: l, ...f } = c, e = `${y}-empty`, i = l ?? e, d = typeof m == "string" ? m : "empty";
3
+ import { UI_COMMON_PREFIX as g } from "@unicom-cloud/utils/constant/ui";
4
+ import { memo as x, forwardRef as u } from "react";
5
+ import { SpaceVertical as C } from "../space/index.js";
6
+ import r from "@unicom-cloud/utils/class-name";
7
+ const E = (n, c) => {
8
+ const {
9
+ style: a,
10
+ className: p,
11
+ description: i = "无数据",
12
+ // 默认描述文本
13
+ icon: o,
14
+ imgSrc: m,
15
+ prefixCls: l,
16
+ ...f
17
+ } = n, e = `${g}-empty`, t = l ?? e, d = typeof i == "string" ? i : "empty", y = () => m ? /* @__PURE__ */ s(
18
+ "img",
19
+ {
20
+ className: r(`${e}-img`, `${t}-img`),
21
+ alt: d,
22
+ src: m,
23
+ loading: "lazy"
24
+ }
25
+ ) : o ? /* @__PURE__ */ s("div", { className: r(`${e}-icon`, `${t}-icon`), children: o }) : /* @__PURE__ */ s($, { className: r(`${e}-icon`, `${t}-icon`) });
9
26
  return /* @__PURE__ */ N(
10
- u,
27
+ C,
11
28
  {
12
- ref: n,
13
- className: s(e, i, p),
29
+ ref: c,
30
+ className: r(e, t, p),
14
31
  style: a,
15
32
  justifyContent: "center",
16
33
  alignItems: "center",
17
34
  gap: 5,
18
35
  ...f,
19
36
  children: [
20
- r ? /* @__PURE__ */ t(
21
- "img",
22
- {
23
- className: s(`${e}-img`, `${i}-img`),
24
- alt: d,
25
- src: r
26
- }
27
- ) : o ? /* @__PURE__ */ t("div", { className: s(`${e}-icon`, `${i}-icon`), children: o }) : /* @__PURE__ */ t($, { className: s(`${e}-icon`, `${i}-icon`) }),
28
- /* @__PURE__ */ t("div", { className: s(`${e}-description`, `${i}-description`), children: m || "无数据" })
37
+ y(),
38
+ /* @__PURE__ */ s("div", { className: r(`${e}-description`, `${t}-description`), children: i })
29
39
  ]
30
40
  }
31
41
  );
32
- }
33
- const E = g(x(C));
34
- E.displayName = "Empty";
42
+ }, I = x(
43
+ u(E)
44
+ );
45
+ I.displayName = "Empty";
35
46
  export {
36
- E as default
47
+ I as Empty,
48
+ I as default
37
49
  };
@@ -0,0 +1,64 @@
1
+ import { jsx as d } from "react/jsx-runtime";
2
+ import { UI_COMMON_PREFIX as j } from "@unicom-cloud/utils/constant/ui";
3
+ import { forwardRef as x, useMemo as C } from "react";
4
+ import I from "../hooks/useMergeProps.js";
5
+ import P from "@unicom-cloud/utils/class-name";
6
+ import "../utils/is.js";
7
+ import { GAP_SIZE_MAP as y } from "./interface.js";
8
+ import { isBoolean as V, isArray as _, isString as A } from "@unicom-cloud/utils/is";
9
+ const O = (o) => A(o) && Object.keys(y).includes(o), m = (o, r, t) => {
10
+ t !== void 0 && (O(t) ? o[r] = y[t] : o[r] = typeof t == "number" ? `${t}px` : t);
11
+ }, S = (o = {}, r, t = "gap") => (r === void 0 || (_(r) ? (m(o, "rowGap", r[0]), m(o, "columnGap", r[1])) : m(o, t, r)), o), b = {
12
+ component: "div",
13
+ gap: "small"
14
+ }, a = x((o, r) => {
15
+ const t = I(o, b, {}), {
16
+ className: g,
17
+ style: c,
18
+ flex: l,
19
+ gap: f,
20
+ children: u,
21
+ direction: e,
22
+ justify: i,
23
+ align: n,
24
+ component: N = "div",
25
+ wrap: s,
26
+ rtl: w,
27
+ ...F
28
+ } = t, p = `${j}-flex`, G = C(() => {
29
+ const M = {
30
+ display: "flex",
31
+ ...S({}, f),
32
+ ...s !== void 0 && {
33
+ flexWrap: V(s) ? s ? "wrap" : "nowrap" : s
34
+ },
35
+ ...n && { alignItems: n },
36
+ ...i && { justifyContent: i },
37
+ ...e && { flexDirection: e },
38
+ ...l && { flex: l }
39
+ };
40
+ return { ...c, ...M };
41
+ }, [f, s, n, i, e, l, c]);
42
+ return /* @__PURE__ */ d(
43
+ N,
44
+ {
45
+ ref: r,
46
+ style: G,
47
+ className: P(p, g, {
48
+ [`${p}-rtl`]: w,
49
+ [`${p}-${e}`]: e,
50
+ [`${p}-${i}`]: i,
51
+ [`${p}-${n}`]: n
52
+ }),
53
+ ...F,
54
+ children: u
55
+ }
56
+ );
57
+ }), $ = x((o, r) => /* @__PURE__ */ d(a, { ref: r, ...o, direction: "column" }));
58
+ a.Vertical = $;
59
+ a.displayName = "Flex";
60
+ $.displayName = "Flex.Vertical";
61
+ export {
62
+ $ as FlexVertical,
63
+ a as default
64
+ };
@@ -0,0 +1,9 @@
1
+ const p = {
2
+ mini: "4px",
3
+ small: "8px",
4
+ medium: "12px",
5
+ large: "20px"
6
+ };
7
+ export {
8
+ p as GAP_SIZE_MAP
9
+ };