@unicom-cloud/ui 0.8.98 → 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 (180) hide show
  1. package/Anchor.js +3 -1
  2. package/Badge.js +54 -7
  3. package/Copy.js +49 -2
  4. package/Flex.js +12 -0
  5. package/Grid.js +1 -1
  6. package/LiquidFill.js +60 -2
  7. package/Marquee.js +62 -0
  8. package/QrCode.js +14 -9
  9. package/Segmented.js +11 -0
  10. package/Space.js +14 -6
  11. package/Splitter.js +6 -0
  12. package/Tag.js +3 -2
  13. package/Tour.js +14 -9
  14. package/alert/index.js +38 -39
  15. package/anchor/index.js +5 -3
  16. package/badge/index.js +174 -80
  17. package/collapse/Collapse.js +54 -48
  18. package/components/common/space/index.js +90 -106
  19. package/copy/index.js +83 -35
  20. package/flex/index.js +59 -0
  21. package/flex/interface.js +34 -0
  22. package/flex/utils.js +13 -0
  23. package/grid/{GridItem.js → Item.js} +15 -15
  24. package/grid/index.js +1 -1
  25. package/index.js +490 -477
  26. package/input/Button.js +39 -34
  27. package/input/Textarea.js +108 -104
  28. package/liquid-fill/index.js +256 -2
  29. package/marquee/index.js +283 -0
  30. package/menu/Item.js +17 -16
  31. package/package.json +1 -1
  32. package/qr-code/index.js +54 -36
  33. package/rate/index.js +8 -8
  34. package/segmented/index.js +225 -0
  35. package/space/index.js +28 -29
  36. package/spin/index.js +75 -62
  37. package/splitter/Panel.js +39 -0
  38. package/splitter/SplitBar.js +157 -0
  39. package/splitter/Splitter.js +139 -0
  40. package/splitter/hooks/useEvent.js +12 -0
  41. package/splitter/hooks/useItems.js +26 -0
  42. package/splitter/hooks/useResizable.js +26 -0
  43. package/splitter/hooks/useResize.js +68 -0
  44. package/splitter/hooks/useSizes.js +60 -0
  45. package/splitter/index.js +7 -0
  46. package/splitter/interface.js +1 -0
  47. package/style.css +1 -1
  48. package/table/Table.js +1 -1
  49. package/table/hook/useThResizable.js +72 -26
  50. package/table/tbody/Td.js +80 -77
  51. package/table/th-resizable/index.js +92 -35
  52. package/tag/index.js +42 -41
  53. package/tooltip/index.js +89 -82
  54. package/tour/index.js +110 -89
  55. package/types/common/hooks/useMergeProps.d.ts +1 -1
  56. package/types/common/space/index.d.ts +7 -5
  57. package/types/common/space/interface.d.ts +29 -16
  58. package/types/pc/affix/interface.d.ts +0 -2
  59. package/types/pc/alert/index.d.ts +2 -2
  60. package/types/pc/anchor/index.d.ts +2 -1
  61. package/types/pc/anchor/interface.d.ts +0 -2
  62. package/types/pc/auto-complete/interface.d.ts +0 -6
  63. package/types/pc/avatar/interface.d.ts +0 -4
  64. package/types/pc/badge/index.d.ts +4 -4
  65. package/types/pc/badge/interface.d.ts +26 -0
  66. package/types/pc/breadcrumb/interface.d.ts +0 -3
  67. package/types/pc/carousel/interface.d.ts +2 -6
  68. package/types/pc/cascader/interface.d.ts +6 -18
  69. package/types/pc/checkbox/interface.d.ts +0 -1
  70. package/types/pc/collapse/interface.d.ts +4 -2
  71. package/types/pc/color-picker/interface.d.ts +0 -2
  72. package/types/pc/config-provider/interface.d.ts +16 -14
  73. package/types/pc/copy/interface.d.ts +2 -1
  74. package/types/pc/date-picker/RangePicker.d.ts +1 -1
  75. package/types/pc/date-picker/interface.d.ts +0 -17
  76. package/types/pc/descriptions/interface.d.ts +0 -1
  77. package/types/pc/drawer/interface.d.ts +0 -7
  78. package/types/pc/dropdown/interface.d.ts +0 -1
  79. package/types/pc/flex/index.d.ts +9 -0
  80. package/types/pc/flex/interface.d.ts +61 -0
  81. package/types/pc/flex/utils.d.ts +9 -0
  82. package/types/pc/form/interface.d.ts +9 -22
  83. package/types/pc/form/util.d.ts +1 -1
  84. package/types/pc/grid/index.d.ts +3 -3
  85. package/types/pc/grid/interface.d.ts +1 -6
  86. package/types/pc/image/interface.d.ts +0 -13
  87. package/types/pc/index.d.ts +16 -6
  88. package/types/pc/input/Textarea.d.ts +2 -6
  89. package/types/pc/input/interface.d.ts +5 -13
  90. package/types/pc/input-number/interface.d.ts +0 -4
  91. package/types/pc/input-tag/interface.d.ts +0 -13
  92. package/types/pc/layout/interface.d.ts +0 -1
  93. package/types/pc/link/interface.d.ts +0 -1
  94. package/types/pc/liquid-fill/index.d.ts +114 -1
  95. package/types/pc/list/interface.d.ts +0 -4
  96. package/types/pc/marquee/index.d.ts +61 -0
  97. package/types/pc/menu/context.d.ts +1 -1
  98. package/types/pc/menu/interface.d.ts +0 -8
  99. package/types/pc/message/interface.d.ts +0 -2
  100. package/types/pc/modal/interface.d.ts +0 -5
  101. package/types/pc/notification/interface.d.ts +0 -1
  102. package/types/pc/pagination/interface.d.ts +0 -2
  103. package/types/pc/popconfirm/interface.d.ts +8 -10
  104. package/types/pc/popover/interface.d.ts +0 -1
  105. package/types/pc/progress/interface.d.ts +0 -3
  106. package/types/pc/qr-code/index.d.ts +1 -1
  107. package/types/pc/rate/index.d.ts +2 -2
  108. package/types/pc/resize-box/interface.d.ts +1 -7
  109. package/types/pc/segmented/index.d.ts +8 -0
  110. package/types/pc/segmented/interface.d.ts +88 -0
  111. package/types/pc/select/interface.d.ts +0 -12
  112. package/types/pc/select-view/interface.d.ts +0 -7
  113. package/types/pc/slider/interface.d.ts +0 -4
  114. package/types/pc/space/index.d.ts +4 -1
  115. package/types/pc/space/interface.d.ts +6 -10
  116. package/types/pc/spin/interface.d.ts +4 -1
  117. package/types/pc/splitter/Panel.d.ts +8 -0
  118. package/types/pc/splitter/SplitBar.d.ts +21 -0
  119. package/types/pc/splitter/Splitter.d.ts +4 -0
  120. package/types/pc/splitter/hooks/useEvent.d.ts +3 -0
  121. package/types/pc/splitter/hooks/useItems.d.ts +10 -0
  122. package/types/pc/splitter/hooks/useResizable.d.ts +8 -0
  123. package/types/pc/splitter/hooks/useResize.d.ts +4 -0
  124. package/types/pc/splitter/hooks/useSizes.d.ts +5 -0
  125. package/types/pc/splitter/index.d.ts +8 -0
  126. package/types/pc/splitter/interface.d.ts +213 -0
  127. package/types/pc/statistic/interface.d.ts +0 -4
  128. package/types/pc/steps/interface.d.ts +0 -3
  129. package/types/pc/table/hook/useThResizable.d.ts +2 -2
  130. package/types/pc/table/interface.d.ts +4 -15
  131. package/types/pc/tabs/interface.d.ts +0 -7
  132. package/types/pc/tag/index.d.ts +2 -0
  133. package/types/pc/tag/interface.d.ts +0 -1
  134. package/types/pc/time-picker/interface.d.ts +0 -7
  135. package/types/pc/tooltip/interface.d.ts +4 -1
  136. package/types/pc/tour/index.d.ts +6 -1
  137. package/types/pc/transfer/interface.d.ts +2 -9
  138. package/types/pc/tree/interface.d.ts +2 -8
  139. package/types/pc/tree-select/interface.d.ts +0 -8
  140. package/types/pc/trigger/interface.d.ts +0 -5
  141. package/types/pc/typography/EditContent.d.ts +2 -1
  142. package/types/pc/typography/interface.d.ts +45 -30
  143. package/types/pc/upload/interface.d.ts +6 -11
  144. package/types/pc/utils/index.d.ts +1 -0
  145. package/types/pc/utils/names.d.ts +24 -0
  146. package/types/pc/utils/toArray.d.ts +7 -0
  147. package/types/pc/verification-code/interface.d.ts +0 -2
  148. package/types/pc/watermark/interface.d.ts +0 -2
  149. package/typography/Base.js +73 -73
  150. package/typography/EditContent.js +43 -33
  151. package/typography/Ellipsis.js +117 -184
  152. package/typography/Operations.js +97 -49
  153. package/typography/useCssEllipsis.js +7 -6
  154. package/utils/index.js +117 -115
  155. package/utils/names.js +16 -0
  156. package/utils/toArray.js +12 -0
  157. package/version/index.js +1 -1
  158. package/_virtual/_commonjsHelpers.js +0 -6
  159. package/_virtual/index.js +0 -7
  160. package/_virtual/index2.js +0 -4
  161. package/liquid-fill/LiquidFill.js +0 -226
  162. package/liquid-fill/LiquidFill2.js +0 -3
  163. package/space-/index.js +0 -93
  164. package/types/common/utils/color.d.ts +0 -1
  165. package/types/common/utils/computeScrollIntoView.d.ts +0 -1
  166. package/types/common/utils/index.d.ts +0 -45
  167. package/types/common/utils/math.d.ts +0 -1
  168. package/types/common/utils/reactTransitionGroup.d.ts +0 -1
  169. package/types/common/utils/tree.d.ts +0 -1
  170. package/types/common/utils/tween.d.ts +0 -1
  171. package/types/common/utils/uuid.d.ts +0 -1
  172. package/types/common/utils/validate.d.ts +0 -1
  173. package/types/pc/liquid-fill/LiquidFill.d.ts +0 -115
  174. package/types/pc/liquid-fill/LiquidFill2.d.ts +0 -1
  175. package/types/pc/space-/index.d.ts +0 -6
  176. package/types/pc/space-/interface.d.ts +0 -38
  177. /package/{space- → components/common/space}/toArray.js +0 -0
  178. /package/{space- → segmented}/interface.js +0 -0
  179. /package/types/{pc/space- → common/space}/toArray.d.ts +0 -0
  180. /package/types/pc/grid/{GridItem.d.ts → Item.d.ts} +0 -0
