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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (544) hide show
  1. package/__tests__/__snapshots__/Vue Next Demos.md +261 -255
  2. package/components/affix/index.d.ts +2 -2
  3. package/components/affix/index.js +0 -5
  4. package/components/affix/index.spec.js +84 -108
  5. package/components/affix/index.vdt.js +7 -10
  6. package/components/affix/styles.js +1 -1
  7. package/components/affix/useStyle.js +8 -19
  8. package/components/badge/index.js +0 -5
  9. package/components/badge/index.vdt.js +7 -11
  10. package/components/badge/styles.js +1 -3
  11. package/components/breadcrumb/index.js +0 -7
  12. package/components/breadcrumb/index.spec.js +6 -6
  13. package/components/breadcrumb/index.vdt.js +5 -14
  14. package/components/breadcrumb/item.js +0 -8
  15. package/components/breadcrumb/item.vdt.js +3 -6
  16. package/components/breadcrumb/styles.js +1 -4
  17. package/components/button/dynamicButton.d.ts +1 -1
  18. package/components/button/dynamicButton.js +2 -5
  19. package/components/button/group.js +2 -13
  20. package/components/button/group.vdt.js +5 -8
  21. package/components/button/index.js +3 -27
  22. package/components/button/index.spec.js +74 -96
  23. package/components/button/index.vdt.js +21 -31
  24. package/components/button/styles.d.ts +2 -2
  25. package/components/button/styles.js +8 -53
  26. package/components/card/column.js +0 -5
  27. package/components/card/column.vdt.js +5 -10
  28. package/components/card/index.js +0 -7
  29. package/components/card/index.vdt.js +5 -17
  30. package/components/card/styles.js +3 -6
  31. package/components/carousel/index.js +1 -19
  32. package/components/carousel/index.spec.js +127 -163
  33. package/components/carousel/index.vdt.js +12 -16
  34. package/components/carousel/item.js +0 -5
  35. package/components/carousel/item.vdt.js +4 -7
  36. package/components/carousel/styles.js +2 -3
  37. package/components/carousel/useAutoplay.js +0 -4
  38. package/components/carousel/useItems.js +4 -20
  39. package/components/carousel/useSlide.js +57 -89
  40. package/components/cascader/index.d.ts +1 -1
  41. package/components/cascader/index.js +3 -18
  42. package/components/cascader/index.spec.js +300 -377
  43. package/components/cascader/index.vdt.js +15 -33
  44. package/components/cascader/styles.js +2 -8
  45. package/components/cascader/useFields.js +1 -4
  46. package/components/cascader/useFilterable.js +2 -19
  47. package/components/cascader/useLabel.js +1 -9
  48. package/components/cascader/useLoad.js +22 -35
  49. package/components/cascader/useValue.d.ts +2 -2
  50. package/components/cascader/useValue.js +5 -26
  51. package/components/checkbox/index.js +5 -27
  52. package/components/checkbox/index.spec.js +129 -171
  53. package/components/checkbox/index.vdt.js +12 -16
  54. package/components/checkbox/styles.js +1 -13
  55. package/components/code/crossDomain.js +2 -9
  56. package/components/code/index.js +0 -9
  57. package/components/code/index.spec.js +46 -55
  58. package/components/code/index.vdt.js +6 -14
  59. package/components/code/styles.js +0 -1
  60. package/components/code/useEditor.js +5 -10
  61. package/components/collapse/index.d.ts +1 -1
  62. package/components/collapse/index.js +3 -17
  63. package/components/collapse/index.spec.js +47 -60
  64. package/components/collapse/index.vdt.js +4 -12
  65. package/components/collapse/item.js +0 -10
  66. package/components/collapse/item.vdt.js +7 -14
  67. package/components/collapse/styles.js +2 -5
  68. package/components/colorpicker/drag.js +0 -5
  69. package/components/colorpicker/index.js +0 -7
  70. package/components/colorpicker/index.spec.js +211 -259
  71. package/components/colorpicker/index.vdt.js +8 -11
  72. package/components/colorpicker/panel.js +0 -5
  73. package/components/colorpicker/panel.vdt.js +21 -26
  74. package/components/colorpicker/styles.js +4 -15
  75. package/components/colorpicker/useDrag.js +22 -26
  76. package/components/colorpicker/useInput.js +0 -16
  77. package/components/colorpicker/usePointer.js +15 -18
  78. package/components/colorpicker/useValue.js +2 -7
  79. package/components/config/index.js +3 -8
  80. package/components/config/index.spec.js +37 -50
  81. package/components/context.d.ts +2 -2
  82. package/components/context.js +2 -21
  83. package/components/copy/index.js +0 -7
  84. package/components/copy/index.spec.js +64 -86
  85. package/components/copy/index.vdt.js +4 -7
  86. package/components/copy/styles.js +0 -1
  87. package/components/copy/useCopy.js +13 -23
  88. package/components/datepicker/basepicker.d.ts +8 -8
  89. package/components/datepicker/basepicker.js +20 -90
  90. package/components/datepicker/calendar.js +0 -11
  91. package/components/datepicker/calendar.vdt.js +11 -15
  92. package/components/datepicker/constants.js +0 -1
  93. package/components/datepicker/dayjs.js +1 -1
  94. package/components/datepicker/helpers.js +3 -15
  95. package/components/datepicker/index.js +6 -32
  96. package/components/datepicker/index.spec.js +1154 -1464
  97. package/components/datepicker/index.vdt.js +20 -34
  98. package/components/datepicker/shortcuts.d.ts +1 -1
  99. package/components/datepicker/shortcuts.js +0 -4
  100. package/components/datepicker/styles.js +3 -12
  101. package/components/datepicker/time.d.ts +1 -1
  102. package/components/datepicker/time.js +3 -23
  103. package/components/datepicker/time.vdt.js +4 -5
  104. package/components/datepicker/useDays.js +2 -9
  105. package/components/datepicker/useDisabled.js +6 -23
  106. package/components/datepicker/useFocusDate.js +0 -2
  107. package/components/datepicker/useFormats.js +6 -15
  108. package/components/datepicker/useKeyboards.js +20 -36
  109. package/components/datepicker/useMonths.js +0 -6
  110. package/components/datepicker/usePanel.js +0 -10
  111. package/components/datepicker/useShowDate.js +10 -37
  112. package/components/datepicker/useStatus.js +3 -15
  113. package/components/datepicker/useValue.js +20 -38
  114. package/components/datepicker/useYears.js +4 -15
  115. package/components/diagram/diagram.js +17 -43
  116. package/components/diagram/diagram.vdt.js +2 -5
  117. package/components/diagram/graph.js +6 -6
  118. package/components/diagram/index.js +7 -7
  119. package/components/diagram/index.spec.js +369 -495
  120. package/components/diagram/layouts/circle.js +6 -14
  121. package/components/diagram/layouts/flow.js +7 -15
  122. package/components/diagram/layouts/layout.js +6 -28
  123. package/components/diagram/layouts/organic.js +3 -11
  124. package/components/diagram/layouts/partition.js +4 -12
  125. package/components/diagram/layouts/radial.js +6 -18
  126. package/components/diagram/layouts/stack.js +6 -14
  127. package/components/diagram/layouts/tree.js +11 -21
  128. package/components/diagram/mxgraph/handler/mxConnectionHandler.js +15 -22
  129. package/components/diagram/mxgraph/handler/mxConstraintHandler.js +4 -4
  130. package/components/diagram/mxgraph/handler/mxEdgeHandler.js +11 -15
  131. package/components/diagram/mxgraph/handler/mxGraphHandler.js +6 -9
  132. package/components/diagram/mxgraph/handler/mxRubberband.js +4 -4
  133. package/components/diagram/mxgraph/handler/mxVertexHandler.js +7 -10
  134. package/components/diagram/mxgraph/index.js +0 -2
  135. package/components/diagram/mxgraph/mx.js +3 -3
  136. package/components/diagram/mxgraph/shape/mxCloud.js +2 -2
  137. package/components/diagram/mxgraph/shape/mxCylinder.js +4 -9
  138. package/components/diagram/mxgraph/shape/mxEllipse.js +2 -2
  139. package/components/diagram/mxgraph/shape/mxHexagon.js +2 -2
  140. package/components/diagram/mxgraph/shape/mxLine.js +2 -2
  141. package/components/diagram/mxgraph/shape/mxRectangleShape.js +2 -2
  142. package/components/diagram/mxgraph/shape/mxRhombus.js +6 -12
  143. package/components/diagram/mxgraph/shape/mxShape.js +0 -1
  144. package/components/diagram/mxgraph/shape/mxTriangle.js +2 -2
  145. package/components/diagram/mxgraph/util/mxConstants.js +2 -2
  146. package/components/diagram/mxgraph/util/mxGuide.js +5 -7
  147. package/components/diagram/mxgraph/view/mxCellEditor.js +16 -29
  148. package/components/diagram/mxgraph/view/mxCellRenderer.js +0 -2
  149. package/components/diagram/mxgraph/view/mxGraph.js +14 -32
  150. package/components/diagram/shapes/base.d.ts +1 -1
  151. package/components/diagram/shapes/base.js +9 -39
  152. package/components/diagram/shapes/callout.js +10 -23
  153. package/components/diagram/shapes/circle.js +3 -10
  154. package/components/diagram/shapes/document.js +5 -16
  155. package/components/diagram/shapes/ellipse.js +0 -5
  156. package/components/diagram/shapes/generateShapes.d.ts +1 -1
  157. package/components/diagram/shapes/generateShapes.js +0 -9
  158. package/components/diagram/shapes/hexagon.js +9 -26
  159. package/components/diagram/shapes/image.js +1 -9
  160. package/components/diagram/shapes/line.d.ts +2 -2
  161. package/components/diagram/shapes/line.js +13 -48
  162. package/components/diagram/shapes/parallelogram.js +9 -26
  163. package/components/diagram/shapes/rectangle.js +1 -9
  164. package/components/diagram/shapes/shape.js +6 -35
  165. package/components/diagram/shapes/square.js +3 -11
  166. package/components/diagram/shapes/text.js +0 -5
  167. package/components/diagram/styles.js +0 -1
  168. package/components/dialog/alert.vdt.js +9 -20
  169. package/components/dialog/base.js +1 -29
  170. package/components/dialog/base.vdt.js +14 -31
  171. package/components/dialog/index.js +6 -31
  172. package/components/dialog/index.spec.js +456 -627
  173. package/components/dialog/staticMethods.d.ts +1 -1
  174. package/components/dialog/staticMethods.js +2 -13
  175. package/components/dialog/styles.js +3 -14
  176. package/components/dialog/useDraggable.js +0 -6
  177. package/components/dialog/useEscClosable.js +4 -12
  178. package/components/dialog/useFixBody.d.ts +1 -1
  179. package/components/dialog/useFixBody.js +0 -11
  180. package/components/dialog/usePosition.js +0 -5
  181. package/components/drawer/index.js +0 -5
  182. package/components/drawer/index.spec.js +128 -170
  183. package/components/drawer/index.vdt.js +3 -9
  184. package/components/drawer/styles.d.ts +2 -2
  185. package/components/drawer/styles.js +1 -4
  186. package/components/dropdown/dropdown.d.ts +2 -2
  187. package/components/dropdown/dropdown.js +33 -90
  188. package/components/dropdown/index.js +2 -6
  189. package/components/dropdown/index.spec.js +388 -496
  190. package/components/dropdown/item.js +4 -25
  191. package/components/dropdown/item.vdt.js +5 -8
  192. package/components/dropdown/menu.js +12 -29
  193. package/components/dropdown/menu.vdt.js +5 -13
  194. package/components/dropdown/styles.js +2 -11
  195. package/components/dropdown/useKeyboard.d.ts +2 -2
  196. package/components/dropdown/useKeyboard.js +8 -30
  197. package/components/dropdown/usePosition.d.ts +1 -1
  198. package/components/dropdown/usePosition.js +12 -21
  199. package/components/dropdown/useTransition.js +0 -8
  200. package/components/editable/index.d.ts +1 -1
  201. package/components/editable/index.js +4 -28
  202. package/components/editable/index.spec.js +152 -189
  203. package/components/editable/index.vdt.js +8 -11
  204. package/components/editable/styles.js +1 -2
  205. package/components/form/form.js +0 -18
  206. package/components/form/form.vdt.js +4 -7
  207. package/components/form/index.spec.js +1082 -1316
  208. package/components/form/item.d.ts +1 -1
  209. package/components/form/item.js +0 -12
  210. package/components/form/item.vdt.js +17 -31
  211. package/components/form/methods.d.ts +5 -5
  212. package/components/form/methods.js +2 -12
  213. package/components/form/styles.js +2 -10
  214. package/components/form/useDirty.js +2 -8
  215. package/components/form/useError.js +2 -10
  216. package/components/form/useValidate.d.ts +1 -1
  217. package/components/form/useValidate.js +8 -24
  218. package/components/grid/col.d.ts +3 -3
  219. package/components/grid/col.js +0 -7
  220. package/components/grid/col.vdt.js +8 -13
  221. package/components/grid/constants.d.ts +6 -6
  222. package/components/grid/row.js +0 -5
  223. package/components/grid/row.vdt.js +5 -8
  224. package/components/grid/styles.js +2 -8
  225. package/components/grid/useBreakpoints.js +0 -5
  226. package/components/grid/useGutter.js +9 -27
  227. package/components/icon/index.js +0 -10
  228. package/components/icon/index.vdt.js +8 -14
  229. package/components/icon/styles.js +1 -4
  230. package/components/input/index.d.ts +3 -3
  231. package/components/input/index.js +0 -13
  232. package/components/input/index.spec.js +185 -239
  233. package/components/input/index.vdt.js +46 -57
  234. package/components/input/search.js +0 -20
  235. package/components/input/search.vdt.js +6 -9
  236. package/components/input/styles.js +2 -29
  237. package/components/input/useAutoRows.js +6 -18
  238. package/components/input/useAutoWidth.js +0 -5
  239. package/components/input/useFocus.js +0 -2
  240. package/components/input/useFrozen.js +0 -6
  241. package/components/input/useShowPassword.js +2 -5
  242. package/components/layout/aside.js +6 -18
  243. package/components/layout/aside.vdt.js +5 -9
  244. package/components/layout/body.js +5 -18
  245. package/components/layout/footer.js +1 -10
  246. package/components/layout/header.js +9 -23
  247. package/components/layout/index.spec.js +24 -34
  248. package/components/layout/layout.js +9 -24
  249. package/components/layout/styles.js +6 -17
  250. package/components/layout/template.vdt.js +2 -4
  251. package/components/layout/useParse.js +0 -7
  252. package/components/menu/index.spec.js +189 -242
  253. package/components/menu/item.js +3 -16
  254. package/components/menu/item.vdt.js +22 -38
  255. package/components/menu/menu.js +2 -11
  256. package/components/menu/menu.vdt.js +6 -12
  257. package/components/menu/styles.js +4 -23
  258. package/components/menu/useDropdown.js +4 -10
  259. package/components/menu/useExpanded.js +0 -14
  260. package/components/menu/useHighlight.js +26 -36
  261. package/components/message/index.spec.js +58 -73
  262. package/components/message/message.js +0 -19
  263. package/components/message/message.vdt.js +6 -9
  264. package/components/message/messages.js +0 -12
  265. package/components/message/messages.vdt.js +0 -1
  266. package/components/message/styles.js +2 -11
  267. package/components/pagination/index.d.ts +1 -1
  268. package/components/pagination/index.js +10 -46
  269. package/components/pagination/index.spec.js +133 -173
  270. package/components/pagination/index.vdt.js +14 -32
  271. package/components/pagination/styles.js +3 -9
  272. package/components/popover/content.js +1 -5
  273. package/components/popover/content.vdt.js +4 -14
  274. package/components/popover/index.js +5 -10
  275. package/components/popover/index.spec.js +113 -150
  276. package/components/popover/styles.js +1 -1
  277. package/components/portal.d.ts +1 -1
  278. package/components/portal.js +2 -30
  279. package/components/position.d.ts +12 -12
  280. package/components/position.js +32 -88
  281. package/components/progress/index.d.ts +6 -6
  282. package/components/progress/index.js +0 -12
  283. package/components/progress/index.spec.js +143 -191
  284. package/components/progress/index.vdt.js +8 -17
  285. package/components/progress/styles.js +1 -7
  286. package/components/progress/useColor.js +2 -7
  287. package/components/progress/useStatus.d.ts +1 -1
  288. package/components/progress/useStatus.js +2 -5
  289. package/components/radio/index.js +3 -18
  290. package/components/radio/index.spec.js +111 -149
  291. package/components/radio/index.vdt.js +14 -17
  292. package/components/radio/styles.js +1 -13
  293. package/components/rate/index.js +0 -7
  294. package/components/rate/index.spec.js +64 -79
  295. package/components/rate/index.vdt.js +8 -21
  296. package/components/rate/styles.js +1 -4
  297. package/components/rate/useActiveValue.js +2 -7
  298. package/components/scrollSelect/index.d.ts +2 -2
  299. package/components/scrollSelect/index.js +0 -7
  300. package/components/scrollSelect/index.spec.js +100 -131
  301. package/components/scrollSelect/index.vdt.js +6 -12
  302. package/components/scrollSelect/styles.js +1 -8
  303. package/components/scrollSelect/useList.js +3 -17
  304. package/components/scrollSelect/useMouseEvents.js +31 -49
  305. package/components/scrollSelect/useTranslate.js +1 -11
  306. package/components/select/base.d.ts +2 -2
  307. package/components/select/base.js +3 -33
  308. package/components/select/base.vdt.js +27 -46
  309. package/components/select/group.js +0 -5
  310. package/components/select/group.vdt.js +4 -10
  311. package/components/select/index.spec.js +370 -464
  312. package/components/select/menu.js +0 -5
  313. package/components/select/menu.vdt.js +18 -33
  314. package/components/select/option.js +2 -16
  315. package/components/select/option.vdt.js +7 -14
  316. package/components/select/select.js +3 -20
  317. package/components/select/select.vdt.js +9 -17
  318. package/components/select/styles.js +3 -34
  319. package/components/select/useBaseLabel.d.ts +1 -1
  320. package/components/select/useBaseLabel.js +4 -17
  321. package/components/select/useCard.js +0 -4
  322. package/components/select/useDraggble.js +2 -2
  323. package/components/select/useEqualWidth.js +0 -1
  324. package/components/select/useFilterable.js +9 -27
  325. package/components/select/useFocusout.js +0 -8
  326. package/components/select/useInput.js +6 -10
  327. package/components/select/useLabel.js +3 -13
  328. package/components/select/useSearchable.js +0 -10
  329. package/components/skeleton/item.d.ts +1 -1
  330. package/components/skeleton/item.js +0 -7
  331. package/components/skeleton/item.vdt.js +1 -6
  332. package/components/skeleton/skeleton.js +0 -7
  333. package/components/skeleton/skeleton.vdt.js +6 -12
  334. package/components/skeleton/styles.d.ts +1 -1
  335. package/components/skeleton/styles.js +2 -3
  336. package/components/slider/index.d.ts +1 -1
  337. package/components/slider/index.js +0 -7
  338. package/components/slider/index.spec.js +502 -624
  339. package/components/slider/index.vdt.js +35 -50
  340. package/components/slider/styles.js +1 -19
  341. package/components/slider/useClick.js +2 -11
  342. package/components/slider/useDraggable.js +23 -34
  343. package/components/slider/useKeyboard.js +7 -18
  344. package/components/slider/useMarks.d.ts +5 -5
  345. package/components/slider/useMarks.js +5 -13
  346. package/components/slider/usePoints.d.ts +2 -2
  347. package/components/slider/usePoints.js +7 -21
  348. package/components/slider/useStyles.d.ts +1 -1
  349. package/components/slider/useStyles.js +5 -10
  350. package/components/slider/useTooltip.js +2 -10
  351. package/components/slider/useValue.d.ts +1 -1
  352. package/components/slider/useValue.js +7 -24
  353. package/components/spin/index.js +0 -7
  354. package/components/spin/index.vdt.js +4 -11
  355. package/components/spin/styles.js +1 -3
  356. package/components/spinner/index.d.ts +4 -4
  357. package/components/spinner/index.js +6 -18
  358. package/components/spinner/index.spec.js +359 -460
  359. package/components/spinner/index.vdt.js +12 -15
  360. package/components/spinner/styles.js +1 -11
  361. package/components/spinner/useChange.js +4 -16
  362. package/components/spinner/useFormatter.js +6 -16
  363. package/components/spinner/useStep.d.ts +3 -3
  364. package/components/spinner/useStep.js +2 -20
  365. package/components/spinner/useValue.js +14 -32
  366. package/components/split/index.js +0 -7
  367. package/components/split/index.spec.js +223 -267
  368. package/components/split/index.vdt.js +8 -17
  369. package/components/split/memo.js +0 -6
  370. package/components/split/styles.d.ts +1 -1
  371. package/components/split/styles.js +1 -9
  372. package/components/split/useDraggable.js +11 -35
  373. package/components/split/useSize.js +2 -5
  374. package/components/steps/index.js +2 -13
  375. package/components/steps/index.spec.js +21 -27
  376. package/components/steps/index.vdt.js +9 -12
  377. package/components/steps/step.js +0 -5
  378. package/components/steps/step.vdt.js +8 -12
  379. package/components/steps/styles.js +1 -38
  380. package/components/switch/index.js +2 -23
  381. package/components/switch/index.spec.js +194 -234
  382. package/components/switch/index.vdt.js +16 -32
  383. package/components/switch/styles.js +4 -12
  384. package/components/switch/useDraggable.js +10 -18
  385. package/components/table/cell.js +0 -9
  386. package/components/table/cell.vdt.js +14 -21
  387. package/components/table/column.d.ts +1 -1
  388. package/components/table/column.js +0 -5
  389. package/components/table/column.vdt.js +25 -37
  390. package/components/table/exportTable.js +41 -55
  391. package/components/table/index.spec.js +817 -1026
  392. package/components/table/row.d.ts +1 -1
  393. package/components/table/row.js +12 -44
  394. package/components/table/row.vdt.js +27 -38
  395. package/components/table/styles.js +2 -18
  396. package/components/table/table.d.ts +5 -5
  397. package/components/table/table.js +18 -50
  398. package/components/table/table.vdt.js +61 -86
  399. package/components/table/useChecked.d.ts +1 -1
  400. package/components/table/useChecked.js +20 -61
  401. package/components/table/useColumns.js +3 -16
  402. package/components/table/useDisableRow.js +2 -12
  403. package/components/table/useDraggable.js +4 -8
  404. package/components/table/useExpandable.js +2 -5
  405. package/components/table/useFixedColumns.d.ts +1 -1
  406. package/components/table/useFixedColumns.js +3 -20
  407. package/components/table/useGroup.d.ts +1 -1
  408. package/components/table/useGroup.js +7 -25
  409. package/components/table/useMerge.d.ts +4 -4
  410. package/components/table/useMerge.js +2 -14
  411. package/components/table/usePagination.js +4 -18
  412. package/components/table/useResetRowStatus.js +2 -6
  413. package/components/table/useResizable.js +4 -21
  414. package/components/table/useScroll.d.ts +1 -1
  415. package/components/table/useScroll.js +0 -3
  416. package/components/table/useSelected.js +2 -5
  417. package/components/table/useSortable.js +2 -8
  418. package/components/table/useStickyHeader.js +3 -7
  419. package/components/table/useStickyScrollbar.js +6 -16
  420. package/components/table/useTree.js +1 -12
  421. package/components/table/useWidth.js +14 -30
  422. package/components/tabs/index.js +29 -51
  423. package/components/tabs/index.spec.js +97 -129
  424. package/components/tabs/index.vdt.js +13 -16
  425. package/components/tabs/styles.js +1 -23
  426. package/components/tabs/tab.js +0 -10
  427. package/components/tabs/tab.vdt.js +6 -10
  428. package/components/tabs/useActiveBar.js +2 -11
  429. package/components/tabs/useScroll.js +10 -30
  430. package/components/tag/base.js +0 -11
  431. package/components/tag/index.js +2 -4
  432. package/components/tag/index.spec.js +123 -156
  433. package/components/tag/index.vdt.js +8 -15
  434. package/components/tag/styles.d.ts +1 -1
  435. package/components/tag/styles.js +2 -18
  436. package/components/tag/tags.d.ts +2 -2
  437. package/components/tag/tags.js +0 -7
  438. package/components/tag/tags.vdt.js +10 -18
  439. package/components/tag/useChildren.js +0 -5
  440. package/components/tag/useDraggable.js +6 -15
  441. package/components/tag/useNowrap.js +10 -27
  442. package/components/timeline/item.js +0 -7
  443. package/components/timeline/item.vdt.js +4 -9
  444. package/components/timeline/styles.d.ts +2 -2
  445. package/components/timeline/styles.js +2 -6
  446. package/components/timeline/timeline.js +0 -5
  447. package/components/timeline/timeline.vdt.js +2 -5
  448. package/components/timepicker/index.js +2 -7
  449. package/components/timepicker/index.spec.js +293 -368
  450. package/components/timepicker/panelPicker.js +2 -11
  451. package/components/timepicker/panelPicker.vdt.js +14 -24
  452. package/components/timepicker/selectPicker.js +0 -5
  453. package/components/timepicker/selectPicker.vdt.js +5 -10
  454. package/components/timepicker/styles.js +1 -2
  455. package/components/timepicker/useDisabled.js +2 -4
  456. package/components/timepicker/useFormats.js +4 -13
  457. package/components/timepicker/useStep.d.ts +1 -1
  458. package/components/timepicker/useStep.js +8 -17
  459. package/components/timepicker/useValue.js +16 -21
  460. package/components/tip/index.js +0 -2
  461. package/components/tip/index.vdt.js +5 -17
  462. package/components/tip/styles.js +1 -4
  463. package/components/tooltip/content.js +0 -28
  464. package/components/tooltip/content.vdt.js +15 -27
  465. package/components/tooltip/index.js +3 -7
  466. package/components/tooltip/index.spec.js +400 -527
  467. package/components/tooltip/styles.d.ts +1 -1
  468. package/components/tooltip/styles.js +3 -13
  469. package/components/tooltip/tooltip.js +2 -15
  470. package/components/tooltip/useArrow.js +11 -14
  471. package/components/transfer/index.d.ts +1 -1
  472. package/components/transfer/index.js +1 -13
  473. package/components/transfer/index.spec.js +159 -194
  474. package/components/transfer/index.vdt.js +17 -36
  475. package/components/transfer/styles.js +1 -11
  476. package/components/transfer/useCheck.d.ts +1 -1
  477. package/components/transfer/useCheck.js +1 -16
  478. package/components/transfer/useFilter.d.ts +1 -1
  479. package/components/transfer/useFilter.js +9 -30
  480. package/components/transfer/useTransfer.js +10 -26
  481. package/components/tree/index.d.ts +3 -3
  482. package/components/tree/index.js +3 -22
  483. package/components/tree/index.spec.js +310 -388
  484. package/components/tree/index.vdt.js +12 -24
  485. package/components/tree/styles.js +3 -17
  486. package/components/tree/useChecked.js +3 -27
  487. package/components/tree/useDraggable.js +14 -44
  488. package/components/tree/useExpanded.js +28 -46
  489. package/components/tree/useFilter.js +3 -10
  490. package/components/tree/useNodes.d.ts +3 -3
  491. package/components/tree/useNodes.js +0 -4
  492. package/components/tree/useSelected.js +21 -38
  493. package/components/tree/useTransitionEvent.js +3 -5
  494. package/components/treeSelect/index.js +9 -37
  495. package/components/treeSelect/index.spec.js +123 -160
  496. package/components/treeSelect/index.vdt.js +14 -20
  497. package/components/treeSelect/styles.js +1 -2
  498. package/components/treeSelect/useValue.js +0 -11
  499. package/components/types.d.ts +3 -3
  500. package/components/upload/ajaxUploader.d.ts +1 -1
  501. package/components/upload/ajaxUploader.js +0 -17
  502. package/components/upload/index.d.ts +4 -4
  503. package/components/upload/index.js +0 -14
  504. package/components/upload/index.spec.js +142 -248
  505. package/components/upload/index.vdt.js +12 -28
  506. package/components/upload/styles.js +2 -28
  507. package/components/upload/useAccept.js +2 -10
  508. package/components/upload/useDrag.js +0 -7
  509. package/components/upload/useFiles.js +103 -148
  510. package/components/upload/useShowImage.js +0 -3
  511. package/components/upload/useUpload.js +47 -69
  512. package/components/utils.d.ts +6 -6
  513. package/components/utils.js +12 -56
  514. package/components/virtual.js +9 -37
  515. package/components/wave/index.js +5 -32
  516. package/components/wave/styles.js +1 -1
  517. package/hooks/useDelayClose.js +2 -7
  518. package/hooks/useDocumentClick.js +8 -16
  519. package/hooks/useDraggable.d.ts +1 -1
  520. package/hooks/useDraggable.js +0 -9
  521. package/hooks/useKeyboard.d.ts +3 -3
  522. package/hooks/useKeyboard.js +0 -10
  523. package/hooks/useMouseOutsidable.js +0 -8
  524. package/hooks/useReceive.d.ts +1 -1
  525. package/hooks/useReceive.js +0 -4
  526. package/hooks/useRecordComponent.js +0 -6
  527. package/hooks/useResizeObserver.js +0 -2
  528. package/hooks/useRouter.js +7 -18
  529. package/hooks/useShowHideEvents.js +0 -3
  530. package/hooks/useState.d.ts +2 -2
  531. package/hooks/useState.js +2 -6
  532. package/i18n/en-US.js +0 -1
  533. package/i18n/index.d.ts +1 -1
  534. package/i18n/index.js +0 -7
  535. package/index.d.ts +2 -2
  536. package/index.js +2 -3
  537. package/package.json +2 -2
  538. package/styles/global.js +2 -5
  539. package/styles/keyframes.js +0 -1
  540. package/styles/theme.d.ts +1 -1
  541. package/styles/theme.js +2 -5
  542. package/styles/utils.d.ts +1 -1
  543. package/styles/utils.js +3 -17
  544. package/yarn-error.log +897 -0
