@alifd/chat 0.3.40-beta.0 → 0.3.40-beta.2

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 (241) hide show
  1. package/es/ai-loading/types.d.ts +1 -0
  2. package/es/button/button.d.ts +1 -2
  3. package/es/button/button.js +13 -19
  4. package/es/button/group.js +5 -42
  5. package/es/button/main.scss +36 -77
  6. package/es/card/main.scss +1 -1
  7. package/es/checkbox-group/main.scss +6 -7
  8. package/es/checkbox-group/types.d.ts +6 -0
  9. package/es/code-view/index.d.ts +11 -0
  10. package/es/code-view/index.js +63 -0
  11. package/es/code-view/main.scss +54 -0
  12. package/es/code-view/style.d.ts +4 -0
  13. package/es/code-view/style.js +4 -0
  14. package/es/code-view/types.d.ts +27 -0
  15. package/es/code-view/types.js +1 -0
  16. package/es/collapse/index.d.ts +157 -0
  17. package/es/collapse/index.js +20 -0
  18. package/es/collapse/main.scss +97 -0
  19. package/es/collapse/style.d.ts +2 -0
  20. package/es/collapse/style.js +2 -0
  21. package/es/collapse/types.d.ts +82 -0
  22. package/es/collapse/types.js +2 -0
  23. package/es/core/variables.scss +27 -12
  24. package/es/date-picker/DatePicker.d.ts +5 -0
  25. package/es/date-picker/DatePicker.js +15 -0
  26. package/es/date-picker/MonthPicker.d.ts +4 -0
  27. package/es/date-picker/MonthPicker.js +15 -0
  28. package/es/date-picker/RangePicker.d.ts +4 -0
  29. package/es/date-picker/RangePicker.js +17 -0
  30. package/es/date-picker/YearPicker.d.ts +4 -0
  31. package/es/date-picker/YearPicker.js +15 -0
  32. package/es/date-picker/index.d.ts +5 -23
  33. package/es/date-picker/index.js +11 -29
  34. package/es/date-picker/main.scss +23 -1
  35. package/es/date-picker/style.d.ts +1 -0
  36. package/es/date-picker/style.js +1 -0
  37. package/es/date-picker/types.d.ts +161 -81
  38. package/es/float-button/hooks/useAutoAlign.d.ts +1 -1
  39. package/es/form/style.d.ts +0 -1
  40. package/es/form/style.js +2 -1
  41. package/es/form/types.d.ts +3 -517
  42. package/es/form/types.js +5 -1
  43. package/es/html-render/index.d.ts +1 -1
  44. package/es/html-render/index.js +118 -106
  45. package/es/html-render/main.scss +27 -8
  46. package/es/html-render/style.d.ts +1 -0
  47. package/es/html-render/style.js +1 -0
  48. package/es/icon/index.d.ts +1 -1
  49. package/es/index.d.ts +3 -0
  50. package/es/index.js +4 -1
  51. package/es/input/index.d.ts +1 -1
  52. package/es/input/index.js +16 -6
  53. package/es/input/main.scss +25 -0
  54. package/es/input/style.d.ts +1 -0
  55. package/es/input/style.js +1 -0
  56. package/es/input/types.d.ts +58 -15
  57. package/es/markdown/index.d.ts +1 -2
  58. package/es/markdown/index.js +26 -15
  59. package/es/markdown/main.scss +4 -3
  60. package/es/markdown/style.d.ts +2 -1
  61. package/es/markdown/style.js +2 -1
  62. package/es/markdown/types.d.ts +20 -9
  63. package/es/message/index.d.ts +4 -4
  64. package/es/person-picker/index.d.ts +3 -190
  65. package/es/person-picker/index.js +23 -21
  66. package/es/person-picker/main.scss +15 -1
  67. package/es/person-picker/types.d.ts +53 -11
  68. package/es/radio-group/index.d.ts +1 -1
  69. package/es/radio-group/index.js +9 -3
  70. package/es/radio-group/main.scss +13 -5
  71. package/es/radio-group/types.d.ts +5 -3
  72. package/es/reference/index.d.ts +1 -1
  73. package/es/reference/index.js +14 -15
  74. package/es/reference/main.scss +1 -1
  75. package/es/reference/types.d.ts +1 -0
  76. package/es/select/button.d.ts +3 -0
  77. package/es/select/button.js +70 -0
  78. package/es/select/index.d.ts +79 -79
  79. package/es/select/index.js +13 -57
  80. package/es/select/main.scss +22 -4
  81. package/es/select/types.d.ts +108 -1
  82. package/es/step/index.js +2 -2
  83. package/es/step/main.scss +115 -66
  84. package/es/step/types.d.ts +13 -2
  85. package/es/table/index.d.ts +12 -0
  86. package/es/table/index.js +23 -0
  87. package/es/table/main.scss +30 -0
  88. package/es/table/style.d.ts +2 -0
  89. package/es/table/style.js +2 -0
  90. package/es/table/types.d.ts +98 -0
  91. package/es/table/types.js +1 -0
  92. package/es/tag/index.d.ts +5 -3
  93. package/es/tag/index.js +18 -2
  94. package/es/tag/main.scss +20 -4
  95. package/es/tag/types.d.ts +55 -0
  96. package/es/text/index.js +1 -1
  97. package/es/text/main.scss +4 -1
  98. package/es/text/types.d.ts +8 -0
  99. package/es/time-picker/index.d.ts +6 -15
  100. package/es/time-picker/index.js +71 -24
  101. package/es/time-picker/main.scss +19 -1
  102. package/es/time-picker/style.d.ts +1 -0
  103. package/es/time-picker/style.js +1 -0
  104. package/es/time-picker/types.d.ts +133 -8
  105. package/es/tool-status/index.d.ts +1 -1
  106. package/es/tool-status/index.js +1 -1
  107. package/es/tool-status/main.scss +2 -1
  108. package/es/tool-status/types.d.ts +7 -2
  109. package/es/utils/func.d.ts +1 -0
  110. package/es/utils/func.js +13 -0
  111. package/es/utils/github-dark.scss +137 -0
  112. package/es/utils/github.scss +137 -0
  113. package/es/utils/hoc/main.scss +166 -0
  114. package/es/utils/hoc/withLabel.d.ts +94 -0
  115. package/es/utils/hoc/withLabel.js +57 -0
  116. package/es/utils/index.d.ts +1 -0
  117. package/es/utils/index.js +1 -0
  118. package/lib/ai-loading/types.d.ts +1 -0
  119. package/lib/button/button.d.ts +1 -2
  120. package/lib/button/button.js +13 -19
  121. package/lib/button/group.js +4 -41
  122. package/lib/button/main.scss +36 -77
  123. package/lib/card/main.scss +1 -1
  124. package/lib/checkbox-group/main.scss +6 -7
  125. package/lib/checkbox-group/types.d.ts +6 -0
  126. package/lib/code-view/index.d.ts +11 -0
  127. package/lib/code-view/index.js +66 -0
  128. package/lib/code-view/main.scss +54 -0
  129. package/lib/code-view/style.d.ts +4 -0
  130. package/lib/code-view/style.js +6 -0
  131. package/lib/code-view/types.d.ts +27 -0
  132. package/lib/code-view/types.js +2 -0
  133. package/lib/collapse/index.d.ts +157 -0
  134. package/lib/collapse/index.js +22 -0
  135. package/lib/collapse/main.scss +97 -0
  136. package/lib/collapse/style.d.ts +2 -0
  137. package/lib/collapse/style.js +4 -0
  138. package/lib/collapse/types.d.ts +82 -0
  139. package/lib/collapse/types.js +3 -0
  140. package/lib/core/variables.scss +27 -12
  141. package/lib/date-picker/DatePicker.d.ts +5 -0
  142. package/lib/date-picker/DatePicker.js +17 -0
  143. package/lib/date-picker/MonthPicker.d.ts +4 -0
  144. package/lib/date-picker/MonthPicker.js +17 -0
  145. package/lib/date-picker/RangePicker.d.ts +4 -0
  146. package/lib/date-picker/RangePicker.js +19 -0
  147. package/lib/date-picker/YearPicker.d.ts +4 -0
  148. package/lib/date-picker/YearPicker.js +17 -0
  149. package/lib/date-picker/index.d.ts +5 -23
  150. package/lib/date-picker/index.js +10 -27
  151. package/lib/date-picker/main.scss +23 -1
  152. package/lib/date-picker/style.d.ts +1 -0
  153. package/lib/date-picker/style.js +1 -0
  154. package/lib/date-picker/types.d.ts +161 -81
  155. package/lib/float-button/hooks/useAutoAlign.d.ts +1 -1
  156. package/lib/form/style.d.ts +0 -1
  157. package/lib/form/style.js +1 -2
  158. package/lib/form/types.d.ts +3 -517
  159. package/lib/form/types.js +4 -1
  160. package/lib/html-render/index.d.ts +1 -1
  161. package/lib/html-render/index.js +118 -106
  162. package/lib/html-render/main.scss +27 -8
  163. package/lib/html-render/style.d.ts +1 -0
  164. package/lib/html-render/style.js +1 -0
  165. package/lib/icon/index.d.ts +1 -1
  166. package/lib/index.d.ts +3 -0
  167. package/lib/index.js +8 -2
  168. package/lib/input/index.d.ts +1 -1
  169. package/lib/input/index.js +16 -6
  170. package/lib/input/main.scss +25 -0
  171. package/lib/input/style.d.ts +1 -0
  172. package/lib/input/style.js +1 -0
  173. package/lib/input/types.d.ts +58 -15
  174. package/lib/markdown/index.d.ts +1 -2
  175. package/lib/markdown/index.js +26 -15
  176. package/lib/markdown/main.scss +4 -3
  177. package/lib/markdown/style.d.ts +2 -1
  178. package/lib/markdown/style.js +2 -1
  179. package/lib/markdown/types.d.ts +20 -9
  180. package/lib/message/index.d.ts +4 -4
  181. package/lib/person-picker/index.d.ts +3 -190
  182. package/lib/person-picker/index.js +22 -20
  183. package/lib/person-picker/main.scss +15 -1
  184. package/lib/person-picker/types.d.ts +53 -11
  185. package/lib/radio-group/index.d.ts +1 -1
  186. package/lib/radio-group/index.js +8 -2
  187. package/lib/radio-group/main.scss +13 -5
  188. package/lib/radio-group/types.d.ts +5 -3
  189. package/lib/reference/index.d.ts +1 -1
  190. package/lib/reference/index.js +17 -18
  191. package/lib/reference/main.scss +1 -1
  192. package/lib/reference/types.d.ts +1 -0
  193. package/lib/select/button.d.ts +3 -0
  194. package/lib/select/button.js +74 -0
  195. package/lib/select/index.d.ts +79 -79
  196. package/lib/select/index.js +11 -55
  197. package/lib/select/main.scss +22 -4
  198. package/lib/select/types.d.ts +108 -1
  199. package/lib/step/index.js +2 -2
  200. package/lib/step/main.scss +115 -66
  201. package/lib/step/types.d.ts +13 -2
  202. package/lib/table/index.d.ts +12 -0
  203. package/lib/table/index.js +25 -0
  204. package/lib/table/main.scss +30 -0
  205. package/lib/table/style.d.ts +2 -0
  206. package/lib/table/style.js +4 -0
  207. package/lib/table/types.d.ts +98 -0
  208. package/lib/table/types.js +2 -0
  209. package/lib/tag/index.d.ts +5 -3
  210. package/lib/tag/index.js +17 -1
  211. package/lib/tag/main.scss +20 -4
  212. package/lib/tag/types.d.ts +55 -0
  213. package/lib/text/index.js +1 -1
  214. package/lib/text/main.scss +4 -1
  215. package/lib/text/types.d.ts +8 -0
  216. package/lib/time-picker/index.d.ts +6 -15
  217. package/lib/time-picker/index.js +71 -23
  218. package/lib/time-picker/main.scss +19 -1
  219. package/lib/time-picker/style.d.ts +1 -0
  220. package/lib/time-picker/style.js +1 -0
  221. package/lib/time-picker/types.d.ts +133 -8
  222. package/lib/tool-status/index.d.ts +1 -1
  223. package/lib/tool-status/index.js +1 -1
  224. package/lib/tool-status/main.scss +2 -1
  225. package/lib/tool-status/types.d.ts +7 -2
  226. package/lib/utils/func.d.ts +1 -0
  227. package/lib/utils/func.js +15 -0
  228. package/lib/utils/github-dark.scss +137 -0
  229. package/lib/utils/github.scss +137 -0
  230. package/lib/utils/hoc/main.scss +166 -0
  231. package/lib/utils/hoc/withLabel.d.ts +94 -0
  232. package/lib/utils/hoc/withLabel.js +60 -0
  233. package/lib/utils/index.d.ts +1 -0
  234. package/lib/utils/index.js +1 -0
  235. package/package.json +49 -4
  236. package/es/form/index.d.ts +0 -23
  237. package/es/form/index.js +0 -33
  238. package/es/form/main.scss +0 -5
  239. package/lib/form/index.d.ts +0 -23
  240. package/lib/form/index.js +0 -35
  241. package/lib/form/main.scss +0 -5
