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

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 (545) hide show
  1. package/__tests__/__snapshots__/Dialog.md +1 -1
  2. package/__tests__/__snapshots__/React Demos.md +260 -254
  3. package/components/affix/index.d.ts +2 -2
  4. package/components/affix/index.js +0 -5
  5. package/components/affix/index.spec.js +84 -108
  6. package/components/affix/index.vdt.js +7 -10
  7. package/components/affix/styles.js +1 -1
  8. package/components/affix/useStyle.js +8 -19
  9. package/components/badge/index.js +0 -5
  10. package/components/badge/index.vdt.js +7 -11
  11. package/components/badge/styles.js +1 -3
  12. package/components/breadcrumb/index.js +0 -7
  13. package/components/breadcrumb/index.spec.js +6 -6
  14. package/components/breadcrumb/index.vdt.js +5 -14
  15. package/components/breadcrumb/item.js +0 -8
  16. package/components/breadcrumb/item.vdt.js +3 -6
  17. package/components/breadcrumb/styles.js +1 -4
  18. package/components/button/dynamicButton.d.ts +1 -1
  19. package/components/button/dynamicButton.js +2 -5
  20. package/components/button/group.js +2 -13
  21. package/components/button/group.vdt.js +5 -8
  22. package/components/button/index.js +3 -27
  23. package/components/button/index.spec.js +74 -96
  24. package/components/button/index.vdt.js +21 -31
  25. package/components/button/styles.d.ts +2 -2
  26. package/components/button/styles.js +8 -53
  27. package/components/card/column.js +0 -5
  28. package/components/card/column.vdt.js +5 -10
  29. package/components/card/index.js +0 -7
  30. package/components/card/index.vdt.js +5 -17
  31. package/components/card/styles.js +3 -6
  32. package/components/carousel/index.js +1 -19
  33. package/components/carousel/index.spec.js +127 -163
  34. package/components/carousel/index.vdt.js +12 -16
  35. package/components/carousel/item.js +0 -5
  36. package/components/carousel/item.vdt.js +4 -7
  37. package/components/carousel/styles.js +2 -3
  38. package/components/carousel/useAutoplay.js +0 -4
  39. package/components/carousel/useItems.js +4 -20
  40. package/components/carousel/useSlide.js +57 -89
  41. package/components/cascader/index.d.ts +1 -1
  42. package/components/cascader/index.js +3 -18
  43. package/components/cascader/index.spec.js +300 -377
  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 +5 -26
  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.js +7 -7
  120. package/components/diagram/index.spec.js +369 -495
  121. package/components/diagram/layouts/circle.js +6 -14
  122. package/components/diagram/layouts/flow.js +7 -15
  123. package/components/diagram/layouts/layout.js +6 -28
  124. package/components/diagram/layouts/organic.js +3 -11
  125. package/components/diagram/layouts/partition.js +4 -12
  126. package/components/diagram/layouts/radial.js +6 -18
  127. package/components/diagram/layouts/stack.js +6 -14
  128. package/components/diagram/layouts/tree.js +11 -21
  129. package/components/diagram/mxgraph/handler/mxConnectionHandler.js +15 -22
  130. package/components/diagram/mxgraph/handler/mxConstraintHandler.js +4 -4
  131. package/components/diagram/mxgraph/handler/mxEdgeHandler.js +11 -15
  132. package/components/diagram/mxgraph/handler/mxGraphHandler.js +6 -9
  133. package/components/diagram/mxgraph/handler/mxRubberband.js +4 -4
  134. package/components/diagram/mxgraph/handler/mxVertexHandler.js +7 -10
  135. package/components/diagram/mxgraph/index.js +0 -2
  136. package/components/diagram/mxgraph/mx.js +3 -3
  137. package/components/diagram/mxgraph/shape/mxCloud.js +2 -2
  138. package/components/diagram/mxgraph/shape/mxCylinder.js +4 -9
  139. package/components/diagram/mxgraph/shape/mxEllipse.js +2 -2
  140. package/components/diagram/mxgraph/shape/mxHexagon.js +2 -2
  141. package/components/diagram/mxgraph/shape/mxLine.js +2 -2
  142. package/components/diagram/mxgraph/shape/mxRectangleShape.js +2 -2
  143. package/components/diagram/mxgraph/shape/mxRhombus.js +6 -12
  144. package/components/diagram/mxgraph/shape/mxShape.js +0 -1
  145. package/components/diagram/mxgraph/shape/mxTriangle.js +2 -2
  146. package/components/diagram/mxgraph/util/mxConstants.js +2 -2
  147. package/components/diagram/mxgraph/util/mxGuide.js +5 -7
  148. package/components/diagram/mxgraph/view/mxCellEditor.js +16 -29
  149. package/components/diagram/mxgraph/view/mxCellRenderer.js +0 -2
  150. package/components/diagram/mxgraph/view/mxGraph.js +14 -32
  151. package/components/diagram/shapes/base.d.ts +1 -1
  152. package/components/diagram/shapes/base.js +9 -39
  153. package/components/diagram/shapes/callout.js +10 -23
  154. package/components/diagram/shapes/circle.js +3 -10
  155. package/components/diagram/shapes/document.js +5 -16
  156. package/components/diagram/shapes/ellipse.js +0 -5
  157. package/components/diagram/shapes/generateShapes.d.ts +1 -1
  158. package/components/diagram/shapes/generateShapes.js +0 -9
  159. package/components/diagram/shapes/hexagon.js +9 -26
  160. package/components/diagram/shapes/image.js +1 -9
  161. package/components/diagram/shapes/line.d.ts +2 -2
  162. package/components/diagram/shapes/line.js +13 -48
  163. package/components/diagram/shapes/parallelogram.js +9 -26
  164. package/components/diagram/shapes/rectangle.js +1 -9
  165. package/components/diagram/shapes/shape.js +6 -35
  166. package/components/diagram/shapes/square.js +3 -11
  167. package/components/diagram/shapes/text.js +0 -5
  168. package/components/diagram/styles.js +0 -1
  169. package/components/dialog/alert.vdt.js +9 -20
  170. package/components/dialog/base.js +1 -29
  171. package/components/dialog/base.vdt.js +14 -31
  172. package/components/dialog/index.js +6 -31
  173. package/components/dialog/index.spec.js +456 -627
  174. package/components/dialog/staticMethods.d.ts +1 -1
  175. package/components/dialog/staticMethods.js +2 -13
  176. package/components/dialog/styles.js +3 -14
  177. package/components/dialog/useDraggable.js +0 -6
  178. package/components/dialog/useEscClosable.js +4 -12
  179. package/components/dialog/useFixBody.d.ts +1 -1
  180. package/components/dialog/useFixBody.js +0 -11
  181. package/components/dialog/usePosition.js +0 -5
  182. package/components/drawer/index.js +0 -5
  183. package/components/drawer/index.spec.js +128 -170
  184. package/components/drawer/index.vdt.js +3 -9
  185. package/components/drawer/styles.d.ts +2 -2
  186. package/components/drawer/styles.js +1 -4
  187. package/components/dropdown/dropdown.d.ts +2 -2
  188. package/components/dropdown/dropdown.js +33 -90
  189. package/components/dropdown/index.js +2 -6
  190. package/components/dropdown/index.spec.js +388 -496
  191. package/components/dropdown/item.js +4 -25
  192. package/components/dropdown/item.vdt.js +5 -8
  193. package/components/dropdown/menu.js +12 -29
  194. package/components/dropdown/menu.vdt.js +5 -13
  195. package/components/dropdown/styles.js +2 -11
  196. package/components/dropdown/useKeyboard.d.ts +2 -2
  197. package/components/dropdown/useKeyboard.js +8 -30
  198. package/components/dropdown/usePosition.d.ts +1 -1
  199. package/components/dropdown/usePosition.js +12 -21
  200. package/components/dropdown/useTransition.js +0 -8
  201. package/components/editable/index.d.ts +1 -1
  202. package/components/editable/index.js +4 -28
  203. package/components/editable/index.spec.js +152 -189
  204. package/components/editable/index.vdt.js +8 -11
  205. package/components/editable/styles.js +1 -2
  206. package/components/form/form.js +0 -18
  207. package/components/form/form.vdt.js +4 -7
  208. package/components/form/index.spec.js +1082 -1316
  209. package/components/form/item.d.ts +1 -1
  210. package/components/form/item.js +0 -12
  211. package/components/form/item.vdt.js +17 -31
  212. package/components/form/methods.d.ts +5 -5
  213. package/components/form/methods.js +2 -12
  214. package/components/form/styles.js +2 -10
  215. package/components/form/useDirty.js +2 -8
  216. package/components/form/useError.js +2 -10
  217. package/components/form/useValidate.d.ts +1 -1
  218. package/components/form/useValidate.js +8 -24
  219. package/components/grid/col.d.ts +3 -3
  220. package/components/grid/col.js +0 -7
  221. package/components/grid/col.vdt.js +8 -13
  222. package/components/grid/constants.d.ts +6 -6
  223. package/components/grid/row.js +0 -5
  224. package/components/grid/row.vdt.js +5 -8
  225. package/components/grid/styles.js +2 -8
  226. package/components/grid/useBreakpoints.js +0 -5
  227. package/components/grid/useGutter.js +9 -27
  228. package/components/icon/index.js +0 -10
  229. package/components/icon/index.vdt.js +8 -14
  230. package/components/icon/styles.js +1 -4
  231. package/components/input/index.d.ts +3 -3
  232. package/components/input/index.js +0 -13
  233. package/components/input/index.spec.js +185 -239
  234. package/components/input/index.vdt.js +46 -57
  235. package/components/input/search.js +0 -20
  236. package/components/input/search.vdt.js +6 -9
  237. package/components/input/styles.js +2 -29
  238. package/components/input/useAutoRows.js +6 -18
  239. package/components/input/useAutoWidth.js +0 -5
  240. package/components/input/useFocus.js +0 -2
  241. package/components/input/useFrozen.js +0 -6
  242. package/components/input/useShowPassword.js +2 -5
  243. package/components/layout/aside.js +6 -18
  244. package/components/layout/aside.vdt.js +5 -9
  245. package/components/layout/body.js +5 -18
  246. package/components/layout/footer.js +1 -10
  247. package/components/layout/header.js +9 -23
  248. package/components/layout/index.spec.js +24 -34
  249. package/components/layout/layout.js +9 -24
  250. package/components/layout/styles.js +6 -17
  251. package/components/layout/template.vdt.js +2 -4
  252. package/components/layout/useParse.js +0 -7
  253. package/components/menu/index.spec.js +189 -242
  254. package/components/menu/item.js +3 -16
  255. package/components/menu/item.vdt.js +22 -38
  256. package/components/menu/menu.js +2 -11
  257. package/components/menu/menu.vdt.js +6 -12
  258. package/components/menu/styles.js +4 -23
  259. package/components/menu/useDropdown.js +4 -10
  260. package/components/menu/useExpanded.js +0 -14
  261. package/components/menu/useHighlight.js +26 -36
  262. package/components/message/index.spec.js +58 -73
  263. package/components/message/message.js +0 -19
  264. package/components/message/message.vdt.js +6 -9
  265. package/components/message/messages.js +0 -12
  266. package/components/message/messages.vdt.js +0 -1
  267. package/components/message/styles.js +2 -11
  268. package/components/pagination/index.d.ts +1 -1
  269. package/components/pagination/index.js +10 -46
  270. package/components/pagination/index.spec.js +133 -173
  271. package/components/pagination/index.vdt.js +14 -32
  272. package/components/pagination/styles.js +3 -9
  273. package/components/popover/content.js +1 -5
  274. package/components/popover/content.vdt.js +4 -14
  275. package/components/popover/index.js +5 -10
  276. package/components/popover/index.spec.js +113 -150
  277. package/components/popover/styles.js +1 -1
  278. package/components/portal.d.ts +1 -1
  279. package/components/portal.js +2 -30
  280. package/components/position.d.ts +12 -12
  281. package/components/position.js +32 -88
  282. package/components/progress/index.d.ts +6 -6
  283. package/components/progress/index.js +0 -12
  284. package/components/progress/index.spec.js +143 -191
  285. package/components/progress/index.vdt.js +8 -17
  286. package/components/progress/styles.js +1 -7
  287. package/components/progress/useColor.js +2 -7
  288. package/components/progress/useStatus.d.ts +1 -1
  289. package/components/progress/useStatus.js +2 -5
  290. package/components/radio/index.js +3 -18
  291. package/components/radio/index.spec.js +111 -149
  292. package/components/radio/index.vdt.js +14 -17
  293. package/components/radio/styles.js +1 -13
  294. package/components/rate/index.js +0 -7
  295. package/components/rate/index.spec.js +64 -79
  296. package/components/rate/index.vdt.js +8 -21
  297. package/components/rate/styles.js +1 -4
  298. package/components/rate/useActiveValue.js +2 -7
  299. package/components/scrollSelect/index.d.ts +2 -2
  300. package/components/scrollSelect/index.js +0 -7
  301. package/components/scrollSelect/index.spec.js +100 -131
  302. package/components/scrollSelect/index.vdt.js +6 -12
  303. package/components/scrollSelect/styles.js +1 -8
  304. package/components/scrollSelect/useList.js +3 -17
  305. package/components/scrollSelect/useMouseEvents.js +31 -49
  306. package/components/scrollSelect/useTranslate.js +1 -11
  307. package/components/select/base.d.ts +2 -2
  308. package/components/select/base.js +3 -33
  309. package/components/select/base.vdt.js +27 -46
  310. package/components/select/group.js +0 -5
  311. package/components/select/group.vdt.js +4 -10
  312. package/components/select/index.spec.js +370 -464
  313. package/components/select/menu.js +0 -5
  314. package/components/select/menu.vdt.js +18 -33
  315. package/components/select/option.js +2 -16
  316. package/components/select/option.vdt.js +7 -14
  317. package/components/select/select.js +3 -20
  318. package/components/select/select.vdt.js +9 -17
  319. package/components/select/styles.js +3 -34
  320. package/components/select/useBaseLabel.d.ts +1 -1
  321. package/components/select/useBaseLabel.js +4 -17
  322. package/components/select/useCard.js +0 -4
  323. package/components/select/useDraggble.js +2 -2
  324. package/components/select/useEqualWidth.js +0 -1
  325. package/components/select/useFilterable.js +9 -27
  326. package/components/select/useFocusout.js +0 -8
  327. package/components/select/useInput.js +6 -10
  328. package/components/select/useLabel.js +3 -13
  329. package/components/select/useSearchable.js +0 -10
  330. package/components/skeleton/item.d.ts +1 -1
  331. package/components/skeleton/item.js +0 -7
  332. package/components/skeleton/item.vdt.js +1 -6
  333. package/components/skeleton/skeleton.js +0 -7
  334. package/components/skeleton/skeleton.vdt.js +6 -12
  335. package/components/skeleton/styles.d.ts +1 -1
  336. package/components/skeleton/styles.js +2 -3
  337. package/components/slider/index.d.ts +1 -1
  338. package/components/slider/index.js +0 -7
  339. package/components/slider/index.spec.js +502 -624
  340. package/components/slider/index.vdt.js +35 -50
  341. package/components/slider/styles.js +1 -19
  342. package/components/slider/useClick.js +2 -11
  343. package/components/slider/useDraggable.js +23 -34
  344. package/components/slider/useKeyboard.js +7 -18
  345. package/components/slider/useMarks.d.ts +5 -5
  346. package/components/slider/useMarks.js +5 -13
  347. package/components/slider/usePoints.d.ts +2 -2
  348. package/components/slider/usePoints.js +7 -21
  349. package/components/slider/useStyles.d.ts +1 -1
  350. package/components/slider/useStyles.js +5 -10
  351. package/components/slider/useTooltip.js +2 -10
  352. package/components/slider/useValue.d.ts +1 -1
  353. package/components/slider/useValue.js +7 -24
  354. package/components/spin/index.js +0 -7
  355. package/components/spin/index.vdt.js +4 -11
  356. package/components/spin/styles.js +1 -3
  357. package/components/spinner/index.d.ts +4 -4
  358. package/components/spinner/index.js +6 -18
  359. package/components/spinner/index.spec.js +359 -460
  360. package/components/spinner/index.vdt.js +12 -15
  361. package/components/spinner/styles.js +1 -11
  362. package/components/spinner/useChange.js +4 -16
  363. package/components/spinner/useFormatter.js +6 -16
  364. package/components/spinner/useStep.d.ts +3 -3
  365. package/components/spinner/useStep.js +2 -20
  366. package/components/spinner/useValue.js +14 -32
  367. package/components/split/index.js +0 -7
  368. package/components/split/index.spec.js +223 -267
  369. package/components/split/index.vdt.js +8 -17
  370. package/components/split/memo.js +0 -6
  371. package/components/split/styles.d.ts +1 -1
  372. package/components/split/styles.js +1 -9
  373. package/components/split/useDraggable.js +11 -35
  374. package/components/split/useSize.js +2 -5
  375. package/components/steps/index.js +2 -13
  376. package/components/steps/index.spec.js +21 -27
  377. package/components/steps/index.vdt.js +9 -12
  378. package/components/steps/step.js +0 -5
  379. package/components/steps/step.vdt.js +8 -12
  380. package/components/steps/styles.js +1 -38
  381. package/components/switch/index.js +2 -23
  382. package/components/switch/index.spec.js +194 -234
  383. package/components/switch/index.vdt.js +16 -32
  384. package/components/switch/styles.js +4 -12
  385. package/components/switch/useDraggable.js +10 -18
  386. package/components/table/cell.js +0 -9
  387. package/components/table/cell.vdt.js +14 -21
  388. package/components/table/column.d.ts +1 -1
  389. package/components/table/column.js +0 -5
  390. package/components/table/column.vdt.js +25 -37
  391. package/components/table/exportTable.js +41 -55
  392. package/components/table/index.spec.js +817 -1026
  393. package/components/table/row.d.ts +1 -1
  394. package/components/table/row.js +12 -44
  395. package/components/table/row.vdt.js +27 -38
  396. package/components/table/styles.js +2 -18
  397. package/components/table/table.d.ts +5 -5
  398. package/components/table/table.js +18 -50
  399. package/components/table/table.vdt.js +61 -86
  400. package/components/table/useChecked.d.ts +1 -1
  401. package/components/table/useChecked.js +20 -61
  402. package/components/table/useColumns.js +3 -16
  403. package/components/table/useDisableRow.js +2 -12
  404. package/components/table/useDraggable.js +4 -8
  405. package/components/table/useExpandable.js +2 -5
  406. package/components/table/useFixedColumns.d.ts +1 -1
  407. package/components/table/useFixedColumns.js +3 -20
  408. package/components/table/useGroup.d.ts +1 -1
  409. package/components/table/useGroup.js +7 -25
  410. package/components/table/useMerge.d.ts +4 -4
  411. package/components/table/useMerge.js +2 -14
  412. package/components/table/usePagination.js +4 -18
  413. package/components/table/useResetRowStatus.js +2 -6
  414. package/components/table/useResizable.js +4 -21
  415. package/components/table/useScroll.d.ts +1 -1
  416. package/components/table/useScroll.js +0 -3
  417. package/components/table/useSelected.js +2 -5
  418. package/components/table/useSortable.js +2 -8
  419. package/components/table/useStickyHeader.js +3 -7
  420. package/components/table/useStickyScrollbar.js +6 -16
  421. package/components/table/useTree.js +1 -12
  422. package/components/table/useWidth.js +14 -30
  423. package/components/tabs/index.js +29 -51
  424. package/components/tabs/index.spec.js +97 -129
  425. package/components/tabs/index.vdt.js +13 -16
  426. package/components/tabs/styles.js +1 -23
  427. package/components/tabs/tab.js +0 -10
  428. package/components/tabs/tab.vdt.js +6 -10
  429. package/components/tabs/useActiveBar.js +2 -11
  430. package/components/tabs/useScroll.js +10 -30
  431. package/components/tag/base.js +0 -11
  432. package/components/tag/index.js +2 -4
  433. package/components/tag/index.spec.js +123 -156
  434. package/components/tag/index.vdt.js +8 -15
  435. package/components/tag/styles.d.ts +1 -1
  436. package/components/tag/styles.js +2 -18
  437. package/components/tag/tags.d.ts +2 -2
  438. package/components/tag/tags.js +0 -7
  439. package/components/tag/tags.vdt.js +10 -18
  440. package/components/tag/useChildren.js +0 -5
  441. package/components/tag/useDraggable.js +6 -15
  442. package/components/tag/useNowrap.js +10 -27
  443. package/components/timeline/item.js +0 -7
  444. package/components/timeline/item.vdt.js +4 -9
  445. package/components/timeline/styles.d.ts +2 -2
  446. package/components/timeline/styles.js +2 -6
  447. package/components/timeline/timeline.js +0 -5
  448. package/components/timeline/timeline.vdt.js +2 -5
  449. package/components/timepicker/index.js +2 -7
  450. package/components/timepicker/index.spec.js +293 -368
  451. package/components/timepicker/panelPicker.js +2 -11
  452. package/components/timepicker/panelPicker.vdt.js +14 -24
  453. package/components/timepicker/selectPicker.js +0 -5
  454. package/components/timepicker/selectPicker.vdt.js +5 -10
  455. package/components/timepicker/styles.js +1 -2
  456. package/components/timepicker/useDisabled.js +2 -4
  457. package/components/timepicker/useFormats.js +4 -13
  458. package/components/timepicker/useStep.d.ts +1 -1
  459. package/components/timepicker/useStep.js +8 -17
  460. package/components/timepicker/useValue.js +16 -21
  461. package/components/tip/index.js +0 -2
  462. package/components/tip/index.vdt.js +5 -17
  463. package/components/tip/styles.js +1 -4
  464. package/components/tooltip/content.js +0 -28
  465. package/components/tooltip/content.vdt.js +15 -27
  466. package/components/tooltip/index.js +3 -7
  467. package/components/tooltip/index.spec.js +400 -527
  468. package/components/tooltip/styles.d.ts +1 -1
  469. package/components/tooltip/styles.js +3 -13
  470. package/components/tooltip/tooltip.js +2 -15
  471. package/components/tooltip/useArrow.js +11 -14
  472. package/components/transfer/index.d.ts +1 -1
  473. package/components/transfer/index.js +1 -13
  474. package/components/transfer/index.spec.js +159 -194
  475. package/components/transfer/index.vdt.js +17 -36
  476. package/components/transfer/styles.js +1 -11
  477. package/components/transfer/useCheck.d.ts +1 -1
  478. package/components/transfer/useCheck.js +1 -16
  479. package/components/transfer/useFilter.d.ts +1 -1
  480. package/components/transfer/useFilter.js +9 -30
  481. package/components/transfer/useTransfer.js +10 -26
  482. package/components/tree/index.d.ts +3 -3
  483. package/components/tree/index.js +3 -22
  484. package/components/tree/index.spec.js +310 -388
  485. package/components/tree/index.vdt.js +12 -24
  486. package/components/tree/styles.js +3 -17
  487. package/components/tree/useChecked.js +3 -27
  488. package/components/tree/useDraggable.js +14 -44
  489. package/components/tree/useExpanded.js +28 -46
  490. package/components/tree/useFilter.js +3 -10
  491. package/components/tree/useNodes.d.ts +3 -3
  492. package/components/tree/useNodes.js +0 -4
  493. package/components/tree/useSelected.js +21 -38
  494. package/components/tree/useTransitionEvent.js +3 -5
  495. package/components/treeSelect/index.js +9 -37
  496. package/components/treeSelect/index.spec.js +123 -160
  497. package/components/treeSelect/index.vdt.js +14 -20
  498. package/components/treeSelect/styles.js +1 -2
  499. package/components/treeSelect/useValue.js +0 -11
  500. package/components/types.d.ts +3 -3
  501. package/components/upload/ajaxUploader.d.ts +1 -1
  502. package/components/upload/ajaxUploader.js +0 -17
  503. package/components/upload/index.d.ts +4 -4
  504. package/components/upload/index.js +0 -14
  505. package/components/upload/index.spec.js +142 -248
  506. package/components/upload/index.vdt.js +12 -28
  507. package/components/upload/styles.js +2 -28
  508. package/components/upload/useAccept.js +2 -10
  509. package/components/upload/useDrag.js +0 -7
  510. package/components/upload/useFiles.js +103 -148
  511. package/components/upload/useShowImage.js +0 -3
  512. package/components/upload/useUpload.js +47 -69
  513. package/components/utils.d.ts +6 -6
  514. package/components/utils.js +12 -56
  515. package/components/virtual.js +9 -37
  516. package/components/wave/index.js +5 -32
  517. package/components/wave/styles.js +1 -1
  518. package/hooks/useDelayClose.js +2 -7
  519. package/hooks/useDocumentClick.js +8 -16
  520. package/hooks/useDraggable.d.ts +1 -1
  521. package/hooks/useDraggable.js +0 -9
  522. package/hooks/useKeyboard.d.ts +3 -3
  523. package/hooks/useKeyboard.js +0 -10
  524. package/hooks/useMouseOutsidable.js +0 -8
  525. package/hooks/useReceive.d.ts +1 -1
  526. package/hooks/useReceive.js +0 -4
  527. package/hooks/useRecordComponent.js +0 -6
  528. package/hooks/useResizeObserver.js +0 -2
  529. package/hooks/useRouter.js +7 -18
  530. package/hooks/useShowHideEvents.js +0 -3
  531. package/hooks/useState.d.ts +2 -2
  532. package/hooks/useState.js +2 -6
  533. package/i18n/en-US.js +0 -1
  534. package/i18n/index.d.ts +1 -1
  535. package/i18n/index.js +0 -7
  536. package/index.d.ts +2 -2
  537. package/index.js +2 -3
  538. package/package.json +2 -2
  539. package/styles/global.js +2 -5
  540. package/styles/keyframes.js +0 -1
  541. package/styles/theme.d.ts +1 -1
  542. package/styles/theme.js +2 -5
  543. package/styles/utils.d.ts +1 -1
  544. package/styles/utils.js +3 -17
  545. package/yarn-error.log +528 -0
