@douyinfe/semi-foundation 2.36.0-alpha.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 (477) hide show
  1. package/calendar/calendar.scss +1 -1
  2. package/calendar/foundation.ts +2 -1
  3. package/datePicker/_utils/getYears.ts +8 -4
  4. package/datePicker/foundation.ts +1 -1
  5. package/datePicker/monthsGridFoundation.ts +2 -1
  6. package/datePicker/yearAndMonthFoundation.ts +3 -1
  7. package/lib/cjs/anchor/constants.js +0 -2
  8. package/lib/cjs/anchor/foundation.js +10 -73
  9. package/lib/cjs/anchor/linkFoundation.js +4 -16
  10. package/lib/cjs/autoComplete/constants.js +0 -3
  11. package/lib/cjs/autoComplete/foundation.d.ts +1 -1
  12. package/lib/cjs/autoComplete/foundation.js +25 -139
  13. package/lib/cjs/autoComplete/optionFoundation.js +4 -14
  14. package/lib/cjs/avatar/constants.js +0 -2
  15. package/lib/cjs/avatar/foundation.js +0 -17
  16. package/lib/cjs/backtop/constants.js +0 -2
  17. package/lib/cjs/backtop/foundation.d.ts +2 -2
  18. package/lib/cjs/backtop/foundation.js +0 -21
  19. package/lib/cjs/badge/constants.js +0 -2
  20. package/lib/cjs/banner/constants.js +0 -2
  21. package/lib/cjs/banner/foundation.js +0 -7
  22. package/lib/cjs/base/constants.js +2 -4
  23. package/lib/cjs/base/foundation.d.ts +1 -1
  24. package/lib/cjs/base/foundation.js +12 -46
  25. package/lib/cjs/base/index.js +0 -3
  26. package/lib/cjs/breadcrumb/constants.js +0 -2
  27. package/lib/cjs/breadcrumb/foundation.js +1 -12
  28. package/lib/cjs/breadcrumb/itemFoundation.js +0 -7
  29. package/lib/cjs/button/constants.js +0 -2
  30. package/lib/cjs/calendar/calendar.css +2 -2
  31. package/lib/cjs/calendar/calendar.scss +1 -1
  32. package/lib/cjs/calendar/constants.js +0 -2
  33. package/lib/cjs/calendar/eventUtil.d.ts +1 -1
  34. package/lib/cjs/calendar/eventUtil.js +2 -74
  35. package/lib/cjs/calendar/foundation.d.ts +2 -2
  36. package/lib/cjs/calendar/foundation.js +28 -123
  37. package/lib/cjs/card/constants.js +0 -2
  38. package/lib/cjs/carousel/constants.js +0 -2
  39. package/lib/cjs/carousel/foundation.js +2 -52
  40. package/lib/cjs/cascader/constants.js +0 -3
  41. package/lib/cjs/cascader/foundation.d.ts +4 -4
  42. package/lib/cjs/cascader/foundation.js +28 -242
  43. package/lib/cjs/cascader/util.js +6 -24
  44. package/lib/cjs/checkbox/checkboxFoundation.js +2 -38
  45. package/lib/cjs/checkbox/checkboxGroupFoundation.js +2 -23
  46. package/lib/cjs/checkbox/constants.js +0 -2
  47. package/lib/cjs/collapse/constants.js +0 -2
  48. package/lib/cjs/collapse/foundation.d.ts +1 -1
  49. package/lib/cjs/collapse/foundation.js +2 -13
  50. package/lib/cjs/collapsible/constants.js +0 -2
  51. package/lib/cjs/collapsible/foundation.js +0 -9
  52. package/lib/cjs/datePicker/_utils/formatter.js +4 -10
  53. package/lib/cjs/datePicker/_utils/getDayOfWeek.d.ts +1 -1
  54. package/lib/cjs/datePicker/_utils/getDayOfWeek.js +0 -4
  55. package/lib/cjs/datePicker/_utils/getDefaultFormatToken.js +0 -5
  56. package/lib/cjs/datePicker/_utils/getDefaultPickerDate.d.ts +1 -1
  57. package/lib/cjs/datePicker/_utils/getDefaultPickerDate.js +0 -15
  58. package/lib/cjs/datePicker/_utils/getFullDateOffset.js +0 -7
  59. package/lib/cjs/datePicker/_utils/getInsetInputFormatToken.js +0 -5
  60. package/lib/cjs/datePicker/_utils/getInsetInputValueFromInsetInputStr.js +0 -6
  61. package/lib/cjs/datePicker/_utils/getMonthTable.d.ts +1 -1
  62. package/lib/cjs/datePicker/_utils/getMonthTable.js +3 -14
  63. package/lib/cjs/datePicker/_utils/getMonthsInYear.js +0 -2
  64. package/lib/cjs/datePicker/_utils/getYears.d.ts +1 -1
  65. package/lib/cjs/datePicker/_utils/getYears.js +9 -7
  66. package/lib/cjs/datePicker/_utils/index.js +0 -13
  67. package/lib/cjs/datePicker/_utils/isAfter.js +0 -4
  68. package/lib/cjs/datePicker/_utils/isBefore.js +0 -4
  69. package/lib/cjs/datePicker/_utils/isBetween.js +0 -4
  70. package/lib/cjs/datePicker/_utils/isDate.js +0 -1
  71. package/lib/cjs/datePicker/_utils/isSameDay.js +0 -4
  72. package/lib/cjs/datePicker/_utils/isTimestamp.js +0 -4
  73. package/lib/cjs/datePicker/_utils/isUnixTimestamp.js +0 -4
  74. package/lib/cjs/datePicker/_utils/isValidDate.js +0 -1
  75. package/lib/cjs/datePicker/_utils/isValidTimeZone.js +0 -1
  76. package/lib/cjs/datePicker/_utils/isWithinInterval.js +0 -4
  77. package/lib/cjs/datePicker/_utils/parser.js +0 -10
  78. package/lib/cjs/datePicker/constants.js +0 -3
  79. package/lib/cjs/datePicker/foundation.d.ts +25 -25
  80. package/lib/cjs/datePicker/foundation.js +22 -333
  81. package/lib/cjs/datePicker/inputFoundation.d.ts +3 -3
  82. package/lib/cjs/datePicker/inputFoundation.js +5 -86
  83. package/lib/cjs/datePicker/monthFoundation.d.ts +1 -1
  84. package/lib/cjs/datePicker/monthFoundation.js +3 -28
  85. package/lib/cjs/datePicker/monthsGridFoundation.d.ts +5 -4
  86. package/lib/cjs/datePicker/monthsGridFoundation.js +43 -238
  87. package/lib/cjs/datePicker/yearAndMonthFoundation.d.ts +3 -1
  88. package/lib/cjs/datePicker/yearAndMonthFoundation.js +12 -38
  89. package/lib/cjs/descriptions/constants.js +0 -2
  90. package/lib/cjs/divider/constants.js +0 -2
  91. package/lib/cjs/dropdown/constants.js +0 -3
  92. package/lib/cjs/dropdown/foundation.js +4 -23
  93. package/lib/cjs/dropdown/menuFoundation.js +8 -27
  94. package/lib/cjs/empty/constants.js +0 -2
  95. package/lib/cjs/form/constants.js +0 -2
  96. package/lib/cjs/form/foundation.js +75 -206
  97. package/lib/cjs/form/interface.d.ts +5 -5
  98. package/lib/cjs/form/utils.js +47 -77
  99. package/lib/cjs/grid/constants.js +0 -2
  100. package/lib/cjs/highlight/constants.js +0 -2
  101. package/lib/cjs/icons/constants.js +0 -2
  102. package/lib/cjs/image/constants.js +0 -2
  103. package/lib/cjs/image/imageFoundation.js +4 -18
  104. package/lib/cjs/image/previewFooterFoundation.js +0 -13
  105. package/lib/cjs/image/previewFoundation.js +0 -11
  106. package/lib/cjs/image/previewImageFoundation.js +6 -80
  107. package/lib/cjs/image/previewInnerFoundation.js +12 -77
  108. package/lib/cjs/image/utils.js +0 -14
  109. package/lib/cjs/input/constants.js +0 -2
  110. package/lib/cjs/input/foundation.js +17 -101
  111. package/lib/cjs/input/textareaFoundation.js +20 -85
  112. package/lib/cjs/input/util/calculateNodeHeight.js +6 -18
  113. package/lib/cjs/input/util/getSizingData.js +7 -11
  114. package/lib/cjs/inputNumber/constants.js +0 -2
  115. package/lib/cjs/inputNumber/foundation.js +29 -192
  116. package/lib/cjs/layout/constants.js +0 -2
  117. package/lib/cjs/list/constants.js +0 -2
  118. package/lib/cjs/modal/constants.js +0 -2
  119. package/lib/cjs/modal/modalContentFoundation.js +0 -20
  120. package/lib/cjs/modal/modalFoundation.d.ts +2 -2
  121. package/lib/cjs/modal/modalFoundation.js +2 -22
  122. package/lib/cjs/navigation/NavItem.js +0 -10
  123. package/lib/cjs/navigation/constants.js +0 -3
  124. package/lib/cjs/navigation/foundation.js +3 -67
  125. package/lib/cjs/navigation/itemFoundation.d.ts +0 -2
  126. package/lib/cjs/navigation/itemFoundation.js +3 -21
  127. package/lib/cjs/navigation/navigation.css +7 -77
  128. package/lib/cjs/navigation/navigation.scss +7 -119
  129. package/lib/cjs/navigation/subNavFoundation.d.ts +0 -2
  130. package/lib/cjs/navigation/subNavFoundation.js +4 -40
  131. package/lib/cjs/notification/constants.js +0 -3
  132. package/lib/cjs/notification/notificationFoundation.d.ts +3 -3
  133. package/lib/cjs/notification/notificationFoundation.js +0 -16
  134. package/lib/cjs/notification/notificationListFoundation.js +7 -17
  135. package/lib/cjs/overflowList/constants.js +0 -2
  136. package/lib/cjs/overflowList/foundation.js +11 -41
  137. package/lib/cjs/pagination/constants.js +0 -2
  138. package/lib/cjs/pagination/foundation.d.ts +3 -3
  139. package/lib/cjs/pagination/foundation.js +21 -90
  140. package/lib/cjs/popconfirm/constants.js +0 -2
  141. package/lib/cjs/popconfirm/popconfirmFoundation.js +1 -21
  142. package/lib/cjs/popover/constants.js +0 -3
  143. package/lib/cjs/progress/constants.js +0 -2
  144. package/lib/cjs/progress/generates.d.ts +2 -2
  145. package/lib/cjs/progress/generates.js +19 -60
  146. package/lib/cjs/radio/constants.js +0 -2
  147. package/lib/cjs/radio/radioFoundation.js +0 -14
  148. package/lib/cjs/radio/radioGroupFoundation.js +4 -23
  149. package/lib/cjs/radio/radioInnerFoundation.js +2 -19
  150. package/lib/cjs/rating/constants.js +0 -2
  151. package/lib/cjs/rating/foundation.js +11 -61
  152. package/lib/cjs/scrollList/constants.js +0 -2
  153. package/lib/cjs/scrollList/foundation.js +0 -4
  154. package/lib/cjs/scrollList/itemFoundation.js +8 -61
  155. package/lib/cjs/scrollList/scrollTo.js +2 -5
  156. package/lib/cjs/select/constants.js +0 -3
  157. package/lib/cjs/select/foundation.d.ts +2 -2
  158. package/lib/cjs/select/foundation.js +122 -425
  159. package/lib/cjs/select/optionFoundation.js +4 -14
  160. package/lib/cjs/sideSheet/constants.js +0 -2
  161. package/lib/cjs/sideSheet/sideSheetFoundation.js +0 -18
  162. package/lib/cjs/skeleton/constants.js +0 -2
  163. package/lib/cjs/slider/constants.js +0 -2
  164. package/lib/cjs/slider/foundation.d.ts +1 -1
  165. package/lib/cjs/slider/foundation.js +25 -204
  166. package/lib/cjs/space/constants.js +0 -2
  167. package/lib/cjs/spin/constants.js +0 -2
  168. package/lib/cjs/spin/foundation.js +3 -13
  169. package/lib/cjs/steps/bacisSteps.scss +238 -287
  170. package/lib/cjs/steps/constants.js +0 -2
  171. package/lib/cjs/steps/fillSteps.scss +142 -153
  172. package/lib/cjs/steps/navSteps.scss +40 -61
  173. package/lib/cjs/steps/steps.css +17 -381
  174. package/lib/cjs/switch/constants.js +0 -2
  175. package/lib/cjs/switch/foundation.js +2 -18
  176. package/lib/cjs/table/bodyFoundation.js +2 -34
  177. package/lib/cjs/table/cellFoundation.js +0 -5
  178. package/lib/cjs/table/constants.js +7 -8
  179. package/lib/cjs/table/foundation.d.ts +17 -14
  180. package/lib/cjs/table/foundation.js +72 -302
  181. package/lib/cjs/table/table.css +6 -0
  182. package/lib/cjs/table/table.scss +12 -0
  183. package/lib/cjs/table/tableRowFoundation.js +0 -11
  184. package/lib/cjs/table/tableSelectionCellFoundation.js +0 -6
  185. package/lib/cjs/table/utils.d.ts +2 -2
  186. package/lib/cjs/table/utils.js +5 -118
  187. package/lib/cjs/tabs/constants.js +0 -2
  188. package/lib/cjs/tabs/foundation.js +2 -40
  189. package/lib/cjs/tabs/tabs.css +14 -14
  190. package/lib/cjs/tabs/tabs.scss +16 -14
  191. package/lib/cjs/tag/constants.js +1 -2
  192. package/lib/cjs/tagInput/constants.js +0 -2
  193. package/lib/cjs/tagInput/foundation.d.ts +4 -4
  194. package/lib/cjs/tagInput/foundation.js +4 -94
  195. package/lib/cjs/tagInput/utils/getSplitedArray.js +0 -11
  196. package/lib/cjs/timePicker/ComboxFoundation.js +4 -39
  197. package/lib/cjs/timePicker/constants.js +0 -3
  198. package/lib/cjs/timePicker/foundation.d.ts +2 -2
  199. package/lib/cjs/timePicker/foundation.js +6 -102
  200. package/lib/cjs/timePicker/inputFoundation.js +6 -25
  201. package/lib/cjs/timePicker/utils/index.js +6 -45
  202. package/lib/cjs/timePicker/utils/localeDate.js +0 -10
  203. package/lib/cjs/timeline/constants.js +0 -2
  204. package/lib/cjs/timeline/timeline.css +0 -36
  205. package/lib/cjs/timeline/timeline.scss +46 -96
  206. package/lib/cjs/toast/constants.js +0 -3
  207. package/lib/cjs/toast/toastFoundation.d.ts +3 -3
  208. package/lib/cjs/toast/toastFoundation.js +0 -14
  209. package/lib/cjs/toast/toastListFoundation.js +4 -22
  210. package/lib/cjs/tooltip/constants.js +0 -2
  211. package/lib/cjs/tooltip/foundation.d.ts +1 -1
  212. package/lib/cjs/tooltip/foundation.js +63 -291
  213. package/lib/cjs/transfer/constants.js +0 -2
  214. package/lib/cjs/transfer/foundation.d.ts +1 -1
  215. package/lib/cjs/transfer/foundation.js +4 -68
  216. package/lib/cjs/transfer/transferUtils.js +5 -27
  217. package/lib/cjs/tree/constants.js +0 -2
  218. package/lib/cjs/tree/foundation.d.ts +3 -3
  219. package/lib/cjs/tree/foundation.js +34 -150
  220. package/lib/cjs/tree/treeUtil.js +54 -173
  221. package/lib/cjs/treeSelect/constants.js +0 -2
  222. package/lib/cjs/treeSelect/foundation.d.ts +7 -7
  223. package/lib/cjs/treeSelect/foundation.js +18 -192
  224. package/lib/cjs/typography/constants.d.ts +1 -0
  225. package/lib/cjs/typography/constants.js +1 -2
  226. package/lib/cjs/typography/formatNumeral.d.ts +3 -3
  227. package/lib/cjs/typography/formatNumeral.js +16 -32
  228. package/lib/cjs/typography/typography.css +120 -0
  229. package/lib/cjs/typography/typography.scss +131 -6
  230. package/lib/cjs/typography/variables.scss +48 -0
  231. package/lib/cjs/upload/constants.js +0 -2
  232. package/lib/cjs/upload/foundation.d.ts +5 -5
  233. package/lib/cjs/upload/foundation.js +36 -245
  234. package/lib/cjs/upload/utils.js +10 -29
  235. package/lib/cjs/utils/Event.js +2 -21
  236. package/lib/cjs/utils/FocusHandle.d.ts +1 -1
  237. package/lib/cjs/utils/FocusHandle.js +6 -35
  238. package/lib/cjs/utils/Logger.js +0 -21
  239. package/lib/cjs/utils/Store.js +0 -10
  240. package/lib/cjs/utils/a11y.js +18 -43
  241. package/lib/cjs/utils/array.d.ts +1 -1
  242. package/lib/cjs/utils/array.js +0 -7
  243. package/lib/cjs/utils/arrayMove.js +0 -1
  244. package/lib/cjs/utils/classnames.js +0 -12
  245. package/lib/cjs/utils/date-fns-extra.js +0 -35
  246. package/lib/cjs/utils/dom.d.ts +1 -1
  247. package/lib/cjs/utils/dom.js +0 -13
  248. package/lib/cjs/utils/function.js +0 -1
  249. package/lib/cjs/utils/getDataAttr.js +0 -2
  250. package/lib/cjs/utils/getHighlight.js +5 -26
  251. package/lib/cjs/utils/getMotionObjFromProps.js +0 -12
  252. package/lib/cjs/utils/index.js +0 -4
  253. package/lib/cjs/utils/isBothNaN.js +0 -2
  254. package/lib/cjs/utils/isElement.js +0 -1
  255. package/lib/cjs/utils/isEnterPress.js +0 -5
  256. package/lib/cjs/utils/isEscPress.js +0 -5
  257. package/lib/cjs/utils/isNullOrUndefined.js +0 -1
  258. package/lib/cjs/utils/isNumber.js +0 -1
  259. package/lib/cjs/utils/isObject.js +0 -1
  260. package/lib/cjs/utils/isPromise.js +0 -3
  261. package/lib/cjs/utils/isString.js +0 -1
  262. package/lib/cjs/utils/keyCode.js +0 -105
  263. package/lib/cjs/utils/log.js +0 -5
  264. package/lib/cjs/utils/number.js +0 -2
  265. package/lib/cjs/utils/object.d.ts +4 -4
  266. package/lib/cjs/utils/object.js +12 -34
  267. package/lib/cjs/utils/set.js +0 -8
  268. package/lib/cjs/utils/shallowEqualObjects.js +0 -7
  269. package/lib/cjs/utils/touchPolyfill.js +0 -7
  270. package/lib/cjs/utils/type.d.ts +3 -3
  271. package/lib/cjs/utils/uuid.js +2 -9
  272. package/lib/cjs/utils/warning.js +0 -1
  273. package/lib/es/anchor/foundation.js +10 -66
  274. package/lib/es/anchor/linkFoundation.js +4 -12
  275. package/lib/es/autoComplete/foundation.d.ts +1 -1
  276. package/lib/es/autoComplete/foundation.js +24 -132
  277. package/lib/es/autoComplete/optionFoundation.js +4 -10
  278. package/lib/es/avatar/foundation.js +0 -12
  279. package/lib/es/backtop/foundation.d.ts +2 -2
  280. package/lib/es/backtop/foundation.js +0 -16
  281. package/lib/es/banner/foundation.js +0 -3
  282. package/lib/es/base/constants.js +2 -2
  283. package/lib/es/base/foundation.d.ts +1 -1
  284. package/lib/es/base/foundation.js +11 -44
  285. package/lib/es/breadcrumb/foundation.js +0 -7
  286. package/lib/es/breadcrumb/itemFoundation.js +0 -3
  287. package/lib/es/calendar/calendar.css +2 -2
  288. package/lib/es/calendar/calendar.scss +1 -1
  289. package/lib/es/calendar/eventUtil.d.ts +1 -1
  290. package/lib/es/calendar/eventUtil.js +2 -36
  291. package/lib/es/calendar/foundation.d.ts +2 -2
  292. package/lib/es/calendar/foundation.js +28 -117
  293. package/lib/es/carousel/foundation.js +2 -47
  294. package/lib/es/cascader/constants.js +0 -1
  295. package/lib/es/cascader/foundation.d.ts +4 -4
  296. package/lib/es/cascader/foundation.js +30 -226
  297. package/lib/es/cascader/util.js +6 -15
  298. package/lib/es/checkbox/checkboxFoundation.js +2 -34
  299. package/lib/es/checkbox/checkboxGroupFoundation.js +2 -20
  300. package/lib/es/collapse/foundation.d.ts +1 -1
  301. package/lib/es/collapse/foundation.js +2 -9
  302. package/lib/es/collapsible/foundation.js +0 -7
  303. package/lib/es/datePicker/_utils/formatter.js +4 -8
  304. package/lib/es/datePicker/_utils/getDayOfWeek.d.ts +1 -1
  305. package/lib/es/datePicker/_utils/getDayOfWeek.js +0 -3
  306. package/lib/es/datePicker/_utils/getDefaultFormatToken.js +0 -2
  307. package/lib/es/datePicker/_utils/getDefaultPickerDate.d.ts +1 -1
  308. package/lib/es/datePicker/_utils/getDefaultPickerDate.js +0 -10
  309. package/lib/es/datePicker/_utils/getFullDateOffset.js +0 -3
  310. package/lib/es/datePicker/_utils/getInsetInputFormatToken.js +0 -4
  311. package/lib/es/datePicker/_utils/getInsetInputValueFromInsetInputStr.js +0 -5
  312. package/lib/es/datePicker/_utils/getMonthTable.d.ts +1 -1
  313. package/lib/es/datePicker/_utils/getMonthTable.js +4 -14
  314. package/lib/es/datePicker/_utils/getMonthsInYear.js +0 -1
  315. package/lib/es/datePicker/_utils/getYears.d.ts +1 -1
  316. package/lib/es/datePicker/_utils/getYears.js +9 -6
  317. package/lib/es/datePicker/_utils/isBetween.js +0 -1
  318. package/lib/es/datePicker/_utils/parser.js +0 -8
  319. package/lib/es/datePicker/foundation.d.ts +25 -25
  320. package/lib/es/datePicker/foundation.js +22 -318
  321. package/lib/es/datePicker/inputFoundation.d.ts +3 -3
  322. package/lib/es/datePicker/inputFoundation.js +5 -74
  323. package/lib/es/datePicker/monthFoundation.d.ts +1 -1
  324. package/lib/es/datePicker/monthFoundation.js +4 -22
  325. package/lib/es/datePicker/monthsGridFoundation.d.ts +5 -4
  326. package/lib/es/datePicker/monthsGridFoundation.js +42 -222
  327. package/lib/es/datePicker/yearAndMonthFoundation.d.ts +3 -1
  328. package/lib/es/datePicker/yearAndMonthFoundation.js +12 -36
  329. package/lib/es/dropdown/foundation.js +4 -18
  330. package/lib/es/dropdown/menuFoundation.js +8 -22
  331. package/lib/es/form/foundation.js +74 -195
  332. package/lib/es/form/interface.d.ts +5 -5
  333. package/lib/es/form/utils.js +47 -70
  334. package/lib/es/image/imageFoundation.js +4 -13
  335. package/lib/es/image/previewFooterFoundation.js +0 -9
  336. package/lib/es/image/previewFoundation.js +0 -7
  337. package/lib/es/image/previewImageFoundation.js +6 -72
  338. package/lib/es/image/previewInnerFoundation.js +12 -70
  339. package/lib/es/image/utils.js +0 -6
  340. package/lib/es/input/foundation.js +17 -93
  341. package/lib/es/input/textareaFoundation.js +20 -75
  342. package/lib/es/input/util/calculateNodeHeight.js +6 -18
  343. package/lib/es/input/util/getSizingData.js +7 -11
  344. package/lib/es/inputNumber/foundation.js +28 -183
  345. package/lib/es/modal/modalContentFoundation.js +0 -15
  346. package/lib/es/modal/modalFoundation.d.ts +2 -2
  347. package/lib/es/modal/modalFoundation.js +2 -17
  348. package/lib/es/navigation/NavItem.js +0 -6
  349. package/lib/es/navigation/constants.js +1 -1
  350. package/lib/es/navigation/foundation.js +2 -60
  351. package/lib/es/navigation/itemFoundation.d.ts +0 -2
  352. package/lib/es/navigation/itemFoundation.js +3 -18
  353. package/lib/es/navigation/navigation.css +7 -77
  354. package/lib/es/navigation/navigation.scss +7 -119
  355. package/lib/es/navigation/subNavFoundation.d.ts +0 -2
  356. package/lib/es/navigation/subNavFoundation.js +4 -36
  357. package/lib/es/notification/constants.js +1 -1
  358. package/lib/es/notification/notificationFoundation.d.ts +3 -3
  359. package/lib/es/notification/notificationFoundation.js +0 -11
  360. package/lib/es/notification/notificationListFoundation.js +6 -13
  361. package/lib/es/overflowList/foundation.js +11 -37
  362. package/lib/es/pagination/foundation.d.ts +3 -3
  363. package/lib/es/pagination/foundation.js +20 -87
  364. package/lib/es/popconfirm/popconfirmFoundation.js +1 -16
  365. package/lib/es/progress/generates.d.ts +2 -2
  366. package/lib/es/progress/generates.js +19 -59
  367. package/lib/es/radio/radioFoundation.js +0 -9
  368. package/lib/es/radio/radioGroupFoundation.js +4 -19
  369. package/lib/es/radio/radioInnerFoundation.js +2 -15
  370. package/lib/es/rating/foundation.js +10 -54
  371. package/lib/es/scrollList/itemFoundation.js +8 -60
  372. package/lib/es/scrollList/scrollTo.js +2 -4
  373. package/lib/es/select/foundation.d.ts +2 -2
  374. package/lib/es/select/foundation.js +122 -411
  375. package/lib/es/select/optionFoundation.js +4 -10
  376. package/lib/es/sideSheet/sideSheetFoundation.js +0 -12
  377. package/lib/es/slider/foundation.d.ts +1 -1
  378. package/lib/es/slider/foundation.js +24 -197
  379. package/lib/es/spin/foundation.js +3 -11
  380. package/lib/es/steps/bacisSteps.scss +238 -287
  381. package/lib/es/steps/fillSteps.scss +142 -153
  382. package/lib/es/steps/navSteps.scss +40 -61
  383. package/lib/es/steps/steps.css +17 -381
  384. package/lib/es/switch/foundation.js +2 -13
  385. package/lib/es/table/bodyFoundation.js +2 -25
  386. package/lib/es/table/cellFoundation.js +0 -1
  387. package/lib/es/table/constants.js +6 -6
  388. package/lib/es/table/foundation.d.ts +17 -14
  389. package/lib/es/table/foundation.js +72 -309
  390. package/lib/es/table/table.css +6 -0
  391. package/lib/es/table/table.scss +12 -0
  392. package/lib/es/table/tableRowFoundation.js +2 -9
  393. package/lib/es/table/tableSelectionCellFoundation.js +0 -2
  394. package/lib/es/table/utils.d.ts +2 -2
  395. package/lib/es/table/utils.js +5 -81
  396. package/lib/es/tabs/foundation.js +2 -35
  397. package/lib/es/tabs/tabs.css +14 -14
  398. package/lib/es/tabs/tabs.scss +16 -14
  399. package/lib/es/tagInput/foundation.d.ts +4 -4
  400. package/lib/es/tagInput/foundation.js +4 -84
  401. package/lib/es/tagInput/utils/getSplitedArray.js +0 -7
  402. package/lib/es/timePicker/ComboxFoundation.js +4 -30
  403. package/lib/es/timePicker/foundation.d.ts +2 -2
  404. package/lib/es/timePicker/foundation.js +7 -95
  405. package/lib/es/timePicker/inputFoundation.js +6 -22
  406. package/lib/es/timePicker/utils/index.js +6 -25
  407. package/lib/es/timePicker/utils/localeDate.js +0 -8
  408. package/lib/es/timeline/timeline.css +0 -36
  409. package/lib/es/timeline/timeline.scss +46 -96
  410. package/lib/es/toast/constants.js +1 -1
  411. package/lib/es/toast/toastFoundation.d.ts +3 -3
  412. package/lib/es/toast/toastFoundation.js +0 -9
  413. package/lib/es/toast/toastListFoundation.js +4 -18
  414. package/lib/es/tooltip/foundation.d.ts +1 -1
  415. package/lib/es/tooltip/foundation.js +63 -288
  416. package/lib/es/transfer/foundation.d.ts +1 -1
  417. package/lib/es/transfer/foundation.js +6 -62
  418. package/lib/es/transfer/transferUtils.js +5 -21
  419. package/lib/es/tree/foundation.d.ts +3 -3
  420. package/lib/es/tree/foundation.js +34 -143
  421. package/lib/es/tree/treeUtil.js +54 -139
  422. package/lib/es/treeSelect/foundation.d.ts +7 -7
  423. package/lib/es/treeSelect/foundation.js +20 -179
  424. package/lib/es/typography/constants.d.ts +1 -0
  425. package/lib/es/typography/constants.js +1 -0
  426. package/lib/es/typography/formatNumeral.d.ts +3 -3
  427. package/lib/es/typography/formatNumeral.js +16 -29
  428. package/lib/es/typography/typography.css +120 -0
  429. package/lib/es/typography/typography.scss +131 -6
  430. package/lib/es/typography/variables.scss +48 -0
  431. package/lib/es/upload/foundation.d.ts +5 -5
  432. package/lib/es/upload/foundation.js +36 -238
  433. package/lib/es/upload/utils.js +10 -24
  434. package/lib/es/utils/Event.js +2 -17
  435. package/lib/es/utils/FocusHandle.d.ts +1 -1
  436. package/lib/es/utils/FocusHandle.js +6 -32
  437. package/lib/es/utils/Logger.js +0 -20
  438. package/lib/es/utils/Store.js +0 -9
  439. package/lib/es/utils/a11y.js +18 -31
  440. package/lib/es/utils/array.d.ts +1 -1
  441. package/lib/es/utils/array.js +0 -5
  442. package/lib/es/utils/classnames.js +0 -10
  443. package/lib/es/utils/date-fns-extra.js +0 -27
  444. package/lib/es/utils/dom.d.ts +1 -1
  445. package/lib/es/utils/dom.js +0 -9
  446. package/lib/es/utils/getDataAttr.js +0 -1
  447. package/lib/es/utils/getHighlight.js +5 -26
  448. package/lib/es/utils/getMotionObjFromProps.js +0 -8
  449. package/lib/es/utils/isBothNaN.js +0 -1
  450. package/lib/es/utils/isEnterPress.js +0 -2
  451. package/lib/es/utils/isEscPress.js +0 -2
  452. package/lib/es/utils/keyCode.js +0 -104
  453. package/lib/es/utils/log.js +0 -3
  454. package/lib/es/utils/object.d.ts +4 -4
  455. package/lib/es/utils/object.js +12 -28
  456. package/lib/es/utils/set.js +0 -5
  457. package/lib/es/utils/shallowEqualObjects.js +0 -6
  458. package/lib/es/utils/touchPolyfill.js +0 -5
  459. package/lib/es/utils/type.d.ts +3 -3
  460. package/lib/es/utils/uuid.js +2 -8
  461. package/navigation/itemFoundation.ts +1 -3
  462. package/navigation/navigation.scss +7 -119
  463. package/navigation/subNavFoundation.ts +1 -3
  464. package/overflowList/foundation.ts +4 -4
  465. package/package.json +2 -2
  466. package/steps/bacisSteps.scss +238 -287
  467. package/steps/fillSteps.scss +142 -153
  468. package/steps/navSteps.scss +40 -61
  469. package/table/foundation.ts +8 -10
  470. package/table/table.scss +12 -0
  471. package/tabs/tabs.scss +16 -14
  472. package/timePicker/foundation.ts +4 -6
  473. package/timeline/timeline.scss +46 -96
  474. package/typography/constants.ts +1 -0
  475. package/typography/typography.scss +131 -6
  476. package/typography/variables.scss +48 -0
  477. package/upload/foundation.ts +8 -8
