@king-design/vue 2.1.4 → 2.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (521) hide show
  1. package/components/affix/index.d.ts +2 -2
  2. package/components/affix/index.js +5 -0
  3. package/components/affix/index.spec.js +108 -84
  4. package/components/affix/index.vdt.js +8 -5
  5. package/components/affix/useStyle.js +19 -8
  6. package/components/badge/index.js +2 -0
  7. package/components/badge/index.vdt.js +9 -5
  8. package/components/badge/styles.js +2 -0
  9. package/components/breadcrumb/index.js +4 -0
  10. package/components/breadcrumb/index.spec.js +6 -6
  11. package/components/breadcrumb/index.vdt.js +14 -5
  12. package/components/breadcrumb/item.js +8 -0
  13. package/components/breadcrumb/item.vdt.js +6 -3
  14. package/components/breadcrumb/styles.js +3 -0
  15. package/components/button/dynamicButton.d.ts +1 -1
  16. package/components/button/dynamicButton.js +5 -2
  17. package/components/button/group.js +10 -2
  18. package/components/button/group.vdt.js +7 -4
  19. package/components/button/index.js +27 -3
  20. package/components/button/index.spec.js +96 -74
  21. package/components/button/index.vdt.js +29 -19
  22. package/components/button/styles.d.ts +2 -2
  23. package/components/button/styles.js +48 -4
  24. package/components/card/column.js +2 -0
  25. package/components/card/column.vdt.js +10 -5
  26. package/components/card/index.js +4 -0
  27. package/components/card/index.vdt.js +16 -4
  28. package/components/carousel/index.js +19 -1
  29. package/components/carousel/index.spec.js +163 -127
  30. package/components/carousel/index.vdt.js +15 -12
  31. package/components/carousel/item.js +2 -0
  32. package/components/carousel/item.vdt.js +7 -4
  33. package/components/carousel/styles.js +1 -0
  34. package/components/carousel/useAutoplay.js +4 -0
  35. package/components/carousel/useItems.js +20 -4
  36. package/components/carousel/useSlide.js +89 -57
  37. package/components/cascader/index.d.ts +45 -0
  38. package/components/cascader/index.js +18 -3
  39. package/components/cascader/index.spec.js +445 -354
  40. package/components/cascader/index.vdt.js +31 -14
  41. package/components/cascader/styles.js +6 -0
  42. package/components/cascader/useFields.js +4 -1
  43. package/components/cascader/useFilterable.js +19 -2
  44. package/components/cascader/useLabel.js +9 -1
  45. package/components/cascader/useLoad.js +35 -22
  46. package/components/cascader/useValue.d.ts +2 -2
  47. package/components/cascader/useValue.js +26 -5
  48. package/components/checkbox/index.js +27 -5
  49. package/components/checkbox/index.spec.js +171 -129
  50. package/components/checkbox/index.vdt.js +16 -12
  51. package/components/checkbox/styles.js +10 -0
  52. package/components/code/crossDomain.js +9 -2
  53. package/components/code/index.js +9 -0
  54. package/components/code/index.spec.js +55 -46
  55. package/components/code/index.vdt.js +14 -6
  56. package/components/code/styles.js +1 -0
  57. package/components/code/useEditor.js +10 -5
  58. package/components/collapse/index.d.ts +1 -1
  59. package/components/collapse/index.js +14 -3
  60. package/components/collapse/index.spec.js +60 -47
  61. package/components/collapse/index.vdt.js +12 -4
  62. package/components/collapse/item.js +10 -0
  63. package/components/collapse/item.vdt.js +14 -7
  64. package/components/collapse/styles.js +1 -0
  65. package/components/colorpicker/drag.js +5 -0
  66. package/components/colorpicker/index.js +4 -0
  67. package/components/colorpicker/index.spec.js +259 -211
  68. package/components/colorpicker/index.vdt.js +11 -8
  69. package/components/colorpicker/panel.js +5 -0
  70. package/components/colorpicker/panel.vdt.js +26 -21
  71. package/components/colorpicker/styles.js +13 -2
  72. package/components/colorpicker/useDrag.js +26 -22
  73. package/components/colorpicker/useInput.js +16 -0
  74. package/components/colorpicker/usePointer.js +18 -15
  75. package/components/colorpicker/useValue.js +7 -2
  76. package/components/context.d.ts +2 -2
  77. package/components/context.js +19 -2
  78. package/components/datepicker/basepicker.d.ts +8 -8
  79. package/components/datepicker/basepicker.js +90 -20
  80. package/components/datepicker/calendar.js +11 -0
  81. package/components/datepicker/calendar.vdt.js +14 -11
  82. package/components/datepicker/constants.js +1 -0
  83. package/components/datepicker/dayjs.js +1 -1
  84. package/components/datepicker/helpers.js +15 -3
  85. package/components/datepicker/index.d.ts +63 -0
  86. package/components/datepicker/index.js +32 -6
  87. package/components/datepicker/index.spec.js +1448 -1141
  88. package/components/datepicker/index.vdt.js +34 -20
  89. package/components/datepicker/shortcuts.d.ts +1 -1
  90. package/components/datepicker/shortcuts.js +4 -0
  91. package/components/datepicker/styles.js +8 -0
  92. package/components/datepicker/time.d.ts +1 -1
  93. package/components/datepicker/time.js +23 -3
  94. package/components/datepicker/time.vdt.js +5 -4
  95. package/components/datepicker/useDays.js +9 -2
  96. package/components/datepicker/useDisabled.js +23 -6
  97. package/components/datepicker/useFocusDate.js +2 -0
  98. package/components/datepicker/useFormats.js +15 -6
  99. package/components/datepicker/useKeyboards.js +36 -20
  100. package/components/datepicker/useMonths.js +6 -0
  101. package/components/datepicker/usePanel.js +10 -0
  102. package/components/datepicker/useShowDate.js +37 -10
  103. package/components/datepicker/useStatus.js +15 -3
  104. package/components/datepicker/useValue.js +35 -22
  105. package/components/datepicker/useYears.js +15 -4
  106. package/components/diagram/diagram.js +43 -17
  107. package/components/diagram/diagram.vdt.js +5 -2
  108. package/components/diagram/graph.js +6 -6
  109. package/components/diagram/index.d.ts +1 -1
  110. package/components/diagram/index.js +7 -7
  111. package/components/diagram/index.spec.js +495 -369
  112. package/components/diagram/layouts/circle.js +14 -6
  113. package/components/diagram/layouts/flow.js +15 -7
  114. package/components/diagram/layouts/layout.js +28 -6
  115. package/components/diagram/layouts/organic.js +11 -3
  116. package/components/diagram/layouts/partition.js +12 -4
  117. package/components/diagram/layouts/radial.js +18 -6
  118. package/components/diagram/layouts/stack.js +14 -6
  119. package/components/diagram/layouts/tree.js +21 -11
  120. package/components/diagram/mxgraph/handler/mxConnectionHandler.js +22 -15
  121. package/components/diagram/mxgraph/handler/mxConstraintHandler.js +4 -4
  122. package/components/diagram/mxgraph/handler/mxEdgeHandler.js +15 -11
  123. package/components/diagram/mxgraph/handler/mxGraphHandler.js +9 -6
  124. package/components/diagram/mxgraph/handler/mxRubberband.js +4 -4
  125. package/components/diagram/mxgraph/handler/mxVertexHandler.js +10 -7
  126. package/components/diagram/mxgraph/index.js +2 -0
  127. package/components/diagram/mxgraph/mx.js +3 -3
  128. package/components/diagram/mxgraph/shape/mxCloud.js +2 -2
  129. package/components/diagram/mxgraph/shape/mxCylinder.js +9 -4
  130. package/components/diagram/mxgraph/shape/mxEllipse.js +2 -2
  131. package/components/diagram/mxgraph/shape/mxHexagon.js +2 -2
  132. package/components/diagram/mxgraph/shape/mxLine.js +2 -2
  133. package/components/diagram/mxgraph/shape/mxRectangleShape.js +2 -2
  134. package/components/diagram/mxgraph/shape/mxRhombus.js +12 -6
  135. package/components/diagram/mxgraph/shape/mxShape.js +1 -0
  136. package/components/diagram/mxgraph/shape/mxTriangle.js +2 -2
  137. package/components/diagram/mxgraph/util/mxConstants.js +2 -2
  138. package/components/diagram/mxgraph/util/mxGuide.js +7 -5
  139. package/components/diagram/mxgraph/view/mxCellEditor.js +29 -16
  140. package/components/diagram/mxgraph/view/mxCellRenderer.js +2 -0
  141. package/components/diagram/mxgraph/view/mxGraph.js +32 -14
  142. package/components/diagram/shapes/base.d.ts +1 -1
  143. package/components/diagram/shapes/base.js +39 -9
  144. package/components/diagram/shapes/callout.js +23 -10
  145. package/components/diagram/shapes/circle.js +10 -3
  146. package/components/diagram/shapes/document.js +16 -5
  147. package/components/diagram/shapes/ellipse.js +5 -0
  148. package/components/diagram/shapes/generateShapes.d.ts +1 -1
  149. package/components/diagram/shapes/generateShapes.js +9 -0
  150. package/components/diagram/shapes/hexagon.js +26 -9
  151. package/components/diagram/shapes/image.js +9 -1
  152. package/components/diagram/shapes/line.d.ts +2 -2
  153. package/components/diagram/shapes/line.js +48 -13
  154. package/components/diagram/shapes/parallelogram.js +26 -9
  155. package/components/diagram/shapes/rectangle.js +9 -1
  156. package/components/diagram/shapes/shape.js +35 -6
  157. package/components/diagram/shapes/square.js +11 -3
  158. package/components/diagram/shapes/text.js +5 -0
  159. package/components/diagram/styles.js +1 -0
  160. package/components/dialog/alert.vdt.js +19 -9
  161. package/components/dialog/base.js +29 -1
  162. package/components/dialog/base.vdt.js +29 -14
  163. package/components/dialog/index.js +31 -6
  164. package/components/dialog/index.spec.js +554 -406
  165. package/components/dialog/staticMethods.d.ts +1 -1
  166. package/components/dialog/staticMethods.js +13 -2
  167. package/components/dialog/styles.js +11 -0
  168. package/components/dialog/useDraggable.js +6 -0
  169. package/components/dialog/useEscClosable.js +12 -4
  170. package/components/dialog/useFixBody.d.ts +1 -1
  171. package/components/dialog/useFixBody.js +11 -0
  172. package/components/dialog/usePosition.js +5 -0
  173. package/components/drawer/index.js +5 -0
  174. package/components/drawer/index.spec.js +168 -126
  175. package/components/drawer/index.vdt.js +9 -3
  176. package/components/drawer/styles.d.ts +2 -2
  177. package/components/drawer/styles.js +4 -0
  178. package/components/dropdown/dropdown.d.ts +2 -2
  179. package/components/dropdown/dropdown.js +89 -33
  180. package/components/dropdown/index.js +6 -2
  181. package/components/dropdown/index.spec.js +496 -388
  182. package/components/dropdown/item.js +25 -4
  183. package/components/dropdown/item.vdt.js +8 -5
  184. package/components/dropdown/menu.js +29 -12
  185. package/components/dropdown/menu.vdt.js +13 -5
  186. package/components/dropdown/styles.js +9 -0
  187. package/components/dropdown/useKeyboard.d.ts +2 -2
  188. package/components/dropdown/useKeyboard.js +30 -8
  189. package/components/dropdown/usePosition.d.ts +1 -1
  190. package/components/dropdown/usePosition.js +22 -12
  191. package/components/dropdown/useTransition.js +8 -0
  192. package/components/editable/index.d.ts +1 -1
  193. package/components/editable/index.js +28 -4
  194. package/components/editable/index.spec.js +189 -152
  195. package/components/editable/index.vdt.js +11 -8
  196. package/components/editable/styles.js +1 -0
  197. package/components/form/form.js +18 -0
  198. package/components/form/form.vdt.js +7 -4
  199. package/components/form/index.spec.js +1280 -1057
  200. package/components/form/item.d.ts +1 -1
  201. package/components/form/item.js +12 -0
  202. package/components/form/item.vdt.js +31 -17
  203. package/components/form/methods.d.ts +5 -5
  204. package/components/form/methods.js +12 -2
  205. package/components/form/styles.js +8 -0
  206. package/components/form/useDirty.js +7 -2
  207. package/components/form/useError.js +10 -2
  208. package/components/form/useValidate.d.ts +1 -1
  209. package/components/form/useValidate.js +24 -8
  210. package/components/grid/col.d.ts +3 -3
  211. package/components/grid/col.js +7 -0
  212. package/components/grid/col.vdt.js +13 -8
  213. package/components/grid/constants.d.ts +6 -6
  214. package/components/grid/row.js +5 -0
  215. package/components/grid/row.vdt.js +8 -5
  216. package/components/grid/styles.js +7 -0
  217. package/components/grid/useBreakpoints.js +5 -0
  218. package/components/grid/useGutter.js +25 -5
  219. package/components/icon/index.js +10 -0
  220. package/components/icon/index.vdt.js +13 -7
  221. package/components/icon/styles.js +1 -0
  222. package/components/input/index.d.ts +3 -3
  223. package/components/input/index.js +14 -0
  224. package/components/input/index.spec.js +239 -185
  225. package/components/input/index.vdt.js +49 -39
  226. package/components/input/search.js +20 -0
  227. package/components/input/search.vdt.js +9 -6
  228. package/components/input/styles.js +26 -0
  229. package/components/input/useAutoRows.js +18 -6
  230. package/components/input/useAutoWidth.js +5 -0
  231. package/components/input/useFrozen.js +6 -0
  232. package/components/input/useShowPassword.js +5 -2
  233. package/components/layout/aside.js +17 -5
  234. package/components/layout/aside.vdt.js +9 -5
  235. package/components/layout/body.js +17 -5
  236. package/components/layout/footer.js +7 -1
  237. package/components/layout/header.js +21 -7
  238. package/components/layout/layout.js +24 -9
  239. package/components/layout/styles.js +13 -2
  240. package/components/layout/template.vdt.js +4 -2
  241. package/components/layout/useParse.js +7 -0
  242. package/components/menu/index.spec.js +242 -189
  243. package/components/menu/item.js +16 -3
  244. package/components/menu/item.vdt.js +32 -20
  245. package/components/menu/menu.js +11 -2
  246. package/components/menu/menu.vdt.js +12 -6
  247. package/components/menu/styles.js +18 -0
  248. package/components/menu/useDropdown.js +9 -4
  249. package/components/menu/useExpanded.js +14 -0
  250. package/components/menu/useHighlight.js +36 -26
  251. package/components/message/index.spec.js +73 -58
  252. package/components/message/message.js +19 -0
  253. package/components/message/message.vdt.js +8 -5
  254. package/components/message/messages.js +12 -0
  255. package/components/message/messages.vdt.js +1 -0
  256. package/components/message/styles.js +9 -0
  257. package/components/pagination/index.d.ts +1 -1
  258. package/components/pagination/index.js +46 -10
  259. package/components/pagination/index.spec.js +173 -133
  260. package/components/pagination/index.vdt.js +34 -14
  261. package/components/pagination/styles.js +4 -0
  262. package/components/portal.d.ts +1 -1
  263. package/components/portal.js +29 -2
  264. package/components/position.d.ts +12 -12
  265. package/components/position.js +88 -32
  266. package/components/progress/index.d.ts +6 -6
  267. package/components/progress/index.js +12 -0
  268. package/components/progress/index.spec.js +191 -143
  269. package/components/progress/index.vdt.js +11 -8
  270. package/components/progress/styles.js +6 -0
  271. package/components/progress/useColor.js +7 -2
  272. package/components/progress/useStatus.d.ts +1 -1
  273. package/components/progress/useStatus.js +5 -2
  274. package/components/radio/index.js +18 -3
  275. package/components/radio/index.spec.js +149 -111
  276. package/components/radio/index.vdt.js +17 -14
  277. package/components/radio/styles.js +10 -0
  278. package/components/rate/index.js +7 -0
  279. package/components/rate/index.spec.js +79 -64
  280. package/components/rate/index.vdt.js +21 -8
  281. package/components/rate/styles.js +3 -0
  282. package/components/rate/useActiveValue.js +7 -2
  283. package/components/scrollSelect/index.d.ts +2 -2
  284. package/components/scrollSelect/index.js +7 -0
  285. package/components/scrollSelect/index.spec.js +131 -100
  286. package/components/scrollSelect/index.vdt.js +11 -6
  287. package/components/scrollSelect/styles.js +7 -0
  288. package/components/scrollSelect/useList.js +17 -3
  289. package/components/scrollSelect/useMouseEvents.js +49 -31
  290. package/components/scrollSelect/useTranslate.js +11 -1
  291. package/components/select/base.js +35 -5
  292. package/components/select/base.vdt.js +38 -23
  293. package/components/select/group.js +5 -0
  294. package/components/select/group.vdt.js +10 -4
  295. package/components/select/index.spec.js +452 -361
  296. package/components/select/menu.js +5 -0
  297. package/components/select/menu.vdt.js +33 -18
  298. package/components/select/option.js +16 -2
  299. package/components/select/option.vdt.js +14 -7
  300. package/components/select/select.d.ts +33 -0
  301. package/components/select/select.js +20 -3
  302. package/components/select/select.vdt.js +17 -9
  303. package/components/select/styles.js +33 -0
  304. package/components/select/useBaseLabel.d.ts +1 -1
  305. package/components/select/useBaseLabel.js +17 -4
  306. package/components/select/useCard.js +4 -0
  307. package/components/select/useEqualWidth.js +1 -0
  308. package/components/select/useFilterable.js +27 -5
  309. package/components/select/useFocusout.js +8 -0
  310. package/components/select/useInput.js +10 -6
  311. package/components/select/useLabel.js +13 -3
  312. package/components/select/useSearchable.js +10 -0
  313. package/components/skeleton/item.d.ts +1 -1
  314. package/components/skeleton/item.js +4 -0
  315. package/components/skeleton/item.vdt.js +6 -1
  316. package/components/skeleton/skeleton.js +4 -0
  317. package/components/skeleton/skeleton.vdt.js +12 -6
  318. package/components/skeleton/style.d.ts +1 -1
  319. package/components/skeleton/style.js +1 -0
  320. package/components/slider/index.d.ts +1 -1
  321. package/components/slider/index.js +7 -0
  322. package/components/slider/index.spec.js +585 -467
  323. package/components/slider/index.vdt.js +45 -32
  324. package/components/slider/styles.js +14 -0
  325. package/components/slider/useClick.js +11 -2
  326. package/components/slider/useDraggable.js +34 -23
  327. package/components/slider/useKeyboard.js +18 -7
  328. package/components/slider/useMarks.d.ts +5 -5
  329. package/components/slider/useMarks.js +13 -5
  330. package/components/slider/usePoints.d.ts +2 -2
  331. package/components/slider/usePoints.js +21 -7
  332. package/components/slider/useStyles.d.ts +1 -1
  333. package/components/slider/useStyles.js +10 -5
  334. package/components/slider/useTooltip.js +10 -2
  335. package/components/slider/useValue.d.ts +1 -1
  336. package/components/slider/useValue.js +22 -7
  337. package/components/spin/index.js +4 -0
  338. package/components/spin/index.vdt.js +11 -4
  339. package/components/spin/styles.js +2 -0
  340. package/components/spinner/index.d.ts +4 -4
  341. package/components/spinner/index.js +24 -9
  342. package/components/spinner/index.spec.js +460 -359
  343. package/components/spinner/index.vdt.js +13 -10
  344. package/components/spinner/styles.js +3 -0
  345. package/components/spinner/useChange.js +16 -4
  346. package/components/spinner/useFormatter.js +16 -6
  347. package/components/spinner/useStep.d.ts +3 -3
  348. package/components/spinner/useStep.js +20 -2
  349. package/components/spinner/useValue.js +26 -11
  350. package/components/split/index.js +7 -0
  351. package/components/split/index.spec.js +267 -223
  352. package/components/split/index.vdt.js +17 -8
  353. package/components/split/style.d.ts +1 -1
  354. package/components/split/style.js +8 -0
  355. package/components/split/useDraggable.js +35 -11
  356. package/components/split/useSize.js +5 -2
  357. package/components/steps/context.d.ts +2 -2
  358. package/components/steps/index.js +10 -2
  359. package/components/steps/index.spec.js +27 -21
  360. package/components/steps/index.vdt.js +10 -8
  361. package/components/steps/step.js +2 -0
  362. package/components/steps/step.vdt.js +12 -8
  363. package/components/steps/styles.js +27 -0
  364. package/components/switch/index.js +23 -2
  365. package/components/switch/index.spec.js +224 -188
  366. package/components/switch/index.vdt.js +32 -16
  367. package/components/switch/styles.js +14 -3
  368. package/components/switch/useDraggable.js +18 -10
  369. package/components/table/cell.js +6 -0
  370. package/components/table/cell.vdt.js +21 -14
  371. package/components/table/column.d.ts +1 -1
  372. package/components/table/column.js +5 -0
  373. package/components/table/column.vdt.js +30 -19
  374. package/components/table/exportTable.js +56 -45
  375. package/components/table/index.spec.js +984 -780
  376. package/components/table/row.d.ts +1 -1
  377. package/components/table/row.js +41 -12
  378. package/components/table/row.vdt.js +39 -27
  379. package/components/table/styles.js +11 -0
  380. package/components/table/table.d.ts +5 -5
  381. package/components/table/table.js +50 -18
  382. package/components/table/table.vdt.js +85 -61
  383. package/components/table/useChecked.d.ts +1 -1
  384. package/components/table/useChecked.js +61 -20
  385. package/components/table/useColumns.js +16 -3
  386. package/components/table/useDisableRow.js +12 -2
  387. package/components/table/useDraggable.js +12 -4
  388. package/components/table/useExpandable.js +5 -2
  389. package/components/table/useFixedColumns.d.ts +1 -1
  390. package/components/table/useFixedColumns.js +23 -4
  391. package/components/table/useGroup.d.ts +1 -1
  392. package/components/table/useGroup.js +24 -7
  393. package/components/table/useMerge.d.ts +4 -4
  394. package/components/table/useMerge.js +14 -2
  395. package/components/table/usePagination.js +18 -4
  396. package/components/table/useResizable.js +10 -2
  397. package/components/table/useRestRowStatus.js +6 -2
  398. package/components/table/useScroll.d.ts +1 -1
  399. package/components/table/useScroll.js +3 -0
  400. package/components/table/useSelected.js +5 -2
  401. package/components/table/useSortable.js +8 -2
  402. package/components/table/useStickyHeader.js +7 -3
  403. package/components/table/useStickyScrollbar.js +16 -6
  404. package/components/table/useTree.js +12 -1
  405. package/components/table/useWidth.js +30 -14
  406. package/components/tabs/index.js +51 -29
  407. package/components/tabs/index.spec.js +74 -56
  408. package/components/tabs/index.vdt.js +16 -13
  409. package/components/tabs/styles.js +16 -0
  410. package/components/tabs/tab.js +10 -0
  411. package/components/tabs/tab.vdt.js +10 -6
  412. package/components/tabs/useActiveBar.js +11 -2
  413. package/components/tabs/useScroll.js +20 -4
  414. package/components/tag/base.js +8 -0
  415. package/components/tag/index.js +4 -2
  416. package/components/tag/index.spec.js +25 -19
  417. package/components/tag/index.vdt.js +15 -8
  418. package/components/tag/styles.js +9 -0
  419. package/components/timeline/item.js +4 -0
  420. package/components/timeline/item.vdt.js +9 -4
  421. package/components/timeline/styles.d.ts +2 -2
  422. package/components/timeline/styles.js +4 -0
  423. package/components/timeline/timeline.js +2 -0
  424. package/components/timeline/timeline.vdt.js +5 -2
  425. package/components/timepicker/index.js +7 -2
  426. package/components/timepicker/index.spec.js +368 -293
  427. package/components/timepicker/panelPicker.d.ts +54 -0
  428. package/components/timepicker/panelPicker.js +11 -2
  429. package/components/timepicker/panelPicker.vdt.js +24 -14
  430. package/components/timepicker/selectPicker.js +5 -0
  431. package/components/timepicker/selectPicker.vdt.js +10 -5
  432. package/components/timepicker/styles.js +1 -0
  433. package/components/timepicker/useDisabled.js +4 -2
  434. package/components/timepicker/useFormats.js +13 -4
  435. package/components/timepicker/useStep.d.ts +1 -1
  436. package/components/timepicker/useStep.js +17 -8
  437. package/components/timepicker/useValue.js +21 -16
  438. package/components/tip/index.js +2 -0
  439. package/components/tip/index.vdt.js +17 -5
  440. package/components/tip/styles.js +3 -0
  441. package/components/tooltip/content.js +28 -0
  442. package/components/tooltip/content.vdt.js +25 -15
  443. package/components/tooltip/index.js +7 -3
  444. package/components/tooltip/index.spec.js +572 -434
  445. package/components/tooltip/styles.d.ts +1 -1
  446. package/components/tooltip/styles.js +10 -2
  447. package/components/tooltip/tooltip.js +15 -2
  448. package/components/tooltip/useArrow.js +14 -11
  449. package/components/transfer/index.d.ts +1 -1
  450. package/components/transfer/index.js +13 -1
  451. package/components/transfer/index.spec.js +194 -159
  452. package/components/transfer/index.vdt.js +34 -16
  453. package/components/transfer/styles.js +10 -0
  454. package/components/transfer/useCheck.d.ts +1 -1
  455. package/components/transfer/useCheck.js +15 -1
  456. package/components/transfer/useFilter.d.ts +1 -1
  457. package/components/transfer/useFilter.js +30 -9
  458. package/components/transfer/useTransfer.js +26 -10
  459. package/components/tree/index.d.ts +3 -3
  460. package/components/tree/index.js +22 -4
  461. package/components/tree/index.spec.js +355 -285
  462. package/components/tree/index.vdt.js +23 -12
  463. package/components/tree/styles.js +16 -2
  464. package/components/tree/useChecked.js +26 -3
  465. package/components/tree/useDraggable.js +42 -12
  466. package/components/tree/useExpanded.js +43 -26
  467. package/components/tree/useFilter.js +10 -3
  468. package/components/tree/useNodes.d.ts +1 -1
  469. package/components/tree/useNodes.js +4 -0
  470. package/components/tree/useSelected.js +38 -21
  471. package/components/tree/useTransitionEvent.js +5 -3
  472. package/components/treeSelect/index.d.ts +27 -0
  473. package/components/treeSelect/index.js +36 -9
  474. package/components/treeSelect/index.spec.js +160 -123
  475. package/components/treeSelect/index.vdt.js +20 -14
  476. package/components/treeSelect/styles.js +1 -0
  477. package/components/treeSelect/useValue.js +11 -0
  478. package/components/types.d.ts +3 -3
  479. package/components/upload/ajaxUploader.d.ts +1 -1
  480. package/components/upload/ajaxUploader.js +17 -0
  481. package/components/upload/index.d.ts +4 -4
  482. package/components/upload/index.js +14 -0
  483. package/components/upload/index.spec.js +249 -142
  484. package/components/upload/index.vdt.js +27 -12
  485. package/components/upload/styles.js +30 -0
  486. package/components/upload/useAccept.js +10 -2
  487. package/components/upload/useDrag.js +7 -0
  488. package/components/upload/useFiles.js +145 -103
  489. package/components/upload/useShowImage.js +3 -0
  490. package/components/upload/useUpload.js +69 -47
  491. package/components/utils.d.ts +3 -3
  492. package/components/utils.js +47 -12
  493. package/components/virtual.js +37 -9
  494. package/components/wave/index.js +31 -5
  495. package/hooks/useDelayClose.js +6 -2
  496. package/hooks/useDocumentClick.js +16 -8
  497. package/hooks/useDraggable.d.ts +1 -1
  498. package/hooks/useDraggable.js +9 -0
  499. package/hooks/useKeyboard.d.ts +3 -3
  500. package/hooks/useKeyboard.js +10 -0
  501. package/hooks/useMouseOutsidable.js +8 -0
  502. package/hooks/useReceive.d.ts +1 -1
  503. package/hooks/useReceive.js +4 -0
  504. package/hooks/useRecordComponent.js +6 -0
  505. package/hooks/useRouter.js +18 -7
  506. package/hooks/useShowHideEvents.js +3 -0
  507. package/hooks/useState.d.ts +2 -2
  508. package/hooks/useState.js +6 -2
  509. package/i18n/en-US.js +1 -0
  510. package/i18n/index.d.ts +1 -1
  511. package/i18n/index.js +7 -0
  512. package/index.d.ts +2 -2
  513. package/index.js +3 -2
  514. package/package.json +1 -1
  515. package/styles/global.js +3 -2
  516. package/styles/keyframes.js +1 -0
  517. package/styles/theme.d.ts +1 -1
  518. package/styles/theme.js +7 -4
  519. package/styles/utils.d.ts +1 -1
  520. package/styles/utils.js +17 -3
  521. package/yarn-error.log +0 -1013
