@autobest-ui/components 2.2.1 → 2.4.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 (378) hide show
  1. package/esm/accordion/Item.js +6 -23
  2. package/esm/accordion/index.js +8 -36
  3. package/esm/accordion/style/index.css +1 -0
  4. package/esm/affix/PortalAffix.js +7 -11
  5. package/esm/affix/index.js +30 -70
  6. package/esm/affix/style/index.css +1 -1
  7. package/esm/base.css +1 -1
  8. package/esm/carousel/index.js +45 -141
  9. package/esm/checkbox/index.js +12 -37
  10. package/esm/checkbox/style/index.css +1 -1
  11. package/esm/collapse/index.js +11 -49
  12. package/esm/confirm/index.d.ts +8 -0
  13. package/esm/confirm/index.js +23 -31
  14. package/esm/confirm/style/index.css +1 -1
  15. package/esm/date-picker/DateEnum.js +0 -3
  16. package/esm/date-picker/calendar/Day.js +62 -78
  17. package/esm/date-picker/calendar/MonthYear.js +20 -53
  18. package/esm/date-picker/calendar/grid/index.js +7 -12
  19. package/esm/date-picker/calendar/index.js +4 -31
  20. package/esm/date-picker/index.js +11 -51
  21. package/esm/date-picker/style/index.css +1 -1
  22. package/esm/date-picker/utils.js +6 -11
  23. package/esm/drawer/Child.js +10 -20
  24. package/esm/drawer/index.js +22 -71
  25. package/esm/drawer/style/index.css +1 -1
  26. package/esm/ellipsis/index.js +9 -17
  27. package/esm/ellipsis/style/index.css +1 -1
  28. package/esm/guide/index.js +25 -63
  29. package/esm/guide/style/index.css +1 -1
  30. package/esm/index.d.ts +1 -1
  31. package/esm/input-number/ControlArrow.js +0 -2
  32. package/esm/input-number/constants.js +2 -2
  33. package/esm/input-number/index.js +26 -106
  34. package/esm/input-number/style/index.css +1 -1
  35. package/esm/lazy-image/index.js +10 -55
  36. package/esm/lazy-image/style/index.css +1 -1
  37. package/esm/link-list/index.js +11 -35
  38. package/esm/link-list/style/index.css +1 -1
  39. package/esm/loading/index.js +15 -42
  40. package/esm/loading/style/index.css +1 -1
  41. package/esm/loading-bar/style/index.css +1 -1
  42. package/esm/loading-container/index.js +3 -6
  43. package/esm/loading-container/style/index.css +1 -1
  44. package/esm/loading-icon/index.js +0 -2
  45. package/esm/loading-icon/style/index.css +1 -1
  46. package/esm/mask/index.js +6 -9
  47. package/esm/mask/style/index.css +1 -1
  48. package/esm/message/index.d.ts +17 -6
  49. package/esm/message/index.js +68 -96
  50. package/esm/message/renderMessage.d.ts +17 -0
  51. package/esm/message/renderMessage.js +137 -0
  52. package/esm/message/style/index.css +1 -1
  53. package/esm/modal/Title.js +5 -12
  54. package/esm/modal/getPopupLocation.js +5 -7
  55. package/esm/modal/index.js +44 -125
  56. package/esm/modal/style/index.css +1 -1
  57. package/esm/move/index.js +32 -132
  58. package/esm/move/range.js +6 -12
  59. package/esm/move/utils.js +3 -10
  60. package/esm/popover/index.js +9 -28
  61. package/esm/popover/style/index.css +1 -1
  62. package/esm/portal/index.js +1 -22
  63. package/esm/script/index.js +19 -59
  64. package/esm/select/index.js +28 -106
  65. package/esm/select/style/index.css +1 -1
  66. package/esm/show-more/index.js +40 -103
  67. package/esm/skeleton/Item.js +1 -3
  68. package/esm/skeleton/index.js +5 -11
  69. package/esm/skeleton/style/index.css +1 -1
  70. package/esm/style.css +1 -33
  71. package/esm/table/body/BodyRow.js +11 -28
  72. package/esm/table/body/CheckIcon.js +10 -18
  73. package/esm/table/body/index.js +8 -12
  74. package/esm/table/header/CheckIcon.js +3 -11
  75. package/esm/table/header/HeaderCell.js +12 -33
  76. package/esm/table/header/HeaderRow.js +6 -17
  77. package/esm/table/index.js +30 -100
  78. package/esm/table/style/index.css +1 -1
  79. package/esm/tabs/index.js +35 -118
  80. package/esm/tabs/style/index.css +1 -1
  81. package/esm/tooltip/index.js +0 -4
  82. package/esm/tooltip/style/index.css +1 -1
  83. package/esm/trigger/align.js +6 -6
  84. package/esm/trigger/bottomAlign.js +33 -45
  85. package/esm/trigger/constants.js +0 -1
  86. package/esm/trigger/getPopupLocation.js +48 -68
  87. package/esm/trigger/index.js +52 -187
  88. package/esm/trigger/leftAlign.js +33 -47
  89. package/esm/trigger/ref.js +2 -7
  90. package/esm/trigger/rightAlign.js +33 -45
  91. package/esm/trigger/topAlign.js +33 -45
  92. package/esm/trigger/utils.js +28 -45
  93. package/lib/accordion/Item.js +6 -27
  94. package/lib/accordion/index.js +8 -41
  95. package/lib/accordion/style/index.css +1 -0
  96. package/lib/affix/PortalAffix.js +7 -17
  97. package/lib/affix/index.js +30 -75
  98. package/lib/affix/style/index.css +1 -1
  99. package/lib/base.css +1 -1
  100. package/lib/carousel/index.js +45 -146
  101. package/lib/checkbox/index.js +12 -41
  102. package/lib/checkbox/style/index.css +1 -1
  103. package/lib/collapse/index.js +11 -53
  104. package/lib/confirm/index.d.ts +8 -0
  105. package/lib/confirm/index.js +23 -38
  106. package/lib/confirm/style/index.css +1 -1
  107. package/lib/date-picker/DateEnum.js +0 -3
  108. package/lib/date-picker/calendar/Day.js +62 -87
  109. package/lib/date-picker/calendar/MonthYear.js +20 -62
  110. package/lib/date-picker/calendar/grid/index.js +7 -16
  111. package/lib/date-picker/calendar/index.js +4 -37
  112. package/lib/date-picker/index.js +9 -58
  113. package/lib/date-picker/style/index.css +1 -1
  114. package/lib/date-picker/utils.js +6 -26
  115. package/lib/drawer/Child.js +10 -25
  116. package/lib/drawer/index.js +22 -78
  117. package/lib/drawer/style/index.css +1 -1
  118. package/lib/ellipsis/index.js +9 -23
  119. package/lib/ellipsis/style/index.css +1 -1
  120. package/lib/guide/index.js +25 -71
  121. package/lib/guide/style/index.css +1 -1
  122. package/lib/index.d.ts +1 -1
  123. package/lib/index.js +0 -29
  124. package/lib/input-number/ControlArrow.js +0 -4
  125. package/lib/input-number/constants.js +2 -2
  126. package/lib/input-number/index.js +26 -114
  127. package/lib/input-number/style/index.css +1 -1
  128. package/lib/lazy-image/index.js +10 -58
  129. package/lib/lazy-image/style/index.css +1 -1
  130. package/lib/link-list/index.js +11 -40
  131. package/lib/link-list/style/index.css +1 -1
  132. package/lib/loading/index.js +13 -48
  133. package/lib/loading/style/index.css +1 -1
  134. package/lib/loading-bar/index.js +0 -5
  135. package/lib/loading-bar/style/index.css +1 -1
  136. package/lib/loading-container/index.js +3 -11
  137. package/lib/loading-container/style/index.css +1 -1
  138. package/lib/loading-icon/index.js +0 -7
  139. package/lib/loading-icon/style/index.css +1 -1
  140. package/lib/mask/index.js +6 -17
  141. package/lib/mask/style/index.css +1 -1
  142. package/lib/message/index.d.ts +17 -6
  143. package/lib/message/index.js +67 -104
  144. package/lib/message/renderMessage.d.ts +17 -0
  145. package/lib/message/renderMessage.js +144 -0
  146. package/lib/message/style/index.css +1 -1
  147. package/lib/modal/Affix.js +0 -4
  148. package/lib/modal/Title.js +5 -15
  149. package/lib/modal/getPopupLocation.js +5 -9
  150. package/lib/modal/index.js +44 -135
  151. package/lib/modal/style/index.css +1 -1
  152. package/lib/move/index.js +32 -144
  153. package/lib/move/range.js +6 -14
  154. package/lib/move/utils.js +3 -12
  155. package/lib/popover/index.js +9 -33
  156. package/lib/popover/style/index.css +1 -1
  157. package/lib/portal/index.js +1 -25
  158. package/lib/script/index.js +19 -61
  159. package/lib/select/index.js +28 -113
  160. package/lib/select/style/index.css +1 -1
  161. package/lib/show-more/index.js +40 -110
  162. package/lib/skeleton/Item.js +1 -8
  163. package/lib/skeleton/index.js +5 -16
  164. package/lib/skeleton/style/index.css +1 -1
  165. package/lib/style.css +1 -33
  166. package/lib/table/body/BodyRow.js +11 -33
  167. package/lib/table/body/CheckIcon.js +10 -22
  168. package/lib/table/body/index.js +8 -17
  169. package/lib/table/header/CheckIcon.js +3 -15
  170. package/lib/table/header/HeaderCell.js +12 -37
  171. package/lib/table/header/HeaderRow.js +6 -22
  172. package/lib/table/index.js +30 -107
  173. package/lib/table/style/index.css +1 -1
  174. package/lib/tabs/index.js +35 -122
  175. package/lib/tabs/style/index.css +1 -1
  176. package/lib/tooltip/index.js +0 -9
  177. package/lib/tooltip/style/index.css +1 -1
  178. package/lib/trigger/align.js +0 -4
  179. package/lib/trigger/bottomAlign.js +33 -48
  180. package/lib/trigger/constants.js +0 -2
  181. package/lib/trigger/getPopupLocation.js +48 -74
  182. package/lib/trigger/index.js +52 -198
  183. package/lib/trigger/leftAlign.js +33 -50
  184. package/lib/trigger/ref.js +2 -12
  185. package/lib/trigger/rightAlign.js +33 -48
  186. package/lib/trigger/topAlign.js +33 -48
  187. package/lib/trigger/utils.js +28 -53
  188. package/package.json +9 -3
  189. package/esm/accordion/style/index.d.ts +0 -1
  190. package/esm/accordion/style/index.js +0 -5
  191. package/esm/affix/style/index.d.ts +0 -1
  192. package/esm/affix/style/index.js +0 -5
  193. package/esm/affix/style/index.scss +0 -35
  194. package/esm/base.scss +0 -42
  195. package/esm/carousel/style/index.d.ts +0 -1
  196. package/esm/carousel/style/index.js +0 -5
  197. package/esm/carousel/style/index.scss +0 -37
  198. package/esm/checkbox/style/index.d.ts +0 -1
  199. package/esm/checkbox/style/index.js +0 -5
  200. package/esm/checkbox/style/index.scss +0 -118
  201. package/esm/collapse/style/index.d.ts +0 -1
  202. package/esm/collapse/style/index.js +0 -5
  203. package/esm/collapse/style/index.scss +0 -43
  204. package/esm/confirm/style/index.d.ts +0 -1
  205. package/esm/confirm/style/index.js +0 -7
  206. package/esm/confirm/style/index.scss +0 -44
  207. package/esm/date-picker/calendar/grid/index.scss +0 -90
  208. package/esm/date-picker/calendar/index.scss +0 -58
  209. package/esm/date-picker/style/index.d.ts +0 -1
  210. package/esm/date-picker/style/index.js +0 -11
  211. package/esm/date-picker/style/index.scss +0 -24
  212. package/esm/drawer/style/index.d.ts +0 -1
  213. package/esm/drawer/style/index.js +0 -7
  214. package/esm/drawer/style/index.scss +0 -44
  215. package/esm/ellipsis/style/index.d.ts +0 -1
  216. package/esm/ellipsis/style/index.js +0 -5
  217. package/esm/ellipsis/style/index.scss +0 -35
  218. package/esm/guide/style/index.d.ts +0 -1
  219. package/esm/guide/style/index.js +0 -7
  220. package/esm/guide/style/index.scss +0 -18
  221. package/esm/input-number/style/index.d.ts +0 -1
  222. package/esm/input-number/style/index.js +0 -5
  223. package/esm/input-number/style/index.scss +0 -70
  224. package/esm/lazy-image/style/index.d.ts +0 -1
  225. package/esm/lazy-image/style/index.js +0 -5
  226. package/esm/lazy-image/style/index.scss +0 -25
  227. package/esm/link-list/style/index.d.ts +0 -1
  228. package/esm/link-list/style/index.js +0 -7
  229. package/esm/link-list/style/index.scss +0 -125
  230. package/esm/loading/style/index.d.ts +0 -1
  231. package/esm/loading/style/index.js +0 -7
  232. package/esm/loading/style/index.scss +0 -21
  233. package/esm/loading-bar/style/index.d.ts +0 -1
  234. package/esm/loading-bar/style/index.js +0 -5
  235. package/esm/loading-bar/style/index.scss +0 -62
  236. package/esm/loading-container/style/index.d.ts +0 -1
  237. package/esm/loading-container/style/index.js +0 -7
  238. package/esm/loading-container/style/index.scss +0 -28
  239. package/esm/loading-icon/style/index.d.ts +0 -1
  240. package/esm/loading-icon/style/index.js +0 -5
  241. package/esm/loading-icon/style/index.scss +0 -24
  242. package/esm/mask/style/index.d.ts +0 -1
  243. package/esm/mask/style/index.js +0 -5
  244. package/esm/mask/style/index.scss +0 -35
  245. package/esm/message/style/index.d.ts +0 -1
  246. package/esm/message/style/index.js +0 -5
  247. package/esm/message/style/index.scss +0 -71
  248. package/esm/modal/style/index.d.ts +0 -1
  249. package/esm/modal/style/index.js +0 -7
  250. package/esm/modal/style/index.scss +0 -112
  251. package/esm/move/style/index.d.ts +0 -1
  252. package/esm/move/style/index.js +0 -5
  253. package/esm/move/style/index.scss +0 -7
  254. package/esm/popover/style/index.d.ts +0 -1
  255. package/esm/popover/style/index.js +0 -7
  256. package/esm/popover/style/index.scss +0 -60
  257. package/esm/portal/style/index.d.ts +0 -1
  258. package/esm/portal/style/index.js +0 -5
  259. package/esm/portal/style/index.scss +0 -0
  260. package/esm/script/style/index.d.ts +0 -1
  261. package/esm/script/style/index.js +0 -1
  262. package/esm/script/style/index.scss +0 -0
  263. package/esm/select/style/index.d.ts +0 -1
  264. package/esm/select/style/index.js +0 -7
  265. package/esm/select/style/index.scss +0 -126
  266. package/esm/show-more/style/index.d.ts +0 -1
  267. package/esm/show-more/style/index.js +0 -5
  268. package/esm/show-more/style/index.scss +0 -23
  269. package/esm/skeleton/style/index.d.ts +0 -1
  270. package/esm/skeleton/style/index.js +0 -5
  271. package/esm/skeleton/style/index.scss +0 -27
  272. package/esm/table/style/index.d.ts +0 -1
  273. package/esm/table/style/index.js +0 -9
  274. package/esm/table/style/index.scss +0 -45
  275. package/esm/tabs/style/index.d.ts +0 -1
  276. package/esm/tabs/style/index.js +0 -5
  277. package/esm/tabs/style/index.scss +0 -62
  278. package/esm/tooltip/style/index.d.ts +0 -1
  279. package/esm/tooltip/style/index.js +0 -7
  280. package/esm/tooltip/style/index.scss +0 -62
  281. package/esm/trigger/style/index.d.ts +0 -1
  282. package/esm/trigger/style/index.js +0 -5
  283. package/esm/trigger/style/index.scss +0 -79
  284. package/lib/accordion/style/index.d.ts +0 -1
  285. package/lib/accordion/style/index.js +0 -7
  286. package/lib/affix/style/index.d.ts +0 -1
  287. package/lib/affix/style/index.js +0 -7
  288. package/lib/affix/style/index.scss +0 -35
  289. package/lib/base.scss +0 -42
  290. package/lib/carousel/style/index.d.ts +0 -1
  291. package/lib/carousel/style/index.js +0 -7
  292. package/lib/carousel/style/index.scss +0 -37
  293. package/lib/checkbox/style/index.d.ts +0 -1
  294. package/lib/checkbox/style/index.js +0 -7
  295. package/lib/checkbox/style/index.scss +0 -118
  296. package/lib/collapse/style/index.d.ts +0 -1
  297. package/lib/collapse/style/index.js +0 -7
  298. package/lib/collapse/style/index.scss +0 -43
  299. package/lib/confirm/style/index.d.ts +0 -1
  300. package/lib/confirm/style/index.js +0 -9
  301. package/lib/confirm/style/index.scss +0 -44
  302. package/lib/date-picker/calendar/grid/index.scss +0 -90
  303. package/lib/date-picker/calendar/index.scss +0 -58
  304. package/lib/date-picker/style/index.d.ts +0 -1
  305. package/lib/date-picker/style/index.js +0 -13
  306. package/lib/date-picker/style/index.scss +0 -24
  307. package/lib/drawer/style/index.d.ts +0 -1
  308. package/lib/drawer/style/index.js +0 -9
  309. package/lib/drawer/style/index.scss +0 -44
  310. package/lib/ellipsis/style/index.d.ts +0 -1
  311. package/lib/ellipsis/style/index.js +0 -7
  312. package/lib/ellipsis/style/index.scss +0 -35
  313. package/lib/guide/style/index.d.ts +0 -1
  314. package/lib/guide/style/index.js +0 -9
  315. package/lib/guide/style/index.scss +0 -18
  316. package/lib/input-number/style/index.d.ts +0 -1
  317. package/lib/input-number/style/index.js +0 -7
  318. package/lib/input-number/style/index.scss +0 -70
  319. package/lib/lazy-image/style/index.d.ts +0 -1
  320. package/lib/lazy-image/style/index.js +0 -7
  321. package/lib/lazy-image/style/index.scss +0 -25
  322. package/lib/link-list/style/index.d.ts +0 -1
  323. package/lib/link-list/style/index.js +0 -9
  324. package/lib/link-list/style/index.scss +0 -125
  325. package/lib/loading/style/index.d.ts +0 -1
  326. package/lib/loading/style/index.js +0 -9
  327. package/lib/loading/style/index.scss +0 -21
  328. package/lib/loading-bar/style/index.d.ts +0 -1
  329. package/lib/loading-bar/style/index.js +0 -7
  330. package/lib/loading-bar/style/index.scss +0 -62
  331. package/lib/loading-container/style/index.d.ts +0 -1
  332. package/lib/loading-container/style/index.js +0 -9
  333. package/lib/loading-container/style/index.scss +0 -28
  334. package/lib/loading-icon/style/index.d.ts +0 -1
  335. package/lib/loading-icon/style/index.js +0 -7
  336. package/lib/loading-icon/style/index.scss +0 -24
  337. package/lib/mask/style/index.d.ts +0 -1
  338. package/lib/mask/style/index.js +0 -7
  339. package/lib/mask/style/index.scss +0 -35
  340. package/lib/message/style/index.d.ts +0 -1
  341. package/lib/message/style/index.js +0 -7
  342. package/lib/message/style/index.scss +0 -71
  343. package/lib/modal/style/index.d.ts +0 -1
  344. package/lib/modal/style/index.js +0 -9
  345. package/lib/modal/style/index.scss +0 -112
  346. package/lib/move/style/index.d.ts +0 -1
  347. package/lib/move/style/index.js +0 -7
  348. package/lib/move/style/index.scss +0 -7
  349. package/lib/popover/style/index.d.ts +0 -1
  350. package/lib/popover/style/index.js +0 -9
  351. package/lib/popover/style/index.scss +0 -60
  352. package/lib/portal/style/index.d.ts +0 -1
  353. package/lib/portal/style/index.js +0 -7
  354. package/lib/portal/style/index.scss +0 -0
  355. package/lib/script/style/index.d.ts +0 -1
  356. package/lib/script/style/index.js +0 -1
  357. package/lib/script/style/index.scss +0 -0
  358. package/lib/select/style/index.d.ts +0 -1
  359. package/lib/select/style/index.js +0 -9
  360. package/lib/select/style/index.scss +0 -126
  361. package/lib/show-more/style/index.d.ts +0 -1
  362. package/lib/show-more/style/index.js +0 -7
  363. package/lib/show-more/style/index.scss +0 -23
  364. package/lib/skeleton/style/index.d.ts +0 -1
  365. package/lib/skeleton/style/index.js +0 -7
  366. package/lib/skeleton/style/index.scss +0 -27
  367. package/lib/table/style/index.d.ts +0 -1
  368. package/lib/table/style/index.js +0 -11
  369. package/lib/table/style/index.scss +0 -45
  370. package/lib/tabs/style/index.d.ts +0 -1
  371. package/lib/tabs/style/index.js +0 -7
  372. package/lib/tabs/style/index.scss +0 -62
  373. package/lib/tooltip/style/index.d.ts +0 -1
  374. package/lib/tooltip/style/index.js +0 -9
  375. package/lib/tooltip/style/index.scss +0 -62
  376. package/lib/trigger/style/index.d.ts +0 -1
  377. package/lib/trigger/style/index.js +0 -7
  378. package/lib/trigger/style/index.scss +0 -79
