@unicom-cloud/ui 0.8.100 → 0.8.102

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 (301) hide show
  1. package/Badge.js +7 -54
  2. package/Copy.js +5 -4
  3. package/Details.js +13 -2
  4. package/Divider.js +3 -2
  5. package/Flex.js +14 -4
  6. package/LiquidFill.js +5 -4
  7. package/List.js +1 -1
  8. package/Loading.js +16 -3
  9. package/Marquee.js +5 -4
  10. package/QrCode.js +5 -4
  11. package/Space.js +3 -3
  12. package/Splitter.js +4 -3
  13. package/SuspenseFallbackTest.js +2 -4
  14. package/Tooltip.js +3 -4
  15. package/Tour.js +5 -4
  16. package/alert/index.js +60 -62
  17. package/anchor/Anchor.js +12 -12
  18. package/anchor/util.js +10 -10
  19. package/back-top/index.js +33 -34
  20. package/badge/index.js +109 -162
  21. package/calendar/index.js +85 -84
  22. package/card/index.js +63 -43
  23. package/color-picker/InputHex.js +3 -4
  24. package/color-picker/InputRgb.js +7 -8
  25. package/color-picker/Palette.js +3 -4
  26. package/color-picker/Panel.js +3 -4
  27. package/color-picker/colors.js +5 -5
  28. package/color-picker/hooks/useColorPicker.js +3 -4
  29. package/color-picker/utils.js +14 -15
  30. package/components/common/development/index.js +44 -29
  31. package/components/common/empty/index.js +35 -23
  32. package/components/common/flex/index.js +64 -0
  33. package/components/common/flex/interface.js +9 -0
  34. package/components/common/higher-order/with-speech-synthesis/index.js +79 -55
  35. package/components/common/space/index.js +71 -91
  36. package/components/common/suspense-fallback-test/index.js +16 -0
  37. package/components/common/utils/PqbCSSTransition.js +1 -1
  38. package/components/common/utils/constant.js +6 -3
  39. package/components/common/utils/reactDOM.js +6 -4
  40. package/components/common/utils/{scrollIntoView.js → scrollIntoViewIfNeeded.js} +1 -1
  41. package/components/common/utils/setPrimaryColor.js +18 -18
  42. package/components/common/utils/setTheme.js +8 -9
  43. package/components/common/utils/toArray.js +12 -0
  44. package/copy/index.js +3 -2
  45. package/details/index.js +102 -62
  46. package/dist/scroll-into-view-if-needed/compute/index.js +126 -0
  47. package/dist/scroll-into-view-if-needed/smooth/index.js +70 -0
  48. package/dist/scroll-into-view-if-needed/src/index.js +19 -19
  49. package/divider/index.js +27 -21
  50. package/empty/index.js +13 -13
  51. package/flex/index.js +43 -55
  52. package/flex/interface.js +1 -34
  53. package/form/FormItem.js +69 -65
  54. package/form/context.js +6 -7
  55. package/grid/Col-.js +86 -0
  56. package/grid/Col.js +156 -73
  57. package/grid/Grid.js +71 -67
  58. package/grid/Row.js +3 -3
  59. package/grid/index.js +13 -13
  60. package/icon/interface.js +1 -0
  61. package/icon-hover/interface.js +1 -0
  62. package/index.js +641 -663
  63. package/input/Textarea.js +1 -1
  64. package/input/autoSizeTextAreaHeight.js +7 -7
  65. package/liquid-fill/index.js +5 -4
  66. package/list/index.js +1 -1
  67. package/loading/index.js +72 -53
  68. package/loading/interface.js +1 -0
  69. package/marquee/index.js +5 -4
  70. package/menu/Item.js +9 -9
  71. package/modal/Modal.js +73 -74
  72. package/package.json +1 -1
  73. package/portal/interface.js +1 -0
  74. package/qr-code/index.js +5 -4
  75. package/segmented/index.js +47 -47
  76. package/space/index.js +41 -35
  77. package/speech-synthesis/interface.js +1 -0
  78. package/splitter/SplitBar.js +81 -79
  79. package/splitter/Splitter.js +92 -104
  80. package/splitter/hooks/useItems.js +1 -1
  81. package/splitter/hooks/useResizable.js +9 -18
  82. package/splitter/hooks/useResize.js +10 -10
  83. package/splitter/hooks/useSizes.js +28 -28
  84. package/splitter/index.js +5 -4
  85. package/statistic/index.js +10 -10
  86. package/style.css +1 -1
  87. package/suspense-fallback-test/index.js +2 -11
  88. package/suspense-fallback-test/interface.js +1 -0
  89. package/table/Table.js +376 -377
  90. package/table/hook/useThResizable.js +5 -4
  91. package/table/th-resizable/index.js +12 -11
  92. package/time-picker/util.js +8 -8
  93. package/tooltip/index.js +1 -2
  94. package/tour/index.js +5 -4
  95. package/tree/NodeList.js +1 -1
  96. package/trigger/index.js +67 -70
  97. package/types/common/development/index.d.ts +7 -1
  98. package/types/common/development/interface.d.ts +22 -0
  99. package/types/common/empty/index.d.ts +2 -1
  100. package/types/common/flex/index.d.ts +14 -0
  101. package/types/common/flex/interface.d.ts +62 -0
  102. package/types/common/higher-order/with-speech-synthesis/index.d.ts +6 -1
  103. package/types/common/higher-order/with-speech-synthesis/interface.d.ts +13 -0
  104. package/types/common/space/index.d.ts +4 -4
  105. package/types/common/space/interface.d.ts +10 -18
  106. package/types/common/suspense-fallback-test/index.d.ts +7 -0
  107. package/types/common/suspense-fallback-test/interface.d.ts +1 -0
  108. package/types/common/utils/PqbCSSTransition.d.ts +1 -1
  109. package/types/common/utils/constant.d.ts +1 -0
  110. package/types/common/utils/scrollIntoViewIfNeeded.d.ts +4 -0
  111. package/types/common/utils/toArray.d.ts +13 -0
  112. package/types/common/utils/tree.d.ts +1 -0
  113. package/types/common/utils/tween.d.ts +1 -0
  114. package/types/pc/alert/index.d.ts +2 -1
  115. package/types/pc/alert/interface.d.ts +7 -1
  116. package/types/pc/anchor/util.d.ts +1 -1
  117. package/types/pc/badge/Count.d.ts +1 -1
  118. package/types/pc/badge/interface.d.ts +2 -0
  119. package/types/pc/breadcrumb/Item.d.ts +1 -1
  120. package/types/pc/calendar/Month.d.ts +1 -1
  121. package/types/pc/calendar/WeekList.d.ts +1 -1
  122. package/types/pc/calendar/Year.d.ts +1 -1
  123. package/types/pc/calendar/header/Panel.d.ts +1 -1
  124. package/types/pc/calendar/header/index.d.ts +1 -1
  125. package/types/pc/calendar/index.d.ts +1 -1
  126. package/types/pc/calendar/interface.d.ts +2 -1
  127. package/types/pc/card/interface.d.ts +8 -0
  128. package/types/pc/cascader/interface.d.ts +1 -1
  129. package/types/pc/cascader/panel/List.d.ts +1 -1
  130. package/types/pc/cascader/panel/Option.d.ts +1 -1
  131. package/types/pc/cascader/panel/Search.d.ts +1 -1
  132. package/types/pc/checkbox/Group.d.ts +2 -2
  133. package/types/pc/checkbox/GroupBlock.d.ts +1 -1
  134. package/types/pc/checkbox/IconCheck.d.ts +1 -1
  135. package/types/pc/color-picker/InputRgb.d.ts +1 -1
  136. package/types/pc/color-picker/Palette.d.ts +1 -1
  137. package/types/pc/color-picker/hooks/useColorPicker.d.ts +7 -2
  138. package/types/pc/color-picker/utils.d.ts +6 -1
  139. package/types/pc/config-provider/ConfigProvider.d.ts +1 -1
  140. package/types/pc/config-provider/interface.d.ts +4 -0
  141. package/types/pc/copy/index.d.ts +1 -1
  142. package/types/pc/date-picker/panel/Body.d.ts +1 -1
  143. package/types/pc/date-picker/panel/Footer.d.ts +1 -1
  144. package/types/pc/date-picker/panel/Header.d.ts +1 -1
  145. package/types/pc/date-picker/panel/WeekList.d.ts +1 -1
  146. package/types/pc/date-picker/panel/date/index.d.ts +1 -1
  147. package/types/pc/date-picker/panel/month/index.d.ts +1 -1
  148. package/types/pc/date-picker/panel/quarter/index.d.ts +1 -1
  149. package/types/pc/date-picker/panel/range/index.d.ts +1 -1
  150. package/types/pc/date-picker/panel/week/index.d.ts +1 -1
  151. package/types/pc/date-picker/panel/year/index.d.ts +1 -1
  152. package/types/pc/descriptions/index.d.ts +1 -1
  153. package/types/pc/details/index.d.ts +3 -2
  154. package/types/pc/details/interface.d.ts +16 -0
  155. package/types/pc/development/index.d.ts +2 -1
  156. package/types/pc/development/interface.d.ts +15 -0
  157. package/types/pc/divider/index.d.ts +7 -2
  158. package/types/pc/draggable/Item.d.ts +1 -1
  159. package/types/pc/draggable/index.d.ts +1 -1
  160. package/types/pc/flex/index.d.ts +4 -4
  161. package/types/pc/flex/interface.d.ts +8 -53
  162. package/types/pc/form/Control.d.ts +1 -1
  163. package/types/pc/form/FormItem.d.ts +1 -1
  164. package/types/pc/form/FormList.d.ts +1 -1
  165. package/types/pc/form/IconSymbol.d.ts +1 -1
  166. package/types/pc/grid/Col-.d.ts +4 -0
  167. package/types/pc/grid/Col.d.ts +3 -2
  168. package/types/pc/grid/Grid.d.ts +2 -2
  169. package/types/pc/grid/Item.d.ts +3 -3
  170. package/types/pc/grid/Row.d.ts +2 -2
  171. package/types/pc/grid/hook/useResponsiveState.d.ts +2 -2
  172. package/types/pc/grid/interface.d.ts +13 -7
  173. package/types/pc/icon/addFromIconFontCn.d.ts +1 -7
  174. package/types/pc/icon/index.d.ts +2 -7
  175. package/types/pc/icon/interface.d.ts +13 -0
  176. package/types/pc/icon-hover/index.d.ts +2 -8
  177. package/types/pc/icon-hover/interface.d.ts +8 -0
  178. package/types/pc/image/ImageFooter.d.ts +1 -1
  179. package/types/pc/image/ImagePreviewArrow.d.ts +1 -1
  180. package/types/pc/image/TriggerForToolbar.d.ts +1 -1
  181. package/types/pc/index.d.ts +60 -51
  182. package/types/pc/loading/index.d.ts +4 -3
  183. package/types/pc/loading/interface.d.ts +6 -0
  184. package/types/pc/menu/Indent.d.ts +1 -1
  185. package/types/pc/menu/OverflowWrap.d.ts +1 -1
  186. package/types/pc/menu/sub-menu/Inline.d.ts +1 -1
  187. package/types/pc/menu/sub-menu/Pop.d.ts +1 -1
  188. package/types/pc/overflow-ellipsis/OverflowItem.d.ts +1 -1
  189. package/types/pc/overflow-ellipsis/index.d.ts +1 -1
  190. package/types/pc/pagination/PageItem.d.ts +3 -3
  191. package/types/pc/pagination/PageJumper.d.ts +1 -1
  192. package/types/pc/pagination/PageOption.d.ts +1 -1
  193. package/types/pc/portal/Portal.d.ts +2 -6
  194. package/types/pc/portal/index.d.ts +2 -9
  195. package/types/pc/portal/interface.d.ts +14 -0
  196. package/types/pc/progress/CircleProgress.d.ts +1 -1
  197. package/types/pc/progress/LineProgess.d.ts +1 -1
  198. package/types/pc/progress/StepProgress.d.ts +1 -1
  199. package/types/pc/radio/Group.d.ts +2 -2
  200. package/types/pc/radio/GroupBlock.d.ts +1 -1
  201. package/types/pc/radio/Radio.d.ts +1 -1
  202. package/types/pc/resize-box/ResizeTrigger.d.ts +1 -1
  203. package/types/pc/result/403.d.ts +1 -1
  204. package/types/pc/result/404.d.ts +1 -1
  205. package/types/pc/result/500.d.ts +1 -1
  206. package/types/pc/segmented/interface.d.ts +6 -6
  207. package/types/pc/skeleton/Image.d.ts +1 -1
  208. package/types/pc/skeleton/Text.d.ts +2 -1
  209. package/types/pc/slider/Button.d.ts +1 -1
  210. package/types/pc/slider/Input.d.ts +1 -1
  211. package/types/pc/slider/Tick.d.ts +1 -1
  212. package/types/pc/space/index.d.ts +6 -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/splitter/SplitBar.d.ts +0 -1
  217. package/types/pc/splitter/hooks/useResizable.d.ts +0 -1
  218. package/types/pc/splitter/hooks/useResize.d.ts +1 -2
  219. package/types/pc/splitter/index.d.ts +5 -4
  220. package/types/pc/splitter/interface.d.ts +16 -24
  221. package/types/pc/suspense-fallback-test/index.d.ts +2 -3
  222. package/types/pc/suspense-fallback-test/interface.d.ts +2 -0
  223. package/types/pc/table/ColGroup.d.ts +1 -1
  224. package/types/pc/table/summary/Cell.d.ts +1 -1
  225. package/types/pc/table/summary/Row.d.ts +1 -1
  226. package/types/pc/table/tbody/Td.d.ts +1 -1
  227. package/types/pc/table/tbody/index.d.ts +1 -1
  228. package/types/pc/table/tfoot/index.d.ts +1 -1
  229. package/types/pc/table/th-resizable/index.d.ts +1 -1
  230. package/types/pc/table/thead/Column.d.ts +1 -1
  231. package/types/pc/table/thead/index.d.ts +1 -1
  232. package/types/pc/tabs/TabContent.d.ts +1 -1
  233. package/types/pc/tabs/tab-header/DropdownIcon.d.ts +1 -1
  234. package/types/pc/tabs/tab-header/TabInk.d.ts +1 -1
  235. package/types/pc/tabs/tab-header/TabNavIcon.d.ts +1 -1
  236. package/types/pc/time-picker/Picker.d.ts +1 -1
  237. package/types/pc/time-picker/RangePicker.d.ts +1 -1
  238. package/types/pc/time-picker/TimeColumn.d.ts +1 -1
  239. package/types/pc/time-picker/TimePicker.d.ts +1 -1
  240. package/types/pc/time-picker/index.d.ts +1 -1
  241. package/types/pc/tour/index.d.ts +1 -1
  242. package/types/pc/transfer/Item.d.ts +1 -1
  243. package/types/pc/transfer/List.d.ts +1 -1
  244. package/types/pc/tree/Animation.d.ts +1 -1
  245. package/types/pc/typography/Operations.d.ts +1 -1
  246. package/types/pc/upload/interface.d.ts +1 -0
  247. package/types/pc/upload/list/index.d.ts +1 -1
  248. package/types/pc/utils/constant.d.ts +1 -2
  249. package/types/pc/utils/dayjs.d.ts +2 -1
  250. package/types/pc/utils/index.d.ts +2 -5
  251. package/types/pc/utils/scrollIntoViewIfNeeded.d.ts +3 -0
  252. package/types/pc/utils/toArray.d.ts +1 -5
  253. package/types/pc/utils/tree.d.ts +2 -1
  254. package/types/pc/utils/tween.d.ts +1 -1
  255. package/types/pc/verification-code/VerificationCode.d.ts +1 -1
  256. package/types/pc/virtual-list/VirtualList.d.ts +2 -38
  257. package/types/pc/virtual-list/index.d.ts +2 -1
  258. package/types/pc/virtual-list/interface.d.ts +56 -0
  259. package/types/pc/watermark/Watermark.d.ts +1 -1
  260. package/typography/Ellipsis.js +5 -4
  261. package/typography/Operations.js +5 -4
  262. package/upload/request.js +12 -13
  263. package/upload/request_.js +2 -3
  264. package/utils/constant.js +5 -5
  265. package/utils/dayjs.js +13 -12
  266. package/utils/index.js +261 -284
  267. package/utils/scrollIntoViewIfNeeded.js +12 -0
  268. package/utils/toArray.js +3 -10
  269. package/utils/tree.js +11 -9
  270. package/utils/tween.js +5 -5
  271. package/version/index.js +1 -1
  272. package/virtual-list/interface.js +1 -0
  273. package/components/common/space/toArray.js +0 -11
  274. package/components/common/utils/convertToDurationBasedOnTimeUnits.js +0 -6
  275. package/dist/compute-scroll-into-view/src/index.js +0 -126
  276. package/dist/tinycolor/chunk/BOzCVdr0.js +0 -182
  277. package/dist/tinycolor/customize/index.js +0 -12
  278. package/dist/tinycolor/src/conversion.js +0 -143
  279. package/dist/tinycolor/src/css-color-names.js +0 -153
  280. package/dist/tinycolor/src/format-input.js +0 -77
  281. package/dist/tinycolor/src/index.js +0 -388
  282. package/dist/tinycolor/src/util.js +0 -32
  283. package/flex/utils.js +0 -13
  284. package/loading/style/index.module.less.js +0 -4
  285. package/types/common/space/toArray.d.ts +0 -3
  286. package/types/common/utils/convertToDurationBasedOnTimeUnits.d.ts +0 -3
  287. package/types/common/utils/scrollIntoView.d.ts +0 -4
  288. package/types/common/utils/tinycolor.d.ts +0 -1
  289. package/types/pc/flex/utils.d.ts +0 -9
  290. package/types/pc/suspense-fallback-test/style/index.d.ts +0 -1
  291. package/types/pc/utils/color.d.ts +0 -1
  292. package/types/pc/utils/computeScrollIntoView.d.ts +0 -1
  293. package/types/pc/utils/convertToDurationBasedOnTimeUnits.d.ts +0 -3
  294. package/types/pc/utils/scrollIntoView.d.ts +0 -3
  295. package/types/pc/utils/tinycolor.d.ts +0 -1
  296. package/utils/color.js +0 -4
  297. package/utils/computeScrollIntoView.js +0 -6
  298. package/utils/convertToDurationBasedOnTimeUnits.js +0 -6
  299. package/utils/scrollIntoView.js +0 -6
  300. package/utils/tinycolor.js +0 -29
  301. /package/{suspense-fallback-test/style/index.less.js → development/interface.js} +0 -0