@@ -11,19 +11,69 @@ import _each from "lodash/each";
11
11
  import _isFunction from "lodash/isFunction";
12
12
  import _merge from "lodash/merge";
13
13
  import _get from "lodash/get";
14
+ /* eslint-disable prefer-destructuring */
15
+ /* eslint-disable max-depth */
16
+ /* eslint-disable max-nested-callbacks */
17
+ /* eslint-disable max-len */
18
+ /* eslint-disable no-param-reassign */
19
+ /* eslint-disable eqeqeq */
20
+ /* eslint-disable @typescript-eslint/no-empty-function */
14
21
  import memoizeOne from 'memoize-one';
15
22
  import BaseFoundation from '../base/foundation';
16
23
  import { strings, numbers } from './constants';
17
24
  import { mergeQueries, flattenColumns, filterColumns } from './utils';
18
25
  import { pullAll, withOrderSort } from '../utils/array';
19
-
20
26
  class TableFoundation extends BaseFoundation {
27
+ /**
28
+ * update columns in place, and use default values as initial values if the sorting and filtering columns have no values
29
+ */
30
+ static initColumnsFilteredValueAndSorterOrder(columns) {
31
+ columns.forEach(column => {
32
+ TableFoundation.initFilteredValue(column);
33
+ TableFoundation.initSorterOrder(column);
34
+ });
35
+ return columns;
36
+ }
37
+ /**
38
+ * init filteredValue of filtering column, use defaultFilteredValue or [] when it is undefined
39
+ */
40
+ static initFilteredValue(column) {
41
+ const {
42
+ defaultFilteredValue,
43
+ filteredValue
44
+ } = column;
45
+ // There may be cases where onFilter is empty, such as server-side filtering
46
+ // Because filterValue affects the output of filters, it needs to be initialized here
47
+ if (_isUndefined(filteredValue)) {
48
+ if (Array.isArray(defaultFilteredValue) && defaultFilteredValue.length) {
49
+ column.filteredValue = defaultFilteredValue;
50
+ } else {
51
+ column.filteredValue = [];
52
+ }
53
+ }
54
+ }
55
+ /**
56
+ * init sortOrder of sorting column, use defaultSortOrder or [] when it is undefined
57
+ */
58
+ static initSorterOrder(column) {
59
+ const {
60
+ defaultSortOrder,
61
+ sortOrder,
62
+ sorter
63
+ } = column;
64
+ if (sorter && _isUndefined(sortOrder)) {
65
+ if (!_isUndefined(defaultSortOrder)) {
66
+ column.sortOrder = defaultSortOrder;
67
+ } else {
68
+ column.sortOrder = false;
69
+ }
70
+ }
71
+ }
21
72
  constructor(adapter) {
22
73
  super(Object.assign({}, adapter));
23
74
  /**
24
75
  * set page number
25
76
  */
26
-
27
77
  this.setPage = (currentPage, currentPageSize) => {
28
78
  currentPage = currentPage || this._adapter.getCurrentPage();
29
79
  const currentPagination = this.getState('pagination');
@@ -36,121 +86,49 @@ class TableFoundation extends BaseFoundation {
36
86
  currentPage,
37
87
  pageSize: currentPageSize
38
88
  }));
39
-
40
89
  if (!this._pagerIsControlled() && currentPage > 0) {
41
90
  this._adapter.setDisabledRowKeys(disabledRowKeys);
42
-
43
91
  this._adapter.setAllRowKeys(allRowKeys);
44
-
45
92
  this._adapter.setPagination(pagination);
46
-
47
93
  this._adapter.setDataSource(dataSource);
48
94
  }
49
-
50
95
  this._notifyChange(pagination);
51
96
  };