@@ -21,7 +21,7 @@ export interface FormItemBlocks {
21
21
  content: null;
22
22
  append: null;
23
23
  }
24
- export declare type Rules = Record<string, any>;
24
+ export type Rules = Record<string, any>;
25
25
  export declare class FormItem extends Component<FormItemProps, FormItemEvents, FormItemBlocks> {
26
26
  static template: string | import('intact-vue-next').Template<any>;
27
27
  static typeDefs: Required<TypeDefs<FormItemProps>>;
@@ -9,12 +9,10 @@ import { useValidate } from './useValidate';
9
9
  import { useDirty } from './useDirty';
10
10
  import { useConfigContext } from '../config';
11
11
  var MessageOrClassname;
12
-
13
12
  (function (MessageOrClassname) {
14
13
  MessageOrClassname[MessageOrClassname["Message"] = 0] = "Message";
15
14
  MessageOrClassname[MessageOrClassname["ClassName"] = 1] = "ClassName";
16
15
  })(MessageOrClassname || (MessageOrClassname = {}));
17
-
18
16
  var typeDefs = {
19
17
  value: null,
20
18
  rules: Object,
@@ -29,16 +27,12 @@ var typeDefs = {
29
27
  };
30
28
  export var FormItem = /*#__PURE__*/function (_Component) {
31
29
  _inheritsLoose(FormItem, _Component);
32
-
33
30
  function FormItem() {
34
31
  var _context;
35
-
36
32
  var _this;
37
-
38
33
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
39
34
  args[_key] = arguments[_key];
40
35
  }
41
-
42
36
  _this = _Component.call.apply(_Component, _concatInstanceProperty(_context = [this]).call(_context, args)) || this;
43
37
  _this.form = inject(FORM, null);
44
38
  _this.error = useError();
@@ -49,28 +43,22 @@ export var FormItem = /*#__PURE__*/function (_Component) {
49
43
  _this.config = useConfigContext();
50
44
  return _this;
51
45
  }
52
-
53
46
  var _proto = FormItem.prototype;
54
-
55
47
  _proto.init = function init() {
56
48
  useRecordItem(RECORD_KEY);
57
49
  };
58
-
59
50
  _proto.validate = function validate() {
60
51
  if (!this.form) return true;
61
52
  return this.validateHook.validate();
62
53
  };
63
-
64
54
  _proto.isValid = function isValid() {
65
55
  return this.validateHook.isValid.value;
66
56
  };
67
-
68
57
  _proto.reset = function reset() {
69
58
  this.error.reset();
70
59
  this.validateHook.reset();
71
60
  this.dirty.reset();
72
61
  };
73
-
74
62
  return FormItem;
75
63
  }(Component);
76
64
  FormItem.template = template;
@@ -8,36 +8,32 @@ import { makeItemStyles } from './styles';
8
8
  import { context as ErrorContext } from './useError';
9
9
  export default function ($props, $blocks, $__proto__) {
10
10
  var _classNameObj, _$cn2;
11
-
12
11
  $blocks || ($blocks = {});
13
12
  $props || ($props = {});
14
13
  var $this = this;
15
14
  var _$blocks = {};
16
15
  var __$blocks = {};
17
-
18
16
  var _this$get = this.get(),
19
- className = _this$get.className,
20
- children = _this$get.children,
21
- label = _this$get.label,
22
- hideLabel = _this$get.hideLabel,
23
- htmlFor = _this$get.htmlFor,
24
- errorClassName = _this$get.errorClassName,
25
- rules = _this$get.rules,
26
- fluid = _this$get.fluid;
27
-
17
+ className = _this$get.className,
18
+ children = _this$get.children,
19
+ label = _this$get.label,
20
+ hideLabel = _this$get.hideLabel,
21
+ htmlFor = _this$get.htmlFor,
22
+ errorClassName = _this$get.errorClassName,
23
+ rules = _this$get.rules,
24
+ fluid = _this$get.fluid;
28
25
  var _this$dirty = this.dirty,
29
- isDirty = _this$dirty.isDirty.value,
30
- onChange = _this$dirty.onChange,
31
- onFocusout = _this$dirty.onFocusout;
26
+ isDirty = _this$dirty.isDirty.value,
27
+ onChange = _this$dirty.onChange,
28
+ onFocusout = _this$dirty.onFocusout;
32
29
  var _this$validateHook = this.validateHook,
33
- isValid = _this$validateHook.isValid.value,
34
- customErrorClassName = _this$validateHook.errorClassName.value;
30
+ isValid = _this$validateHook.isValid.value,
31
+ customErrorClassName = _this$validateHook.errorClassName.value;
35
32
  var k = this.config.k;
36
33
  var classNameObj = (_classNameObj = {}, _classNameObj[k + "-form-item"] = true, _classNameObj[k + "-invalid"] = isDirty && !isValid, _classNameObj[k + "-valid"] = isDirty && isValid, _classNameObj[className] = className, _classNameObj[k + "-fluid"] = fluid, _classNameObj[makeItemStyles(k)] = true, _classNameObj);
37
34
  var starOnRequired = this.form && this.form.get('starOnRequired');
38
35
  var labelWidth = this.form && this.form.get('labelWidth');
39
36
  var labelStyle;
40
-
41
37
  if (labelWidth != null) {
42
38
  if (/^\d+$/.test(labelWidth)) {
43
39
  labelStyle = {
@@ -49,11 +45,10 @@ export default function ($props, $blocks, $__proto__) {
49
45
  };
50
46
  }
51
47
  }
52
-
53
48
  var _this$error = this.error,
54
- ellipsis = _this$error.ellipsis,
55
- message = _this$error.message,
56
- errorRef = _this$error.errorRef;
49
+ ellipsis = _this$error.ellipsis,
50
+ message = _this$error.message,
51
+ errorRef = _this$error.errorRef;
57
52
  return _$cv('div', _extends({}, getRestProps(this), {
58
53
  'className': _$cn(classNameObj),
59
54
  'ev-change': onChange,
@@ -62,11 +57,9 @@ export default function ($props, $blocks, $__proto__) {
62
57
  return label;
63
58
  }, __$blocks['label'] = function ($super, data) {
64
59
  var block = $blocks['label'];
65
-
66
60
  var callBlock = function callBlock() {
67
61
  return _$blocks['label'].call($this, $super, data);
68
62
  };
69
-
70
63
  return block ? block.call($this, callBlock, data) : callBlock();
71
64
  }, __$blocks['label'](_$no))], 0, _$cn(k + "-form-label"), {
72
65
  'htmlFor': htmlFor,
@@ -77,11 +70,9 @@ export default function ($props, $blocks, $__proto__) {
77
70
  return children;
78
71
  }, __$blocks['content'] = function ($super, data) {
79
72
  var block = $blocks['content'];
80
-
81
73
  var callBlock = function callBlock() {
82
74
  return _$blocks['content'].call($this, $super, data);
83
75
  };
84
-
85
76
  return block ? block.call($this, callBlock, data) : callBlock();
86
77
  }, __$blocks['content'](_$no))
87
78
  }), _$cc(Transition, {
@@ -97,17 +88,14 @@ export default function ($props, $blocks, $__proto__) {
97
88
  }),
98
89
  '$blocks': function ($blocks) {
99
90
  var _$blocks = {},
100
- __$blocks = _$ex({}, $blocks);
101
-
91
+ __$blocks = _$ex({}, $blocks);
102
92
  return (_$blocks['content'] = function ($super) {
103
93
  return message.value;
104
94
  }, __$blocks['content'] = function ($super, data) {
105
95
  var block = $blocks['content'];
106
-
107
96
  var callBlock = function callBlock() {
108
97
  return _$blocks['content'].call($this, $super, data);
109
98
  };
110
-
111
99
  return block ? block.call($this, callBlock, data) : callBlock();
112
100
  }), __$blocks;
113
101
  }.call($this, _$em)
@@ -116,11 +104,9 @@ export default function ($props, $blocks, $__proto__) {
116
104
  return null;
117
105
  }, __$blocks['append'] = function ($super, data) {
118
106
  var block = $blocks['append'];
119
-
120
107
  var callBlock = function callBlock() {
121
108
  return _$blocks['append'].call($this, $super, data);
122
109
  };
123
-
124
110
  return block ? block.call($this, callBlock, data) : callBlock();
125
111
  }, __$blocks['append'](_$no)), 0, _$cn(k + "-form-append")) : undefined]);