@@ -17,524 +17,625 @@ describe('Slider', function () {
17
17
  });
18
18
  it('basic test', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
19
19
  var _mount, instance, element, _element$querySelecto, slider, handle, wrapper, width, bar;
20
+
20
21
  return _regeneratorRuntime.wrap(function _callee$(_context) {
21
- while (1) switch (_context.prev = _context.next) {
22
- case 0:
23
- _mount = mount(BasicDemo), instance = _mount[0], element = _mount[1];
24
- _element$querySelecto = element.querySelectorAll('.k-slider'), slider = _element$querySelecto[1]; // drag
25
- handle = slider.querySelector('.k-slider-thumb');
26
- dispatchEvent(handle, 'mousedown', {
27
- which: 1
28
- });
29
- dispatchEvent(handle, 'focusin');
30
- dispatchEvent(document, 'mousemove', {
31
- clientX: 0
32
- });
33
- expect(instance.get('value2')).eql(50);
34
- // move to boundary
35
- dispatchEvent(document, 'mousemove', {
36
- clientX: -10
37
- });
38
- expect(instance.get('value2')).eql(50);
39
- dispatchEvent(document, 'mousemove', {
40
- clientX: 999999
41
- });
42
- expect(instance.get('value2')).eql(500);
43
- dispatchEvent(document, 'mouseup');
44
- // click
45
- wrapper = slider.querySelector('.k-slider-track-wrapper');
46
- width = wrapper.getBoundingClientRect().width;
47
- dispatchEvent(wrapper, 'click', {
48
- clientX: width / 2
49
- });
50
- expect(instance.get('value2')).eql((500 + 50) / 2);
51
- // set value
52
- bar = slider.querySelector('.k-slider-bar');
53
- instance.set('value2', 135 + 50);
54
- _context.next = 20;
55
- return wait();
56
- case 20:
57
- expect(bar.style.width).eql('30%');
58
- instance.set('value2', -10);
59
- _context.next = 24;
60
- return wait();
61
- case 24:
62
- expect(bar.style.width).eql('0%');
63
- instance.set('value2', 1000);
64
- _context.next = 28;
65
- return wait();
66
- case 28:
67
- expect(bar.style.width).eql('100%');
68
- case 29:
69
- case "end":
70
- return _context.stop();
22
+ while (1) {
23
+ switch (_context.prev = _context.next) {
24
+ case 0:
25
+ _mount = mount(BasicDemo), instance = _mount[0], element = _mount[1];
26
+ _element$querySelecto = element.querySelectorAll('.k-slider'), slider = _element$querySelecto[1]; // drag
27
+
28
+ handle = slider.querySelector('.k-slider-thumb');
29
+ dispatchEvent(handle, 'mousedown', {
30
+ which: 1
31
+ });
32
+ dispatchEvent(handle, 'focusin');
33
+ dispatchEvent(document, 'mousemove', {
34
+ clientX: 0
35
+ });
36
+ expect(instance.get('value2')).eql(50); // move to boundary
37
+
38
+ dispatchEvent(document, 'mousemove', {
39
+ clientX: -10
40
+ });
41
+ expect(instance.get('value2')).eql(50);
42
+ dispatchEvent(document, 'mousemove', {
43
+ clientX: 999999
44
+ });
45
+ expect(instance.get('value2')).eql(500);
46
+ dispatchEvent(document, 'mouseup'); // click
47
+
48
+ wrapper = slider.querySelector('.k-slider-track-wrapper');
49
+ width = wrapper.getBoundingClientRect().width;
50
+ dispatchEvent(wrapper, 'click', {
51
+ clientX: width / 2
52
+ });
53
+ expect(instance.get('value2')).eql((500 + 50) / 2); // set value
54
+
55
+ bar = slider.querySelector('.k-slider-bar');
56
+ instance.set('value2', 135 + 50);
57
+ _context.next = 20;
58
+ return wait();
59
+
60
+ case 20:
61
+ expect(bar.style.width).eql('30%');
62
+ instance.set('value2', -10);
63
+ _context.next = 24;
64
+ return wait();
65
+
66
+ case 24:
67
+ expect(bar.style.width).eql('0%');
68
+ instance.set('value2', 1000);
69
+ _context.next = 28;
70
+ return wait();
71
+
72
+ case 28:
73
+ expect(bar.style.width).eql('100%');
74
+
75
+ case 29:
76
+ case "end":
77
+ return _context.stop();
78
+ }
71
79
  }
72
80
  }, _callee);
73
81
  })));