52
97
  /**
53
98
  * Cache related data when initializing or updating the calculated dataSource
54
99
  * @param {*} filteredSortedDataSource
55
100
  */
56
-
57
-
58
101
  this.setCachedFilteredSortedDataSource = filteredSortedDataSource => {
59
102
  this._adapter.setCachedFilteredSortedDataSource(filteredSortedDataSource);
60
-
61
103
  const filteredSortedRowKeys = this.getAllRowKeys(filteredSortedDataSource);
62
-
63
104
  this._adapter.setCachedFilteredSortedRowKeys(filteredSortedRowKeys);
64
105
  };
65
-
66
106
  this.isSortOrderValid = sortOrder => strings.SORT_DIRECTIONS.includes(sortOrder) || sortOrder === false;
67
107
  /**
68
108
  * memoized function list
69
109
  */
70
-
71
-
72
110
  const handleColumns = this._adapter.getHandleColumns();
73
-
74
111
  const mergePagination = this._adapter.getMergePagination();
75
-
76
112
  this.memoizedWithFnsColumns = memoizeOne(handleColumns, _isEqual);
77
113
  this.memoizedFilterColumns = memoizeOne(filterColumns);
78
114
  this.memoizedFlattenFnsColumns = memoizeOne(flattenColumns);
79
115
  this.memoizedPagination = memoizeOne(mergePagination, _isEqual);
