@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
@@ -51,20 +51,17 @@ export interface TreeSelectProps extends SelectViewCommonProps {
51
51
  * @en
52
52
  * Customize the content that will be displayed in the Select.
53
53
  * If the `Option` corresponding to `value` does not exist, the first parameter will be `null`
54
- * @version 2.46.0
55
54
  */
56
55
  renderFormat?: (option: NodeProps | null, value: string | LabelValue) => ReactNode;
57
56
  /**
58
57
  * @zh 输入框搜索文本的受控值
59
58
  * @en To set input search value
60
- * @version 2.39.0
61
59
  */
62
60
  inputValue?: string;
63
61
  /**
64
62
  * @zh 指定 key,title,isLeaf,disabled,children 对应的字段
65
63
  * @en Custom field name for key, title, isLeaf, disabled and children
66
64
  * @defaultValue DefaultFieldNames
67
- * @version 2.11.0
68
65
  */
69
66
  fieldNames?: TreeProps['fieldNames'];
70
67
  /**
@@ -111,7 +108,6 @@ export interface TreeSelectProps extends SelectViewCommonProps {
111
108
  /**
112
109
  * @zh 自定义上方显示元素
113
110
  * @en Customize the trigger element
114
- * @version `() => ReactNode` in 2.31.0
115
111
  */
116
112
  triggerElement?: ReactNode | ((params: {
117
113
  value: any;
@@ -135,19 +131,16 @@ export interface TreeSelectProps extends SelectViewCommonProps {
135
131
  /**
136
132
  * @zh 设置下拉框样式
137
133
  * @en The additional css style for dropdown menu
138
- * @version 2.3.0
139
134
  */
140
135
  dropdownMenuStyle?: CSSProperties;
141
136
  /**
142
137
  * @zh 自定义下拉框展示
143
138
  * @en Customize dropdown rendering
144
- * @version 2.3.0
145
139
  */
146
140
  dropdownRender?: (dom: ReactNode) => ReactNode;
147
141
  /**
148
142
  * @zh 选中值改变的回调
149
143
  * @en Callback when the selection changed
150
- * @version `extra` in `2.29.0`
151
144
  */
152
145
  onChange?: (value: any, extra: {
153
146
  trigger?: NodeProps;
@@ -185,7 +178,6 @@ export interface TreeSelectProps extends SelectViewCommonProps {
185
178
  /**
186
179
  * @zh 输入框搜索文本改变的回调。
187
180
  * @en Callback when the search value of input is changed.
188
- * @version 2.39.0
189
181
  */
190
182
  onInputValueChange?: (value: string, reason: InputValueChangeReason) => void;
191
183
  /**
@@ -115,7 +115,6 @@ export interface TriggerProps {
115
115
  /**
116
116
  * @zh 默认弹出层位置会根据视口边界进行定位及微调,此参数可以设置到视口边界一定距离时即进行定位调整。仅在 autoFitPosition=true 且 alignPoint=false 生效。
117
117
  * @en The default pop-up layer position will be positioned and fine-tuned according to the viewport boundary. This parameter can be set to adjust the positioning when it is a certain distance from the viewport boundary. Only takes effect when autoFitPosition=true and alignPoint=false.
118
- * @version 2.59.0
119
118
  */
120
119
  boundaryDistance?: {
121
120
  left?: number;
@@ -146,7 +145,6 @@ export interface TriggerProps {
146
145
  * @zh 是否在鼠标移出触发节点和弹出层的时候关闭弹出层
147
146
  * @en Whether to allow close the popup by clicking the child node.
148
147
  * @defaultValue true
149
- * @version 2.22.0
150
148
  */
151
149
  mouseLeaveToClose?: boolean;
152
150
  /**
@@ -158,7 +156,6 @@ export interface TriggerProps {
158
156
  * @zh 是否在点击空白处(触发节点和弹出框以外的区域)时关闭弹出层。 关闭时会触发 `onVisibleChange`。默认是在冒泡阶段触发该逻辑,可设置 `{ capture: true }` 指定捕获阶段触发
159
157
  * @en Whether to allow close the popup by clicking the area outside the child node and the popup box.By default, this logic is triggered in the bubbling phase. You can set `{ capture: true }` to specify the triggering phase in the capture phase.
160
158
  * @defaultValue true
161
- * @version `{ capture: boolean }` in `2.55.0`
162
159
  */
163
160
  clickOutsideToClose?: boolean | {
164
161
  capture: boolean;
@@ -171,7 +168,6 @@ export interface TriggerProps {
171
168
  /**
172
169
  * @zh 是否在容器滚动时关闭弹出框
173
170
  * @en Whether to close the popup when the container is scrolled
174
- * @version 2.34.0
175
171
  */
176
172
  containerScrollToClose?: boolean;
177
173
  /**
@@ -232,7 +228,6 @@ export interface TriggerProps {
232
228
  /**
233
229
  * @zh 是否在容器滚动时更新弹出框的位置
234
230
  * @en Whether to update the popover's position when the container is scrolled
235
- * @version 2.32.0
236
231
  */
237
232
  updateOnScroll?: boolean;
238
233
  children?: ReactNode;
@@ -1,3 +1,4 @@
1
+ import React from 'react';
1
2
  import { EditContentProps } from './interface';
2
- declare const _default: import("react").ForwardRefExoticComponent<EditContentProps & import("react").RefAttributes<HTMLDivElement>>;
3
+ declare const _default: React.ForwardRefExoticComponent<EditContentProps & React.RefAttributes<HTMLDivElement>>;
3
4
  export default _default;
@@ -1,5 +1,17 @@
1
1
  import React, { CSSProperties, ReactNode } from 'react';
2
+ import type { InputProps, TextAreaProps } from '../input';
2
3
  import { TooltipProps } from '../tooltip';
4
+ /**
5
+ * @zh 开启复制功能
6
+ * @en Whether to be copyable
7
+ */
8
+ type Copyable = boolean | {
9
+ text?: string | (() => string);
10
+ onCopy?: (text: string, e: any) => void;
11
+ icon?: ReactNode;
12
+ tooltips?: [ReactNode, ReactNode];
13
+ tooltipProps?: TooltipProps;
14
+ };
3
15
  /**
4
16
  * @title Typography
5
17
  */
@@ -12,27 +24,13 @@ export interface OperationsProps extends Omit<React.HTMLAttributes<HTMLElement>,
12
24
  /**
13
25
  * @zh 开启复制功能
14
26
  * @en Whether to be copyable
15
- * @version `onCopy` params `e` in `2.31.0`
16
- */
17
- copyable?: boolean | {
18
- text?: string;
19
- onCopy?: (text: string, e: any) => void;
20
- icon?: ReactNode;
21
- tooltips?: [ReactNode, ReactNode];
22
- tooltipProps?: TooltipProps;
23
- };
27
+ */
28
+ copyable?: Copyable;
24
29
  /**
25
30
  * @zh 开启可编辑功能
26
31
  * @en If editable. Can control edit state when is object
27
- * @version `onStart` params `e` in `2.31.0`
28
- */
29
- editable?: boolean | {
30
- editing?: boolean;
31
- tooltipProps?: TooltipProps;
32
- onStart?: (text: any, e: any) => void;
33
- onChange?: (text: any) => void;
34
- onEnd?: (text: any) => void;
35
- };
32
+ */
33
+ editable?: boolean | EditableConfig;
36
34
  /**
37
35
  * @zh 自动溢出省略(只支持字符串),具体参数配置看 [EllipsisConfig](#ellipsisconfig)。不推荐使用,建议 `Typography.Ellipsis` 替代
38
36
  * @en Auto overflow omitted, see [EllipsisConfig](#ellipsisconfig)。Deprecated, `Typography.Ellipsis` is recommended instead
@@ -117,18 +115,33 @@ export interface TypographyParagraphProps extends CommonProps {
117
115
  */
118
116
  spacing?: 'default' | 'close';
119
117
  }
118
+ export interface EditableConfig {
119
+ /** 是否处于编辑状态 */
120
+ editing?: boolean;
121
+ /** 工具提示属性 */
122
+ tooltipProps?: TooltipProps;
123
+ /** 开始编辑回调 */
124
+ onStart?: (text: string, e: React.MouseEvent) => void;
125
+ /** 内容变化回调 */
126
+ onChange?: (text: string) => void;
127
+ /** 结束编辑回调 */
128
+ onEnd?: (text: string) => void;
129
+ /**
130
+ * Input 组件属性,如果有此属性,则使用 Input 组件,否则使用 TextArea 组件。
131
+ */
132
+ inputProps?: InputProps;
133
+ /**
134
+ * Input.TextArea 组件属性。
135
+ */
136
+ textAreaProps?: TextAreaProps;
137
+ }
120
138
  export interface EditContentProps {
121
139
  prefixCls?: string;
122
140
  style?: CSSProperties;
123
141
  className?: string | string[];
124
142
  children?: ReactNode;
125
143
  setEditing?: (editing: boolean) => void;
126
- editableConfig?: {
127
- editing?: boolean;
128
- onStart?: (text: any, e: any) => void;
129
- onChange?: (text: any) => void;
130
- onEnd?: (text: any) => void;
131
- };
144
+ editableConfig?: EditableConfig;
132
145
  }
133
146
  /**
134
147
  * @title Typography.Text
@@ -141,7 +154,6 @@ export type EllipsisConfig = {
141
154
  /**
142
155
  * @zh 自动溢出省略(只支持字符串),在大量使用情况下建议开启提高性能。
143
156
  * @en Automatic overflow omission (only strings are supported). In the case of simple single-line, css will be used by default to handle ellipsis to avoid complicated calculations.
144
- * @version `2.36.0` 将默认值改为 `false` 并支持多行CSS省略。
145
157
  */
146
158
  cssEllipsis?: boolean;
147
159
  /**
@@ -179,7 +191,6 @@ export type EllipsisConfig = {
179
191
  /**
180
192
  * @zh 在折叠/展开状态发生改变的时候触发,通常是点击折叠/展开按钮触发。
181
193
  * @en Callback when the expand state changes, usually triggered by clicking the button
182
- * @version e in `2.27.0`
183
194
  */
184
195
  onExpand?: (isExpand: boolean, e: any) => void;
185
196
  /**
@@ -193,13 +204,11 @@ export type EllipsisConfig = {
193
204
  /**
194
205
  * @zh 是否展开
195
206
  * @en whether to expand
196
- * @version `2.33.0`
197
207
  */
198
208
  expanded?: boolean;
199
209
  /**
200
210
  * @zh 默认展开
201
211
  * @en Default expanded state
202
- * @version `2.33.0`
203
212
  */
204
213
  defaultExpanded?: boolean;
205
214
  wrapper?: string | React.FC<any> | React.ComponentClass<any>;
@@ -210,6 +219,11 @@ export type EllipsisConfig = {
210
219
  export interface TypographyEllipsisProps {
211
220
  style?: CSSProperties;
212
221
  className?: string | string[];
222
+ /**
223
+ * @zh 开启复制功能
224
+ * @en Whether to be copyable
225
+ */
226
+ copyable?: Copyable;
213
227
  /**
214
228
  * @zh 显示省略的行数
215
229
  * @en The number of omitted rows
@@ -227,8 +241,8 @@ export interface TypographyEllipsisProps {
227
241
  */
228
242
  showTooltip?: boolean | TooltipProps;
229
243
  /**
230
- * @zh 是否显示操控按钮。`2.61.0` 版本支持 `single` 属性
231
- * @en Whether to show control button. `2.61.0` version supports `single` attribute
244
+ * @zh 是否显示操控按钮。
245
+ * @en Whether to show control button.
232
246
  * @defaultValue true
233
247
  */
234
248
  expandable?: boolean | {
@@ -260,3 +274,4 @@ export interface TypographyEllipsisProps {
260
274
  */
261
275
  onEllipsis?: (isEllipsis: boolean) => void;
262
276
  }
277
+ export {};
@@ -49,12 +49,11 @@ export interface UploadProps {
49
49
  /**
50
50
  * @zh 文件夹上传
51
51
  * @en Support upload whole directory
52
- * @version 2.11.0
53
52
  */
54
53
  directory?: boolean;
55
54
  /**
56
- * @zh 接受上传的类型 [详细请参考](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#accept)。(`strict` in `2.53.0`,默认为 true。设置为 false 时,accept 表现和原生一致。设置为 true 时,会严格匹配文件后缀名,过滤掉不符合 accept 规则的文件。)
57
- * @en Accepted [file types](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#accept)(`strict` in `2.53.0`, defaultValue is true. When set to false, accept behaves the same as native. When set to true, file extensions will be strictly matched and files that do not meet the accept rules will be filtered out. )
55
+ * @zh 接受上传的类型 [详细请参考](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#accept)。(`strict` 默认为 true。设置为 false 时,accept 表现和原生一致。设置为 true 时,会严格匹配文件后缀名,过滤掉不符合 accept 规则的文件。)
56
+ * @en Accepted [file types](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#accept)(`strict` defaultValue is true. When set to false, accept behaves the same as native. When set to true, file extensions will be strictly matched and files that do not meet the accept rules will be filtered out. )
58
57
  */
59
58
  accept?: string | {
60
59
  type: string;
@@ -72,8 +71,8 @@ export interface UploadProps {
72
71
  */
73
72
  listType?: 'text' | 'picture-list' | 'picture-card';
74
73
  /**
75
- * @zh 启用内置的图片预览,仅在 listType='picture-card' 时生效。(`v2.41.0`)
76
- * @en Enable built-in image preview, only works when listType='picture-card'. (`v2.41.0`)
74
+ * @zh 启用内置的图片预览,仅在 listType='picture-card' 时生效。
75
+ * @en Enable built-in image preview, only works when listType='picture-card'.
77
76
  */
78
77
  imagePreview?: boolean;
79
78
  /**
@@ -100,12 +99,11 @@ export interface UploadProps {
100
99
  * @zh 上传请求的 http method
101
100
  * @en The http method of upload request
102
101
  * @defaultValue post
103
- * @version 2.55.0
104
102
  */
105
103
  method?: string;
106
104
  /**
107
- * @zh 限制上传数量。默认超出后会隐藏上传节点。对象类型在 `2.28.0` 支持
108
- * @en maximum number of uploads allowed. Object type is supported in `2.28.0`
105
+ * @zh 限制上传数量。默认超出后会隐藏上传节点。
106
+ * @en maximum number of uploads allowed.
109
107
  */
110
108
  limit?: number | {
111
109
  maxCount: number;
@@ -205,19 +203,16 @@ export interface UploadProps {
205
203
  /**
206
204
  * @zh 拖拽上传文件时执行的回调
207
205
  * @en Callback after drag file to the upload area and drop.
208
- * @version 2.37.0
209
206
  */
210
207
  onDrop?: (e: React.DragEvent) => void;
211
208
  /**
212
209
  * @zh 拖拽上传文件进入拖拽区时的回调
213
210
  * @en Callback when drag and drop uploaded file into the drag area
214
- * @version 2.41.0
215
211
  */
216
212
  onDragOver?: (e: React.DragEvent) => void;
217
213
  /**
218
214
  * @zh 拖拽上传文件离开拖拽区时的回调
219
215
  * @en Callback when drag and drop uploaded file leaves the drag area
220
- * @version 2.41.0
221
216
  */
222
217
  onDragLeave?: (e: React.DragEvent) => void;
223
218
  }
@@ -40,6 +40,7 @@ export * from './setTheme';
40
40
  export * from './style';
41
41
  export * from './throttleByRaf';
42
42
  export * from './tinycolor';
43
+ export * from './toArray';
43
44
  export * from './tree';
44
45
  export * from './tween';
45
46
  export * from './type';
@@ -855,4 +855,10 @@ export namespace COMPONENT_NAMES {
855
855
  let en_142: string;
856
856
  export { en_142 as en };
857
857
  }
858
+ namespace Flex {
859
+ let zh_143: string;
860
+ export { zh_143 as zh };
861
+ let en_143: string;
862
+ export { en_143 as en };
863
+ }
858
864
  }
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ interface ToArrayOptions {
3
+ keepEmpty?: boolean;
4
+ }
5
+ declare function toArray(children: React.ReactNode, options?: ToArrayOptions): React.ReactElement[];
6
+ export { toArray };
7
+ export default toArray;
@@ -2,8 +2,6 @@ import { CSSProperties, ReactNode } from 'react';
2
2
  import { InputProps } from '../input';
3
3
  /**
4
4
  * @title VerificationCode
5
- * @zh `2.55.0` 支持
6
- * @en 2.55.0
7
5
  */
8
6
  export interface VerificationCodeProps {
9
7
  style?: CSSProperties;
@@ -1,8 +1,6 @@
1
1
  import { CSSProperties, ReactNode } from 'react';
2
2
  /**
3
3
  * @title Watermark
4
- * @zh `2.56.0` 支持
5
- * @en 2.56.0
6
4
  */
7
5
  export interface WatermarkProps {
8
6
  style?: CSSProperties;
@@ -1,34 +1,34 @@
1
- import { jsx as p, jsxs as ie, Fragment as re } from "react/jsx-runtime";
2
- import le from "lodash/merge";
3
- import R, { forwardRef as pe, useContext as ce, useRef as W, useState as q, useEffect as ae, useImperativeHandle as me } from "react";
1
+ import { jsx as p, jsxs as ne, Fragment as ie } from "react/jsx-runtime";
2
+ import re from "lodash/merge";
3
+ import _, { forwardRef as le, useContext as pe, useRef as ce, useState as W, useEffect as ae, useImperativeHandle as me } from "react";
4
4
  import "../config-provider/ConfigProvider.js";
5
5
  import de from "../components/common/hooks/useMergeValue.js";
6
6
  import fe from "../components/common/hooks/useUpdateEffect.js";
7
7
  import ue from "../popover/index.js";
8
8
  import he from "../tooltip/index.js";
9
- import F from "@unicom-cloud/utils/class-name";
9
+ import q from "@unicom-cloud/utils/class-name";
10
10
  import "../components/common/utils/is.js";
11
11
  import { mergedToString as Ee } from "../components/common/utils/mergedToString.js";
12
12
  import { omit as ge } from "../components/common/utils/omit.js";
13
13
  import { resizeObserver as Ce } from "../components/common/utils/resizeObserver.js";
14
14
  import { throttleByRaf as xe } from "../components/common/utils/throttleByRaf.js";
15
15
  import Te from "./EditContent.js";
16
- import Ne from "./Operations.js";
17
- import Se from "./useCssEllipsis.js";
18
- import be, { MEASURE_STATUS as O } from "./useEllipsis.js";
16
+ import Se from "./Operations.js";
17
+ import Ne from "./useCssEllipsis.js";
18
+ import be, { MEASURE_STATUS as A } from "./useEllipsis.js";
19
19
  import we from "../config-provider/context.js";
20
- import { isPlainObject as x, isUndefined as L } from "@unicom-cloud/utils/is";
20
+ import { isPlainObject as x, isUndefined as F } from "@unicom-cloud/utils/is";
21
21
  function ye(s, f) {
22
22
  const {
23
23
  type: c,
24
- bold: b,
24
+ bold: w,
25
25
  disabled: T,
26
26
  mark: u,
27
- underline: N,
27
+ underline: S,
28
28
  delete: a,
29
- code: w
29
+ code: y
30
30
  } = s, l = [], h = [];
31
- return c && h.push(`${f}-${c}`), T && h.push(`${f}-disabled`), b && l.push("b"), N && l.push("u"), a && l.push("del"), w && l.push("code"), u && l.push("mark"), {
31
+ return c && h.push(`${f}-${c}`), T && h.push(`${f}-disabled`), w && l.push("b"), S && l.push("u"), a && l.push("del"), y && l.push("code"), u && l.push("mark"), {
32
32
  component: l,
33
33
  className: h
34
34
  };
@@ -36,100 +36,100 @@ function ye(s, f) {
36
36
  function $e(s, f) {
37
37
  const {
38
38
  componentType: c,
39
- style: b,
39
+ style: w,
40
40
  className: T,
41
41
  children: u,
42
- editable: N,
42
+ editable: S,
43
43
  ellipsis: a,
44
- heading: w,
44
+ heading: y,
45
45
  blockquote: l,
46
46
  ...h
47
- } = s, _ = ce(we), { getPrefixCls: V, rtl: A } = _, n = V?.("typography"), I = W(), { component: S, className: M } = ye(s, n), [H, U] = q(!1), [G, J] = q(0), y = x(N) ? N : {}, K = "editing" in y ? y.editing : H, e = a ? {
47
+ } = s, I = pe(we), { getPrefixCls: L, rtl: O } = I, n = L?.("typography"), N = ce(null), { component: b, className: U } = ye(s, n), [V, z] = W(!1), [H, G] = W(0), $ = x(S) ? S : {}, J = "editing" in $ ? $.editing : V, D = "...", e = a ? {
48
48
  rows: 1,
49
- ellipsisStr: "...",
49
+ ellipsisStr: D,
50
50
  cssEllipsis: !1,
51
51
  ...x(a) ? a : {}
52
- } : {}, Q = e.wrapper || R.Fragment, [i, X] = de(!1, {
52
+ } : {}, K = e.wrapper || _.Fragment, [i, Q] = de(!1, {
53
53
  defaultValue: e.defaultExpanded,
54
54
  value: e.expanded
55
- }), { simpleEllipsis: $, ellipsisStyle: Y } = Se(e), z = (t, o) => {
56
- const r = L(e.ellipsisStr) ? "..." : e.ellipsisStr, d = !L(e.suffix) && e.suffix;
57
- return /* @__PURE__ */ ie(Q, { children: [
55
+ }), { simpleEllipsis: k, ellipsisStyle: X } = Ne(e), M = (t, o) => {
56
+ const r = F(e.ellipsisStr) ? D : e.ellipsisStr, d = !F(e.suffix) && e.suffix;
57
+ return /* @__PURE__ */ ne(K, { children: [
58
58
  t,
59
- o && !i && !$ ? r : "",
59
+ o && !i && !k ? r : "",
60
60
  d,
61
- te(o)
61
+ ee(o)
62
62
  ] });
63
- }, { ellipsisNode: Z, isEllipsis: m, measureStatus: D } = be({
63
+ }, { ellipsisNode: Y, isEllipsis: m, measureStatus: j } = be({
64
64
  ...e,
65
65
  children: u,
66
66
  expanding: i,
67
- width: G,
68
- renderMeasureContent: z,
69
- simpleEllipsis: $ || i
70
- }), ee = xe((t) => {
67
+ width: H,
68
+ renderMeasureContent: M,
69
+ simpleEllipsis: k || i
70
+ }), Z = xe((t) => {
71
71
  const { contentRect: o } = t?.[0];
72
72
  if (o) {
73
- const r = S.includes("code") ? o.width - 18 : o.width;
73
+ const r = b.includes("code") ? o.width - 18 : o.width;
74
74
  [
75
- O.NO_NEED_ELLIPSIS,
76
- O.MEASURE_END
77
- ].includes(D) && J(r);
75
+ A.NO_NEED_ELLIPSIS,
76
+ A.MEASURE_END
77
+ ].includes(j) && G(r);
78
78
  }
79
- }), j = W(null);
79
+ });
80
80
  ae(() => {
81
- const t = Ce([j.current], ee);
81
+ const t = Ce([N.current], Z);
82
82
  return () => {
83
83
  t();
84
84
  };
85
- }, [j.current]);
86
- function te(t) {
87
- return /* @__PURE__ */ p(re, { children: /* @__PURE__ */ p(
88
- Ne,
85
+ }, [N.current]);
86
+ function ee(t) {
87
+ return /* @__PURE__ */ p(ie, { children: /* @__PURE__ */ p(
88
+ Se,
89
89
  {
90
90
  ...s,
91
- setEditing: U,
92
- onClickExpand: oe,
91
+ setEditing: z,
92
+ onClickExpand: te,
93
93
  expanding: i,
94
94
  isEllipsis: t,
95
- currentContext: _
95
+ currentContext: I
96
96
  }
97
97
  ) });
98
98
  }
99
- function oe(t) {
100
- X(!i), s.onClickExpand?.(t), e.onExpand?.(!i, t);
99
+ function te(t) {
100
+ Q(!i), s.onClickExpand?.(t), e.onExpand?.(!i, t);
101
101
  }
102
102
  fe(() => {
103
103
  e.onEllipsis?.(m);
104
- }, [m]), me(f, () => I.current);
104
+ }, [m]), me(f, () => N.current);
105
105
  function B(t, o, r, d = {}) {
106
106
  let g = t;
107
- return o.forEach((k, P) => {
108
- const v = { className: `${n}-${k}` }, C = P === 0 ? d : {}, ne = x(r.mark) && r.mark.color ? { style: { backgroundColor: r.mark.color }, ...C } : { ...C };
109
- g = R.createElement(
110
- k,
111
- le({ ...ne }, v),
107
+ return o.forEach((P, v) => {
108
+ const R = { className: `${n}-${P}` }, C = v === 0 ? d : {}, se = x(r.mark) && r.mark.color ? { style: { backgroundColor: r.mark.color }, ...C } : { ...C };
109
+ g = _.createElement(
110
+ P,
111
+ re({ ...se }, R),
112
112
  g
113
113
  );
114
114
  }), g;
115
115
  }
116
116
  let E;
117
- c === "Paragraph" ? E = l ? "blockquote" : "div" : c === "Title" ? E = `h${w}` : c === "Text" && (E = a ? "div" : "span");
118
- function se() {
119
- const t = Ee(R.Children.toArray(u)), o = e.showTooltip, r = x(e.showTooltip) && e.showTooltip.type === "popover" ? "popover" : "tooltip", d = x(e.showTooltip) ? e.showTooltip.props || {} : {}, g = r === "popover" ? ue : he, P = {
120
- style: b,
117
+ c === "Paragraph" ? E = l ? "blockquote" : "div" : c === "Title" ? E = `h${y}` : c === "Text" && (E = a ? "div" : "span");
118
+ function oe() {
119
+ const t = Ee(_.Children.toArray(u)), o = e.showTooltip, r = x(e.showTooltip) && e.showTooltip.type === "popover" ? "popover" : "tooltip", d = x(e.showTooltip) ? e.showTooltip.props || {} : {}, g = r === "popover" ? ue : he, v = {
120
+ style: w,
121
121
  ...m && !o && !i ? { title: t } : {}
122
- }, v = m && o && !i, C = /* @__PURE__ */ p(
122
+ }, R = m && o && !i, C = /* @__PURE__ */ p(
123
123
  E,
124
124
  {
125
- ref: I,
126
- className: F(
125
+ ref: N,
126
+ className: q(
127
127
  n,
128
- M,
129
- { [`${n}-rtl`]: A },
128
+ U,
129
+ { [`${n}-rtl`]: O },
130
130
  T
131
131
  ),
132
- ...P,
132
+ ...v,
133
133
  ...ge(h, [
134
134
  "spacing",
135
135
  "type",
@@ -147,41 +147,41 @@ function $e(s, f) {
147
147
  "setEditing",
148
148
  "forceShowExpand"
149
149
  ]),
150
- children: $ && D !== O.INIT && !i && m ? B(
150
+ children: k && j !== A.INIT && !i && m ? B(
151
151
  // CSS folding style, need to wrap the text separately.
152
- z(
153
- /* @__PURE__ */ p("span", { style: Y, children: u }),
152
+ M(
153
+ /* @__PURE__ */ p("span", { style: X, children: u }),
154
154
  m
155
155
  ),
156
- S.length ? S : ["span"],
156
+ b.length ? b : ["span"],
157
157
  s,
158
158
  // The simple-ellipsis class ensures that the ReactNode after the text is displayed correctly (no line breaks)
159
159
  // Need to act on the immediate parent node of the text
160
160
  { className: `${n}-simple-ellipsis` }
161
- ) : B(Z, S, s)
161
+ ) : B(Y, b, s)
162
162
  }
163
163
  );
164
- return v ? /* @__PURE__ */ p(g, { content: t, ...d, children: /* @__PURE__ */ p("span", { children: C }) }) : C;
164
+ return R ? /* @__PURE__ */ p(g, { content: t, ...d, children: /* @__PURE__ */ p("span", { children: C }) }) : C;
165
165
  }
166
- return K ? /* @__PURE__ */ p(
166
+ return J ? /* @__PURE__ */ p(
167
167
  Te,
168
168
  {
169
169
  ref: f,
170
170
  ...s,
171
- className: F(
171
+ className: q(
172
172
  n,
173
- M,
174
- { [`${n}-rtl`]: A },
173
+ U,
174
+ { [`${n}-rtl`]: O },
175
175
  `${n}-${E}`,
176
176
  T
177
177
  ),
178
178
  prefixCls: n,
179
- setEditing: U,
180
- editableConfig: y
179
+ setEditing: z,
180
+ editableConfig: $
181
181
  }
182
- ) : se();
182
+ ) : oe();
183
183
  }
184
- const Ge = pe($e);
184
+ const Ge = le($e);
185
185
  export {
186
186
  Ge as default
187
187
  };