@douyinfe/semi-foundation 2.36.0-beta.0 → 2.36.0

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 (415) hide show
  1. package/calendar/foundation.ts +2 -1
  2. package/lib/cjs/anchor/constants.js +0 -2
  3. package/lib/cjs/anchor/foundation.js +10 -73
  4. package/lib/cjs/anchor/linkFoundation.js +4 -16
  5. package/lib/cjs/autoComplete/constants.js +0 -3
  6. package/lib/cjs/autoComplete/foundation.d.ts +1 -1
  7. package/lib/cjs/autoComplete/foundation.js +25 -139
  8. package/lib/cjs/autoComplete/optionFoundation.js +4 -14
  9. package/lib/cjs/avatar/constants.js +0 -2
  10. package/lib/cjs/avatar/foundation.js +0 -17
  11. package/lib/cjs/backtop/constants.js +0 -2
  12. package/lib/cjs/backtop/foundation.d.ts +2 -2
  13. package/lib/cjs/backtop/foundation.js +0 -21
  14. package/lib/cjs/badge/constants.js +0 -2
  15. package/lib/cjs/banner/constants.js +0 -2
  16. package/lib/cjs/banner/foundation.js +0 -7
  17. package/lib/cjs/base/constants.js +2 -4
  18. package/lib/cjs/base/foundation.d.ts +1 -1
  19. package/lib/cjs/base/foundation.js +12 -46
  20. package/lib/cjs/base/index.js +0 -3
  21. package/lib/cjs/breadcrumb/constants.js +0 -2
  22. package/lib/cjs/breadcrumb/foundation.js +1 -12
  23. package/lib/cjs/breadcrumb/itemFoundation.js +0 -7
  24. package/lib/cjs/button/constants.js +0 -2
  25. package/lib/cjs/calendar/constants.js +0 -2
  26. package/lib/cjs/calendar/eventUtil.d.ts +1 -1
  27. package/lib/cjs/calendar/eventUtil.js +2 -74
  28. package/lib/cjs/calendar/foundation.d.ts +2 -2
  29. package/lib/cjs/calendar/foundation.js +28 -123
  30. package/lib/cjs/card/constants.js +0 -2
  31. package/lib/cjs/carousel/constants.js +0 -2
  32. package/lib/cjs/carousel/foundation.js +2 -52
  33. package/lib/cjs/cascader/constants.js +0 -3
  34. package/lib/cjs/cascader/foundation.d.ts +4 -4
  35. package/lib/cjs/cascader/foundation.js +28 -242
  36. package/lib/cjs/cascader/util.js +6 -24
  37. package/lib/cjs/checkbox/checkboxFoundation.js +2 -38
  38. package/lib/cjs/checkbox/checkboxGroupFoundation.js +2 -23
  39. package/lib/cjs/checkbox/constants.js +0 -2
  40. package/lib/cjs/collapse/constants.js +0 -2
  41. package/lib/cjs/collapse/foundation.d.ts +1 -1
  42. package/lib/cjs/collapse/foundation.js +2 -13
  43. package/lib/cjs/collapsible/constants.js +0 -2
  44. package/lib/cjs/collapsible/foundation.js +0 -9
  45. package/lib/cjs/datePicker/_utils/formatter.js +4 -10
  46. package/lib/cjs/datePicker/_utils/getDayOfWeek.d.ts +1 -1
  47. package/lib/cjs/datePicker/_utils/getDayOfWeek.js +0 -4
  48. package/lib/cjs/datePicker/_utils/getDefaultFormatToken.js +0 -5
  49. package/lib/cjs/datePicker/_utils/getDefaultPickerDate.d.ts +1 -1
  50. package/lib/cjs/datePicker/_utils/getDefaultPickerDate.js +0 -15
  51. package/lib/cjs/datePicker/_utils/getFullDateOffset.js +0 -7
  52. package/lib/cjs/datePicker/_utils/getInsetInputFormatToken.js +0 -5
  53. package/lib/cjs/datePicker/_utils/getInsetInputValueFromInsetInputStr.js +0 -6
  54. package/lib/cjs/datePicker/_utils/getMonthTable.d.ts +1 -1
  55. package/lib/cjs/datePicker/_utils/getMonthTable.js +3 -14
  56. package/lib/cjs/datePicker/_utils/getMonthsInYear.js +0 -2
  57. package/lib/cjs/datePicker/_utils/getYears.js +0 -4
  58. package/lib/cjs/datePicker/_utils/index.js +0 -13
  59. package/lib/cjs/datePicker/_utils/isAfter.js +0 -4
  60. package/lib/cjs/datePicker/_utils/isBefore.js +0 -4
  61. package/lib/cjs/datePicker/_utils/isBetween.js +0 -4
  62. package/lib/cjs/datePicker/_utils/isDate.js +0 -1
  63. package/lib/cjs/datePicker/_utils/isSameDay.js +0 -4
  64. package/lib/cjs/datePicker/_utils/isTimestamp.js +0 -4
  65. package/lib/cjs/datePicker/_utils/isUnixTimestamp.js +0 -4
  66. package/lib/cjs/datePicker/_utils/isValidDate.js +0 -1
  67. package/lib/cjs/datePicker/_utils/isValidTimeZone.js +0 -1
  68. package/lib/cjs/datePicker/_utils/isWithinInterval.js +0 -4
  69. package/lib/cjs/datePicker/_utils/parser.js +0 -10
  70. package/lib/cjs/datePicker/constants.js +0 -3
  71. package/lib/cjs/datePicker/foundation.d.ts +24 -24
  72. package/lib/cjs/datePicker/foundation.js +22 -333
  73. package/lib/cjs/datePicker/inputFoundation.d.ts +3 -3
  74. package/lib/cjs/datePicker/inputFoundation.js +5 -86
  75. package/lib/cjs/datePicker/monthFoundation.d.ts +1 -1
  76. package/lib/cjs/datePicker/monthFoundation.js +3 -28
  77. package/lib/cjs/datePicker/monthsGridFoundation.d.ts +3 -3
  78. package/lib/cjs/datePicker/monthsGridFoundation.js +43 -238
  79. package/lib/cjs/datePicker/yearAndMonthFoundation.d.ts +1 -1
  80. package/lib/cjs/datePicker/yearAndMonthFoundation.js +12 -38
  81. package/lib/cjs/descriptions/constants.js +0 -2
  82. package/lib/cjs/divider/constants.js +0 -2
  83. package/lib/cjs/dropdown/constants.js +0 -3
  84. package/lib/cjs/dropdown/foundation.js +4 -23
  85. package/lib/cjs/dropdown/menuFoundation.js +8 -27
  86. package/lib/cjs/empty/constants.js +0 -2
  87. package/lib/cjs/form/constants.js +0 -2
  88. package/lib/cjs/form/foundation.js +75 -206
  89. package/lib/cjs/form/interface.d.ts +5 -5
  90. package/lib/cjs/form/utils.js +47 -77
  91. package/lib/cjs/grid/constants.js +0 -2
  92. package/lib/cjs/highlight/constants.js +0 -2
  93. package/lib/cjs/icons/constants.js +0 -2
  94. package/lib/cjs/image/constants.js +0 -2
  95. package/lib/cjs/image/imageFoundation.js +4 -18
  96. package/lib/cjs/image/previewFooterFoundation.js +0 -13
  97. package/lib/cjs/image/previewFoundation.js +0 -11
  98. package/lib/cjs/image/previewImageFoundation.js +6 -80
  99. package/lib/cjs/image/previewInnerFoundation.js +12 -77
  100. package/lib/cjs/image/utils.js +0 -14
  101. package/lib/cjs/input/constants.js +0 -2
  102. package/lib/cjs/input/foundation.js +17 -101
  103. package/lib/cjs/input/textareaFoundation.js +20 -85
  104. package/lib/cjs/input/util/calculateNodeHeight.js +6 -18
  105. package/lib/cjs/input/util/getSizingData.js +7 -11
  106. package/lib/cjs/inputNumber/constants.js +0 -2
  107. package/lib/cjs/inputNumber/foundation.js +29 -192
  108. package/lib/cjs/layout/constants.js +0 -2
  109. package/lib/cjs/list/constants.js +0 -2
  110. package/lib/cjs/modal/constants.js +0 -2
  111. package/lib/cjs/modal/modalContentFoundation.js +0 -20
  112. package/lib/cjs/modal/modalFoundation.d.ts +2 -2
  113. package/lib/cjs/modal/modalFoundation.js +2 -22
  114. package/lib/cjs/navigation/NavItem.js +0 -10
  115. package/lib/cjs/navigation/constants.js +0 -3
  116. package/lib/cjs/navigation/foundation.js +3 -67
  117. package/lib/cjs/navigation/itemFoundation.js +3 -21
  118. package/lib/cjs/navigation/subNavFoundation.js +4 -40
  119. package/lib/cjs/notification/constants.js +0 -3
  120. package/lib/cjs/notification/notificationFoundation.d.ts +3 -3
  121. package/lib/cjs/notification/notificationFoundation.js +0 -16
  122. package/lib/cjs/notification/notificationListFoundation.js +7 -17
  123. package/lib/cjs/overflowList/constants.js +0 -2
  124. package/lib/cjs/overflowList/foundation.js +11 -41
  125. package/lib/cjs/pagination/constants.js +0 -2
  126. package/lib/cjs/pagination/foundation.d.ts +3 -3
  127. package/lib/cjs/pagination/foundation.js +21 -90
  128. package/lib/cjs/popconfirm/constants.js +0 -2
  129. package/lib/cjs/popconfirm/popconfirmFoundation.js +1 -21
  130. package/lib/cjs/popover/constants.js +0 -3
  131. package/lib/cjs/progress/constants.js +0 -2
  132. package/lib/cjs/progress/generates.d.ts +2 -2
  133. package/lib/cjs/progress/generates.js +19 -60
  134. package/lib/cjs/radio/constants.js +0 -2
  135. package/lib/cjs/radio/radioFoundation.js +0 -14
  136. package/lib/cjs/radio/radioGroupFoundation.js +4 -23
  137. package/lib/cjs/radio/radioInnerFoundation.js +2 -19
  138. package/lib/cjs/rating/constants.js +0 -2
  139. package/lib/cjs/rating/foundation.js +11 -61
  140. package/lib/cjs/scrollList/constants.js +0 -2
  141. package/lib/cjs/scrollList/foundation.js +0 -4
  142. package/lib/cjs/scrollList/itemFoundation.js +8 -61
  143. package/lib/cjs/scrollList/scrollTo.js +2 -5
  144. package/lib/cjs/select/constants.js +0 -3
  145. package/lib/cjs/select/foundation.d.ts +2 -2
  146. package/lib/cjs/select/foundation.js +122 -425
  147. package/lib/cjs/select/optionFoundation.js +4 -14
  148. package/lib/cjs/sideSheet/constants.js +0 -2
  149. package/lib/cjs/sideSheet/sideSheetFoundation.js +0 -18
  150. package/lib/cjs/skeleton/constants.js +0 -2
  151. package/lib/cjs/slider/constants.js +0 -2
  152. package/lib/cjs/slider/foundation.d.ts +1 -1
  153. package/lib/cjs/slider/foundation.js +25 -204
  154. package/lib/cjs/space/constants.js +0 -2
  155. package/lib/cjs/spin/constants.js +0 -2
  156. package/lib/cjs/spin/foundation.js +3 -13
  157. package/lib/cjs/steps/constants.js +0 -2
  158. package/lib/cjs/switch/constants.js +0 -2
  159. package/lib/cjs/switch/foundation.js +2 -18
  160. package/lib/cjs/table/bodyFoundation.js +2 -34
  161. package/lib/cjs/table/cellFoundation.js +0 -5
  162. package/lib/cjs/table/constants.js +7 -8
  163. package/lib/cjs/table/foundation.d.ts +17 -14
  164. package/lib/cjs/table/foundation.js +71 -302
  165. package/lib/cjs/table/tableRowFoundation.js +0 -11
  166. package/lib/cjs/table/tableSelectionCellFoundation.js +0 -6
  167. package/lib/cjs/table/utils.d.ts +2 -2
  168. package/lib/cjs/table/utils.js +5 -118
  169. package/lib/cjs/tabs/constants.js +0 -2
  170. package/lib/cjs/tabs/foundation.js +2 -40
  171. package/lib/cjs/tag/constants.js +1 -2
  172. package/lib/cjs/tagInput/constants.js +0 -2
  173. package/lib/cjs/tagInput/foundation.d.ts +4 -4
  174. package/lib/cjs/tagInput/foundation.js +4 -94
  175. package/lib/cjs/tagInput/utils/getSplitedArray.js +0 -11
  176. package/lib/cjs/timePicker/ComboxFoundation.js +4 -39
  177. package/lib/cjs/timePicker/constants.js +0 -3
  178. package/lib/cjs/timePicker/foundation.d.ts +1 -1
  179. package/lib/cjs/timePicker/foundation.js +3 -97
  180. package/lib/cjs/timePicker/inputFoundation.js +6 -25
  181. package/lib/cjs/timePicker/utils/index.js +6 -45
  182. package/lib/cjs/timePicker/utils/localeDate.js +0 -10
  183. package/lib/cjs/timeline/constants.js +0 -2
  184. package/lib/cjs/toast/constants.js +0 -3
  185. package/lib/cjs/toast/toastFoundation.d.ts +3 -3
  186. package/lib/cjs/toast/toastFoundation.js +0 -14
  187. package/lib/cjs/toast/toastListFoundation.js +4 -22
  188. package/lib/cjs/tooltip/constants.js +0 -2
  189. package/lib/cjs/tooltip/foundation.d.ts +1 -1
  190. package/lib/cjs/tooltip/foundation.js +63 -291
  191. package/lib/cjs/transfer/constants.js +0 -2
  192. package/lib/cjs/transfer/foundation.d.ts +1 -1
  193. package/lib/cjs/transfer/foundation.js +4 -68
  194. package/lib/cjs/transfer/transferUtils.js +5 -27
  195. package/lib/cjs/tree/constants.js +0 -2
  196. package/lib/cjs/tree/foundation.d.ts +3 -3
  197. package/lib/cjs/tree/foundation.js +34 -150
  198. package/lib/cjs/tree/treeUtil.js +54 -173
  199. package/lib/cjs/treeSelect/constants.js +0 -2
  200. package/lib/cjs/treeSelect/foundation.d.ts +7 -7
  201. package/lib/cjs/treeSelect/foundation.js +18 -192
  202. package/lib/cjs/typography/constants.js +0 -2
  203. package/lib/cjs/typography/formatNumeral.d.ts +3 -3
  204. package/lib/cjs/typography/formatNumeral.js +16 -32
  205. package/lib/cjs/upload/constants.js +0 -2
  206. package/lib/cjs/upload/foundation.d.ts +5 -5
  207. package/lib/cjs/upload/foundation.js +36 -245
  208. package/lib/cjs/upload/utils.js +10 -29
  209. package/lib/cjs/utils/Event.js +2 -21
  210. package/lib/cjs/utils/FocusHandle.d.ts +1 -1
  211. package/lib/cjs/utils/FocusHandle.js +6 -35
  212. package/lib/cjs/utils/Logger.js +0 -21
  213. package/lib/cjs/utils/Store.js +0 -10
  214. package/lib/cjs/utils/a11y.js +18 -43
  215. package/lib/cjs/utils/array.d.ts +1 -1
  216. package/lib/cjs/utils/array.js +0 -7
  217. package/lib/cjs/utils/arrayMove.js +0 -1
  218. package/lib/cjs/utils/classnames.js +0 -12
  219. package/lib/cjs/utils/date-fns-extra.js +0 -35
  220. package/lib/cjs/utils/dom.d.ts +1 -1
  221. package/lib/cjs/utils/dom.js +0 -13
  222. package/lib/cjs/utils/function.js +0 -1
  223. package/lib/cjs/utils/getDataAttr.js +0 -2
  224. package/lib/cjs/utils/getHighlight.js +5 -26
  225. package/lib/cjs/utils/getMotionObjFromProps.js +0 -12
  226. package/lib/cjs/utils/index.js +0 -4
  227. package/lib/cjs/utils/isBothNaN.js +0 -2
  228. package/lib/cjs/utils/isElement.js +0 -1
  229. package/lib/cjs/utils/isEnterPress.js +0 -5
  230. package/lib/cjs/utils/isEscPress.js +0 -5
  231. package/lib/cjs/utils/isNullOrUndefined.js +0 -1
  232. package/lib/cjs/utils/isNumber.js +0 -1
  233. package/lib/cjs/utils/isObject.js +0 -1
  234. package/lib/cjs/utils/isPromise.js +0 -3
  235. package/lib/cjs/utils/isString.js +0 -1
  236. package/lib/cjs/utils/keyCode.js +0 -105
  237. package/lib/cjs/utils/log.js +0 -5
  238. package/lib/cjs/utils/number.js +0 -2
  239. package/lib/cjs/utils/object.d.ts +4 -4
  240. package/lib/cjs/utils/object.js +12 -34
  241. package/lib/cjs/utils/set.js +0 -8
  242. package/lib/cjs/utils/shallowEqualObjects.js +0 -7
  243. package/lib/cjs/utils/touchPolyfill.js +0 -7
  244. package/lib/cjs/utils/type.d.ts +3 -3
  245. package/lib/cjs/utils/uuid.js +2 -9
  246. package/lib/cjs/utils/warning.js +0 -1
  247. package/lib/es/anchor/foundation.js +10 -66
  248. package/lib/es/anchor/linkFoundation.js +4 -12
  249. package/lib/es/autoComplete/foundation.d.ts +1 -1
  250. package/lib/es/autoComplete/foundation.js +24 -132
  251. package/lib/es/autoComplete/optionFoundation.js +4 -10
  252. package/lib/es/avatar/foundation.js +0 -12
  253. package/lib/es/backtop/foundation.d.ts +2 -2
  254. package/lib/es/backtop/foundation.js +0 -16
  255. package/lib/es/banner/foundation.js +0 -3
  256. package/lib/es/base/constants.js +2 -2
  257. package/lib/es/base/foundation.d.ts +1 -1
  258. package/lib/es/base/foundation.js +11 -44
  259. package/lib/es/breadcrumb/foundation.js +0 -7
  260. package/lib/es/breadcrumb/itemFoundation.js +0 -3
  261. package/lib/es/calendar/eventUtil.d.ts +1 -1
  262. package/lib/es/calendar/eventUtil.js +2 -36
  263. package/lib/es/calendar/foundation.d.ts +2 -2
  264. package/lib/es/calendar/foundation.js +28 -117
  265. package/lib/es/carousel/foundation.js +2 -47
  266. package/lib/es/cascader/constants.js +0 -1
  267. package/lib/es/cascader/foundation.d.ts +4 -4
  268. package/lib/es/cascader/foundation.js +30 -226
  269. package/lib/es/cascader/util.js +6 -15
  270. package/lib/es/checkbox/checkboxFoundation.js +2 -34
  271. package/lib/es/checkbox/checkboxGroupFoundation.js +2 -20
  272. package/lib/es/collapse/foundation.d.ts +1 -1
  273. package/lib/es/collapse/foundation.js +2 -9
  274. package/lib/es/collapsible/foundation.js +0 -7
  275. package/lib/es/datePicker/_utils/formatter.js +4 -8
  276. package/lib/es/datePicker/_utils/getDayOfWeek.d.ts +1 -1
  277. package/lib/es/datePicker/_utils/getDayOfWeek.js +0 -3
  278. package/lib/es/datePicker/_utils/getDefaultFormatToken.js +0 -2
  279. package/lib/es/datePicker/_utils/getDefaultPickerDate.d.ts +1 -1
  280. package/lib/es/datePicker/_utils/getDefaultPickerDate.js +0 -10
  281. package/lib/es/datePicker/_utils/getFullDateOffset.js +0 -3
  282. package/lib/es/datePicker/_utils/getInsetInputFormatToken.js +0 -4
  283. package/lib/es/datePicker/_utils/getInsetInputValueFromInsetInputStr.js +0 -5
  284. package/lib/es/datePicker/_utils/getMonthTable.d.ts +1 -1
  285. package/lib/es/datePicker/_utils/getMonthTable.js +4 -14
  286. package/lib/es/datePicker/_utils/getMonthsInYear.js +0 -1
  287. package/lib/es/datePicker/_utils/getYears.js +0 -3
  288. package/lib/es/datePicker/_utils/isBetween.js +0 -1
  289. package/lib/es/datePicker/_utils/parser.js +0 -8
  290. package/lib/es/datePicker/foundation.d.ts +24 -24
  291. package/lib/es/datePicker/foundation.js +22 -318
  292. package/lib/es/datePicker/inputFoundation.d.ts +3 -3
  293. package/lib/es/datePicker/inputFoundation.js +5 -74
  294. package/lib/es/datePicker/monthFoundation.d.ts +1 -1
  295. package/lib/es/datePicker/monthFoundation.js +4 -22
  296. package/lib/es/datePicker/monthsGridFoundation.d.ts +3 -3
  297. package/lib/es/datePicker/monthsGridFoundation.js +42 -222
  298. package/lib/es/datePicker/yearAndMonthFoundation.d.ts +1 -1
  299. package/lib/es/datePicker/yearAndMonthFoundation.js +12 -36
  300. package/lib/es/dropdown/foundation.js +4 -18
  301. package/lib/es/dropdown/menuFoundation.js +8 -22
  302. package/lib/es/form/foundation.js +74 -195
  303. package/lib/es/form/interface.d.ts +5 -5
  304. package/lib/es/form/utils.js +47 -70
  305. package/lib/es/image/imageFoundation.js +4 -13
  306. package/lib/es/image/previewFooterFoundation.js +0 -9
  307. package/lib/es/image/previewFoundation.js +0 -7
  308. package/lib/es/image/previewImageFoundation.js +6 -72
  309. package/lib/es/image/previewInnerFoundation.js +12 -70
  310. package/lib/es/image/utils.js +0 -6
  311. package/lib/es/input/foundation.js +17 -93
  312. package/lib/es/input/textareaFoundation.js +20 -75
  313. package/lib/es/input/util/calculateNodeHeight.js +6 -18
  314. package/lib/es/input/util/getSizingData.js +7 -11
  315. package/lib/es/inputNumber/foundation.js +28 -183
  316. package/lib/es/modal/modalContentFoundation.js +0 -15
  317. package/lib/es/modal/modalFoundation.d.ts +2 -2
  318. package/lib/es/modal/modalFoundation.js +2 -17
  319. package/lib/es/navigation/NavItem.js +0 -6
  320. package/lib/es/navigation/constants.js +1 -1
  321. package/lib/es/navigation/foundation.js +2 -60
  322. package/lib/es/navigation/itemFoundation.js +3 -18
  323. package/lib/es/navigation/subNavFoundation.js +4 -36
  324. package/lib/es/notification/constants.js +1 -1
  325. package/lib/es/notification/notificationFoundation.d.ts +3 -3
  326. package/lib/es/notification/notificationFoundation.js +0 -11
  327. package/lib/es/notification/notificationListFoundation.js +6 -13
  328. package/lib/es/overflowList/foundation.js +11 -37
  329. package/lib/es/pagination/foundation.d.ts +3 -3
  330. package/lib/es/pagination/foundation.js +20 -87
  331. package/lib/es/popconfirm/popconfirmFoundation.js +1 -16
  332. package/lib/es/progress/generates.d.ts +2 -2
  333. package/lib/es/progress/generates.js +19 -59
  334. package/lib/es/radio/radioFoundation.js +0 -9
  335. package/lib/es/radio/radioGroupFoundation.js +4 -19
  336. package/lib/es/radio/radioInnerFoundation.js +2 -15
  337. package/lib/es/rating/foundation.js +10 -54
  338. package/lib/es/scrollList/itemFoundation.js +8 -60
  339. package/lib/es/scrollList/scrollTo.js +2 -4
  340. package/lib/es/select/foundation.d.ts +2 -2
  341. package/lib/es/select/foundation.js +122 -411
  342. package/lib/es/select/optionFoundation.js +4 -10
  343. package/lib/es/sideSheet/sideSheetFoundation.js +0 -12
  344. package/lib/es/slider/foundation.d.ts +1 -1
  345. package/lib/es/slider/foundation.js +24 -197
  346. package/lib/es/spin/foundation.js +3 -11
  347. package/lib/es/switch/foundation.js +2 -13
  348. package/lib/es/table/bodyFoundation.js +2 -25
  349. package/lib/es/table/cellFoundation.js +0 -1
  350. package/lib/es/table/constants.js +6 -6
  351. package/lib/es/table/foundation.d.ts +17 -14
  352. package/lib/es/table/foundation.js +71 -309
  353. package/lib/es/table/tableRowFoundation.js +2 -9
  354. package/lib/es/table/tableSelectionCellFoundation.js +0 -2
  355. package/lib/es/table/utils.d.ts +2 -2
  356. package/lib/es/table/utils.js +5 -81
  357. package/lib/es/tabs/foundation.js +2 -35
  358. package/lib/es/tagInput/foundation.d.ts +4 -4
  359. package/lib/es/tagInput/foundation.js +4 -84
  360. package/lib/es/tagInput/utils/getSplitedArray.js +0 -7
  361. package/lib/es/timePicker/ComboxFoundation.js +4 -30
  362. package/lib/es/timePicker/foundation.d.ts +1 -1
  363. package/lib/es/timePicker/foundation.js +4 -90
  364. package/lib/es/timePicker/inputFoundation.js +6 -22
  365. package/lib/es/timePicker/utils/index.js +6 -25
  366. package/lib/es/timePicker/utils/localeDate.js +0 -8
  367. package/lib/es/toast/constants.js +1 -1
  368. package/lib/es/toast/toastFoundation.d.ts +3 -3
  369. package/lib/es/toast/toastFoundation.js +0 -9
  370. package/lib/es/toast/toastListFoundation.js +4 -18
  371. package/lib/es/tooltip/foundation.d.ts +1 -1
  372. package/lib/es/tooltip/foundation.js +63 -288
  373. package/lib/es/transfer/foundation.d.ts +1 -1
  374. package/lib/es/transfer/foundation.js +6 -62
  375. package/lib/es/transfer/transferUtils.js +5 -21
  376. package/lib/es/tree/foundation.d.ts +3 -3
  377. package/lib/es/tree/foundation.js +34 -143
  378. package/lib/es/tree/treeUtil.js +54 -139
  379. package/lib/es/treeSelect/foundation.d.ts +7 -7
  380. package/lib/es/treeSelect/foundation.js +20 -179
  381. package/lib/es/typography/formatNumeral.d.ts +3 -3
  382. package/lib/es/typography/formatNumeral.js +16 -29
  383. package/lib/es/upload/foundation.d.ts +5 -5
  384. package/lib/es/upload/foundation.js +36 -238
  385. package/lib/es/upload/utils.js +10 -24
  386. package/lib/es/utils/Event.js +2 -17
  387. package/lib/es/utils/FocusHandle.d.ts +1 -1
  388. package/lib/es/utils/FocusHandle.js +6 -32
  389. package/lib/es/utils/Logger.js +0 -20
  390. package/lib/es/utils/Store.js +0 -9
  391. package/lib/es/utils/a11y.js +18 -31
  392. package/lib/es/utils/array.d.ts +1 -1
  393. package/lib/es/utils/array.js +0 -5
  394. package/lib/es/utils/classnames.js +0 -10
  395. package/lib/es/utils/date-fns-extra.js +0 -27
  396. package/lib/es/utils/dom.d.ts +1 -1
  397. package/lib/es/utils/dom.js +0 -9
  398. package/lib/es/utils/getDataAttr.js +0 -1
  399. package/lib/es/utils/getHighlight.js +5 -26
  400. package/lib/es/utils/getMotionObjFromProps.js +0 -8
  401. package/lib/es/utils/isBothNaN.js +0 -1
  402. package/lib/es/utils/isEnterPress.js +0 -2
  403. package/lib/es/utils/isEscPress.js +0 -2
  404. package/lib/es/utils/keyCode.js +0 -104
  405. package/lib/es/utils/log.js +0 -3
  406. package/lib/es/utils/object.d.ts +4 -4
  407. package/lib/es/utils/object.js +12 -28
  408. package/lib/es/utils/set.js +0 -5
  409. package/lib/es/utils/shallowEqualObjects.js +0 -6
  410. package/lib/es/utils/touchPolyfill.js +0 -5
  411. package/lib/es/utils/type.d.ts +3 -3
  412. package/lib/es/utils/uuid.js +2 -8
  413. package/package.json +2 -2
  414. package/table/foundation.ts +7 -10
  415. package/upload/foundation.ts +8 -8