74
82
  it('range test', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
75
83
  var _mount2, instance, element, windowWidth, _element$querySelecto2, first, second, wrapper;
84
+
76
85
  return _regeneratorRuntime.wrap(function _callee2$(_context2) {
77
- while (1) switch (_context2.prev = _context2.next) {
78
- case 0:
79
- _mount2 = mount(RangeDemo), instance = _mount2[0], element = _mount2[1];
80
- windowWidth = 800; //document.documentElement.clientWidth;
81
- _element$querySelecto2 = element.querySelectorAll('.k-slider-thumb'), first = _element$querySelecto2[0], second = _element$querySelecto2[1]; // drag
82
- dispatchEvent(first, 'mousedown', {
83
- which: 1
84
- });
85
- dispatchEvent(first, 'focusin');
86
- dispatchEvent(first, 'mousemove', {
87
- clientX: windowWidth * 0.8
88
- });
89
- _context2.next = 8;
90
- return wait();
91
- case 8:
92
- expect(element.innerHTML).to.matchSnapshot();
93
- expect(instance.get('values')).eql([76, 80]);
94
- dispatchEvent(first, 'mouseup');
95
- dispatchEvent(second, 'mousedown', {
96
- which: 1
97
- });
98
- dispatchEvent(second, 'focusin');
99
- dispatchEvent(second, 'mousemove', {
100
- clientX: windowWidth * 0.6
101
- });
102
- _context2.next = 16;
103
- return wait();
104
- case 16:
105
- expect(element.innerHTML).to.matchSnapshot();
106
- expect(instance.get('values')).eql([60, 76]);
107
- dispatchEvent(first, 'mouseup');
108
- // click
109
- wrapper = element.querySelector('.k-slider-track-wrapper');
110
- dispatchEvent(wrapper, 'click', {
111
- clientX: windowWidth * 0.5
112
- });
113
- _context2.next = 23;
114
- return wait();
115
- case 23:
116
- expect(element.innerHTML).to.matchSnapshot();
117
- expect(instance.get('values')).eql([50, 76]);
118
- dispatchEvent(wrapper, 'click', {
119
- clientX: windowWidth * 0.7
120
- });
121
- _context2.next = 28;
122
- return wait();
123
- case 28:
124
- expect(element.innerHTML).to.matchSnapshot();
125
- expect(instance.get('values')).eql([50, 70]);
126
- // set invalid value
127
- instance.set('values', 1);
128
- _context2.next = 33;
129
- return wait();
130
- case 33:
131
- expect(instance.get('values')).eql([1, 1]);
132
- case 34:
133
- case "end":
134
- return _context2.stop();
86
+ while (1) {
87
+ switch (_context2.prev = _context2.next) {
88
+ case 0:
89
+ _mount2 = mount(RangeDemo), instance = _mount2[0], element = _mount2[1];
90
+ windowWidth = 800; //document.documentElement.clientWidth;
91
+
92
+ _element$querySelecto2 = element.querySelectorAll('.k-slider-thumb'), first = _element$querySelecto2[0], second = _element$querySelecto2[1]; // drag
93
+
94
+ dispatchEvent(first, 'mousedown', {
95
+ which: 1
96
+ });
97
+ dispatchEvent(first, 'focusin');
98
+ dispatchEvent(first, 'mousemove', {
99
+ clientX: windowWidth * 0.8
100
+ });
101
+ _context2.next = 8;
102
+ return wait();
103
+
104
+ case 8:
105
+ expect(element.innerHTML).to.matchSnapshot();
106
+ expect(instance.get('values')).eql([76, 80]);
107
+ dispatchEvent(first, 'mouseup');
108
+ dispatchEvent(second, 'mousedown', {
109
+ which: 1
110
+ });
111
+ dispatchEvent(second, 'focusin');
112
+ dispatchEvent(second, 'mousemove', {
113
+ clientX: windowWidth * 0.6
114
+ });
115
+ _context2.next = 16;
116
+ return wait();
117
+
118
+ case 16:
119
+ expect(element.innerHTML).to.matchSnapshot();
120
+ expect(instance.get('values')).eql([60, 76]);
121
+ dispatchEvent(first, 'mouseup'); // click
122
+
123
+ wrapper = element.querySelector('.k-slider-track-wrapper');
124
+ dispatchEvent(wrapper, 'click', {
125
+ clientX: windowWidth * 0.5
126
+ });
127
+ _context2.next = 23;
128
+ return wait();
129
+
130
+ case 23:
131
+ expect(element.innerHTML).to.matchSnapshot();
132
+ expect(instance.get('values')).eql([50, 76]);
133
+ dispatchEvent(wrapper, 'click', {
134
+ clientX: windowWidth * 0.7
135
+ });
136
+ _context2.next = 28;
137
+ return wait();
138
+
139
+ case 28:
140
+ expect(element.innerHTML).to.matchSnapshot();
141
+ expect(instance.get('values')).eql([50, 70]); // set invalid value
142
+
143
+ instance.set('values', 1);
144
+ _context2.next = 33;
145
+ return wait();
146
+
147
+ case 33:
148
+ expect(instance.get('values')).eql([1, 1]);
149
+
150
+ case 34:
151
+ case "end":
152
+ return _context2.stop();
153
+ }
135
154
  }
136
155
  }, _callee2);
137
156
  })));