@@ -10,46 +10,39 @@ import { _$ } from '../../i18n';
10
10
  import { makeStyles } from './styles';
11
11
  export default function ($props, $blocks, $__proto__) {
12
12
  var _classNameObj;
13
-
14
13
  $blocks || ($blocks = {});
15
14
  $props || ($props = {});
16
15
  var $this = this;
17
-
18
16
  var _this$get = this.get(),
19
- total = _this$get.total,
20
- size = _this$get.size,
21
- flat = _flatInstanceProperty(_this$get),
22
- simple = _this$get.simple,
23
- className = _this$get.className,
24
- showTotal = _this$get.showTotal,
25
- showGoto = _this$get.showGoto,
26
- counts = _this$get.counts,
27
- value = _this$get.value,
28
- limit = _this$get.limit,
29
- limits = _this$get.limits,
30
- showLimits = _this$get.showLimits,
31
- disableBtn = _this$get.disableBtn,
32
- disablePage = _this$get.disablePage;
33
-
17
+ total = _this$get.total,
18
+ size = _this$get.size,
19
+ flat = _flatInstanceProperty(_this$get),
20
+ simple = _this$get.simple,
21
+ className = _this$get.className,
22
+ showTotal = _this$get.showTotal,
23
+ showGoto = _this$get.showGoto,
24
+ counts = _this$get.counts,
25
+ value = _this$get.value,
26
+ limit = _this$get.limit,
27
+ limits = _this$get.limits,
28
+ showLimits = _this$get.showLimits,
29
+ disableBtn = _this$get.disableBtn,
30
+ disablePage = _this$get.disablePage;
34
31
  if (!total) return _$ccv(' pagination ');
35
32
  var k = this.config.k;
36
33
  var classNameObj = (_classNameObj = {}, _classNameObj[k + "-pagination"] = true, _classNameObj[className] = className, _classNameObj[k + "-" + size] = size !== 'default', _classNameObj[k + "-flat"] = flat, _classNameObj[k + "-simple"] = simple, _classNameObj[makeStyles(k)] = true, _classNameObj);
37
34
  var type = flat ? 'flat' : simple ? 'none' : 'default';
38
35
  var totalPages = Math.ceil(total / limit) || 0;
39
-
40
36
  var paginationButton = function paginationButton(page) {
41
37
  var disabled = false;
42
-
43
38
  if (page !== value) {
44
39
  if (disablePage) {
45
40
  disabled || (disabled = !!disablePage(page, limit));
46
41
  }
47
-
48
42
  if (disableBtn) {
49
43
  disabled || (disabled = !!disableBtn(page, limit));
50
44
  }
51
45
  }
52
-
53
46
  return _$cc(Button, {
54
47
  'type': type,
55
48
  'size': size,
@@ -59,7 +52,6 @@ export default function ($props, $blocks, $__proto__) {
59
52
  'children': page
60
53
  });
61
54
  };
62
-
63
55
  var paginationDot = function paginationDot(callback) {
64
56
  return _$cc(Button, {
65
57
  'type': type,
@@ -70,22 +62,18 @@ export default function ($props, $blocks, $__proto__) {
70
62
  'children': '...'
71
63
  });
72
64
  };
73
-
74
65
  var paginationItems = [];
75
66
  var minCount = Math.ceil(counts / 2);
76
67
  var maxCount = totalPages - minCount;
77
68
  var prevPage = value - 1;
78
69
  var nextPage = value + 1;
79
-
80
70
  if (!simple) {
81
71
  if (totalPages > counts) {
82
72
  if (value <= minCount) {
83
73
  var max = counts - 2;
84
-
85
74
  for (var i = 1; i <= max; i++) {
86
75
  paginationItems.push(paginationButton(i));
87
76
  }
88
-
89
77
  paginationItems.push(paginationDot(this.fastNext));
90
78
  paginationItems.push(paginationButton(totalPages));
91
79
  } else if (value > minCount && value <= maxCount) {
@@ -94,21 +82,16 @@ export default function ($props, $blocks, $__proto__) {
94
82
  var midCount = counts - 4;
95
83
  var mid = Math.floor(midCount / 2);
96
84
  var min = value - mid;
97
-
98
85
  var _max = midCount % 2 === 1 ? value + mid : value + mid - 1;
99
-
100
86
  for (var _i = min; _i <= _max; _i++) {
101
87
  paginationItems.push(paginationButton(_i));
102
88
  }
103
-
104
89
  paginationItems.push(paginationDot(this.fastNext));
105
90
  paginationItems.push(paginationButton(totalPages));
106
91
  } else {
107
92
  paginationItems.push(paginationButton(1));
108
93
  paginationItems.push(paginationDot(this.fastPrev));
109
-
110
94
  var _min = totalPages - counts + 3;
111
-
112
95
  for (var _i2 = _min; _i2 <= totalPages; _i2++) {
113
96
  paginationItems.push(paginationButton(_i2));
114
97
  }
@@ -126,7 +109,6 @@ export default function ($props, $blocks, $__proto__) {
126
109
  'ev-change': this.goto
127
110
  }), _$ce(2, 'span', [_$ct(' / '), totalPages], 0, _$cn(k + "-pagination-text"))];
128
111
  }
129
-
130
112
  return _$cv('div', _extends({
131
113
  'className': _$cn(classNameObj)
132
114
  }, getRestProps(this)), [showTotal && !simple ? _$ce(2, 'div', _$('共 {n} 条', {
@@ -20,17 +20,14 @@ var defaults = deepDefaults({
20
20
  get fontSize() {
21
21
  return theme.default.fontSize;
22
22
  },
23
-
24
23
  gap: '16px',
25
24
  btn: {
26
25
  gap: '6px',
27
26
  padding: '0 3px',
28
-
29
27
  get borderRadius() {
30
28
  return theme.borderRadius;
31
- } // get hoverBgColor() { return theme.color.hoverBg }
32
-
33
-
29
+ }
30
+ // get hoverBgColor() { return theme.color.hoverBg }
34
31
  },
35
32
  // goto
36
33
  goto: {
@@ -43,15 +40,12 @@ var defaults = deepDefaults({
43
40
  get fontSize() {
44
41
  return styles.fontSize;
45
42
  },
46
-
47
43
  get btnGap() {
48
44
  return btnGapMap[size];
49
45
  },
50
-
51
46
  get iconFontSize() {
52
47
  return iconFontSizeMap[size];
53
48
  }
54
-
55
49
  };
56
50
  return memo;
57
51
  }, {}));
@@ -60,7 +54,7 @@ setDefault(function () {
60
54
  pagination = deepDefaults(theme, {
61
55
  pagination: defaults
62
56
  }).pagination;
63
- makeStyles == null ? void 0 : makeStyles.clearCache();
57
+ makeStyles == null || makeStyles.clearCache();
64
58
  });
65
59
  export var makeStyles = cache(function makeStyles(k) {
66
60
  return /*#__PURE__*/css("font-size:", pagination.fontSize, ";>*{display:inline-block;vertical-align:middle;&:not(:first-child){margin-left:", pagination.gap, ";}}.", k, "-pagination-ellipsis{background-color:transparent;border-color:transparent;}.", k, "-btns{.", k, "-btn{width:auto!important;min-width:", button.height, ";padding:", pagination.btn.padding, ";margin-right:", pagination.btn.gap, ";border-radius:", pagination.btn.borderRadius, "!important;&:last-of-type{margin:0!important;}}.", k, "-icon{font-size:18px;}}.", k, "-pagination-goto{.", k, "-input{font-size:inherit;width:", pagination.goto.width, ";margin:", pagination.goto.gap, ";}.", k, "-input-inner{text-align:center;}}.", k, "-select{width:auto;}", _mapInstanceProperty(sizes).call(sizes, function (size) {
@@ -10,21 +10,17 @@ var typeDefs = {
10
10
  };
11
11
  export var PopoverContent = /*#__PURE__*/function (_TooltipContent) {
12
12
  _inheritsLoose(PopoverContent, _TooltipContent);
13
-
14
13
  function PopoverContent() {
15
14
  var _context;
16
-
17
15
  var _this;
18
-
19
16
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
20
17
  args[_key] = arguments[_key];
21
18
  }
22
-
23
19
  _this = _TooltipContent.call.apply(_TooltipContent, _concatInstanceProperty(_context = [this]).call(_context, args)) || this;
20
+ // don't check children
24
21
  _this.isEmptyChildren = false;
25
22
  return _this;
26
23
  }
27
-
28
24
  return PopoverContent;
29
25
  }(TooltipContent);
30
26
  PopoverContent.template = template;
@@ -3,18 +3,15 @@ import { Icon } from '../icon';
3
3
  import { makeStyles } from "./styles";
4
4
  export default function ($props, $blocks, $__proto__) {
5
5
  var _classNameObj;
6
-
7
6
  $blocks || ($blocks = {});
8
7
  $props || ($props = {});
9
8
  var $this = this;
10
9
  var _$blocks = {};
11
10
  var __$blocks = {};
12
-
13
11
  var _this$get = this.get(),
14
- type = _this$get.type,
15
- title = _this$get.title,
16
- content = _this$get.content;
17
-
12
+ type = _this$get.type,
13
+ title = _this$get.title,
14
+ content = _this$get.content;
18
15
  var k = this.config.k;
19
16
  var iconMap = {
20
17
  info: 'information-fill',
@@ -27,8 +24,7 @@ export default function ($props, $blocks, $__proto__) {
27
24
  'className': _$cn(classNameObj)
28
25
  }, function ($blocks) {
29
26
  var _$blocks = {},
30
- __$blocks = _$ex({}, $blocks);
31
-
27
+ __$blocks = _$ex({}, $blocks);
32
28
  return (_$blocks['body'] = function ($super) {
33
29
  return [title || $blocks.title ? _$ce(2, 'div', [type ? _$cc(Icon, {
34
30
  'className': _$cn(k + "-icon-" + iconMap[type] + " " + k + "-popover-icon"),
@@ -38,30 +34,24 @@ export default function ($props, $blocks, $__proto__) {
38
34
  return title;
39
35
  }, __$blocks['title'] = function ($super, data) {
40
36
  var block = $blocks['title'];
41
-
42
37
  var callBlock = function callBlock() {
43
38
  return _$blocks['title'].call($this, $super, data);
44
39
  };
45
-
46
40
  return block ? block.call($this, callBlock, data) : callBlock();
47
41
  }, __$blocks['title'](_$no))], 0, _$cn(k + "-popover-title")) : undefined, content || $blocks.content ? _$ce(2, 'div', (_$blocks['content'] = function ($super) {
48
42
  return content;
49
43
  }, __$blocks['content'] = function ($super, data) {
50
44
  var block = $blocks['content'];
51
-
52
45
  var callBlock = function callBlock() {
53
46
  return _$blocks['content'].call($this, $super, data);
54
47
  };
55
-
56
48
  return block ? block.call($this, callBlock, data) : callBlock();
57
49
  }, __$blocks['content'](_$no)), 0, _$cn(k + "-popover-content")) : undefined];
58
50
  }, __$blocks['body'] = function ($super, data) {
59
51
  var block = $blocks['body'];
60
-
61
52
  var callBlock = function callBlock() {
62
53
  return _$blocks['body'].call($this, $super, data);
63
54
  };
64
-
65
55
  return block ? block.call($this, callBlock, data) : callBlock();
66
56
  }), __$blocks;
67
57
  }.call($this, $blocks), $__proto__);
@@ -5,25 +5,21 @@ import { createVNode as h, Component } from 'intact-react';
5
5
  import { Tooltip } from "../tooltip/tooltip";
6
6
  import { PopoverContent } from './content';
7
7
  import { noop } from 'intact-shared';
8
-
9
8
  function Wrapper(props) {
10
9
  var children = props.children,
11
- type = props.type,
12
- title = props.title,
13
- content = props.content,
14
- $blocks = props.$blocks,
15
- rest = _objectWithoutPropertiesLoose(props, _excluded);
16
-
10
+ type = props.type,
11
+ title = props.title,
12
+ content = props.content,
13
+ $blocks = props.$blocks,
14
+ rest = _objectWithoutPropertiesLoose(props, _excluded);
17
15
  if ($blocks) {
18
16
  if ($blocks.title) {
19
17
  title = $blocks.title(noop);
20
18
  }
21
-
22
19
  if ($blocks.content) {
23
20
  content = $blocks.content(noop);
24
21
  }
25
22
  }
26
-
27
23
  var contentVNode = h(PopoverContent, {
28
24
  type: type,
29
25
  title: title,
@@ -39,6 +35,5 @@ function Wrapper(props) {
39
35
  trigger: 'click'
40
36
  }));
41
37
  }
42
-
43
38
  var functionalWrapper = Component.functionalWrapper;
44
39
  export var Popover = functionalWrapper ? functionalWrapper(Wrapper) : Wrapper;
@@ -14,181 +14,144 @@ describe("Popover", function () {
14
14
  });
15
15
  it('should handle popover correctly', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
16
16
  var _mount, instance, element, cancelCb, okCb, content, _Array$from, btn;
17
-
18
17
  return _regeneratorRuntime.wrap(function _callee$(_context) {
19
- while (1) {
20
- switch (_context.prev = _context.next) {
21
- case 0:
22
- _mount = mount(BasicDemo), instance = _mount[0], element = _mount[1];
23
- cancelCb = sinon.spy();
24
- okCb = sinon.spy();
25
- instance.refs.popover1.on('cancel', cancelCb);
26
- instance.refs.popover1.on('ok', okCb);
27
- dispatchEvent(element.children[0], 'click');
28
- _context.next = 8;
29
- return wait();
30
-
31
- case 8:
32
- content = getElement('.k-tooltip-content');
33
- expect(content.innerHTML).to.matchSnapshot();
34
- content.querySelector('.k-btn').click();
35
- _context.next = 13;
36
- return wait(500);
37
-
38
- case 13:
39
- expect(content.style.display).eql('none');
40
- dispatchEvent(element.firstElementChild, 'click');
41
- _context.next = 17;
42
- return wait();
43
-
44
- case 17:
45
- content = getElement('.k-tooltip-content');
46
- _Array$from = _Array$from2(content.querySelectorAll('.k-btn')), btn = _Array$from[1];
47
- btn.click();
48
- _context.next = 22;
49
- return wait(500);
50
-
51
- case 22:
52
- expect(content.style.display).eql('none');
53
- expect(cancelCb.callCount).eql(1);
54
- expect(okCb.callCount).eql(1);
55
-
56
- case 25:
57
- case "end":
58
- return _context.stop();
59
- }
18
+ while (1) switch (_context.prev = _context.next) {
19
+ case 0:
20
+ _mount = mount(BasicDemo), instance = _mount[0], element = _mount[1];
21
+ cancelCb = sinon.spy();
22
+ okCb = sinon.spy();
23
+ instance.refs.popover1.on('cancel', cancelCb);
24
+ instance.refs.popover1.on('ok', okCb);
25
+ dispatchEvent(element.children[0], 'click');
26
+ _context.next = 8;
27
+ return wait();
28
+ case 8:
29
+ content = getElement('.k-tooltip-content');
30
+ expect(content.innerHTML).to.matchSnapshot();
31
+ content.querySelector('.k-btn').click();
32
+ _context.next = 13;
33
+ return wait(500);
34
+ case 13:
35
+ expect(content.style.display).eql('none');
36
+ dispatchEvent(element.firstElementChild, 'click');
37
+ _context.next = 17;
38
+ return wait();
39
+ case 17:
40
+ content = getElement('.k-tooltip-content');
41
+ _Array$from = _Array$from2(content.querySelectorAll('.k-btn')), btn = _Array$from[1];
42
+ btn.click();
43
+ _context.next = 22;
44
+ return wait(500);
45
+ case 22:
46
+ expect(content.style.display).eql('none');
47
+ expect(cancelCb.callCount).eql(1);
48
+ expect(okCb.callCount).eql(1);
49
+ case 25:
50
+ case "end":
51
+ return _context.stop();
60
52
  }
61
53
  }, _callee);
62
54
  })));
63
55
  it('should handle type correctly', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
64
56
  var _mount2, instance, element, _element$querySelecto, info, success, error, warning, test;
65
-
66
57
  return _regeneratorRuntime.wrap(function _callee3$(_context3) {
67
- while (1) {
68
- switch (_context3.prev = _context3.next) {
69
- case 0:
70
- _mount2 = mount(TypeDemo), instance = _mount2[0], element = _mount2[1];
71
- _element$querySelecto = element.querySelectorAll('.k-btn'), info = _element$querySelecto[0], success = _element$querySelecto[1], error = _element$querySelecto[2], warning = _element$querySelecto[3];
72
-
73
- test = /*#__PURE__*/function () {
74
- var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(element, className) {
75
- var content;
76
- return _regeneratorRuntime.wrap(function _callee2$(_context2) {
77
- while (1) {
78
- switch (_context2.prev = _context2.next) {
79
- case 0:
80
- element.click();
81
- _context2.next = 3;
82
- return wait();
83
-
84
- case 3:
85
- content = getElement('.k-tooltip-content');
86
- expect(content.querySelector('.k-popover-icon').classList.contains(className)).eql(true);
87
-
88
- case 5:
89
- case "end":
90
- return _context2.stop();
91
- }
92
- }
93
- }, _callee2);
94
- }));
95
-
96
- return function test(_x, _x2) {
97
- return _ref3.apply(this, arguments);
98
- };
99
- }();
100
-
101
- _context3.next = 5;
102
- return test(info, 'k-icon-information-fill');
103
-
104
- case 5:
105
- _context3.next = 7;
106
- return test(success, 'k-icon-success-fill');
107
-
108
- case 7:
109
- _context3.next = 9;
110
- return test(error, 'k-icon-error-fill');
111
-
112
- case 9:
113
- _context3.next = 11;
114
- return test(warning, 'k-icon-warning-fill');
115
-
116
- case 11:
117
- case "end":
118
- return _context3.stop();
119
- }
58
+ while (1) switch (_context3.prev = _context3.next) {
59
+ case 0:
60
+ _mount2 = mount(TypeDemo), instance = _mount2[0], element = _mount2[1];
61
+ _element$querySelecto = element.querySelectorAll('.k-btn'), info = _element$querySelecto[0], success = _element$querySelecto[1], error = _element$querySelecto[2], warning = _element$querySelecto[3];
62
+ test = /*#__PURE__*/function () {
63
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(element, className) {
64
+ var content;
65
+ return _regeneratorRuntime.wrap(function _callee2$(_context2) {
66
+ while (1) switch (_context2.prev = _context2.next) {
67
+ case 0:
68
+ element.click();
69
+ _context2.next = 3;
70
+ return wait();
71
+ case 3:
72
+ content = getElement('.k-tooltip-content');
73
+ expect(content.querySelector('.k-popover-icon').classList.contains(className)).eql(true);
74
+ case 5:
75
+ case "end":
76
+ return _context2.stop();
77
+ }
78
+ }, _callee2);
79
+ }));
80
+ return function test(_x, _x2) {
81
+ return _ref3.apply(this, arguments);
82
+ };
83
+ }();
84
+ _context3.next = 5;
85
+ return test(info, 'k-icon-information-fill');
86
+ case 5:
87
+ _context3.next = 7;
88
+ return test(success, 'k-icon-success-fill');
89
+ case 7:
90
+ _context3.next = 9;
91
+ return test(error, 'k-icon-error-fill');
92
+ case 9:
93
+ _context3.next = 11;
94
+ return test(warning, 'k-icon-warning-fill');
95
+ case 11:
96
+ case "end":
97
+ return _context3.stop();
120
98
  }
121
99
  }, _callee3);
122
100
  })));
123
101
  it('should handle title/content slot correctly', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
124
102
  var _mount3, instance, element, content;
125
-
126
103
  return _regeneratorRuntime.wrap(function _callee4$(_context4) {
127
- while (1) {
128
- switch (_context4.prev = _context4.next) {
129
- case 0:
130
- _mount3 = mount(ContentDemo), instance = _mount3[0], element = _mount3[1];
131
- dispatchEvent(element.children[0], 'click');
132
- _context4.next = 4;
133
- return wait();
134
-
135
- case 4:
136
- content = getElement('.k-tooltip-content');
137
- expect(content.querySelector('.k-popover-title')).to.matchSnapshot();
138
- expect(content.querySelector('.k-popover-content')).to.matchSnapshot();
139
-
140
- case 7:
141
- case "end":
142
- return _context4.stop();
143
- }
104
+ while (1) switch (_context4.prev = _context4.next) {
105
+ case 0:
106
+ _mount3 = mount(ContentDemo), instance = _mount3[0], element = _mount3[1];
107
+ dispatchEvent(element.children[0], 'click');
108
+ _context4.next = 4;
109
+ return wait();
110
+ case 4:
111
+ content = getElement('.k-tooltip-content');
112
+ expect(content.querySelector('.k-popover-title')).to.matchSnapshot();
113
+ expect(content.querySelector('.k-popover-content')).to.matchSnapshot();
114
+ case 7:
115
+ case "end":
116
+ return _context4.stop();
144
117
  }
145
118
  }, _callee4);
146
119
  })));
147
120
  it('should handle text props correctly', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5() {
148
121
  var _mount4, instance, element, content, btns;
149
-
150
122
  return _regeneratorRuntime.wrap(function _callee5$(_context5) {
151
- while (1) {
152
- switch (_context5.prev = _context5.next) {
153
- case 0:
154
- _mount4 = mount(TextDemo), instance = _mount4[0], element = _mount4[1];
155
- dispatchEvent(element.children[0], 'click');
156
- _context5.next = 4;
157
- return wait();
158
-
159
- case 4:
160
- content = getElement('.k-tooltip-content');
161
- btns = content.querySelectorAll('.k-btn');
162
- expect(btns[0].textContent).eql('cancel');
163
- expect(btns[1].textContent).eql('confirm');
164
-
165
- case 8:
166
- case "end":
167
- return _context5.stop();
168
- }
123
+ while (1) switch (_context5.prev = _context5.next) {
124
+ case 0:
125
+ _mount4 = mount(TextDemo), instance = _mount4[0], element = _mount4[1];
126
+ dispatchEvent(element.children[0], 'click');
127
+ _context5.next = 4;
128
+ return wait();
129
+ case 4:
130
+ content = getElement('.k-tooltip-content');
131
+ btns = content.querySelectorAll('.k-btn');
132
+ expect(btns[0].textContent).eql('cancel');
133
+ expect(btns[1].textContent).eql('confirm');
134
+ case 8:
135
+ case "end":
136
+ return _context5.stop();
169
137
  }
170
138
  }, _callee5);
171
139
  })));
172
140
  it('should handle footer slot correctly', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6() {
173
141
  var _mount5, instance, element, content;
174
-
175
142
  return _regeneratorRuntime.wrap(function _callee6$(_context6) {
176
- while (1) {
177
- switch (_context6.prev = _context6.next) {
178
- case 0:
179
- _mount5 = mount(ButtonDemo), instance = _mount5[0], element = _mount5[1];
180
- dispatchEvent(element.children[0], 'click');
181
- _context6.next = 4;
182
- return wait();
183
-
184
- case 4:
185
- content = getElement('.k-tooltip-content');
186
- expect(content.querySelector('.k-tooltip-footer').outerHTML).to.matchSnapshot();
187
-
188
- case 6:
189
- case "end":
190
- return _context6.stop();
191
- }
143
+ while (1) switch (_context6.prev = _context6.next) {
144
+ case 0:
145
+ _mount5 = mount(ButtonDemo), instance = _mount5[0], element = _mount5[1];
146
+ dispatchEvent(element.children[0], 'click');
147
+ _context6.next = 4;
148
+ return wait();
149
+ case 4:
150
+ content = getElement('.k-tooltip-content');
151
+ expect(content.querySelector('.k-tooltip-footer').outerHTML).to.matchSnapshot();
152
+ case 6:
153
+ case "end":
154
+ return _context6.stop();
192
155
  }
193
156
  }, _callee6);
194
157
  })));
@@ -20,7 +20,7 @@ setDefault(function () {
20
20
  popover = deepDefaults(theme, {
21
21
  popover: defaults
22
22
  }).popover;
23
- makeStyles == null ? void 0 : makeStyles.clearCache();
23
+ makeStyles == null || makeStyles.clearCache();
24
24
  });
25
25
  export var makeStyles = cache(function makeStyles(k) {
26
26
  return /*#__PURE__*/css("&.", k, "-tooltip-content.", k, "-popover{width:", popover.width, ";padding:", popover.padding, ";.", k, "-popover-title{display:flex;align-items:center;font-size:", popover.title.fontSize, ";line-height:", popover.title.lineHeight, ";font-weight:", popover.title.fontWeight, ";}.", k, "-popover-icon{margin-right:", popover.gap, ";}.", k, "-popover-content{margin-top:", popover.gap, ";}.", k, "-tooltip-footer{text-align:right;}&.", k, "-small{padding:", popover.padding, ";width:", popover.small.width, ";}}");
@@ -2,7 +2,7 @@ import { Component, VNodeComponentClass, IntactDom, TypeDefs } from 'intact-reac
2
2
  export interface PortalProps {
3
3
  container?: Container;
4
4
  }
5
- export declare type Container = string | ((parentDom: Element, anchor: IntactDom | null) => Element);
5
+ export type Container = string | ((parentDom: Element, anchor: IntactDom | null) => Element);
6
6
  export declare class Portal<T extends PortalProps = PortalProps> extends Component<T> {
7
7
  static template(this: Portal): import('intact-react').VNodeTextElement;
8
8
  static typeDefs: Required<TypeDefs<PortalProps>>;