@@ -2,18 +2,14 @@ var __assign = this && this.__assign || function () {
2
2
  __assign = Object.assign || function (t) {
3
3
  for (var s, i = 1, n = arguments.length; i < n; i++) {
4
4
  s = arguments[i];
5
-
6
5
  for (var p in s) {
7
6
  if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
8
7
  }
9
8
  }
10
-
11
9
  return t;
12
10
  };
13
-
14
11
  return __assign.apply(this, arguments);
15
12
  };
16
-
17
13
  import React, { useCallback, useEffect, useMemo, useState } from 'react';
18
14
  import classNames from 'classnames';
19
15
  import { compareDate, getYearAdd, getDateValue, getMonthEnd, getMonthStart, getYearEnd, getYearStart, isOutOfDate } from '../utils';
@@ -23,48 +19,39 @@ var dateStyle = {
23
19
  Year: 1
24
20
  };
25
21
  var monthList = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
26
-
27
22
  var getStartYear = function getStartYear(currentYear) {
28
23
  return Math.floor(currentYear / 10) * 10;
29
24
  };
30
-
31
25
  var MonthYearCalendar = function MonthYearCalendar(props) {
32
26
  var cls = props.prefixCls,
33
- today = props.today,
34
- goTodayVisible = props.goTodayVisible,
35
- navigatedDate = props.navigatedDate,
36
- minDate = props.minDate,
37
- maxDate = props.maxDate,
38
- monthPickerVisible = props.monthPickerVisible,
39
- yearPickerVisible = props.yearPickerVisible,
40
- onChangeNavigatedDate = props.onChangeNavigatedDate;
41
-
27
+ today = props.today,
28
+ goTodayVisible = props.goTodayVisible,
29
+ navigatedDate = props.navigatedDate,
30
+ minDate = props.minDate,
31
+ maxDate = props.maxDate,
32
+ monthPickerVisible = props.monthPickerVisible,
33
+ yearPickerVisible = props.yearPickerVisible,
34
+ onChangeNavigatedDate = props.onChangeNavigatedDate;
42
35
  var _a = useState(monthPickerVisible ? dateStyle.Month : dateStyle.Year),
43
- style = _a[0],
44
- setStyle = _a[1];
45
-
36
+ style = _a[0],
37
+ setStyle = _a[1];
46
38
  var _b = getDateValue(navigatedDate),
47
- navigatedYear = _b.year,
48
- navigatedMonth = _b.month; // 月份日历显示的当前年份
49
-
50
-
39
+ navigatedYear = _b.year,
40
+ navigatedMonth = _b.month;
41
+ // 月份日历显示的当前年份
51
42
  var _c = useState(navigatedYear),
52
- monthPickerYear = _c[0],
53
- setMonthPickerYear = _c[1]; // 年份日历显示的初始年份
54
-
55
-
43
+ monthPickerYear = _c[0],
44
+ setMonthPickerYear = _c[1];
45
+ // 年份日历显示的初始年份
56
46
  var _d = useState(getStartYear(navigatedYear)),
57
- yearPickerStart = _d[0],
58
- setYearPickerStart = _d[1];
59
-
47
+ yearPickerStart = _d[0],
48
+ setYearPickerStart = _d[1];
60
49
  var _e = useState(false),
61
- goTodayEnabled = _e[0],
62
- setGoTodayEnabled = _e[1];
50
+ goTodayEnabled = _e[0],
51
+ setGoTodayEnabled = _e[1];
63
52
  /**
64
53
  * navigatedYear有变更时,用navigatedYear覆盖当前选中Year
65
54
  */
66
-
67
-
68
55
  useEffect(function () {
69
56
  setMonthPickerYear(navigatedYear);
70
57
  setYearPickerStart(getStartYear(navigatedYear));
@@ -72,14 +59,11 @@ var MonthYearCalendar = function MonthYearCalendar(props) {
72
59
  /**
73
60
  * goToday能否点击
74
61
  */
75
-
76
62
  useEffect(function () {
77
63
  if (!goTodayVisible) {
78
64
  return;
79
65
  }
80
-
81
66
  var todayEnabled = isOutOfDate(today, getMonthStart(navigatedYear, navigatedMonth), getMonthEnd(navigatedYear, navigatedMonth));
82
-
83
67
  if (todayEnabled !== goTodayEnabled) {
84
68
  setGoTodayEnabled(todayEnabled);
85
69
  }
@@ -106,7 +90,6 @@ var MonthYearCalendar = function MonthYearCalendar(props) {
106
90
  }, []);
107
91
  var onSelectYear = useCallback(function (year) {
108
92
  onChangeNavigatedDate(getYearAdd(navigatedDate, year - navigatedDate.getFullYear()));
109
-
110
93
  if (monthPickerVisible) {
111
94
  setStyle(dateStyle.Month);
112
95
  }
@@ -115,7 +98,6 @@ var MonthYearCalendar = function MonthYearCalendar(props) {
115
98
  var onSelectMonth = function onSelectMonth(month) {
116
99
  onChangeNavigatedDate(getMonthStart(monthPickerYear, month));
117
100
  };
118
-
119
101
  if (monthPickerVisible) {
120
102
  var prevEnabled = minDate ? compareDate(minDate, getYearStart(monthPickerYear)) < 0 : true;
121
103
  var nextEnabled = maxDate ? compareDate(getYearEnd(monthPickerYear), maxDate) < 0 : true;
@@ -136,7 +118,6 @@ var MonthYearCalendar = function MonthYearCalendar(props) {
136
118
  })
137
119
  };
138
120
  }
139
-
140
121
  return null;
141
122
  }, [monthPickerVisible, minDate, maxDate, monthPickerYear, onChangeNavigatedDate, goPrevYear, goNextYear]);
142
123
  var yearValue = useMemo(function () {
@@ -145,7 +126,6 @@ var MonthYearCalendar = function MonthYearCalendar(props) {
145
126
  var prevEnabled = minDate ? compareDate(minDate, getYearStart(yearPickerStart)) < 0 : true;
146
127
  var nextEnabled = maxDate ? compareDate(getYearEnd(endYear), maxDate) < 0 : true;
147
128
  var list = [];
148
-
149
129
  var _loop_1 = function _loop_1(i) {
150
130
  var disabled = minDate && minDate.getFullYear() > i || maxDate && i > maxDate.getFullYear();
151
131
  list.push({
@@ -157,11 +137,9 @@ var MonthYearCalendar = function MonthYearCalendar(props) {
157
137
  }
158
138
  });
159
139
  };
160
-
161
140
  for (var i = yearPickerStart; i <= endYear; i++) {
162
141
  _loop_1(i);
163
142
  }
164
-
165
143
  return {
166
144
  title: "".concat(yearPickerStart, " - ").concat(endYear),
167
145
  onPrev: prevEnabled ? goPrevPackageYear : null,
@@ -169,45 +147,35 @@ var MonthYearCalendar = function MonthYearCalendar(props) {
169
147
  list: list
170
148
  };
171
149
  }
172
-
173
150
  return null;
174
151
  }, [yearPickerVisible, minDate, maxDate, yearPickerStart, navigatedYear, onSelectYear, goPrevPackageYear, goNextPackageYear]);
175
152
  var dateList = {};
176
-
177
153
  if (monthValue) {
178
154
  dateList[dateStyle.Month] = monthValue;
179
155
  }
180
-
181
156
  if (yearValue) {
182
157
  dateList[dateStyle.Year] = yearValue;
183
158
  }
184
-
185
159
  var onClickTitle = function onClickTitle() {
186
160
  var curStyle = (style + 1) % 2;
187
161
  setStyle(curStyle);
188
-
189
162
  if (curStyle === dateStyle.Year) {
190
163
  setYearPickerStart(getStartYear(monthPickerYear));
191
164
  }
192
165
  };
193
-
194
166
  var goToday = function goToday() {
195
167
  onChangeNavigatedDate(getMonthStart(today.getFullYear(), today.getMonth()));
196
168
  };
197
-
198
169
  var renderGotoToday = function renderGotoToday() {
199
170
  var _a;
200
-
201
171
  if (!goTodayVisible) {
202
172
  return null;
203
173
  }
204
-
205
174
  return /*#__PURE__*/React.createElement("div", {
206
175
  onClick: goToday,
207
176
  className: classNames("".concat(cls, "-t"), (_a = {}, _a["".concat(cls, "-t-dis")] = !goTodayEnabled, _a))
208
177
  }, "Go to today");
209
178
  };
210
-
211
179
  return /*#__PURE__*/React.createElement("div", {
212
180
  className: "".concat(cls, "-my")
213
181
  }, /*#__PURE__*/React.createElement(CalendarGrid, __assign({
@@ -216,7 +184,6 @@ var MonthYearCalendar = function MonthYearCalendar(props) {
216
184
  onClickTitle: monthPickerVisible && yearPickerVisible ? onClickTitle : null
217
185
  }, dateList[style])));
218
186
  };
219
-
220
187
  MonthYearCalendar.defaultProps = {
221
188
  goTodayVisible: true
222
189
  };
@@ -1,7 +1,6 @@
1
1
  import React from 'react';
2
2
  import classNames from 'classnames';
3
3
  var cls = 'ab-dp-cg';
4
-
5
4
  var renderArrow = function renderArrow(prefixCls, direction, onClick) {
6
5
  var enabled = !!onClick;
7
6
  return /*#__PURE__*/React.createElement("span", {
@@ -19,18 +18,16 @@ var renderArrow = function renderArrow(prefixCls, direction, onClick) {
19
18
  d: "M525.339326 186.172452L801.789086 462.622212c12.496698 12.496698 32.758136 12.496698 45.254834 0 12.497405-12.497405 12.496698-32.758136 0-45.254834l-331.014362-331.014362c-12.496698-12.496698-32.757429-12.497405-45.254834 0l-341.795619 339.143969c-12.496698 12.496698-12.496698 32.758136 0 45.254834 12.496698 12.496698 32.758136 12.496698 45.254834 0l287.10586-284.454209L461.372325 925.726242c0 17.673427 14.32669 32.000117 32.000118 32.000117 17.67272-0.000707 31.99941-14.327398 32.000117-32.000117l-0.032527-739.553083z"
20
19
  })));
21
20
  };
22
-
23
21
  var CalendarGrid = function CalendarGrid(_a) {
24
22
  var _b;
25
-
26
23
  var className = _a.className,
27
- title = _a.title,
28
- onClickTitle = _a.onClickTitle,
29
- onPrev = _a.onPrev,
30
- onNext = _a.onNext,
31
- headList = _a.headList,
32
- list = _a.list,
33
- bottomElement = _a.bottomElement;
24
+ title = _a.title,
25
+ onClickTitle = _a.onClickTitle,
26
+ onPrev = _a.onPrev,
27
+ onNext = _a.onNext,
28
+ headList = _a.headList,
29
+ list = _a.list,
30
+ bottomElement = _a.bottomElement;
34
31
  return /*#__PURE__*/React.createElement("div", {
35
32
  className: classNames(className, cls)
36
33
  }, /*#__PURE__*/React.createElement("div", {
@@ -50,7 +47,6 @@ var CalendarGrid = function CalendarGrid(_a) {
50
47
  className: "".concat(cls, "-content")
51
48
  }, list.map(function (item, index) {
52
49
  var _a, _b, _c;
53
-
54
50
  return /*#__PURE__*/React.createElement("li", {
55
51
  key: "".concat(index, " ").concat(item.name),
56
52
  className: classNames((_a = {}, _a["".concat(cls, "-dis")] = item.disabled, _a), (_b = {}, _b["".concat(cls, "-selected")] = item.selected, _b), (_c = {}, _c["".concat(cls, "-today")] = item.isToday, _c), item.className),
@@ -58,7 +54,6 @@ var CalendarGrid = function CalendarGrid(_a) {
58
54
  }, item.name);
59
55
  })), bottomElement);
60
56
  };
61
-
62
57
  CalendarGrid.defaultProps = {
63
58
  headList: [],
64
59
  list: []
@@ -9,73 +9,53 @@ var __extends = this && this.__extends || function () {
9
9
  if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
10
10
  }
11
11
  };
12
-
13
12
  return _extendStatics(d, b);
14
13
  };
15
-
16
14
  return function (d, b) {
17
15
  if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
18
-
19
16
  _extendStatics(d, b);
20
-
21
17
  function __() {
22
18
  this.constructor = d;
23
19
  }
24
-
25
20
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
26
21
  };
27
22
  }();
28
-
29
23
  var __assign = this && this.__assign || function () {
30
24
  __assign = Object.assign || function (t) {
31
25
  for (var s, i = 1, n = arguments.length; i < n; i++) {
32
26
  s = arguments[i];
33
-
34
27
  for (var p in s) {
35
28
  if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
36
29
  }
37
30
  }
38
-
39
31
  return t;
40
32
  };
41
-
42
33
  return __assign.apply(this, arguments);
43
34
  };
44
-
45
35
  import React from 'react';
46
36
  import classNames from 'classnames';
47
37
  import { getMonthStart, isOutOfDate } from '../utils';
48
38
  import DayCalendar from './Day';
49
39
  import MonthYearCalendar from './MonthYear';
50
-
51
- var Calendar =
52
- /** @class */
53
- function (_super) {
40
+ var Calendar = /** @class */function (_super) {
54
41
  __extends(Calendar, _super);
55
-
56
42
  function Calendar(props) {
57
43
  var _this = _super.call(this, props) || this;
58
-
59
44
  _this.prefixCls = 'ab-dp-cal';
60
-
61
45
  _this.onChangeSelectedDate = function (date) {
62
46
  _this.setState({
63
47
  selectedDate: date
64
48
  });
65
-
66
49
  _this.props.onSelect(date, _this.props.name);
67
50
  };
68
-
69
51
  _this.onChangeNavigatedDate = function (date) {
70
52
  if (date.toDateString() === _this.state.navigatedDate.toDateString()) {
71
53
  return;
72
54
  }
73
-
74
55
  _this.setState({
75
56
  navigatedDate: date
76
57
  });
77
58
  };
78
-
79
59
  var nowDate = props.defaultDate || props.today || new Date();
80
60
  _this.state = {
81
61
  selectedDate: nowDate,
@@ -83,29 +63,24 @@ function (_super) {
83
63
  };
84
64
  return _this;
85
65
  }
86
-
87
66
  Calendar.prototype.updateDate = function (date) {
88
67
  if (isOutOfDate(date, this.props.minDate, this.props.maxDate)) {
89
68
  return;
90
69
  }
91
-
92
70
  var navigatedDate = getMonthStart(date.getFullYear(), date.getMonth());
93
-
94
71
  if (navigatedDate.toDateString() !== this.state.navigatedDate.toDateString()) {
95
72
  this.onChangeNavigatedDate(navigatedDate);
96
73
  }
97
-
98
74
  if (date.toDateString() !== this.state.selectedDate.toDateString()) {
99
75
  this.onChangeSelectedDate(date);
100
76
  }
101
77
  };
102
-
103
78
  Calendar.prototype.render = function () {
104
79
  var cls = this.prefixCls;
105
80
  var _a = this.props,
106
- monthPickerVisible = _a.monthPickerVisible,
107
- yearPickerVisible = _a.yearPickerVisible,
108
- className = _a.className;
81
+ monthPickerVisible = _a.monthPickerVisible,
82
+ yearPickerVisible = _a.yearPickerVisible,
83
+ className = _a.className;
109
84
  return /*#__PURE__*/React.createElement("div", {
110
85
  className: classNames(cls, className)
111
86
  }, /*#__PURE__*/React.createElement(DayCalendar, __assign({
@@ -119,7 +94,6 @@ function (_super) {
119
94
  onChangeNavigatedDate: this.onChangeNavigatedDate
120
95
  })));
121
96
  };
122
-
123
97
  Calendar.defaultProps = {
124
98
  today: new Date(),
125
99
  monthPickerVisible: true,
@@ -127,5 +101,4 @@ function (_super) {
127
101
  };
128
102
  return Calendar;
129
103
  }(React.Component);
130
-
131
104
  export default Calendar;
@@ -9,131 +9,99 @@ var __extends = this && this.__extends || function () {
9
9
  if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
10
10
  }
11
11
  };
12
-
13
12
  return _extendStatics(d, b);
14
13
  };
15
-
16
14
  return function (d, b) {
17
15
  if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
18
-
19
16
  _extendStatics(d, b);
20
-
21
17
  function __() {
22
18
  this.constructor = d;
23
19
  }
24
-
25
20
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
26
21
  };
27
22
  }();
28
-
29
23
  var __assign = this && this.__assign || function () {
30
24
  __assign = Object.assign || function (t) {
31
25
  for (var s, i = 1, n = arguments.length; i < n; i++) {
32
26
  s = arguments[i];
33
-
34
27
  for (var p in s) {
35
28
  if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
36
29
  }
37
30
  }
38
-
39
31
  return t;
40
32
  };
41
-
42
33
  return __assign.apply(this, arguments);
43
34
  };
44
-
45
35
  import React, { createRef } from 'react';
46
36
  import classNames from 'classnames';
47
37
  import Popover from '../popover';
48
- import Calendar from './calendar'; // TODO: 移动端
49
-
50
- var DatePicker =
51
- /** @class */
52
- function (_super) {
38
+ import Calendar from './calendar';
39
+ // TODO: 移动端
40
+ var DatePicker = /** @class */function (_super) {
53
41
  __extends(DatePicker, _super);
54
-
55
42
  function DatePicker(props) {
56
43
  var _this = _super.call(this, props) || this;
57
-
58
44
  _this.prefixCls = 'ab-date-picker';
59
45
  _this.calendarRef = /*#__PURE__*/createRef();
60
46
  _this.popoverTriggered = false;
61
-
62
47
  _this.onCalendarSelect = function (date) {
63
48
  _this.setState({
64
49
  calendarVisible: false,
65
50
  inputValue: _this.props.onFormatDate(date, _this.props.name)
66
51
  });
67
-
68
52
  if (_this.props.onSelect) {
69
53
  _this.props.onSelect(date, _this.props.name);
70
54
  }
71
55
  };
72
-
73
56
  _this.updateDate = function () {
74
57
  if (!_this.calendarRef.current || !_this.state.inputValue) {
75
58
  return;
76
59
  }
77
-
78
60
  var date = _this.props.parseDateFromString(_this.state.inputValue, _this.props.name);
79
-
80
61
  if (isNaN(date.getTime())) {
81
62
  return;
82
63
  }
83
-
84
64
  _this.calendarRef.current.updateDate(date);
85
65
  };
86
-
87
66
  _this.onInputFocus = function () {
88
67
  _this.updateDate();
89
-
90
68
  _this.setState({
91
69
  calendarVisible: true
92
70
  });
93
-
94
71
  if (!_this.popoverTriggered) {
95
72
  // 标记触发过popover visible
96
73
  _this.popoverTriggered = true;
97
-
98
74
  if ('value' in _this.props && _this.props.value) {
99
75
  _this.defaultDate = _this.props.value;
100
76
  }
101
77
  }
102
78
  };
103
-
104
79
  _this.onInputChange = function (ev) {
105
80
  if (!_this.props.allowTextInput) {
106
81
  return;
107
82
  }
108
-
109
83
  _this.setState({
110
84
  inputValue: ev.target.value
111
85
  });
112
86
  };
113
-
114
87
  _this.onChangeDate = function () {
115
88
  if (!_this.props.allowTextInput) {
116
89
  return;
117
90
  }
118
-
119
91
  _this.updateDate();
120
92
  };
121
-
122
93
  _this.onPopoverVisibleChange = function (visible) {
123
94
  if (visible !== _this.state.calendarVisible) {
124
95
  _this.setState({
125
96
  calendarVisible: visible
126
97
  });
127
98
  }
128
-
129
99
  if (!visible) {
130
100
  _this.onChangeDate();
131
101
  }
132
102
  };
133
-
134
103
  _this.renderTip = function () {
135
104
  var copyProps = __assign({}, _this.props);
136
-
137
105
  delete copyProps.onSelect;
138
106
  delete copyProps.className;
139
107
  delete copyProps.onFormatDate;
@@ -148,9 +116,8 @@ function (_super) {
148
116
  defaultDate: _this.defaultDate
149
117
  }));
150
118
  };
151
-
152
119
  var defaultValue = props.defaultValue,
153
- onFormatDate = props.onFormatDate;
120
+ onFormatDate = props.onFormatDate;
154
121
  _this.defaultDate = defaultValue;
155
122
  _this.state = {
156
123
  calendarVisible: false,
@@ -158,36 +125,31 @@ function (_super) {
158
125
  };
159
126
  return _this;
160
127
  }
161
-
162
128
  DatePicker.getDerivedStateFromProps = function (nextProps, prevState) {
163
129
  if ('value' in nextProps) {
164
130
  var onFormatDate = nextProps.onFormatDate,
165
- value = nextProps.value;
131
+ value = nextProps.value;
166
132
  var currentValue = value ? onFormatDate(value) : '';
167
-
168
133
  if (prevState.inputValue === currentValue) {
169
134
  return null;
170
135
  }
171
-
172
136
  return {
173
137
  inputValue: currentValue,
174
138
  calendarVisible: false
175
139
  };
176
140
  }
177
-
178
141
  return null;
179
142
  };
180
-
181
143
  DatePicker.prototype.render = function () {
182
144
  var cls = this.prefixCls;
183
145
  var _a = this.props,
184
- className = _a.className,
185
- prefix = _a.prefix,
186
- iconVisible = _a.iconVisible,
187
- disabled = _a.disabled;
146
+ className = _a.className,
147
+ prefix = _a.prefix,
148
+ iconVisible = _a.iconVisible,
149
+ disabled = _a.disabled;
188
150
  var _b = this.state,
189
- calendarVisible = _b.calendarVisible,
190
- inputValue = _b.inputValue;
151
+ calendarVisible = _b.calendarVisible,
152
+ inputValue = _b.inputValue;
191
153
  return /*#__PURE__*/React.createElement(Popover, {
192
154
  tip: this.renderTip(),
193
155
  visible: calendarVisible,
@@ -217,7 +179,6 @@ function (_super) {
217
179
  d: "M928 128H832V64h-64v64H256V64H192v64H96l-32 32v768l32 32h832l32-32v-768l-32-32zM896 896H128V320h768v576z m0-640H128V192h768v64zM256 512H192v64h64V512z m-64 128h64v64H192v-64z m64 128H192v64h64v-64z m128-256h64v64H384V512z m64 128H384v64h64v-64z m-64 128h64v64H384v-64z m64-384H384v64h64V384z m128 128h64v64H576V512z m64 128H576v64h64v-64z m-64 128h64v64H576v-64z m64-384H576v64h64V384z m128 128h64v64h-64V512z m64 128h-64v64h64v-64z m-64-256h64v64h-64V384z"
218
180
  })))));
219
181
  };
220
-
221
182
  DatePicker.defaultProps = {
222
183
  onFormatDate: function onFormatDate(date) {
223
184
  return date.toDateString();
@@ -231,5 +192,4 @@ function (_super) {
231
192
  };
232
193
  return DatePicker;
233
194
  }(React.Component);
234
-
235
195
  export default DatePicker;
@@ -1 +1 @@
1
- .ab-date-picker{position:relative}.ab-date-picker-input{outline:0;font-size:.14rem;padding:.04rem;width:1.44rem}.ab-date-picker-input.ab-date-picker-error{background:#fffacd}.ab-date-picker-icon{color:#606060;position:absolute;right:.05rem;top:50%;transform:translateY(-50%)}
1
+ .ab-dp-cal{display:flex}.ab-dp-cal-my{padding-left:.12rem;margin-left:.12rem;border-left:1px solid #b0b0b0}.ab-dp-cal-day,.ab-dp-cal-my{width:2.1rem}.ab-dp-cal-dis{color:#c8c8c8}.ab-dp-cal-dg>ul>li{width:14.28%;height:.28rem}.ab-dp-cal-dg>ul>li.ab-dp-cal-out{color:#666}.ab-dp-cal-myg{padding-bottom:.62rem}.ab-dp-cal-myg>ul{justify-content:space-between}.ab-dp-cal-myg>ul>li{width:.4rem;height:.4rem;margin-bottom:.1rem}.ab-dp-cal-t{cursor:pointer;position:absolute;right:.08rem;bottom:.3rem}.ab-dp-cal-t.ab-dp-cal-t-dis{color:#b0b0b0;cursor:default}.ab-dp-cg-content,.ab-dp-cg-head,.ab-dp-cg-title{display:flex;align-items:center}.ab-dp-cg-title{user-select:none;font-size:.14rem;padding-bottom:.08rem}.ab-dp-cg-title>strong{flex:1 1;margin-left:.1rem;cursor:default;color:#4a4a4a}.ab-dp-cg-title>strong.ab-dp-cg-clickable{cursor:pointer}.ab-dp-cg-title>strong.ab-dp-cg-clickable:hover{color:#000}.ab-dp-cg-dis-icon,.ab-dp-cg-icon{align-self:flex-end;margin-left:.08rem}.ab-dp-cg-icon{cursor:pointer}.ab-dp-cg-head{padding-bottom:.05rem}.ab-dp-cg-head>li{display:flex;align-items:center;justify-content:center;cursor:default}.ab-dp-cg-content{flex-wrap:wrap}.ab-dp-cg-content>li{cursor:pointer;display:flex;align-items:center;justify-content:center;color:#000}.ab-dp-cg-content>li:hover{background:#f0f0f0}.ab-dp-cg-content>li.ab-dp-cg-dis{cursor:not-allowed;color:#b0b0b0}.ab-dp-cg-content>li.ab-dp-cg-dis:hover{background:0 0}.ab-dp-cg-content>li.ab-dp-cg-selected,.ab-dp-cg-content>li:active{background:#c7e0f4;border:3px solid #c7e0f4;border-radius:2px;color:#000}.ab-dp-cg-content>li.ab-dp-cg-today{background:#0078d4;color:#fff}.ab-dp-cg-arrow{cursor:pointer}.ab-trigger-wrap{position:absolute;top:0;left:0;z-index:101}.ab-trigger-wrap.ab-trigger-hidden{display:none}.ab-trigger-mask{position:fixed;top:0;left:0;bottom:0;right:0;z-index:101;background-color:transparent;display:none}.ab-trigger-mask.ab-trigger-mask-show{display:block}.ab-trigger-fade-appear,.ab-trigger-fade-enter,.ab-trigger-fade-hr-appear,.ab-trigger-fade-hr-enter{opacity:0}.ab-trigger-fade-appear,.ab-trigger-fade-enter{transform:scale(.7)}.ab-trigger-fade-hr-appear,.ab-trigger-fade-hr-enter{opacity:0;transform:scaleY(.7)}.ab-trigger-fade-appear-active,.ab-trigger-fade-enter-active,.ab-trigger-fade-hr-appear-active,.ab-trigger-fade-hr-enter-active{opacity:1;transition:opacity .2s,transform .2s}.ab-trigger-fade-appear-active,.ab-trigger-fade-enter-active{transform:scale(1)}.ab-trigger-fade-hr-appear-active,.ab-trigger-fade-hr-enter-active{transform:scaleY(1)}.ab-trigger-fade-exit,.ab-trigger-fade-hr-exit{opacity:1}.ab-trigger-fade-exit-active,.ab-trigger-fade-hr-exit-active{opacity:0;transition:opacity .2s,transform .2s}.ab-trigger-fade-exit-active{transform:scale(.7)}.ab-trigger-fade-hr-exit-active{transform:scaleY(.7)}.ab-trigger-fade-exit-done,.ab-trigger-fade-hr-exit-done{display:none}.ab-popover-wrap{background-color:#fff;background-clip:padding-box;box-shadow:0 2px 8px rgba(0,0,0,.15);padding:.08rem .11rem .05rem;min-width:210px;border-radius:4px}.ab-popover-inner{position:relative;width:100%;overflow:hidden;font-size:.12rem}.ab-popover-inner-expand{padding-right:.1rem}.ab-popover-arrow{position:absolute;display:block;width:8px;height:8px;border-style:solid;background-color:#fff;border-color:transparent #fff #fff transparent;border-width:4px;box-shadow:3px 3px 7px rgba(0,0,0,.07)}.ab-popover-close{position:absolute;right:.02rem;top:.05rem;cursor:pointer;padding:0 .05rem;color:#bfbfbf;font-size:.2rem;line-height:1;z-index:2}.ab-popover-close:hover{color:#4a4a4a}@media only screen and (max-width:767px){.ab-popover-wrap{width:calc(100% - .3rem)}}.ab-date-picker{position:relative}.ab-date-picker-input{outline:0;font-size:.14rem;padding:.04rem;width:1.44rem}.ab-date-picker-input.ab-date-picker-error{background:#fffacd}.ab-date-picker-icon{color:#606060;position:absolute;right:.05rem;top:50%;transform:translateY(-50%)}
@@ -8,7 +8,6 @@ export function getDateValue(date) {
8
8
  year: 0
9
9
  };
10
10
  }
11
-
12
11
  return {
13
12
  week: date.getDay(),
14
13
  day: date.getDate(),
@@ -33,23 +32,19 @@ export function getYearAdd(date, offset) {
33
32
  }
34
33
  export function compareDate(prevDate, nextDate) {
35
34
  var _a = getDateValue(prevDate),
36
- year = _a.year,
37
- month = _a.month,
38
- day = _a.day;
39
-
35
+ year = _a.year,
36
+ month = _a.month,
37
+ day = _a.day;
40
38
  var _b = getDateValue(nextDate),
41
- nextYear = _b.year,
42
- nextMonth = _b.month,
43
- nextDay = _b.day;
44
-
39
+ nextYear = _b.year,
40
+ nextMonth = _b.month,
41
+ nextDay = _b.day;
45
42
  if (year !== nextYear) {
46
43
  return year - nextYear;
47
44
  }
48
-
49
45
  if (month !== nextMonth) {
50
46
  return month - nextMonth;
51
47
  }
52
-
53
48
  return day - nextDay;
54
49
  }
55
50
  export function isOutOfDate(date, minDate, maxDate) {
@@ -2,41 +2,34 @@ var __assign = this && this.__assign || function () {
2
2
  __assign = Object.assign || function (t) {
3
3
  for (var s, i = 1, n = arguments.length; i < n; i++) {
4
4
  s = arguments[i];
5
-
6
5
  for (var p in s) {
7
6
  if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
8
7
  }
9
8
  }
10
-
11
9
  return t;
12
10
  };
13
-
14
11
  return __assign.apply(this, arguments);
15
12
  };
16
-
17
13
  import React from 'react';
18
14
  import { Transition } from 'react-transition-group';
19
15
  import classNames from 'classnames';
20
-
21
16
  function Child(_a, ref) {
22
17
  var _b;
23
-
24
18
  var cls = _a.prefixCls,
25
- visible = _a.visible,
26
- children = _a.children,
27
- width = _a.width,
28
- height = _a.height,
29
- className = _a.className,
30
- placement = _a.placement,
31
- closable = _a.closable,
32
- onEnter = _a.onEnter,
33
- onExited = _a.onExited,
34
- onCancel = _a.onCancel;
19
+ visible = _a.visible,
20
+ children = _a.children,
21
+ width = _a.width,
22
+ height = _a.height,
23
+ className = _a.className,
24
+ placement = _a.placement,
25
+ closable = _a.closable,
26
+ onEnter = _a.onEnter,
27
+ onExited = _a.onExited,
28
+ onCancel = _a.onCancel;
35
29
  var enterStyle = {
36
30
  transform: 'translate(0, 0)'
37
31
  };
38
32
  var contentStyle = (_b = {}, _b[placement] = '0px', _b);
39
-
40
33
  if (placement === 'left' || placement === 'right') {
41
34
  contentStyle.width = width;
42
35
  contentStyle.height = '100%';
@@ -46,7 +39,6 @@ function Child(_a, ref) {
46
39
  contentStyle.height = height;
47
40
  contentStyle.left = '0px';
48
41
  }
49
-
50
42
  var transitionStyles = {
51
43
  entering: enterStyle,
52
44
  entered: enterStyle,
@@ -61,7 +53,6 @@ function Child(_a, ref) {
61
53
  onExited: onExited
62
54
  }, function (state) {
63
55
  var _a;
64
-
65
56
  var nextStyles = state !== 'exited' ? contentStyle : {};
66
57
  return /*#__PURE__*/React.createElement("div", {
67
58
  style: __assign(__assign({}, nextStyles), transitionStyles[state]),
@@ -73,5 +64,4 @@ function Child(_a, ref) {
73
64
  }, "\xD7") : null, children);
74
65
  });
75
66
  }
76
-
77
67
  export default /*#__PURE__*/React.forwardRef(Child);