138
157
  it('keyboard operation for basic', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
139
158
  var _mount3, instance, element, _element$querySelecto3, slider, handle;
159
+
140
160
  return _regeneratorRuntime.wrap(function _callee3$(_context3) {
141
- while (1) switch (_context3.prev = _context3.next) {
142
- case 0:
143
- _mount3 = mount(BasicDemo), instance = _mount3[0], element = _mount3[1];
144
- _element$querySelecto3 = element.querySelectorAll('.k-slider'), slider = _element$querySelecto3[1];
145
- handle = slider.querySelector('.k-slider-thumb');
146
- dispatchEvent(handle, 'focusin');
147
- dispatchEvent(handle, 'keydown', {
148
- keyCode: 37
149
- });
150
- _context3.next = 7;
151
- return wait();
152
- case 7:
153
- expect(slider.innerHTML).to.matchSnapshot();
154
- expect(instance.get('value2')).to.eql(276);
155
- dispatchEvent(handle, 'keydown', {
156
- keyCode: 39
157
- });
158
- _context3.next = 12;
159
- return wait();
160
- case 12:
161
- expect(slider.innerHTML).to.matchSnapshot();
162
- expect(instance.get('value2')).to.eql(277);
163
- dispatchEvent(handle, 'focusout');
164
- _context3.next = 17;
165
- return wait();
166
- case 17:
167
- expect(slider.innerHTML).to.matchSnapshot();
168
- case 18:
169
- case "end":
170
- return _context3.stop();
161
+ while (1) {
162
+ switch (_context3.prev = _context3.next) {
163
+ case 0:
164
+ _mount3 = mount(BasicDemo), instance = _mount3[0], element = _mount3[1];
165
+ _element$querySelecto3 = element.querySelectorAll('.k-slider'), slider = _element$querySelecto3[1];
166
+ handle = slider.querySelector('.k-slider-thumb');
167
+ dispatchEvent(handle, 'focusin');
168
+ dispatchEvent(handle, 'keydown', {
169
+ keyCode: 37
170
+ });
171
+ _context3.next = 7;
172
+ return wait();
173
+
174
+ case 7:
175
+ expect(slider.innerHTML).to.matchSnapshot();
176
+ expect(instance.get('value2')).to.eql(276);
177
+ dispatchEvent(handle, 'keydown', {
178
+ keyCode: 39
179
+ });
180
+ _context3.next = 12;
181
+ return wait();
182
+
183
+ case 12:
184
+ expect(slider.innerHTML).to.matchSnapshot();
185
+ expect(instance.get('value2')).to.eql(277);
186
+ dispatchEvent(handle, 'focusout');
187
+ _context3.next = 17;
188
+ return wait();
189
+
190
+ case 17:
191
+ expect(slider.innerHTML).to.matchSnapshot();
192
+
193
+ case 18:
194
+ case "end":
195
+ return _context3.stop();
196
+ }
171
197
  }
172
198
  }, _callee3);
173
199
  })));
