@douyinfe/semi-foundation 2.22.0-beta.0 → 2.22.0-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 (273) hide show
  1. package/anchor/foundation.ts +1 -1
  2. package/anchor/linkFoundation.ts +1 -1
  3. package/autoComplete/foundation.ts +4 -4
  4. package/autoComplete/optionFoundation.ts +2 -2
  5. package/avatar/foundation.ts +1 -1
  6. package/backtop/foundation.ts +1 -1
  7. package/banner/foundation.ts +1 -1
  8. package/base/foundation.ts +1 -1
  9. package/breadcrumb/foundation.ts +1 -1
  10. package/breadcrumb/itemFoundation.ts +3 -3
  11. package/calendar/eventUtil.ts +1 -1
  12. package/calendar/foundation.ts +8 -8
  13. package/card/variables.scss +1 -1
  14. package/cascader/foundation.ts +15 -32
  15. package/checkbox/checkboxFoundation.ts +4 -4
  16. package/checkbox/checkboxGroupFoundation.ts +1 -1
  17. package/collapse/foundation.ts +4 -4
  18. package/collapsible/animation.scss +10 -0
  19. package/collapsible/collapsible.scss +11 -0
  20. package/collapsible/foundation.ts +59 -0
  21. package/collapsible/variables.scss +0 -0
  22. package/datePicker/_utils/getDefaultPickerDate.ts +1 -1
  23. package/datePicker/_utils/getInsetInputFormatToken.ts +1 -1
  24. package/datePicker/_utils/getInsetInputValueFromInsetInputStr.ts +1 -1
  25. package/datePicker/_utils/parser.ts +1 -1
  26. package/datePicker/datePicker.scss +14 -0
  27. package/datePicker/foundation.ts +19 -28
  28. package/datePicker/inputFoundation.ts +10 -10
  29. package/datePicker/monthFoundation.ts +7 -7
  30. package/datePicker/monthsGridFoundation.ts +10 -11
  31. package/datePicker/yearAndMonthFoundation.ts +5 -4
  32. package/dropdown/foundation.ts +1 -1
  33. package/form/interface.ts +12 -12
  34. package/image/animation.scss +1 -1
  35. package/image/imageFoundation.ts +1 -1
  36. package/image/previewFooterFoundation.ts +1 -1
  37. package/image/previewImageFoundation.ts +6 -6
  38. package/image/previewInnerFoundation.ts +2 -2
  39. package/input/foundation.ts +2 -2
  40. package/input/textareaFoundation.ts +2 -2
  41. package/inputNumber/foundation.ts +2 -2
  42. package/keyframes/rotate.scss +0 -8
  43. package/lib/cjs/button/iconButton.css +0 -8
  44. package/lib/cjs/card/card.css +1 -1
  45. package/lib/cjs/card/variables.scss +1 -1
  46. package/lib/cjs/cascader/foundation.d.ts +2 -3
  47. package/lib/cjs/cascader/foundation.js +6 -30
  48. package/lib/cjs/collapse/foundation.d.ts +1 -2
  49. package/lib/cjs/collapsible/animation.scss +10 -0
  50. package/lib/cjs/collapsible/collapsible.css +6 -0
  51. package/lib/cjs/collapsible/collapsible.scss +11 -0
  52. package/lib/cjs/collapsible/foundation.d.ts +31 -0
  53. package/lib/cjs/collapsible/foundation.js +36 -0
  54. package/lib/cjs/collapsible/variables.scss +0 -0
  55. package/lib/cjs/datePicker/datePicker.css +9 -0
  56. package/lib/cjs/datePicker/datePicker.scss +14 -0
  57. package/lib/cjs/datePicker/foundation.d.ts +6 -5
  58. package/lib/cjs/datePicker/foundation.js +5 -13
  59. package/lib/cjs/datePicker/monthsGridFoundation.d.ts +0 -1
  60. package/lib/cjs/datePicker/yearAndMonthFoundation.d.ts +1 -0
  61. package/lib/cjs/image/animation.scss +1 -1
  62. package/lib/cjs/image/image.css +1 -1
  63. package/lib/cjs/keyframes/rotate.css +1 -9
  64. package/lib/cjs/keyframes/rotate.scss +0 -8
  65. package/lib/cjs/modal/animation.scss +26 -0
  66. package/lib/cjs/modal/modal.css +8 -8
  67. package/lib/cjs/modal/modal.scss +51 -47
  68. package/lib/cjs/modal/modalContentFoundation.d.ts +3 -1
  69. package/lib/cjs/modal/modalFoundation.d.ts +7 -6
  70. package/lib/cjs/modal/modalFoundation.js +9 -5
  71. package/lib/cjs/navigation/itemFoundation.js +11 -1
  72. package/lib/cjs/navigation/navigation.css +12 -0
  73. package/lib/cjs/navigation/navigation.scss +16 -0
  74. package/lib/cjs/navigation/variables.scss +3 -2
  75. package/lib/cjs/notification/animation.scss +12 -0
  76. package/lib/cjs/notification/notification.css +156 -0
  77. package/lib/cjs/notification/notification.scss +183 -1
  78. package/lib/cjs/notification/notificationFoundation.d.ts +1 -2
  79. package/lib/cjs/popover/animation.scss +7 -0
  80. package/lib/cjs/popover/popover.css +27 -0
  81. package/lib/cjs/popover/popover.scss +38 -2
  82. package/lib/cjs/scrollList/scrollList.css +1 -0
  83. package/lib/cjs/scrollList/scrollList.scss +1 -0
  84. package/lib/cjs/select/foundation.d.ts +1 -0
  85. package/lib/cjs/select/foundation.js +12 -0
  86. package/lib/cjs/sideSheet/animation.scss +14 -6
  87. package/lib/cjs/sideSheet/sideSheet.css +110 -2
  88. package/lib/cjs/sideSheet/sideSheet.scss +140 -5
  89. package/lib/cjs/sideSheet/sideSheetFoundation.d.ts +8 -6
  90. package/lib/cjs/sideSheet/sideSheetFoundation.js +10 -50
  91. package/lib/cjs/skeleton/animation.scss +3 -0
  92. package/lib/cjs/skeleton/skeleton.css +1 -1
  93. package/lib/cjs/skeleton/skeleton.scss +2 -1
  94. package/lib/cjs/spin/animation.scss +2 -0
  95. package/lib/cjs/spin/spin.css +9 -9
  96. package/lib/cjs/spin/spin.scss +14 -6
  97. package/lib/cjs/spin/variables.scss +1 -7
  98. package/lib/cjs/table/table.css +8 -0
  99. package/lib/cjs/table/table.scss +10 -0
  100. package/lib/cjs/tabs/animation.scss +28 -15
  101. package/lib/cjs/tabs/constants.d.ts +4 -0
  102. package/lib/cjs/tabs/constants.js +5 -1
  103. package/lib/cjs/tabs/tabs.css +52 -0
  104. package/lib/cjs/tabs/tabs.scss +60 -0
  105. package/lib/cjs/timePicker/timePicker.css +9 -0
  106. package/lib/cjs/timePicker/timePicker.scss +12 -0
  107. package/lib/cjs/toast/animation.scss +11 -0
  108. package/lib/cjs/toast/toast.css +24 -0
  109. package/lib/cjs/toast/toast.scss +30 -1
  110. package/lib/cjs/toast/toastFoundation.d.ts +1 -2
  111. package/lib/cjs/tooltip/animation.scss +7 -0
  112. package/lib/cjs/tooltip/foundation.d.ts +4 -7
  113. package/lib/cjs/tooltip/foundation.js +11 -30
  114. package/lib/cjs/tooltip/tooltip.css +6 -0
  115. package/lib/cjs/tooltip/tooltip.scss +13 -1
  116. package/lib/cjs/treeSelect/foundation.d.ts +2 -0
  117. package/lib/cjs/typography/constants.d.ts +2 -0
  118. package/lib/cjs/typography/constants.js +3 -1
  119. package/lib/cjs/typography/formatNumeral.d.ts +18 -0
  120. package/lib/cjs/typography/formatNumeral.js +114 -0
  121. package/lib/cjs/utils/uuid.js +4 -1
  122. package/lib/es/button/iconButton.css +0 -8
  123. package/lib/es/card/card.css +1 -1
  124. package/lib/es/card/variables.scss +1 -1
  125. package/lib/es/cascader/foundation.d.ts +2 -3
  126. package/lib/es/cascader/foundation.js +6 -30
  127. package/lib/es/collapse/foundation.d.ts +1 -2
  128. package/lib/es/collapsible/animation.scss +10 -0
  129. package/lib/es/collapsible/collapsible.css +6 -0
  130. package/lib/es/collapsible/collapsible.scss +11 -0
  131. package/lib/es/collapsible/foundation.d.ts +31 -0
  132. package/lib/es/collapsible/foundation.js +26 -0
  133. package/lib/es/collapsible/variables.scss +0 -0
  134. package/lib/es/datePicker/datePicker.css +9 -0
  135. package/lib/es/datePicker/datePicker.scss +14 -0
  136. package/lib/es/datePicker/foundation.d.ts +6 -5
  137. package/lib/es/datePicker/foundation.js +5 -13
  138. package/lib/es/datePicker/monthsGridFoundation.d.ts +0 -1
  139. package/lib/es/datePicker/yearAndMonthFoundation.d.ts +1 -0
  140. package/lib/es/image/animation.scss +1 -1
  141. package/lib/es/image/image.css +1 -1
  142. package/lib/es/keyframes/rotate.css +1 -9
  143. package/lib/es/keyframes/rotate.scss +0 -8
  144. package/lib/es/modal/animation.scss +26 -0
  145. package/lib/es/modal/modal.css +8 -8
  146. package/lib/es/modal/modal.scss +51 -47
  147. package/lib/es/modal/modalContentFoundation.d.ts +3 -1
  148. package/lib/es/modal/modalFoundation.d.ts +7 -6
  149. package/lib/es/modal/modalFoundation.js +9 -5
  150. package/lib/es/navigation/itemFoundation.js +12 -1
  151. package/lib/es/navigation/navigation.css +12 -0
  152. package/lib/es/navigation/navigation.scss +16 -0
  153. package/lib/es/navigation/variables.scss +3 -2
  154. package/lib/es/notification/animation.scss +12 -0
  155. package/lib/es/notification/notification.css +156 -0
  156. package/lib/es/notification/notification.scss +183 -1
  157. package/lib/es/notification/notificationFoundation.d.ts +1 -2
  158. package/lib/es/popover/animation.scss +7 -0
  159. package/lib/es/popover/popover.css +27 -0
  160. package/lib/es/popover/popover.scss +38 -2
  161. package/lib/es/scrollList/scrollList.css +1 -0
  162. package/lib/es/scrollList/scrollList.scss +1 -0
  163. package/lib/es/select/foundation.d.ts +1 -0
  164. package/lib/es/select/foundation.js +12 -0
  165. package/lib/es/sideSheet/animation.scss +14 -6
  166. package/lib/es/sideSheet/sideSheet.css +110 -2
  167. package/lib/es/sideSheet/sideSheet.scss +140 -5
  168. package/lib/es/sideSheet/sideSheetFoundation.d.ts +8 -6
  169. package/lib/es/sideSheet/sideSheetFoundation.js +10 -49
  170. package/lib/es/skeleton/animation.scss +3 -0
  171. package/lib/es/skeleton/skeleton.css +1 -1
  172. package/lib/es/skeleton/skeleton.scss +2 -1
  173. package/lib/es/spin/animation.scss +2 -0
  174. package/lib/es/spin/spin.css +9 -9
  175. package/lib/es/spin/spin.scss +14 -6
  176. package/lib/es/spin/variables.scss +1 -7
  177. package/lib/es/table/table.css +8 -0
  178. package/lib/es/table/table.scss +10 -0
  179. package/lib/es/tabs/animation.scss +28 -15
  180. package/lib/es/tabs/constants.d.ts +4 -0
  181. package/lib/es/tabs/constants.js +5 -1
  182. package/lib/es/tabs/tabs.css +52 -0
  183. package/lib/es/tabs/tabs.scss +60 -0
  184. package/lib/es/timePicker/timePicker.css +9 -0
  185. package/lib/es/timePicker/timePicker.scss +12 -0
  186. package/lib/es/toast/animation.scss +11 -0
  187. package/lib/es/toast/toast.css +24 -0
  188. package/lib/es/toast/toast.scss +30 -1
  189. package/lib/es/toast/toastFoundation.d.ts +1 -2
  190. package/lib/es/tooltip/animation.scss +7 -0
  191. package/lib/es/tooltip/foundation.d.ts +4 -7
  192. package/lib/es/tooltip/foundation.js +11 -30
  193. package/lib/es/tooltip/tooltip.css +6 -0
  194. package/lib/es/tooltip/tooltip.scss +13 -1
  195. package/lib/es/treeSelect/foundation.d.ts +2 -0
  196. package/lib/es/typography/constants.d.ts +2 -0
  197. package/lib/es/typography/constants.js +3 -1
  198. package/lib/es/typography/formatNumeral.d.ts +18 -0
  199. package/lib/es/typography/formatNumeral.js +104 -0
  200. package/lib/es/utils/uuid.js +4 -1
  201. package/modal/animation.scss +26 -0
  202. package/modal/modal.scss +51 -47
  203. package/modal/modalContentFoundation.ts +6 -4
  204. package/modal/modalFoundation.ts +16 -10
  205. package/navigation/foundation.ts +6 -6
  206. package/navigation/itemFoundation.ts +9 -3
  207. package/navigation/navigation.scss +16 -0
  208. package/navigation/subNavFoundation.ts +4 -4
  209. package/navigation/variables.scss +3 -2
  210. package/notification/animation.scss +12 -0
  211. package/notification/notification.scss +183 -1
  212. package/notification/notificationFoundation.ts +4 -5
  213. package/notification/notificationListFoundation.ts +3 -3
  214. package/overflowList/foundation.ts +1 -1
  215. package/package.json +2 -2
  216. package/pagination/foundation.ts +2 -2
  217. package/popconfirm/popconfirmFoundation.ts +1 -1
  218. package/popover/animation.scss +7 -0
  219. package/popover/popover.scss +38 -2
  220. package/progress/generates.ts +3 -3
  221. package/radio/radioFoundation.ts +1 -1
  222. package/radio/radioGroupFoundation.ts +1 -1
  223. package/radio/radioInnerFoundation.ts +3 -3
  224. package/rating/foundation.ts +2 -2
  225. package/scrollList/itemFoundation.ts +2 -2
  226. package/scrollList/scrollList.scss +1 -0
  227. package/select/foundation.ts +10 -2
  228. package/select/optionFoundation.ts +2 -2
  229. package/sideSheet/animation.scss +14 -6
  230. package/sideSheet/sideSheet.scss +140 -5
  231. package/sideSheet/sideSheetFoundation.ts +20 -44
  232. package/skeleton/animation.scss +3 -0
  233. package/skeleton/skeleton.scss +2 -1
  234. package/slider/foundation.ts +7 -7
  235. package/spin/animation.scss +2 -0
  236. package/spin/foundation.ts +1 -1
  237. package/spin/spin.scss +14 -6
  238. package/spin/variables.scss +1 -7
  239. package/switch/foundation.ts +1 -1
  240. package/table/bodyFoundation.ts +3 -3
  241. package/table/cellFoundation.ts +1 -1
  242. package/table/foundation.ts +11 -11
  243. package/table/table.scss +10 -0
  244. package/table/tableRowFoundation.ts +1 -1
  245. package/table/tableSelectionCellFoundation.ts +3 -3
  246. package/table/utils.ts +3 -3
  247. package/tabs/animation.scss +28 -15
  248. package/tabs/constants.ts +4 -0
  249. package/tabs/foundation.ts +1 -1
  250. package/tabs/tabs.scss +60 -0
  251. package/tagInput/foundation.ts +2 -2
  252. package/timePicker/foundation.ts +1 -1
  253. package/timePicker/inputFoundation.ts +1 -1
  254. package/timePicker/timePicker.scss +12 -0
  255. package/toast/animation.scss +11 -0
  256. package/toast/toast.scss +30 -1
  257. package/toast/toastFoundation.ts +4 -5
  258. package/toast/toastListFoundation.ts +2 -2
  259. package/tooltip/animation.scss +7 -0
  260. package/tooltip/foundation.ts +14 -26
  261. package/tooltip/tooltip.scss +13 -1
  262. package/transfer/foundation.ts +5 -5
  263. package/tree/foundation.ts +19 -19
  264. package/tree/treeUtil.ts +3 -3
  265. package/treeSelect/foundation.ts +8 -6
  266. package/typography/constants.ts +4 -5
  267. package/typography/formatNumeral.ts +125 -0
  268. package/upload/foundation.ts +6 -6
  269. package/utils/FocusHandle.ts +3 -3
  270. package/utils/getHighlight.ts +2 -2
  271. package/utils/getMotionObjFromProps.ts +1 -1
  272. package/utils/type.ts +4 -4
  273. package/utils/uuid.ts +6 -5
