@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
@@ -17,9 +17,7 @@ exports.getYearAdd = getYearAdd;
17
17
  exports.getYearEnd = getYearEnd;
18
18
  exports.getYearStart = getYearStart;
19
19
  exports.isOutOfDate = isOutOfDate;
20
-
21
20
  var _DateEnum = require("./DateEnum");
22
-
23
21
  function getDateValue(date) {
24
22
  if (!date) {
25
23
  return {
@@ -29,7 +27,6 @@ function getDateValue(date) {
29
27
  year: 0
30
28
  };
31
29
  }
32
-
33
30
  return {
34
31
  week: date.getDay(),
35
32
  day: date.getDate(),
@@ -37,79 +34,62 @@ function getDateValue(date) {
37
34
  year: date.getFullYear()
38
35
  };
39
36
  }
40
-
41
37
  function getDayAdd(date, offset) {
42
38
  var result = new Date(date.getTime());
43
39
  result.setDate(date.getDate() + offset);
44
40
  return result;
45
41
  }
46
-
47
42
  function getMonthAdd(date, offset) {
48
43
  var result = new Date(date.getTime());
49
44
  result.setMonth(date.getMonth() + offset);
50
45
  return result;
51
46
  }
52
-
53
47
  function getYearAdd(date, offset) {
54
48
  var result = new Date(date.getTime());
55
49
  result.setFullYear(date.getFullYear() + offset);
56
50
  return result;
57
51
  }
58
-
59
52
  function compareDate(prevDate, nextDate) {
60
53
  var _a = getDateValue(prevDate),
61
- year = _a.year,
62
- month = _a.month,
63
- day = _a.day;
64
-
54
+ year = _a.year,
55
+ month = _a.month,
56
+ day = _a.day;
65
57
  var _b = getDateValue(nextDate),
66
- nextYear = _b.year,
67
- nextMonth = _b.month,
68
- nextDay = _b.day;
69
-
58
+ nextYear = _b.year,
59
+ nextMonth = _b.month,
60
+ nextDay = _b.day;
70
61
  if (year !== nextYear) {
71
62
  return year - nextYear;
72
63
  }
73
-
74
64
  if (month !== nextMonth) {
75
65
  return month - nextMonth;
76
66
  }
77
-
78
67
  return day - nextDay;
79
68
  }
80
-
81
69
  function isOutOfDate(date, minDate, maxDate) {
82
70
  return !!minDate && compareDate(minDate, date) > 0 || !!maxDate && compareDate(maxDate, date) < 0;
83
71
  }
84
-
85
72
  function getMonthStart(year, month) {
86
73
  return new Date(year, month, 1, 0, 0, 0, 0);
87
74
  }
88
-
89
75
  function getMonthEnd(year, month) {
90
76
  return new Date(year, month + 1, 0, 0, 0, 0, 0);
91
77
  }
92
-
93
78
  function getYearStart(year) {
94
79
  return new Date(year, 0, 1, 0, 0, 0, 0);
95
80
  }
96
-
97
81
  function getYearEnd(year) {
98
82
  return new Date(year + 1, 0, 0, 0, 0, 0, 0);
99
83
  }
100
-
101
84
  function getMonthFullName(month) {
102
85
  return Object.keys(_DateEnum.MonthOfYear)[Object.values(_DateEnum.MonthOfYear).indexOf(month)];
103
86
  }
104
-
105
87
  function getStartWeekInMonth(date) {
106
88
  return new Date(date.getFullYear(), date.getMonth(), 1).getDay();
107
89
  }
108
-
109
90
  function getEndWeekInMonth(date) {
110
91
  return new Date(date.getFullYear(), date.getMonth() + 1, 0).getDay();
111
92
  }
112
-
113
93
  function getDaysInMonth(date) {
114
94
  return new Date(date.getFullYear(), date.getMonth() + 1, 0).getDate();
115
95
  }
@@ -1,53 +1,42 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
7
  exports.default = void 0;
9
-
10
8
  var _react = _interopRequireDefault(require("react"));
11
-
12
9
  var _reactTransitionGroup = require("react-transition-group");
13
-
14
10
  var _classnames = _interopRequireDefault(require("classnames"));
15
-
16
11
  var __assign = void 0 && (void 0).__assign || function () {
17
12
  __assign = Object.assign || function (t) {
18
13
  for (var s, i = 1, n = arguments.length; i < n; i++) {
19
14
  s = arguments[i];
20
-
21
15
  for (var p in s) {
22
16
  if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
23
17
  }
24
18
  }
25
-
26
19
  return t;
27
20
  };
28
-
29
21
  return __assign.apply(this, arguments);
30
22
  };
31
-
32
23
  function Child(_a, ref) {
33
24
  var _b;
34
-
35
25
  var cls = _a.prefixCls,
36
- visible = _a.visible,
37
- children = _a.children,
38
- width = _a.width,
39
- height = _a.height,
40
- className = _a.className,
41
- placement = _a.placement,
42
- closable = _a.closable,
43
- onEnter = _a.onEnter,
44
- onExited = _a.onExited,
45
- onCancel = _a.onCancel;
26
+ visible = _a.visible,
27
+ children = _a.children,
28
+ width = _a.width,
29
+ height = _a.height,
30
+ className = _a.className,
31
+ placement = _a.placement,
32
+ closable = _a.closable,
33
+ onEnter = _a.onEnter,
34
+ onExited = _a.onExited,
35
+ onCancel = _a.onCancel;
46
36
  var enterStyle = {
47
37
  transform: 'translate(0, 0)'
48
38
  };
49
39
  var contentStyle = (_b = {}, _b[placement] = '0px', _b);
50
-
51
40
  if (placement === 'left' || placement === 'right') {
52
41
  contentStyle.width = width;
53
42
  contentStyle.height = '100%';
@@ -57,7 +46,6 @@ function Child(_a, ref) {
57
46
  contentStyle.height = height;
58
47
  contentStyle.left = '0px';
59
48
  }
60
-
61
49
  var transitionStyles = {
62
50
  entering: enterStyle,
63
51
  entered: enterStyle,
@@ -72,7 +60,6 @@ function Child(_a, ref) {
72
60
  onExited: onExited
73
61
  }, function (state) {
74
62
  var _a;
75
-
76
63
  var nextStyles = state !== 'exited' ? contentStyle : {};
77
64
  return /*#__PURE__*/_react.default.createElement("div", {
78
65
  style: __assign(__assign({}, nextStyles), transitionStyles[state]),
@@ -84,7 +71,5 @@ function Child(_a, ref) {
84
71
  }, "\xD7") : null, children);
85
72
  });
86
73
  }
87
-
88
74
  var _default = /*#__PURE__*/_react.default.forwardRef(Child);
89
-
90
75
  exports.default = _default;
@@ -1,24 +1,16 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
7
  exports.default = void 0;
9
-
10
8
  var _react = _interopRequireDefault(require("react"));
11
-
12
9
  var _classnames = _interopRequireDefault(require("classnames"));
13
-
14
10
  var _utils = require("@autobest-ui/utils");
15
-
16
11
  var _portal = _interopRequireDefault(require("../portal"));
17
-
18
12
  var _mask = _interopRequireDefault(require("../mask"));
19
-
20
13
  var _Child = _interopRequireDefault(require("./Child"));
21
-
22
14
  var __extends = void 0 && (void 0).__extends || function () {
23
15
  var _extendStatics = function extendStatics(d, b) {
24
16
  _extendStatics = Object.setPrototypeOf || {
@@ -30,135 +22,102 @@ var __extends = void 0 && (void 0).__extends || function () {
30
22
  if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
31
23
  }
32
24
  };
33
-
34
25
  return _extendStatics(d, b);
35
26
  };
36
-
37
27
  return function (d, b) {
38
28
  if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
39
-
40
29
  _extendStatics(d, b);
41
-
42
30
  function __() {
43
31
  this.constructor = d;
44
32
  }
45
-
46
33
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
47
34
  };
48
35
  }();
49
-
50
36
  var __assign = void 0 && (void 0).__assign || function () {
51
37
  __assign = Object.assign || function (t) {
52
38
  for (var s, i = 1, n = arguments.length; i < n; i++) {
53
39
  s = arguments[i];
54
-
55
40
  for (var p in s) {
56
41
  if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
57
42
  }
58
43
  }
59
-
60
44
  return t;
61
45
  };
62
-
63
46
  return __assign.apply(this, arguments);
64
47
  };
65
-
66
48
  var __rest = void 0 && (void 0).__rest || function (s, e) {
67
49
  var t = {};
68
-
69
50
  for (var p in s) {
70
51
  if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
71
52
  }
72
-
73
53
  if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
74
54
  if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
75
55
  }
76
56
  return t;
77
57
  };
78
-
79
- var Drawer =
80
- /** @class */
81
- function (_super) {
58
+ var Drawer = /** @class */function (_super) {
82
59
  __extends(Drawer, _super);
83
-
84
60
  function Drawer(props) {
85
61
  var _this = _super.call(this, props) || this;
86
-
87
62
  _this.prefixCls = 'ab-drawer';
88
63
  _this.childRef = /*#__PURE__*/_react.default.createRef();
89
-
90
64
  _this.onClose = function () {
91
65
  var _a = _this.props,
92
- maskClosable = _a.maskClosable,
93
- onClose = _a.onClose,
94
- name = _a.name;
95
-
66
+ maskClosable = _a.maskClosable,
67
+ onClose = _a.onClose,
68
+ name = _a.name;
96
69
  if (maskClosable && onClose) {
97
70
  onClose(false, name);
98
71
  }
99
72
  };
100
-
101
73
  _this.onCancel = function () {
102
74
  var _a = _this.props,
103
- onClose = _a.onClose,
104
- name = _a.name;
105
-
75
+ onClose = _a.onClose,
76
+ name = _a.name;
106
77
  if (onClose) {
107
78
  onClose(false, name);
108
79
  }
109
- }; // 用于标志是否弹出,防止在单页面应用时,没有onEnter,但是在销毁时执行onExited
110
-
111
-
80
+ };
81
+ // 用于标志是否弹出,防止在单页面应用时,没有onEnter,但是在销毁时执行onExited
112
82
  _this.isEnter = false;
113
-
114
83
  _this.onEnter = function () {
115
84
  _this.isEnter = true;
116
85
  var currentDocument = window.document.body;
117
86
  var hiddenScroll = _this.props.hiddenScroll;
118
-
119
87
  if (hiddenScroll) {
120
88
  currentDocument.style.overflow = 'hidden';
121
89
  var scrollSize = (0, _utils.getScrollBarSize)();
122
-
123
90
  if ((0, _utils.hasVerticalScrollbar)(scrollSize)) {
124
91
  currentDocument.style.paddingRight = "".concat(scrollSize, "px");
125
92
  }
126
93
  }
127
94
  };
128
-
129
95
  _this.onExited = function () {
130
96
  if (!_this.isEnter) {
131
97
  return;
132
98
  }
133
-
134
99
  var currentDocument = window.document.body;
135
100
  var hiddenScroll = _this.props.hiddenScroll;
136
-
137
101
  if (hiddenScroll && currentDocument) {
138
102
  currentDocument.style.overflow = '';
139
103
  currentDocument.style.paddingRight = '';
140
- } // 插入元素,在exited时, 设置为hidden
141
-
142
-
104
+ }
105
+ // 插入元素,在exited时, 设置为hidden
143
106
  _this.setState({
144
107
  isHidden: true
145
108
  });
146
-
147
109
  var _a = _this.props,
148
- onDestroy = _a.onDestroy,
149
- name = _a.name;
150
-
110
+ onDestroy = _a.onDestroy,
111
+ name = _a.name;
151
112
  if (onDestroy) {
152
113
  onDestroy(name);
153
114
  }
154
115
  };
155
-
156
116
  _this.state = {
157
117
  isHidden: !props.visible
158
118
  };
159
119
  return _this;
160
120
  }
161
-
162
121
  Drawer.getDerivedStateFromProps = function (nextProps, prevState) {
163
122
  // 在visible发生改变时,判断是否hidden, 并设置hidden:false,
164
123
  // 注:不能在onEnter处理,否则动画无法执行
@@ -167,22 +126,17 @@ function (_super) {
167
126
  isHidden: false
168
127
  };
169
128
  }
170
-
171
129
  return null;
172
130
  };
173
-
174
131
  Drawer.prototype.componentWillUnmount = function () {
175
132
  // 销毁时,如果没有执行onExited,则在此执行
176
133
  this.onExited();
177
134
  };
178
-
179
135
  Drawer.prototype.renderMask = function () {
180
136
  var _a;
181
-
182
137
  var _b = this.props,
183
- visible = _b.visible,
184
- showMask = _b.showMask;
185
-
138
+ visible = _b.visible,
139
+ showMask = _b.showMask;
186
140
  if (showMask) {
187
141
  return /*#__PURE__*/_react.default.createElement(_mask.default, {
188
142
  onClose: this.onClose,
@@ -191,19 +145,15 @@ function (_super) {
191
145
  timeout: 300
192
146
  });
193
147
  }
194
-
195
148
  return null;
196
149
  };
197
-
198
150
  Drawer.prototype.renderChild = function () {
199
151
  var _a;
200
-
201
152
  var _b = this.props,
202
- visible = _b.visible,
203
- children = _b.children,
204
- className = _b.className,
205
- extraProps = __rest(_b, ["visible", "children", "className"]);
206
-
153
+ visible = _b.visible,
154
+ children = _b.children,
155
+ className = _b.className,
156
+ extraProps = __rest(_b, ["visible", "children", "className"]);
207
157
  return /*#__PURE__*/_react.default.createElement(_Child.default, __assign({}, extraProps, {
208
158
  visible: visible,
209
159
  className: (0, _classnames.default)(className, (_a = {}, _a["".concat(this.prefixCls, "-hidden")] = this.state.isHidden, _a)),
@@ -214,24 +164,19 @@ function (_super) {
214
164
  ref: this.childRef
215
165
  }), children);
216
166
  };
217
-
218
167
  Drawer.prototype.render = function () {
219
168
  var _a = this.props,
220
- visible = _a.visible,
221
- isInsertNode = _a.isInsertNode;
222
-
169
+ visible = _a.visible,
170
+ isInsertNode = _a.isInsertNode;
223
171
  if (isInsertNode) {
224
172
  return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, this.renderMask(), this.renderChild());
225
173
  }
226
-
227
174
  if (visible || this.childRef.current) {
228
175
  return /*#__PURE__*/_react.default.createElement(_portal.default, null, /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, this.renderMask(), this.renderChild()));
229
176
  }
230
-
231
177
  return null;
232
- }; // 默认值
233
-
234
-
178
+ };
179
+ // 默认值
235
180
  Drawer.defaultProps = {
236
181
  placement: 'left',
237
182
  width: '2.45rem',
@@ -245,6 +190,5 @@ function (_super) {
245
190
  };
246
191
  return Drawer;
247
192
  }(_react.default.Component);