126
112
  }
@@ -1,8 +1,8 @@
1
- export declare type MethodReturn = boolean | string;
2
- export declare type Method = (value: any, param: any) => MethodReturn | Promise<MethodReturn>;
3
- export declare type Message = string | ((value: any, param: any) => string);
4
- export declare type ClassName = string | ((value: any, param: any) => string);
1
+ export type MethodReturn = boolean | string;
2
+ export type Method = (value: any, param: any) => MethodReturn | Promise<MethodReturn>;
3
+ export type Message = string | ((value: any, param: any) => string);
4
+ export type ClassName = string | ((value: any, param: any) => string);
5
5
  export declare const methods: Record<string, Method>;
6
6
  export declare const messages: Record<string, Message>;
7
7
  export declare const classNames: Record<string, ClassName>;
8
- export declare const addMethod: (name: string, method: Method, message?: Message | undefined, className?: ClassName | undefined) => void;
8
+ export declare const addMethod: (name: string, method: Method, message?: Message, className?: ClassName) => void;
@@ -1,31 +1,24 @@
1
1
  import _trimInstanceProperty from "@babel/runtime-corejs3/core-js/instance/trim";
2
2
  import { _$ } from '../../i18n';
3
3
  import { isNumber, isNullOrUndefined, isString } from 'intact-shared';