@@ -21,7 +21,7 @@ export interface AnchorAdapter<P = Record<string, any>, S = Record<string, any>>
21
21
  getContentNode: (selector: string) => HTMLElement;
22
22
  notifyChange: (currentLink: string, previousLink: string) => void;
23
23
  notifyClick: (e: any, link: string) => void;
24
- canSmoothScroll: () => boolean;
24
+ canSmoothScroll: () => boolean
25
25
  }
26
26
 
27
27
  export default class AnchorFoundation<P = Record<string, any>, S = Record<string, any>> extends BaseFoundation<AnchorAdapter<P, S>, P, S> {
@@ -3,7 +3,7 @@ import { AnchorAdapter } from './foundation';
3
3
 
4
4
  export interface LinkAdapter extends DefaultAdapter {
5
5
  addLink: AnchorAdapter['addLink'];
6
- removeLink: AnchorAdapter['removeLink'];
6
+ removeLink: AnchorAdapter['removeLink']
7
7
  }
8
8
 
9
9
  export default class LinkFoundation extends BaseFoundation<LinkAdapter> {
@@ -8,18 +8,18 @@ interface KeyboardAdapter<P = Record<string, any>, S = Record<string, any>> exte
8
8
  registerKeyDown: (callback: (event: any) => void) => void;
9
9
  unregisterKeyDown: (callback: (event: any) => void) => void;
10
10
  updateFocusIndex: (focusIndex: number) => void;
11
- notifyKeyDown: (e: any) => void;
11
+ notifyKeyDown: (e: any) => void
12
12
  }
13
13
 
14
14
  export interface DataItem {
15
15
  [x: string]: any;
16
16
  value?: string | number;
17
- label?: any; // reactNode
17
+ label?: any // reactNode
18
18
  }
19
19
 
20
20
  export interface StateOptionItem extends DataItem {
21
21
  show?: boolean;
22
- key?: string | number;
22
+ key?: string | number
23
23
  }
24
24
 
25
25
  export type AutoCompleteData = Array<DataItem | string>;
@@ -39,7 +39,7 @@ export interface AutoCompleteAdapter<P = Record<string, any>, S = Record<string,
39
39
  notifyFocus: (event?: any) => void;
40
40
  notifyBlur: (event?: any) => void;
41
41
  rePositionDropdown: () => void;
42
- persistEvent: (event: any) => void;
42
+ persistEvent: (event: any) => void
43
43
  }