package/badge/index.js CHANGED
@@ -1,13 +1,60 @@
1
- import { jsxs as g, jsx as s } from "react/jsx-runtime";
2
- import R from "lodash/isPlainObject";
3
- import { forwardRef as G, useContext as _ } from "react";
1
+ import { jsxs as c, jsx as e } from "react/jsx-runtime";
2
+ import q from "lodash/isPlainObject";
3
+ import { forwardRef as z, useContext as H, useRef as O, useImperativeHandle as L } from "react";
4
4
  import "../config-provider/ConfigProvider.js";
5
- import k from "../components/common/hooks/useMergeProps.js";
6
- import { PqbCSSTransition as q } from "../components/common/utils/PqbCSSTransition.js";
5
+ import M from "../components/common/hooks/useMergeProps.js";
6
+ import "@unicom-cloud/utils/case-name";
7
7
  import n from "@unicom-cloud/utils/class-name";
8
- import $ from "./Count.js";
9
- import z from "../config-provider/context.js";
10
- const x = [
8
+ import "../dist/tinycolor/chunk/BOzCVdr0.js";
9
+ import "@unicom-cloud/utils/constant/ui";
10
+ import "../utils/contextHolder.js";
11
+ import "@unicom-cloud/utils/dayjs";
12
+ import "@unicom-cloud/utils/clipboard-copy";
13
+ import "../components/common/utils/dayjs.js";
14
+ import "../components/common/utils/dom.js";
15
+ import "@unicom-cloud/utils/file/fileToURL";
16
+ import "lodash/escapeRegExp";
17
+ import "lodash/isArray";
18
+ import "lodash/isNumber";
19
+ import "lodash/isString";
20
+ import "lodash/isFunction";
21
+ import "lodash/throttle";
22
+ import "../components/common/utils/is.js";
23
+ import "lodash/camelCase";
24
+ import "lodash/capitalize";
25
+ import "lodash/cloneDeep";
26
+ import "lodash/debounce";
27
+ import "lodash/get";
28
+ import "lodash/has";
29
+ import "lodash/kebabCase";
30
+ import "lodash/merge";
31
+ import "lodash/mergeWith";
32
+ import "lodash/set";
33
+ import "lodash/setWith";
34
+ import "lodash/snakeCase";
35
+ import "lodash/startCase";
36
+ import "lodash/uniq";
37
+ import "lodash/upperFirst";
38
+ import "@unicom-cloud/utils/math";
39
+ import { PqbCSSTransition as U } from "../components/common/utils/PqbCSSTransition.js";
40
+ import "../components/common/utils/reactDOM.js";
41
+ import "../dist/react-transition-group/src/CSSTransition.js";
42
+ import "../dist/react-transition-group/src/ReplaceTransition.js";
43
+ import "../dist/react-transition-group/src/SwitchTransition.js";
44
+ import "../dist/react-transition-group/chunk/CPfP7aNL.js";
45
+ import "../dist/react-transition-group/src/TransitionGroup.js";
46
+ import "@unicom-cloud/utils/file/saveAs";
47
+ import "@unicom-cloud/utils/screenfull";
48
+ import "@unicom-cloud/utils/constant/ui.js";
49
+ import "react-is";
50
+ import "@unicom-cloud/utils/tree";
51
+ import "@unicom-cloud/utils/is";
52
+ import { v4 as F } from "uuid";
53
+ import "../dist/validate/src/index.js";
54
+ import "@unicom-cloud/utils/constant/keyboardCode";
55
+ import B from "./Count.js";
56
+ import J from "../config-provider/context.js";
57
+ const f = [
11
58
  "red",
12
59
  "orangered",
13
60
  "orange",
@@ -19,132 +66,179 @@ const x = [
19
66
  "purple",
20
67
  "magenta",
21
68
  "gray"
22
- ], I = {
69
+ ], K = {
23
70
  count: 0,
24
- maxCount: 99
71
+ maxCount: 99,
72
+ dotAnimation: !0
73
+ // 默认开启 dot 动画
25
74
  };
26
- function L(y, N) {
27
- const { getPrefixCls: h, componentConfig: S, rtl: b } = _(z), O = k(
28
- y,
29
- I,
30
- S?.Badge
75
+ function Q(P, v) {
76
+ const { getPrefixCls: A, componentConfig: R, rtl: $ } = H(J), T = M(
77
+ P,
78
+ K,
79
+ R?.Badge
31
80
  ), {
32
- count: o,
33
- prefixText: c,
34
- text: m,
35
- className: B,
36
- dotClassName: a,
37
- dot: p,
38
- dotAnimation: P = !0,
39
- maxCount: T,
40
- color: e,
41
- dotStyle: A,
42
- offset: D,
43
- style: E,
44
- status: l,
81
+ ribbon: o,
82
+ count: s,
83
+ prefixText: g,
84
+ text: l,
85
+ className: w,
86
+ dotClassName: m,
87
+ dot: b,
88
+ dotAnimation: x,
89
+ maxCount: E,
90
+ color: r,
91
+ dotStyle: j,
92
+ offset: I,
93
+ style: N,
94
+ status: p,
45
95
  children: u,
46
- ...j
47
- } = O, t = h?.("badge"), r = { ...A || {} }, [f, d] = D || [];
48
- f && (r.marginRight = -f), d && (r.marginTop = d);
49
- const w = () => {
50
- if (R(o))
51
- return /* @__PURE__ */ s(
96
+ ...y
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, () => ({
99
+ dom: d.current
100
+ }));
101
+ const k = () => {
102
+ if (q(s))
103
+ return /* @__PURE__ */ e(
52
104
  "span",
53
105
  {
54
- className: n(`${t}-custom-dot`, a),
55
- style: r,
56
- children: o
106
+ className: n(`${t}-custom-dot`, m),
107
+ style: i,
108
+ children: s
57
109
  }
58
110
  );
59
- const i = !e || x.indexOf(e) > -1 ? {} : { backgroundColor: e };
60
- return m && !e && !l ? /* @__PURE__ */ s(
111
+ const a = !r || f.indexOf(r) > -1 ? {} : { backgroundColor: r };
112
+ return l && !r && !p ? /* @__PURE__ */ e(
61
113
  "span",
62
114
  {
63
- className: n(`${t}-text`, a),
64
- style: r,
65
- children: m
115
+ className: n(`${t}-text`, m),
116
+ style: i,
117
+ children: l
66
118
  }
67
- ) : l || e && typeof o == "number" && o <= 0 ? /* @__PURE__ */ g("span", { className: `${t}-status-wrapper`, children: [
68
- !!c && /* @__PURE__ */ s("span", { className: `${t}-status-prefix-text`, children: c }),
69
- /* @__PURE__ */ s(
119
+ ) : p || r && typeof s == "number" && s <= 0 ? /* @__PURE__ */ c("span", { className: `${t}-status-wrapper`, children: [
120
+ !!g && /* @__PURE__ */ e("span", { className: `${t}-status-prefix-text`, children: g }),
121
+ /* @__PURE__ */ e(
70
122
  "span",
71
123
  {
72
124
  className: n(
73
125
  `${t}-status-dot`,
74
126
  {
75
- [`${t}-status-dot-animation`]: P,
76
- [`${t}-status-${l}`]: l,
77
- [`${t}-color-${e}`]: e
127
+ [`${t}-dot-pulse`]: x,
128
+ [`${t}-status-${p}`]: p,
129
+ [`${t}-color-${r}`]: r
78
130
  },
79
- a
131
+ m
80
132
  ),
81
- style: { ...i, ...r }
133
+ style: { ...a, ...i }
82
134
  }
83
135
  ),
84
- !!m && /* @__PURE__ */ s("span", { className: `${t}-status-text`, children: m })
85
- ] }) : (p || e) && typeof o == "number" && o > 0 ? /* @__PURE__ */ s(
86
- q,
136
+ !!l && /* @__PURE__ */ e("span", { className: `${t}-status-text`, children: l })
137
+ ] }) : (b || r) && typeof s == "number" && s > 0 ? /* @__PURE__ */ e(
138
+ U,
87
139
  {
88
140
  classNames: "badge-zoom",
89
- in: p || !!e,
141
+ in: b || !!r,
90
142
  timeout: 200,
91
143
  appear: !0,
92
144
  mountOnEnter: !0,
93
145
  unmountOnExit: !0,
94
- children: /* @__PURE__ */ s(
146
+ children: /* @__PURE__ */ e(
95
147
  "span",
96
148
  {
97
149
  className: n(
98
150
  `${t}-dot`,
99
151
  {
100
- [`${t}-color-${e}`]: e
152
+ [`${t}-dot-pulse`]: x,
153
+ [`${t}-color-${r}`]: r
101
154
  },
102
- a
155
+ m
103
156
  ),
104
- style: { ...i, ...r }
157
+ style: { ...a, ...i }
105
158
  }
106
159
  )
107
160
  }
108
- ) : /* @__PURE__ */ s(
109
- $,
161
+ ) : /* @__PURE__ */ e(
162
+ B,
110
163
  {
111
164
  prefixCls: t,
112
- className: n(`${t}-number`, a),
113
- style: { ...i, ...r },
114
- maxCount: T,
115
- count: o
165
+ className: n(`${t}-number`, m),
166
+ style: { ...a, ...i },
167
+ maxCount: E,
168
+ count: s
169
+ }
170
+ );
171
+ }, G = () => {
172
+ if (!o || !o.text) return null;
173
+ const a = o.color ? { backgroundColor: o.color } : {}, _ = o.placement || "end";
174
+ return /* @__PURE__ */ c(
175
+ "div",
176
+ {
177
+ className: n(
178
+ `${t}-ribbon`,
179
+ `${t}-ribbon-${_}`,
180
+ {
181
+ [`${t}-rtl`]: $,
182
+ [`${t}-color-${o.color}`]: o.color && f.includes(o.color)
183
+ }
184
+ ),
185
+ style: a,
186
+ children: [
187
+ /* @__PURE__ */ e("span", { className: `${t}-ribbon-text`, children: o.text }),
188
+ /* @__PURE__ */ e("div", { className: `${t}-ribbon-corner` })
189
+ ]
116
190
  }
117
191
  );
118
192
  };
119
- return /* @__PURE__ */ g(
193
+ return o ? /* @__PURE__ */ c(
194
+ "div",
195
+ {
196
+ className: `${t}-ribbon-wrapper`,
197
+ ref: d,
198
+ style: N,
199
+ id: C.current,
200
+ ...y,
201
+ children: [
202
+ u,
203
+ G()
204
+ ]
205
+ }
206
+ ) : /* @__PURE__ */ c(
120
207
  "span",
121
208
  {
122
209
  className: n(
123
210
  t,
124
211
  {
125
- [`${t}-status`]: l,
212
+ [`${t}-status`]: p,
126
213
  [`${t}-no-children`]: !u,
127
- [`${t}-rtl`]: b
214
+ [`${t}-rtl`]: $
128
215
  },
129
- B
216
+ w
130
217
  ),
131
- ref: N,
132
- style: E,
133
- ...j,
218
+ ref: d,
219
+ style: N,
220
+ id: C.current,
221
+ ...y,
134
222
  children: [
135
223
  u,
136
- w()
224
+ k()
137
225
  ]
138
226
  }
139
227
  );
140
228
  }
141
- const C = G(L);
142
- C.displayName = "Badge";
143
- C.Count = $;
144
- const W = x, X = ["default", "processing", "success", "warning", "error"];
229
+ const D = z(Q);
230
+ D.displayName = "Badge";
231
+ D.Count = B;
232
+ const Xt = f, Yt = [
233
+ "default",
234
+ "processing",
235
+ "success",
236
+ "warning",
237
+ "error"
238
+ ];
145
239
  export {
146
- W as BADGE_COLORS,
147
- X as BADGE_STATUS,
148
- $ as BadgeCount,
149
- C as default
240
+ Xt as BADGE_COLORS,
241
+ Yt as BADGE_STATUS,
242
+ B as BadgeCount,
243
+ D as default
150
244
  };
@@ -1,90 +1,96 @@
1
1
  import { jsx as t } from "react/jsx-runtime";
2
2
  import z from "@unicom-cloud/icons/IconUiCaretLeft";
3
- import f from "@unicom-cloud/icons/IconUiCaretRight";
4
- import F from "lodash/isFunction";
5
- import M, { createContext as O, useContext as T } from "react";
3
+ import m from "@unicom-cloud/icons/IconUiCaretRight";
4
+ import B from "lodash/isFunction";
5
+ import F, { createContext as M, useContext as O } from "react";
6
6
  import "../config-provider/ConfigProvider.js";
7
- import U from "../components/common/hooks/useMergeProps.js";
8
- import V from "../components/common/hooks/useMergeValue.js";
9
- import j from "@unicom-cloud/utils/class-name";
10
- import { omit as H } from "../components/common/utils/omit.js";
11
- import L from "./Item.js";
12
- import q from "../config-provider/context.js";
13
- const m = (i, s) => {
14
- const n = [].concat(i);
15
- return s ? n.slice(0, 1) : n;
16
- }, B = {
7
+ import T from "../components/common/hooks/useMergeProps.js";
8
+ import U from "../components/common/hooks/useMergeValue.js";
9
+ import V from "@unicom-cloud/utils/class-name";
10
+ import { omit as j } from "../components/common/utils/omit.js";
11
+ import k from "./Item.js";
12
+ import L from "../config-provider/context.js";
13
+ const f = (s, a) => {
14
+ const n = [].concat(s);
15
+ return a ? n.slice(0, 1) : n;
16
+ }, q = {
17
17
  bordered: !0,
18
18
  lazyload: !0,
19
- expandIconPosition: "left"
20
- }, D = O({
21
19
  expandIconPosition: "left",
22
- expandIcon: /* @__PURE__ */ t(f, {}),
20
+ invertHeaderContentBackgrounds: !1
21
+ // 潘启宝添加
22
+ }, D = M({
23
+ expandIconPosition: "left",
24
+ expandIcon: /* @__PURE__ */ t(m, {}),
23
25
  activeKeys: [],
24
26
  onToggle: () => {
25
27
  }
26
28
  });
27
- function E(i, s) {
28
- const { getPrefixCls: n, componentConfig: C, rtl: v } = T(q), e = U(
29
- i,
30
- B,
29
+ function E(s, a) {
30
+ const { getPrefixCls: n, componentConfig: C, rtl: v } = O(L), e = T(
31
+ s,
32
+ q,
31
33
  C?.Collapse
32
- ), [a, x] = V([], {
33
- defaultValue: "defaultActiveKey" in e ? m(e.defaultActiveKey, e.accordion) : void 0,
34
- value: "activeKey" in e ? m(e.activeKey, e.accordion) : void 0
34
+ ), [c, g] = U([], {
35
+ defaultValue: "defaultActiveKey" in e ? f(e.defaultActiveKey, e.accordion) : void 0,
36
+ value: "activeKey" in e ? f(e.activeKey, e.accordion) : void 0
35
37
  }), {
36
- children: g,
38
+ children: x,
37
39
  className: y,
38
40
  style: I,
39
41
  bordered: K,
40
- lazyload: P,
41
- expandIcon: h,
42
+ lazyload: h,
43
+ expandIcon: P,
42
44
  expandIconPosition: l,
43
45
  destroyOnHide: A,
44
46
  accordion: R,
45
- triggerRegion: N,
46
- onChange: p,
47
- ...b
48
- } = e, c = n?.("collapse"), $ = (r, w) => {
49
- let o = [...a || []];
50
- const d = a?.indexOf(r);
51
- d > -1 ? o.splice(d, 1) : R ? o = [r] : o.push(r), "activeKey" in e || x(o), F(p) && p(r, o, w);
47
+ triggerRegion: b,
48
+ invertHeaderContentBackgrounds: N,
49
+ // 潘启宝添加
50
+ onChange: d,
51
+ ...$
52
+ } = e, r = n?.("collapse"), w = (i, H) => {
53
+ let o = [...c || []];
54
+ const p = c?.indexOf(i);
55
+ p > -1 ? o.splice(p, 1) : R ? o = [i] : o.push(i), "activeKey" in e || g(o), B(d) && d(i, o, H);
52
56
  };
53
57
  return /* @__PURE__ */ t(
54
58
  D.Provider,
55
59
  {
56
60
  value: {
57
- activeKeys: a,
58
- triggerRegion: N,
59
- lazyload: P,
61
+ activeKeys: c,
62
+ triggerRegion: b,
63
+ lazyload: h,
60
64
  destroyOnHide: A,
61
65
  expandIconPosition: l,
62
- onToggle: $,
63
- expandIcon: "expandIcon" in e ? h : l === "right" ? /* @__PURE__ */ t(z, {}) : /* @__PURE__ */ t(f, {})
66
+ onToggle: w,
67
+ expandIcon: "expandIcon" in e ? P : l === "right" ? /* @__PURE__ */ t(z, {}) : /* @__PURE__ */ t(m, {})
64
68
  },
65
69
  children: /* @__PURE__ */ t(
66
70
  "div",
67
71
  {
68
- ref: s,
69
- ...H(b, ["activeKey", "defaultActiveKey"]),
70
- className: j(
71
- c,
72
- `${c}-${K ? "border" : "borderless"}`,
73
- { [`${c}-rtl`]: v },
72
+ ref: a,
73
+ ...j($, ["activeKey", "defaultActiveKey"]),
74
+ className: V(
75
+ r,
76
+ `${r}-${K ? "border" : "borderless"}`,
77
+ { [`${r}-rtl`]: v },
78
+ N && `${r}-invert-header-content-backgrounds`,
79
+ // 潘启宝添加
74
80
  y
75
81
  ),
76
82
  style: I,
77
- children: g
83
+ children: x
78
84
  }
79
85
  )
80
86
  }
81
87
  );
82
88
  }
83
- const G = M.forwardRef(E), u = G;
89
+ const G = F.forwardRef(E), u = G;
84
90
  u.displayName = "Collapse";
85
- u.Item = L;
91
+ u.Item = k;
86
92
  export {
87
93
  D as CollapseContext,
88
- L as CollapseItem,
94
+ k as CollapseItem,
89
95
  u as default
90
96
  };
@@ -1,112 +1,96 @@
1
- import { jsx as s } from "react/jsx-runtime";
2
- import { UI_COMMON_PREFIX as C } from "@unicom-cloud/utils/constant/ui";
3
- import { forwardRef as c } from "react";
4
- import "@unicom-cloud/utils/case-name";
5
- import _ from "@unicom-cloud/utils/class-name";
6
- import "../../../dist/tinycolor/chunk/BOzCVdr0.js";
7
- import "@unicom-cloud/utils/dayjs";
8
- import "@unicom-cloud/utils/clipboard-copy";
9
- import "../utils/dayjs.js";
10
- import "../utils/dom.js";
11
- import "@unicom-cloud/utils/file/fileToURL";
12
- import "lodash/escapeRegExp";
13
- import "lodash/isArray";
14
- import "lodash/isNumber";
15
- import "lodash/isString";
16
- import "lodash/isFunction";
17
- import "lodash/throttle";
18
- import "../utils/is.js";
19
- import "lodash/camelCase";
20
- import "lodash/capitalize";
21
- import "lodash/cloneDeep";
22
- import "lodash/debounce";
23
- import "lodash/get";
24
- import "lodash/has";
25
- import "lodash/kebabCase";
26
- import "lodash/merge";
27
- import "lodash/mergeWith";
28
- import "lodash/set";
29
- import "lodash/setWith";
30
- import "lodash/snakeCase";
31
- import "lodash/startCase";
32
- import "lodash/uniq";
33
- import "lodash/upperFirst";
34
- import "@unicom-cloud/utils/math";
35
- import "lodash/isPlainObject";
36
- import "../../../dist/react-transition-group/src/CSSTransition.js";
37
- import "../../../dist/react-transition-group/src/ReplaceTransition.js";
38
- import "../../../dist/react-transition-group/src/SwitchTransition.js";
39
- import "../../../dist/react-transition-group/chunk/CPfP7aNL.js";
40
- import "../../../dist/react-transition-group/src/TransitionGroup.js";
41
- import "../utils/reactDOM.js";
42
- import "@unicom-cloud/utils/file/saveAs";
43
- import "@unicom-cloud/utils/screenfull";
44
- import "@unicom-cloud/utils/tree";
45
- import { isArray as l, isNumber as I } from "@unicom-cloud/utils/is";
46
- import "uuid";
47
- import "../../../dist/validate/src/index.js";
48
- import "@unicom-cloud/utils/constant/keyboardCode";
49
- function f(t = 8) {
50
- if (I(t))
51
- return t;
52
- if (l(t))
53
- return t.map((i, r, e) => f(i));
54
- switch (t) {
55
- case "mini":
56
- return 4;
57
- case "small":
58
- return 8;
59
- case "medium":
60
- return 16;
61
- case "large":
62
- return 24;
63
- default:
64
- return 8;
65
- }
66
- }
67
- function S(t, i) {
68
- const r = `${C}-space`, {
69
- className: e,
70
- style: d,
71
- children: $,
72
- inline: y,
73
- gap: N = "small",
74
- direction: n = "horizontal",
75
- wrap: h,
76
- justifyContent: a,
77
- alignItems: g,
78
- ...w
79
- } = t;
80
- let p = g;
81
- n === "horizontal" && (p ||= "center");
82
- const o = f(N), m = { ...d };
83
- return l(o) ? (m.rowGap = o[0], m.columnGap = o[1]) : m.gap = o, /* @__PURE__ */ s(
84
- "div",
1
+ import { jsx as c, jsxs as L } from "react/jsx-runtime";
2
+ import { UI_COMMON_PREFIX as O } from "@unicom-cloud/utils/constant/ui";
3
+ import P from "lodash/isArray";
4
+ import _ from "lodash/isNumber";
5
+ import { forwardRef as N, Fragment as b } from "react";
6
+ import k from "../hooks/useMergeProps.js";
7
+ import x from "@unicom-cloud/utils/class-name";
8
+ import F from "./toArray.js";
9
+ const D = {
10
+ size: "small",
11
+ direction: "horizontal"
12
+ };
13
+ function E(a, m) {
14
+ const S = k(a, D, {}), {
15
+ className: z,
16
+ style: C,
17
+ children: M,
18
+ gap: j,
19
+ size: w,
20
+ direction: s,
21
+ align: B,
22
+ alignItems: R,
23
+ justifyContent: d,
24
+ wrap: l,
25
+ split: p,
26
+ rtl: $,
27
+ ...V
28
+ } = S, r = `${O}-space`, h = R ?? (B || (s === "horizontal" ? "center" : "")), i = j ?? w, A = x(
29
+ r,
85
30
  {
86
- ref: i,
87
- className: _(
88
- `${r}`,
89
- y && `${r}-inline`,
90
- h && `${r}-wrap`,
91
- `${r}-${n}`,
92
- a && `${r}-justify-content-${a}`,
93
- p && `${r}-align-items-${p}`,
94
- e
95
- ),
96
- style: m,
97
- ...w,
98
- children: $
99
- }
31
+ [`${r}-${s}`]: s,
32
+ [`${r}-justify-content-${d}`]: d,
33
+ [`${r}-align-items-${h}`]: h,
34
+ [`${r}-wrap`]: l,
35
+ [`${r}-rtl`]: $
36
+ },
37
+ z
100
38
  );
39
+ function f(e) {
40
+ if (_(e))
41
+ return e;
42
+ switch (e) {
43
+ case "mini":
44
+ return 4;
45
+ case "small":
46
+ return 8;
47
+ case "medium":
48
+ return 16;
49
+ case "large":
50
+ return 24;
51
+ default:
52
+ return 8;
53
+ }
54
+ }
55
+ const y = F(M);
56
+ function I(e) {
57
+ const n = y.length === e + 1, o = $ ? "marginLeft" : "marginRight";
58
+ if (typeof i == "string" || typeof i == "number") {
59
+ const t = f(i);
60
+ return l ? n ? { marginBottom: t } : {
61
+ [`${o}`]: t,
62
+ marginBottom: t
63
+ } : n ? {} : {
64
+ [s === "vertical" ? "marginBottom" : o]: t
65
+ };
66
+ }
67
+ if (P(i)) {
68
+ const t = f(i[0]), u = f(i[1]);
69
+ return l ? n ? { marginBottom: u } : {
70
+ [`${o}`]: t,
71
+ marginBottom: u
72
+ } : s === "vertical" ? { marginBottom: u } : { [`${o}`]: t };
73
+ }
74
+ }
75
+ return /* @__PURE__ */ c("div", { ref: m, className: A, style: C, ...V, children: y.map((e, n) => {
76
+ const o = e?.key || n, t = p != null && n > 0;
77
+ return /* @__PURE__ */ L(b, { children: [
78
+ t && /* @__PURE__ */ c("div", { className: `${r}-item-split`, children: p }),
79
+ /* @__PURE__ */ c("div", { className: `${r}-item`, style: I(n), children: e })
80
+ ] }, o);
81
+ }) });
101
82
  }
102
- const u = c(S);
103
- u.displayName = "Space";
104
- function j(t, i) {
105
- return /* @__PURE__ */ s(u, { ref: i, ...t, direction: "vertical", children: t.children });
83
+ const g = N(
84
+ E
85
+ );
86
+ g.displayName = "Space";
87
+ function H(a, m) {
88
+ return /* @__PURE__ */ c(g, { ref: m, ...a, direction: "vertical", children: a.children });
106
89
  }
107
- const x = c(j);
108
- x.displayName = "SpaceVertical";
90
+ const v = N(H);
91
+ v.displayName = "SpaceVertical";
92
+ g.Vertical = v;
109
93
  export {
110
- x as SpaceVertical,
111
- u as default
94
+ v as SpaceVertical,
95
+ g as default
112
96
  };