@unicom-cloud/ui 0.8.99 → 0.8.100

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 (136) hide show
  1. package/Anchor.js +3 -1
  2. package/Badge.js +7 -6
  3. package/Copy.js +49 -2
  4. package/Flex.js +12 -0
  5. package/Grid.js +1 -1
  6. package/LiquidFill.js +3 -2
  7. package/Marquee.js +3 -2
  8. package/QrCode.js +3 -2
  9. package/Splitter.js +4 -5
  10. package/Tag.js +3 -2
  11. package/Tour.js +3 -2
  12. package/alert/index.js +38 -39
  13. package/anchor/index.js +5 -3
  14. package/badge/index.js +19 -18
  15. package/copy/index.js +83 -35
  16. package/flex/index.js +59 -0
  17. package/flex/interface.js +34 -0
  18. package/flex/utils.js +13 -0
  19. package/grid/{GridItem.js → Item.js} +15 -15
  20. package/grid/index.js +1 -1
  21. package/index.js +503 -493
  22. package/input/Button.js +39 -34
  23. package/input/Textarea.js +108 -104
  24. package/liquid-fill/index.js +3 -2
  25. package/marquee/index.js +3 -2
  26. package/package.json +1 -1
  27. package/qr-code/index.js +3 -2
  28. package/segmented/index.js +112 -104
  29. package/spin/index.js +75 -62
  30. package/splitter/Panel.js +39 -0
  31. package/splitter/SplitBar.js +157 -0
  32. package/splitter/Splitter.js +139 -0
  33. package/splitter/hooks/useEvent.js +12 -0
  34. package/splitter/hooks/useItems.js +26 -0
  35. package/splitter/hooks/useResizable.js +26 -0
  36. package/splitter/hooks/useResize.js +68 -0
  37. package/splitter/hooks/useSizes.js +60 -0
  38. package/splitter/index.js +5 -115
  39. package/style.css +1 -1
  40. package/table/Table.js +1 -1
  41. package/table/hook/useThResizable.js +72 -26
  42. package/table/tbody/Td.js +80 -77
  43. package/table/th-resizable/index.js +92 -35
  44. package/tag/index.js +42 -41
  45. package/tooltip/index.js +89 -82
  46. package/tour/index.js +5 -6
  47. package/types/common/space/index.d.ts +2 -1
  48. package/types/pc/affix/interface.d.ts +0 -2
  49. package/types/pc/alert/index.d.ts +2 -2
  50. package/types/pc/anchor/index.d.ts +2 -1
  51. package/types/pc/anchor/interface.d.ts +0 -2
  52. package/types/pc/auto-complete/interface.d.ts +0 -6
  53. package/types/pc/avatar/interface.d.ts +0 -4
  54. package/types/pc/breadcrumb/interface.d.ts +0 -3
  55. package/types/pc/carousel/interface.d.ts +2 -6
  56. package/types/pc/cascader/interface.d.ts +6 -18
  57. package/types/pc/checkbox/interface.d.ts +0 -1
  58. package/types/pc/collapse/interface.d.ts +0 -2
  59. package/types/pc/color-picker/interface.d.ts +0 -2
  60. package/types/pc/config-provider/interface.d.ts +13 -17
  61. package/types/pc/copy/interface.d.ts +2 -1
  62. package/types/pc/date-picker/interface.d.ts +0 -17
  63. package/types/pc/descriptions/interface.d.ts +0 -1
  64. package/types/pc/drawer/interface.d.ts +0 -7
  65. package/types/pc/dropdown/interface.d.ts +0 -1
  66. package/types/pc/flex/index.d.ts +9 -0
  67. package/types/pc/flex/interface.d.ts +61 -0
  68. package/types/pc/flex/utils.d.ts +9 -0
  69. package/types/pc/form/interface.d.ts +9 -22
  70. package/types/pc/form/util.d.ts +1 -1
  71. package/types/pc/grid/index.d.ts +3 -3
  72. package/types/pc/grid/interface.d.ts +1 -6
  73. package/types/pc/image/interface.d.ts +0 -13
  74. package/types/pc/index.d.ts +6 -2
  75. package/types/pc/input/Textarea.d.ts +2 -6
  76. package/types/pc/input/interface.d.ts +5 -13
  77. package/types/pc/input-number/interface.d.ts +0 -4
  78. package/types/pc/input-tag/interface.d.ts +0 -13
  79. package/types/pc/layout/interface.d.ts +0 -1
  80. package/types/pc/link/interface.d.ts +0 -1
  81. package/types/pc/list/interface.d.ts +0 -4
  82. package/types/pc/menu/interface.d.ts +0 -8
  83. package/types/pc/message/interface.d.ts +0 -2
  84. package/types/pc/modal/interface.d.ts +0 -5
  85. package/types/pc/notification/interface.d.ts +0 -1
  86. package/types/pc/pagination/interface.d.ts +0 -2
  87. package/types/pc/popconfirm/interface.d.ts +8 -10
  88. package/types/pc/popover/interface.d.ts +0 -1
  89. package/types/pc/progress/interface.d.ts +0 -3
  90. package/types/pc/resize-box/interface.d.ts +1 -7
  91. package/types/pc/select/interface.d.ts +0 -12
  92. package/types/pc/select-view/interface.d.ts +0 -7
  93. package/types/pc/slider/interface.d.ts +0 -4
  94. package/types/pc/space/index.d.ts +1 -0
  95. package/types/pc/spin/interface.d.ts +4 -1
  96. package/types/pc/splitter/Panel.d.ts +8 -0
  97. package/types/pc/splitter/SplitBar.d.ts +21 -0
  98. package/types/pc/splitter/Splitter.d.ts +4 -0
  99. package/types/pc/splitter/hooks/useEvent.d.ts +3 -0
  100. package/types/pc/splitter/hooks/useItems.d.ts +10 -0
  101. package/types/pc/splitter/hooks/useResizable.d.ts +8 -0
  102. package/types/pc/splitter/hooks/useResize.d.ts +4 -0
  103. package/types/pc/splitter/hooks/useSizes.d.ts +5 -0
  104. package/types/pc/splitter/index.d.ts +8 -4
  105. package/types/pc/splitter/interface.d.ts +181 -38
  106. package/types/pc/statistic/interface.d.ts +0 -4
  107. package/types/pc/steps/interface.d.ts +0 -3
  108. package/types/pc/table/hook/useThResizable.d.ts +2 -2
  109. package/types/pc/table/interface.d.ts +4 -15
  110. package/types/pc/tabs/interface.d.ts +0 -7
  111. package/types/pc/tag/index.d.ts +2 -0
  112. package/types/pc/tag/interface.d.ts +0 -1
  113. package/types/pc/time-picker/interface.d.ts +0 -7
  114. package/types/pc/tooltip/interface.d.ts +4 -1
  115. package/types/pc/transfer/interface.d.ts +2 -9
  116. package/types/pc/tree/interface.d.ts +2 -8
  117. package/types/pc/tree-select/interface.d.ts +0 -8
  118. package/types/pc/trigger/interface.d.ts +0 -5
  119. package/types/pc/typography/EditContent.d.ts +2 -1
  120. package/types/pc/typography/interface.d.ts +45 -30
  121. package/types/pc/upload/interface.d.ts +6 -11
  122. package/types/pc/utils/index.d.ts +1 -0
  123. package/types/pc/utils/names.d.ts +6 -0
  124. package/types/pc/utils/toArray.d.ts +7 -0
  125. package/types/pc/verification-code/interface.d.ts +0 -2
  126. package/types/pc/watermark/interface.d.ts +0 -2
  127. package/typography/Base.js +73 -73
  128. package/typography/EditContent.js +43 -33
  129. package/typography/Ellipsis.js +117 -184
  130. package/typography/Operations.js +97 -49
  131. package/typography/useCssEllipsis.js +7 -6
  132. package/utils/index.js +117 -115
  133. package/utils/names.js +4 -0
  134. package/utils/toArray.js +12 -0
  135. package/version/index.js +1 -1
  136. /package/types/pc/grid/{GridItem.d.ts → Item.d.ts} +0 -0