174
200
  it('keyboard operation for range', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
175
201
  var _mount4, instance, element, _element$querySelecto4, first, second;
202
+
176
203
  return _regeneratorRuntime.wrap(function _callee4$(_context4) {
177
- while (1) switch (_context4.prev = _context4.next) {
178
- case 0:
179
- _mount4 = mount(RangeDemo), instance = _mount4[0], element = _mount4[1];
180
- _element$querySelecto4 = element.querySelectorAll('.k-slider-thumb'), first = _element$querySelecto4[0], second = _element$querySelecto4[1];
181
- instance.set('values', [50, 51]);
182
- _context4.next = 5;
183
- return wait();
184
- case 5:
185
- dispatchEvent(first, 'focusin');
186
- dispatchEvent(first, 'keydown', {
187
- keyCode: 39
188
- });
189
- _context4.next = 9;
190
- return wait();
191
- case 9:
192
- expect(element.innerHTML).to.matchSnapshot();
193
- expect(instance.get('values')).to.eql([51, 51]);
194
- dispatchEvent(first, 'keydown', {
195
- keyCode: 39
196
- });
197
- _context4.next = 14;
198
- return wait();
199
- case 14:
200
- expect(element.innerHTML).to.matchSnapshot();
201
- expect(instance.get('values')).to.eql([51, 52]);
202
- dispatchEvent(second, 'keydown', {
203
- keyCode: 39
204
- });
205
- _context4.next = 19;
206
- return wait();
207
- case 19:
208
- expect(element.innerHTML).to.matchSnapshot();
209
- expect(instance.get('values')).to.eql([51, 53]);
210
- dispatchEvent(second, 'focusout');
211
- instance.set('values', [50, 51]);
212
- _context4.next = 25;
213
- return wait();
214
- case 25:
215
- dispatchEvent(second, 'focusin');
216
- dispatchEvent(second, 'keydown', {
217
- keyCode: 37
218
- });
219
- _context4.next = 29;
220
- return wait();
221
- case 29:
222
- expect(instance.get('values')).to.eql([50, 50]);
223
- expect(element.innerHTML).to.matchSnapshot();
224
- dispatchEvent(second, 'keydown', {
225
- keyCode: 37
226
- });
227
- _context4.next = 34;
228
- return wait();
229
- case 34:
230
- expect(instance.get('values')).to.eql([49, 50]);
231
- expect(element.innerHTML).to.matchSnapshot();
232
- dispatchEvent(first, 'keydown', {
233
- keyCode: 37
234
- });
235
- _context4.next = 39;
236
- return wait();
237
- case 39:
238
- expect(instance.get('values')).to.eql([48, 50]);
239
- expect(element.innerHTML).to.matchSnapshot();
240
- dispatchEvent(first, 'focusout');
241
- case 42:
242
- case "end":
243
- return _context4.stop();
204
+ while (1) {
205
+ switch (_context4.prev = _context4.next) {
206
+ case 0:
207
+ _mount4 = mount(RangeDemo), instance = _mount4[0], element = _mount4[1];
208
+ _element$querySelecto4 = element.querySelectorAll('.k-slider-thumb'), first = _element$querySelecto4[0], second = _element$querySelecto4[1];
209
+ instance.set('values', [50, 51]);
210
+ _context4.next = 5;
211
+ return wait();
212
+
213
+ case 5:
214
+ dispatchEvent(first, 'focusin');
215
+ dispatchEvent(first, 'keydown', {
216
+ keyCode: 39
217
+ });
218
+ _context4.next = 9;
219
+ return wait();
220
+
221
+ case 9:
222
+ expect(element.innerHTML).to.matchSnapshot();
223
+ expect(instance.get('values')).to.eql([51, 51]);
224
+ dispatchEvent(first, 'keydown', {
225
+ keyCode: 39
226
+ });
227
+ _context4.next = 14;
228
+ return wait();
229
+
230
+ case 14:
231
+ expect(element.innerHTML).to.matchSnapshot();
232
+ expect(instance.get('values')).to.eql([51, 52]);
233
+ dispatchEvent(second, 'keydown', {
234
+ keyCode: 39
235
+ });
236
+ _context4.next = 19;
237
+ return wait();
238
+
239
+ case 19:
240
+ expect(element.innerHTML).to.matchSnapshot();
241
+ expect(instance.get('values')).to.eql([51, 53]);
242
+ dispatchEvent(second, 'focusout');
243
+ instance.set('values', [50, 51]);
244
+ _context4.next = 25;
245
+ return wait();
246
+
247
+ case 25:
248
+ dispatchEvent(second, 'focusin');
249
+ dispatchEvent(second, 'keydown', {
250
+ keyCode: 37
251
+ });
252
+ _context4.next = 29;
253
+ return wait();
254
+
255
+ case 29:
256
+ expect(instance.get('values')).to.eql([50, 50]);
257
+ expect(element.innerHTML).to.matchSnapshot();
258
+ dispatchEvent(second, 'keydown', {
259
+ keyCode: 37
260
+ });
261
+ _context4.next = 34;
262
+ return wait();
263
+
264
+ case 34:
265
+ expect(instance.get('values')).to.eql([49, 50]);
266
+ expect(element.innerHTML).to.matchSnapshot();
267
+ dispatchEvent(first, 'keydown', {
268
+ keyCode: 37
269
+ });
270
+ _context4.next = 39;
271
+ return wait();
272
+
273
+ case 39:
274
+ expect(instance.get('values')).to.eql([48, 50]);
275
+ expect(element.innerHTML).to.matchSnapshot();
276
+ dispatchEvent(first, 'focusout');
277
+
278
+ case 42:
279
+ case "end":
280
+ return _context4.stop();
281
+ }
244
282
  }
245
283
  }, _callee4);
246
284
  })));