80
116
  }
81
- /**
82
- * update columns in place, and use default values as initial values if the sorting and filtering columns have no values
83
- */
84
-
85
-
86
- static initColumnsFilteredValueAndSorterOrder(columns) {
87
- columns.forEach(column => {
88
- TableFoundation.initFilteredValue(column);
89
- TableFoundation.initSorterOrder(column);
90
- });
91
- return columns;
92
- }
93
- /**
94
- * init filteredValue of filtering column, use defaultFilteredValue or [] when it is undefined
95
- */
96
-
97
-
98
- static initFilteredValue(column) {
99
- const {
100
- defaultFilteredValue,
101
- filteredValue,
102
- onFilter
103
- } = column;
104
-
105
- const hasFilter = _isFunction(onFilter);
106
-
107
- if (hasFilter && _isUndefined(filteredValue)) {
108
- if (Array.isArray(defaultFilteredValue) && defaultFilteredValue.length) {
109
- column.filteredValue = defaultFilteredValue;
110
- } else {
111
- column.filteredValue = [];
112
- }
113
- }
114
- }
115
- /**
116
- * init sortOrder of sorting column, use defaultSortOrder or [] when it is undefined
117
- */
118
-
119
-
120
- static initSorterOrder(column) {
121
- const {
122
- defaultSortOrder,
123
- sortOrder,
124
- sorter
125
- } = column;
126
-
127
- if (sorter && _isUndefined(sortOrder)) {
128
- if (!_isUndefined(defaultSortOrder)) {
129
- column.sortOrder = defaultSortOrder;
130
- } else {
131
- column.sortOrder = false;
132
- }
133
- }
134
- }
135
-
136
117
  init() {
137
118
  const dataSource = [...this.getProp('dataSource')];
138
-
139
119
  const {
140
120
  queries
141
121
  } = this._adapter.getStates();
142
-
143
122
  const filteredSortedDataSource = this.getFilteredSortedDataSource(dataSource, queries);
144
123
  const allDataDisabledRowKeys = this.getAllDisabledRowKeys(filteredSortedDataSource);
145
124
  const pageData = this.getCurrentPageData(filteredSortedDataSource);
146
125
  this.setAdapterPageData(pageData);
147
126
  this.initExpandedRowKeys(pageData);
148
- this.initSelectedRowKeys(pageData); // cache dataSource after mount, and then calculate it on demand
149
-
127
+ this.initSelectedRowKeys(pageData);
128
+ // cache dataSource after mount, and then calculate it on demand
150
129
  this.setCachedFilteredSortedDataSource(filteredSortedDataSource);
151
130
  this.setAllDisabledRowKeys(allDataDisabledRowKeys);
152
131
  }