package/flex/index.js ADDED
@@ -0,0 +1,59 @@
1
+ import { jsx as c } from "react/jsx-runtime";
2
+ import V, { forwardRef as n } from "react";
3
+ import "../config-provider/ConfigProvider.js";
4
+ import h from "../components/common/hooks/useMergeProps.js";
5
+ import w from "@unicom-cloud/utils/class-name";
6
+ import { isPresetSize as i, createFlexClassNames as z } from "./utils.js";
7
+ import R from "../config-provider/context.js";
8
+ const S = {
9
+ component: "div",
10
+ vertical: !1
11
+ };
12
+ function j(r, o) {
13
+ const { getPrefixCls: p, rtl: f, componentConfig: x } = V.useContext(R), l = h(
14
+ r,
15
+ S,
16
+ x?.Flex
17
+ ), {
18
+ prefixCls: C,
19
+ rootClassName: d,
20
+ className: u,
21
+ style: g,
22
+ flex: a,
23
+ gap: e,
24
+ children: N,
25
+ vertical: v,
26
+ component: F = "div",
27
+ wrap: b,
28
+ ...P
29
+ } = l, t = p?.("flex", C), y = w(
30
+ t,
31
+ u,
32
+ d,
33
+ {
34
+ [`${t}-rtl`]: f,
35
+ [`${t}-gap-${e}`]: i(e),
36
+ [`${t}-vertical`]: v
37
+ },
38
+ z(t, l)
39
+ ), $ = {
40
+ ...g,
41
+ ...a ? { flex: a } : {},
42
+ ...e && !i(e) ? { gap: e } : {}
43
+ };
44
+ return /* @__PURE__ */ c(F, { ref: o, className: y, style: $, ...P, children: N });
45
+ }
46
+ const s = n(
47
+ j
48
+ );
49
+ s.displayName = "Flex";
50
+ function M(r, o) {
51
+ return /* @__PURE__ */ c(s, { ref: o, ...r, vertical: !0, children: r.children });
52
+ }
53
+ const m = n(M);
54
+ m.displayName = "FlexVertical";
55
+ s.Vertical = m;
56
+ export {
57
+ m as FlexVertical,
58
+ s as default
59
+ };
@@ -0,0 +1,34 @@
1
+ const e = [
2
+ "wrap",
3
+ "nowrap",
4
+ "wrap-reverse"
5
+ ], t = [
6
+ "flex-start",
7
+ "flex-end",
8
+ "start",
9
+ "end",
10
+ "center",
11
+ "space-between",
12
+ "space-around",
13
+ "space-evenly",
14
+ "stretch",
15
+ "normal",
16
+ "left",
17
+ "right"
18
+ ], s = [
19
+ "center",
20
+ "start",
21
+ "end",
22
+ "flex-start",
23
+ "flex-end",
24
+ "self-start",
25
+ "self-end",
26
+ "baseline",
27
+ "normal",
28
+ "stretch"
29
+ ];
30
+ export {
31
+ s as alignItemsValues,
32
+ e as flexWrapValues,
33
+ t as justifyContentValues
34
+ };
package/flex/utils.js ADDED
@@ -0,0 +1,13 @@
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
+ };
@@ -15,27 +15,27 @@ const U = {
15
15
  span: 1
16
16
  };