package/es/tag/main.scss CHANGED
@@ -2,8 +2,24 @@
2
2
  @import "../core/variables.scss";
3
3
 
4
4
  .#{$prefix}tag {
5
-
6
- &.#{$prefix}tag {
7
- border-color: transparent;
8
- }
5
+ &.#{$prefix}tag {
6
+ border-color: transparent;
7
+ }
9
8
  }
9
+
10
+ .#{$prefix}tag-group {
11
+ display: inline-flex;
12
+ align-items: center;
13
+ gap: var(--s-2, 8px);
14
+ padding-left: var(--s-2, 8px);
15
+ flex-wrap: wrap;
16
+
17
+ &-medium {
18
+ margin: 3px 0;
19
+ }
20
+
21
+ &.#{$prefix}field-wrapper-horizontal {
22
+ display: flex;
23
+ align-items: center;
24
+ }
25
+ }
package/es/tag/types.d.ts CHANGED
@@ -1,6 +1,61 @@
1
+ import type * as React from 'react';
1
2
  import type { TagCurrentProps as FusionTagProps } from '@alifd/next/types/tag/types';
2
3
  /**
3
4
  * @api Tag
4
5
  */
5
6
  export interface TagProps extends FusionTagProps {
6
7
  }
8
+ export interface TagItem {
9
+ /**
10
+ * 标签内容
11
+ * @en Tag content
12
+ */
13
+ label: React.ReactNode;
14
+ /**
15
+ * 标签类型
16
+ * @en Tag type
17
+ */
18
+ type?: 'normal' | 'primary';
19
+ /**
20
+ * 标签颜色
21
+ * @en Tag color
22
+ */
23
+ color?: string;
24
+ /**
25
+ * 是否可关闭
26
+ * @en Whether the tag is closable
27
+ */
28
+ closable?: boolean;
29
+ /**
30
+ * 标签尺寸
31
+ * @en Tag size
32
+ */
33
+ size?: 'small' | 'medium' | 'large';
34
+ }
35
+ /**
36
+ * @api TagGroup
37
+ */
38
+ export interface TagGroupProps extends React.HTMLAttributes<HTMLDivElement> {
39
+ /**
40
+ * 标签数据源
41
+ * @en Data source for tags
42
+ */
43
+ dataSource?: TagItem[];
44
+ /**
45
+ * 标签被关闭时的回调
46
+ * @en Callback when tag is closed
47
+ */
48
+ onClose?: (item: TagItem, index: number) => void;
49
+ /**
50
+ * 标签组中的标签列表
51
+ * @en Tags in the group
52
+ */
53
+ children?: React.ReactNode;
54
+ /**
55
+ * 标签组尺寸
56
+ * @en Size of the tag group
57
+ * @defaultValue 'medium'
58
+ * @remarks 可选值:'small' | 'medium' | 'large'
59
+ */
60
+ size?: 'small' | 'medium' | 'large';
61
+ }
package/es/text/index.js CHANGED
@@ -119,7 +119,7 @@ function useCollapseText({ enable, boxRef, textRef, maxLine, placeholder = '...'
119
119
  return;
120
120
  }
121
121
  const lineHeight = getLineHeight(text);
122
- const newCanCollapse = box.offsetHeight > maxLine * lineHeight;
122
+ const newCanCollapse = box.offsetHeight > maxLine * lineHeight + 2;
123
123
  if (canCollapse !== newCanCollapse) {
124
124
  setCanCollapse(newCanCollapse);
125
125
  }
package/es/text/main.scss CHANGED
@@ -1,7 +1,10 @@
1
1
  @import '../core/variables.scss';
2
2
 
3
3
  .#{$prefix}text {
4
- display: inline-block;
4
+ line-height: var(--common-text-line-height);
5
+ vertical-align: middle;
6
+ display: flex;
7
+ color: var(--color-text1-4, #333333);
5
8
 
6
9
  &-inner {
7
10
  }
@@ -1,6 +1,14 @@
1
1
  import type { HTMLAttributes, ReactElement, ReactNode } from 'react';
2
2
  export type HTMLAttributesWeak = Omit<HTMLAttributes<HTMLDivElement>, 'children'>;
3
+ /**
4
+ * 触发类型
5
+ * @api
6
+ */
3
7
  export type TriggerType = 'click' | 'hover';
8
+ /**
9
+ * 文本组件属性
10
+ * @api
11
+ */
4
12
  export interface TextProps extends HTMLAttributesWeak {
5
13
  maxLine?: number;
6
14
  visible?: boolean;
@@ -2,22 +2,13 @@
2
2
  * @component 时间选择器
3
3
  * @en TimePicker
4
4
  * @type 通用 - General
5
- * @remarks 同 Next TimePicker,按钮用于开始一个即时操作。- Same as Next.Button, Button used to trigger an action.
6
- * @when 标记一个(或封装一组)操作命令,响应用户点击行为,触发相应的业务逻辑。- Buttons are used for emphasizing important functions on your page.
7
- * @others
8
- * ## 无障碍键盘操作指南
9
- * | 按键 | 说明 |
10
- * | :---- | :---------- |
11
- * | Enter | 触发 onClick 事件 |
12
- * | SPACE | 触发 onClick 事件 |
13
- * @othersEn
14
- * ## ARIA and KeyBoard
15
- * | KeyBoard | Description |
16
- * | :---------- | :------------------------------ |
17
- * | Enter | Trigger the onClick event |
18
- * | SPACE | Trigger the onClick event |
19
5
  */
20
6
  import React from 'react';
7
+ import type { RangePickerProps, TimePickerProps } from './types';
8
+ declare const RangePicker: React.ForwardRefExoticComponent<Pick<Omit<RangePickerProps, "label" | "required"> & React.RefAttributes<HTMLDivElement> & import("../utils").WithLabelProps, "title" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoCapitalize" | "autoFocus" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "nonce" | "placeholder" | "slot" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "content" | "datatype" | "inlist" | "prefix" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "exportparts" | "part" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocusCapture" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "warning" | "pure" | "rtl" | "device" | "locale" | "key" | "errorBoundary" | keyof import("../utils").WithLabelProps | "value" | "format" | "mode" | "disabledTime" | "hourStep" | "minuteStep" | "secondStep"> & React.RefAttributes<any>>;
21
9
  export * from './types';
22
- declare const _default: import("@alifd/next/types/config-provider/types").ConfiguredComponentClass<Pick<Pick<any, string | number | symbol> & React.RefAttributes<any>, string | number | symbol> & import("@alifd/next/types/config-provider/types").ComponentCommonProps, any, {}>;
10
+ export { RangePicker };
11
+ declare const _default: import("@alifd/next/types/config-provider/types").ConfiguredComponentClass<Pick<Pick<Omit<TimePickerProps, "label" | "required"> & React.RefAttributes<HTMLDivElement> & import("../utils").WithLabelProps, "title" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoCapitalize" | "autoFocus" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "nonce" | "placeholder" | "slot" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "content" | "datatype" | "inlist" | "prefix" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "exportparts" | "part" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocusCapture" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "warning" | "pure" | "rtl" | "device" | "locale" | "key" | "errorBoundary" | keyof import("../utils").WithLabelProps | "value" | "format" | "mode" | "disabledTime" | "hourStep" | "minuteStep" | "secondStep"> & React.RefAttributes<any>, "title" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoCapitalize" | "autoFocus" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "nonce" | "placeholder" | "slot" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "content" | "datatype" | "inlist" | "prefix" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "exportparts" | "part" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocusCapture" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "warning" | "pure" | "rtl" | "device" | "locale" | "key" | "errorBoundary" | keyof import("../utils").WithLabelProps | "value" | "format" | "mode" | "disabledTime" | "hourStep" | "minuteStep" | "secondStep"> & import("@alifd/next/types/config-provider/types").ComponentCommonProps, any, {}> & {
12
+ RangePicker: React.ForwardRefExoticComponent<Pick<Omit<RangePickerProps, "label" | "required"> & React.RefAttributes<HTMLDivElement> & import("../utils").WithLabelProps, "title" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoCapitalize" | "autoFocus" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "nonce" | "placeholder" | "slot" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "content" | "datatype" | "inlist" | "prefix" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "exportparts" | "part" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocusCapture" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "warning" | "pure" | "rtl" | "device" | "locale" | "key" | "errorBoundary" | keyof import("../utils").WithLabelProps | "value" | "format" | "mode" | "disabledTime" | "hourStep" | "minuteStep" | "secondStep"> & React.RefAttributes<any>>;
13
+ };
23
14
  export default _default;
@@ -2,34 +2,16 @@
2
2
  * @component 时间选择器
3
3
  * @en TimePicker
4
4
  * @type 通用 - General
5
- * @remarks 同 Next TimePicker,按钮用于开始一个即时操作。- Same as Next.Button, Button used to trigger an action.
6
- * @when 标记一个(或封装一组)操作命令,响应用户点击行为,触发相应的业务逻辑。- Buttons are used for emphasizing important functions on your page.
7
- * @others
8
- * ## 无障碍键盘操作指南
9
- * | 按键 | 说明 |
10
- * | :---- | :---------- |
11
- * | Enter | 触发 onClick 事件 |
12
- * | SPACE | 触发 onClick 事件 |
13
- * @othersEn
14
- * ## ARIA and KeyBoard
15
- * | KeyBoard | Description |
16
- * | :---------- | :------------------------------ |
17
- * | Enter | Trigger the onClick event |
18
- * | SPACE | Trigger the onClick event |
19
5
  */
20
6
  import { __rest } from "tslib";
21
7
  import React, { forwardRef } from 'react';
22
8
  import { TimePicker2 as NextTimePicker2, Select as NextSelect, ConfigProvider } from '@alifd/next';
23
9
  import cs from 'classnames';
24
10
  import dayjs from 'dayjs';
25
- import { PREFIX_DEFAULT, assignSubComponent } from '../utils';
26
- // Todo: ComponentInstance CombinedProps 类型补全
27
- // type ComponentInstance = InstanceType<typeof NextTimePicker> | InstanceType<typeof NextSelect>;
28
- // type CombinedProps = TimePickerProps & SelectProps & {
29
- // mode: 'timePicker' | 'select';
30
- // };
31
- const TimePicker = forwardRef((_a, ref) => {
32
- var { className, size = 'small', mode = 'normal' } = _a, props = __rest(_a, ["className", "size", "mode"]);
11
+ import { PREFIX_DEFAULT, assignSubComponent, withLabel } from '../utils';
12
+ const BasePicker = forwardRef((_a) => {
13
+ var _b;
14
+ var { className, size = 'medium', mode = 'normal' } = _a, props = __rest(_a, ["className", "size", "mode"]);
33
15
  const getTimeArray = () => {
34
16
  const now = dayjs();
35
17
  const TODAY = now.hour(0).minute(0).second(0);
@@ -66,14 +48,79 @@ const TimePicker = forwardRef((_a, ref) => {
66
48
  };
67
49
  if (mode === 'dingtalk') {
68
50
  const { format, hourStep, minuteStep, secondStep, disabledTime } = props, otherProps = __rest(props, ["format", "hourStep", "minuteStep", "secondStep", "disabledTime"]);
69
- return (React.createElement(NextSelect, Object.assign({}, otherProps, { className: cs(`${PREFIX_DEFAULT}time-picker2`, className), value: formatSelectValue(), size: size, ref: ref }), getTimeArray().map((time, index) => (React.createElement(NextSelect.Option, { disabled: disabledTime ? disabledTime(time.value) : false, value: time.value, key: index }, time.label)))));
51
+ return (React.createElement(NextSelect, Object.assign({}, otherProps, { className: cs(`${PREFIX_DEFAULT}time-picker2`, className), value: formatSelectValue(),
52
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
53
+ onChange: props.onChange,
54
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
55
+ defaultValue: props.defaultValue, state: props.state !== 'warning' && props.state ? props.state : undefined, size: size }), (_b = getTimeArray()) === null || _b === void 0 ? void 0 : _b.map((time, index) => (React.createElement(NextSelect.Option, { disabled: disabledTime ? disabledTime(time.value) : false, value: time.value, key: index }, time.label)))));
70
56
  }
71
57
  else {
72
- return (React.createElement(NextTimePicker2, Object.assign({}, props, { className: cs(`${PREFIX_DEFAULT}time-picker2`, className), size: size, ref: ref })));
58
+ return (React.createElement(NextTimePicker2
59
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
60
+ , Object.assign({}, props, { className: cs(`${PREFIX_DEFAULT}time-picker2`, className), size: size,
61
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
62
+ defaultValue: props.defaultValue, state: props.state })));
73
63
  }
74
64
  });
65
+ const BaseRangePicker = forwardRef((_a) => {
66
+ var _b;
67
+ var { className, size = 'medium', mode = 'normal', state } = _a, props = __rest(_a, ["className", "size", "mode", "state"]);
68
+ const getTimeArray = () => {
69
+ const now = dayjs();
70
+ const TODAY = now.hour(0).minute(0).second(0);
71
+ const TOMORROW = dayjs(TODAY).add(1, 'day');
72
+ const { format = 'HH:mm', hourStep = 0, minuteStep = 0, secondStep = 0, } = props;
73
+ let todayClone = dayjs(TODAY);
74
+ const timeArray = [];
75
+ while (todayClone.isBefore(TOMORROW)) {
76
+ timeArray.push({
77
+ label: todayClone.format(format),
78
+ value: todayClone.format(format),
79
+ });
80
+ if (hourStep > 0) {
81
+ todayClone = todayClone.add(hourStep, 'hour');
82
+ }
83
+ else if (minuteStep > 0) {
84
+ todayClone = todayClone.add(minuteStep, 'minute');
85
+ }
86
+ else if (secondStep > 0) {
87
+ todayClone = todayClone.add(secondStep, 'second');
88
+ }
89
+ else {
90
+ break;
91
+ }
92
+ }
93
+ return timeArray;
94
+ };
95
+ const formatSelectValue = () => {
96
+ const { value, format = 'HH:mm' } = props;
97
+ return value === null || value === void 0 ? void 0 : value.map((v) => ({
98
+ label: dayjs(v).format(format),
99
+ value: dayjs(v).format(format),
100
+ }));
101
+ };
102
+ if (mode === 'dingtalk') {
103
+ const { format, hourStep, minuteStep, secondStep, disabledTime } = props, otherProps = __rest(props, ["format", "hourStep", "minuteStep", "secondStep", "disabledTime"]);
104
+ return (React.createElement(NextSelect, Object.assign({}, otherProps, { className: cs(`${PREFIX_DEFAULT}time-picker2`, className), value: formatSelectValue(), size: size,
105
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
106
+ onChange: props.onChange,
107
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
108
+ defaultValue: props.defaultValue,
109
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
110
+ placeholder: props.placeholder || ['开始时间', '结束时间'], mode: "multiple" }), (_b = getTimeArray()) === null || _b === void 0 ? void 0 : _b.map((time, index) => (React.createElement(NextSelect.Option, { disabled: disabledTime ? disabledTime(time.value) : false, value: time.value, key: index }, time.label)))));
111
+ }
112
+ else {
113
+ return (React.createElement(NextTimePicker2.RangePicker
114
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
115
+ , Object.assign({}, props, { className: cs(`${PREFIX_DEFAULT}time-picker2`, className), state: state, size: size })));
116
+ }
117
+ });
118
+ const TimePicker = withLabel(BasePicker);
119
+ const RangePicker = withLabel(BaseRangePicker);
75
120
  const TimePickerWithSub = assignSubComponent(TimePicker, {
76
121
  displayName: 'TimePicker',
122
+ RangePicker
77
123
  });
78
124
  export * from './types';
125
+ export { RangePicker };
79
126
  export default ConfigProvider.config(TimePickerWithSub);
@@ -2,5 +2,23 @@
2
2
  @import "../core/variables.scss";
3
3
 
4
4
  .#{$prefix}time-picker2 {
5
-
5
+ .next-time-picker2-trigger {
6
+ width: 100%;
7
+ position: relative;
8
+ padding-right: var(--input-control-padding-right, 22px);
9
+ }
10
+
11
+ .next-time-picker2-input-separator {
12
+ color: var(--color-text1-2, #A0A3A8);
13
+ }
14
+
15
+ .next-input-control {
16
+ position: absolute;
17
+ right: var(--input-control-right, 2px);
18
+ top: var(--input-control-top, 10px);
19
+ }
20
+
21
+ &.next-select-multiple .next-select-trigger-search {
22
+ margin-bottom: 2px;
23
+ }
6
24
  }
@@ -1,2 +1,3 @@
1
1
  import '@alifd/next/lib/time-picker2/style2';
2
2
  import '@alifd/next/lib/select/style2';
3
+ import './main.scss';
@@ -1,2 +1,3 @@
1
1
  import '@alifd/next/lib/time-picker2/style2';
2
2
  import '@alifd/next/lib/select/style2';
3
+ import './main.scss';
@@ -1,20 +1,145 @@
1
1
  import type React from 'react';
2
- type HTMLAttributesWeak = Omit<React.ButtonHTMLAttributes<HTMLElement>, 'type' | 'onClick'>;
2
+ import type { CommonProps } from '@alifd/next';
3
+ type HTMLAttributesWeak = Omit<React.HTMLAttributes<HTMLElement>, 'onChange' | 'size' | 'value' | 'defaultValue' | 'placeholder'>;
3
4
  /**
4
- * @api TimePicker
5
+ * 时间选择器尺寸
6
+ * @api
7
+ */
8
+ export type TimePickerSize = 'small' | 'medium' | 'large';
9
+ /**
10
+ * 时间选择器通用属性
11
+ * @api
5
12
  */
6
- export interface TimePickerProps extends HTMLAttributesWeak {
13
+ interface TimePickerCommonProps extends HTMLAttributesWeak, CommonProps {
14
+ /**
15
+ * 选择器尺寸
16
+ * @en Size of time picker
17
+ * @defaultValue 'medium'
18
+ */
19
+ size?: TimePickerSize;
20
+ /**
21
+ * 标签文本
22
+ * @en Label text
23
+ */
24
+ label?: string;
25
+ /**
26
+ * 禁用时间的函数
27
+ * @en Function to disable time options
28
+ * @param timeStr - 时间字符串,格式由 format 属性决定
29
+ * @returns 是否禁用该时间
30
+ * @skip
31
+ */
32
+ disabledTime?: (timeStr: string) => boolean;
7
33
  /**
8
34
  * 采用模式
9
- * @en mode of time-picker
35
+ * @en Mode of time picker
10
36
  * @defaultValue 'normal'
11
37
  */
12
38
  mode?: 'normal' | 'dingtalk';
13
39
  /**
14
- * 时间选择器其他属性
15
- * @en key of time-picker
16
- * @defaultValue 'medium'
40
+ * 时间格式
41
+ * @en Time format
42
+ * @defaultValue 'HH:mm'
43
+ */
44
+ format?: string;
45
+ /**
46
+ * 小时步进
47
+ * @en Hour step
48
+ */
49
+ hourStep?: number;
50
+ /**
51
+ * 分钟步进
52
+ * @en Minute step
53
+ */
54
+ minuteStep?: number;
55
+ /**
56
+ * 秒钟步进
57
+ * @en Second step
58
+ */
59
+ secondStep?: number;
60
+ /**
61
+ * 状态
62
+ * @en State of time picker
63
+ */
64
+ state?: 'error' | 'warning';
65
+ /**
66
+ * 是否禁用
67
+ * @en Whether is disabled
68
+ * @defaultValue false
69
+ */
70
+ disabled?: boolean;
71
+ /**
72
+ * 是否必选
73
+ * @en Whether is required
74
+ * @defaultValue false
75
+ */
76
+ required?: boolean;
77
+ /**
78
+ * 自定义类名
79
+ * @en Custom className
80
+ * @skip
81
+ */
82
+ className?: string;
83
+ /**
84
+ * 自定义样式
85
+ * @en Custom style
86
+ * @skip
87
+ */
88
+ style?: React.CSSProperties;
89
+ }
90
+ /**
91
+ * @api TimePicker
92
+ */
93
+ export interface TimePickerProps extends TimePickerCommonProps {
94
+ /**
95
+ * 时间值
96
+ * @en Selected time
97
+ */
98
+ value?: Date | null;
99
+ /**
100
+ * 默认时间值
101
+ * @en Default time
102
+ */
103
+ defaultValue?: Date | null;
104
+ /**
105
+ * 时间值改变时的回调
106
+ * @en Callback when time changes
107
+ */
108
+ onChange?: (date: Date | null, dateString: string) => void;
109
+ /**
110
+ * 占位符
111
+ * @en Placeholder text
112
+ */
113
+ placeholder?: string;
114
+ }
115
+ /**
116
+ * @api TimePicker.RangePicker
117
+ */
118
+ export interface RangePickerProps extends TimePickerCommonProps {
119
+ /**
120
+ * 时间范围值
121
+ * @en Time range value
122
+ */
123
+ value?: [Date | null, Date | null];
124
+ /**
125
+ * 默认时间范围值
126
+ * @en Default time range value
127
+ */
128
+ defaultValue?: [Date | null, Date | null];
129
+ /**
130
+ * 时间范围值改变时的回调
131
+ * @en Callback when time range changes
132
+ */
133
+ onChange?: (dates: [Date | null, Date | null], dateStrings: [string, string]) => void;
134
+ /**
135
+ * 占位符
136
+ * @en Placeholder text
137
+ */
138
+ placeholder?: [string, string];
139
+ /**
140
+ * 尺寸
141
+ * @en Size
17
142
  */
18
- [key: string]: any;
143
+ size?: TimePickerSize;
19
144
  }
20
145
  export {};
@@ -5,7 +5,7 @@
5
5
  * @when ToolStatus
6
6
  */
7
7
  import React from 'react';
8
- import { ToolStatusProps } from './types';
8
+ import { type ToolStatusProps } from './types';
9
9
  export * from './types';
10
10
  declare const _default: import("@alifd/next/types/config-provider/types").ConfiguredComponentClass<Pick<ToolStatusProps & React.RefAttributes<HTMLDivElement>, "key" | keyof ToolStatusProps> & import("@alifd/next/types/config-provider/types").ComponentCommonProps, HTMLDivElement, {}>;
11
11
  export default _default;
@@ -6,8 +6,8 @@
6
6
  */
7
7
  import React, { forwardRef } from 'react';
8
8
  import { ConfigProvider } from '@alifd/next';
9
- import Icon from '../icon';
10
9
  import cs from 'classnames';
10
+ import Icon from '../icon';
11
11
  import { PREFIX_DEFAULT } from '../utils';
12
12
  const SUCCESS_ICON = 'icon-check'; //'success'
13
13
  const ERROR_ICON = 'icon-cross1'; //'error'
@@ -12,6 +12,7 @@
12
12
  background-color: transparent;
13
13
  font-size: $font-size-caption;
14
14
  max-width: 100%;
15
+ color: $color-text1-4;
15
16
 
16
17
  i {
17
18
  margin-right: $s-1;
@@ -49,7 +50,7 @@
49
50
  color: $color-brand1-6;
50
51
  }
51
52
  }
52
-
53
+
53
54
  .next-btn-text.next-btn-primary{
54
55
  line-height: $s-4;
55
56
  font-size: $font-size-caption;
@@ -1,13 +1,18 @@
1
- import React, { type ReactNode } from 'react';
1
+ import type { ReactNode, HTMLAttributes } from 'react';
2
2
  import { type CommonProps } from '@alifd/next';
3
+ /**
4
+ * 工具调用状态授权信息属性
5
+ * @api
6
+ */
3
7
  export interface ToolStatusAuthProps {
4
8
  content: string | ReactNode;
5
9
  onAuthClick?: (data: ToolStatusProps) => void;
6
10
  }
7
11
  /**
8
12
  * 参考来源属性
13
+ * @api
9
14
  */
10
- export interface ToolStatusProps extends React.HTMLAttributes<HTMLElement>, CommonProps {
15
+ export interface ToolStatusProps extends HTMLAttributes<HTMLElement>, CommonProps {
11
16
  className?: string;
12
17
  /**
13
18
  * 是否被选中
@@ -2,3 +2,4 @@ import { type AnyFunction } from './types';
2
2
  export declare function debounce<Callback extends AnyFunction>(callback: Callback, delay: number, leading?: boolean): (...args: Parameters<Callback>) => void;
3
3
  export declare function throttle<Callback extends AnyFunction>(callback: Callback, delay: number): (...args: Parameters<Callback>) => void;
4
4
  export declare function findAncestor(element: HTMLElement | null, where: (e: HTMLElement) => boolean | undefined): HTMLElement | null;
5
+ export declare function defaultCopyText(text: string): void;
package/es/utils/func.js CHANGED
@@ -1,3 +1,5 @@
1
+ import copy from 'copy-to-clipboard';
2
+ import Message from '../message';
1
3
  export function debounce(callback, delay, leading = false) {
2
4
  let timer;
3
5
  let isFirstRun = true;
@@ -37,3 +39,14 @@ export function findAncestor(element, where) {
37
39
  }
38
40
  return findAncestor(element.parentElement, where);
39
41
  }
42
+ export function defaultCopyText(text) {
43
+ if (!text)
44
+ return;
45
+ const success = copy(text);
46
+ if (success) {
47
+ Message.success('复制成功');
48
+ }
49
+ else {
50
+ Message.error('复制失败');
51
+ }
52
+ }