@@ -3,12 +3,10 @@ import KeyCode from '../utils/keyCode';
3
3
  export default class ModalContentFoundation extends BaseFoundation {
4
4
  constructor(adapter) {
5
5
  super(Object.assign(Object.assign({}, ModalContentFoundation.defaultAdapter), adapter));
6
-
7
6
  this.handleKeyDown = e => {
8
7
  const {
9
8
  closeOnEsc
10
9
  } = this.getProps();
11
-
12
10
  if (closeOnEsc && e.keyCode === KeyCode.ESC) {
13
11
  e.stopPropagation();
14
12
  this.close(e);
@@ -16,57 +14,44 @@ export default class ModalContentFoundation extends BaseFoundation {
16
14
  }
17
15
  };
18
16
  }
19
-
20
17
  destroy() {
21
18
  this.handleKeyDownEventListenerUnmount();
22
19
  this.modalDialogBlur();
23
20
  this.prevFocusElementReFocus();
24
21
  }
25
-
26
22
  handleDialogMouseDown() {
27
23
  this._adapter.notifyDialogMouseDown();
28
24
  }
29
-
30
25
  handleMaskMouseUp() {
31
26
  this._adapter.notifyDialogMouseUp();
32
27
  }
33
-
34
28
  handleKeyDownEventListenerMount() {
35
29
  this._adapter.addKeyDownEventListener();
36
30
  }
37
-
38
31
  handleKeyDownEventListenerUnmount() {
39
32
  this._adapter.removeKeyDownEventListener();
40
33
  }
41
-
42
34
  getMouseState() {
43
35
  this._adapter.getMouseState();
44
36
  }
45
-
46
37
  handleMaskClick(e) {
47
38
  const {
48
39
  dialogMouseDown
49
40
  } = this.getStates();
50
-
51
41
  if (e.target === e.currentTarget && !dialogMouseDown) {
52
42
  this.close(e);
53
43
  }
54
44
  }
55
-
56
45
  close(e) {
57
46
  this._adapter.notifyClose(e);
58
47
  }
59
-
60
48
  modalDialogFocus() {
61
49
  this._adapter.modalDialogFocus();
62
50
  }
63
-
64
51
  modalDialogBlur() {
65
52
  this._adapter.modalDialogBlur();
66
53
  }
67
-
68
54
  prevFocusElementReFocus() {
69
55
  this._adapter.prevFocusElementReFocus();
70
56
  }
71
-
72
57
  }
@@ -1,6 +1,6 @@
1
1
  import BaseFoundation, { DefaultAdapter } from '../base/foundation';
2
- export declare type OKType = 'primary' | 'secondary' | 'tertiary' | 'warning' | 'danger';
3
- export declare type Size = 'small' | 'medium' | 'large' | 'full-width';
2
+ export type OKType = 'primary' | 'secondary' | 'tertiary' | 'warning' | 'danger';
3
+ export type Size = 'small' | 'medium' | 'large' | 'full-width';
4
4
  export interface ModalAdapter extends DefaultAdapter<ModalProps, ModalState> {
5
5
  disabledBodyScroll: () => void;
6
6
  enabledBodyScroll: () => void;
@@ -2,29 +2,24 @@ import BaseFoundation from '../base/foundation';
2
2
  import isPromise from "../utils/isPromise";
3
3
  export default class ModalFoundation extends BaseFoundation {
4
4
  constructor(adapter) {
5
- super(Object.assign({}, adapter)); // afterClose() {
5
+ super(Object.assign({}, adapter));
6
+ // afterClose() {
6
7
  // this._adapter.notifyClose();
7
8
  // }
8
-
9
9
  this.toggleDisplayNone = (displayNone, callback) => {
10
10
  this._adapter.toggleDisplayNone(displayNone, callback);
11
11
  };
12
12
  }
13
-
14
13
  destroy() {
15
14
  this.afterHide();
16
15
  }
17
-
18
16
  handleCancel(e) {
19
17
  var _a;
20
-
21
18
  const result = this._adapter.notifyCancel(e);
22
-
23
19
  if (isPromise(result)) {
24
20
  this._adapter.setState({
25
21
  onCancelReturnPromiseStatus: "pending"
26
22
  });
27
-
28
23
  (_a = result === null || result === void 0 ? void 0 : result.then(() => {
29
24
  this._adapter.setState({
30
25
  onCancelReturnPromiseStatus: "fulfilled"
@@ -33,22 +28,17 @@ export default class ModalFoundation extends BaseFoundation {
33
28
  this._adapter.setState({
34
29
  onCancelReturnPromiseStatus: "rejected"
35
30
  });
36
-
37
31
  throw e;
38
32
  });
39
33
  }
40
34
  }
41
-
42
35
  handleOk(e) {
43
36
  var _a;
44
-
45
37
  const result = this._adapter.notifyOk(e);
46
-
47
38
  if (isPromise(result)) {
48
39
  this._adapter.setState({
49
40
  onOKReturnPromiseStatus: "pending"
50
41
  });
51
-
52
42
  (_a = result === null || result === void 0 ? void 0 : result.then(() => {
53
43
  this._adapter.setState({
54
44
  onOKReturnPromiseStatus: "fulfilled"
@@ -57,20 +47,15 @@ export default class ModalFoundation extends BaseFoundation {
57
47
  this._adapter.setState({
58
48
  onOKReturnPromiseStatus: "rejected"
59
49
  });
60
-
61
50
  throw e;
62
51
  });
63
52
  }
64
53
  }
65
-
66
54
  beforeShow() {
67
55
  this._adapter.disabledBodyScroll();
68
56
  }
69
-
70
57
  afterHide() {
71
58
  this._adapter.enabledBodyScroll();
72
-
73
59
  this._adapter.notifyClose();
74
60
  }
75
-
76
61
  }
@@ -6,7 +6,6 @@ export const DEFAULT_TOGGLE_ICON = {
6
6
  export default class NavItem {
7
7
  constructor() {
8
8
  let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
9
-
10
9
  // eslint-disable-next-line eqeqeq
11
10
  if (options == null || typeof options !== 'object') {
12
11
  // eslint-disable-next-line no-param-reassign
@@ -22,14 +21,11 @@ export default class NavItem {
22
21
  indent: false
23
22
  };
24
23
  }
25
-
26
24
  for (const key of Object.keys(options)) {
27
25
  this[key] = options[key];
28
26
  }
29
-
30
27
  if (options.items && Array.isArray(options.items) && options.items.length) {
31
28
  this.items = options.items.map(item => new NavItem(item));
32
-
33
29
  if ('toggleIcon' in options) {
34
30
  this.toggleIcon = NavItem.isValidToggleIcon(options.toggleIcon) ? Object.assign({}, options.toggleIcon) : Object.assign({}, DEFAULT_TOGGLE_ICON);
35
31
  } else {
@@ -39,9 +35,7 @@ export default class NavItem {
39
35
  this.items = null;
40
36
  }
41
37
  }
42
-
43
38
  static isValidToggleIcon(toggleIcon) {
44
39
  return Boolean(toggleIcon && typeof toggleIcon === 'object' && typeof toggleIcon.open === 'string' && toggleIcon.open.length && typeof toggleIcon.closed === 'string' && toggleIcon.closed.length);
45
40
  }
46
-
47
41
  }
@@ -20,6 +20,6 @@ const numbers = {
20
20
  DEFAULT_TOOLTIP_HIDE_DELAY: 100,
21
21
  DEFAULT_SUBNAV_OPEN_DELAY: 0,
22
22
  DEFAULT_SUBNAV_CLOSE_DELAY: 100 // ms
23
-
24
23
  };
24
+
25
25
  export { cssClasses, strings, numbers };
@@ -1,7 +1,5 @@
1
1
  import _get from "lodash/get";
2
-
3
2
  /* eslint-disable max-depth */
4
-
5
3
  /* eslint-disable max-len */
6
4
  import BaseFoundation from '../base/foundation';
7
5
  import NavItem from './NavItem';
@@ -12,51 +10,40 @@ export default class NavigationFoundation extends BaseFoundation {
12
10
  super(Object.assign({}, adapter));
13
11
  }
14
12
  /* istanbul ignore next */
15
-
16
-
17
13
  static getZeroParentKeys() {
18
14
  let itemKeysMap = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
19
15
  const willAddKeys = [];
20
-
21
16
  for (var _len = arguments.length, itemKeys = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
22
17
  itemKeys[_key - 1] = arguments[_key];
23
18
  }
24
-
25
19
  if (itemKeys.length) {
26
20
  for (const itemKey of itemKeys) {
27
21
  if (Array.isArray(itemKeysMap[itemKey]) && itemKeysMap[itemKey].length) {
28
22
  const levelZeroParentKey = itemKeysMap[itemKey][0];
29
-
30
23
  if (!isNullOrUndefined(levelZeroParentKey)) {
31
24
  willAddKeys.push(levelZeroParentKey);
32
25
  }
33
26
  }
34
27
  }
35
28
  }
36
-
37
29
  return willAddKeys;
38
30
  }
39
-
40
31
  static buildItemKeysMap() {
41
32
  let items = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
42
33
  let keysMap = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
43
34
  let parentKeys = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
44
35
  let keyPropName = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'itemKey';
45
-
46
36
  if (Array.isArray(items) && items.length) {
47
37
  for (const item of items) {
48
38
  if (Array.isArray(item)) {
49
39
  NavigationFoundation.buildItemKeysMap(item, keysMap, [...parentKeys], keyPropName);
50
40
  } else {
51
41
  let itemKey;
52
-
53
42
  if (item && typeof item === 'object') {
54
43
  itemKey = item[keyPropName] || item.props && item.props[keyPropName];
55
44
  }
56
-
57
45
  if (itemKey) {
58
46
  keysMap[itemKey] = [...parentKeys];
59
-
60
47
  if (Array.isArray(item.items) && item.items.length) {
61
48
  NavigationFoundation.buildItemKeysMap(item.items, keysMap, [...parentKeys, itemKey], keyPropName);
62
49
  } else if (item.props && item.props.children) {
@@ -67,7 +54,6 @@ export default class NavigationFoundation extends BaseFoundation {
67
54
  }
68
55
  }
69
56
  }
70
-
71
57
  return keysMap;
72
58
  }
73
59
  /**
@@ -77,8 +63,6 @@ export default class NavigationFoundation extends BaseFoundation {
77
63
  * @param {*} lifecycle
78
64
  * @returns
79
65
  */
80
-
81
-
82
66
  init(lifecycle) {
83
67
  const {
84
68
  defaultSelectedKeys,
@@ -92,7 +76,6 @@ export default class NavigationFoundation extends BaseFoundation {
92
76
  } = this.getCalcState();
93
77
  const parentSelectKeys = this.selectLevelZeroParentKeys(itemKeysMap, willSelectedKeys);
94
78
  willSelectedKeys = willSelectedKeys.concat(parentSelectKeys);
95
-
96
79
  if (lifecycle === 'constructor') {
97
80
  return {
98
81
  selectedKeys: willSelectedKeys,
@@ -102,23 +85,16 @@ export default class NavigationFoundation extends BaseFoundation {
102
85
  };
103
86
  } else {
104
87
  this._adapter.updateSelectedKeys(willSelectedKeys);
105
-
106
88
  this._adapter.setItemKeysMap(itemKeysMap);
107
-
108
89
  this._adapter.updateOpenKeys(willOpenKeys);
109
-
110
90
  this._adapter.updateItems(formattedItems);
111
-
112
91
  this._adapter.setItemsChanged(true);
113
92
  }
114
-
115
93
  return undefined;
116
94
  }
117
95
  /**
118
96
  * Get the state to be calculated
119
97
  */
120
-
121
-
122
98
  getCalcState() {
123
99
  const {
124
100
  itemKeysMap,
@@ -134,8 +110,6 @@ export default class NavigationFoundation extends BaseFoundation {
134
110
  /**
135
111
  * Calculate formatted items and itemsKeyMap
136
112
  */
137
-
138
-
139
113
  getFormattedItems() {
140
114
  const {
141
115
  items,
@@ -153,8 +127,6 @@ export default class NavigationFoundation extends BaseFoundation {
153
127
  * Calculate the keys that will need to be opened soon
154
128
  * @param {*} itemKeysMap
155
129
  */
156
-
157
-
158
130
  getWillOpenKeys(itemKeysMap) {
159
131
  const {
160
132
  defaultOpenKeys,
@@ -164,114 +136,84 @@ export default class NavigationFoundation extends BaseFoundation {
164
136
  mode
165
137
  } = this.getProps();
166
138
  let willOpenKeys = openKeys || defaultOpenKeys || [];
167
-
168
139
  if (!(Array.isArray(defaultOpenKeys) || Array.isArray(openKeys)) && mode === strings.MODE_VERTICAL && (Array.isArray(defaultSelectedKeys) || Array.isArray(selectedKeys))) {
169
140
  const currentSelectedKeys = Array.isArray(selectedKeys) ? selectedKeys : defaultSelectedKeys;
170
141
  willOpenKeys = this.getShouldOpenKeys(itemKeysMap, currentSelectedKeys);
171
142
  }
172
-
173
143
  return [...willOpenKeys];
174
144
  }
175
-
176
145
  getShouldOpenKeys() {
177
146
  let itemKeysMap = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
178
147
  let selectedKeys = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
179
148
  const willOpenKeySet = new Set();
180
-
181
149
  if (Array.isArray(selectedKeys) && selectedKeys.length) {
182
150
  selectedKeys.forEach(item => {
183
151
  if (item) {
184
152
  const parentKeys = _get(itemKeysMap, item);
185
-
186
153
  if (Array.isArray(parentKeys)) {
187
154
  parentKeys.forEach(k => willOpenKeySet.add(k));
188
155
  }
189
156
  }
190
157
  });
191
158
  }
192
-
193
159
  return [...willOpenKeySet];
194
160
  }
195
-
196
161
  destroy() {} // eslint-disable-line
197
-
198
-
199
162
  selectLevelZeroParentKeys(itemKeysMap) {
200
- const _itemKeysMap = isNullOrUndefined(itemKeysMap) ? this.getState('itemKeysMap') : itemKeysMap; // console.log(itemKeysMap);
201
-
202
-
163
+ const _itemKeysMap = isNullOrUndefined(itemKeysMap) ? this.getState('itemKeysMap') : itemKeysMap;
164
+ // console.log(itemKeysMap);
203
165
  const willAddKeys = [];
204
-
205
166
  for (var _len2 = arguments.length, itemKeys = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
206
167
  itemKeys[_key2 - 1] = arguments[_key2];
207
168
  }
208
-
209
169
  if (itemKeys.length) {
210
170
  for (const itemKey of itemKeys) {
211
171
  if (Array.isArray(_itemKeysMap[itemKey]) && _itemKeysMap[itemKey].length) {
212
172
  const levelZeroParentKey = _itemKeysMap[itemKey][0];
213
-
214
173
  if (!isNullOrUndefined(levelZeroParentKey)) {
215
174
  willAddKeys.push(levelZeroParentKey);
216
175
  }
217
176
  }
218
177
  }
219
178
  }
220
-
221
179
  if (willAddKeys.length) {
222
180
  return willAddKeys;
223
181
  }
224
-
225
182
  return [];
226
183
  }
227
-
228
184
  formatItems() {
229
185
  let items = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
230
186
  const formattedItems = [];
231
-
232
187
  for (const item of items) {
233
188
  formattedItems.push(new NavItem(item));
234
189
  }
235
-
236
190
  return formattedItems;
237
191
  }
238
-
239
192
  handleSelect(data) {
240
193
  this._adapter.notifySelect(data);
241
194
  }
242
195
  /* istanbul ignore next */
243
-
244
-
245
196
  judgeIfOpen(openKeys, items) {
246
197
  let shouldBeOpen = false;
247
-
248
198
  const _openKeys = Array.isArray(openKeys) ? openKeys : openKeys && [openKeys];
249
-
250
199
  if (_openKeys && Array.isArray(items) && items.length) {
251
200
  for (const item of items) {
252
201
  shouldBeOpen = _openKeys.includes(item.itemKey) || this.judgeIfOpen(_openKeys, item.items);
253
-
254
202
  if (shouldBeOpen) {
255
203
  break;
256
204
  }
257
205
  }
258
206
  }
259
-
260
207
  return shouldBeOpen;
261
208
  }
262
-
263
209
  handleCollapseChange() {
264
210
  const isCollapsed = !this.getState('isCollapsed');
265
-
266
211
  if (!this._isControlledComponent('isCollapsed')) {
267
212
  this._adapter.setIsCollapsed(isCollapsed);
268
213
  }
269
-
270
214
  this._adapter.notifyCollapseChange(isCollapsed);
271
215
  }
272
-
273
216
  handleItemsChange(isChanged) {
274
217
  this._adapter.setItemsChanged(isChanged);
275
218
  }
276
-
277
219
  }
@@ -1,25 +1,22 @@
1
1
  import _get from "lodash/get";
2
+ /* argus-disable unPkgSensitiveInfo */
2
3
  import BaseFoundation from '../base/foundation';
3
4
  import isEnterPress from '../utils/isEnterPress';
4
5
  export default class ItemFoundation extends BaseFoundation {
5
6
  constructor(adapter) {
6
7
  super(Object.assign({}, adapter));
7
8
  }
8
-
9
9
  init() {
10
10
  this._timer = null;
11
11
  this._mounted = true;
12
12
  }
13
-
14
13
  destroy() {
15
14
  this._mounted = false;
16
15
  }
17
-
18
16
  isValidKey(itemKey) {
19
17
  // eslint-disable-next-line eqeqeq
20
18
  return itemKey != null && (typeof itemKey === 'string' || typeof itemKey === 'number');
21
19
  }
22
-
23
20
  handleClick(e) {
24
21
  const {
25
22
  isSubNav,
@@ -27,22 +24,18 @@ export default class ItemFoundation extends BaseFoundation {
27
24
  text,
28
25
  disabled
29
26
  } = this.getProps();
30
-
31
27
  if (disabled) {
32
28
  return;
33
29
  }
34
-
35
30
  if (!isSubNav && this.isValidKey(itemKey) && !this._adapter.getSelectedKeysIsControlled() && !this._adapter.getSelected()) {
36
31
  this._adapter.updateSelected(true);
37
32
  }
38
-
39
- const selectedKeys = [itemKey]; // If the current item is subNav, there is no need to trigger the global onSelect/onClick event, instead, the SubNav component will trigger the click event
40
-
33
+ const selectedKeys = [itemKey];
34
+ // If the current item is subNav, there is no need to trigger the global onSelect/onClick event, instead, the SubNav component will trigger the click event
41
35
  if (!isSubNav) {
42
36
  if (!this._adapter.getSelected()) {
43
37
  // internal-issues:51
44
38
  const selectedItems = [this._adapter.cloneDeep(this.getProps())];
45
-
46
39
  this._adapter.notifyGlobalOnSelect({
47
40
  itemKey,
48
41
  selectedKeys,
@@ -50,14 +43,12 @@ export default class ItemFoundation extends BaseFoundation {
50
43
  domEvent: e
51
44
  });
52
45
  }
53
-
54
46
  this._adapter.notifyGlobalOnClick({
55
47
  itemKey,
56
48
  text,
57
49
  domEvent: e
58
50
  });
59
51
  }
60
-
61
52
  this._adapter.notifyClick({
62
53
  itemKey,
63
54
  text,
@@ -67,23 +58,17 @@ export default class ItemFoundation extends BaseFoundation {
67
58
  /**
68
59
  * A11y: simulate item click
69
60
  */
70
-
71
-
72
61
  handleKeyPress(e) {
73
62
  if (isEnterPress(e)) {
74
63
  const {
75
64
  link,
76
65
  linkOptions
77
66
  } = this.getProps();
78
-
79
67
  const target = _get(linkOptions, 'target', '_self');
80
-
81
68
  this.handleClick(e);
82
-
83
69
  if (typeof link === 'string') {
84
70
  target === '_blank' ? window.open(link) : window.location.href = link;
85
71
  }
86
72
  }
87
73
  }
88
-
89
74
  }
@@ -1,72 +1,54 @@
1
1
  import BaseFoundation from '../base/foundation';
2
2
  import isEnterPress from '../utils/isEnterPress';
3
-
4
3
  const addKeys = function addKeys() {
5
4
  let originKeys = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
6
5
  const keySet = new Set(originKeys);
7
-
8
6
  for (var _len = arguments.length, willAddKeys = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
9
7
  willAddKeys[_key - 1] = arguments[_key];
10
8
  }
11
-
12
9
  willAddKeys.forEach(key => key && keySet.add(key));
13
10
  return Array.from(keySet);
14
11
  };
15
-
16
12
  const removeKeys = function removeKeys() {
17
13
  let originKeys = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
18
14
  const keySet = new Set(originKeys);
19
-
20
15
  for (var _len2 = arguments.length, willRemoveKeys = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
21
16
  willRemoveKeys[_key2 - 1] = arguments[_key2];
22
17
  }
23
-
24
18
  willRemoveKeys.forEach(key => key && keySet.delete(key));
25
19
  return Array.from(keySet);
26
20
  };
27
-
28
21
  export default class SubNavFoundation extends BaseFoundation {
29
22
  constructor(adapter) {
30
23
  super(Object.assign({}, adapter));
31
24
  }
32
-
33
25
  init() {
34
26
  // this.log('invoke SubNavFoundation init()');
35
27
  this._timer = null;
36
28
  }
37
-
38
29
  destroy() {} // eslint-disable-line
39
-
40
-
41
30
  clearDelayTimer() {
42
31
  if (this._timer) {
43
32
  clearTimeout(this._timer);
44
33
  this._timer = null;
45
34
  }
46
35
  }
47
-
48
36
  isValidKey(itemKey) {
49
37
  // eslint-disable-next-line eqeqeq
50
38
  return itemKey != null && (typeof itemKey === 'number' || typeof itemKey === 'string');
51
39
  }
52
-
53
40
  handleDropdownVisibleChange(visible) {
54
41
  const itemKey = this.getProp('itemKey');
55
-
56
42
  const openKeysIsControlled = this._adapter.getOpenKeysIsControlled();
57
-
58
43
  const canUpdateOpenKeys = this._adapter.getCanUpdateOpenKeys();
59
-
60
44
  const rawOpenKeys = this._adapter.getOpenKeys();
61
-
62
45
  const openKeys = visible ? addKeys(rawOpenKeys, itemKey) : removeKeys(rawOpenKeys, itemKey);
63
46
  this.clearDelayTimer();
64
-
65
47
  if (!openKeysIsControlled) {
66
48
  if (canUpdateOpenKeys) {
67
49
  this._adapter.updateOpen(visible);
68
- } // this._adapter.updateIsHovered(visible);
69
-
50
+ }
51
+ // this._adapter.updateIsHovered(visible);
70
52
  }
71
53
 
72
54
  this._adapter.notifyGlobalOpenChange({
@@ -80,28 +62,22 @@ export default class SubNavFoundation extends BaseFoundation {
80
62
  * @param {Event} e
81
63
  * @param {HTMLElement} titleRef
82
64
  */
83
-
84
-
85
65
  handleClick(e, titleRef) {
86
66
  const {
87
67
  itemKey,
88
68
  disabled
89
69
  } = this.getProps();
90
-
91
70
  if (disabled) {
92
71
  return;
93
- } // this.log(e, titleRef, titleRef.contains(e.target));
94
-
95
-
72
+ }
73
+ // this.log(e, titleRef, titleRef.contains(e.target));
96
74
  const clickedDomIsTitle = titleRef && titleRef.contains(e.target);
97
75
  let isOpen = Boolean(this._adapter.getIsOpen());
98
-
99
76
  if (!clickedDomIsTitle) {
100
77
  isOpen = false;
101
78
  } else {
102
79
  isOpen = !isOpen;
103
80
  }
104
-
105
81
  const openKeys = isOpen ? addKeys(this._adapter.getOpenKeys(), itemKey) : removeKeys(this._adapter.getOpenKeys(), itemKey);
106
82
  const cbVal = {
107
83
  itemKey,
@@ -109,17 +85,12 @@ export default class SubNavFoundation extends BaseFoundation {
109
85
  isOpen,
110
86
  domEvent: e
111
87
  };
112
-
113
88
  const openKeysIsControlled = this._adapter.getOpenKeysIsControlled();
114
-
115
89
  const canUpdateOpenKeys = this._adapter.getCanUpdateOpenKeys();
116
-
117
90
  if (!openKeysIsControlled && canUpdateOpenKeys) {
118
91
  this._adapter.updateOpen(isOpen);
119
92
  }
120
-
121
93
  this._adapter.notifyGlobalOpenChange(cbVal);
122
-
123
94
  this._adapter.notifyGlobalOnClick(cbVal);
124
95
  }
125
96
  /**
@@ -127,12 +98,9 @@ export default class SubNavFoundation extends BaseFoundation {
127
98
  * @param e
128
99
  * @param titleRef
129
100
  */
130
-
131
-
132
101
  handleKeyPress(e, titleRef) {
133
102
  if (isEnterPress(e)) {
134
103
  this.handleClick(e, titleRef);
135
104
  }
136
105
  }
137
-
138
106
  }
@@ -11,6 +11,6 @@ const strings = {
11
11
  };
12
12
  const numbers = {
13
13
  duration: 3 // default close time, unit: s
14
-
15
14
  };
15
+
16
16
  export { cssClasses, strings, numbers };
@@ -1,8 +1,8 @@
1
1
  import BaseFoundation, { DefaultAdapter } from '../base/foundation';
2
2
  import { strings } from '../notification/constants';
3
- export declare type NoticePosition = 'top' | 'bottom' | 'topLeft' | 'topRight' | 'bottomLeft' | 'bottomRight';
4
- export declare type NoticeType = 'warning' | 'success' | 'info' | 'error' | 'default';
5
- export declare type NoticeTheme = 'light' | 'normal';
3
+ export type NoticePosition = 'top' | 'bottom' | 'topLeft' | 'topRight' | 'bottomLeft' | 'bottomRight';
4
+ export type NoticeType = 'warning' | 'success' | 'info' | 'error' | 'default';
5
+ export type NoticeTheme = 'light' | 'normal';
6
6
  export interface NoticeProps {
7
7
  duration?: number;
8
8
  id?: string | number;