44
44
 
45
45
  class AutoCompleteFoundation<P = Record<string, any>, S = Record<string, any>> extends BaseFoundation<AutoCompleteAdapter<P, S>, P, S> {
@@ -9,10 +9,10 @@ export interface BasicOptionProps {
9
9
  disabled?: boolean;
10
10
  showTick?: boolean;
11
11
  className?: string;
12
- style?: Record<string, any>;
12
+ style?: Record<string, any>
13
13
  }
14
14
  export interface OptionDefaultAdapter extends Partial<DefaultAdapter> {
15
- notifyClick(option: BasicOptionProps): void;
15
+ notifyClick(option: BasicOptionProps): void
16
16
  }
17
17
 
18
18
 
@@ -5,7 +5,7 @@ export interface AvatarAdapter<P = Record<string, any>, S = Record<string, any>>
5
5
  notifyImgState(isImgExist: boolean): void;
6
6
  notifyLeave(event: any): void;
7
7
  notifyEnter(event: any): void;
8
- setFocusVisible: (focusVisible: boolean) => void;
8
+ setFocusVisible: (focusVisible: boolean) => void
9
9
  }
10
10
 
11
11
  export default class AvatarFoundation<P = Record<string, any>, S = Record<string, any>> extends BaseFoundation<AvatarAdapter<P, S>, P, S> {
@@ -10,7 +10,7 @@ export interface BackTopAdapter extends DefaultAdapter {
10
10
  notifyClick: (e: BackTopClickEvent) => void;
11
11
  targetIsWindow: (target: any) => boolean;
12
12
  isWindowUndefined: () => boolean;
13
- targetScrollToTop: (targetNode: any, scrollTop: number) => void;
13
+ targetScrollToTop: (targetNode: any, scrollTop: number) => void
14
14
  }
15
15
 
16
16
  export default class BackTopFoundation extends BaseFoundation<BackTopAdapter> {
@@ -2,7 +2,7 @@ import BaseFoundation, { DefaultAdapter } from '../base/foundation';
2
2
 
3
3
  export interface BannerAdapter<P = Record<string, any>, S = Record<string, any>> extends DefaultAdapter<P, S> {
4
4
  setVisible: () => void;
5
- notifyClose: (e: any) => void;
5
+ notifyClose: (e: any) => void
6
6
  }
7
7
 
8
8
  export default class BannerFoundation<P = Record<string, any>, S = Record<string, any>> extends BaseFoundation<BannerAdapter<P, S>, P, S> {
@@ -21,7 +21,7 @@ export interface DefaultAdapter<P = Record<string, any>, S = Record<string, any>
21
21
  getCaches(): any;
22
22
  setCache(key: any, value: any): void;
23
23
  stopPropagation(e: any): void;
24
- persistEvent: (event: any) => void;
24
+ persistEvent: (event: any) => void
25
25
  }
26
26
 
27
27
  class BaseFoundation<T extends Partial<DefaultAdapter<P, S>>, P = Record<string, any>, S = Record<string, any>> {
@@ -4,7 +4,7 @@ import isEnterPress from '../utils/isEnterPress';
4
4
  import { BreadcrumbItemInfo, Route } from './itemFoundation';
5
5
  export interface BreadcrumbAdapter<P = Record<string, any>, S = Record<string, any>> extends DefaultAdapter<P, S> {
6
6
  notifyClick: (itemInfo: BreadcrumbItemInfo, event: any) => void;
7
- expandCollapsed: (clickEvent?: any) => void;
7
+ expandCollapsed: (clickEvent?: any) => void
8
8
  }
9
9
 
10
10
  export default class BreadcrumbFoundation<P = Record<string, any>, S = Record<string, any>> extends BaseFoundation<BreadcrumbAdapter<P, S>, P, S> {
@@ -4,7 +4,7 @@ export interface BreadcrumbItemInfo {
4
4
  name?: any; // maybe reactNode, string, number
5
5
  href?: string;
6
6
  icon?: any;
7
- path?: string;
7
+ path?: string
8
8
  }
9
9
 
10
10
  export interface Route {
@@ -12,12 +12,12 @@ export interface Route {
12
12
  path?: string;
13
13
  href?: string;
14
14
  name?: string;
15
- icon?: any;
15
+ icon?: any
16
16
  }
17
17
 
18
18
  export interface BreadcrumbItemAdapter<P = Record<string, any>, S = Record<string, any>> extends DefaultAdapter<P, S> {
19
19
  notifyClick: (item: BreadcrumbItemInfo, e: any) => void;
20
- notifyParent: (item: BreadcrumbItemInfo, e: any) => void;
20
+ notifyParent: (item: BreadcrumbItemInfo, e: any) => void
21
21
  }
22
22
 
23
23
  export default class BreadcrumbItemFoundation<P = Record<string, any>, S = Record<string, any>> extends BaseFoundation<BreadcrumbItemAdapter<P, S>, P, S> {
@@ -93,7 +93,7 @@ export interface DateObj {
93
93
  isToday: boolean;
94
94
  isWeekend: boolean;
95
95
  isSameMonth: boolean;
96
- month: string;
96
+ month: string
97
97
  }
98
98
 
99
99
  export type weeekStartsOnEnum = 0 | 1 | 2 | 3 | 4 | 5 | 6;
@@ -43,38 +43,38 @@ export interface EventObject {
43
43
  start?: Date;
44
44
  end?: Date;
45
45
  // children?: React.ReactNode;
46
- children?: any;
46
+ children?: any
47
47
  }
48
48
 
49
49
  export interface ParsedEventsWithArray {
50
50
  day: Array<any>;
51
- allDay: Array<any>;
51
+ allDay: Array<any>
52
52
  }
53
53
 
54
54
  export interface ParsedEvents {
55
55
  day?: Map<string, Array<EventObject>>;
56
- allDay?: Map<string, Array<EventObject>>;
56
+ allDay?: Map<string, Array<EventObject>>
57
57
  }
58
58
 
59
59
  export interface ParsedRangeEvent extends EventObject {
60
60
  leftPos?: number;
61
61
  width?: number;
62
- topInd?: number;
62
+ topInd?: number
63
63
  }
64
64
 
65
65
  export interface MonthlyEvent {
66
66
  day: ParsedRangeEvent[][];
67
- display: ParsedRangeEvent[];
67
+ display: ParsedRangeEvent[]
68
68
  }
69
69
 
70
70
  export interface RangeData {
71
71
  month: string;
72
- week: any[];
72
+ week: any[]
73
73
  }
74
74
 
75
75
  export interface WeeklyData {
76
76
  month: string;
77
- week: DateObj[];
77
+ week: DateObj[]
78
78
  }
79
79
 
80
80
  export type MonthData = Record<number, DateObj[]>;
@@ -103,7 +103,7 @@ export interface CalendarAdapter<P = Record<string, any>, S = Record<string, any
103
103
  getMonthlyData?: () => MonthData;
104
104
  notifyClose?: (e: any, key: string) => void;
105
105
  openCard?: (key: string, spacing: boolean) => void;
106
- setItemLimit?: (itemLimit: number) => void;
106
+ setItemLimit?: (itemLimit: number) => void
107
107
  }
108
108
 
109
109
  export default class CalendarFoundation<P = Record<string, any>, S = Record<string, any>> extends BaseFoundation<CalendarAdapter<P, S>, P, S> {
@@ -16,7 +16,7 @@ $font-card_title-fontSize: $font-size-header-6; // 卡片文字大小 - 标题
16
16
 
17
17
  $radius-card: var(--semi-border-radius-medium); // 卡片圆角
18
18
 
19
- $motion-card-transition_duration: 0.3s; // 卡片悬浮动画时长
19
+ $motion-card-transition_duration: 300ms; // 卡片悬浮动画时长
20
20
 
21
21
  $width-card-border: $border-thickness-control; // 卡片描边宽度
22
22
 
@@ -24,11 +24,11 @@ export interface BasicData {
24
24
  data: BasicCascaderData;
25
25
  disabled: boolean;
26
26
  key: string;
27
- searchText: any[];
27
+ searchText: any[]
28
28
  }
29
29
 
30
30
  export interface BasicEntities {
31
- [idx: string]: BasicEntity;
31
+ [idx: string]: BasicEntity
32
32
  }
33
33
 
34
34
  export interface BasicEntity {
@@ -50,7 +50,7 @@ export interface BasicEntity {
50
50
  /* key path */
51
51
  path: Array<string>;
52
52
  /* value path */
53
- valuePath: Array<string>;
53
+ valuePath: Array<string>
54
54
  }
55
55
 
56
56
  export interface BasicCascaderData {
@@ -60,7 +60,7 @@ export interface BasicCascaderData {
60
60
  disabled?: boolean;
61
61
  isLeaf?: boolean;
62
62
  loading?: boolean;
63
- children?: BasicCascaderData[];
63
+ children?: BasicCascaderData[]
64
64
  }
65
65
 
66
66
  export type CascaderType = 'large' | 'small' | 'default';
@@ -92,12 +92,12 @@ export interface BasicTriggerRenderProps {
92
92
  * with Cascader. */
93
93
  onChange: (inputValue: string) => void;
94
94
  /* Function to clear the value */
95
- onClear: (e: any) => void;
95
+ onClear: (e: any) => void
96
96
  }
97
97
 
98
98
  export interface BasicScrollPanelProps {
99
99
  panelIndex: number;
100
- activeNode: BasicCascaderData;
100
+ activeNode: BasicCascaderData
101
101
  }
102
102
 
103
103
  export interface BasicCascaderProps {
@@ -114,7 +114,7 @@ export interface BasicCascaderProps {
114
114
  dropdownStyle?: any;
115
115
  emptyContent?: any;
116
116
  filterLeafOnly?: boolean;
117
- motion?: Motion;
117
+ motion?: boolean;
118
118
  filterTreeNode?: ((inputValue: string, treeNodeString: string) => boolean) | boolean;
119
119
  placeholder?: string;
120
120
  searchPlaceholder?: string;
@@ -159,7 +159,7 @@ export interface BasicCascaderProps {
159
159
  onExceed?: (checkedItem: BasicEntity[]) => void;
160
160
  displayRender?: (selected: Array<string> | BasicEntity, idx?: number) => any;
161
161
  onBlur?: (e: any) => void;
162
- onFocus?: (e: any) => void;
162
+ onFocus?: (e: any) => void
163
163
  }
164
164
 
165
165
  export interface BasicCascaderInnerData {
@@ -184,7 +184,7 @@ export interface BasicCascaderInnerData {
184
184
  isFocus?: boolean;
185
185
  isInput?: boolean;
186
186
  disabledKeys?: Set<string>;
187
- showInput?: boolean;
187
+ showInput?: boolean
188
188
  }
189
189
 
190
190
  export interface CascaderAdapter extends DefaultAdapter<BasicCascaderProps, BasicCascaderInnerData> {
@@ -211,7 +211,7 @@ export interface CascaderAdapter extends DefaultAdapter<BasicCascaderProps, Basi
211
211
  notifyListScroll: (e: any, panel: BasicScrollPanelProps) => void;
212
212
  notifyOnExceed: (data: BasicEntity[]) => void;
213
213
  toggleInputShow: (show: boolean, cb: () => void) => void;
214
- updateFocusState: (focus: boolean) => void,
214
+ updateFocusState: (focus: boolean) => void
215
215
  }
216
216
 
217
217
  // eslint-disable-next-line max-len
@@ -522,7 +522,7 @@ export default class CascaderFoundation extends BaseFoundation<CascaderAdapter,
522
522
  this._adapter.notifyDropdownVisibleChange(false);
523
523
  this._adapter.unregisterClickOutsideHandler();
524
524
  if (this._isFilterable()) {
525
- const { selectedKeys } = this.getStates();
525
+ const { selectedKeys, isSearching } = this.getStates();
526
526
  let inputValue = '';
527
527
  if (key && !multiple) {
528
528
  inputValue = this.renderDisplayText(key);
@@ -549,27 +549,10 @@ export default class CascaderFoundation extends BaseFoundation<CascaderAdapter,
549
549
  this._adapter.updateFocusState(true);
550
550
  }
551
551
 
552
- getMergedMotion = () => {
553
- const { motion } = this.getProps();
554
- const { isSearching } = this.getStates();
555
- if (isSearching) {
556
- const mergedMotion =
557
- typeof motion === 'undefined' || motion ?
558
- {
559
- ...motion,
560
- didLeave: (...args: any) => {
561
- const didLeave = get(motion, 'didLeave');
562
- if (typeof didLeave === 'function') {
563
- didLeave(...args);
564
- }
565
- this._adapter.updateStates({ isSearching: false });
566
- },
567
- } :
568
- false;
569
- return mergedMotion;
570
- }
571
- return motion;
572
- };
552
+
553
+ updateSearching = (isSearching:boolean)=>{
554
+ this._adapter.updateStates({ isSearching: false });
555
+ }
573
556
 
574
557
  handleItemClick(e: any, item: BasicEntity | BasicData) {
575
558
  const isDisabled = this._isDisabled();
@@ -4,13 +4,13 @@ import warning from '../utils/warning';
4
4
 
5
5
  export interface BasicTargetObject {
6
6
  [x: string]: any;
7
- checked?: boolean;
7
+ checked?: boolean
8
8
  }
9
9
  export interface BasicCheckboxEvent {
10
10
  target: BasicTargetObject;
11
11
  stopPropagation: () => void;
12
12
  preventDefault: () => void;
13
- [x: string]: any;
13
+ [x: string]: any
14
14
  // nativeEvent: {
15
15
  // stopImmediatePropagation: () => void;
16
16
  // }
@@ -27,7 +27,7 @@ export interface CheckboxAdapter<P = Record<string, any>, S = Record<string, any
27
27
  setExtraId: () => void;
28
28
  setFocusVisible: (focusVisible: boolean) => void;
29
29
  focusCheckboxEntity: () => void;
30
- generateEvent: (checked: boolean, e: any) => any; // 1.modify checked value 2.add nativeEvent on react adapter
30
+ generateEvent: (checked: boolean, e: any) => any // 1.modify checked value 2.add nativeEvent on react adapter
31
31
  }
32
32
 
33
33
  class CheckboxFoundation<P = Record<string, any>, S = Record<string, any>> extends BaseFoundation<CheckboxAdapter<P, S>, P, S> {
@@ -148,7 +148,7 @@ export interface BaseCheckboxProps {
148
148
  extra?: any;
149
149
  addonId?: string;
150
150
  extraId?: string;
151
- preventScroll?: boolean;
151
+ preventScroll?: boolean
152
152
  }
153
153
 
154
154
  export default CheckboxFoundation;
@@ -4,7 +4,7 @@ import { BasicCheckboxEvent } from './checkboxFoundation';
4
4
 
5
5
  export interface CheckboxGroupAdapter extends DefaultAdapter{
6
6
  updateGroupValue: (value: any[]) => void;
7
- notifyChange: (value: any[]) => void;
7
+ notifyChange: (value: any[]) => void
8
8
  }
9
9
  class CheckboxGroupFoundation extends BaseFoundation<CheckboxGroupAdapter> {
10
10
  static get checkboxGroupDefaultAdapter() {
@@ -13,20 +13,20 @@ export interface CollapseProps{
13
13
  style?: any;
14
14
  className?: string;
15
15
  keepDOM?: boolean;
16
- motion?: Motion;
17
- expandIconPosition?: 'left' | 'right';
16
+ motion?: boolean;
17
+ expandIconPosition?: 'left' | 'right'
18
18
 
19
19
  }
20
20
 
21
21
  export interface CollapseState{
22
- activeSet: Set<string>;
22
+ activeSet: Set<string>
23
23
  }
24
24
 
25
25
  export interface CollapseAdapter extends DefaultAdapter<CollapseProps, CollapseState>{
26
26
  handleChange: (activeKey: CollapseProps['activeKey'], e: any) => void;
27
27
  // getStates: () => CollapseState;
28
28
  // getProps: () => CollapseProps;
29
- addActiveKey: (newSet: CollapseState['activeSet']) => void;
29
+ addActiveKey: (newSet: CollapseState['activeSet']) => void
30
30
  }
31
31
 
32
32
  export default class CollapseFoundation extends BaseFoundation<CollapseAdapter> {
@@ -0,0 +1,10 @@
1
+ $transition_duration-collapsible-height: 250ms;//折叠-高度-动画持续时间
2
+ $transition_function-collapsible-height: cubic-bezier(0.25,0.1,0.25,1);//折叠-高度-过渡曲线
3
+ $transition_delay-collapsible-height: var(--semi-transition_delay-fastest);//折叠-高度-延迟时间
4
+
5
+ $transition_duration-collapsible-opacity: 250ms;//折叠-透明度-动画持续时间
6
+ $transition_function-collapsible-opacity: var(--semi-transition_function-easeIn);//折叠-透明度-过渡曲线
7
+ $transition_delay-collapsible-opacity: var(--semi-transition_delay-fastest);//折叠-透明度-延迟时间
8
+
9
+
10
+
@@ -0,0 +1,11 @@
1
+ @import "./animation.scss";
2
+ @import "./variables.scss";
3
+
4
+
5
+ $module: #{$prefix}-collapsible;
6
+
7
+
8
+ .#{$module}-transition{
9
+ transition: height $transition_duration-collapsible-height $transition_function-collapsible-height $transition_delay-collapsible-height,
10
+ opacity $transition_duration-collapsible-opacity $transition_function-collapsible-opacity $transition_delay-collapsible-opacity,
11
+ }
@@ -0,0 +1,59 @@
1
+ import BaseFoundation, { DefaultAdapter } from "../base/foundation";
2
+
3
+ export interface CollapsibleFoundationProps {
4
+ isOpen?: boolean;
5
+ duration?: number;
6
+ keepDOM?: boolean;
7
+ className?: string;
8
+ collapseHeight?: number;
9
+ reCalcKey?: number | string;
10
+ id?: string;
11
+ fade?: boolean
12
+ }
13
+
14
+ export interface CollapsibleFoundationState {
15
+ domInRenderTree: boolean;
16
+ domHeight: number;
17
+ visible: boolean;
18
+ isTransitioning: boolean
19
+
20
+ }
21
+
22
+
23
+ export interface CollapsibleAdapter<P = Record<string, any>, S = Record<string, any>> extends DefaultAdapter<P, S> {
24
+ setDOMInRenderTree: (isInRenderTree: boolean) => void;
25
+ setDOMHeight: (domHeight: number) => void;
26
+ setVisible: (visible: boolean) => void;
27
+ setIsTransitioning: (isTransitioning: boolean) => void
28
+ }
29
+
30
+ class CollapsibleFoundation extends BaseFoundation<CollapsibleAdapter<CollapsibleFoundationProps, CollapsibleFoundationState>, CollapsibleFoundationProps, CollapsibleFoundationState> {
31
+
32
+ constructor(adapter: CollapsibleAdapter<CollapsibleFoundationProps, CollapsibleFoundationState>) {
33
+ super({
34
+ ...adapter
35
+ });
36
+ }
37
+
38
+
39
+ updateDOMInRenderTree = (isInRenderTree) => {
40
+ this._adapter.setDOMInRenderTree(isInRenderTree);
41
+ }
42
+
43
+ updateDOMHeight = (domHeight: number) => {
44
+ this._adapter.setDOMHeight(domHeight);
45
+ }
46
+
47
+ updateVisible = (visible: boolean) => {
48
+ this._adapter.setVisible(visible);
49
+ }
50
+
51
+ updateIsTransitioning = (isTransitioning: boolean) => {
52
+ this._adapter.setIsTransitioning(isTransitioning);
53
+ }
54
+
55
+
56
+ }
57
+
58
+
59
+ export default CollapsibleFoundation;
File without changes
@@ -50,5 +50,5 @@ type BaseValueType = string | number | Date;
50
50
  interface GetDefaultPickerValueDateOptions {
51
51
  defaultPickerValue?: BaseValueType | BaseValueType[];
52
52
  format: string;
53
- dateFnsLocale: dateFnsLocale;
53
+ dateFnsLocale: dateFnsLocale
54
54
  }
@@ -16,7 +16,7 @@ import { getDefaultFormatTokenByType } from './getDefaultFormatToken';
16
16
  * 'yyyy-MM-dd HH:mm' => 'yyyy-MM-dd HH:mm'
17
17
  * 'Pp' => 'yyyy-MM-dd'
18
18
  */
19
- export default function getInsetInputFormatToken(options: { format: string, type: typeof strings.TYPE_SET[number]; }) {
19
+ export default function getInsetInputFormatToken(options: { format: string; type: typeof strings.TYPE_SET[number] }) {
20
20
  const { format, type } = options;
21
21
  const dateReg = /([yMd]{0,4}[^a-z\s]*[yMd]{0,4}[^a-z\s]*[yMd]{0,4})/i;
22
22
  const dateTimeReg = /([yMd]{0,4}[^a-z\s]*[yMd]{0,4}[^a-z\s]*[yMd]{0,4}) (H{0,2}[^a-z\s]*m{0,2}[^a-z\s]*s{0,2})/i;
@@ -16,7 +16,7 @@ import { strings } from '../constants';
16
16
  * ' ~ 2022-02-15 00:00:00' => { monthLeft: { dateInput: '', timeInput: '' }, monthRight: { dateInput: '2022-02-15', timeInput: '00:00:00' } }
17
17
  * ```
18
18
  */
19
- export default function getInsetInputValueFromInsetInputStr(options: { inputValue: string; rangeSeparator: string, type: typeof strings.TYPE_SET[number] }) {
19
+ export default function getInsetInputValueFromInsetInputStr(options: { inputValue: string; rangeSeparator: string; type: typeof strings.TYPE_SET[number] }) {
20
20
  const timeSeparator = ' ';
21
21
  const { inputValue = '', rangeSeparator, type } = options;
22
22
  let leftDateInput, leftTimeInput, rightDateInput, rightTimeInput;
@@ -46,7 +46,7 @@ export function isValueParseValid(options: {
46
46
  value: string;
47
47
  formatToken: string;
48
48
  baseDate?: Date;
49
- locale?: Locale;
49
+ locale?: Locale
50
50
  }) {
51
51
  const { value, locale, formatToken } = options;
52
52
  const baseDate = options.baseDate || new Date();
@@ -2,12 +2,26 @@
2
2
  @import "./variables.scss";
3
3
 
4
4
  $module: #{$prefix}-datepicker;
5
+ $module-list: #{$prefix}-scrolllist;
5
6
 
6
7
  .#{$module} {
7
8
  box-sizing: border-box;
8
9
  display: inline-block;
9
10
  vertical-align: top;
10
11
 
12
+ .#{$module-list}-body {
13
+ .#{$module-list}-item {
14
+ -ms-overflow-style: none; /* Internet Explorer 10+ */
15
+ scrollbar-width: none; /* Firefox */
16
+
17
+ &::-webkit-scrollbar {
18
+ display: none;
19
+ width: 0;
20
+ height: 0;
21
+ }
22
+ }
23
+ }
24
+
11
25
  // 双月网格
12
26
 
13
27
  &-month-grid {