247
285
  it('disabled', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5() {
248
286
  var _mount5, instance, element, slider, sliderDom, handle, wrapper;
287
+
249
288
  return _regeneratorRuntime.wrap(function _callee5$(_context5) {
250
- while (1) switch (_context5.prev = _context5.next) {
251
- case 0:
252
- _mount5 = mount(DisabledDemo), instance = _mount5[0], element = _mount5[1];
253
- slider = instance.refs.__test; // cannot drag
254
- sliderDom = element.querySelector('.k-slider');
255
- handle = sliderDom.querySelector('.k-slider-thumb');
256
- dispatchEvent(handle, 'mousedown', {
257
- which: 1
258
- });
259
- dispatchEvent(handle, 'focusin');
260
- dispatchEvent(document, 'mousemove', {
261
- clientX: 0
262
- });
263
- dispatchEvent(handle, 'mouseup', {
264
- clientX: 0
265
- });
266
- _context5.next = 10;
267
- return wait();
268
- case 10:
269
- expect(sliderDom.innerHTML).to.matchSnapshot();
270
- expect(slider.get('value')).to.eql(50);
271
- // keyboard
272
- dispatchEvent(handle, 'keydown', {
273
- keyCode: 37
274
- });
275
- dispatchEvent(handle, 'focusout');
276
- _context5.next = 16;
277
- return wait();
278
- case 16:
279
- expect(sliderDom.innerHTML).to.matchSnapshot();
280
- expect(slider.get('value')).to.eql(50);
281
- // click
282
- wrapper = sliderDom.querySelector('.k-slider-track-wrapper');
283
- dispatchEvent(wrapper, 'click', {
284
- clientX: 0
285
- });
286
- _context5.next = 22;
287
- return wait();
288
- case 22:
289
- expect(sliderDom.innerHTML).to.matchSnapshot();
290
- expect(slider.get('value')).to.eql(50);
291
- case 24:
292
- case "end":
293
- return _context5.stop();
289
+ while (1) {
290
+ switch (_context5.prev = _context5.next) {
291
+ case 0:
292
+ _mount5 = mount(DisabledDemo), instance = _mount5[0], element = _mount5[1];
293
+ slider = instance.refs.__test; // cannot drag
294
+
295
+ sliderDom = element.querySelector('.k-slider');
296
+ handle = sliderDom.querySelector('.k-slider-thumb');
297
+ dispatchEvent(handle, 'mousedown', {
298
+ which: 1
299
+ });
300
+ dispatchEvent(handle, 'focusin');
301
+ dispatchEvent(document, 'mousemove', {
302
+ clientX: 0
303
+ });
304
+ dispatchEvent(handle, 'mouseup', {
305
+ clientX: 0
306
+ });
307
+ _context5.next = 10;
308
+ return wait();
309
+
310
+ case 10:
311
+ expect(sliderDom.innerHTML).to.matchSnapshot();
312
+ expect(slider.get('value')).to.eql(50); // keyboard
313
+
314
+ dispatchEvent(handle, 'keydown', {
315
+ keyCode: 37
316
+ });
317
+ dispatchEvent(handle, 'focusout');
318
+ _context5.next = 16;
319
+ return wait();
320
+
321
+ case 16:
322
+ expect(sliderDom.innerHTML).to.matchSnapshot();
323
+ expect(slider.get('value')).to.eql(50); // click
324
+
325
+ wrapper = sliderDom.querySelector('.k-slider-track-wrapper');
326
+ dispatchEvent(wrapper, 'click', {
327
+ clientX: 0
328
+ });
329
+ _context5.next = 22;
330
+ return wait();
331
+
332
+ case 22:
333
+ expect(sliderDom.innerHTML).to.matchSnapshot();
334
+ expect(slider.get('value')).to.eql(50);
335
+
336
+ case 24:
337
+ case "end":
338
+ return _context5.stop();
339
+ }
294
340
  }
295
341
  }, _callee5);
296
342
  })));
297
343
  it('min/max/step is undefined', function () {
298
344
  var Demo = /*#__PURE__*/function (_Component) {
299
345
  _inheritsLoose(Demo, _Component);
346
+
300
347
  function Demo() {
301
348
  var _context6;
349
+
302
350
  var _this;
351
+
303
352
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
304
353
  args[_key] = arguments[_key];
305
354
  }
355
+
306
356
  _this = _Component.call.apply(_Component, _concatInstanceProperty(_context6 = [this]).call(_context6, args)) || this;
307
357
  _this.Slider = Slider;
308
358
  return _this;
309
359
  }
360
+
310
361
  return Demo;
311
362
  }(Component);
363
+
312
364
  Demo.template = "const {Slider} = this; <Slider min={undefined}\n max={undefined}\n step={undefined}\n value={1}\n />";
365
+
313
366
  var _mount6 = mount(Demo),
314
- instance = _mount6[0],
315
- element = _mount6[1];
367
+ instance = _mount6[0],
368
+ element = _mount6[1];
369
+
316
370
  expect(element.innerHTML).to.matchSnapshot();
317
371
  });
318
372
  it('should log error when max < min', function () {
319
373
  var Demo = /*#__PURE__*/function (_Component2) {
320
374
  _inheritsLoose(Demo, _Component2);
375
+
321
376
  function Demo() {
322
377
  var _context7;
378
+
323
379
  var _this2;
380
+
324
381
  for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
325
382
  args[_key2] = arguments[_key2];
326
383
  }
384
+
327
385
  _this2 = _Component2.call.apply(_Component2, _concatInstanceProperty(_context7 = [this]).call(_context7, args)) || this;
328
386
  _this2.Slider = Slider;
329
387
  return _this2;
330
388
  }
389
+
331
390
  return Demo;
332
391
  }(Component);
392
+
333
393
  Demo.template = "const {Slider} = this; <Slider min={20}\n max={0}\n step={undefined}\n value={1}\n />";
334
394
  var error = fakeError();
395
+
335
396
  var _mount7 = mount(Demo),
336
- instance = _mount7[0],
337
- element = _mount7[1];
397
+ instance = _mount7[0],
398
+ element = _mount7[1];
399
+
338
400
  expect(element.innerHTML).to.matchSnapshot();
339
401
  error('[Slider] min must less than or equal to max, but got min: 20 max: 0');
340
402
  });
341
403
  it('should input any value even if it has step', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6() {
342
404
  var _mount8, instance, element, input, slider;
405
+
343
406
  return _regeneratorRuntime.wrap(function _callee6$(_context8) {
344
- while (1) switch (_context8.prev = _context8.next) {
345
- case 0:
346
- _mount8 = mount(StepDemo), instance = _mount8[0], element = _mount8[1];
347
- input = element.querySelector('input');
348
- input.value = '1';
349
- dispatchEvent(input, 'input');
350
- _context8.next = 6;
351
- return wait();
352
- case 6:
353
- expect(input.value).to.eql('1');
354
- input.value = '11';
355
- dispatchEvent(input, 'input');
356
- _context8.next = 11;
357
- return wait();
358
- case 11:
359
- expect(input.value).to.eql('11');
360
- expect(instance.get('value1')).to.eql(10);
361
- dispatchEvent(input, 'change');
362
- _context8.next = 16;
363
- return wait();
364
- case 16:
365
- expect(input.value).to.eql('10');
366
- instance.set('value1', 13);
367
- _context8.next = 20;
368
- return wait();
369
- case 20:
370
- expect(instance.get('value1')).to.eql(15);
371
- // disable forceStep
372
- slider = instance.refs.__test;
373
- slider.set('forceStep', false);
374
- instance.set('value1', 13);
375
- _context8.next = 26;
376
- return wait();
377
- case 26:
378
- expect(instance.get('value1')).to.eql(13);
379
- case 27:
380
- case "end":
381
- return _context8.stop();
407
+ while (1) {
408
+ switch (_context8.prev = _context8.next) {
409
+ case 0:
410
+ _mount8 = mount(StepDemo), instance = _mount8[0], element = _mount8[1];
411
+ input = element.querySelector('input');
412
+ input.value = '1';
413
+ dispatchEvent(input, 'input');
414
+ _context8.next = 6;
415
+ return wait();
416
+
417
+ case 6:
418
+ expect(input.value).to.eql('1');
419
+ input.value = '11';
420
+ dispatchEvent(input, 'input');
421
+ _context8.next = 11;
422
+ return wait();
423
+
424
+ case 11:
425
+ expect(input.value).to.eql('11');
426
+ expect(instance.get('value1')).to.eql(10);
427
+ dispatchEvent(input, 'change');
428
+ _context8.next = 16;
429
+ return wait();
430
+
431
+ case 16:
432
+ expect(input.value).to.eql('10');
433
+ instance.set('value1', 13);
434
+ _context8.next = 20;
435
+ return wait();
436
+
437
+ case 20:
438
+ expect(instance.get('value1')).to.eql(15); // disable forceStep
439
+
440
+ slider = instance.refs.__test;
441
+ slider.set('forceStep', false);
442
+ instance.set('value1', 13);
443
+ _context8.next = 26;
444
+ return wait();
445
+
446
+ case 26:
447
+ expect(instance.get('value1')).to.eql(13);
448
+
449
+ case 27:
450
+ case "end":
451
+ return _context8.stop();
452
+ }
382
453
  }
383
454
  }, _callee6);
384
455
  })));
