@king-design/vue 2.1.3 → 2.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 (522) hide show
  1. package/components/affix/index.d.ts +2 -2
  2. package/components/affix/index.js +0 -5
  3. package/components/affix/index.spec.js +84 -108
  4. package/components/affix/index.vdt.js +5 -8
  5. package/components/affix/useStyle.js +8 -19
  6. package/components/badge/index.js +0 -2
  7. package/components/badge/index.vdt.js +5 -9
  8. package/components/badge/styles.js +0 -2
  9. package/components/breadcrumb/index.js +0 -4
  10. package/components/breadcrumb/index.spec.js +6 -6
  11. package/components/breadcrumb/index.vdt.js +5 -14
  12. package/components/breadcrumb/item.js +0 -8
  13. package/components/breadcrumb/item.vdt.js +3 -6
  14. package/components/breadcrumb/styles.js +0 -3
  15. package/components/button/dynamicButton.d.ts +1 -1
  16. package/components/button/dynamicButton.js +2 -5
  17. package/components/button/group.js +2 -10
  18. package/components/button/group.vdt.js +4 -7
  19. package/components/button/index.js +3 -27
  20. package/components/button/index.spec.js +74 -96
  21. package/components/button/index.vdt.js +19 -29
  22. package/components/button/styles.d.ts +2 -2
  23. package/components/button/styles.js +4 -48
  24. package/components/card/column.js +0 -2
  25. package/components/card/column.vdt.js +5 -10
  26. package/components/card/index.js +0 -4
  27. package/components/card/index.vdt.js +4 -16
  28. package/components/carousel/index.js +1 -19
  29. package/components/carousel/index.spec.js +127 -163
  30. package/components/carousel/index.vdt.js +12 -15
  31. package/components/carousel/item.js +0 -2
  32. package/components/carousel/item.vdt.js +4 -7
  33. package/components/carousel/styles.js +0 -1
  34. package/components/carousel/useAutoplay.js +0 -4
  35. package/components/carousel/useItems.js +4 -20
  36. package/components/carousel/useSlide.js +57 -89
  37. package/components/cascader/index.js +3 -18
  38. package/components/cascader/index.spec.js +365 -379
  39. package/components/cascader/index.vdt.js +14 -31
  40. package/components/cascader/styles.js +0 -6
  41. package/components/cascader/useFields.js +1 -4
  42. package/components/cascader/useFilterable.js +2 -19
  43. package/components/cascader/useLabel.js +1 -9
  44. package/components/cascader/useLoad.js +22 -35
  45. package/components/cascader/useValue.d.ts +2 -2
  46. package/components/cascader/useValue.js +6 -27
  47. package/components/checkbox/index.js +5 -27
  48. package/components/checkbox/index.spec.js +129 -171
  49. package/components/checkbox/index.vdt.js +12 -16
  50. package/components/checkbox/styles.js +0 -10
  51. package/components/code/crossDomain.js +2 -9
  52. package/components/code/index.js +0 -9
  53. package/components/code/index.spec.js +46 -55
  54. package/components/code/index.vdt.js +6 -14
  55. package/components/code/styles.js +0 -1
  56. package/components/code/useEditor.js +5 -10
  57. package/components/collapse/index.d.ts +1 -1
  58. package/components/collapse/index.js +3 -14
  59. package/components/collapse/index.spec.js +47 -60
  60. package/components/collapse/index.vdt.js +4 -12
  61. package/components/collapse/item.js +0 -10
  62. package/components/collapse/item.vdt.js +7 -14
  63. package/components/collapse/styles.js +0 -1
  64. package/components/colorpicker/drag.js +0 -5
  65. package/components/colorpicker/index.js +0 -4
  66. package/components/colorpicker/index.spec.js +211 -259
  67. package/components/colorpicker/index.vdt.js +8 -11
  68. package/components/colorpicker/panel.js +0 -5
  69. package/components/colorpicker/panel.vdt.js +21 -26
  70. package/components/colorpicker/styles.js +2 -13
  71. package/components/colorpicker/useDrag.js +22 -26
  72. package/components/colorpicker/useInput.js +0 -16
  73. package/components/colorpicker/usePointer.js +15 -18
  74. package/components/colorpicker/useValue.js +2 -7
  75. package/components/context.d.ts +2 -2
  76. package/components/context.js +2 -19
  77. package/components/datepicker/basepicker.d.ts +8 -8
  78. package/components/datepicker/basepicker.js +20 -90
  79. package/components/datepicker/calendar.js +0 -11
  80. package/components/datepicker/calendar.vdt.js +11 -14
  81. package/components/datepicker/constants.js +0 -1
  82. package/components/datepicker/dayjs.js +1 -1
  83. package/components/datepicker/helpers.js +3 -15
  84. package/components/datepicker/index.js +6 -32
  85. package/components/datepicker/index.spec.js +1141 -1448
  86. package/components/datepicker/index.vdt.js +20 -34
  87. package/components/datepicker/shortcuts.d.ts +1 -1
  88. package/components/datepicker/shortcuts.js +0 -4
  89. package/components/datepicker/styles.js +0 -8
  90. package/components/datepicker/time.d.ts +1 -1
  91. package/components/datepicker/time.js +3 -23
  92. package/components/datepicker/time.vdt.js +4 -5
  93. package/components/datepicker/useDays.js +2 -9
  94. package/components/datepicker/useDisabled.js +6 -23
  95. package/components/datepicker/useFocusDate.js +0 -2
  96. package/components/datepicker/useFormats.js +6 -15
  97. package/components/datepicker/useKeyboards.js +20 -36
  98. package/components/datepicker/useMonths.js +0 -6
  99. package/components/datepicker/usePanel.js +0 -10
  100. package/components/datepicker/useShowDate.js +10 -37
  101. package/components/datepicker/useStatus.js +3 -15
  102. package/components/datepicker/useValue.js +22 -35
  103. package/components/datepicker/useYears.js +4 -15
  104. package/components/diagram/diagram.js +17 -43
  105. package/components/diagram/diagram.vdt.js +2 -5
  106. package/components/diagram/graph.js +6 -6
  107. package/components/diagram/index.d.ts +1 -1
  108. package/components/diagram/index.js +7 -7
  109. package/components/diagram/index.spec.js +369 -495
  110. package/components/diagram/layouts/circle.js +6 -14
  111. package/components/diagram/layouts/flow.js +7 -15
  112. package/components/diagram/layouts/layout.js +6 -28
  113. package/components/diagram/layouts/organic.js +3 -11
  114. package/components/diagram/layouts/partition.js +4 -12
  115. package/components/diagram/layouts/radial.js +6 -18
  116. package/components/diagram/layouts/stack.js +6 -14
  117. package/components/diagram/layouts/tree.js +11 -21
  118. package/components/diagram/mxgraph/handler/mxConnectionHandler.js +15 -22
  119. package/components/diagram/mxgraph/handler/mxConstraintHandler.js +4 -4
  120. package/components/diagram/mxgraph/handler/mxEdgeHandler.js +11 -15
  121. package/components/diagram/mxgraph/handler/mxGraphHandler.js +6 -9
  122. package/components/diagram/mxgraph/handler/mxRubberband.js +4 -4
  123. package/components/diagram/mxgraph/handler/mxVertexHandler.js +7 -10
  124. package/components/diagram/mxgraph/index.js +0 -2
  125. package/components/diagram/mxgraph/mx.js +3 -3
  126. package/components/diagram/mxgraph/shape/mxCloud.js +2 -2
  127. package/components/diagram/mxgraph/shape/mxCylinder.js +4 -9
  128. package/components/diagram/mxgraph/shape/mxEllipse.js +2 -2
  129. package/components/diagram/mxgraph/shape/mxHexagon.js +2 -2
  130. package/components/diagram/mxgraph/shape/mxLine.js +2 -2
  131. package/components/diagram/mxgraph/shape/mxRectangleShape.js +2 -2
  132. package/components/diagram/mxgraph/shape/mxRhombus.js +6 -12
  133. package/components/diagram/mxgraph/shape/mxShape.js +0 -1
  134. package/components/diagram/mxgraph/shape/mxTriangle.js +2 -2
  135. package/components/diagram/mxgraph/util/mxConstants.js +2 -2
  136. package/components/diagram/mxgraph/util/mxGuide.js +5 -7
  137. package/components/diagram/mxgraph/view/mxCellEditor.js +16 -29
  138. package/components/diagram/mxgraph/view/mxCellRenderer.js +0 -2
  139. package/components/diagram/mxgraph/view/mxGraph.js +14 -32
  140. package/components/diagram/shapes/base.d.ts +1 -1
  141. package/components/diagram/shapes/base.js +9 -39
  142. package/components/diagram/shapes/callout.js +10 -23
  143. package/components/diagram/shapes/circle.js +3 -10
  144. package/components/diagram/shapes/document.js +5 -16
  145. package/components/diagram/shapes/ellipse.js +0 -5
  146. package/components/diagram/shapes/generateShapes.d.ts +1 -1
  147. package/components/diagram/shapes/generateShapes.js +0 -9
  148. package/components/diagram/shapes/hexagon.js +9 -26
  149. package/components/diagram/shapes/image.js +1 -9
  150. package/components/diagram/shapes/line.d.ts +2 -2
  151. package/components/diagram/shapes/line.js +13 -48
  152. package/components/diagram/shapes/parallelogram.js +9 -26
  153. package/components/diagram/shapes/rectangle.js +1 -9
  154. package/components/diagram/shapes/shape.js +6 -35
  155. package/components/diagram/shapes/square.js +3 -11
  156. package/components/diagram/shapes/text.js +0 -5
  157. package/components/diagram/styles.js +0 -1
  158. package/components/dialog/alert.vdt.js +9 -19
  159. package/components/dialog/base.js +1 -29
  160. package/components/dialog/base.vdt.js +14 -29
  161. package/components/dialog/index.js +6 -31
  162. package/components/dialog/index.spec.js +406 -554
  163. package/components/dialog/staticMethods.d.ts +1 -1
  164. package/components/dialog/staticMethods.js +2 -13
  165. package/components/dialog/styles.js +0 -11
  166. package/components/dialog/useDraggable.js +0 -6
  167. package/components/dialog/useEscClosable.js +4 -12
  168. package/components/dialog/useFixBody.d.ts +1 -1
  169. package/components/dialog/useFixBody.js +0 -11
  170. package/components/dialog/usePosition.js +0 -5
  171. package/components/drawer/index.js +0 -5
  172. package/components/drawer/index.spec.js +126 -168
  173. package/components/drawer/index.vdt.js +3 -9
  174. package/components/drawer/styles.d.ts +2 -2
  175. package/components/drawer/styles.js +0 -4
  176. package/components/dropdown/dropdown.d.ts +2 -2
  177. package/components/dropdown/dropdown.js +33 -89
  178. package/components/dropdown/index.js +2 -6
  179. package/components/dropdown/index.spec.js +388 -496
  180. package/components/dropdown/item.js +4 -25
  181. package/components/dropdown/item.vdt.js +5 -8
  182. package/components/dropdown/menu.js +14 -29
  183. package/components/dropdown/menu.vdt.js +5 -13
  184. package/components/dropdown/styles.js +0 -9
  185. package/components/dropdown/useKeyboard.d.ts +2 -2
  186. package/components/dropdown/useKeyboard.js +8 -30
  187. package/components/dropdown/usePosition.d.ts +2 -1
  188. package/components/dropdown/usePosition.js +24 -22
  189. package/components/dropdown/useTransition.js +0 -8
  190. package/components/editable/index.d.ts +1 -1
  191. package/components/editable/index.js +4 -28
  192. package/components/editable/index.spec.js +152 -189
  193. package/components/editable/index.vdt.js +8 -11
  194. package/components/editable/styles.js +0 -1
  195. package/components/form/form.js +0 -18
  196. package/components/form/form.vdt.js +4 -7
  197. package/components/form/index.spec.js +1057 -1280
  198. package/components/form/item.d.ts +1 -1
  199. package/components/form/item.js +0 -12
  200. package/components/form/item.vdt.js +17 -31
  201. package/components/form/methods.d.ts +5 -5
  202. package/components/form/methods.js +2 -12
  203. package/components/form/styles.js +0 -8
  204. package/components/form/useDirty.js +2 -7
  205. package/components/form/useError.js +2 -10
  206. package/components/form/useValidate.d.ts +1 -1
  207. package/components/form/useValidate.js +8 -24
  208. package/components/grid/col.d.ts +3 -3
  209. package/components/grid/col.js +0 -7
  210. package/components/grid/col.vdt.js +8 -13
  211. package/components/grid/constants.d.ts +6 -6
  212. package/components/grid/row.js +0 -5
  213. package/components/grid/row.vdt.js +5 -8
  214. package/components/grid/styles.js +0 -7
  215. package/components/grid/useBreakpoints.js +0 -5
  216. package/components/grid/useGutter.js +5 -25
  217. package/components/icon/index.js +0 -10
  218. package/components/icon/index.vdt.js +7 -13
  219. package/components/icon/styles.js +0 -1
  220. package/components/input/index.d.ts +3 -3
  221. package/components/input/index.js +0 -14
  222. package/components/input/index.spec.js +185 -239
  223. package/components/input/index.vdt.js +39 -49
  224. package/components/input/search.js +0 -20
  225. package/components/input/search.vdt.js +6 -9
  226. package/components/input/styles.js +0 -26
  227. package/components/input/useAutoRows.js +6 -18
  228. package/components/input/useAutoWidth.js +0 -5
  229. package/components/input/useFrozen.js +0 -6
  230. package/components/input/useShowPassword.js +2 -5
  231. package/components/layout/aside.js +5 -17
  232. package/components/layout/aside.vdt.js +5 -9
  233. package/components/layout/body.js +5 -17
  234. package/components/layout/footer.js +1 -7
  235. package/components/layout/header.js +7 -21
  236. package/components/layout/layout.js +9 -24
  237. package/components/layout/styles.js +2 -13
  238. package/components/layout/template.vdt.js +2 -4
  239. package/components/layout/useParse.js +0 -7
  240. package/components/menu/index.spec.js +189 -242
  241. package/components/menu/item.js +3 -16
  242. package/components/menu/item.vdt.js +20 -32
  243. package/components/menu/menu.js +2 -11
  244. package/components/menu/menu.vdt.js +6 -12
  245. package/components/menu/styles.js +0 -18
  246. package/components/menu/useDropdown.js +4 -9
  247. package/components/menu/useExpanded.js +0 -14
  248. package/components/menu/useHighlight.js +26 -36
  249. package/components/message/index.spec.js +58 -73
  250. package/components/message/message.js +0 -19
  251. package/components/message/message.vdt.js +5 -8
  252. package/components/message/messages.js +0 -12
  253. package/components/message/messages.vdt.js +0 -1
  254. package/components/message/styles.js +0 -9
  255. package/components/pagination/index.d.ts +1 -1
  256. package/components/pagination/index.js +10 -46
  257. package/components/pagination/index.spec.js +133 -173
  258. package/components/pagination/index.vdt.js +14 -34
  259. package/components/pagination/styles.js +0 -4
  260. package/components/portal.d.ts +1 -1
  261. package/components/portal.js +2 -29
  262. package/components/position.d.ts +12 -12
  263. package/components/position.js +32 -88
  264. package/components/progress/index.d.ts +6 -6
  265. package/components/progress/index.js +0 -12
  266. package/components/progress/index.spec.js +143 -191
  267. package/components/progress/index.vdt.js +8 -11
  268. package/components/progress/styles.js +0 -6
  269. package/components/progress/useColor.js +2 -7
  270. package/components/progress/useStatus.d.ts +1 -1
  271. package/components/progress/useStatus.js +2 -5
  272. package/components/radio/index.js +3 -18
  273. package/components/radio/index.spec.js +111 -149
  274. package/components/radio/index.vdt.js +14 -17
  275. package/components/radio/styles.js +0 -10
  276. package/components/rate/index.js +0 -7
  277. package/components/rate/index.spec.js +64 -79
  278. package/components/rate/index.vdt.js +8 -21
  279. package/components/rate/styles.js +0 -3
  280. package/components/rate/useActiveValue.js +2 -7
  281. package/components/scrollSelect/index.d.ts +2 -2
  282. package/components/scrollSelect/index.js +0 -7
  283. package/components/scrollSelect/index.spec.js +100 -131
  284. package/components/scrollSelect/index.vdt.js +6 -11
  285. package/components/scrollSelect/styles.js +0 -7
  286. package/components/scrollSelect/useList.js +3 -17
  287. package/components/scrollSelect/useMouseEvents.js +31 -49
  288. package/components/scrollSelect/useTranslate.js +1 -11
  289. package/components/select/base.js +5 -35
  290. package/components/select/base.vdt.js +23 -38
  291. package/components/select/group.js +0 -5
  292. package/components/select/group.vdt.js +4 -10
  293. package/components/select/index.spec.js +361 -452
  294. package/components/select/menu.js +0 -5
  295. package/components/select/menu.vdt.js +18 -33
  296. package/components/select/option.js +2 -16
  297. package/components/select/option.vdt.js +7 -14
  298. package/components/select/select.js +3 -20
  299. package/components/select/select.vdt.js +9 -17
  300. package/components/select/styles.js +0 -33
  301. package/components/select/useBaseLabel.d.ts +1 -1
  302. package/components/select/useBaseLabel.js +4 -17
  303. package/components/select/useCard.js +0 -4
  304. package/components/select/useEqualWidth.js +0 -1
  305. package/components/select/useFilterable.js +5 -27
  306. package/components/select/useFocusout.d.ts +1 -1
  307. package/components/select/useFocusout.js +1 -9
  308. package/components/select/useInput.js +6 -10
  309. package/components/select/useLabel.js +3 -13
  310. package/components/select/useSearchable.js +0 -10
  311. package/components/skeleton/item.d.ts +1 -1
  312. package/components/skeleton/item.js +0 -4
  313. package/components/skeleton/item.vdt.js +1 -6
  314. package/components/skeleton/skeleton.js +0 -4
  315. package/components/skeleton/skeleton.vdt.js +6 -12
  316. package/components/skeleton/style.d.ts +1 -1
  317. package/components/skeleton/style.js +0 -1
  318. package/components/slider/index.d.ts +1 -1
  319. package/components/slider/index.js +0 -7
  320. package/components/slider/index.spec.js +467 -585
  321. package/components/slider/index.vdt.js +32 -45
  322. package/components/slider/styles.js +0 -14
  323. package/components/slider/useClick.js +2 -11
  324. package/components/slider/useDraggable.js +23 -34
  325. package/components/slider/useKeyboard.js +7 -18
  326. package/components/slider/useMarks.d.ts +5 -5
  327. package/components/slider/useMarks.js +5 -13
  328. package/components/slider/usePoints.d.ts +2 -2
  329. package/components/slider/usePoints.js +7 -21
  330. package/components/slider/useStyles.d.ts +1 -1
  331. package/components/slider/useStyles.js +5 -10
  332. package/components/slider/useTooltip.js +2 -10
  333. package/components/slider/useValue.d.ts +1 -1
  334. package/components/slider/useValue.js +7 -22
  335. package/components/spin/index.js +0 -4
  336. package/components/spin/index.vdt.js +4 -11
  337. package/components/spin/styles.js +0 -2
  338. package/components/spinner/index.d.ts +4 -4
  339. package/components/spinner/index.js +9 -24
  340. package/components/spinner/index.spec.js +359 -460
  341. package/components/spinner/index.vdt.js +10 -13
  342. package/components/spinner/styles.js +0 -3
  343. package/components/spinner/useChange.js +4 -16
  344. package/components/spinner/useFormatter.js +6 -16
  345. package/components/spinner/useStep.d.ts +3 -3
  346. package/components/spinner/useStep.js +2 -20
  347. package/components/spinner/useValue.js +11 -26
  348. package/components/split/index.js +0 -7
  349. package/components/split/index.spec.js +223 -267
  350. package/components/split/index.vdt.js +8 -17
  351. package/components/split/style.d.ts +1 -1
  352. package/components/split/style.js +0 -8
  353. package/components/split/useDraggable.js +11 -35
  354. package/components/split/useSize.js +2 -5
  355. package/components/steps/context.d.ts +2 -2
  356. package/components/steps/index.js +2 -10
  357. package/components/steps/index.spec.js +21 -27
  358. package/components/steps/index.vdt.js +8 -10
  359. package/components/steps/step.js +0 -2
  360. package/components/steps/step.vdt.js +8 -12
  361. package/components/steps/styles.js +0 -27
  362. package/components/switch/index.js +2 -23
  363. package/components/switch/index.spec.js +188 -224
  364. package/components/switch/index.vdt.js +16 -32
  365. package/components/switch/styles.js +3 -14
  366. package/components/switch/useDraggable.js +10 -18
  367. package/components/table/cell.js +0 -6
  368. package/components/table/cell.vdt.js +14 -21
  369. package/components/table/column.d.ts +1 -1
  370. package/components/table/column.js +0 -5
  371. package/components/table/column.vdt.js +19 -30
  372. package/components/table/exportTable.js +45 -56
  373. package/components/table/index.spec.js +780 -984
  374. package/components/table/row.d.ts +1 -1
  375. package/components/table/row.js +12 -41
  376. package/components/table/row.vdt.js +27 -39
  377. package/components/table/styles.js +0 -11
  378. package/components/table/table.d.ts +5 -5
  379. package/components/table/table.js +18 -50
  380. package/components/table/table.vdt.js +61 -85
  381. package/components/table/useChecked.d.ts +1 -1
  382. package/components/table/useChecked.js +20 -61
  383. package/components/table/useColumns.js +3 -16
  384. package/components/table/useDisableRow.js +2 -12
  385. package/components/table/useDraggable.js +4 -12
  386. package/components/table/useExpandable.js +2 -5
  387. package/components/table/useFixedColumns.d.ts +1 -1
  388. package/components/table/useFixedColumns.js +4 -23
  389. package/components/table/useGroup.d.ts +1 -1
  390. package/components/table/useGroup.js +7 -24
  391. package/components/table/useMerge.d.ts +4 -4
  392. package/components/table/useMerge.js +2 -14
  393. package/components/table/usePagination.js +4 -18
  394. package/components/table/useResizable.js +2 -10
  395. package/components/table/useRestRowStatus.js +2 -6
  396. package/components/table/useScroll.d.ts +1 -1
  397. package/components/table/useScroll.js +0 -3
  398. package/components/table/useSelected.js +2 -5
  399. package/components/table/useSortable.js +2 -8
  400. package/components/table/useStickyHeader.js +3 -7
  401. package/components/table/useStickyScrollbar.js +6 -16
  402. package/components/table/useTree.js +1 -12
  403. package/components/table/useWidth.js +14 -30
  404. package/components/tabs/index.js +29 -51
  405. package/components/tabs/index.spec.js +56 -74
  406. package/components/tabs/index.vdt.js +13 -16
  407. package/components/tabs/styles.js +0 -16
  408. package/components/tabs/tab.js +0 -10
  409. package/components/tabs/tab.vdt.js +6 -10
  410. package/components/tabs/useActiveBar.js +2 -11
  411. package/components/tabs/useScroll.js +4 -20
  412. package/components/tag/base.js +0 -8
  413. package/components/tag/index.js +2 -4
  414. package/components/tag/index.spec.js +19 -25
  415. package/components/tag/index.vdt.js +8 -15
  416. package/components/tag/styles.js +0 -9
  417. package/components/timeline/item.js +0 -4
  418. package/components/timeline/item.vdt.js +4 -9
  419. package/components/timeline/styles.d.ts +2 -2
  420. package/components/timeline/styles.js +0 -4
  421. package/components/timeline/timeline.js +0 -2
  422. package/components/timeline/timeline.vdt.js +2 -5
  423. package/components/timepicker/index.js +2 -7
  424. package/components/timepicker/index.spec.js +293 -368
  425. package/components/timepicker/panelPicker.js +2 -11
  426. package/components/timepicker/panelPicker.vdt.js +14 -24
  427. package/components/timepicker/selectPicker.js +0 -5
  428. package/components/timepicker/selectPicker.vdt.js +5 -10
  429. package/components/timepicker/styles.js +0 -1
  430. package/components/timepicker/useDisabled.js +2 -4
  431. package/components/timepicker/useFormats.js +4 -13
  432. package/components/timepicker/useStep.d.ts +1 -1
  433. package/components/timepicker/useStep.js +8 -17
  434. package/components/timepicker/useValue.js +16 -21
  435. package/components/tip/index.js +0 -2
  436. package/components/tip/index.vdt.js +5 -17
  437. package/components/tip/styles.js +0 -3
  438. package/components/tooltip/content.js +0 -28
  439. package/components/tooltip/content.vdt.js +15 -25
  440. package/components/tooltip/index.js +3 -7
  441. package/components/tooltip/index.spec.js +434 -572
  442. package/components/tooltip/styles.d.ts +1 -1
  443. package/components/tooltip/styles.js +2 -10
  444. package/components/tooltip/tooltip.js +2 -15
  445. package/components/tooltip/useArrow.js +11 -14
  446. package/components/transfer/index.d.ts +1 -1
  447. package/components/transfer/index.js +1 -13
  448. package/components/transfer/index.spec.js +159 -194
  449. package/components/transfer/index.vdt.js +16 -34
  450. package/components/transfer/styles.js +0 -10
  451. package/components/transfer/useCheck.d.ts +1 -1
  452. package/components/transfer/useCheck.js +1 -15
  453. package/components/transfer/useFilter.d.ts +1 -1
  454. package/components/transfer/useFilter.js +9 -30
  455. package/components/transfer/useTransfer.js +10 -26
  456. package/components/tree/index.d.ts +3 -3
  457. package/components/tree/index.js +4 -22
  458. package/components/tree/index.spec.js +285 -355
  459. package/components/tree/index.vdt.js +12 -23
  460. package/components/tree/styles.js +2 -16
  461. package/components/tree/useChecked.js +3 -26
  462. package/components/tree/useDraggable.js +12 -42
  463. package/components/tree/useExpanded.js +26 -43
  464. package/components/tree/useFilter.js +3 -10
  465. package/components/tree/useNodes.d.ts +1 -1
  466. package/components/tree/useNodes.js +0 -4
  467. package/components/tree/useSelected.js +21 -38
  468. package/components/tree/useTransitionEvent.js +3 -5
  469. package/components/treeSelect/index.js +9 -36
  470. package/components/treeSelect/index.spec.js +123 -160
  471. package/components/treeSelect/index.vdt.js +14 -20
  472. package/components/treeSelect/styles.js +0 -1
  473. package/components/treeSelect/useValue.js +0 -11
  474. package/components/types.d.ts +3 -3
  475. package/components/upload/ajaxUploader.d.ts +1 -1
  476. package/components/upload/ajaxUploader.js +0 -17
  477. package/components/upload/index.d.ts +4 -4
  478. package/components/upload/index.js +0 -14
  479. package/components/upload/index.spec.js +142 -249
  480. package/components/upload/index.vdt.js +12 -27
  481. package/components/upload/styles.js +0 -30
  482. package/components/upload/useAccept.js +2 -10
  483. package/components/upload/useDrag.js +0 -7
  484. package/components/upload/useFiles.js +103 -145
  485. package/components/upload/useShowImage.js +0 -3
  486. package/components/upload/useUpload.js +47 -69
  487. package/components/utils.d.ts +3 -3
  488. package/components/utils.js +12 -47
  489. package/components/virtual.js +9 -37
  490. package/components/wave/index.js +5 -31
  491. package/hooks/useDelayClose.js +2 -6
  492. package/hooks/useDocumentClick.js +8 -16
  493. package/hooks/useDraggable.d.ts +1 -1
  494. package/hooks/useDraggable.js +0 -9
  495. package/hooks/useKeyboard.d.ts +3 -3
  496. package/hooks/useKeyboard.js +0 -10
  497. package/hooks/useMouseOutsidable.js +0 -8
  498. package/hooks/useReceive.d.ts +1 -1
  499. package/hooks/useReceive.js +0 -4
  500. package/hooks/useRecordComponent.js +0 -6
  501. package/hooks/useRouter.js +7 -18
  502. package/hooks/useShowHideEvents.js +0 -3
  503. package/hooks/useState.d.ts +2 -2
  504. package/hooks/useState.js +2 -6
  505. package/i18n/en-US.js +0 -1
  506. package/i18n/index.d.ts +1 -1
  507. package/i18n/index.js +0 -7
  508. package/index.d.ts +2 -2
  509. package/index.js +2 -3
  510. package/package.json +2 -2
  511. package/styles/global.js +2 -3
  512. package/styles/keyframes.js +0 -1
  513. package/styles/theme.d.ts +1 -1
  514. package/styles/theme.js +4 -7
  515. package/styles/utils.d.ts +1 -1
  516. package/styles/utils.js +3 -17
  517. package/yarn-error.log +633 -517
  518. package/components/cascader/index.d.ts +0 -45
  519. package/components/datepicker/index.d.ts +0 -63
  520. package/components/select/select.d.ts +0 -33
  521. package/components/timepicker/panelPicker.d.ts +0 -54
  522. package/components/treeSelect/index.d.ts +0 -27