@@ -1,77 +0,0 @@
1
- import { rgbToRgb as A, hsvToRgb as y, hslToRgb as F, cmykToRgb as v, convertHexToDecimal as i, parseIntFromHex as n } from "./conversion.js";
2
- import { names as u } from "./css-color-names.js";
3
- import { convertToPercentage as x, boundAlpha as R } from "./util.js";
4
- function M(a) {
5
- let r = { r: 0, g: 0, b: 0 }, e = 1, g = null, c = null, p = null, o = !1, m = !1;
6
- return typeof a == "string" && (a = T(a)), typeof a == "object" && (s(a.r) && s(a.g) && s(a.b) ? (r = A(a.r, a.g, a.b), o = !0, m = String(a.r).slice(-1) === "%" ? "prgb" : "rgb") : s(a.h) && s(a.s) && s(a.v) ? (g = x(a.s), c = x(a.v), r = y(a.h, g, c), o = !0, m = "hsv") : s(a.h) && s(a.s) && s(a.l) ? (g = x(a.s), p = x(a.l), r = F(a.h, g, p), o = !0, m = "hsl") : s(a.c) && s(a.m) && s(a.y) && s(a.k) && (r = v(a.c, a.m, a.y, a.k), o = !0, m = "cmyk"), Object.prototype.hasOwnProperty.call(a, "a") && (e = a.a)), e = R(e), {
7
- ok: o,
8
- format: a.format || m,
9
- r: Math.min(255, Math.max(r.r, 0)),
10
- g: Math.min(255, Math.max(r.g, 0)),
11
- b: Math.min(255, Math.max(r.b, 0)),
12
- a: e
13
- };
14
- }
15
- const w = "[-\\+]?\\d+%?", k = "[-\\+]?\\d*\\.\\d+%?", f = "(?:" + k + ")|(?:" + w + ")", b = "[\\s|\\(]+(" + f + ")[,|\\s]+(" + f + ")[,|\\s]+(" + f + ")\\s*\\)?", l = (
16
- // eslint-disable-next-line prettier/prettier
17
- "[\\s|\\(]+(" + f + ")[,|\\s]+(" + f + ")[,|\\s]+(" + f + ")[,|\\s]+(" + f + ")\\s*\\)?"
18
- ), h = {
19
- CSS_UNIT: new RegExp(f),
20
- rgb: new RegExp("rgb" + b),
21
- rgba: new RegExp("rgba" + l),
22
- hsl: new RegExp("hsl" + b),
23
- hsla: new RegExp("hsla" + l),
24
- hsv: new RegExp("hsv" + b),
25
- hsva: new RegExp("hsva" + l),
26
- cmyk: new RegExp("cmyk" + l),
27
- hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
28
- hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,
29
- hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
30
- hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/
31
- };
32
- function T(a) {
33
- if (a = a.trim().toLowerCase(), a.length === 0)
34
- return !1;
35
- let r = !1;
36
- if (u[a])
37
- a = u[a], r = !0;
38
- else if (a === "transparent")
39
- return { r: 0, g: 0, b: 0, a: 0, format: "name" };
40
- let e = h.rgb.exec(a);
41
- return e ? { r: e[1], g: e[2], b: e[3] } : (e = h.rgba.exec(a), e ? { r: e[1], g: e[2], b: e[3], a: e[4] } : (e = h.hsl.exec(a), e ? { h: e[1], s: e[2], l: e[3] } : (e = h.hsla.exec(a), e ? { h: e[1], s: e[2], l: e[3], a: e[4] } : (e = h.hsv.exec(a), e ? { h: e[1], s: e[2], v: e[3] } : (e = h.hsva.exec(a), e ? { h: e[1], s: e[2], v: e[3], a: e[4] } : (e = h.cmyk.exec(a), e ? {
42
- c: e[1],
43
- m: e[2],
44
- y: e[3],
45
- k: e[4]
46
- } : (e = h.hex8.exec(a), e ? {
47
- r: n(e[1]),
48
- g: n(e[2]),
49
- b: n(e[3]),
50
- a: i(e[4]),
51
- format: r ? "name" : "hex8"
52
- } : (e = h.hex6.exec(a), e ? {
53
- r: n(e[1]),
54
- g: n(e[2]),
55
- b: n(e[3]),
56
- format: r ? "name" : "hex"
57
- } : (e = h.hex4.exec(a), e ? {
58
- r: n(e[1] + e[1]),
59
- g: n(e[2] + e[2]),
60
- b: n(e[3] + e[3]),
61
- a: i(e[4] + e[4]),
62
- format: r ? "name" : "hex8"
63
- } : (e = h.hex3.exec(a), e ? {
64
- r: n(e[1] + e[1]),
65
- g: n(e[2] + e[2]),
66
- b: n(e[3] + e[3]),
67
- format: r ? "name" : "hex"
68
- } : !1))))))))));
69
- }
70
- function s(a) {
71
- return typeof a == "number" ? !Number.isNaN(a) : h.CSS_UNIT.test(a);
72
- }
73
- export {
74
- M as inputToRGB,
75
- s as isValidCSSUnit,
76
- T as stringInputToObject
77
- };
@@ -1,388 +0,0 @@
1
- import { numberInputToObject as $, rgbToHsv as b, rgbToHsl as l, rgbToHex as c, rgbaToHex as M, rgbToCmyk as m } from "./conversion.js";
2
- import { names as H } from "./css-color-names.js";
3
- import { inputToRGB as f } from "./format-input.js";
4
- import { boundAlpha as p, clamp01 as u, bound01 as d } from "./util.js";
5
- var S = Object.defineProperty, x = (a, t, s) => t in a ? S(a, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : a[t] = s, e = (a, t, s) => x(a, typeof t != "symbol" ? t + "" : t, s);
6
- class i {
7
- constructor(t = "", s = {}) {
8
- if (e(this, "r"), e(this, "g"), e(this, "b"), e(this, "a"), e(this, "format"), e(this, "originalInput"), e(this, "isValid"), e(this, "gradientType"), e(this, "roundA"), t instanceof i)
9
- return t;
10
- typeof t == "number" && (t = $(t)), this.originalInput = t;
11
- const r = f(t);
12
- this.originalInput = t, this.r = r.r, this.g = r.g, this.b = r.b, this.a = r.a, this.roundA = Math.round(100 * this.a) / 100, this.format = s.format ?? r.format, this.gradientType = s.gradientType, this.r < 1 && (this.r = Math.round(this.r)), this.g < 1 && (this.g = Math.round(this.g)), this.b < 1 && (this.b = Math.round(this.b)), this.isValid = r.ok;
13
- }
14
- get ok() {
15
- return this.isValid;
16
- }
17
- isDark() {
18
- return this.getBrightness() < 128;
19
- }
20
- isLight() {
21
- return !this.isDark();
22
- }
23
- /**
24
- * Returns the perceived brightness of the color, from 0-255.
25
- */
26
- getBrightness() {
27
- const t = this.toRgb();
28
- return (t.r * 299 + t.g * 587 + t.b * 114) / 1e3;
29
- }
30
- /**
31
- * Returns the perceived luminance of a color, from 0-1.
32
- */
33
- getLuminance() {
34
- const t = this.toRgb();
35
- let s, r, h;
36
- const n = t.r / 255, o = t.g / 255, g = t.b / 255;
37
- return n <= 0.03928 ? s = n / 12.92 : s = Math.pow((n + 0.055) / 1.055, 2.4), o <= 0.03928 ? r = o / 12.92 : r = Math.pow((o + 0.055) / 1.055, 2.4), g <= 0.03928 ? h = g / 12.92 : h = Math.pow((g + 0.055) / 1.055, 2.4), 0.2126 * s + 0.7152 * r + 0.0722 * h;
38
- }
39
- /**
40
- * Returns the alpha value of a color, from 0-1.
41
- */
42
- getAlpha() {
43
- return this.a;
44
- }
45
- /**
46
- * Sets the alpha value on the current color.
47
- *
48
- * @param alpha - The new alpha value. The accepted range is 0-1.
49
- */
50
- setAlpha(t) {
51
- return this.a = p(t), this.roundA = Math.round(100 * this.a) / 100, this;
52
- }
53
- /**
54
- * Returns whether the color is monochrome.
55
- */
56
- isMonochrome() {
57
- const { s: t } = this.toHsl();
58
- return t === 0;
59
- }
60
- /**
61
- * Returns the object as a HSVA object.
62
- */
63
- toHsv() {
64
- const t = b(this.r, this.g, this.b);
65
- return { h: t.h * 360, s: t.s, v: t.v, a: this.a };
66
- }
67
- toHsv_() {
68
- const t = b(this.r, this.g, this.b);
69
- return { h: t.h, s: t.s, v: t.v, a: this.a };
70
- }
71
- /**
72
- * Returns the hsva values interpolated into a string with the following format:
73
- * "hsva(xxx, xxx, xxx, xx)".
74
- */
75
- toHsvString() {
76
- const t = b(this.r, this.g, this.b), s = Math.round(t.h * 360), r = Math.round(t.s * 100), h = Math.round(t.v * 100);
77
- return this.a === 1 ? `hsv(${s}, ${r}%, ${h}%)` : `hsva(${s}, ${r}%, ${h}%, ${this.roundA})`;
78
- }
79
- /**
80
- * Returns the object as a HSLA object.
81
- */
82
- toHsl() {
83
- const t = l(this.r, this.g, this.b);
84
- return { h: t.h * 360, s: t.s, l: t.l, a: this.a };
85
- }
86
- /**
87
- * Returns the hsla values interpolated into a string with the following format:
88
- * "hsla(xxx, xxx, xxx, xx)".
89
- */
90
- toHslString() {
91
- const t = l(this.r, this.g, this.b), s = Math.round(t.h * 360), r = Math.round(t.s * 100), h = Math.round(t.l * 100);
92
- return this.a === 1 ? `hsl(${s}, ${r}%, ${h}%)` : `hsla(${s}, ${r}%, ${h}%, ${this.roundA})`;
93
- }
94
- /**
95
- * Returns the hex value of the color.
96
- * @param allow3Char will shorten hex value to 3 char if possible
97
- */
98
- toHex(t = !1) {
99
- return c(this.r, this.g, this.b, t);
100
- }
101
- /**
102
- * Returns the hex value of the color -with a # prefixed.
103
- * @param allow3Char will shorten hex value to 3 char if possible
104
- */
105
- toHexString(t = !1) {
106
- return `#${this.toHex(t)}`;
107
- }
108
- /**
109
- * Returns the hex 8 value of the color.
110
- * @param allow4Char will shorten hex value to 4 char if possible
111
- */
112
- toHex8(t = !1) {
113
- return M(this.r, this.g, this.b, this.a, t);
114
- }
115
- /**
116
- * Returns the hex 8 value of the color -with a # prefixed.
117
- * @param allow4Char will shorten hex value to 4 char if possible
118
- */
119
- toHex8String(t = !1) {
120
- return `#${this.toHex8(t)}`;
121
- }
122
- /**
123
- * Returns the shorter hex value of the color depends on its alpha -with a # prefixed.
124
- * @param allowShortChar will shorten hex value to 3 or 4 char if possible
125
- */
126
- toHexShortString(t = !1) {
127
- return this.a === 1 ? this.toHexString(t) : this.toHex8String(t);
128
- }
129
- /**
130
- * Returns the object as a RGBA object.
131
- */
132
- toRgb() {
133
- return {
134
- r: Math.round(this.r),
135
- g: Math.round(this.g),
136
- b: Math.round(this.b),
137
- a: this.a
138
- };
139
- }
140
- toRgba() {
141
- return this.toRgb();
142
- }
143
- toRgbArray() {
144
- const t = this.toRgb();
145
- return [t.r, t.g, t.b];
146
- }
147
- toRgbArrayString() {
148
- const t = this.toRgb();
149
- return `${t.r},${t.g},${t.b}`;
150
- }
151
- /**
152
- * Returns the RGBA values interpolated into a string with the following format:
153
- * "RGBA(xxx, xxx, xxx, xx)".
154
- */
155
- toRgbString() {
156
- const t = Math.round(this.r), s = Math.round(this.g), r = Math.round(this.b);
157
- return this.a === 1 ? `rgb(${t}, ${s}, ${r})` : `rgba(${t}, ${s}, ${r}, ${this.roundA})`;
158
- }
159
- toRgbaString() {
160
- const t = Math.round(this.r), s = Math.round(this.g), r = Math.round(this.b);
161
- return `rgba(${t}, ${s}, ${r}, ${this.roundA})`;
162
- }
163
- /**
164
- * Returns the object as a RGBA object.
165
- */
166
- toPercentageRgb() {
167
- const t = (s) => `${Math.round(d(s, 255) * 100)}%`;
168
- return {
169
- r: t(this.r),
170
- g: t(this.g),
171
- b: t(this.b),
172
- a: this.a
173
- };
174
- }
175
- /**
176
- * Returns the RGBA relative values interpolated into a string
177
- */
178
- toPercentageRgbString() {
179
- const t = (s) => Math.round(d(s, 255) * 100);
180
- return this.a === 1 ? `rgb(${t(this.r)}%, ${t(this.g)}%, ${t(this.b)}%)` : `rgba(${t(this.r)}%, ${t(this.g)}%, ${t(this.b)}%, ${this.roundA})`;
181
- }
182
- toCmyk() {
183
- return {
184
- ...m(this.r, this.g, this.b)
185
- };
186
- }
187
- toCmykString() {
188
- const { c: t, m: s, y: r, k: h } = m(this.r, this.g, this.b);
189
- return `cmyk(${t}, ${s}, ${r}, ${h})`;
190
- }
191
- /**
192
- * The 'real' name of the color -if there is one.
193
- */
194
- toName() {
195
- if (this.a === 0)
196
- return "transparent";
197
- if (this.a < 1)
198
- return !1;
199
- const t = `#${c(this.r, this.g, this.b, !1)}`;
200
- for (const [s, r] of Object.entries(H))
201
- if (t === r)
202
- return s;
203
- return !1;
204
- }
205
- toString(t) {
206
- const s = !!t;
207
- t = t ?? this.format;
208
- let r = !1;
209
- const h = this.a < 1 && this.a >= 0;
210
- return !s && h && (t.startsWith("hex") || t === "name") ? t === "name" && this.a === 0 ? this.toName() : this.toRgbString() : (t === "rgb" && (r = this.toRgbString()), t === "prgb" && (r = this.toPercentageRgbString()), (t === "hex" || t === "hex6") && (r = this.toHexString()), t === "hex3" && (r = this.toHexString(!0)), t === "hex4" && (r = this.toHex8String(!0)), t === "hex8" && (r = this.toHex8String()), t === "name" && (r = this.toName()), t === "hsl" && (r = this.toHslString()), t === "hsv" && (r = this.toHsvString()), t === "cmyk" && (r = this.toCmykString()), r || this.toHexString());
211
- }
212
- toNumber() {
213
- return (Math.round(this.r) << 16) + (Math.round(this.g) << 8) + Math.round(this.b);
214
- }
215
- clone() {
216
- return new i(this.toString());
217
- }
218
- /**
219
- * Lighten the color a given amount. Providing 100 will always return white.
220
- * @param amount - valid between 1-100
221
- */
222
- lighten(t = 10) {
223
- const s = this.toHsl();
224
- return s.l += t / 100, s.l = u(s.l), new i(s);
225
- }
226
- /**
227
- * Brighten the color a given amount, from 0 to 100.
228
- * @param amount - valid between 1-100
229
- */
230
- brighten(t = 10) {
231
- const s = this.toRgb();
232
- return s.r = Math.max(
233
- 0,
234
- Math.min(255, s.r - Math.round(255 * -(t / 100)))
235
- ), s.g = Math.max(
236
- 0,
237
- Math.min(255, s.g - Math.round(255 * -(t / 100)))
238
- ), s.b = Math.max(
239
- 0,
240
- Math.min(255, s.b - Math.round(255 * -(t / 100)))
241
- ), new i(s);
242
- }
243
- /**
244
- * Darken the color a given amount, from 0 to 100.
245
- * Providing 100 will always return black.
246
- * @param amount - valid between 1-100
247
- */
248
- darken(t = 10) {
249
- const s = this.toHsl();
250
- return s.l -= t / 100, s.l = u(s.l), new i(s);
251
- }
252
- /**
253
- * Mix the color with pure white, from 0 to 100.
254
- * Providing 0 will do nothing, providing 100 will always return white.
255
- * @param amount - valid between 1-100
256
- */
257
- tint(t = 10) {
258
- return this.mix("white", t);
259
- }
260
- /**
261
- * Mix the color with pure black, from 0 to 100.
262
- * Providing 0 will do nothing, providing 100 will always return black.
263
- * @param amount - valid between 1-100
264
- */
265
- shade(t = 10) {
266
- return this.mix("black", t);
267
- }
268
- /**
269
- * Desaturate the color a given amount, from 0 to 100.
270
- * Providing 100 will is the same as calling greyscale
271
- * @param amount - valid between 1-100
272
- */
273
- desaturate(t = 10) {
274
- const s = this.toHsl();
275
- return s.s -= t / 100, s.s = u(s.s), new i(s);
276
- }
277
- /**
278
- * Saturate the color a given amount, from 0 to 100.
279
- * @param amount - valid between 1-100
280
- */
281
- saturate(t = 10) {
282
- const s = this.toHsl();
283
- return s.s += t / 100, s.s = u(s.s), new i(s);
284
- }
285
- /**
286
- * Completely desaturates a color into greyscale.
287
- * Same as calling `desaturate(100)`
288
- */
289
- greyscale() {
290
- return this.desaturate(100);
291
- }
292
- /**
293
- * Spin takes a positive or negative amount within [-360, 360] indicating the change of hue.
294
- * Values outside of this range will be wrapped into this range.
295
- */
296
- spin(t) {
297
- const s = this.toHsl(), r = (s.h + t) % 360;
298
- return s.h = r < 0 ? 360 + r : r, new i(s);
299
- }
300
- /**
301
- * Mix the current color a given amount with another color, from 0 to 100.
302
- * 0 means no mixing (return current color).
303
- */
304
- mix(t, s = 50) {
305
- const r = this.toRgb(), h = new i(t).toRgb(), n = s / 100, o = {
306
- r: (h.r - r.r) * n + r.r,
307
- g: (h.g - r.g) * n + r.g,
308
- b: (h.b - r.b) * n + r.b,
309
- a: (h.a - r.a) * n + r.a
310
- };
311
- return new i(o);
312
- }
313
- analogous(t = 6, s = 30) {
314
- const r = this.toHsl(), h = 360 / s, n = [this];
315
- for (r.h = (r.h - (h * t >> 1) + 720) % 360; --t; )
316
- r.h = (r.h + h) % 360, n.push(new i(r));
317
- return n;
318
- }
319
- /**
320
- * taken from https://github.com/infusion/jQuery-xcolor/blob/master/jquery.xcolor.js
321
- */
322
- complement() {
323
- const t = this.toHsl();
324
- return t.h = (t.h + 180) % 360, new i(t);
325
- }
326
- monochromatic(t = 6) {
327
- const s = this.toHsv(), { h: r } = s, { s: h } = s;
328
- let { v: n } = s;
329
- const o = [], g = 1 / t;
330
- for (; t--; )
331
- o.push(new i({ h: r, s: h, v: n })), n = (n + g) % 1;
332
- return o;
333
- }
334
- splitcomplement() {
335
- const t = this.toHsl(), { h: s } = t;
336
- return [
337
- this,
338
- new i({ h: (s + 72) % 360, s: t.s, l: t.l }),
339
- new i({ h: (s + 216) % 360, s: t.s, l: t.l })
340
- ];
341
- }
342
- /**
343
- * Compute how the color would appear on a background
344
- */
345
- onBackground(t) {
346
- const s = this.toRgb(), r = new i(t).toRgb(), h = s.a + r.a * (1 - s.a);
347
- return new i({
348
- r: (s.r * s.a + r.r * r.a * (1 - s.a)) / h,
349
- g: (s.g * s.a + r.g * r.a * (1 - s.a)) / h,
350
- b: (s.b * s.a + r.b * r.a * (1 - s.a)) / h,
351
- a: h
352
- });
353
- }
354
- /**
355
- * Alias for `polyad(3)`
356
- */
357
- triad() {
358
- return this.polyad(3);
359
- }
360
- /**
361
- * Alias for `polyad(4)`
362
- */
363
- tetrad() {
364
- return this.polyad(4);
365
- }
366
- /**
367
- * Get polyad colors, like (for 1, 2, 3, 4, 5, 6, 7, 8, etc...)
368
- * monad, dyad, triad, tetrad, pentad, hexad, heptad, octad, etc...
369
- */
370
- polyad(t) {
371
- const s = this.toHsl(), { h: r } = s, h = [this], n = 360 / t;
372
- for (let o = 1; o < t; o++)
373
- h.push(
374
- new i({ h: (r + o * n) % 360, s: s.s, l: s.l })
375
- );
376
- return h;
377
- }
378
- /**
379
- * compare color vs current color
380
- */
381
- equals(t) {
382
- const s = new i(t);
383
- return this.format === "cmyk" || s.format === "cmyk" ? this.toCmykString() === s.toCmykString() : this.toRgbString() === s.toRgbString();
384
- }
385
- }
386
- export {
387
- i as TinyColor
388
- };
@@ -1,32 +0,0 @@
1
- function i(n, a) {
2
- o(n) && (n = "100%");
3
- const e = r(n);
4
- return n = a === 360 ? n : Math.min(a, Math.max(0, parseFloat(n))), e && (n = parseInt(String(n * a), 10) / 100), Math.abs(n - a) < 1e-6 ? 1 : (a === 360 ? n = (n < 0 ? n % a + a : n % a) / parseFloat(String(a)) : n = n % a / parseFloat(String(a)), n);
5
- }
6
- function s(n) {
7
- return Math.min(1, Math.max(0, n));
8
- }
9
- function o(n) {
10
- return typeof n == "string" && n.indexOf(".") !== -1 && parseFloat(n) === 1;
11
- }
12
- function r(n) {
13
- return typeof n == "string" && n.indexOf("%") !== -1;
14
- }
15
- function u(n) {
16
- return n = parseFloat(n), (isNaN(n) || n < 0 || n > 1) && (n = 1), n;
17
- }
18
- function p(n) {
19
- return Number(n) <= 1 ? `${Number(n) * 100}%` : n;
20
- }
21
- function c(n) {
22
- return n.length === 1 ? "0" + n : String(n);
23
- }
24
- export {
25
- i as bound01,
26
- u as boundAlpha,
27
- s as clamp01,
28
- p as convertToPercentage,
29
- o as isOnePointZero,
30
- r as isPercentage,
31
- c as pad2
32
- };
package/flex/utils.js DELETED
@@ -1,13 +0,0 @@
1
- import s from "@unicom-cloud/utils/class-name";
2
- import { alignItemsValues as u, justifyContentValues as c, flexWrapValues as m } from "./interface.js";
3
- function g(t, i) {
4
- const n = i.wrap === !0 ? "wrap" : i.wrap, a = n && m.includes(n) ? `${t}-wrap-${n}` : void 0, e = i.align && u.includes(i.align) ? `${t}-align-${i.align}` : !i.align && i.vertical ? `${t}-align-stretch` : void 0, l = i.justify && c.includes(i.justify) ? `${t}-justify-${i.justify}` : void 0;
5
- return s(a, e, l);
6
- }
7
- function d(t) {
8
- return typeof t == "string" && ["mini", "small", "medium", "large"].includes(t);
9
- }
10
- export {
11
- g as createFlexClassNames,
12
- d as isPresetSize
13
- };
@@ -1,4 +0,0 @@
1
- const s = {};
2
- export {
3
- s as default
4
- };
@@ -1,3 +0,0 @@
1
- import { ReactElement } from 'react';
2
- declare function toArray(children: ReactElement): unknown[];
3
- export default toArray;
@@ -1,3 +0,0 @@
1
- export { convertToDurationBasedOnTimeUnits };
2
- export default convertToDurationBasedOnTimeUnits;
3
- import { convertToDurationBasedOnTimeUnits } from '@unicom-cloud/utils/dayjs';
@@ -1,4 +0,0 @@
1
- import { Options } from '@unicom-cloud/scroll-into-view-if-needed';
2
- declare function scrollIntoView(node: HTMLElement, options?: Options): void;
3
- export { scrollIntoView, scrollIntoView as scrollIntoViewIfNeeded };
4
- export default scrollIntoView;
@@ -1 +0,0 @@
1
- export { cmykToRgb, names as colorNames, compareColorByRange, convertDecimalToHex, convertHexToDecimal, default, hslToRgb, hsvToRgb, inputToRGB, isValidCSSUnit, numberInputToObject, parseIntFromHex, rgbaToArgbHex, rgbaToHex, rgbToCmyk, rgbToHex, rgbToHsl, rgbToHsv, rgbToRgb, stringInputToObject, default as TinyColor, } from '@unicom-cloud/tinycolor';
@@ -1,9 +0,0 @@
1
- import { type FlexProps, type SizeType } from './interface';
2
- /**
3
- * 生成Flex组件的类名
4
- */
5
- export declare function createFlexClassNames(prefixCls: string | undefined, props: FlexProps): string;
6
- /**
7
- * 检查是否是预设的gap尺寸
8
- */
9
- export declare function isPresetSize(gap?: FlexProps['gap']): gap is SizeType;
@@ -1 +0,0 @@
1
- import './index.less';
@@ -1 +0,0 @@
1
- export { uiColor as color } from '@unicom-cloud/tinycolor';
@@ -1 +0,0 @@
1
- export { compute, default as computeScrollIntoView, default, } from '@unicom-cloud/compute-scroll-into-view';
@@ -1,3 +0,0 @@
1
- export { convertToDurationBasedOnTimeUnits };
2
- export default convertToDurationBasedOnTimeUnits;
3
- import convertToDurationBasedOnTimeUnits from '../../common/utils/convertToDurationBasedOnTimeUnits';
@@ -1,3 +0,0 @@
1
- import scrollIntoView from '../../common/utils/scrollIntoView';
2
- export { scrollIntoView, scrollIntoView as scrollIntoViewIfNeeded };
3
- export default scrollIntoView;
@@ -1 +0,0 @@
1
- export { cmykToRgb, names as colorNames, compareColorByRange, convertDecimalToHex, convertHexToDecimal, default, hslToRgb, hsvToRgb, inputToRGB, isValidCSSUnit, numberInputToObject, parseIntFromHex, rgbaToArgbHex, rgbaToHex, rgbToCmyk, rgbToHex, rgbToHsl, rgbToHsv, rgbToRgb, stringInputToObject, default as TinyColor, } from '@unicom-cloud/tinycolor';
package/utils/color.js DELETED
@@ -1,4 +0,0 @@
1
- import { a } from "../dist/tinycolor/chunk/BOzCVdr0.js";
2
- export {
3
- a as color
4
- };
@@ -1,6 +0,0 @@
1
- import { compute as t, compute as c, compute as m } from "../dist/compute-scroll-into-view/src/index.js";
2
- export {
3
- t as compute,
4
- c as computeScrollIntoView,
5
- m as default
6
- };
@@ -1,6 +0,0 @@
1
- import "@unicom-cloud/utils/dayjs";
2
- import { convertToDurationBasedOnTimeUnits as i, convertToDurationBasedOnTimeUnits as r } from "@unicom-cloud/utils/dayjs";
3
- export {
4
- i as convertToDurationBasedOnTimeUnits,
5
- r as default
6
- };
@@ -1,6 +0,0 @@
1
- import { scrollIntoView as o } from "../components/common/utils/scrollIntoView.js";
2
- export {
3
- o as default,
4
- o as scrollIntoView,
5
- o as scrollIntoViewIfNeeded
6
- };
@@ -1,29 +0,0 @@
1
- import { cmykToRgb as t, convertDecimalToHex as T, convertHexToDecimal as b, hslToRgb as m, hsvToRgb as g, numberInputToObject as a, parseIntFromHex as n, rgbToCmyk as p, rgbToHex as s, rgbToHsl as x, rgbToHsv as i, rgbToRgb as l, rgbaToArgbHex as c, rgbaToHex as H } from "../dist/tinycolor/src/conversion.js";
2
- import { names as R } from "../dist/tinycolor/src/css-color-names.js";
3
- import { inputToRGB as y, isValidCSSUnit as C, stringInputToObject as v } from "../dist/tinycolor/src/format-input.js";
4
- import { compareColorByRange as d } from "../dist/tinycolor/customize/index.js";
5
- import { TinyColor as j, TinyColor as k } from "../dist/tinycolor/src/index.js";
6
- import "../dist/tinycolor/chunk/BOzCVdr0.js";
7
- export {
8
- j as TinyColor,
9
- t as cmykToRgb,
10
- R as colorNames,
11
- d as compareColorByRange,
12
- T as convertDecimalToHex,
13
- b as convertHexToDecimal,
14
- k as default,
15
- m as hslToRgb,
16
- g as hsvToRgb,
17
- y as inputToRGB,
18
- C as isValidCSSUnit,
19
- a as numberInputToObject,
20
- n as parseIntFromHex,
21
- p as rgbToCmyk,
22
- s as rgbToHex,
23
- x as rgbToHsl,
24
- i as rgbToHsv,
25
- l as rgbToRgb,
26
- c as rgbaToArgbHex,
27
- H as rgbaToHex,
28
- v as stringInputToObject
29
- };