17
17
  function W($, g) {
18
- const { getPrefixCls: G, componentConfig: _, rtl: y } = p(K), i = q(
18
+ const { getPrefixCls: _, componentConfig: y, rtl: S } = p(K), a = q(
19
19
  $,
20
20
  U,
21
- _?.["Grid.GridItem"]
21
+ y?.["Grid.Item"]
22
22
  ), {
23
- children: a,
24
- className: S,
23
+ children: i,
24
+ className: G,
25
25
  style: v,
26
26
  offset: N,
27
27
  span: D,
28
28
  __index__: s
29
- } = i, r = p(A), { collectItemData: R, removeItemData: E } = p(
29
+ } = a, n = p(A), { collectItemData: R, removeItemData: E } = p(
30
30
  H
31
- ), { colGap: f, cols: l, displayIndexList: P, overflow: u } = r, d = C(N, 0), n = C(D, 1), x = G?.("grid-item"), w = P?.includes(s), M = {
31
+ ), { colGap: f, cols: l, displayIndexList: P, overflow: u } = n, d = C(N, 0), r = C(D, 1), x = _?.("grid-item"), w = P?.includes(s), M = {
32
32
  [`${x}`]: !0,
33
- [`${x}-rtl`]: y
34
- }, b = z(M, S), e = c(() => J(r.cols, {
35
- suffix: !!i.suffix,
36
- span: n,
33
+ [`${x}-rtl`]: S
34
+ }, b = z(M, G), e = c(() => J(n.cols, {
35
+ suffix: !!a.suffix,
36
+ span: r,
37
37
  offset: d
38
- }), [r.cols, i.suffix, n, d]);
38
+ }), [n.cols, a.suffix, r, d]);
39
39
  k(() => (R(s, e), () => {
40
40
  E(s);
41
41
  }), [s, e]);
@@ -47,8 +47,8 @@ function W($, g) {
47
47
  }, [e, f]), L = c(() => {
48
48
  const { suffix: t, span: o } = e;
49
49
  return t ? `${l - o + 1}` : `span ${o}`;
50
- }, [e, l]), j = !w || n === 0 ? { display: "none" } : {}, B = {
51
- gridColumn: `${L} / span ${n}`,
50
+ }, [e, l]), j = !w || r === 0 ? { display: "none" } : {}, B = {
51
+ gridColumn: `${L} / span ${r}`,
52
52
  ...F,
53
53
  ...j
54
54
  };
@@ -61,7 +61,7 @@ function W($, g) {
61
61
  ...B,
62
62
  ...v
63
63
  },
64
- children: Q(a) ? a({ overflow: u }) : m.Children.map(a, (t) => t && r.collapsed && m.isValidElement(t) && !T(t.type) ? m.cloneElement(t, {
64
+ children: Q(i) ? i({ overflow: u }) : m.Children.map(i, (t) => t && n.collapsed && m.isValidElement(t) && !T(t.type) ? m.cloneElement(t, {
65
65
  overflow: u,
66
66
  ...t.props
67
67
  }) : t)
@@ -69,7 +69,7 @@ function W($, g) {
69
69
  );
70
70
  }
71
71
  const X = V(W), I = X;
72
- I.displayName = "GridItem";
72
+ I.displayName = "Grid.Item";
73
73
  I.__PQB_GRID_ITEM__ = !0;
74
74
  export {
75
75
  I as default
package/grid/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import m from "./Col.js";
2
2
  import r from "./Grid.js";
3
- import t from "./GridItem.js";
3
+ import t from "./Item.js";
4
4
  import i from "./Row.js";
5
5
  const o = r;
6
6
  o.Col = m;