@@ -13,16 +13,12 @@ import { useStep } from './useStep';
13
13
  import { typeDefs } from './constants';
14
14
  export var PanelPicker = /*#__PURE__*/function (_BasePicker) {
15
15
  _inheritsLoose(PanelPicker, _BasePicker);
16
-
17
16
  function PanelPicker() {
18
17
  var _context;
19
-
20
18
  var _this;
21
-
22
19
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
23
20
  args[_key] = arguments[_key];
24
21
  }
25
-
26
22
  _this = _BasePicker.call.apply(_BasePicker, _concatInstanceProperty(_context = [this]).call(_context, args)) || this;
27
23
  _this.formats = useFormats();
28
24
  _this.disabled = useDisabled(_this.formats);
@@ -31,22 +27,17 @@ export var PanelPicker = /*#__PURE__*/function (_BasePicker) {
31
27
  _this.step = useStep(_this.disabled, _this.formats);
32
28
  return _this;
33
29
  }
34
-
35
30
  var _proto = PanelPicker.prototype;
36
-
37
31
  _proto.getPlaceholder = function getPlaceholder() {
38
32
  var _this$get = this.get(),
39
- placeholder = _this$get.placeholder,
40
- range = _this$get.range;
41
-
33
+ placeholder = _this$get.placeholder,
34
+ range = _this$get.range;
42
35
  if (!isNullOrUndefined(placeholder)) return placeholder;
43
36
  return range ? _$('开始时间 ~ 结束时间') : _$('请选择时间');
44
37
  };
45
-
46
38
  _proto.getLabel = function getLabel() {
47
39
  return this.value.format();
48
40
  };
49
-
50
41
  return PanelPicker;
51
42
  }(BasePicker);
