@king-design/react 3.1.4-beta.2 → 3.1.5

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 (553) hide show
  1. package/__tests__/__snapshots__/Dialog.md +1 -1
  2. package/__tests__/__snapshots__/React Demos.md +260 -254
  3. package/__tests__/components/cascader.spec.tsx +1 -1
  4. package/components/affix/index.d.ts +2 -2
  5. package/components/affix/index.js +0 -5
  6. package/components/affix/index.spec.js +84 -108
  7. package/components/affix/index.vdt.js +7 -10
  8. package/components/affix/styles.js +1 -1
  9. package/components/affix/useStyle.js +8 -19
  10. package/components/badge/index.js +0 -5
  11. package/components/badge/index.vdt.js +7 -11
  12. package/components/badge/styles.js +1 -3
  13. package/components/breadcrumb/index.js +0 -7
  14. package/components/breadcrumb/index.spec.js +6 -6
  15. package/components/breadcrumb/index.vdt.js +5 -14
  16. package/components/breadcrumb/item.js +0 -8
  17. package/components/breadcrumb/item.vdt.js +3 -6
  18. package/components/breadcrumb/styles.js +1 -4
  19. package/components/button/dynamicButton.d.ts +1 -1
  20. package/components/button/dynamicButton.js +2 -5
  21. package/components/button/group.js +2 -13
  22. package/components/button/group.vdt.js +5 -8
  23. package/components/button/index.js +3 -27
  24. package/components/button/index.spec.js +74 -96
  25. package/components/button/index.vdt.js +21 -31
  26. package/components/button/styles.d.ts +2 -2
  27. package/components/button/styles.js +8 -53
  28. package/components/card/column.js +0 -5
  29. package/components/card/column.vdt.js +5 -10
  30. package/components/card/index.js +0 -7
  31. package/components/card/index.vdt.js +5 -17
  32. package/components/card/styles.js +3 -6
  33. package/components/carousel/index.js +1 -19
  34. package/components/carousel/index.spec.js +127 -163
  35. package/components/carousel/index.vdt.js +12 -16
  36. package/components/carousel/item.js +0 -5
  37. package/components/carousel/item.vdt.js +4 -7
  38. package/components/carousel/styles.js +2 -3
  39. package/components/carousel/useAutoplay.js +0 -4
  40. package/components/carousel/useItems.js +4 -20
  41. package/components/carousel/useSlide.js +57 -89
  42. package/components/cascader/index.js +3 -18
  43. package/components/cascader/index.spec.js +365 -379
  44. package/components/cascader/index.vdt.js +15 -33
  45. package/components/cascader/styles.js +2 -8
  46. package/components/cascader/useFields.js +1 -4
  47. package/components/cascader/useFilterable.js +2 -19
  48. package/components/cascader/useLabel.js +1 -9
  49. package/components/cascader/useLoad.js +22 -35
  50. package/components/cascader/useValue.d.ts +2 -2
  51. package/components/cascader/useValue.js +6 -27
  52. package/components/checkbox/index.js +5 -27
  53. package/components/checkbox/index.spec.js +129 -171
  54. package/components/checkbox/index.vdt.js +12 -16
  55. package/components/checkbox/styles.js +1 -13
  56. package/components/code/crossDomain.js +2 -9
  57. package/components/code/index.js +0 -9
  58. package/components/code/index.spec.js +46 -55
  59. package/components/code/index.vdt.js +6 -14
  60. package/components/code/styles.js +0 -1
  61. package/components/code/useEditor.js +5 -10
  62. package/components/collapse/index.d.ts +1 -1
  63. package/components/collapse/index.js +3 -17
  64. package/components/collapse/index.spec.js +47 -60
  65. package/components/collapse/index.vdt.js +4 -12
  66. package/components/collapse/item.js +0 -10
  67. package/components/collapse/item.vdt.js +7 -14
  68. package/components/collapse/styles.js +2 -5
  69. package/components/colorpicker/drag.js +0 -5
  70. package/components/colorpicker/index.js +0 -7
  71. package/components/colorpicker/index.spec.js +211 -259
  72. package/components/colorpicker/index.vdt.js +8 -11
  73. package/components/colorpicker/panel.js +0 -5
  74. package/components/colorpicker/panel.vdt.js +21 -26
  75. package/components/colorpicker/styles.js +4 -15
  76. package/components/colorpicker/useDrag.js +22 -26
  77. package/components/colorpicker/useInput.js +0 -16
  78. package/components/colorpicker/usePointer.js +15 -18
  79. package/components/colorpicker/useValue.js +2 -7
  80. package/components/config/index.js +3 -8
  81. package/components/config/index.spec.js +37 -50
  82. package/components/context.d.ts +2 -2
  83. package/components/context.js +2 -21
  84. package/components/copy/index.js +0 -7
  85. package/components/copy/index.spec.js +64 -86
  86. package/components/copy/index.vdt.js +4 -7
  87. package/components/copy/styles.js +0 -1
  88. package/components/copy/useCopy.js +13 -23
  89. package/components/datepicker/basepicker.d.ts +8 -8
  90. package/components/datepicker/basepicker.js +20 -90
  91. package/components/datepicker/calendar.js +0 -11
  92. package/components/datepicker/calendar.vdt.js +11 -15
  93. package/components/datepicker/constants.js +0 -1
  94. package/components/datepicker/dayjs.js +1 -1
  95. package/components/datepicker/helpers.js +3 -15
  96. package/components/datepicker/index.js +6 -32
  97. package/components/datepicker/index.spec.js +1154 -1464
  98. package/components/datepicker/index.vdt.js +20 -34
  99. package/components/datepicker/shortcuts.d.ts +1 -1
  100. package/components/datepicker/shortcuts.js +0 -4
  101. package/components/datepicker/styles.js +3 -12
  102. package/components/datepicker/time.d.ts +1 -1
  103. package/components/datepicker/time.js +3 -23
  104. package/components/datepicker/time.vdt.js +4 -5
  105. package/components/datepicker/useDays.js +2 -9
  106. package/components/datepicker/useDisabled.js +6 -23
  107. package/components/datepicker/useFocusDate.js +0 -2
  108. package/components/datepicker/useFormats.js +6 -15
  109. package/components/datepicker/useKeyboards.js +20 -36
  110. package/components/datepicker/useMonths.js +0 -6
  111. package/components/datepicker/usePanel.js +0 -10
  112. package/components/datepicker/useShowDate.js +10 -37
  113. package/components/datepicker/useStatus.js +3 -15
  114. package/components/datepicker/useValue.js +20 -38
  115. package/components/datepicker/useYears.js +4 -15
  116. package/components/diagram/diagram.js +17 -43
  117. package/components/diagram/diagram.vdt.js +2 -5
  118. package/components/diagram/graph.js +6 -6
  119. package/components/diagram/index.d.ts +1 -1
  120. package/components/diagram/index.js +7 -7
  121. package/components/diagram/index.spec.js +369 -495
  122. package/components/diagram/layouts/circle.js +6 -14
  123. package/components/diagram/layouts/flow.js +7 -15
  124. package/components/diagram/layouts/layout.js +6 -28
  125. package/components/diagram/layouts/organic.js +3 -11
  126. package/components/diagram/layouts/partition.js +4 -12
  127. package/components/diagram/layouts/radial.js +6 -18
  128. package/components/diagram/layouts/stack.js +6 -14
  129. package/components/diagram/layouts/tree.js +11 -21
  130. package/components/diagram/mxgraph/handler/mxConnectionHandler.js +15 -22
  131. package/components/diagram/mxgraph/handler/mxConstraintHandler.js +4 -4
  132. package/components/diagram/mxgraph/handler/mxEdgeHandler.js +11 -15
  133. package/components/diagram/mxgraph/handler/mxGraphHandler.js +6 -9
  134. package/components/diagram/mxgraph/handler/mxRubberband.js +4 -4
  135. package/components/diagram/mxgraph/handler/mxVertexHandler.js +7 -10
  136. package/components/diagram/mxgraph/index.js +0 -2
  137. package/components/diagram/mxgraph/mx.js +3 -3
  138. package/components/diagram/mxgraph/shape/mxCloud.js +2 -2
  139. package/components/diagram/mxgraph/shape/mxCylinder.js +4 -9
  140. package/components/diagram/mxgraph/shape/mxEllipse.js +2 -2
  141. package/components/diagram/mxgraph/shape/mxHexagon.js +2 -2
  142. package/components/diagram/mxgraph/shape/mxLine.js +2 -2
  143. package/components/diagram/mxgraph/shape/mxRectangleShape.js +2 -2
  144. package/components/diagram/mxgraph/shape/mxRhombus.js +6 -12
  145. package/components/diagram/mxgraph/shape/mxShape.js +0 -1
  146. package/components/diagram/mxgraph/shape/mxTriangle.js +2 -2
  147. package/components/diagram/mxgraph/util/mxConstants.js +2 -2
  148. package/components/diagram/mxgraph/util/mxGuide.js +5 -7
  149. package/components/diagram/mxgraph/view/mxCellEditor.js +16 -29
  150. package/components/diagram/mxgraph/view/mxCellRenderer.js +0 -2
  151. package/components/diagram/mxgraph/view/mxGraph.js +14 -32
  152. package/components/diagram/shapes/base.d.ts +1 -1
  153. package/components/diagram/shapes/base.js +9 -39
  154. package/components/diagram/shapes/callout.js +10 -23
  155. package/components/diagram/shapes/circle.js +3 -10
  156. package/components/diagram/shapes/document.js +5 -16
  157. package/components/diagram/shapes/ellipse.js +0 -5
  158. package/components/diagram/shapes/generateShapes.d.ts +1 -1
  159. package/components/diagram/shapes/generateShapes.js +0 -9
  160. package/components/diagram/shapes/hexagon.js +9 -26
  161. package/components/diagram/shapes/image.js +1 -9
  162. package/components/diagram/shapes/line.d.ts +2 -2
  163. package/components/diagram/shapes/line.js +13 -48
  164. package/components/diagram/shapes/parallelogram.js +9 -26
  165. package/components/diagram/shapes/rectangle.js +1 -9
  166. package/components/diagram/shapes/shape.js +6 -35
  167. package/components/diagram/shapes/square.js +3 -11
  168. package/components/diagram/shapes/text.js +0 -5
  169. package/components/diagram/styles.js +0 -1
  170. package/components/dialog/alert.vdt.js +9 -20
  171. package/components/dialog/base.js +1 -29
  172. package/components/dialog/base.vdt.js +14 -31
  173. package/components/dialog/index.js +6 -31
  174. package/components/dialog/index.spec.js +456 -627
  175. package/components/dialog/staticMethods.d.ts +1 -1
  176. package/components/dialog/staticMethods.js +2 -13
  177. package/components/dialog/styles.js +3 -14
  178. package/components/dialog/useDraggable.js +0 -6
  179. package/components/dialog/useEscClosable.js +4 -12
  180. package/components/dialog/useFixBody.d.ts +1 -1
  181. package/components/dialog/useFixBody.js +0 -11
  182. package/components/dialog/usePosition.js +0 -5
  183. package/components/drawer/index.js +0 -5
  184. package/components/drawer/index.spec.js +128 -170
  185. package/components/drawer/index.vdt.js +3 -9
  186. package/components/drawer/styles.d.ts +2 -2
  187. package/components/drawer/styles.js +1 -4
  188. package/components/dropdown/dropdown.d.ts +2 -2
  189. package/components/dropdown/dropdown.js +33 -90
  190. package/components/dropdown/index.js +2 -6
  191. package/components/dropdown/index.spec.js +388 -496
  192. package/components/dropdown/item.js +4 -25
  193. package/components/dropdown/item.vdt.js +5 -8
  194. package/components/dropdown/menu.js +14 -29
  195. package/components/dropdown/menu.vdt.js +5 -13
  196. package/components/dropdown/styles.js +2 -11
  197. package/components/dropdown/useKeyboard.d.ts +2 -2
  198. package/components/dropdown/useKeyboard.js +8 -30
  199. package/components/dropdown/usePosition.d.ts +2 -1
  200. package/components/dropdown/usePosition.js +24 -22
  201. package/components/dropdown/useTransition.js +0 -8
  202. package/components/editable/index.d.ts +1 -1
  203. package/components/editable/index.js +4 -28
  204. package/components/editable/index.spec.js +152 -189
  205. package/components/editable/index.vdt.js +8 -11
  206. package/components/editable/styles.js +1 -2
  207. package/components/form/form.js +0 -18
  208. package/components/form/form.vdt.js +4 -7
  209. package/components/form/index.spec.js +1082 -1316
  210. package/components/form/item.d.ts +1 -1
  211. package/components/form/item.js +0 -12
  212. package/components/form/item.vdt.js +17 -31
  213. package/components/form/methods.d.ts +5 -5
  214. package/components/form/methods.js +2 -12
  215. package/components/form/styles.js +2 -10
  216. package/components/form/useDirty.js +2 -8
  217. package/components/form/useError.js +2 -10
  218. package/components/form/useValidate.d.ts +1 -1
  219. package/components/form/useValidate.js +8 -24
  220. package/components/grid/col.d.ts +3 -3
  221. package/components/grid/col.js +0 -7
  222. package/components/grid/col.vdt.js +8 -13
  223. package/components/grid/constants.d.ts +6 -6
  224. package/components/grid/row.js +0 -5
  225. package/components/grid/row.vdt.js +5 -8
  226. package/components/grid/styles.js +2 -8
  227. package/components/grid/useBreakpoints.js +0 -5
  228. package/components/grid/useGutter.js +9 -27
  229. package/components/icon/index.js +0 -10
  230. package/components/icon/index.vdt.js +8 -14
  231. package/components/icon/styles.js +1 -4
  232. package/components/input/index.d.ts +3 -3
  233. package/components/input/index.js +0 -13
  234. package/components/input/index.spec.js +185 -239
  235. package/components/input/index.vdt.js +46 -57
  236. package/components/input/search.js +0 -20
  237. package/components/input/search.vdt.js +6 -9
  238. package/components/input/styles.js +2 -29
  239. package/components/input/useAutoRows.js +6 -18
  240. package/components/input/useAutoWidth.js +0 -5
  241. package/components/input/useFocus.js +0 -2
  242. package/components/input/useFrozen.js +0 -6
  243. package/components/input/useShowPassword.js +2 -5
  244. package/components/layout/aside.js +6 -18
  245. package/components/layout/aside.vdt.js +5 -9
  246. package/components/layout/body.js +5 -18
  247. package/components/layout/footer.js +1 -10
  248. package/components/layout/header.js +9 -23
  249. package/components/layout/index.spec.js +24 -34
  250. package/components/layout/layout.js +9 -24
  251. package/components/layout/styles.js +6 -17
  252. package/components/layout/template.vdt.js +2 -4
  253. package/components/layout/useParse.js +0 -7
  254. package/components/menu/index.spec.js +189 -242
  255. package/components/menu/item.js +3 -16
  256. package/components/menu/item.vdt.js +22 -38
  257. package/components/menu/menu.js +2 -11
  258. package/components/menu/menu.vdt.js +6 -12
  259. package/components/menu/styles.js +4 -23
  260. package/components/menu/useDropdown.js +4 -10
  261. package/components/menu/useExpanded.js +0 -14
  262. package/components/menu/useHighlight.js +26 -36
  263. package/components/message/index.spec.js +58 -73
  264. package/components/message/message.js +0 -19
  265. package/components/message/message.vdt.js +6 -9
  266. package/components/message/messages.js +0 -12
  267. package/components/message/messages.vdt.js +0 -1
  268. package/components/message/styles.js +2 -11
  269. package/components/pagination/index.d.ts +1 -1
  270. package/components/pagination/index.js +10 -46
  271. package/components/pagination/index.spec.js +133 -173
  272. package/components/pagination/index.vdt.js +14 -32
  273. package/components/pagination/styles.js +3 -9
  274. package/components/popover/content.js +1 -5
  275. package/components/popover/content.vdt.js +4 -14
  276. package/components/popover/index.js +5 -10
  277. package/components/popover/index.spec.js +113 -150
  278. package/components/popover/styles.js +1 -1
  279. package/components/portal.d.ts +1 -1
  280. package/components/portal.js +2 -30
  281. package/components/position.d.ts +12 -12
  282. package/components/position.js +32 -88
  283. package/components/progress/index.d.ts +6 -6
  284. package/components/progress/index.js +0 -12
  285. package/components/progress/index.spec.js +143 -191
  286. package/components/progress/index.vdt.js +8 -17
  287. package/components/progress/styles.js +1 -7
  288. package/components/progress/useColor.js +2 -7
  289. package/components/progress/useStatus.d.ts +1 -1
  290. package/components/progress/useStatus.js +2 -5
  291. package/components/radio/index.js +3 -18
  292. package/components/radio/index.spec.js +111 -149
  293. package/components/radio/index.vdt.js +14 -17
  294. package/components/radio/styles.js +1 -13
  295. package/components/rate/index.js +0 -7
  296. package/components/rate/index.spec.js +64 -79
  297. package/components/rate/index.vdt.js +8 -21
  298. package/components/rate/styles.js +1 -4
  299. package/components/rate/useActiveValue.js +2 -7
  300. package/components/scrollSelect/index.d.ts +2 -2
  301. package/components/scrollSelect/index.js +0 -7
  302. package/components/scrollSelect/index.spec.js +100 -131
  303. package/components/scrollSelect/index.vdt.js +6 -12
  304. package/components/scrollSelect/styles.js +1 -8
  305. package/components/scrollSelect/useList.js +3 -17
  306. package/components/scrollSelect/useMouseEvents.js +31 -49
  307. package/components/scrollSelect/useTranslate.js +1 -11
  308. package/components/select/base.d.ts +2 -2
  309. package/components/select/base.js +3 -33
  310. package/components/select/base.vdt.js +27 -46
  311. package/components/select/group.js +0 -5
  312. package/components/select/group.vdt.js +4 -10
  313. package/components/select/index.spec.js +370 -464
  314. package/components/select/menu.js +0 -5
  315. package/components/select/menu.vdt.js +18 -33
  316. package/components/select/option.js +2 -16
  317. package/components/select/option.vdt.js +7 -14
  318. package/components/select/select.js +3 -20
  319. package/components/select/select.vdt.js +9 -17
  320. package/components/select/styles.js +3 -34
  321. package/components/select/useBaseLabel.d.ts +1 -1
  322. package/components/select/useBaseLabel.js +4 -17
  323. package/components/select/useCard.js +0 -4
  324. package/components/select/useDraggble.js +2 -2
  325. package/components/select/useEqualWidth.js +0 -1
  326. package/components/select/useFilterable.js +9 -27
  327. package/components/select/useFocusout.d.ts +1 -1
  328. package/components/select/useFocusout.js +1 -9
  329. package/components/select/useInput.js +6 -10
  330. package/components/select/useLabel.js +3 -13
  331. package/components/select/useSearchable.js +0 -10
  332. package/components/skeleton/item.d.ts +1 -1
  333. package/components/skeleton/item.js +0 -7
  334. package/components/skeleton/item.vdt.js +1 -6
  335. package/components/skeleton/skeleton.js +0 -7
  336. package/components/skeleton/skeleton.vdt.js +6 -12
  337. package/components/skeleton/styles.d.ts +1 -1
  338. package/components/skeleton/styles.js +2 -3
  339. package/components/slider/index.d.ts +1 -1
  340. package/components/slider/index.js +0 -7
  341. package/components/slider/index.spec.js +502 -624
  342. package/components/slider/index.vdt.js +35 -50
  343. package/components/slider/styles.js +1 -19
  344. package/components/slider/useClick.js +2 -11
  345. package/components/slider/useDraggable.js +23 -34
  346. package/components/slider/useKeyboard.js +7 -18
  347. package/components/slider/useMarks.d.ts +5 -5
  348. package/components/slider/useMarks.js +5 -13
  349. package/components/slider/usePoints.d.ts +2 -2
  350. package/components/slider/usePoints.js +7 -21
  351. package/components/slider/useStyles.d.ts +1 -1
  352. package/components/slider/useStyles.js +5 -10
  353. package/components/slider/useTooltip.js +2 -10
  354. package/components/slider/useValue.d.ts +1 -1
  355. package/components/slider/useValue.js +7 -24
  356. package/components/spin/index.js +0 -7
  357. package/components/spin/index.vdt.js +4 -11
  358. package/components/spin/styles.js +1 -3
  359. package/components/spinner/index.d.ts +4 -4
  360. package/components/spinner/index.js +6 -18
  361. package/components/spinner/index.spec.js +359 -460
  362. package/components/spinner/index.vdt.js +12 -15
  363. package/components/spinner/styles.js +1 -11
  364. package/components/spinner/useChange.js +4 -16
  365. package/components/spinner/useFormatter.js +6 -16
  366. package/components/spinner/useStep.d.ts +3 -3
  367. package/components/spinner/useStep.js +2 -20
  368. package/components/spinner/useValue.js +14 -32
  369. package/components/split/index.js +0 -7
  370. package/components/split/index.spec.js +223 -267
  371. package/components/split/index.vdt.js +8 -17
  372. package/components/split/memo.js +0 -6
  373. package/components/split/styles.d.ts +1 -1
  374. package/components/split/styles.js +1 -9
  375. package/components/split/useDraggable.js +11 -35
  376. package/components/split/useSize.js +2 -5
  377. package/components/steps/context.d.ts +3 -3
  378. package/components/steps/index.js +2 -13
  379. package/components/steps/index.spec.js +21 -27
  380. package/components/steps/index.vdt.js +9 -12
  381. package/components/steps/step.js +0 -5
  382. package/components/steps/step.vdt.js +8 -12
  383. package/components/steps/styles.js +1 -38
  384. package/components/switch/index.js +2 -23
  385. package/components/switch/index.spec.js +194 -234
  386. package/components/switch/index.vdt.js +16 -32
  387. package/components/switch/styles.js +4 -12
  388. package/components/switch/useDraggable.js +10 -18
  389. package/components/table/cell.js +0 -9
  390. package/components/table/cell.vdt.js +14 -21
  391. package/components/table/column.d.ts +1 -1
  392. package/components/table/column.js +0 -5
  393. package/components/table/column.vdt.js +25 -37
  394. package/components/table/exportTable.js +41 -55
  395. package/components/table/index.spec.js +817 -1026
  396. package/components/table/row.d.ts +1 -1
  397. package/components/table/row.js +12 -44
  398. package/components/table/row.vdt.js +27 -38
  399. package/components/table/styles.js +2 -18
  400. package/components/table/table.d.ts +5 -5
  401. package/components/table/table.js +18 -50
  402. package/components/table/table.vdt.js +61 -86
  403. package/components/table/useChecked.d.ts +1 -1
  404. package/components/table/useChecked.js +20 -61
  405. package/components/table/useColumns.js +3 -16
  406. package/components/table/useDisableRow.js +2 -12
  407. package/components/table/useDraggable.js +4 -8
  408. package/components/table/useExpandable.js +2 -5
  409. package/components/table/useFixedColumns.d.ts +1 -1
  410. package/components/table/useFixedColumns.js +3 -20
  411. package/components/table/useGroup.d.ts +1 -1
  412. package/components/table/useGroup.js +7 -25
  413. package/components/table/useMerge.d.ts +4 -4
  414. package/components/table/useMerge.js +2 -14
  415. package/components/table/usePagination.js +4 -18
  416. package/components/table/useResetRowStatus.js +2 -6
  417. package/components/table/useResizable.js +4 -21
  418. package/components/table/useScroll.d.ts +1 -1
  419. package/components/table/useScroll.js +0 -3
  420. package/components/table/useSelected.js +2 -5
  421. package/components/table/useSortable.js +2 -8
  422. package/components/table/useStickyHeader.js +3 -7
  423. package/components/table/useStickyScrollbar.js +6 -16
  424. package/components/table/useTree.js +1 -12
  425. package/components/table/useWidth.js +14 -30
  426. package/components/tabs/index.js +29 -51
  427. package/components/tabs/index.spec.js +97 -129
  428. package/components/tabs/index.vdt.js +13 -16
  429. package/components/tabs/styles.js +1 -23
  430. package/components/tabs/tab.js +0 -10
  431. package/components/tabs/tab.vdt.js +6 -10
  432. package/components/tabs/useActiveBar.js +2 -11
  433. package/components/tabs/useScroll.js +10 -30
  434. package/components/tag/base.js +0 -11
  435. package/components/tag/index.js +2 -4
  436. package/components/tag/index.spec.js +123 -156
  437. package/components/tag/index.vdt.js +8 -15
  438. package/components/tag/styles.d.ts +1 -1
  439. package/components/tag/styles.js +2 -18
  440. package/components/tag/tags.d.ts +2 -2
  441. package/components/tag/tags.js +0 -7
  442. package/components/tag/tags.vdt.js +10 -18
  443. package/components/tag/useChildren.js +0 -5
  444. package/components/tag/useDraggable.js +6 -15
  445. package/components/tag/useNowrap.js +10 -27
  446. package/components/timeline/item.js +0 -7
  447. package/components/timeline/item.vdt.js +4 -9
  448. package/components/timeline/styles.d.ts +2 -2
  449. package/components/timeline/styles.js +2 -6
  450. package/components/timeline/timeline.js +0 -5
  451. package/components/timeline/timeline.vdt.js +2 -5
  452. package/components/timepicker/index.js +2 -7
  453. package/components/timepicker/index.spec.js +293 -368
  454. package/components/timepicker/panelPicker.js +2 -11
  455. package/components/timepicker/panelPicker.vdt.js +14 -24
  456. package/components/timepicker/selectPicker.js +0 -5
  457. package/components/timepicker/selectPicker.vdt.js +5 -10
  458. package/components/timepicker/styles.js +1 -2
  459. package/components/timepicker/useDisabled.js +2 -4
  460. package/components/timepicker/useFormats.js +4 -13
  461. package/components/timepicker/useStep.d.ts +1 -1
  462. package/components/timepicker/useStep.js +8 -17
  463. package/components/timepicker/useValue.js +16 -21
  464. package/components/tip/index.js +0 -2
  465. package/components/tip/index.vdt.js +5 -17
  466. package/components/tip/styles.js +1 -4
  467. package/components/tooltip/content.js +0 -28
  468. package/components/tooltip/content.vdt.js +15 -27
  469. package/components/tooltip/index.js +3 -7
  470. package/components/tooltip/index.spec.js +400 -527
  471. package/components/tooltip/styles.d.ts +1 -1
  472. package/components/tooltip/styles.js +3 -13
  473. package/components/tooltip/tooltip.js +2 -15
  474. package/components/tooltip/useArrow.js +11 -14
  475. package/components/transfer/index.d.ts +1 -1
  476. package/components/transfer/index.js +1 -13
  477. package/components/transfer/index.spec.js +159 -194
  478. package/components/transfer/index.vdt.js +17 -36
  479. package/components/transfer/styles.js +1 -11
  480. package/components/transfer/useCheck.d.ts +1 -1
  481. package/components/transfer/useCheck.js +1 -16
  482. package/components/transfer/useFilter.d.ts +1 -1
  483. package/components/transfer/useFilter.js +9 -30
  484. package/components/transfer/useTransfer.js +10 -26
  485. package/components/tree/index.d.ts +3 -3
  486. package/components/tree/index.js +3 -22
  487. package/components/tree/index.spec.js +310 -388
  488. package/components/tree/index.vdt.js +12 -24
  489. package/components/tree/styles.js +3 -17
  490. package/components/tree/useChecked.js +3 -27
  491. package/components/tree/useDraggable.js +14 -44
  492. package/components/tree/useExpanded.js +28 -46
  493. package/components/tree/useFilter.js +3 -10
  494. package/components/tree/useNodes.d.ts +3 -3
  495. package/components/tree/useNodes.js +0 -4
  496. package/components/tree/useSelected.js +21 -38
  497. package/components/tree/useTransitionEvent.js +3 -5
  498. package/components/treeSelect/index.js +9 -37
  499. package/components/treeSelect/index.spec.js +123 -160
  500. package/components/treeSelect/index.vdt.js +14 -20
  501. package/components/treeSelect/styles.js +1 -2
  502. package/components/treeSelect/useValue.js +0 -11
  503. package/components/types.d.ts +3 -3
  504. package/components/upload/ajaxUploader.d.ts +1 -1
  505. package/components/upload/ajaxUploader.js +0 -17
  506. package/components/upload/index.d.ts +4 -4
  507. package/components/upload/index.js +0 -14
  508. package/components/upload/index.spec.js +142 -248
  509. package/components/upload/index.vdt.js +12 -28
  510. package/components/upload/styles.js +2 -28
  511. package/components/upload/useAccept.js +2 -10
  512. package/components/upload/useDrag.js +0 -7
  513. package/components/upload/useFiles.js +103 -148
  514. package/components/upload/useShowImage.js +0 -3
  515. package/components/upload/useUpload.js +47 -69
  516. package/components/utils.d.ts +6 -6
  517. package/components/utils.js +12 -56
  518. package/components/virtual.js +9 -37
  519. package/components/wave/index.js +5 -32
  520. package/components/wave/styles.js +1 -1
  521. package/hooks/useDelayClose.js +2 -7
  522. package/hooks/useDocumentClick.js +8 -16
  523. package/hooks/useDraggable.d.ts +1 -1
  524. package/hooks/useDraggable.js +0 -9
  525. package/hooks/useKeyboard.d.ts +3 -3
  526. package/hooks/useKeyboard.js +0 -10
  527. package/hooks/useMouseOutsidable.js +0 -8
  528. package/hooks/useReceive.d.ts +1 -1
  529. package/hooks/useReceive.js +0 -4
  530. package/hooks/useRecordComponent.js +0 -6
  531. package/hooks/useResizeObserver.js +0 -2
  532. package/hooks/useRouter.js +7 -18
  533. package/hooks/useShowHideEvents.js +0 -3
  534. package/hooks/useState.d.ts +2 -2
  535. package/hooks/useState.js +2 -6
  536. package/i18n/en-US.js +0 -1
  537. package/i18n/index.d.ts +1 -1
  538. package/i18n/index.js +0 -7
  539. package/index.d.ts +2 -2
  540. package/index.js +2 -3
  541. package/package.json +2 -2
  542. package/styles/global.js +2 -5
  543. package/styles/keyframes.js +0 -1
  544. package/styles/theme.d.ts +1 -1
  545. package/styles/theme.js +2 -5
  546. package/styles/utils.d.ts +1 -1
  547. package/styles/utils.js +3 -17
  548. package/yarn-error.log +528 -0
  549. package/components/cascader/index.d.ts +0 -45
  550. package/components/datepicker/index.d.ts +0 -63
  551. package/components/select/select.d.ts +0 -33
  552. package/components/timepicker/panelPicker.d.ts +0 -54
  553. package/components/treeSelect/index.d.ts +0 -28