153
-
154
132
  initExpandedRowKeys() {
155
133
  let {
156
134
  groups
@@ -165,7 +143,6 @@ class TableFoundation extends BaseFoundation {
165
143
  expandAllGroupRows
166
144
  } = this.getProps();
167
145
  const expandedRowKeys = [];
168
-
169
146
  if (defaultExpandAllRows || expandAllRows) {
170
147
  this._addNoDuplicatedItemsToArr(expandedRowKeys, this.getAllRowKeys(dataSource), groups && _isMap(groups) && groups.size ? Array.from(groups.keys()) : []);
171
148
  } else if (defaultExpandAllGroupRows || expandAllGroupRows) {
@@ -175,32 +152,25 @@ class TableFoundation extends BaseFoundation {
175
152
  } else if (Array.isArray(propExpandedRowKeys) && propExpandedRowKeys.length) {
176
153
  this._addNoDuplicatedItemsToArr(expandedRowKeys, propExpandedRowKeys);
177
154
  }
178
-
179
155
  this._adapter.setExpandedRowKeys(expandedRowKeys);
180
156
  }
181
-
182
157
  initSelectedRowKeys(_ref) {
183
158
  let {
184
159
  disabledRowKeys
185
160
  } = _ref;
186
161
  const rowSelection = this.getProp('rowSelection');
187
162
  const rowKeys = [];
188
-
189
163
  if (rowSelection) {
190
164
  const selectedRowKeys = _get(rowSelection, 'selectedRowKeys');
191
-
192
165
  const defaultSelectedRowKeys = _get(rowSelection, 'defaultSelectedRowKeys');
193
-
194
166
  if (Array.isArray(selectedRowKeys)) {
195
167
  this._addNoDuplicatedItemsToArr(rowKeys, selectedRowKeys);
196
168
  } else if (Array.isArray(defaultSelectedRowKeys)) {
197
169
  this._addNoDuplicatedItemsToArr(rowKeys, defaultSelectedRowKeys);
198
170
  }
199
-
200
171
  if (Array.isArray(disabledRowKeys) && disabledRowKeys.length) {
201
172
  _pull(rowKeys, ...disabledRowKeys);
202
173
  }
203
-
204
174
  this._adapter.setSelectedRowKeys(rowKeys);
205
175
  }
206
176
  }
@@ -210,17 +180,8 @@ class TableFoundation extends BaseFoundation {
210
180
  * @param {Object[]} queries
211
181
  * @returns {Object[]} sortedDataSource
212
182
  */
213
-
214
-
215
183
  getFilteredSortedDataSource(dataSource, queries) {
216
184
  const filteredDataSource = this.filterDataSource(dataSource, queries.filter(query => {
217
- /**
218
- * 这里无需判断 filteredValue 是否为数组,初始化时它是 `undefined`,点击选择空时为 `[]`
219
- * 初始化时我们应该用 `defaultFilteredValue`,点击后我们应该用 `filteredValue`
220
- *
221
- * There is no need to judge whether `filteredValue` is an array here, because it is `undefined` when initialized, and `[]` when you click to select empty
222
- * When initializing we should use `defaultFilteredValue`, after clicking we should use `filteredValue`
223
- */
224
185
  const currentFilteredValue = query.filteredValue ? query.filteredValue : query.defaultFilteredValue;
225
186
  return _isFunction(query.onFilter) && Array.isArray(currentFilteredValue) && currentFilteredValue.length;
226
187
  }));
@@ -235,16 +196,12 @@ class TableFoundation extends BaseFoundation {
235
196
  * @param {object} queries
236
197
  * @returns {{dataSource: RecordType[], groups: Map<string, Set<string>>, pagination: object, disabledRowKeys: string[], queries: BaseColumnProps[], allRowKeys: string[]}}
237
198
  */
238
-
239
-
240
199
  getCurrentPageData(dataSource, pagination, queries) {
241
200
  const filteredSortedDataSource = this._adapter.getCachedFilteredSortedDataSource();
242
-
243
201
  dataSource = dataSource == null ? [...filteredSortedDataSource] : dataSource;
244
202
  pagination = pagination == null ? this.getState('pagination') && Object.assign({}, this.getState('pagination')) : pagination;
245
203
  queries = queries == null ? [...this.getState('queries')] : queries;
246
204
  let groups;
247
-
248
205
  if (this.getProp('groupBy') != null) {
249
206
  const {
250
207
  groups: groupedGroups,
@@ -253,7 +210,6 @@ class TableFoundation extends BaseFoundation {
253
210
  dataSource = groupedData;
254
211
  groups = groupedGroups;
255
212
  }
256
-
257
213
  pagination = this.normalizePagination(pagination, dataSource);
258
214
  dataSource = this.limitPageDataSource(dataSource, pagination);
259
215
  const disabledRowKeys = this.getAllDisabledRowKeys(dataSource);
@@ -274,21 +230,16 @@ class TableFoundation extends BaseFoundation {
274
230
  * @param {*[]} dataSource
275
231
  * @param {Function|string} groupBy
276
232
  */
277
-
278
-
279
233
  groupDataSource(dataSource, groupBy) {
280
234
  groupBy = groupBy == null ? this.getProp('groupBy') : groupBy;
281
235
  const groups = new Map();
282
236
  const newDataSource = [];
283
-
284
237
  if (groupBy != null) {
285
238
  _each(dataSource, (record, index) => {
286
239
  const groupKey = typeof groupBy === 'function' ? groupBy(record) : _get(record, groupBy);
287
-
288
240
  if (groupKey != null && groupKey !== '') {
289
241
  const recordKey = this.getRecordKey(record);
290
242
  let group = groups.get(groupKey);
291
-
292
243
  if (!_isSet(group)) {
293
244
  group = new Set([recordKey]);
294
245
  groups.set(groupKey, group);
@@ -298,7 +249,6 @@ class TableFoundation extends BaseFoundation {
298
249
  }
299
250
  });
300
251
  }
301
-
302
252
  if (groups && groups.size) {
303
253
  groups.forEach((set, key) => {
304
254
  if (_isSet(set)) {
@@ -310,7 +260,6 @@ class TableFoundation extends BaseFoundation {
310
260
  } else {
311
261
  newDataSource.push(...dataSource);
312
262
  }
313
-
314
263
  return {
315
264
  groups,
316
265
  dataSource: newDataSource
@@ -323,8 +272,6 @@ class TableFoundation extends BaseFoundation {
323
272
  * @param {Array} sorters
324
273
  * @returns {Array}
325
274
  */
326
-
327
-
328
275
  sortDataSource(dataSource, sorters) {
329
276
  _each(sorters, sorterObj => {
330
277
  // const sorterObj = last(sorters) || {};
@@ -335,30 +282,24 @@ class TableFoundation extends BaseFoundation {
335
282
  sortChildrenRecord
336
283
  } = sorterObj;
337
284
  const currentSortOrder = this.isSortOrderValid(sortOrder) ? sortOrder : defaultSortOrder;
338
-
339
285
  if (_isFunction(sorter) && currentSortOrder && strings.SORT_DIRECTIONS.includes(currentSortOrder)) {
340
286
  if (sortChildrenRecord) {
341
287
  const childrenRecordName = this.getProp('childrenRecordName');
342
288
  dataSource = dataSource && dataSource.map(record => {
343
289
  const children = this._getRecordChildren(record);
344
-
345
290
  if (Array.isArray(children) && children.length) {
346
291
  return Object.assign(Object.assign({}, record), {
347
292
  [childrenRecordName]: this.sortDataSource(children, [sorterObj])
348
293
  });
349
294
  }
350
-
351
295
  return record;
352
296
  });
353
297
  }
354
-
355
298
  dataSource.sort(withOrderSort(sorter, currentSortOrder));
356
299
  return false;
357
300
  }
358
-
359
301
  return undefined;
360
302
  });
361
-
362
303
  return dataSource;
363
304
  }
364
305
  /**
@@ -368,13 +309,10 @@ class TableFoundation extends BaseFoundation {
368
309
  * @param {*[]} filters
369
310
  * @returns {*[]}
370
311
  */
371
-
372
-
373
312
  filterDataSource(dataSource, filters) {
374
313
  let filteredData = null;
375
314
  let hasValidFilters = false;
376
315
  const childrenRecordName = this.getProp('childrenRecordName');
377
-
378
316
  _each(filters, filterObj => {
379
317
  const {
380
318
  onFilter,
@@ -383,40 +321,34 @@ class TableFoundation extends BaseFoundation {
383
321
  defaultFilteredValue
384
322
  } = filterObj;
385
323
  const currentFilteredValue = Array.isArray(filteredValue) ? filteredValue : defaultFilteredValue;
386
-
387
324
  if (typeof onFilter === 'function' && Array.isArray(currentFilteredValue) && currentFilteredValue.length) {
388
325
  hasValidFilters = true;
389
-
390
326
  if (filteredData === null) {
391
327
  filteredData = new Map();
392
328
  } else {
393
329
  dataSource = Array.from(filteredData && filteredData.values());
394
330
  filteredData = new Map();
395
331
  }
396
-
397
332
  _each(dataSource, record => {
398
333
  _each(currentFilteredValue, value => {
399
334
  const childrenRecords = _get(record, childrenRecordName);
400
-
401
335
  const recordKey = this.getRecordKey(record);
402
336
  let filteredChildren;
403
-
404
337
  if (Array.isArray(childrenRecords) && childrenRecords.length && filterChildrenRecord) {
405
338
  filteredChildren = this.filterDataSource(childrenRecords, [filterObj]);
406
339
  }
407
-
408
340
  if (Array.isArray(filteredChildren) && filteredChildren.length) {
409
341
  if (recordKey != null) {
410
342
  const children = _get(filteredData.get(recordKey), childrenRecordName, []);
411
-
412
343
  filteredData.set(recordKey, Object.assign(Object.assign({}, record), {
413
344
  [childrenRecordName]: filteredChildren.reduce((arr, cur) => {
414
345
  if (arr.find(item => this.getRecordKey(item) === this.getRecordKey(cur)) == null) {
415
346
  arr.push(cur);
416
347
  }
417
-
418
348
  return arr;
419
- }, [...children])
349
+ },
350
+ // @ts-ignore
351
+ [...children])
420
352
  }));
421
353
  }
422
354
  } else if (onFilter(value, record)) {
@@ -426,21 +358,16 @@ class TableFoundation extends BaseFoundation {
426
358
  });
427
359
  }
428
360
  });
429
-
430
361
  if (hasValidFilters) {
431
362
  dataSource = Array.from(filteredData && filteredData.values());
432
363
  }
433
-
434
364
  return dataSource;
435
365
  }
436
-
437
366
  limitPageDataSource(dataSource, pagination) {
438
367
  dataSource = dataSource == null ? this.getProp('dataSource') : dataSource;
439
368
  pagination = pagination == null ? this.getState('pagination') : pagination;
440
369
  let pageData = dataSource;
441
-
442
370
  const pageNo = _get(pagination, 'currentPage');
443
-
444
371
  if (this.getProp('pagination') !== false && pageNo && dataSource && pagination && !this._pagerIsControlled()) {
445
372
  const {
446
373
  pageSize = numbers.DEFAULT_PAGE_SIZE
@@ -449,15 +376,12 @@ class TableFoundation extends BaseFoundation {
449
376
  const end = pageNo * pageSize;
450
377
  pageData = _slice(dataSource, start, end);
451
378
  }
452
-
453
379
  return pageData;
454
380
  }
455
-
456
381
  normalizePagination(pagination, dataSource) {
457
382
  pagination = pagination == null ? this._getPagination() : pagination;
458
383
  dataSource = dataSource == null ? this._getDataSource() : dataSource;
459
384
  const propPagination = this.getProp('pagination');
460
-
461
385
  if (pagination) {
462
386
  pagination = typeof pagination === 'object' ? Object.assign({}, pagination) : {};
463
387
  pagination = _merge({
@@ -466,27 +390,21 @@ class TableFoundation extends BaseFoundation {
466
390
  currentPage: _get(propPagination, 'defaultCurrentPage', 1),
467
391
  position: strings.PAGINATION_POSITIONS[0]
468
392
  }, pagination);
469
-
470
393
  if (!this._pagerIsControlled()) {
471
394
  const total = _get(propPagination, 'total', dataSource.length);
472
-
473
395
  const pageSize = _get(propPagination, 'pageSize', pagination.pageSize);
474
-
475
396
  const {
476
397
  currentPage
477
398
  } = pagination;
478
399
  const realTotalPage = Math.ceil(total / pageSize);
479
400
  pagination.total = total;
480
-
481
401
  if (currentPage > realTotalPage) {
482
402
  pagination.currentPage = 1;
483
403
  }
484
404
  }
485
405
  }
486
-
487
406
  return pagination;
488
407
  }
489
-
490
408
  setAdapterPageData() {
491
409
  let pageData = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
492
410
  const {
@@ -496,30 +414,19 @@ class TableFoundation extends BaseFoundation {
496
414
  allRowKeys,
497
415
  groups
498
416
  } = pageData;
499
-
500
417
  this._adapter.setDisabledRowKeys(disabledRowKeys);
501
-
502
418
  this._adapter.setAllRowKeys(allRowKeys);
503
-
504
419
  this._adapter.setPagination(pagination);
505
-
506
420
  this._adapter.setGroups(groups);
507
-
508
421
  this._adapter.setDataSource(dataSource);
509
422
  }
510
-
511
423
  destroy() {}
512
-
513
424
  setAllDisabledRowKeys(disabledRowKeys) {
514
425
  this._adapter.setAllDisabledRowKeys(disabledRowKeys);
515
426
  }
516
-
517
427
  handleClick(e) {}
518
-
519
428
  handleMouseEnter(e) {}
520
-
521
429
  handleMouseLeave(e) {}
522
-
523
430
  stopPropagation(e) {
524
431
  this._adapter.stopPropagation(e);
525
432
  }
@@ -528,15 +435,11 @@ class TableFoundation extends BaseFoundation {
528
435
  * @param {Array} srcArr
529
436
  * @param {Object} objArrs
530
437
  */
531
-
532
-
533
438
  _addNoDuplicatedItemsToArr() {
534
439
  let srcArr = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
535
-
536
440
  for (var _len = arguments.length, objArrs = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
537
441
  objArrs[_key - 1] = arguments[_key];
538
442
  }
539
-
540
443
  for (const objArr of objArrs) {
541
444
  if (Array.isArray(objArr)) {
542
445
  for (const item of objArr) {
@@ -546,19 +449,15 @@ class TableFoundation extends BaseFoundation {
546
449
  }
547
450
  }
548
451
  }
549
-
550
452
  return srcArr;
551
453
  }
552
-
553
454
  _notifyChange(pagination, filters, sorter, extra) {
554
455
  pagination = pagination == null ? this._getPagination() : pagination;
555
456
  filters = filters == null ? this._getAllFilters() : filters;
556
457
  sorter = sorter == null ? this._getAllSorters()[0] : sorter;
557
-
558
458
  if (_get(this.getProp('scroll'), 'scrollToFirstRowOnChange')) {
559
459
  this._adapter.resetScrollY();
560
460
  }
561
-
562
461
  this._adapter.notifyChange({
563
462
  pagination: Object.assign({}, pagination),
564
463
  filters: [...filters],
@@ -566,15 +465,12 @@ class TableFoundation extends BaseFoundation {
566
465
  extra: Object.assign({}, extra)
567
466
  });
568
467
  }
569
-
570
468
  _rowExpansionIsControlled() {
571
469
  return Array.isArray(this.getProp('expandedRowKeys'));
572
470
  }
573
-
574
471
  _pagerIsControlled() {
575
472
  return _get(this.getProp('pagination'), 'currentPage') != null;
576
473
  }
577
-
578
474
  _selectionIsControlled() {
579
475
  return Array.isArray(_get(this.getProp('rowSelection'), 'selectedRowKeys'));
580
476
  }
@@ -584,8 +480,6 @@ class TableFoundation extends BaseFoundation {
584
480
  * @param {String} dataIndex
585
481
  * @returns {Boolean}
586
482
  */
587
-
588
-
589
483
  _sorterIsControlled(dataIndex) {
590
484
  // The basis for judgment should be props columns instead of cachedColumns fix#1141
591
485
  const query = dataIndex && this.getQuery(dataIndex, this.getState('flattenColumns'));
@@ -597,105 +491,83 @@ class TableFoundation extends BaseFoundation {
597
491
  * @param {String} dataIndex
598
492
  * @returns {Boolean}
599
493
  */
600
-
601
-
602
494
  _filterIsControlled(dataIndex) {
603
495
  const query = dataIndex && this.getQuery(dataIndex, this.getState('flattenColumns'));
604
496
  return Boolean(query && Array.isArray(query.filteredValue));
605
497
  }
606
-
607
498
  _filterShowIsControlled(dataIndex) {
608
499
  const query = dataIndex && this.getQuery(dataIndex, this.getState('flattenColumns'));
609
500
  return Boolean(query && (query.filterDropdownVisible === true || query.filterDropdownVisible === false));
610
501
  }
611
-
612
502
  _getSelectedRowKeys() {
613
503
  const rowSelection = this.getState('rowSelection');
614
-
615
504
  const selectedRowKeys = _get(rowSelection, 'selectedRowKeys', []);
616
-
617
505
  return [...selectedRowKeys];
618
506
  }
619
-
620
507
  _getSelectedRowKeysSet() {
621
508
  const rowSelection = this.getState('rowSelection');
622
-
623
509
  const selectedRowKeysSet = _get(rowSelection, 'selectedRowKeysSet', new Set());
624
-
625
510
  return selectedRowKeysSet;
626
511
  }
627
-
628
512
  _getDataSource() {
629
513
  return this.getProp('dataSource') || [];
630
514
  }
631
-
632
515
  _getRecord(realKey) {
633
516
  return _find(this.getProp('dataSource'), record => realKey != null && realKey !== '' && this.getRecordKey(record) === realKey);
634
517
  }
635
-
636
518
  _getRecordChildren(record) {
637
519
  return _get(record, this.getProp('childrenRecordName'));
638
520
  }
639
-
640
521
  _getPagination() {
641
522
  return this.getState('pagination') || {};
642
523
  }
643
-
524
+ /**
525
+ * Filters are considered valid if filteredValue exists
526
+ */
644
527
  _getAllFilters(queries) {
645
528
  queries = queries || this.getState('queries');
646
529
  const filters = [];
647
-
648
530
  _each(queries, query => {
649
531
  if (Array.isArray(query.filteredValue) && (query.filteredValue.length || this._filterIsControlled(query.dataIndex))) {
650
532
  filters.push(query);
651
533
  }
652
534
  });
653
-
654
535
  return filters;
655
536
  }
656
-
657
537
  _getAllSorters(queries) {
658
538
  queries = queries || this.getState('queries');
659
539
  return _filter(queries, query => query.sorter && query.sortOrder);
660
540
  }
661
-
662
541
  _filterQueries(targetQuery, queries) {
663
542
  let keys = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : ['dataIndex'];
664
543
  queries = queries == null ? this.getState('queries') : queries;
665
544
  const filteredQueries = [];
666
545
  const filteredIndexes = [];
667
-
668
546
  _each(queries, (itQuery, index) => {
669
547
  const flag = _some(keys, k => k && targetQuery[k] != null && targetQuery[k] === itQuery[k]);
670
-
671
548
  if (flag) {
672
549
  filteredQueries.push(itQuery);
673
550
  filteredIndexes.push(index);
674
551
  }
675
552
  });
676
-
677
553
  return {
678
554
  filteredQueries,
679
555
  filteredIndexes
680
556
  };
681
557
  }
682
-
683
558
  _mergeToQueries(query, queries) {
684
559
  let keys = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : ['dataIndex'];
685
560
  queries = queries == null ? this.getState('queries') : queries;
686
561
  queries = [...queries];
687
562
  query = Object.assign({}, query);
688
-
689
563
  const {
690
564
  filteredQueries,
691
565
  filteredIndexes
692
566
  } = this._filterQueries(query, queries, keys);
693
-
694
567
  _each(filteredQueries, (curQuery, idx) => {
695
568
  // assign(curQuery, query);
696
569
  queries[filteredIndexes[idx]] = Object.assign({}, query);
697
570
  });
698
-
699
571
  return queries;
700
572
  }
701
573
  /**
@@ -703,53 +575,39 @@ class TableFoundation extends BaseFoundation {
703
575
  * @param {RecordType} record
704
576
  * @returns {string}
705
577
  */
706
-
707
-
708
578
  getRecordKey(record) {
709
579
  if (!record) {
710
580
  return undefined;
711
581
  }
712
-
713
582
  const rowKey = this.getProp('rowKey');
714
583
  return typeof rowKey === 'function' ? rowKey(record) : _get(record, rowKey);
715
584
  }
716
-
717
585
  isEmpty(dataSource) {
718
586
  dataSource = dataSource == null ? this.getProp('dataSource') : dataSource;
719
587
  return !(Array.isArray(dataSource) && dataSource.length > 0);
720
588
  }
721
-
722
589
  handleSelectRow(realKey, selected, e) {
723
590
  this.stopPropagation(e);
724
-
725
591
  if (typeof selected === 'boolean' && realKey != null) {
726
592
  const selectedRowKeys = this._getSelectedRowKeys();
727
-
728
593
  let foundIdx = -1;
729
594
  const selectedRow = this.getSelectedRows(null, [realKey])[0];
730
595
  let selectedRows;
731
-
732
596
  if ((foundIdx = selectedRowKeys.indexOf(realKey)) > -1 && selected === false) {
733
597
  selectedRowKeys.splice(foundIdx, 1);
734
598
  selectedRows = this.getSelectedRows(null, selectedRowKeys);
735
-
736
599
  if (!this._selectionIsControlled()) {
737
600
  this._adapter.setSelectedRowKeys(selectedRowKeys);
738
601
  }
739
-
740
602
  this._adapter.notifySelect(selectedRow, selected, selectedRows, e);
741
-
742
603
  this._adapter.notifySelectionChange(selectedRowKeys, selectedRows);
743
604
  } else if (selectedRowKeys.indexOf(realKey) === -1 && selected === true) {
744
605
  selectedRowKeys.push(realKey);
745
606
  selectedRows = this.getSelectedRows(null, selectedRowKeys);
746
-
747
607
  if (!this._selectionIsControlled()) {
748
608
  this._adapter.setSelectedRowKeys(selectedRowKeys);
749
609
  }
750
-
751
610
  this._adapter.notifySelect(selectedRow, selected, selectedRows, e);
752
-
753
611
  this._adapter.notifySelectionChange(selectedRowKeys, selectedRows);
754
612
  }
755
613
  }
@@ -759,49 +617,35 @@ class TableFoundation extends BaseFoundation {
759
617
  * @param {*} selected The future state of the select all button
760
618
  * @param {*} e
761
619
  */
762
-
763
-
764
620
  handleSelectAllRow(selected, e) {
765
621
  this.stopPropagation(e);
766
-
767
622
  if (typeof selected === 'boolean') {
768
623
  const curSelectedRowKeys = this._getSelectedRowKeys();
769
-
770
624
  let selectedRowKeys = [...curSelectedRowKeys];
771
-
772
625
  const selectedRowKeysSet = this._getSelectedRowKeysSet();
773
-
774
626
  let allRowKeys = [...this._adapter.getCachedFilteredSortedRowKeys()];
775
-
776
627
  const disabledRowKeys = this._adapter.getAllDisabledRowKeys();
777
-
778
628
  const disabledRowKeysSet = this._adapter.getAllDisabledRowKeysSet();
779
-
780
- let changedRowKeys; // Select all, if not disabled && not in selectedRowKeys
781
-
629
+ let changedRowKeys;
630
+ // Select all, if not disabled && not in selectedRowKeys
782
631
  if (selected) {
783
632
  for (const key of allRowKeys) {
784
633
  if (!disabledRowKeysSet.has(key) && !selectedRowKeysSet.has(key)) {
785
634
  selectedRowKeys.push(key);
786
635
  }
787
636
  }
788
-
789
637
  allRowKeys = pullAll(allRowKeys, [...disabledRowKeys, ...curSelectedRowKeys]);
790
638
  changedRowKeys = [...allRowKeys];
791
639
  } else {
792
640
  selectedRowKeys = pullAll(selectedRowKeys, allRowKeys);
793
641
  changedRowKeys = [...curSelectedRowKeys];
794
642
  }
795
-
796
643
  const changedRows = this.getSelectedRows(null, changedRowKeys || []);
797
644
  const selectedRows = this.getSelectedRows(null, selectedRowKeys || []);
798
-
799
645
  if (!this._selectionIsControlled()) {
800
646
  this._adapter.setSelectedRowKeys(selectedRowKeys);
801
647
  }
802
-
803
648
  this._adapter.notifySelectAll(selected, selectedRows, changedRows, e);
804
-
805
649
  this._adapter.notifySelectionChange(selectedRowKeys, selectedRows);
806
650
  }
807
651
  }
@@ -811,27 +655,20 @@ class TableFoundation extends BaseFoundation {
811
655
  * @param {*} selectedRowKeys
812
656
  * @param {*} selectedRowKeysSet Recursive optimization
813
657
  */
814
-
815
-
816
658
  getSelectedRows(dataSource, selectedRowKeys, selectedRowKeysSet) {
817
659
  dataSource = dataSource == null ? this._getDataSource() : dataSource;
818
660
  selectedRowKeys = selectedRowKeys == null ? this._getSelectedRowKeys() : selectedRowKeys;
819
-
820
661
  if (!_isSet(selectedRowKeysSet)) {
821
662
  selectedRowKeysSet = new Set(selectedRowKeys);
822
663
  }
823
-
824
664
  const childrenRecordName = this.getProp('childrenRecordName');
825
665
  const selectedRows = [];
826
-
827
666
  if (_isSet(selectedRowKeysSet) && selectedRowKeysSet.size && Array.isArray(dataSource) && dataSource.length) {
828
667
  // Time complexity optimization, replace the includes operation of array with has of set
829
668
  selectedRows.push(...dataSource.filter(data => selectedRowKeysSet.has(this.getRecordKey(data))));
830
-
831
669
  if (selectedRows.length < selectedRowKeys.length) {
832
670
  for (const item of dataSource) {
833
671
  const children = _get(item, childrenRecordName);
834
-
835
672
  if (Array.isArray(children) && children.length) {
836
673
  const rows = this.getSelectedRows(children, selectedRowKeys, selectedRowKeysSet);
837
674
  selectedRows.push(...rows);
@@ -839,55 +676,42 @@ class TableFoundation extends BaseFoundation {
839
676
  }
840
677
  }
841
678
  }
842
-
843
679
  return selectedRows;
844
680
  }
845
-
846
681
  getAllDisabledRowKeys(dataSource, getCheckboxProps) {
847
682
  dataSource = dataSource == null ? this._getDataSource() : dataSource;
848
683
  getCheckboxProps = getCheckboxProps == null ? _get(this.getProp('rowSelection'), 'getCheckboxProps') : getCheckboxProps;
849
684
  const childrenRecordName = this.getProp('childrenRecordName');
850
685
  const disabledRowKeys = [];
851
-
852
686
  if (Array.isArray(dataSource) && dataSource.length && typeof getCheckboxProps === 'function') {
853
687
  for (const record of dataSource) {
854
688
  const props = getCheckboxProps(record);
855
-
856
689
  if (props && props.disabled) {
857
690
  disabledRowKeys.push(this.getRecordKey(record));
858
691
  }
859
-
860
692
  const children = _get(record, childrenRecordName);
861
-
862
693
  if (Array.isArray(children) && children.length) {
863
694
  const keys = this.getAllDisabledRowKeys(children, getCheckboxProps);
864
695
  disabledRowKeys.push(...keys);
865
696
  }
866
697
  }
867
698
  }
868
-
869
699
  return disabledRowKeys;
870
700
  }
871
-
872
701
  getAllRowKeys(dataSource) {
873
702
  dataSource = dataSource == null ? this._getDataSource() : dataSource;
874
703
  const childrenRecordName = this.getProp('childrenRecordName');
875
704
  const allRowKeys = [];
876
-
877
705
  if (Array.isArray(dataSource) && dataSource.length) {
878
706
  for (const record of dataSource) {
879
707
  const childrenRowKeys = [];
880
-
881
708
  const children = _get(record, childrenRecordName);
882
-
883
709
  if (Array.isArray(children) && children.length) {
884
710
  childrenRowKeys.push(...this.getAllRowKeys(children));
885
711
  }
886
-
887
712
  allRowKeys.push(this.getRecordKey(record), ...childrenRowKeys);
888
713
  }
889
714
  }
890
-
891
715
  return allRowKeys;
892
716
  }
893
717
  /**
@@ -895,8 +719,6 @@ class TableFoundation extends BaseFoundation {
895
719
  * @param {Array} selectedRowKeys
896
720
  * @param {Set} allRowKeysSet
897
721
  */
898
-
899
-
900
722
  hasRowSelected(selectedRowKeys, allRowKeysSet) {
901
723
  return Boolean(Array.isArray(selectedRowKeys) && selectedRowKeys.length && _isSet(allRowKeysSet) && allRowKeysSet.size && selectedRowKeys.filter(key => allRowKeysSet.has(key)).length);
902
724
  }
@@ -906,38 +728,31 @@ class TableFoundation extends BaseFoundation {
906
728
  * @param {String} realKey
907
729
  * @param {Event} domEvent
908
730
  */
909
-
910
-
911
731
  handleRowExpanded(expanded, realKey, domEvent) {
912
732
  this.stopPropagation(domEvent);
913
733
  const expandedRowKeys = [...this.getState('expandedRowKeys')];
914
734
  const index = expandedRowKeys.indexOf(realKey);
915
735
  const keyIsValid = typeof realKey === 'string' || typeof realKey === 'number';
916
-
917
736
  if (keyIsValid && expanded && index === -1) {
918
737
  expandedRowKeys.push(realKey);
919
738
  } else if (keyIsValid && !expanded && index > -1) {
920
739
  expandedRowKeys.splice(index, 1);
921
740
  }
922
-
923
741
  if (!this._rowExpansionIsControlled()) {
924
742
  this._adapter.setExpandedRowKeys(expandedRowKeys);
925
743
  }
926
-
927
744
  const expandedRows = this.getSelectedRows(null, expandedRowKeys);
928
- let expandedRow = this.getSelectedRows(null, [realKey])[0]; // groups record processing
929
-
745
+ let expandedRow = this.getSelectedRows(null, [realKey])[0];
746
+ // groups record processing
930
747
  const groups = this._getGroups();
931
-
932
748
  if (groups) {
933
749
  // Construct group expandRow
934
750
  if (groups.has(realKey)) {
935
751
  expandedRow = {
936
752
  groupKey: realKey
937
753
  };
938
- } // If expandedRowKeys includes groupKey, add to expandedRows
939
-
940
-
754
+ }
755
+ // If expandedRowKeys includes groupKey, add to expandedRows
941
756
  for (let i = 0, len = expandedRowKeys.length; i < len; i++) {
942
757
  if (groups.has(realKey)) {
943
758
  expandedRows.push({
@@ -946,26 +761,19 @@ class TableFoundation extends BaseFoundation {
946
761
  }
947
762
  }
948
763
  }
949
-
950
764
  this._adapter.notifyExpand(expanded, expandedRow, domEvent);
951
-
952
765
  this._adapter.notifyExpandedRowsChange(expandedRows);
953
766
  }
954
767
  /**
955
768
  * get state.groups
956
769
  * @returns {Map|Null}
957
770
  */
958
-
959
-
960
771
  _getGroups() {
961
772
  const groupBy = this._adapter.getProp('groupBy');
962
-
963
773
  if (groupBy !== null) {
964
774
  const groups = this._adapter.getState('groups');
965
-
966
775
  return groups;
967
776
  }
968
-
969
777
  return null;
970
778
  }
971
779
  /**
@@ -974,18 +782,14 @@ class TableFoundation extends BaseFoundation {
974
782
  * @param {Set} disabledRowKeysSet
975
783
  * @param {Array} allKeys keys after sorted and filtered
976
784
  */
977
-
978
-
979
785
  allIsSelected(selectedRowKeysSet, disabledRowKeysSet, allKeys) {
980
786
  const filteredAllKeys = _filter(allKeys, key => key != null && !disabledRowKeysSet.has(key));
981
-
982
787
  if (filteredAllKeys && filteredAllKeys.length) {
983
788
  for (const key of filteredAllKeys) {
984
789
  if (key != null && !selectedRowKeysSet.has(key)) {
985
790
  return false;
986
791
  }
987
792
  }
988
-
989
793
  return true;
990
794
  } else {
991
795
  return false;
@@ -996,25 +800,19 @@ class TableFoundation extends BaseFoundation {
996
800
  * @param {*} selectedRowKeys
997
801
  * @param {*} allKeys
998
802
  */
999
-
1000
-
1001
803
  allIsNotSelected(selectedRowKeys, allKeys) {
1002
804
  for (const key of allKeys) {
1003
805
  if (key != null && Array.isArray(selectedRowKeys) && selectedRowKeys.includes(key)) {
1004
806
  return true;
1005
807
  }
1006
808
  }
1007
-
1008
809
  return false;
1009
810
  }
1010
-
1011
811
  formatPaginationInfo() {
1012
812
  let pagination = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
1013
813
  let defaultPageText = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
1014
814
  let info = '';
1015
-
1016
815
  const formatPageText = _get(this.getProp('pagination'), 'formatPageText');
1017
-
1018
816
  const {
1019
817
  total,
1020
818
  pageSize,
@@ -1022,7 +820,6 @@ class TableFoundation extends BaseFoundation {
1022
820
  } = pagination;
1023
821
  const currentStart = Math.min((currentPage - 1) * pageSize + 1, total);
1024
822
  const currentEnd = Math.min(currentPage * pageSize, total);
1025
-
1026
823
  if (formatPageText || formatPageText !== false && defaultPageText && total > 0) {
1027
824
  info = typeof formatPageText === 'function' ? formatPageText({
1028
825
  currentStart,
@@ -1030,24 +827,21 @@ class TableFoundation extends BaseFoundation {
1030
827
  total
1031
828
  }) : defaultPageText.replace('${currentStart}', currentStart).replace('${currentEnd}', currentEnd).replace('${total}', total);
1032
829
  }
1033
-
1034
830
  return info;
1035
831
  }
1036
-
1037
832
  toggleShowFilter(dataIndex, visible) {
1038
833
  let filterObj = this.getQuery(dataIndex);
1039
- const filterDropdownVisible = visible; // eslint-disable-next-line @typescript-eslint/no-unused-vars
1040
-
834
+ const filterDropdownVisible = visible;
835
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
1041
836
  filterObj = Object.assign(Object.assign({}, filterObj), {
1042
837
  filterDropdownVisible
1043
838
  });
1044
-
1045
- if (!this._filterShowIsControlled()) {// this._adapter.setQuery({
839
+ if (!this._filterShowIsControlled()) {
840
+ // this._adapter.setQuery({
1046
841
  // ...filterObj,
1047
842
  // filterDropdownVisible,
1048
843
  // });
1049
844
  }
1050
-
1051
845
  this._adapter.notifyFilterDropdownVisibleChange(filterDropdownVisible, dataIndex);
1052
846
  }
1053
847
  /**
@@ -1055,8 +849,6 @@ class TableFoundation extends BaseFoundation {
1055
849
  * @param {*} dataIndex
1056
850
  * @param {*} data
1057
851
  */
1058
-
1059
-
1060
852
  handleFilterSelect(dataIndex) {
1061
853
  let data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
1062
854
  let query = this.getQuery(dataIndex);
@@ -1068,17 +860,12 @@ class TableFoundation extends BaseFoundation {
1068
860
  filteredValue
1069
861
  });
1070
862
  queries = mergeQueries(query, queries);
1071
-
1072
863
  const mergedQueries = this._mergeToQueries(query, null);
1073
-
1074
864
  const filters = this._getAllFilters(mergedQueries);
1075
-
1076
865
  if (!this._filterIsControlled(dataIndex)) {
1077
866
  this._adapter.setQueries(queries);
1078
-
1079
867
  this.handleClickFilterOrSorter(queries);
1080
868
  }
1081
-
1082
869
  this._notifyChange(null, filters);
1083
870
  }
1084
871
  /**
@@ -1086,8 +873,6 @@ class TableFoundation extends BaseFoundation {
1086
873
  * @param {*} column
1087
874
  * @param {*} e
1088
875
  */
1089
-
1090
-
1091
876
  handleSort() {
1092
877
  let column = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
1093
878
  let e = arguments.length > 1 ? arguments[1] : undefined;
@@ -1098,17 +883,12 @@ class TableFoundation extends BaseFoundation {
1098
883
  let queries = this.getState('queries');
1099
884
  let curQuery = null;
1100
885
  queries = [...queries];
1101
-
1102
886
  _each(queries, (query, idx, arr) => {
1103
887
  if (query.sorter) {
1104
888
  const sorterObj = Object.assign({}, query);
1105
-
1106
889
  const stateSortOrder = _get(sorterObj, 'sortOrder');
1107
-
1108
890
  const defaultSortOrder = _get(sorterObj, 'defaultSortOrder', false);
1109
-
1110
891
  let querySortOrder = this.isSortOrderValid(stateSortOrder) ? stateSortOrder : defaultSortOrder;
1111
-
1112
892
  if (dataIndex && dataIndex === sorterObj.dataIndex) {
1113
893
  if (querySortOrder === strings.SORT_DIRECTIONS[0]) {
1114
894
  querySortOrder = strings.SORT_DIRECTIONS[1];
@@ -1121,32 +901,25 @@ class TableFoundation extends BaseFoundation {
1121
901
  // This results in the current click only supports single column sorting
1122
902
  querySortOrder = false;
1123
903
  }
1124
-
1125
904
  arr[idx] = Object.assign(Object.assign({}, sorterObj), {
1126
905
  sortOrder: querySortOrder
1127
906
  });
1128
-
1129
907
  if (dataIndex === sorterObj.dataIndex) {
1130
908
  curQuery = arr[idx];
1131
909
  }
1132
910
  }
1133
911
  });
1134
-
1135
912
  if (!this._sorterIsControlled(dataIndex)) {
1136
913
  this._adapter.setQueries(queries);
1137
-
1138
914
  this.handleClickFilterOrSorter(queries);
1139
- } // notify sort event
1140
-
1141
-
915
+ }
916
+ // notify sort event
1142
917
  this._notifyChange(null, null, curQuery, null);
1143
918
  }
1144
919
  /**
1145
920
  * Recalculate the cached data after clicking filter or sorter
1146
921
  * @param {*} queries
1147
922
  */
1148
-
1149
-
1150
923
  handleClickFilterOrSorter(queries) {
1151
924
  const dataSource = [...this.getProp('dataSource')];
1152
925
  const sortedDataSource = this.getFilteredSortedDataSource(dataSource, queries);
@@ -1156,37 +929,27 @@ class TableFoundation extends BaseFoundation {
1156
929
  const pageData = this.getCurrentPageData(sortedDataSource);
1157
930
  this.setAdapterPageData(pageData);
1158
931
  }
1159
-
1160
932
  getQuery(dataIndex, queries) {
1161
933
  queries = queries || this.getState('queries');
1162
-
1163
934
  if (dataIndex != null) {
1164
935
  return _find(queries, query => query.dataIndex === dataIndex);
1165
936
  }
1166
-
1167
937
  return undefined;
1168
938
  }
1169
-
1170
939
  getCellWidths(flattenedColumns, flattenedWidths, ignoreScrollBarKey) {
1171
940
  return this._adapter.getCellWidths(flattenedColumns, flattenedWidths, ignoreScrollBarKey);
1172
941
  }
1173
-
1174
942
  setHeadWidths(headWidths, index) {
1175
943
  return this._adapter.setHeadWidths(headWidths, index);
1176
944
  }
1177
-
1178
945
  getHeadWidths(index) {
1179
946
  return this._adapter.getHeadWidths(index);
1180
947
  }
1181
-
1182
948
  mergedRowExpandable(record) {
1183
949
  return this._adapter.mergedRowExpandable(record);
1184
950
  }
1185
-
1186
951
  setBodyHasScrollbar(bodyHasScrollbar) {
1187
952
  this._adapter.setBodyHasScrollbar(bodyHasScrollbar);
1188
953
  }
1189
-
1190
954
  }
1191
-
1192
955
  export default TableFoundation;