52
43
  PanelPicker.template = template;
@@ -16,22 +16,19 @@ var _$tmp1 = {
16
16
  };
17
17
  export default function ($props, $blocks, $__proto__) {
18
18
  var _classNameObj;
19
-
20
19
  $blocks || ($blocks = {});
21
20
  $props || ($props = {});
22
21
  var $this = this;
23
-
24
22
  var _this$get = this.get(),
25
- className = _this$get.className,
26
- range = _this$get.range,
27
- multiple = _this$get.multiple;
28
-
23
+ className = _this$get.className,
24
+ range = _this$get.range,
25
+ multiple = _this$get.multiple;
29
26
  var _this$value = this.value,
30
- value = _this$value.value.value,
31
- onConfirm = _this$value.onConfirm,
32
- onChangeTime = _this$value.onChangeTime,
33
- onChangeTimeByStep = _this$value.onChangeTimeByStep,
34
- getTimeValue = _this$value.getTimeValue;
27
+ value = _this$value.value.value,
28
+ onConfirm = _this$value.onConfirm,
29
+ onChangeTime = _this$value.onChangeTime,
30
+ onChangeTimeByStep = _this$value.onChangeTimeByStep,
31
+ getTimeValue = _this$value.getTimeValue;
35
32
  var lastValue = last(value);
36
33
  var classNameObj = (_classNameObj = {
37
34
  'k-time-content': true,
@@ -39,13 +36,12 @@ export default function ($props, $blocks, $__proto__) {
39
36
  }, _classNameObj[className] = className, _classNameObj[makePanelStyles()] = true, _classNameObj);
40
37
  var options = this.step.options.value;
41
38
  var _this$disabled = this.disabled,
42
- isDisabledTime = _this$disabled.isDisabledTime,
43
- isDisabledTimeByStep = _this$disabled.isDisabledTimeByStep,
44
- isDisabledConfirm = _this$disabled.isDisabledConfirm;
39
+ isDisabledTime = _this$disabled.isDisabledTime,
40
+ isDisabledTimeByStep = _this$disabled.isDisabledTimeByStep,
41
+ isDisabledConfirm = _this$disabled.isDisabledConfirm;
45
42
  var _this$formats = this.formats,
46
- getValueFormat = _this$formats.getValueFormat,
47
- getValueString = _this$formats.getValueString;
48
-
43
+ getValueFormat = _this$formats.getValueFormat,
44
+ getValueString = _this$formats.getValueString;
49
45
  var generatePanel = function generatePanel(flag) {
50
46
  var timeValue = getTimeValue(flag);
51
47
  return _$ce(2, 'div', [range ? _$ce(2, 'div', flag === PanelFlags.Start ? _$('开始时间') : _$('结束时间'), 0, 'k-timepicker-title') : undefined, !options ? _$cc(DatepickerTime, {
@@ -67,11 +63,9 @@ export default function ($props, $blocks, $__proto__) {
67
63
  }
68
64
  }), 2, 'k-datepicker-time')], 0, 'k-datepicker-calendar-wrapper');
69
65
  };
70
-
71
66
  return _$su.call($this, _$tmp0, function ($blocks) {
72
67
  var _$blocks = {},
73
- __$blocks = _$ex({}, $blocks);
74
-
68
+ __$blocks = _$ex({}, $blocks);
75
69
  return (_$blocks['base-menu'] = function ($super) {
76
70
  return _$cc(DropdownMenu, {
77
71
  'className': _$cn(classNameObj),
@@ -85,21 +79,17 @@ export default function ($props, $blocks, $__proto__) {
85
79
  });
86
80
  }, __$blocks['base-menu'] = function ($super, data) {
87
81
  var block = $blocks['base-menu'];
88
-
89
82
  var callBlock = function callBlock() {
90
83
  return _$blocks['base-menu'].call($this, $super, data);
91
84
  };
92
-
93
85
  return block ? block.call($this, callBlock, data) : callBlock();
94
86
  }), (_$blocks['suffix'] = function ($super) {
95
87
  return _$cc(Icon, _$tmp1);
96
88
  }, __$blocks['suffix'] = function ($super, data) {
97
89
  var block = $blocks['suffix'];
98
-
99
90
  var callBlock = function callBlock() {
100
91
  return _$blocks['suffix'].call($this, $super, data);
101
92
  };
102
-
103
93
  return block ? block.call($this, callBlock, data) : callBlock();
104
94
  }), __$blocks;
105
95
  }.call($this, $blocks), $__proto__);
@@ -8,23 +8,18 @@ import { useDisabled } from '../datepicker/useDisabled';
8
8
  import { useStep } from './useStep';
9
9
  export var SelectPicker = /*#__PURE__*/function (_Component) {
10
10
  _inheritsLoose(SelectPicker, _Component);
11
-
12
11
  function SelectPicker() {
13
12
  var _context;
14
-
15
13
  var _this;
16
-
17
14
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
18
15
  args[_key] = arguments[_key];
19
16
  }
20
-
21
17
  _this = _Component.call.apply(_Component, _concatInstanceProperty(_context = [this]).call(_context, args)) || this;
22
18
  _this.formats = useFormats();
23
19
  _this.disabled = useDisabled(_this.formats);
24
20
  _this.step = useStep(_this.disabled, _this.formats);
25
21
  return _this;
26
22
  }
27
-
28
23
  return SelectPicker;
29
24
  }(Component);
30
25
  SelectPicker.template = template;
@@ -12,13 +12,11 @@ export default function ($props, $blocks, $__proto__) {
12
12
  $blocks || ($blocks = {});
13
13
  $props || ($props = {});
14
14
  var $this = this;
15
-
16
15
  var _this$get = this.get(),
17
- className = _this$get.className,
18
- value = _this$get.value,
19
- placeholder = _this$get.placeholder,
20
- rest = _objectWithoutPropertiesLoose(_this$get, _excluded);
21
-
16
+ className = _this$get.className,
17
+ value = _this$get.value,
18
+ placeholder = _this$get.placeholder,
19
+ rest = _objectWithoutPropertiesLoose(_this$get, _excluded);
22
20
  var options = this.step.options.value;
23
21
  return _$cc(Select, _extends({}, rest, {
24
22
  'placeholder': placeholder || _$('请选择时间'),
@@ -32,17 +30,14 @@ export default function ($props, $blocks, $__proto__) {
32
30
  }, $this),
33
31
  '$blocks': function ($blocks) {
34
32
  var _$blocks = {},
35
- __$blocks = _$ex({}, $blocks);
36
-
33
+ __$blocks = _$ex({}, $blocks);
37
34
  return (_$blocks['suffix'] = function ($super) {
38
35
  return _$cc(Icon, _$tmp0);
39
36
  }, __$blocks['suffix'] = function ($super, data) {
40
37
  var block = $blocks['suffix'];
41
-
42
38
  var callBlock = function callBlock() {
43
39
  return _$blocks['suffix'].call($this, $super, data);
44
40
  };
45
-
46
41
  return block ? block.call($this, callBlock, data) : callBlock();
47
42
  }), __$blocks;
48
43
  }.call($this, _$em),
@@ -7,7 +7,6 @@ var defaults = {
7
7
  get border() {
8
8
  return datepicker.border;
9
9
  },
10
-
11
10
  padding: "16px",
12
11
  scrollHeight: "160px",
13
12
  // range
@@ -4,13 +4,11 @@ var _excluded = ["isDisabledTime"];
4
4
  import { useDisabled as useDisabledBase } from '../datepicker/useDisabled';
5
5
  export function useDisabled(formats) {
6
6
  var _useDisabledBase = useDisabledBase(formats),
7
- isDisabledTime = _useDisabledBase.isDisabledTime,
8
- rest = _objectWithoutPropertiesLoose(_useDisabledBase, _excluded);
9
-
7
+ isDisabledTime = _useDisabledBase.isDisabledTime,
8
+ rest = _objectWithoutPropertiesLoose(_useDisabledBase, _excluded);
10
9
  function isDisabledTimeByStep(value, flag) {
11
10
  return isDisabledTime(formats.createDateByValueFormat(value), flag);
12
11
  }
13
-
14
12
  return _extends({
15
13
  isDisabledTime: isDisabledTime,
16
14
  isDisabledTimeByStep: isDisabledTimeByStep
@@ -3,39 +3,30 @@ import dayjs from '../datepicker/dayjs';
3
3
  import { YEAR_FORMAT, TIME_FORMAT, PREFIX } from './constants';
4
4
  export function useFormats() {
5
5
  var instance = useInstance();
6
-
7
6
  function getValueFormat() {
8
7
  var _instance$get = instance.get(),
9
- format = _instance$get.format,
10
- valueFormat = _instance$get.valueFormat;
11
-
8
+ format = _instance$get.format,
9
+ valueFormat = _instance$get.valueFormat;
12
10
  return valueFormat || format || TIME_FORMAT;
13
11
  }
14
-
15
12
  function getShowFormat() {
16
13
  var _instance$get2 = instance.get(),
17
- format = _instance$get2.format,
18
- showFormat = _instance$get2.showFormat;
19
-
14
+ format = _instance$get2.format,
15
+ showFormat = _instance$get2.showFormat;
20
16
  return showFormat || format || TIME_FORMAT;
21
17
  }
22
-
23
18
  function createDateByValueFormat(value) {
24
19
  return dayjs(PREFIX + value, YEAR_FORMAT + getValueFormat());
25
20
  }
26
-
27
21
  function createDateByShowFormat(value) {
28
22
  return dayjs(PREFIX + value, YEAR_FORMAT + getShowFormat(), true); // strict parsing
29
23
  }
30
-
31
24
  function getShowString(value) {
32
25
  return value.format(getShowFormat());
33
26
  }
34
-
35
27
  function getValueString(value) {
36
28
  return value.format(getValueFormat());
37
29
  }
38
-
39
30
  return {
40
31
  getValueFormat: getValueFormat,
41
32
  getShowFormat: getShowFormat,
@@ -1,6 +1,6 @@
1
1
  import type { useDisabled } from '../datepicker/useDisabled';
2
2
  import type { useFormats } from './useFormats';
3
- declare type Option = {
3
+ type Option = {
4
4
  value: string;
5
5
  label: string;
6
6
  };
@@ -5,30 +5,26 @@ import { NOW_START, NOW_END } from './constants';
5
5
  import { useReceive } from '../../hooks/useReceive';
6
6
  export function useStep(_ref, _ref2) {
7
7
  var maxDate = _ref.maxDate,
8
- minDate = _ref.minDate;
8
+ minDate = _ref.minDate;
9
9
  var getValueString = _ref2.getValueString,
10
- getShowString = _ref2.getShowString;
10
+ getShowString = _ref2.getShowString;
11
11
  var instance = useInstance();
12
12
  var options = useState(null);
13
13
  useReceive(['step', 'min', 'max'], generateOptions);
14
-
15
14
  function generateOptions() {
16
15
  var _instance$get = instance.get(),
17
- step = _instance$get.step;
18
-
16
+ step = _instance$get.step;
19
17
  if (step) {
20
18
  var data = [];
21
19
  var maxValue = maxDate.value || NOW_END;
22
20
  var stepValue = parseTime(step);
23
21
  var value = minDate.value || NOW_START;
24
-
25
22
  var push = function push(value) {
26
23
  data.push({
27
24
  value: getValueString(value),
28
25
  label: getShowString(value)
29
26
  });
30
27
  };
31
-
32
28
  for (;; value = value.add(stepValue, 'second')) {
33
29
  if (value <= maxValue) {
34
30
  push(value);
@@ -42,26 +38,21 @@ export function useStep(_ref, _ref2) {
42
38
  break;
43
39
  }
44
40
  }
45
-
46
41
  options.set(data);
47
42
  } else {
48
43
  options.set(null);
49
44
  }
50
45
  }
51
-
52
46
  function parseTime(time) {
53
47
  var _context;
54
-
55
48
  var _time$split$map = _mapInstanceProperty(_context = time.split(':')).call(_context, function (item) {
56
- return parseInt(item, 10);
57
- }),
58
- hours = _time$split$map[0],
59
- minutes = _time$split$map[1],
60
- seconds = _time$split$map[2];
61
-
49
+ return parseInt(item, 10);
50
+ }),
51
+ hours = _time$split$map[0],
52
+ minutes = _time$split$map[1],
53
+ seconds = _time$split$map[2];
62
54
  return (hours * 60 + (minutes || 0)) * 60 + (seconds || 0);
63
55
  }
64
-
65
56
  return {
66
57
  options: options
67
58
  };
@@ -8,40 +8,35 @@ import { useValue as useValueBase } from '../datepicker/basepicker';
8
8
  import { NOW_START, NOW_END } from './constants';
9
9
  export function useValue(formats, disabled, panel) {
10
10
  var instance = useInstance();
11
-
12
11
  var _useValueBase = useValueBase(formats, disabled, panel, function (v) {
13
- return false;
14
- }, function (v) {
15
- // pop the last value when input
16
- // because it is a placeholder date
17
- value.value.pop();
18
- setValue(v, true);
19
- }, function () {
20
- return 'second';
21
- }, function (dayjsValue, value) {
22
- value.set(_sliceInstanceProperty(dayjsValue).call(dayjsValue, 0));
23
- }),
24
- value = _useValueBase.value,
25
- getDayjsValue = _useValueBase.getDayjsValue,
26
- setValue = _useValueBase.setValue,
27
- onChangeTime = _useValueBase.onChangeTime,
28
- rest = _objectWithoutPropertiesLoose(_useValueBase, _excluded);
29
-
12
+ return false;
13
+ }, function (v) {
14
+ // pop the last value when input
15
+ // because it is a placeholder date
16
+ value.value.pop();
17
+ setValue(v, true);
18
+ }, function () {
19
+ return 'second';
20
+ }, function (dayjsValue, value) {
21
+ value.set(_sliceInstanceProperty(dayjsValue).call(dayjsValue, 0));
22
+ }),
23
+ value = _useValueBase.value,
24
+ getDayjsValue = _useValueBase.getDayjsValue,
25
+ setValue = _useValueBase.setValue,
26
+ onChangeTime = _useValueBase.onChangeTime,
27
+ rest = _objectWithoutPropertiesLoose(_useValueBase, _excluded);
30
28
  setValue(getPlaceholderDates(), false);
31
29
  instance.watch('value', function (value) {
32
30
  var dayjsValue = getDayjsValue();
33
31
  setValue(last(dayjsValue) || getPlaceholderDates(), false);
34
32
  });
35
-
36
33
  function getPlaceholderDates() {
37
34
  return instance.get('range') ? [NOW_START, NOW_END] : NOW_START;
38
35
  }
39
-
40
36
  function onChangeTimeByStep(v, flag) {
41
37
  var date = formats.createDateByValueFormat(v);
42
38
  onChangeTime(date, flag);
43
39
  }
44
-
45
40
  return _extends({
46
41
  value: value,
47
42
  setValue: setValue,
@@ -3,11 +3,9 @@ import template from './index.vdt';
3
3
  import { Tag } from '../tag/base';
4
4
  export var Tip = /*#__PURE__*/function (_Tag) {
5
5
  _inheritsLoose(Tip, _Tag);
6
-
7
6
  function Tip() {
8
7
  return _Tag.apply(this, arguments) || this;
9
8
  }
10
-
11
9
  return Tip;
12
10
  }(Tag);
13
11
  Tip.template = template;
@@ -4,19 +4,16 @@ import { Icon } from '../icon';
4
4
  import { makeStyles } from './styles';
5
5
  export default function ($props, $blocks, $__proto__) {
6
6
  var _classNameObj;
7
-
8
7
  $blocks || ($blocks = {});
9
8
  $props || ($props = {});
10
9
  var $this = this;
11
10
  var _$blocks = {};
12
11
  var __$blocks = {};
13
-
14
12
  var _this$get = this.get(),
15
- children = _this$get.children,
16
- closable = _this$get.closable,
17
- type = _this$get.type,
18
- disabled = _this$get.disabled;
19
-
13
+ children = _this$get.children,
14
+ closable = _this$get.closable,
15
+ type = _this$get.type,
16
+ disabled = _this$get.disabled;
20
17
  var classNameObj = (_classNameObj = {
21
18
  'k-tip': true
22
19
  }, _classNameObj[makeStyles()] = true, _classNameObj);
@@ -25,27 +22,22 @@ export default function ($props, $blocks, $__proto__) {
25
22
  'name': 'k-fade'
26
23
  }, function ($blocks) {
27
24
  var _$blocks = {},
28
- __$blocks = _$ex({}, $blocks);
29
-
25
+ __$blocks = _$ex({}, $blocks);
30
26
  return (_$blocks['body'] = function ($super) {
31
27
  return _$ce(2, 'div', [$blocks.title ? _$ce(2, 'div', (_$blocks['title'] = function ($super) {
32
28
  return null;
33
29
  }, __$blocks['title'] = function ($super, data) {
34
30
  var block = $blocks['title'];
35
-
36
31
  var callBlock = function callBlock() {
37
32
  return _$blocks['title'].call($this, $super, data);
38
33
  };
39
-
40
34
  return block ? block.call($this, callBlock, data) : callBlock();
41
35
  }, __$blocks['title'](_$no)), 0, 'k-tip-title') : undefined, children], 0, 'k-tip-wrapper');
42
36
  }, __$blocks['body'] = function ($super, data) {
43
37
  var block = $blocks['body'];
44
-
45
38
  var callBlock = function callBlock() {
46
39
  return _$blocks['body'].call($this, $super, data);
47
40
  };
48
-
49
41
  return block ? block.call($this, callBlock, data) : callBlock();
50
42
  }), (_$blocks['_close'] = function ($super) {
51
43
  return closable ? _$cc(Button, {
@@ -62,21 +54,17 @@ export default function ($props, $blocks, $__proto__) {
62
54
  });
63
55
  }, __$blocks['close'] = function ($super, data) {
64
56
  var block = $blocks['close'];
65
-
66
57
  var callBlock = function callBlock() {
67
58
  return _$blocks['close'].call($this, $super, data);
68
59
  };
69
-
70
60
  return block ? block.call($this, callBlock, data) : callBlock();
71
61
  }, __$blocks['close'](_$no))
72
62
  }) : undefined;
73
63
  }, __$blocks['_close'] = function ($super, data) {
74
64
  var block = $blocks['_close'];
75
-
76
65
  var callBlock = function callBlock() {
77
66
  return _$blocks['_close'].call($this, $super, data);
78
67
  };
79
-
80
68
  return block ? block.call($this, callBlock, data) : callBlock();
81
69
  }), __$blocks;
82
70
  }.call($this, $blocks), $__proto__);
@@ -7,15 +7,12 @@ var defaults = {
7
7
  fontSize: '14px',
8
8
  gap: '8px'
9
9
  },
10
-
11
10
  get color() {
12
11
  return theme.color.text;
13
12
  },
14
-
15
13
  get padding() {
16
14
  return "6px " + theme.default.padding;
17
15
  }
18
-
19
16
  };
20
17
  var tip;
21
18
  setDefault(function () {
@@ -8,102 +8,74 @@ import { useArrow } from './useArrow';
8
8
  import { tooltip as tooltipTheme } from './styles';
9
9
  export var TooltipContent = /*#__PURE__*/function (_DropdownMenu) {
10
10
  _inheritsLoose(TooltipContent, _DropdownMenu);
11
-
12
11
  function TooltipContent() {
13
12
  var _context;
14
-
15
13
  var _this;
16
-
17
14
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
18
15
  args[_key] = arguments[_key];
19
16
  }
20
-
21
17
  _this = _DropdownMenu.call.apply(_DropdownMenu, _concatInstanceProperty(_context = [this]).call(_context, args)) || this;
22
18
  _this.isEmptyChildren = true;
23
19
  _this.arrow = useArrow();
24
20
  return _this;
25
21
  }
26
-
27
22
  var _proto = TooltipContent.prototype;
28
-
29
23
  _proto.init = function init() {
30
24
  var _this2 = this;
31
-
32
25
  _DropdownMenu.prototype.init.call(this);
33
-
34
26
  this.on('$receive:children', function (vNodes) {
35
27
  _this2.isEmptyChildren = isEmptyChildren(vNodes);
36
28
  });
37
29
  };
38
-
39
30
  _proto.onEnter = function onEnter(elem) {
40
31
  // fix the width, https://github.com/ksc-fe/kpc/issues/873
41
32
  var maxWidth = parseInt(tooltipTheme.maxWidth);
42
33
  var width = elem.offsetWidth;
43
-
44
34
  if (width === maxWidth) {
45
35
  elem.style.width = width + "px";
46
36
  }
47
-
48
37
  this.dropdown.position();
49
38
  };
50
-
51
39
  _proto.onAfterLeave = function onAfterLeave(elem) {
52
40
  // remove the position after leave, https://github.com/ksc-fe/kpc/issues/873
53
41
  var style = elem.style;
54
42
  style.left = style.top = style.width = '';
55
43
  };
56
-
57
44
  _proto.onMouseEnter = function onMouseEnter(e) {
58
45
  var dropdown = this.dropdown;
59
-
60
46
  if (dropdown.get('hoverable')) {
61
47
  dropdown.show();
62
48
  }
63
-
64
49
  dropdown.trigger('mouseenter', e);
65
50
  };
66
-
67
51
  _proto.ok = function ok() {
68
52
  var dropdown = this.dropdown;
69
53
  dropdown.hide(true);
70
54
  dropdown.trigger('ok');
71
55
  };
72
-
73
56
  _proto.cancel = function cancel() {
74
57
  var dropdown = this.dropdown;
75
58
  dropdown.hide(true);
76
59
  dropdown.trigger('cancel');
77
60
  };
78
-
79
61
  return TooltipContent;
80
62
  }(DropdownMenu);
81
63
  TooltipContent.template = template;
82
-
83
64
  __decorate([bind], TooltipContent.prototype, "onEnter", null);
84
-
85
65
  __decorate([bind], TooltipContent.prototype, "onAfterLeave", null);
86
-
87
66
  __decorate([bind], TooltipContent.prototype, "onMouseEnter", null);
88
-
89
67
  __decorate([bind], TooltipContent.prototype, "ok", null);
90
-
91
68
  __decorate([bind], TooltipContent.prototype, "cancel", null);
92
-
93
69
  function isEmptyChildren(vNodes) {
94
70
  if (!vNodes) return true;
95
-
96
71
  if (Array.isArray(vNodes)) {
97
72
  return vNodes.every(function (vNode) {
98
73
  return isEmptyChildren(vNode);
99
74
  });
100
75
  }
101
-
102
76
  if (vNodes.type === 1) {
103
77
  return !vNodes.children;
104
78
  }
105
-
106
79
  return false;
107
80
  }
108
-
109
81
  ;
@@ -3,32 +3,28 @@ import { Button } from '../button';
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$dropdown$get = this.dropdown.get(),
14
- showArrow = _this$dropdown$get.showArrow,
15
- confirm = _this$dropdown$get.confirm,
16
- className = _this$dropdown$get.className,
17
- theme = _this$dropdown$get.theme,
18
- hoverable = _this$dropdown$get.hoverable,
19
- trigger = _this$dropdown$get.trigger,
20
- value = _this$dropdown$get.value,
21
- cancelText = _this$dropdown$get.cancelText,
22
- okText = _this$dropdown$get.okText,
23
- size = _this$dropdown$get.size,
24
- always = _this$dropdown$get.always;
25
-
12
+ showArrow = _this$dropdown$get.showArrow,
13
+ confirm = _this$dropdown$get.confirm,
14
+ className = _this$dropdown$get.className,
15
+ theme = _this$dropdown$get.theme,
16
+ hoverable = _this$dropdown$get.hoverable,
17
+ trigger = _this$dropdown$get.trigger,
18
+ value = _this$dropdown$get.value,
19
+ cancelText = _this$dropdown$get.cancelText,
20
+ okText = _this$dropdown$get.okText,
21
+ size = _this$dropdown$get.size,
22
+ always = _this$dropdown$get.always;
26
23
  var _this$get = this.get(),
27
- children = _this$get.children;
28
-
24
+ children = _this$get.children;
29
25
  var _this$arrow = this.arrow,
30
- arrowRef = _this$arrow.arrowRef,
31
- arrowType = _this$arrow.arrowType;
26
+ arrowRef = _this$arrow.arrowRef,
27
+ arrowType = _this$arrow.arrowType;
32
28
  var classNameObj = (_classNameObj = {
33
29
  'k-tooltip-content': true,
34
30
  'k-hoverable': hoverable || trigger === 'click',
@@ -45,11 +41,9 @@ export default function ($props, $blocks, $__proto__) {
45
41
  'className': _$cn(classNameObj)
46
42
  }, function ($blocks) {
47
43
  var _$blocks = {},
48
- __$blocks = _$ex({}, $blocks);
49
-
44
+ __$blocks = _$ex({}, $blocks);
50
45
  return (_$blocks['children'] = function ($super) {
51
46
  var _$cn2;
52
-
53
47
  return [children, showArrow ? _$ce(2, 'i', null, 1, _$cn((_$cn2 = {
54
48
  "k-tooltip-arrow": true
55
49
  }, _$cn2["k-" + arrowType.value] = arrowType.value, _$cn2)), null, 'tooltip-arrow', arrowRef) : undefined, confirm ? _$ce(2, 'div', (_$blocks['buttons'] = function ($super) {
@@ -65,20 +59,16 @@ export default function ($props, $blocks, $__proto__) {
65
59
  })];
66
60
  }, __$blocks['buttons'] = function ($super, data) {
67
61
  var block = $blocks['buttons'];
68
-
69
62
  var callBlock = function callBlock() {
70
63
  return _$blocks['buttons'].call($this, $super, data);
71
64
  };
72
-
73
65
  return block ? block.call($this, callBlock, data) : callBlock();
74
66
  }, __$blocks['buttons'](_$no)), 0, 'k-tooltip-buttons', null, 'tooltip-buttons') : undefined];
75
67
  }, __$blocks['children'] = function ($super, data) {
76
68
  var block = $blocks['children'];
77
-
78
69
  var callBlock = function callBlock() {
79
70
  return _$blocks['children'].call($this, $super, data);
80
71
  };
81
-
82
72
  return block ? block.call($this, callBlock, data) : callBlock();
83
73
  }), __$blocks;
84
74
  }.call($this, $blocks), $__proto__);