@@ -15,7 +15,6 @@ var typeDefs = {
15
15
  dot: Boolean,
16
16
  _paddingLeft: String
17
17
  };
18
-
19
18
  var defaults = function defaults() {
20
19
  return {
21
20
  expandedKeys: [],
@@ -24,21 +23,16 @@ var defaults = function defaults() {
24
23
  size: 'default'
25
24
  };
26
25
  };
27
-
28
26
  export var MENU = 'Menu';
29
27
  export var ROOT_MENU = 'RootMenu';
30
28
  export var Menu = /*#__PURE__*/function (_Component) {
31
29
  _inheritsLoose(Menu, _Component);
32
-
33
30
  function Menu() {
34
31
  var _context;
35
-
36
32
  var _this;
37
-
38
33
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
39
34
  args[_key] = arguments[_key];
40
35
  }
41
-
42
36
  _this = _Component.call.apply(_Component, _concatInstanceProperty(_context = [this]).call(_context, args)) || this;
43
37
  _this.rootMenu = inject(ROOT_MENU, null);
44
38
  _this.parentMenu = inject(MENU, null);
@@ -47,18 +41,15 @@ export var Menu = /*#__PURE__*/function (_Component) {
47
41
  _this.config = useConfigContext();
48
42
  return _this;
49
43
  }
50
-
51
44
  var _proto = Menu.prototype;
52
-
53
45
  _proto.init = function init() {
54
- provide(MENU, this); // is root menu or not
55
-
46
+ provide(MENU, this);
47
+ // is root menu or not
56
48
  if (!this.rootMenu) {
57
49
  provide(ROOT_MENU, this);
58
50
  this.highlight = useHighlight();
59
51
  }
60
52
  };
61
-
62
53
  return Menu;
63
54
  }(Component);
64
55
  Menu.template = template;
@@ -7,23 +7,19 @@ import { makeMenuStyles, makeTitleStyles } from './styles';
7
7
  import { Icon } from '../icon';
8
8
  export default function ($props, $blocks, $__proto__) {
9
9
  var _classNameObj, _$cn2;
10
-
11
10
  $blocks || ($blocks = {});
12
11
  $props || ($props = {});
13
12
  var $this = this;
14
13
  var _$blocks = {};
15
14
  var __$blocks = {};
16
-
17
15
  var _this$get = this.get(),
18
- children = _this$get.children,
19
- className = _this$get.className;
20
-
16
+ children = _this$get.children,
17
+ className = _this$get.className;
21
18
  var _get = (this.rootMenu || this).get(),
22
- collapse = _get.collapse,
23
- theme = _get.theme,
24
- type = _get.type,
25
- size = _get.size;
26
-
19
+ collapse = _get.collapse,
20
+ theme = _get.theme,
21
+ type = _get.type,
22
+ size = _get.size;
27
23
  var isRootMenu = !this.rootMenu;
28
24
  var isDropdownMenu = !isRootMenu && isDropdown(this.rootMenu);
29
25
  var k = this.config.k;
@@ -32,11 +28,9 @@ export default function ($props, $blocks, $__proto__) {
32
28
  return null;
33
29
  }, __$blocks['header'] = function ($super, data) {
34
30
  var block = $blocks['header'];
35
-
36
31
  var callBlock = function callBlock() {
37
32
  return _$blocks['header'].call($this, $super, data);
38
33
  };
39
-
40
34
  return block ? block.call($this, callBlock, data) : callBlock();
41
35
  }, __$blocks['header'](_$no));
42
36
  var content = [$blocks.header ? _$ce(2, 'div', !collapse ? header : findChildren(header, function (vNode) {
@@ -9,29 +9,23 @@ var defaults = {
9
9
  get transition() {
10
10
  return theme.transition.large;
11
11
  },
12
-
13
12
  width: '200px',
14
13
  bgColor: '#262626',
15
14
  fontSize: '14px',
16
-
17
15
  get borderRadius() {
18
16
  return theme.borderRadius;
19
17
  },
20
-
21
18
  item: {
22
19
  height: '40px',
23
20
  padding: '0 21px',
24
21
  color: '#b2b2b2',
25
22
  hoverColor: '#fff',
26
-
27
23
  get disabledColor() {
28
24
  return theme.color.text;
29
25
  },
30
-
31
26
  get activeBgColor() {
32
27
  return theme.color.primary;
33
28
  },
34
-
35
29
  dotFontSize: '12px'
36
30
  },
37
31
  icon: {
@@ -53,11 +47,9 @@ var defaults = {
53
47
  get color() {
54
48
  return theme.color.text;
55
49
  },
56
-
57
50
  get hoverColor() {
58
51
  return theme.color.primary;
59
52
  },
60
-
61
53
  disabledColor: '#999'
62
54
  }
63
55
  },
@@ -69,25 +61,20 @@ var defaults = {
69
61
  get color() {
70
62
  return theme.color.text;
71
63
  },
72
-
73
64
  get hoverColor() {
74
65
  return theme.color.primary;
75
66
  },
76
-
77
67
  get disabledColor() {
78
68
  return theme.color.disabled;
79
69
  }
80
-
81
70
  },
82
71
  active: {
83
72
  get color() {
84
73
  return theme.color.primary;
85
74
  },
86
-
87
75
  get bgColor() {
88
76
  return palette(theme.color.primary, -4);
89
77
  }
90
-
91
78
  }
92
79
  },
93
80
  // dropdown
@@ -96,19 +83,15 @@ var defaults = {
96
83
  },
97
84
  large: {
98
85
  width: '250px',
99
-
100
86
  get fontSize() {
101
87
  return menu.fontSize;
102
88
  }
103
-
104
89
  },
105
90
  small: {
106
91
  width: '180px',
107
-
108
92
  get fontSize() {
109
93
  return theme.small.fontSize;
110
94
  }
111
-
112
95
  }
113
96
  };
114
97
  var menu;
@@ -116,15 +99,14 @@ setDefault(function () {
116
99
  menu = deepDefaults(theme, {
117
100
  menu: defaults
118
101
  }).menu;
119
- makeMenuStyles == null ? void 0 : makeMenuStyles.clearCache();
120
- makeItemStyles == null ? void 0 : makeItemStyles.clearCache();
121
- makeTitleStyles == null ? void 0 : makeTitleStyles.clearCache();
122
- makeNestedMenuStyles == null ? void 0 : makeNestedMenuStyles.clearCache();
102
+ makeMenuStyles == null || makeMenuStyles.clearCache();
103
+ makeItemStyles == null || makeItemStyles.clearCache();
104
+ makeTitleStyles == null || makeTitleStyles.clearCache();
105
+ makeNestedMenuStyles == null || makeNestedMenuStyles.clearCache();
123
106
  });
124
107
  export { menu };
125
108
  export var makeMenuStyles = cache(function makeMenuStyles(k) {
126
109
  var _context;
127
-
128
110
  // we must increase the priority by adding &.${k}-menu
129
111
  // to override the css of dropdownMenu
130
112
  return /*#__PURE__*/css("&.", k, "-menu{width:", menu.width, ";transition:width ", menu.transition, ";background:", menu.bgColor, ";font-size:", menu.fontSize, ";}.", k, "-icon{width:", menu.icon.width, ";margin-right:", menu.icon.gap, ";text-align:center;flex-shrink:0;}.", k, "-menu-header{height:", menu.header.height, ";font-size:", menu.header.fontSize, ";font-weight:bold;border-bottom:", menu.header.borderBottom, ";}", _mapInstanceProperty(_context = ['light', 'white']).call(_context, function (theme) {
@@ -147,7 +129,6 @@ export var makeNestedMenuStyles = cache(function makeNestedMenuStyles(k, hasIcon
147
129
  if (parentPaddingLeft === void 0) {
148
130
  parentPaddingLeft = getLeft(menu.item.padding);
149
131
  }
150
-
151
132
  var paddingLeft = "" + parentPaddingLeft + (hasIcon ? ' + ' + menu.icon.width : '') + " + " + menu.icon.gap;
152
133
  return [/*#__PURE__*/css("&.", k, "-menu{width:auto;background:", menu.subBgColor, ";.", k, "-menu-title{padding-left:calc(", paddingLeft, ");}}"), paddingLeft];
153
134
  });
@@ -17,10 +17,9 @@ export function useDropdown(rootMenu, parentMenu) {
17
17
  onBeforeMount(parseChildren);
18
18
  onBeforeUpdate(parseChildren);
19
19
  parsePosition(rootMenu.get('type'));
20
- rootMenu.watch('type', parsePosition); // hide dropdown menu on select
21
-
20
+ rootMenu.watch('type', parsePosition);
21
+ // hide dropdown menu on select
22
22
  instance.on('select', hide);
23
-
24
23
  function parseChildren() {
25
24
  isDropdownMenu = isDropdown(rootMenu);
26
25
  tooltipContents = [];
@@ -39,12 +38,10 @@ export function useDropdown(rootMenu, parentMenu) {
39
38
  } else if (!iconVNode && isComponentVNode(vNode, Icon)) {
40
39
  iconVNode = vNode;
41
40
  }
42
-
43
41
  titleVNodes.push(vNode);
44
42
  }
45
43
  });
46
44
  }
47
-
48
45
  function parsePosition(type) {
49
46
  position = type !== 'horizontal' || !isTopItem ? {
50
47
  my: 'left top',
@@ -54,13 +51,11 @@ export function useDropdown(rootMenu, parentMenu) {
54
51
  at: 'left bottom+5'
55
52
  };
56
53
  }
57
-
58
54
  function hide() {
59
55
  if (!isTopItem && rootDropdown) {
60
56
  rootDropdown.hide(true);
61
57
  }
62
58
  }
63
-
64
59
  return function () {
65
60
  return {
66
61
  isTopItem: isTopItem,
@@ -76,8 +71,7 @@ export function useDropdown(rootMenu, parentMenu) {
76
71
  }
77
72
  export function isDropdown(rootMenu) {
78
73
  var _rootMenu$get = rootMenu.get(),
79
- collapse = _rootMenu$get.collapse,
80
- type = _rootMenu$get.type;
81
-
74
+ collapse = _rootMenu$get.collapse,
75
+ type = _rootMenu$get.type;
82
76
  return collapse || type === 'horizontal';
83
77
  }
@@ -6,27 +6,21 @@ import { isDropdown } from './useDropdown';
6
6
  export function useExpanded(rootMenu, parentMenu) {
7
7
  var instance = useInstance();
8
8
  onBeforeUnmount(removeSubExpandedKey);
9
-
10
9
  function isExpanded() {
11
10
  var isExpanded = !isDropdown(rootMenu) && inArray(rootMenu.get('expandedKeys'), instance.get('key'));
12
-
13
11
  if (isExpanded) {
14
12
  addSubExpandedKey();
15
13
  } else {
16
14
  removeSubExpandedKey();
17
15
  }
18
-
19
16
  return isExpanded;
20
17
  }
21
-
22
18
  function expand() {
23
19
  expandOrShrink(true);
24
20
  }
25
-
26
21
  function shrink() {
27
22
  expandOrShrink(false);
28
23
  }
29
-
30
24
  function toggle() {
31
25
  if (isExpanded()) {
32
26
  shrink();
@@ -35,40 +29,32 @@ export function useExpanded(rootMenu, parentMenu) {
35
29
  } else {
36
30
  // accordion
37
31
  var subExpandedKeys = parentMenu.subExpandedKeys;
38
-
39
32
  if (subExpandedKeys) {
40
33
  subExpandedKeys.forEach(function (key) {
41
34
  addOrRemove(rootMenu.get('expandedKeys'), key, false);
42
35
  });
43
36
  }
44
-
45
37
  expand();
46
38
  }
47
39
  }
48
-
49
40
  function expandOrShrink(isExpand) {
50
41
  var _context;
51
-
52
42
  var expandedKeys = _sliceInstanceProperty(_context = rootMenu.get('expandedKeys')).call(_context);
53
-
54
43
  addOrRemove(expandedKeys, instance.get('key'), isExpand);
55
44
  rootMenu.set({
56
45
  expandedKeys: expandedKeys
57
46
  });
58
47
  }
59
-
60
48
  function addSubExpandedKey() {
61
49
  var key = instance.get('key');
62
50
  var subExpandedKeys = parentMenu.subExpandedKeys || (parentMenu.subExpandedKeys = new _Set());
63
51
  subExpandedKeys.add(key);
64
52
  }
65
-
66
53
  function removeSubExpandedKey() {
67
54
  var key = instance.get('key');
68
55
  var subExpandedKeys = parentMenu.subExpandedKeys || (parentMenu.subExpandedKeys = new _Set());
69
56
  subExpandedKeys.delete(key);
70
57
  }
71
-
72
58
  return {
73
59
  isExpanded: isExpanded,
74
60
  expand: expand,
@@ -13,54 +13,45 @@ export function useHighlight() {
13
13
  instance.watch('selectedKey', updateStatus, {
14
14
  presented: true
15
15
  });
16
-
17
16
  function updateStatus(newValue) {
18
- var _loop = function _loop(i) {
19
- var menuItem = menuItems[i];
20
- var key = menuItem.get('key');
21
- if (newValue !== key) return "continue";
22
- var items = [];
23
- var parentItem = menuItem.parentMenuItem;
24
-
25
- while (parentItem) {
26
- items.push(parentItem);
27
- parentItem = parentItem.parentMenuItem;
28
- }
29
-
30
- var expandedKeys = new _Set(instance.get('expandedKeys'));
31
- highlightedKeys.set(_mapInstanceProperty(items).call(items, function (item) {
32
- var key = item.get('key');
33
- expandedKeys.add(key);
34
- return key;
35
- }));
36
- instance.set('expandedKeys', _Array$from(expandedKeys));
37
- return {
38
- v: void 0
39
- };
40
- };
41
-
17
+ var _loop = function _loop() {
18
+ var menuItem = menuItems[i];
19
+ var key = menuItem.get('key');
20
+ if (newValue !== key) return 0; // continue
21
+ var items = [];
22
+ var parentItem = menuItem.parentMenuItem;
23
+ while (parentItem) {
24
+ items.push(parentItem);
25
+ parentItem = parentItem.parentMenuItem;
26
+ }
27
+ var expandedKeys = new _Set(instance.get('expandedKeys'));
28
+ highlightedKeys.set(_mapInstanceProperty(items).call(items, function (item) {
29
+ var key = item.get('key');
30
+ expandedKeys.add(key);
31
+ return key;
32
+ }));
33
+ instance.set('expandedKeys', _Array$from(expandedKeys));
34
+ return {
35
+ v: void 0
36
+ };
37
+ },
38
+ _ret;
42
39
  for (var i = 0; i < menuItems.length; i++) {
43
- var _ret = _loop(i);
44
-
45
- if (_ret === "continue") continue;
46
- if (typeof _ret === "object") return _ret.v;
40
+ _ret = _loop();
41
+ if (_ret === 0) continue;
42
+ if (_ret) return _ret.v;
47
43
  }
48
-
49
44
  highlightedKeys.set([]);
50
45
  }
51
-
52
46
  function isHighlighted(key) {
53
47
  return inArray(highlightedKeys.value, key);
54
48
  }
55
-
56
49
  function select(key) {
57
50
  instance.set('selectedKey', key);
58
51
  }
59
-
60
52
  function isSelected(key) {
61
53
  return instance.get('selectedKey') === key;
62
54
  }
63
-
64
55
  return {
65
56
  isHighlighted: isHighlighted,
66
57
  select: select,
@@ -73,8 +64,7 @@ export function useHighlightItem() {
73
64
  onMounted(function () {
74
65
  if (instance.rootMenu.get('selectedKey') == instance.get('key')) {
75
66
  var _instance$rootMenu$hi;
76
-
77
- (_instance$rootMenu$hi = instance.rootMenu.highlight) == null ? void 0 : _instance$rootMenu$hi.updateStatus(instance.get('key'));
67
+ (_instance$rootMenu$hi = instance.rootMenu.highlight) == null || _instance$rootMenu$hi.updateStatus(instance.get('key'));
78
68
  }
79
69
  });
80
70
  }
@@ -9,86 +9,71 @@ describe('Message', function () {
9
9
  });
10
10
  it('show messages', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
11
11
  var _mount, instance, element, _element$querySelecto, info, error, warning, success, message;
12
-
13
12
  return _regeneratorRuntime.wrap(function _callee$(_context) {
14
- while (1) {
15
- switch (_context.prev = _context.next) {
16
- case 0:
17
- _mount = mount(BasicDemo), instance = _mount[0], element = _mount[1];
18
- _element$querySelecto = element.querySelectorAll('.k-btn'), info = _element$querySelecto[0], error = _element$querySelecto[1], warning = _element$querySelecto[2], success = _element$querySelecto[3];
19
- info.click();
20
- _context.next = 5;
21
- return wait();
22
-
23
- case 5:
24
- message = getElement('.k-message');
25
- expect(message.outerHTML).to.matchSnapshot();
26
- error.click();
27
- _context.next = 10;
28
- return wait();
29
-
30
- case 10:
31
- expect(getElement('.k-message').outerHTML).matchSnapshot();
32
- warning.click();
33
- _context.next = 14;
34
- return wait();
35
-
36
- case 14:
37
- expect(getElement('.k-message').outerHTML).matchSnapshot();
38
- success.click();
39
- _context.next = 18;
40
- return wait();
41
-
42
- case 18:
43
- expect(getElement('.k-message').outerHTML).matchSnapshot();
44
-
45
- case 19:
46
- case "end":
47
- return _context.stop();
48
- }
13
+ while (1) switch (_context.prev = _context.next) {
14
+ case 0:
15
+ _mount = mount(BasicDemo), instance = _mount[0], element = _mount[1];
16
+ _element$querySelecto = element.querySelectorAll('.k-btn'), info = _element$querySelecto[0], error = _element$querySelecto[1], warning = _element$querySelecto[2], success = _element$querySelecto[3];
17
+ info.click();
18
+ _context.next = 5;
19
+ return wait();
20
+ case 5:
21
+ message = getElement('.k-message');
22
+ expect(message.outerHTML).to.matchSnapshot();
23
+ error.click();
24
+ _context.next = 10;
25
+ return wait();
26
+ case 10:
27
+ expect(getElement('.k-message').outerHTML).matchSnapshot();
28
+ warning.click();
29
+ _context.next = 14;
30
+ return wait();
31
+ case 14:
32
+ expect(getElement('.k-message').outerHTML).matchSnapshot();
33
+ success.click();
34
+ _context.next = 18;
35
+ return wait();
36
+ case 18:
37
+ expect(getElement('.k-message').outerHTML).matchSnapshot();
38
+ case 19:
39
+ case "end":
40
+ return _context.stop();
49
41
  }
50
42
  }, _callee);
51
43
  })));
52
44
  it('set duration', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
53
45
  var message, message1;
54
46
  return _regeneratorRuntime.wrap(function _callee2$(_context2) {
55
- while (1) {
56
- switch (_context2.prev = _context2.next) {
57
- case 0:
58
- this.timeout(0);
59
- Message.info('test', 500);
60
- _context2.next = 4;
61
- return wait();
62
-
63
- case 4:
64
- message = getElement('.k-message');
65
- expect(message.outerHTML).to.matchSnapshot(); // should not remove when mouseenter
66
-
67
- dispatchEvent(message, 'mouseenter');
68
- _context2.next = 9;
69
- return wait(1000);
70
-
71
- case 9:
72
- message1 = getElement('.k-message');
73
- expect(message1).eql(message);
74
- dispatchEvent(message, 'mouseleave');
75
- _context2.next = 14;
76
- return wait(500);
77
-
78
- case 14:
79
- message1 = getElement('.k-message');
80
- expect(message1).eql(message);
81
- _context2.next = 18;
82
- return wait(700);
83
-
84
- case 18:
85
- message1 = getElement('.k-message');
86
- expect(message1).not.eql(message);
87
-
88
- case 20:
89
- case "end":
90
- return _context2.stop();
91
- }
47
+ while (1) switch (_context2.prev = _context2.next) {
48
+ case 0:
49
+ this.timeout(0);
50
+ Message.info('test', 500);
51
+ _context2.next = 4;
52
+ return wait();
53
+ case 4:
54
+ message = getElement('.k-message');
55
+ expect(message.outerHTML).to.matchSnapshot();
56
+ // should not remove when mouseenter
57
+ dispatchEvent(message, 'mouseenter');
58
+ _context2.next = 9;
59
+ return wait(1000);
60
+ case 9:
61
+ message1 = getElement('.k-message');
62
+ expect(message1).eql(message);
63
+ dispatchEvent(message, 'mouseleave');
64
+ _context2.next = 14;
65
+ return wait(500);
66
+ case 14:
67
+ message1 = getElement('.k-message');
68
+ expect(message1).eql(message);
69
+ _context2.next = 18;
70
+ return wait(700);
71
+ case 18:
72
+ message1 = getElement('.k-message');
73
+ expect(message1).not.eql(message);
74
+ case 20:
75
+ case "end":
76
+ return _context2.stop();
92
77
  }
93
78
  }, _callee2, this);
94
79
  })));
@@ -17,7 +17,6 @@ var typeDefs = {
17
17
  hideIcon: Boolean
18
18
  };
19
19
  var id = 0;
20
-
21
20
  var defaults = function defaults() {
22
21
  return {
23
22
  duration: 5000,
@@ -25,35 +24,27 @@ var defaults = function defaults() {
25
24
  closable: false
26
25
  };
27
26
  };
28
-
29
27
  var messages = null;
30
28
  export var Message = /*#__PURE__*/function (_Component) {
31
29
  _inheritsLoose(Message, _Component);
32
-
33
30
  function Message() {
34
31
  var _context;
35
-
36
32
  var _this;
37
-
38
33
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
39
34
  args[_key] = arguments[_key];
40
35
  }
41
-
42
36
  _this = _Component.call.apply(_Component, _concatInstanceProperty(_context = [this]).call(_context, args)) || this;
43
37
  _this.delayClose = useDelayClose(_this.close, _this.get('duration'));
44
38
  _this.config = useConfigContext();
45
39
  return _this;
46
40
  }
47
-
48
41
  Message.notice = function notice(content, duration, type) {
49
42
  if (duration === void 0) {
50
43
  duration = 3000;
51
44
  }
52
-
53
45
  if (type === void 0) {
54
46
  type = 'info';
55
47
  }
56
-
57
48
  if (isObject(content) && !content.tag) {
58
49
  content = _extends({}, content, {
59
50
  type: type,
@@ -67,7 +58,6 @@ export var Message = /*#__PURE__*/function (_Component) {
67
58
  key: id++
68
59
  };
69
60
  }
70
-
71
61
  if (!messages) {
72
62
  var container = document.createElement('div');
73
63
  document.body.append(container);
@@ -78,37 +68,28 @@ export var Message = /*#__PURE__*/function (_Component) {
78
68
  classNamePrefix: Message.classNamePrefix
79
69
  }), container);
80
70
  }
81
-
82
71
  messages.notice(h(Message, content));
83
72
  };
84
-
85
73
  Message.info = function info(content, duration) {
86
74
  Message.notice(content, duration, 'info');
87
75
  };
88
-
89
76
  Message.error = function error(content, duration) {
90
77
  Message.notice(content, duration, 'error');
91
78
  };
92
-
93
79
  Message.success = function success(content, duration) {
94
80
  Message.notice(content, duration, 'success');
95
81
  };
96
-
97
82
  Message.warning = function warning(content, duration) {
98
83
  Message.notice(content, duration, 'warning');
99
84
  };
100
-
101
85
  var _proto = Message.prototype;
102
-
103
86
  _proto.close = function close() {
104
87
  messages.delete(this.get('key'));
105
88
  };
106
-
107
89
  return Message;
108
90
  }(Component);
109
91
  Message.template = template;
110
92
  Message.typeDefs = typeDefs;
111
93
  Message.defaults = defaults;
112
94
  Message.classNamePrefix = void 0;
113
-
114
95
  __decorate([bind], Message.prototype, "close", null);
@@ -6,19 +6,16 @@ import { getRestProps } from '../utils';
6
6
  import { makeMessageStyles } from './styles';
7
7
  export default function ($props, $blocks, $__proto__) {
8
8
  var _classNameObj, _$cn2, _$cn3;
9
-
10
9
  $blocks || ($blocks = {});
11
10
  $props || ($props = {});
12
11
  var $this = this;
13
-
14
12
  var _this$get = this.get(),
15
- type = _this$get.type,
16
- content = _this$get.content,
17
- children = _this$get.children,
18
- closable = _this$get.closable,
19
- hideIcon = _this$get.hideIcon,
20
- classNamePrefix = _this$get.classNamePrefix;
21
-
13
+ type = _this$get.type,
14
+ content = _this$get.content,
15
+ children = _this$get.children,
16
+ closable = _this$get.closable,
17
+ hideIcon = _this$get.hideIcon,
18
+ classNamePrefix = _this$get.classNamePrefix;
22
19
  var k = this.config.k;
23
20
  var classNameObj = (_classNameObj = {}, _classNameObj[k + "-message"] = true, _classNameObj[k + "-" + type] = type, _classNameObj[makeMessageStyles(k)] = true, _classNameObj);
24
21
  var iconMap = {