385
456
  it('should show tooltip', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7() {
386
457
  var _mount9, instance, element, content;
458
+
387
459
  return _regeneratorRuntime.wrap(function _callee7$(_context9) {
388
- while (1) switch (_context9.prev = _context9.next) {
389
- case 0:
390
- _mount9 = mount(TooltipDemo), instance = _mount9[0], element = _mount9[1];
391
- instance.set('value2', 11);
392
- _context9.next = 4;
393
- return wait();
394
- case 4:
395
- content = getElements('.k-tooltip-content')[0];
396
- expect(content.textContent).to.eql('满2年,优惠4个月');
397
- instance.set('value2', 5);
398
- _context9.next = 9;
399
- return wait();
400
- case 9:
401
- expect(content.textContent).to.eql('');
402
- case 10:
403
- case "end":
404
- return _context9.stop();
460
+ while (1) {
461
+ switch (_context9.prev = _context9.next) {
462
+ case 0:
463
+ _mount9 = mount(TooltipDemo), instance = _mount9[0], element = _mount9[1];
464
+ instance.set('value2', 11);
465
+ _context9.next = 4;
466
+ return wait();
467
+
468
+ case 4:
469
+ content = getElements('.k-tooltip-content')[0];
470
+ expect(content.textContent).to.eql('满2年,优惠4个月');
471
+ instance.set('value2', 5);
472
+ _context9.next = 9;
473
+ return wait();
474
+
475
+ case 9:
476
+ expect(content.textContent).to.eql('');
477
+
478
+ case 10:
479
+ case "end":
480
+ return _context9.stop();
481
+ }
405
482
  }
406
483
  }, _callee7);
407
484
  })));
408
485
  it('should locate at the end if start value is equal to end value', function () {
409
486
  var Demo = /*#__PURE__*/function (_Component3) {
410
487
  _inheritsLoose(Demo, _Component3);
488
+
411
489
  function Demo() {
412
490
  var _context10;
491
+
413
492
  var _this3;
493
+
414
494
  for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
415
495
  args[_key3] = arguments[_key3];
416
496
  }
497
+
417
498
  _this3 = _Component3.call.apply(_Component3, _concatInstanceProperty(_context10 = [this]).call(_context10, args)) || this;
418
499
  _this3.Slider = Slider;
419
500
  return _this3;
420
501
  }
502
+
421
503
  return Demo;
422
504
  }(Component);
505
+
423
506
  Demo.template = "const {Slider} = this; <div>\n <Slider min={1} max={1} value={1} />\n <Slider min={1} max={1} range />\n </div>";
507
+
424
508
  var _mount10 = mount(Demo),
425
- instance = _mount10[0],
426
- element = _mount10[1];
509
+ instance = _mount10[0],
510
+ element = _mount10[1];
511
+
427
512
  expect(element.innerHTML).to.matchSnapshot();
428
513
  });
429
514
  it('should trigger change event correctly', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8() {
430
515
  var spy, Demo, _mount11, instance, element, handle, bar, width, start, input, btn;
516
+
431
517
  return _regeneratorRuntime.wrap(function _callee8$(_context12) {
432
- while (1) switch (_context12.prev = _context12.next) {
433
- case 0:
434
- spy = sinon.spy();
435
- Demo = /*#__PURE__*/function (_Component4) {
436
- _inheritsLoose(Demo, _Component4);
437
- function Demo() {
438
- var _context11;
439
- var _this4;
440
- for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
441
- args[_key4] = arguments[_key4];
518
+ while (1) {
519
+ switch (_context12.prev = _context12.next) {
520
+ case 0:
521
+ spy = sinon.spy();
522
+
523
+ Demo = /*#__PURE__*/function (_Component4) {
524
+ _inheritsLoose(Demo, _Component4);
525
+
526
+ function Demo() {
527
+ var _context11;
528
+
529
+ var _this4;
530
+
531
+ for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
532
+ args[_key4] = arguments[_key4];
533
+ }
534
+
535
+ _this4 = _Component4.call.apply(_Component4, _concatInstanceProperty(_context11 = [this]).call(_context11, args)) || this;
536
+ _this4.Slider = Slider;
537
+ return _this4;
442
538
  }
443
- _this4 = _Component4.call.apply(_Component4, _concatInstanceProperty(_context11 = [this]).call(_context11, args)) || this;
444
- _this4.Slider = Slider;
445
- return _this4;
446
- }
447
- Demo.defaults = function defaults() {
448
- return {
449
- value: 0
539
+
540
+ Demo.defaults = function defaults() {
541
+ return {
542
+ value: 0
543
+ };
544
+ };
545
+
546
+ var _proto = Demo.prototype;
547
+
548
+ _proto._onChange = function _onChange(v) {
549
+ console.log('change', v);
550
+ spy(v);
450
551
  };
451
- };
452
- var _proto = Demo.prototype;
453
- _proto._onChange = function _onChange(v) {
454
- console.log('change', v);
455
- spy(v);
456
- };
457
- return Demo;
458
- }(Component);
459
- Demo.template = "const Slider = this.Slider; <Slider ev-change={this._onChange} v-model=\"value\" />";
460
- _mount11 = mount(Demo), instance = _mount11[0], element = _mount11[1];
461
- handle = element.querySelector('.k-slider-thumb');
462
- bar = element.querySelector('.k-slider-track-wrapper'); // keyboard
463
- dispatchEvent(handle, 'focusin');
464
- dispatchEvent(handle, 'keydown', {
465
- keyCode: 39
466
- });
467
- expect(spy.callCount).to.eql(0);
468
- dispatchEvent(handle, 'keydown', {
469
- keyCode: 39
470
- });
471
- expect(spy.callCount).to.eql(0);
472
- dispatchEvent(handle, 'keyup', {
473
- keyCode: 13
474
- });
475
- expect(spy.callCount).to.eql(0);
476
- dispatchEvent(handle, 'keyup', {
477
- keyCode: 39
478
- });
479
- expect(spy.callCount).to.eql(1);
480
- expect(spy.calledWith(2)).to.be.true;
481
- dispatchEvent(handle, 'keydown', {
482
- keyCode: 39
483
- });
484
- expect(spy.callCount).to.eql(1);
485
- dispatchEvent(handle, 'keyup', {
486
- keyCode: 39
487
- });
488
- expect(spy.callCount).to.eql(2);
489
- expect(spy.calledWith(3)).to.be.true;
490
- // drag
491
- width = bar.getBoundingClientRect().width;
492
- dispatchEvent(handle, 'mousedown', {
493
- which: 1
494
- });
495
- dispatchEvent(document, 'mousemove', {
496
- clientX: 0.1 * width
497
- });
498
- expect(spy.callCount).to.eql(2);
499
- dispatchEvent(document, 'mouseup', {
500
- clientX: 0.1 * width
501
- });
502
- expect(spy.callCount).to.eql(3);
503
- expect(spy.calledWith(10)).to.be.true;
504
- // click
505
- dispatchEvent(bar, 'click', {
506
- clientX: 0.2 * width
507
- });
508
- expect(spy.callCount).to.eql(4);
509
- expect(spy.calledWith(20)).to.be.true;
510
- // click end
511
- start = element.querySelector('.k-slider-ends span');
512
- start.click();
513
- expect(spy.callCount).to.eql(5);
514
- expect(spy.calledWith(0)).to.be.true;
515
- // spinner
516
- input = element.querySelector('input');
517
- input.value = '1';
518
- dispatchEvent(input, 'input');
519
- _context12.next = 40;
520
- return wait();
521
- case 40:
522
- expect(spy.callCount).to.eql(6);
523
- expect(spy.calledWith(1)).to.be.true;
524
- btn = element.querySelector('.k-btn');
525
- btn.click();
526
- _context12.next = 46;
527
- return wait();
528
- case 46:
529
- expect(spy.callCount).to.eql(7);
530
- expect(spy.calledWith(0)).to.be.true;
531
- case 48:
532
- case "end":
533
- return _context12.stop();
552
+
553
+ return Demo;
554
+ }(Component);
555
+
556
+ Demo.template = "const Slider = this.Slider; <Slider ev-change={this._onChange} v-model=\"value\" />";
557
+ _mount11 = mount(Demo), instance = _mount11[0], element = _mount11[1];
558
+ handle = element.querySelector('.k-slider-thumb');
559
+ bar = element.querySelector('.k-slider-track-wrapper'); // keyboard
560
+
561
+ dispatchEvent(handle, 'focusin');
562
+ dispatchEvent(handle, 'keydown', {
563
+ keyCode: 39
564
+ });
565
+ expect(spy.callCount).to.eql(0);
566
+ dispatchEvent(handle, 'keydown', {
567
+ keyCode: 39
568
+ });
569
+ expect(spy.callCount).to.eql(0);
570
+ dispatchEvent(handle, 'keyup', {
571
+ keyCode: 13
572
+ });
573
+ expect(spy.callCount).to.eql(0);
574
+ dispatchEvent(handle, 'keyup', {
575
+ keyCode: 39
576
+ });
577
+ expect(spy.callCount).to.eql(1);
578
+ expect(spy.calledWith(2)).to.be.true;
579
+ dispatchEvent(handle, 'keydown', {
580
+ keyCode: 39
581
+ });
582
+ expect(spy.callCount).to.eql(1);
583
+ dispatchEvent(handle, 'keyup', {
584
+ keyCode: 39
585
+ });
586
+ expect(spy.callCount).to.eql(2);
587
+ expect(spy.calledWith(3)).to.be.true; // drag
588
+
589
+ width = bar.getBoundingClientRect().width;
590
+ dispatchEvent(handle, 'mousedown', {
591
+ which: 1
592
+ });
593
+ dispatchEvent(document, 'mousemove', {
594
+ clientX: 0.1 * width
595
+ });
596
+ expect(spy.callCount).to.eql(2);
597
+ dispatchEvent(document, 'mouseup', {
598
+ clientX: 0.1 * width
599
+ });
600
+ expect(spy.callCount).to.eql(3);
601
+ expect(spy.calledWith(10)).to.be.true; // click
602
+
603
+ dispatchEvent(bar, 'click', {
604
+ clientX: 0.2 * width
605
+ });
606
+ expect(spy.callCount).to.eql(4);
607
+ expect(spy.calledWith(20)).to.be.true; // click end
608
+
609
+ start = element.querySelector('.k-slider-ends span');
610
+ start.click();
611
+ expect(spy.callCount).to.eql(5);
612
+ expect(spy.calledWith(0)).to.be.true; // spinner
613
+
614
+ input = element.querySelector('input');
615
+ input.value = '1';
616
+ dispatchEvent(input, 'input');
617
+ _context12.next = 40;
618
+ return wait();
619
+
620
+ case 40:
621
+ expect(spy.callCount).to.eql(6);
622
+ expect(spy.calledWith(1)).to.be.true;
623
+ btn = element.querySelector('.k-btn');
624
+ btn.click();
625
+ _context12.next = 46;
626
+ return wait();
627
+
628
+ case 46:
629
+ expect(spy.callCount).to.eql(7);
630
+ expect(spy.calledWith(0)).to.be.true;
631
+
632
+ case 48:
633
+ case "end":
634
+ return _context12.stop();
635
+ }
534
636
  }
535
637
  }, _callee8);
536
- })));
537
- // it('should set init value to min value', async () => {
638
+ }))); // it('should set init value to min value', async () => {
538
639
  // class Demo extends Component<{a: number, b: number}> {