248
-
249
193
  var _default = Drawer;
250
194
  exports.default = _default;
@@ -1 +1 @@
1
- .ab-drawer{position:fixed;z-index:101;background-color:#fff;overflow:auto;transition:transform .3s cubic-bezier(.7,.3,.1,1)}.ab-drawer-times{position:absolute;right:.17rem;font-size:.16rem;color:#b0b0b0;cursor:pointer;top:.11rem}.ab-drawer-times:hover{color:#333}.ab-drawer-tf-top{transform:translate(0,-100%)}.ab-drawer-tf-bottom{transform:translate(0,100%)}.ab-drawer-tf-left{transform:translate(-100%,0)}.ab-drawer-tf-right{transform:translate(100%,0)}.ab-drawer-hidden.ab-drawer,.ab-drawer-hidden.ab-mask{display:none}
1
+ .ab-mask{position:fixed;top:0;left:0;z-index:101;width:100%;height:100%;background-color:rgba(0,0,0,.45);transition:opacity .4s cubic-bezier(.7,.3,.1,1)}.ab-mask-fade-appear,.ab-mask-fade-enter{opacity:0}.ab-mask-fade-appear-active,.ab-mask-fade-enter-active,.ab-mask-fade-enter-done,.ab-mask-fade-exit{opacity:1}.ab-mask-fade-exit-active{opacity:0}.ab-mask-fade-exit-done{display:none}.ab-drawer{position:fixed;z-index:101;background-color:#fff;overflow:auto;transition:transform .3s cubic-bezier(.7,.3,.1,1)}.ab-drawer-times{position:absolute;right:.17rem;font-size:.16rem;color:#b0b0b0;cursor:pointer;top:.11rem}.ab-drawer-times:hover{color:#333}.ab-drawer-tf-top{transform:translate(0,-100%)}.ab-drawer-tf-bottom{transform:translate(0,100%)}.ab-drawer-tf-left{transform:translate(-100%,0)}.ab-drawer-tf-right{transform:translate(100%,0)}.ab-drawer-hidden.ab-drawer,.ab-drawer-hidden.ab-mask{display:none}
@@ -1,55 +1,44 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
7
  exports.default = void 0;
9
-
10
8
  var _react = _interopRequireDefault(require("react"));
11
-
12
9
  var _classnames = _interopRequireDefault(require("classnames"));
13
-
14
10
  var _reactIs = require("react-is");
15
-
16
11
  var __assign = void 0 && (void 0).__assign || function () {
17
12
  __assign = Object.assign || function (t) {
18
13
  for (var s, i = 1, n = arguments.length; i < n; i++) {
19
14
  s = arguments[i];
20
-
21
15
  for (var p in s) {
22
16
  if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
23
17
  }
24
18
  }
25
-
26
19
  return t;
27
20
  };
28
-
29
21
  return __assign.apply(this, arguments);
30
22
  };
31
-
32
23
  var cls = 'ab-ellipsis';
33
-
34
24
  function Ellipsis(props) {
35
25
  var _a, _b;
36
-
37
26
  var children = props.children,
38
- maxHeight = props.maxHeight,
39
- className = props.className,
40
- _c = props.lines,
41
- lines = _c === void 0 ? 0 : _c,
42
- title = props.title,
43
- _d = props.mobileLines,
44
- mobileLines = _d === void 0 ? 0 : _d;
27
+ maxHeight = props.maxHeight,
28
+ className = props.className,
29
+ _c = props.lines,
30
+ lines = _c === void 0 ? 0 : _c,
31
+ title = props.title,
32
+ _d = props.mobileLines,
33
+ mobileLines = _d === void 0 ? 0 : _d;
45
34
  var wrapCls = (0, _classnames.default)(cls, className, (_a = {}, _a["".concat(cls, "-line").concat(lines)] = lines > 0, _a), (_b = {}, _b["".concat(cls, "-m-line").concat(mobileLines)] = mobileLines > 0, _b));
46
35
  var style = maxHeight ? {
47
36
  maxHeight: maxHeight
48
37
  } : null;
49
38
  var titleParam = title ? {
50
39
  title: title
51
- } : null; // 当children是单个标签元素时(非文本元素),将直接在该标签上加上style, className,title属性
52
-
40
+ } : null;
41
+ // 当children是单个标签元素时(非文本元素),将直接在该标签上加上style, className,title属性
53
42
  if (!(0, _reactIs.isFragment)(children) && (0, _reactIs.isElement)(children)) {
54
43
  var child = children;
55
44
  return /*#__PURE__*/_react.default.cloneElement(child, __assign(__assign({}, titleParam), {
@@ -57,14 +46,11 @@ function Ellipsis(props) {
57
46
  style: __assign(__assign({}, style), child.props.style)
58
47
  }));
59
48
  }
60
-
61
49
  return /*#__PURE__*/_react.default.createElement("span", __assign({
62
50
  className: wrapCls
63
51
  }, titleParam, {
64
52
  style: style
65
53
  }), children);
66
54
  }
67
-
68
55
  var _default = /*#__PURE__*/_react.default.memo(Ellipsis);
69
-
70
56
  exports.default = _default;
@@ -1 +1 @@
1
- .ab-ellipsis{overflow:hidden;display:block;display:-webkit-box;-webkit-box-orient:vertical}.ab-ellipsis.ab-ellipsis-line1{-webkit-line-clamp:1}.ab-ellipsis.ab-ellipsis-line2{-webkit-line-clamp:2}.ab-ellipsis.ab-ellipsis-line3{-webkit-line-clamp:3}.ab-ellipsis.ab-ellipsis-line4{-webkit-line-clamp:4}.ab-ellipsis.ab-ellipsis-line5{-webkit-line-clamp:5}@media only screen and (max-width:767px){.ab-ellipsis.ab-ellipsis-line1{-webkit-line-clamp:unset}.ab-ellipsis.ab-ellipsis-line2{-webkit-line-clamp:unset}.ab-ellipsis.ab-ellipsis-line3{-webkit-line-clamp:unset}.ab-ellipsis.ab-ellipsis-line4{-webkit-line-clamp:unset}.ab-ellipsis.ab-ellipsis-line5{-webkit-line-clamp:unset}.ab-ellipsis.ab-ellipsis-m-line1{-webkit-line-clamp:1}.ab-ellipsis.ab-ellipsis-m-line2{-webkit-line-clamp:2}.ab-ellipsis.ab-ellipsis-m-line3{-webkit-line-clamp:3}.ab-ellipsis.ab-ellipsis-m-line4{-webkit-line-clamp:4}.ab-ellipsis.ab-ellipsis-m-line5{-webkit-line-clamp:5}}
1
+ .ab-ellipsis{overflow:hidden;display:block;display:-webkit-box;-webkit-box-orient:vertical}.ab-ellipsis.ab-ellipsis-line1{-webkit-line-clamp:1}.ab-ellipsis.ab-ellipsis-line2{-webkit-line-clamp:2}.ab-ellipsis.ab-ellipsis-line3{-webkit-line-clamp:3}.ab-ellipsis.ab-ellipsis-line4{-webkit-line-clamp:4}.ab-ellipsis.ab-ellipsis-line5{-webkit-line-clamp:5}@media only screen and (max-width:767px){.ab-ellipsis.ab-ellipsis-line1,.ab-ellipsis.ab-ellipsis-line2,.ab-ellipsis.ab-ellipsis-line3,.ab-ellipsis.ab-ellipsis-line4,.ab-ellipsis.ab-ellipsis-line5{-webkit-line-clamp:unset}.ab-ellipsis.ab-ellipsis-m-line1{-webkit-line-clamp:1}.ab-ellipsis.ab-ellipsis-m-line2{-webkit-line-clamp:2}.ab-ellipsis.ab-ellipsis-m-line3{-webkit-line-clamp:3}.ab-ellipsis.ab-ellipsis-m-line4{-webkit-line-clamp:4}.ab-ellipsis.ab-ellipsis-m-line5{-webkit-line-clamp:5}}