4
-
5
4
  function decimalPlaces(num) {
6
5
  var match = ("" + num).match(/(?:\.(\d+))?$/);
7
6
  /* istanbul ignore if */
8
-
9
7
  if (!match) {
10
8
  return 0;
11
- } // Number of digits right of decimal point.
12
-
13
-
9
+ }
10
+ // Number of digits right of decimal point.
14
11
  return match[1] ? match[1].length : 0;
15
12
  }
16
-
17
13
  export var methods = {
18
14
  required: function required(value) {
19
15
  if (isNullOrUndefined(value)) return false;
20
-
21
16
  if (isString(value)) {
22
17
  return _trimInstanceProperty(value).call(value).length > 0;
23
18
  }
24
-
25
19
  if (Array.isArray(value)) {
26
20
  return value.length > 0;
27
21
  }
28
-
29
22
  return true;
30
23
  },
31
24
  digits: function digits(value) {
@@ -70,11 +63,9 @@ export var methods = {
70
63
  },
71
64
  step: function step(value, param) {
72
65
  var decimals = decimalPlaces(param);
73
-
74
66
  var toInt = function toInt(num) {
75
67
  return Math.round(num * Math.pow(10, decimals));
76
68
  };
77
-
78
69
  return decimalPlaces(value) <= decimals && toInt(value) % toInt(param) === 0;
79
70
  },
80
71
  equal: function equal(value, param) {
@@ -166,7 +157,6 @@ export var classNames = {};
166
157
  export var addMethod = function addMethod(name, method, message, className) {
167
158
  methods[name] = method;
168
159
  messages[name] = message !== undefined ? message : messages[name];
169
-
170
160
  if (className) {
171
161
  classNames[name] = className;
172
162
  }
@@ -8,30 +8,23 @@ var defaults = {
8
8
  item: {
9
9
  gap: "24px",
10
10
  labelWidth: "80px",
11
-
12
11
  get labelHeight() {
13
12
  return theme.default.height;
14
13
  },
15
-
16
14
  labelTextAlign: 'right',
17
15
  labelGap: '16px',
18
-
19
16
  get starColor() {
20
17
  return theme.color.danger;
21
18
  },
22
-
23
19
  starGap: '3px',
24
20
  // invalid
25
21
  errorFontSize: '12px',
26
-
27
22
  get errorColor() {
28
23
  return theme.color.danger;
29
24
  },
30
-
31
25
  get invalidBorder() {
32
26
  return "1px solid " + theme.color.danger;
33
27
  },
34
-
35
28
  // append
36
29
  appendPadding: "0 10px",
37
30
  // layout
@@ -49,15 +42,14 @@ setDefault(function () {
49
42
  form = deepDefaults(theme, {
50
43
  form: defaults
51
44
  }).form;
52
- makeItemStyles == null ? void 0 : makeItemStyles.clearCache();
53
- makeFormStyles == null ? void 0 : makeFormStyles.clearCache();
45
+ makeItemStyles == null || makeItemStyles.clearCache();
46
+ makeFormStyles == null || makeFormStyles.clearCache();
54
47
  });
55
48
  export var makeItemStyles = cache(function makeItemStyles(k) {
56
49
  return /*#__PURE__*/css("display:flex;position:relative;&:not(:last-of-type){margin-bottom:", form.item.gap, ";}&.", k, "-fluid>.", k, "-form-content{flex:1;}.", k, "-form-label{display:flex;align-items:center;justify-content:", form.item.labelTextAlign === 'right' ? 'end' : 'start', ";width:", form.item.labelWidth, ";padding-right:", form.item.labelGap, ";max-height:", form.item.labelHeight, ";flex-shrink:0;}.", k, "-form-star{color:", form.item.starColor, ";margin-right:", form.item.starGap, ";}.", k, "-form-content{position:relative;}.", k, "-form-error{position:absolute;color:", form.item.errorColor, ";font-size:", form.item.errorFontSize, ";left:0;right:0;display:flex;align-items:center;&.", k, "-ellipsis{.", k, "-form-error-more{display:inline-block;}}}.", k, "-form-error-more{line-height:", form.item.errorFontSize, ";display:none;}&.", k, "-invalid{.", k, "-input{.", k, "-input-wrapper{border:", form.item.invalidBorder, ";position:relative;z-index:1;}}.", k, "-select,.", k, "-checkbox-wrapper,.", k, "-radio-wrapper{border:", form.item.invalidBorder, "!important;}.", k, "-select .", k, "-input .", k, "-input-wrapper{border:none;}}.", k, "-form-append{padding:", form.item.appendPadding, ";vertical-align:middle;}");
57
50
  });
58
51
  export var makeFormStyles = cache(function makeFormStyles(k) {
59
52
  var _context;
60
-
61
53
  return /*#__PURE__*/css("&.", k, "-inline{.", k, "-form-item{display:inline-flex;vertical-align:top;margin-right:", form.item.inlineGap, ";}.", k, "-form-label{width:auto;}}&.", k, "-vertical{.", k, "-form-item{flex-direction:column;}.", k, "-form-label{width:auto;text-align:left;padding:0;justify-content:start;margin-bottom:", form.item.verticalLabelGap, ";}}", _mapInstanceProperty(_context = ['small', 'mini']).call(_context, function (size) {
62
54
  return /*#__PURE__*/css("&.", k, "-", size, "{.", k, "-form-item:not(:last-of-type){margin-bottom:", form.item[size + "Gap"], ";}&.", k, "-inline{.", k, "-form-item{margin-right:", form.item[size + "InlineGap"], ";}}}");
63
55
  }), ";");
@@ -3,37 +3,31 @@ import { useState } from '../../hooks/useState';
3
3
  export function useDirty(getValidate) {
4
4
  var instance = useInstance();
5
5
  var isDirty = useState(false);
6
-
7
6
  if (instance.get('validateOnStart')) {
8
7
  dirty();
9
8
  }
10
-
11
9
  function onChange(e) {
12
10
  dirty();
13
11
  instance.trigger('change', e);
14
12
  }
15
-
16
13
  function onFocusout(e) {
17
14
  dirty();
18
15
  instance.trigger('focusout', e);
19
16
  }
20
-
21
17
  function dirty() {
22
18
  if (isDirty.value) return;
23
- isDirty.set(true); // for select, the focusout event triggers before select
19
+ isDirty.set(true);
20
+ // for select, the focusout event triggers before select
24
21
  // so we put off validating it
25
-
26
22
  setTimeout(function () {
27
23
  // maybe it has been unmounted or reset
28
24
  if (instance.$unmounted || !isDirty.value) return;
29
25
  getValidate()();
30
26
  }, 100);
31
27
  }
32
-
33
28
  function reset() {
34
29
  isDirty.set(false);
35
30
  }
36
-
37
31
  return {
38
32
  onChange: onChange,
39
33
  onFocusout: onFocusout,
@@ -2,11 +2,11 @@ import { useInstance, nextTick, createRef } from 'intact-vue-next';
2
2
  import { useState, watchState } from '../../hooks/useState';
3
3
  import { messages as globalMessages, classNames as globalClassNames } from './methods';
4
4
  import { isFunction } from 'intact-shared';
5
- import { createContext } from '../context'; // enum MessageOrClassname {
5
+ import { createContext } from '../context';
6
+ // enum MessageOrClassname {
6
7
  // Message,
7
8
  // ClassName,
8
9
  // }
9
-
10
10
  export var context = createContext();
11
11
  export function useError() {
12
12
  var instance = useInstance();
@@ -16,38 +16,30 @@ export function useError() {
16
16
  watchState(message, function () {
17
17
  nextTick(checkEllipsis);
18
18
  });
19
-
20
19
  function checkEllipsis() {
21
20
  var error = errorRef.value;
22
21
  if (!error) return;
23
22
  ellipsis.set(error.offsetWidth < error.scrollWidth);
24
23
  }
25
-
26
24
  function getErrorMessageOrClassName(type, key) {
27
25
  var custom = instance.get(type);
28
26
  var value = custom && custom[key] || (type === 'messages' ? globalMessages[key] : globalClassNames[key]);
29
-
30
27
  if (isFunction(value)) {
31
28
  var rules = instance.get('rules');
32
29
  return value(instance.get('value'), rules[key]);
33
30
  }
34
-
35
31
  return value;
36
32
  }
37
-
38
33
  function getErrorMessage(key) {
39
34
  return getErrorMessageOrClassName('messages', key);
40
35
  }
41
-
42
36
  function getErrorClassName(key) {
43
37
  return getErrorMessageOrClassName('classNames', key);
44
38
  }
45
-
46
39
  function reset() {
47
40
  ellipsis.set(false);
48
41
  message.set(undefined);
49
42
  }
50
-
51
43
  return {
52
44
  ellipsis: ellipsis,
53
45
  message: message,
@@ -1,5 +1,5 @@
1
1
  import { State } from '../../hooks/useState';
2
- declare type PromiseWithCancelled = Promise<boolean> & {
2
+ type PromiseWithCancelled = Promise<boolean> & {
3
3
  cancelled: boolean;
4
4
  };
5
5
  export declare function useValidate(getErrorMessage: (ruleName: string) => string, getErrorClassName: (ruleName: string) => string, message: State<string | undefined>, isDirty: State<boolean>): {
@@ -10,81 +10,68 @@ export function useValidate(getErrorMessage, getErrorClassName, message, isDirty
10
10
  var errorClassName = useState(undefined);
11
11
  var promise = null;
12
12
  useReceive(['value', 'rules'], validateIfDirty);
13
-
14
13
  function validateIfDirty() {
15
14
  if (isDirty.value) {
16
15
  validate();
17
16
  }
18
17
  }
19
-
20
18
  function validate() {
21
19
  var _instance$get = instance.get(),
22
- rules = _instance$get.rules,
23
- value = _instance$get.value;
24
-
20
+ rules = _instance$get.rules,
21
+ value = _instance$get.value;
25
22
  if (!rules) return true;
26
23
  cancel();
27
24
  var promises = [];
28
- var ruleNames = []; // check required rule firstly, detect whether it is empty or not
29
-
25
+ var ruleNames = [];
26
+ // check required rule firstly, detect whether it is empty or not
30
27
  var required = globalMethods.required(value, true);
31
-
32
28
  if (rules.required) {
33
29
  promises.push(required);
34
30
  ruleNames.push('required');
35
- } // if required rule passed, then check other rules
36
-
37
-
31
+ }
32
+ // if required rule passed, then check other rules
38
33
  if (required) {
39
34
  for (var key in rules) {
40
35
  var rule = rules[key];
41
36
  if (key === 'required' || rule === false) continue;
42
37
  var fn = void 0;
43
-
44
38
  if (isFunction(rule)) {
45
39
  fn = rule;
46
40
  } else {
47
41
  fn = globalMethods[key];
48
42
  /* istanbul ignore if */
49
-
50
43
  if (!fn) {
51
44
  console.warn("Can not find validate method: " + key);
52
45
  continue;
53
46
  }
54
47
  }
55
-
56
48
  promises.push(fn(value, rules[key]));
57
49
  ruleNames.push(key);
58
50
  }
59
51
  }
60
-
61
52
  return promise = _Promise.all(promises).then(function (results) {
62
53
  for (var index = 0; index < results.length; index++) {
63
54
  var result = results[index];
64
-
65
55
  if (result !== true) {
66
56
  var ruleName = ruleNames[index];
67
57
  return [false, result || getErrorMessage(ruleName), getErrorClassName(ruleName)];
68
58
  }
69
59
  }
70
-
71
60
  return [true, message.value, undefined];
72
61
  }, function (err) {
73
62
  var message;
74
63
  var className;
75
-
76
64
  if (isString(err)) {
77
65
  message = err;
78
66
  } else if (err) {
79
67
  message = err.message || getErrorMessage(err.name);
80
68
  className = err.className || getErrorClassName(err.name);
81
69
  }
82
-
83
70
  return [false, message, className];
84
71
  }).then(function (_ref) {
85
72
  var _isValid = _ref[0],
86
- _message = _ref[1],
87
- _className = _ref[2];
73
+ _message = _ref[1],
74
+ _className = _ref[2];
88
75
  // if cancelled, should return the last result
89
76
  if (promise.cancelled) return isValid.value;
90
77
  isDirty.set(true);
@@ -94,19 +81,16 @@ export function useValidate(getErrorMessage, getErrorClassName, message, isDirty
94
81
  return _isValid;
95
82
  });
96
83
  }
97
-
98
84
  function cancel() {
99
85
  if (promise) {
100
86
  promise.cancelled = true;
101
87
  }
102
88
  }
103
-
104
89
  function reset() {
105
90
  isValid.set(true);
106
91
  errorClassName.set(undefined);
107
92
  cancel();
108
93
  }
109
-
110
94
  return {
111
95
  isValid: isValid,
112
96
  errorClassName: errorClassName,
@@ -1,14 +1,14 @@
1
1
  import { Component, TypeDefs } from 'intact-vue-next';
2
2
  import { PrimitiveValue, BreakpointValues } from './constants';
3
- export declare type BaseColProps = {
3
+ export type BaseColProps = {
4
4
  span?: PrimitiveValue;
5
5
  offset?: PrimitiveValue;
6
6
  order?: PrimitiveValue;
7
7
  pull?: PrimitiveValue;
8
8
  push?: PrimitiveValue;
9
9
  };
10
- export declare type BreakpointProps = BreakpointValues<keyof BaseColProps>;
11
- export declare type ColProps = BaseColProps & BreakpointProps;
10
+ export type BreakpointProps = BreakpointValues<keyof BaseColProps>;
11
+ export type ColProps = BaseColProps & BreakpointProps;
12
12
  export declare const baseTypeDefs: Required<TypeDefs<BaseColProps>>;
13
13
  export declare class Col extends Component<ColProps> {
14
14
  static template: string | import('intact-vue-next').Template<any>;
@@ -13,30 +13,23 @@ export var baseTypeDefs = {
13
13
  pull: PrimitiveValue,
14
14
  push: PrimitiveValue
15
15
  };
16
-
17
16
  var typeDefs = _extends({}, baseTypeDefs, breakpoints.reduce(function (memo, key) {
18
17
  memo[key] = Value;
19
18
  return memo;
20
19
  }, {}));
21
-
22
20
  export var Col = /*#__PURE__*/function (_Component) {
23
21
  _inheritsLoose(Col, _Component);
24
-
25
22
  function Col() {
26
23
  var _context;
27
-
28
24
  var _this;
29
-
30
25
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
31
26
  args[_key] = arguments[_key];
32
27
  }
33
-
34
28
  _this = _Component.call.apply(_Component, _concatInstanceProperty(_context = [this]).call(_context, args)) || this;
35
29
  _this.breakpoints = useBreakpoints();
36
30
  _this.config = useConfigContext();
37
31
  return _this;
38
32
  }
39
-
40
33
  return Col;
41
34
  }(Component);
42
35
  Col.template = template;
@@ -5,28 +5,23 @@ import { makeColStyles } from './styles';
5
5
  import { context as GutterContext, gutterStyle } from './useGutter';
6
6
  export default function ($props, $blocks, $__proto__) {
7
7
  var _this = this;
8
-
9
8
  $blocks || ($blocks = {});
10
9
  $props || ($props = {});
11
10
  var $this = this;
12
-
13
11
  var _this$get = this.get(),
14
- className = _this$get.className,
15
- _children = _this$get.children,
16
- span = _this$get.span,
17
- style = _this$get.style,
18
- offset = _this$get.offset,
19
- push = _this$get.push,
20
- pull = _this$get.pull,
21
- order = _this$get.order;
22
-
12
+ className = _this$get.className,
13
+ _children = _this$get.children,
14
+ span = _this$get.span,
15
+ style = _this$get.style,
16
+ offset = _this$get.offset,
17
+ push = _this$get.push,
18
+ pull = _this$get.pull,
19
+ order = _this$get.order;
23
20
  var k = this.config.k;
24
21
  return _$cc(GutterContext.Consumer, {
25
22
  'children': function children(gutter) {
26
23
  var _extends2, _$cn2;
27
-
28
24
  var classNameObj = _extends((_extends2 = {}, _extends2[k + "-col"] = true, _extends2[k + "-" + span] = span, _extends2[k + "-offset-" + offset] = offset, _extends2[k + "-pull-" + pull] = pull, _extends2[k + "-push-" + push] = push, _extends2[k + "-order-" + order] = order, _extends2[className] = className && !gutter, _extends2[makeColStyles(k)] = true, _extends2), _this.breakpoints.getBreakpointsClassName(k));
29
-
30
25
  var newStyle = gutter ? gutterStyle(gutter, style, 'padding') : style;
31
26
  return _$cv('div', _extends({
32
27
  'className': _$cn(classNameObj)
@@ -1,13 +1,13 @@
1
- export declare type Breakpoint = 'xxl' | 'xl' | 'lg' | 'md' | 'sm' | 'xs';
2
- export declare type PrimitiveValue = string | number;
3
- export declare type BreakpointValue = {
1
+ export type Breakpoint = 'xxl' | 'xl' | 'lg' | 'md' | 'sm' | 'xs';
2
+ export type PrimitiveValue = string | number;
3
+ export type BreakpointValue = {
4
4
  [key in Breakpoint]?: PrimitiveValue;
5
5
  };
6
- export declare type Value = PrimitiveValue | BreakpointValue;
7
- export declare type BreakpointPropsValues<T extends string> = {
6
+ export type Value = PrimitiveValue | BreakpointValue;
7
+ export type BreakpointPropsValues<T extends string> = {
8
8
  [key in T]?: PrimitiveValue;
9
9
  };
10
- export declare type BreakpointValues<T extends string> = {
10
+ export type BreakpointValues<T extends string> = {
11
11
  [key in Breakpoint]?: PrimitiveValue | null | undefined | BreakpointPropsValues<T>;
12
12
  };
13
13
  export declare const Value: (ObjectConstructor | StringConstructor | NumberConstructor)[];
@@ -12,22 +12,17 @@ var typeDefs = {
12
12
  };
13
13
  export var Row = /*#__PURE__*/function (_Component) {
14
14
  _inheritsLoose(Row, _Component);
15
-
16
15
  function Row() {
17
16
  var _context;
18
-
19
17
  var _this;
20
-
21
18
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
22
19
  args[_key] = arguments[_key];
23
20
  }
24
-
25
21
  _this = _Component.call.apply(_Component, _concatInstanceProperty(_context = [this]).call(_context, args)) || this;
26
22
  _this.gutter = useGutter();
27
23
  _this.config = useConfigContext();
28
24
  return _this;
29
25
  }
30
-
31
26
  return Row;
32
27
  }(Component);
33
28
  Row.template = template;