539
640
  // static template = `const {Slider} = this; <div>
540
641
  // <Slider min={-1} max={1} v-model="a"/>
@@ -546,71 +647,88 @@ describe('Slider', function () {
546
647
  // expect(instance.get('a')).to.eql(-1);
547
648
  // expect(instance.get('b')).to.eql([-1, -1]);
548
649
  // });
650
+
549
651
  it('should set value by `min + step * n`', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee9() {
550
652
  var Demo, _mount12, instance, element;
653
+
551
654
  return _regeneratorRuntime.wrap(function _callee9$(_context14) {
552
- while (1) switch (_context14.prev = _context14.next) {
553
- case 0:
554
- Demo = /*#__PURE__*/function (_Component5) {
555
- _inheritsLoose(Demo, _Component5);
556
- function Demo() {
557
- var _context13;
558
- var _this5;
559
- for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
560
- args[_key5] = arguments[_key5];
655
+ while (1) {
656
+ switch (_context14.prev = _context14.next) {
657
+ case 0:
658
+ Demo = /*#__PURE__*/function (_Component5) {
659
+ _inheritsLoose(Demo, _Component5);
660
+
661
+ function Demo() {
662
+ var _context13;
663
+
664
+ var _this5;
665
+
666
+ for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
667
+ args[_key5] = arguments[_key5];
668
+ }
669
+
670
+ _this5 = _Component5.call.apply(_Component5, _concatInstanceProperty(_context13 = [this]).call(_context13, args)) || this;
671
+ _this5.Slider = Slider;
672
+ return _this5;
561
673
  }
562
- _this5 = _Component5.call.apply(_Component5, _concatInstanceProperty(_context13 = [this]).call(_context13, args)) || this;
563
- _this5.Slider = Slider;
564
- return _this5;
565
- }
566
- return Demo;
567
- }(Component);
568
- Demo.template = "const {Slider} = this; <div>\n <Slider min={-6} max={20} v-model=\"value\" step={5} points />\n </div>";
569
- _mount12 = mount(Demo), instance = _mount12[0], element = _mount12[1];
570
- instance.set('value', 0);
571
- _context14.next = 6;
572
- return wait();
573
- case 6:
574
- expect(instance.get('value')).to.eql(-1);
575
- case 7:
576
- case "end":
577
- return _context14.stop();
674
+
675
+ return Demo;
676
+ }(Component);
677
+
678
+ Demo.template = "const {Slider} = this; <div>\n <Slider min={-6} max={20} v-model=\"value\" step={5} points />\n </div>";
679
+ _mount12 = mount(Demo), instance = _mount12[0], element = _mount12[1];
680
+ instance.set('value', 0);
681
+ _context14.next = 6;
682
+ return wait();
683
+
684
+ case 6:
685
+ expect(instance.get('value')).to.eql(-1);
686
+
687
+ case 7:
688
+ case "end":
689
+ return _context14.stop();
690
+ }
578
691
  }
579
692
  }, _callee9);
580
693
  })));
581
694
  it('dynamic step', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee10() {
582
695
  var _mount13, instance, element, handle, model;
696
+
583
697
  return _regeneratorRuntime.wrap(function _callee10$(_context15) {
584
- while (1) switch (_context15.prev = _context15.next) {
585
- case 0:
586
- _mount13 = mount(DynamicStepDemo), instance = _mount13[0], element = _mount13[1];
587
- handle = element.querySelector('.k-slider-thumb');
588
- model = "value1";
589
- instance.set(model, 100);
590
- _context15.next = 6;
591
- return wait();
592
- case 6:
593
- dispatchEvent(handle, 'focusin');
594
- dispatchEvent(handle, 'keydown', {
595
- keyCode: 37
596
- });
597
- expect(instance.get(model)).to.eql(90);
598
- dispatchEvent(handle, 'keydown', {
599
- keyCode: 39
600
- });
601
- expect(instance.get(model)).to.eql(100);
602
- dispatchEvent(handle, 'keydown', {
603
- keyCode: 39
604
- });
605
- expect(instance.get(model)).to.eql(150);
606
- dispatchEvent(handle, 'keydown', {
607
- keyCode: 37
608
- });
609
- expect(instance.get(model)).to.eql(100);
610
- dispatchEvent(handle, 'focusout');
611
- case 16:
612
- case "end":
613
- return _context15.stop();
698
+ while (1) {
699
+ switch (_context15.prev = _context15.next) {
700
+ case 0:
701
+ _mount13 = mount(DynamicStepDemo), instance = _mount13[0], element = _mount13[1];
702
+ handle = element.querySelector('.k-slider-thumb');
703
+ model = "value1";
704
+ instance.set(model, 100);
705
+ _context15.next = 6;
706
+ return wait();
707
+
708
+ case 6:
709
+ dispatchEvent(handle, 'focusin');
710
+ dispatchEvent(handle, 'keydown', {
711
+ keyCode: 37
712
+ });
713
+ expect(instance.get(model)).to.eql(90);
714
+ dispatchEvent(handle, 'keydown', {
715
+ keyCode: 39
716
+ });
717
+ expect(instance.get(model)).to.eql(100);
718
+ dispatchEvent(handle, 'keydown', {
719
+ keyCode: 39
720
+ });
721
+ expect(instance.get(model)).to.eql(150);
722
+ dispatchEvent(handle, 'keydown', {
723
+ keyCode: 37
724
+ });
725
+ expect(instance.get(model)).to.eql(100);
726
+ dispatchEvent(handle, 'focusout');
727
+
728
+ case 16:
729
+ case "end":
730
+ return _context15.stop();
731
+ }
614
732
  }
615
733
  }, _callee10);
616
734
  })));