@sheinx/hooks 3.0.0-rc.2 → 3.0.0-rc.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 (595) hide show
  1. package/cjs/common/type.d.ts +15 -15
  2. package/cjs/common/type.d.ts.map +1 -1
  3. package/cjs/common/use-click-away/index.d.ts +2 -2
  4. package/cjs/common/use-click-away/index.d.ts.map +1 -1
  5. package/cjs/common/use-click-away/index.js +2 -3
  6. package/cjs/common/use-default-value/index.js +2 -2
  7. package/cjs/common/use-default-value/use-default-value.js +9 -5
  8. package/cjs/common/use-drag-mock/index.js +2 -2
  9. package/cjs/common/use-drag-mock/use-drag-mock.js +11 -8
  10. package/cjs/common/use-drag-mock/use-drag-move.js +15 -11
  11. package/cjs/common/use-drag-mock/use-drag-resize.js +9 -5
  12. package/cjs/common/use-filter/index.js +2 -2
  13. package/cjs/common/use-filter/use-filter.js +17 -13
  14. package/cjs/common/use-fork-ref/index.js +5 -10
  15. package/cjs/common/use-func-change/index.js +2 -2
  16. package/cjs/common/use-func-change/use-func-change.d.ts +1 -1
  17. package/cjs/common/use-func-change/use-func-change.js +2 -3
  18. package/cjs/common/use-input-able/index.js +2 -2
  19. package/cjs/common/use-input-able/use-Input-able.js +8 -4
  20. package/cjs/common/use-input-able/use-Input-able.type.d.ts +1 -1
  21. package/cjs/common/use-input-able/use-Input-able.type.d.ts.map +1 -1
  22. package/cjs/common/use-key-event/index.js +6 -8
  23. package/cjs/common/use-latest-obj/index.js +1 -3
  24. package/cjs/common/use-list-select/index.js +2 -2
  25. package/cjs/common/use-list-select/use-list-select-multiple.js +20 -29
  26. package/cjs/common/use-list-select/use-list-select-single.js +9 -11
  27. package/cjs/common/use-list-select/use-list-select.js +10 -12
  28. package/cjs/common/use-pagination-list/index.js +17 -15
  29. package/cjs/common/use-persist-fn/index.js +1 -2
  30. package/cjs/common/use-position-style/get-position-style.js +10 -7
  31. package/cjs/common/use-position-style/index.d.ts +3 -3
  32. package/cjs/common/use-position-style/index.d.ts.map +1 -1
  33. package/cjs/common/use-position-style/index.js +16 -22
  34. package/cjs/common/use-previous/index.js +1 -2
  35. package/cjs/common/use-render/index.js +8 -5
  36. package/cjs/common/use-resize/index.js +11 -9
  37. package/cjs/common/use-safe-state/index.js +8 -5
  38. package/cjs/common/use-style/index.js +0 -2
  39. package/cjs/common/use-toggle/index.d.ts +1 -1
  40. package/cjs/common/use-toggle/index.d.ts.map +1 -1
  41. package/cjs/common/use-toggle/index.js +7 -3
  42. package/cjs/common/use-transform/index.js +2 -2
  43. package/cjs/common/use-transform/use-transform.js +13 -11
  44. package/cjs/common/use-unmounted-ref/index.js +1 -2
  45. package/cjs/components/use-button/index.js +2 -2
  46. package/cjs/components/use-button/use-button.d.ts +3 -3
  47. package/cjs/components/use-button/use-button.js +12 -13
  48. package/cjs/components/use-button/use-button.type.d.ts +3 -3
  49. package/cjs/components/use-button/use-button.type.d.ts.map +1 -1
  50. package/cjs/components/use-carousel/index.js +2 -2
  51. package/cjs/components/use-carousel/use-carousel.d.ts +1 -1
  52. package/cjs/components/use-carousel/use-carousel.d.ts.map +1 -1
  53. package/cjs/components/use-carousel/use-carousel.js +9 -5
  54. package/cjs/components/use-cascader/index.js +2 -2
  55. package/cjs/components/use-cascader/use-cascader.js +2 -3
  56. package/cjs/components/use-check/index.js +2 -2
  57. package/cjs/components/use-check/use-check.d.ts +3 -3
  58. package/cjs/components/use-check/use-check.js +24 -17
  59. package/cjs/components/use-collapse/index.js +2 -2
  60. package/cjs/components/use-collapse/use-collapse-item.d.ts +4 -4
  61. package/cjs/components/use-collapse/use-collapse-item.js +7 -10
  62. package/cjs/components/use-collapse/use-collapse-item.type.d.ts +1 -1
  63. package/cjs/components/use-collapse/use-collapse-item.type.d.ts.map +1 -1
  64. package/cjs/components/use-collapse/use-collapse.js +14 -13
  65. package/cjs/components/use-datepicker/index.js +2 -2
  66. package/cjs/components/use-datepicker/use-date.js +13 -11
  67. package/cjs/components/use-datepicker/use-datepicker-format.js +26 -21
  68. package/cjs/components/use-datepicker/use-datepicker-format.type.d.ts +4 -4
  69. package/cjs/components/use-datepicker/use-datepicker-format.type.d.ts.map +1 -1
  70. package/cjs/components/use-datepicker/use-datepicker-range.js +10 -7
  71. package/cjs/components/use-datepicker/use-datepicker-range.type.d.ts +1 -1
  72. package/cjs/components/use-datepicker/use-datepicker-range.type.d.ts.map +1 -1
  73. package/cjs/components/use-datepicker/use-month.js +13 -11
  74. package/cjs/components/use-datepicker/use-quarter.js +13 -12
  75. package/cjs/components/use-datepicker/use-time.js +3 -8
  76. package/cjs/components/use-datepicker/use-year.js +13 -11
  77. package/cjs/components/use-datepicker/util.d.ts +3 -3
  78. package/cjs/components/use-datepicker/util.d.ts.map +1 -1
  79. package/cjs/components/use-datepicker/util.js +13 -20
  80. package/cjs/components/use-descriptions/index.js +2 -2
  81. package/cjs/components/use-descriptions/use-descriptions.js +14 -11
  82. package/cjs/components/use-form/Provider.js +6 -10
  83. package/cjs/components/use-form/form-bind-context.js +6 -11
  84. package/cjs/components/use-form/form-config-context.js +6 -11
  85. package/cjs/components/use-form/form-func-context.js +6 -11
  86. package/cjs/components/use-form/index.js +2 -3
  87. package/cjs/components/use-form/use-form-control/index.js +2 -2
  88. package/cjs/components/use-form/use-form-control/use-form-control.js +23 -23
  89. package/cjs/components/use-form/use-form-fieldset/fieldset-context.js +10 -19
  90. package/cjs/components/use-form/use-form-fieldset/index.js +2 -2
  91. package/cjs/components/use-form/use-form-fieldset/use-form-fieldset.js +3 -5
  92. package/cjs/components/use-form/use-form-flow/index.js +2 -2
  93. package/cjs/components/use-form/use-form-flow/use-form-datum.js +1 -2
  94. package/cjs/components/use-form/use-form-flow/use-form-flow.js +2 -3
  95. package/cjs/components/use-form/use-form-item/form-item-context.js +5 -9
  96. package/cjs/components/use-form/use-form-item/index.js +2 -2
  97. package/cjs/components/use-form/use-form-item/use-form-item.js +12 -13
  98. package/cjs/components/use-form/use-form.d.ts +2 -2
  99. package/cjs/components/use-form/use-form.js +28 -37
  100. package/cjs/components/use-form/use-form.type.d.ts +4 -4
  101. package/cjs/components/use-form/use-form.type.d.ts.map +1 -1
  102. package/cjs/components/use-image/index.js +2 -2
  103. package/cjs/components/use-image/use-image-gallery.d.ts +4 -4
  104. package/cjs/components/use-image/use-image-gallery.d.ts.map +1 -1
  105. package/cjs/components/use-image/use-image-gallery.js +18 -15
  106. package/cjs/components/use-image/use-image-gallery.type.d.ts +1 -1
  107. package/cjs/components/use-image/use-image-gallery.type.d.ts.map +1 -1
  108. package/cjs/components/use-image/use-image-group.d.ts +2 -2
  109. package/cjs/components/use-image/use-image-group.d.ts.map +1 -1
  110. package/cjs/components/use-image/use-image-group.js +9 -12
  111. package/cjs/components/use-image/use-image-magnify.js +13 -13
  112. package/cjs/components/use-image/use-image.d.ts +3 -3
  113. package/cjs/components/use-image/use-image.d.ts.map +1 -1
  114. package/cjs/components/use-image/use-image.js +17 -23
  115. package/cjs/components/use-image/use-image.type.d.ts +4 -4
  116. package/cjs/components/use-image/use-image.type.d.ts.map +1 -1
  117. package/cjs/components/use-input/index.js +2 -2
  118. package/cjs/components/use-input/use-input-format.d.ts +1 -1
  119. package/cjs/components/use-input/use-input-format.js +13 -15
  120. package/cjs/components/use-input/use-input-format.type.d.ts +1 -1
  121. package/cjs/components/use-input/use-input-format.type.d.ts.map +1 -1
  122. package/cjs/components/use-input/use-input-number.d.ts +1 -1
  123. package/cjs/components/use-input/use-input-number.js +15 -16
  124. package/cjs/components/use-input/use-input-number.type.d.ts +1 -1
  125. package/cjs/components/use-input/use-input-number.type.d.ts.map +1 -1
  126. package/cjs/components/use-input/use-input-password.js +11 -9
  127. package/cjs/components/use-input/use-input-password.type.d.ts +1 -1
  128. package/cjs/components/use-input/use-input-password.type.d.ts.map +1 -1
  129. package/cjs/components/use-input/use-input.d.ts +3 -3
  130. package/cjs/components/use-input/use-input.js +30 -29
  131. package/cjs/components/use-input/use-input.type.d.ts +5 -5
  132. package/cjs/components/use-input/use-input.type.d.ts.map +1 -1
  133. package/cjs/components/use-menu/index.js +2 -2
  134. package/cjs/components/use-menu/use-menu-item.d.ts +1 -1
  135. package/cjs/components/use-menu/use-menu-item.d.ts.map +1 -1
  136. package/cjs/components/use-menu/use-menu-item.js +11 -12
  137. package/cjs/components/use-menu/use-menu.js +2 -8
  138. package/cjs/components/use-menu/use-menu.type.d.ts +1 -1
  139. package/cjs/components/use-menu/use-menu.type.d.ts.map +1 -1
  140. package/cjs/components/use-pagination/index.js +2 -2
  141. package/cjs/components/use-pagination/use-pagination.d.ts +1 -1
  142. package/cjs/components/use-pagination/use-pagination.js +16 -13
  143. package/cjs/components/use-popup/index.js +2 -2
  144. package/cjs/components/use-popup/popup-context.js +1 -2
  145. package/cjs/components/use-popup/use-popup.js +14 -11
  146. package/cjs/components/use-popup/use-popup.type.d.ts +1 -1
  147. package/cjs/components/use-popup/use-popup.type.d.ts.map +1 -1
  148. package/cjs/components/use-select/index.js +2 -2
  149. package/cjs/components/use-select/use-select-group.js +13 -10
  150. package/cjs/components/use-select/use-select.js +1 -2
  151. package/cjs/components/use-select/use-select.type.d.ts +1 -1
  152. package/cjs/components/use-select/use-select.type.d.ts.map +1 -1
  153. package/cjs/components/use-slider/index.js +2 -2
  154. package/cjs/components/use-slider/use-slider.js +15 -10
  155. package/cjs/components/use-table/index.js +2 -2
  156. package/cjs/components/use-table/use-table-columns.d.ts +1 -1
  157. package/cjs/components/use-table/use-table-columns.d.ts.map +1 -1
  158. package/cjs/components/use-table/use-table-columns.js +4 -8
  159. package/cjs/components/use-table/use-table-expand.js +19 -20
  160. package/cjs/components/use-table/use-table-group.js +1 -7
  161. package/cjs/components/use-table/use-table-layout.js +34 -34
  162. package/cjs/components/use-table/use-table-row.js +8 -9
  163. package/cjs/components/use-table/use-table-sort.d.ts +1 -1
  164. package/cjs/components/use-table/use-table-sort.d.ts.map +1 -1
  165. package/cjs/components/use-table/use-table-sort.js +21 -22
  166. package/cjs/components/use-table/use-table-tree.js +19 -26
  167. package/cjs/components/use-table/use-table-virtual.js +17 -13
  168. package/cjs/components/use-table/use-table.type.d.ts +4 -4
  169. package/cjs/components/use-table/use-table.type.d.ts.map +1 -1
  170. package/cjs/components/use-tabs/context.js +7 -13
  171. package/cjs/components/use-tabs/index.js +2 -2
  172. package/cjs/components/use-tabs/use-tabs.js +9 -6
  173. package/cjs/components/use-tabs/use-tabs.type.d.ts +1 -1
  174. package/cjs/components/use-tabs/use-tabs.type.d.ts.map +1 -1
  175. package/cjs/components/use-textarea/index.js +2 -2
  176. package/cjs/components/use-textarea/use-textarea-format.js +5 -7
  177. package/cjs/components/use-textarea/use-textarea-format.type.d.ts +1 -1
  178. package/cjs/components/use-textarea/use-textarea-format.type.d.ts.map +1 -1
  179. package/cjs/components/use-textarea/use-textarea.d.ts +2 -2
  180. package/cjs/components/use-textarea/use-textarea.js +23 -18
  181. package/cjs/components/use-textarea/use-textarea.type.d.ts +3 -3
  182. package/cjs/components/use-textarea/use-textarea.type.d.ts.map +1 -1
  183. package/cjs/components/use-transfer/index.js +2 -2
  184. package/cjs/components/use-transfer/use-transfer.js +20 -19
  185. package/cjs/components/use-transfer/use-transfer.type.d.ts +1 -1
  186. package/cjs/components/use-transfer/use-transfer.type.d.ts.map +1 -1
  187. package/cjs/components/use-tree/index.js +2 -2
  188. package/cjs/components/use-tree/use-tree-node.js +11 -7
  189. package/cjs/components/use-tree/use-tree-node.type.d.ts +2 -2
  190. package/cjs/components/use-tree/use-tree-node.type.d.ts.map +1 -1
  191. package/cjs/components/use-tree/use-tree.js +11 -16
  192. package/cjs/components/use-tree/use-tree.type.d.ts +3 -3
  193. package/cjs/components/use-tree/use-tree.type.d.ts.map +1 -1
  194. package/cjs/components/use-treeselect/index.js +2 -2
  195. package/cjs/components/use-treeselect/use-tiled.js +13 -9
  196. package/cjs/components/use-treeselect/use-tiled.type.d.ts +1 -1
  197. package/cjs/components/use-treeselect/use-tiled.type.d.ts.map +1 -1
  198. package/cjs/components/use-treeselect/use-treeselect.js +1 -2
  199. package/cjs/components/use-upload/index.js +2 -2
  200. package/cjs/components/use-upload/use-upload.js +36 -34
  201. package/cjs/components/use-upload/xhr.js +0 -1
  202. package/cjs/components/use-validate/index.js +2 -2
  203. package/cjs/components/use-validate/use-validate.js +9 -5
  204. package/cjs/index.js +4 -9
  205. package/cjs/utils/accept.d.ts +1 -1
  206. package/cjs/utils/accept.d.ts.map +1 -1
  207. package/cjs/utils/accept.js +0 -4
  208. package/cjs/utils/array.js +2 -4
  209. package/cjs/utils/attribute.js +3 -5
  210. package/cjs/utils/clone.js +11 -20
  211. package/cjs/utils/document.js +2 -4
  212. package/cjs/utils/dom/element.js +11 -11
  213. package/cjs/utils/dom/index.js +2 -3
  214. package/cjs/utils/dom/responsiveObserve.js +10 -15
  215. package/cjs/utils/dom/responsiveObserve.type.d.ts +4 -4
  216. package/cjs/utils/dom/responsiveObserve.type.d.ts.map +1 -1
  217. package/cjs/utils/dom/scroll-behavior.js +2 -3
  218. package/cjs/utils/extract-event-handlers.js +0 -6
  219. package/cjs/utils/func.js +3 -5
  220. package/cjs/utils/immer.d.ts +1 -8
  221. package/cjs/utils/immer.d.ts.map +1 -1
  222. package/cjs/utils/immer.js +11 -8
  223. package/cjs/utils/index.js +2 -3
  224. package/cjs/utils/is.d.ts +1 -1
  225. package/cjs/utils/is.d.ts.map +1 -1
  226. package/cjs/utils/is.js +30 -55
  227. package/cjs/utils/lazyload.d.ts +1 -1
  228. package/cjs/utils/lazyload.d.ts.map +1 -1
  229. package/cjs/utils/lazyload.js +0 -1
  230. package/cjs/utils/number.js +0 -7
  231. package/cjs/utils/object.d.ts +4 -4
  232. package/cjs/utils/object.d.ts.map +1 -1
  233. package/cjs/utils/object.js +18 -37
  234. package/cjs/utils/position.js +4 -3
  235. package/cjs/utils/react-render.d.ts +1 -1
  236. package/cjs/utils/react-render.d.ts.map +1 -1
  237. package/cjs/utils/react-render.js +17 -24
  238. package/cjs/utils/render.d.ts +1 -1
  239. package/cjs/utils/render.d.ts.map +1 -1
  240. package/cjs/utils/render.js +3 -5
  241. package/cjs/utils/rule/index.js +2 -2
  242. package/cjs/utils/rule/length.d.ts +1 -1
  243. package/cjs/utils/rule/length.js +9 -11
  244. package/cjs/utils/rule/regexp.d.ts +1 -1
  245. package/cjs/utils/rule/regexp.js +4 -9
  246. package/cjs/utils/rule/required.d.ts +1 -1
  247. package/cjs/utils/rule/required.js +3 -5
  248. package/cjs/utils/rule/rule.js +4 -9
  249. package/cjs/utils/rule/rule.type.d.ts +8 -8
  250. package/cjs/utils/rule/rule.type.d.ts.map +1 -1
  251. package/cjs/utils/rule/type.d.ts +1 -1
  252. package/cjs/utils/rule/type.js +3 -5
  253. package/cjs/utils/shallow-equal.js +4 -9
  254. package/cjs/utils/string.js +0 -7
  255. package/cjs/utils/style-unit.js +0 -2
  256. package/cjs/utils/tree.d.ts +1 -1
  257. package/cjs/utils/tree.d.ts.map +1 -1
  258. package/cjs/utils/tree.js +19 -21
  259. package/cjs/utils/uid.js +0 -11
  260. package/cjs/utils/validate/error.js +22 -18
  261. package/cjs/utils/validate/get-rule.js +1 -4
  262. package/cjs/utils/validate/index.d.ts +1 -1
  263. package/cjs/utils/validate/index.d.ts.map +1 -1
  264. package/cjs/utils/validate/index.js +13 -13
  265. package/cjs/utils/validate/isJson.js +2 -5
  266. package/cjs/utils/validate/nullable.js +2 -3
  267. package/cjs/utils/validate/type.d.ts +1 -1
  268. package/cjs/utils/validate/type.d.ts.map +1 -1
  269. package/cjs/utils/validate/type.js +4 -9
  270. package/esm/common/type.d.ts +15 -15
  271. package/esm/common/type.d.ts.map +1 -1
  272. package/esm/common/type.js +1 -5
  273. package/esm/common/use-click-away/index.d.ts +2 -2
  274. package/esm/common/use-click-away/index.d.ts.map +1 -1
  275. package/esm/common/use-click-away/index.js +8 -17
  276. package/esm/common/use-default-value/index.js +2 -26
  277. package/esm/common/use-default-value/use-default-value.js +16 -19
  278. package/esm/common/use-default-value/use-previous.js +4 -10
  279. package/esm/common/use-drag-mock/index.js +3 -33
  280. package/esm/common/use-drag-mock/use-drag-mock.js +17 -20
  281. package/esm/common/use-drag-mock/use-drag-move.js +25 -28
  282. package/esm/common/use-drag-mock/use-drag-resize.js +19 -22
  283. package/esm/common/use-filter/index.js +1 -19
  284. package/esm/common/use-filter/use-filter.js +34 -36
  285. package/esm/common/use-filter/use-filter.type.js +1 -5
  286. package/esm/common/use-fork-ref/index.js +5 -20
  287. package/esm/common/use-fork-ref/setRef.js +1 -7
  288. package/esm/common/use-func-change/index.js +1 -19
  289. package/esm/common/use-func-change/use-func-change.d.ts +1 -1
  290. package/esm/common/use-func-change/use-func-change.js +8 -16
  291. package/esm/common/use-input-able/index.js +1 -19
  292. package/esm/common/use-input-able/use-Input-able.js +25 -28
  293. package/esm/common/use-input-able/use-Input-able.type.d.ts +1 -1
  294. package/esm/common/use-input-able/use-Input-able.type.d.ts.map +1 -1
  295. package/esm/common/use-input-able/use-Input-able.type.js +1 -5
  296. package/esm/common/use-key-event/index.js +7 -15
  297. package/esm/common/use-latest-obj/index.js +4 -12
  298. package/esm/common/use-list-select/index.js +3 -33
  299. package/esm/common/use-list-select/use-list-select-multiple.js +35 -54
  300. package/esm/common/use-list-select/use-list-select-single.js +17 -26
  301. package/esm/common/use-list-select/use-list-select.js +16 -25
  302. package/esm/common/use-list-select/use-list.type.js +1 -5
  303. package/esm/common/use-pagination-list/index.js +22 -26
  304. package/esm/common/use-persist-fn/index.js +5 -11
  305. package/esm/common/use-position-style/get-position-style.js +10 -13
  306. package/esm/common/use-position-style/index.d.ts +3 -3
  307. package/esm/common/use-position-style/index.d.ts.map +1 -1
  308. package/esm/common/use-position-style/index.js +25 -41
  309. package/esm/common/use-previous/index.js +5 -13
  310. package/esm/common/use-render/index.js +15 -19
  311. package/esm/common/use-resize/index.js +17 -21
  312. package/esm/common/use-safe-state/index.js +15 -19
  313. package/esm/common/use-style/index.js +3 -11
  314. package/esm/common/use-toggle/index.d.ts +1 -1
  315. package/esm/common/use-toggle/index.d.ts.map +1 -1
  316. package/esm/common/use-toggle/index.js +12 -14
  317. package/esm/common/use-transform/index.js +1 -19
  318. package/esm/common/use-transform/use-transform.js +23 -27
  319. package/esm/common/use-transform/use-transform.type.js +1 -5
  320. package/esm/common/use-unmounted-ref/index.js +5 -13
  321. package/esm/components/use-button/index.js +1 -19
  322. package/esm/components/use-button/use-button-group.type.js +1 -5
  323. package/esm/components/use-button/use-button.d.ts +3 -3
  324. package/esm/components/use-button/use-button.js +17 -24
  325. package/esm/components/use-button/use-button.type.d.ts +3 -3
  326. package/esm/components/use-button/use-button.type.d.ts.map +1 -1
  327. package/esm/components/use-button/use-button.type.js +1 -5
  328. package/esm/components/use-carousel/index.js +1 -19
  329. package/esm/components/use-carousel/use-carousel.d.ts +1 -1
  330. package/esm/components/use-carousel/use-carousel.d.ts.map +1 -1
  331. package/esm/components/use-carousel/use-carousel.js +21 -24
  332. package/esm/components/use-cascader/index.js +1 -19
  333. package/esm/components/use-cascader/use-cascader.js +5 -13
  334. package/esm/components/use-cascader/use-cascader.type.js +1 -5
  335. package/esm/components/use-check/index.js +1 -19
  336. package/esm/components/use-check/use-check.d.ts +3 -3
  337. package/esm/components/use-check/use-check.js +32 -31
  338. package/esm/components/use-check/use-check.type.js +1 -5
  339. package/esm/components/use-collapse/index.js +2 -26
  340. package/esm/components/use-collapse/use-collapse-item.d.ts +4 -4
  341. package/esm/components/use-collapse/use-collapse-item.js +9 -18
  342. package/esm/components/use-collapse/use-collapse-item.type.d.ts +1 -1
  343. package/esm/components/use-collapse/use-collapse-item.type.d.ts.map +1 -1
  344. package/esm/components/use-collapse/use-collapse-item.type.js +1 -5
  345. package/esm/components/use-collapse/use-collapse.js +17 -22
  346. package/esm/components/use-collapse/use-collapse.type.js +1 -5
  347. package/esm/components/use-datepicker/index.js +8 -62
  348. package/esm/components/use-datepicker/use-date.js +53 -57
  349. package/esm/components/use-datepicker/use-date.type.js +1 -5
  350. package/esm/components/use-datepicker/use-datepicker-format.js +54 -56
  351. package/esm/components/use-datepicker/use-datepicker-format.type.d.ts +4 -4
  352. package/esm/components/use-datepicker/use-datepicker-format.type.d.ts.map +1 -1
  353. package/esm/components/use-datepicker/use-datepicker-format.type.js +1 -5
  354. package/esm/components/use-datepicker/use-datepicker-range.js +43 -47
  355. package/esm/components/use-datepicker/use-datepicker-range.type.d.ts +1 -1
  356. package/esm/components/use-datepicker/use-datepicker-range.type.d.ts.map +1 -1
  357. package/esm/components/use-datepicker/use-datepicker-range.type.js +1 -5
  358. package/esm/components/use-datepicker/use-month.js +37 -41
  359. package/esm/components/use-datepicker/use-month.type.js +1 -5
  360. package/esm/components/use-datepicker/use-quarter.js +36 -41
  361. package/esm/components/use-datepicker/use-quarter.type.js +1 -5
  362. package/esm/components/use-datepicker/use-time.js +23 -35
  363. package/esm/components/use-datepicker/use-time.type.js +1 -5
  364. package/esm/components/use-datepicker/use-year.js +37 -41
  365. package/esm/components/use-datepicker/use-year.type.js +1 -5
  366. package/esm/components/use-datepicker/util.d.ts +3 -3
  367. package/esm/components/use-datepicker/util.d.ts.map +1 -1
  368. package/esm/components/use-datepicker/util.js +67 -80
  369. package/esm/components/use-descriptions/index.js +1 -19
  370. package/esm/components/use-descriptions/use-descriptions.js +24 -27
  371. package/esm/components/use-descriptions/use-descriptions.type.js +1 -5
  372. package/esm/components/use-form/Provider.js +12 -26
  373. package/esm/components/use-form/form-bind-context.js +4 -17
  374. package/esm/components/use-form/form-config-context.js +4 -17
  375. package/esm/components/use-form/form-func-context.js +4 -17
  376. package/esm/components/use-form/index.js +7 -87
  377. package/esm/components/use-form/use-form-control/index.js +1 -19
  378. package/esm/components/use-form/use-form-control/use-form-control.js +57 -66
  379. package/esm/components/use-form/use-form-control/use-form-control.type.js +1 -5
  380. package/esm/components/use-form/use-form-fieldset/fieldset-context.js +13 -29
  381. package/esm/components/use-form/use-form-fieldset/index.js +2 -26
  382. package/esm/components/use-form/use-form-fieldset/use-form-fieldset.js +6 -15
  383. package/esm/components/use-form/use-form-fieldset/use-form-fieldset.type.js +1 -5
  384. package/esm/components/use-form/use-form-flow/index.js +2 -26
  385. package/esm/components/use-form/use-form-flow/use-form-datum.js +4 -11
  386. package/esm/components/use-form/use-form-flow/use-form-flow.js +9 -17
  387. package/esm/components/use-form/use-form-flow/use-form-flow.type.js +1 -5
  388. package/esm/components/use-form/use-form-item/form-item-context.js +3 -15
  389. package/esm/components/use-form/use-form-item/index.js +1 -19
  390. package/esm/components/use-form/use-form-item/use-form-item.js +21 -32
  391. package/esm/components/use-form/use-form.d.ts +2 -2
  392. package/esm/components/use-form/use-form.js +65 -83
  393. package/esm/components/use-form/use-form.type.d.ts +4 -4
  394. package/esm/components/use-form/use-form.type.d.ts.map +1 -1
  395. package/esm/components/use-form/use-form.type.js +1 -5
  396. package/esm/components/use-image/index.js +4 -40
  397. package/esm/components/use-image/use-image-gallery.d.ts +4 -4
  398. package/esm/components/use-image/use-image-gallery.d.ts.map +1 -1
  399. package/esm/components/use-image/use-image-gallery.js +34 -37
  400. package/esm/components/use-image/use-image-gallery.type.d.ts +1 -1
  401. package/esm/components/use-image/use-image-gallery.type.d.ts.map +1 -1
  402. package/esm/components/use-image/use-image-gallery.type.js +1 -5
  403. package/esm/components/use-image/use-image-group.d.ts +2 -2
  404. package/esm/components/use-image/use-image-group.d.ts.map +1 -1
  405. package/esm/components/use-image/use-image-group.js +15 -24
  406. package/esm/components/use-image/use-image-group.type.js +1 -5
  407. package/esm/components/use-image/use-image-magnify.js +17 -26
  408. package/esm/components/use-image/use-image-magnify.type.js +1 -5
  409. package/esm/components/use-image/use-image.d.ts +3 -3
  410. package/esm/components/use-image/use-image.d.ts.map +1 -1
  411. package/esm/components/use-image/use-image.js +28 -41
  412. package/esm/components/use-image/use-image.type.d.ts +4 -4
  413. package/esm/components/use-image/use-image.type.d.ts.map +1 -1
  414. package/esm/components/use-image/use-image.type.js +1 -5
  415. package/esm/components/use-input/index.js +4 -40
  416. package/esm/components/use-input/use-input-format.d.ts +1 -1
  417. package/esm/components/use-input/use-input-format.js +18 -27
  418. package/esm/components/use-input/use-input-format.type.d.ts +1 -1
  419. package/esm/components/use-input/use-input-format.type.d.ts.map +1 -1
  420. package/esm/components/use-input/use-input-format.type.js +1 -5
  421. package/esm/components/use-input/use-input-number.d.ts +1 -1
  422. package/esm/components/use-input/use-input-number.js +23 -31
  423. package/esm/components/use-input/use-input-number.type.d.ts +1 -1
  424. package/esm/components/use-input/use-input-number.type.d.ts.map +1 -1
  425. package/esm/components/use-input/use-input-number.type.js +1 -5
  426. package/esm/components/use-input/use-input-password.js +16 -21
  427. package/esm/components/use-input/use-input-password.type.d.ts +1 -1
  428. package/esm/components/use-input/use-input-password.type.d.ts.map +1 -1
  429. package/esm/components/use-input/use-input-password.type.js +1 -5
  430. package/esm/components/use-input/use-input.d.ts +3 -3
  431. package/esm/components/use-input/use-input.js +34 -42
  432. package/esm/components/use-input/use-input.type.d.ts +5 -5
  433. package/esm/components/use-input/use-input.type.d.ts.map +1 -1
  434. package/esm/components/use-input/use-input.type.js +1 -5
  435. package/esm/components/use-menu/index.js +2 -20
  436. package/esm/components/use-menu/use-menu-item.d.ts +1 -1
  437. package/esm/components/use-menu/use-menu-item.d.ts.map +1 -1
  438. package/esm/components/use-menu/use-menu-item.js +23 -31
  439. package/esm/components/use-menu/use-menu.js +15 -28
  440. package/esm/components/use-menu/use-menu.type.d.ts +1 -1
  441. package/esm/components/use-menu/use-menu.type.d.ts.map +1 -1
  442. package/esm/components/use-menu/use-menu.type.js +1 -5
  443. package/esm/components/use-pagination/index.js +1 -19
  444. package/esm/components/use-pagination/use-pagination.d.ts +1 -1
  445. package/esm/components/use-pagination/use-pagination.js +22 -25
  446. package/esm/components/use-pagination/use-pagination.type.js +1 -5
  447. package/esm/components/use-popup/index.js +1 -19
  448. package/esm/components/use-popup/popup-context.js +3 -9
  449. package/esm/components/use-popup/use-popup.js +35 -39
  450. package/esm/components/use-popup/use-popup.type.d.ts +1 -1
  451. package/esm/components/use-popup/use-popup.type.d.ts.map +1 -1
  452. package/esm/components/use-popup/use-popup.type.js +1 -5
  453. package/esm/components/use-select/index.js +2 -26
  454. package/esm/components/use-select/use-select-group.js +19 -22
  455. package/esm/components/use-select/use-select-group.type.js +1 -5
  456. package/esm/components/use-select/use-select.js +5 -12
  457. package/esm/components/use-select/use-select.type.d.ts +1 -1
  458. package/esm/components/use-select/use-select.type.d.ts.map +1 -1
  459. package/esm/components/use-select/use-select.type.js +1 -5
  460. package/esm/components/use-slider/index.js +1 -19
  461. package/esm/components/use-slider/use-slider.js +30 -32
  462. package/esm/components/use-slider/use-slider.type.js +1 -5
  463. package/esm/components/use-table/index.js +8 -68
  464. package/esm/components/use-table/use-table-columns.d.ts +1 -1
  465. package/esm/components/use-table/use-table-columns.d.ts.map +1 -1
  466. package/esm/components/use-table/use-table-columns.js +9 -20
  467. package/esm/components/use-table/use-table-expand.js +24 -35
  468. package/esm/components/use-table/use-table-group.js +5 -17
  469. package/esm/components/use-table/use-table-layout.js +66 -75
  470. package/esm/components/use-table/use-table-row.js +18 -25
  471. package/esm/components/use-table/use-table-sort.d.ts +1 -1
  472. package/esm/components/use-table/use-table-sort.d.ts.map +1 -1
  473. package/esm/components/use-table/use-table-sort.js +34 -41
  474. package/esm/components/use-table/use-table-tree.js +36 -49
  475. package/esm/components/use-table/use-table-virtual.js +34 -36
  476. package/esm/components/use-table/use-table.type.d.ts +4 -4
  477. package/esm/components/use-table/use-table.type.d.ts.map +1 -1
  478. package/esm/components/use-table/use-table.type.js +1 -5
  479. package/esm/components/use-tabs/context.js +7 -21
  480. package/esm/components/use-tabs/context.type.js +1 -5
  481. package/esm/components/use-tabs/index.js +2 -26
  482. package/esm/components/use-tabs/use-tabs.js +13 -16
  483. package/esm/components/use-tabs/use-tabs.type.d.ts +1 -1
  484. package/esm/components/use-tabs/use-tabs.type.d.ts.map +1 -1
  485. package/esm/components/use-tabs/use-tabs.type.js +1 -5
  486. package/esm/components/use-textarea/index.js +2 -26
  487. package/esm/components/use-textarea/use-textarea-format.js +6 -15
  488. package/esm/components/use-textarea/use-textarea-format.type.d.ts +1 -1
  489. package/esm/components/use-textarea/use-textarea-format.type.d.ts.map +1 -1
  490. package/esm/components/use-textarea/use-textarea-format.type.js +1 -5
  491. package/esm/components/use-textarea/use-textarea.d.ts +2 -2
  492. package/esm/components/use-textarea/use-textarea.js +31 -32
  493. package/esm/components/use-textarea/use-textarea.type.d.ts +3 -3
  494. package/esm/components/use-textarea/use-textarea.type.d.ts.map +1 -1
  495. package/esm/components/use-textarea/use-textarea.type.js +1 -5
  496. package/esm/components/use-transfer/index.js +1 -19
  497. package/esm/components/use-transfer/use-transfer.js +33 -38
  498. package/esm/components/use-transfer/use-transfer.type.d.ts +1 -1
  499. package/esm/components/use-transfer/use-transfer.type.d.ts.map +1 -1
  500. package/esm/components/use-transfer/use-transfer.type.js +1 -5
  501. package/esm/components/use-tree/index.js +2 -26
  502. package/esm/components/use-tree/use-tree-node.js +17 -20
  503. package/esm/components/use-tree/use-tree-node.type.d.ts +2 -2
  504. package/esm/components/use-tree/use-tree-node.type.d.ts.map +1 -1
  505. package/esm/components/use-tree/use-tree-node.type.js +1 -5
  506. package/esm/components/use-tree/use-tree.js +25 -37
  507. package/esm/components/use-tree/use-tree.type.d.ts +3 -3
  508. package/esm/components/use-tree/use-tree.type.d.ts.map +1 -1
  509. package/esm/components/use-tree/use-tree.type.js +1 -5
  510. package/esm/components/use-treeselect/index.js +2 -26
  511. package/esm/components/use-treeselect/use-tiled.js +22 -24
  512. package/esm/components/use-treeselect/use-tiled.type.d.ts +1 -1
  513. package/esm/components/use-treeselect/use-tiled.type.d.ts.map +1 -1
  514. package/esm/components/use-treeselect/use-tiled.type.js +1 -5
  515. package/esm/components/use-treeselect/use-treeselect.js +3 -10
  516. package/esm/components/use-treeselect/use-treeselect.type.js +1 -5
  517. package/esm/components/use-upload/index.js +1 -19
  518. package/esm/components/use-upload/use-upload.js +57 -62
  519. package/esm/components/use-upload/use-upload.type.js +1 -5
  520. package/esm/components/use-upload/xhr.js +1 -8
  521. package/esm/components/use-validate/index.js +1 -19
  522. package/esm/components/use-validate/use-validate.js +16 -19
  523. package/esm/components/use-validate/use-validate.type.js +1 -5
  524. package/esm/index.js +48 -547
  525. package/esm/utils/accept.d.ts +1 -1
  526. package/esm/utils/accept.d.ts.map +1 -1
  527. package/esm/utils/accept.js +1 -11
  528. package/esm/utils/array.js +2 -10
  529. package/esm/utils/attribute.js +3 -11
  530. package/esm/utils/clone.js +19 -34
  531. package/esm/utils/document.js +11 -20
  532. package/esm/utils/dom/element.js +23 -33
  533. package/esm/utils/dom/index.js +5 -69
  534. package/esm/utils/dom/normalize-wheel.js +1 -7
  535. package/esm/utils/dom/normalize-wheel.type.js +1 -5
  536. package/esm/utils/dom/ready.js +3 -9
  537. package/esm/utils/dom/responsiveObserve.js +10 -21
  538. package/esm/utils/dom/responsiveObserve.type.d.ts +4 -4
  539. package/esm/utils/dom/responsiveObserve.type.d.ts.map +1 -1
  540. package/esm/utils/dom/responsiveObserve.type.js +1 -5
  541. package/esm/utils/dom/scroll-behavior.js +2 -9
  542. package/esm/utils/extract-event-handlers.js +1 -13
  543. package/esm/utils/func.js +3 -11
  544. package/esm/utils/immer.d.ts +1 -8
  545. package/esm/utils/immer.d.ts.map +1 -1
  546. package/esm/utils/immer.js +12 -20
  547. package/esm/utils/index.js +22 -269
  548. package/esm/utils/is.d.ts +1 -1
  549. package/esm/utils/is.d.ts.map +1 -1
  550. package/esm/utils/is.js +33 -69
  551. package/esm/utils/lazyload.d.ts +1 -1
  552. package/esm/utils/lazyload.d.ts.map +1 -1
  553. package/esm/utils/lazyload.js +6 -15
  554. package/esm/utils/number.js +6 -24
  555. package/esm/utils/object.d.ts +4 -4
  556. package/esm/utils/object.d.ts.map +1 -1
  557. package/esm/utils/object.js +30 -59
  558. package/esm/utils/position.js +8 -13
  559. package/esm/utils/react-render.d.ts +1 -1
  560. package/esm/utils/react-render.d.ts.map +1 -1
  561. package/esm/utils/react-render.js +16 -31
  562. package/esm/utils/render.d.ts +1 -1
  563. package/esm/utils/render.d.ts.map +1 -1
  564. package/esm/utils/render.js +4 -13
  565. package/esm/utils/rule/index.js +1 -19
  566. package/esm/utils/rule/length.d.ts +1 -1
  567. package/esm/utils/rule/length.js +11 -19
  568. package/esm/utils/rule/regexp.d.ts +1 -1
  569. package/esm/utils/rule/regexp.js +7 -18
  570. package/esm/utils/rule/required.d.ts +1 -1
  571. package/esm/utils/rule/required.js +6 -14
  572. package/esm/utils/rule/rule.js +20 -33
  573. package/esm/utils/rule/rule.type.d.ts +8 -8
  574. package/esm/utils/rule/rule.type.d.ts.map +1 -1
  575. package/esm/utils/rule/rule.type.js +1 -5
  576. package/esm/utils/rule/type.d.ts +1 -1
  577. package/esm/utils/rule/type.js +6 -14
  578. package/esm/utils/shallow-equal.js +7 -21
  579. package/esm/utils/string.js +2 -16
  580. package/esm/utils/style-unit.js +3 -11
  581. package/esm/utils/tree.d.ts +1 -1
  582. package/esm/utils/tree.d.ts.map +1 -1
  583. package/esm/utils/tree.js +24 -32
  584. package/esm/utils/uid.js +2 -20
  585. package/esm/utils/validate/error.js +23 -26
  586. package/esm/utils/validate/get-rule.js +16 -26
  587. package/esm/utils/validate/index.d.ts +1 -1
  588. package/esm/utils/validate/index.d.ts.map +1 -1
  589. package/esm/utils/validate/index.js +20 -40
  590. package/esm/utils/validate/isJson.js +3 -12
  591. package/esm/utils/validate/nullable.js +2 -9
  592. package/esm/utils/validate/type.d.ts +1 -1
  593. package/esm/utils/validate/type.d.ts.map +1 -1
  594. package/esm/utils/validate/type.js +8 -19
  595. package/package.json +3 -2
@@ -1,14 +1,14 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
3
  Object.defineProperty(exports, "__esModule", {
5
4
  value: true
6
5
  });
7
6
  exports.lengthMessage = exports.default = void 0;
8
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
- var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
10
- require("core-js/modules/es.array.concat.js");
11
7
  var _object = require("../object");
8
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
9
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
10
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
11
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
12
12
  var createMessage = function createMessage(key) {
13
13
  return function (props) {
14
14
  var lt = '';
@@ -29,26 +29,24 @@ var createMessage = function createMessage(key) {
29
29
  var options = {
30
30
  skipUndefined: true
31
31
  };
32
- var lengthMessage = {
32
+ var lengthMessage = exports.lengthMessage = {
33
33
  max: createMessage('max'),
34
34
  min: createMessage('min')
35
35
  };
36
- exports.lengthMessage = lengthMessage;
37
- var _default = function _default(key) {
36
+ var _default = exports.default = function _default(key) {
38
37
  var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
39
38
  message = _ref.message;
40
39
  return function (len, msg) {
41
40
  if (typeof len !== 'number') {
42
- console.error(new Error("Rule \"".concat(key, "\" param expect a number, get ").concat((0, _typeof2.default)(len))));
41
+ console.error(new Error("Rule \"".concat(key, "\" param expect a number, get ").concat(_typeof(len))));
43
42
  return null;
44
43
  }
45
44
  return (0, _object.deepMerge)({
46
45
  message: lengthMessage[key]
47
- }, (0, _object.deepMerge)((0, _defineProperty2.default)({
46
+ }, (0, _object.deepMerge)(_defineProperty({
48
47
  message: message
49
48
  }, key, len), {
50
49
  message: msg
51
50
  }, options), options);
52
51
  };
53
- };
54
- exports.default = _default;
52
+ };
@@ -1,6 +1,6 @@
1
1
  import { MessageType } from './rule.type';
2
2
  declare const _default: ({ message }?: {
3
3
  message?: MessageType | undefined;
4
- }) => (regExp: string | RegExp, msg?: MessageType) => import("../..").ObjectType<any> | null;
4
+ }) => (regExp: string | RegExp, msg?: MessageType) => import("../..").ObjectType | null;
5
5
  export default _default;
6
6
  //# sourceMappingURL=regexp.d.ts.map
@@ -1,24 +1,20 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
3
  Object.defineProperty(exports, "__esModule", {
5
4
  value: true
6
5
  });
7
6
  exports.default = void 0;
8
- var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
9
- require("core-js/modules/es.regexp.constructor.js");
10
- require("core-js/modules/es.regexp.exec.js");
11
- require("core-js/modules/es.regexp.to-string.js");
12
7
  var _object = require("../object");
8
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
13
9
  var options = {
14
10
  skipUndefined: true
15
11
  };
16
- var _default = function _default() {
12
+ var _default = exports.default = function _default() {
17
13
  var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
18
14
  message = _ref.message;
19
15
  return function (regExp, msg) {
20
16
  if (typeof regExp !== 'string' && !(regExp instanceof RegExp)) {
21
- console.error(new Error("Rule \"reg\" param expect a RegExp object or a string, get ".concat((0, _typeof2.default)(regExp))));
17
+ console.error(new Error("Rule \"reg\" param expect a RegExp object or a string, get ".concat(_typeof(regExp))));
22
18
  return null;
23
19
  }
24
20
  return (0, _object.deepMerge)({
@@ -30,5 +26,4 @@ var _default = function _default() {
30
26
  message: msg
31
27
  }, options), options);
32
28
  };
33
- };
34
- exports.default = _default;
29
+ };
@@ -3,6 +3,6 @@ import { MessageType } from './rule.type';
3
3
  export declare const requiredMessage: (props: ObjectType) => string;
4
4
  declare const _default: ({ message }?: {
5
5
  message?: MessageType | undefined;
6
- }) => (msg: MessageType) => ObjectType<any>;
6
+ }) => (msg: MessageType) => ObjectType;
7
7
  export default _default;
8
8
  //# sourceMappingURL=required.d.ts.map
@@ -8,12 +8,11 @@ var _object = require("../object");
8
8
  var options = {
9
9
  skipUndefined: true
10
10
  };
11
- var requiredMessage = function requiredMessage(props) {
11
+ var requiredMessage = exports.requiredMessage = function requiredMessage(props) {
12
12
  var type = props.type === 'array' ? 'array' : 'string';
13
13
  return "$rules.required.".concat(type);
14
14
  };
15
- exports.requiredMessage = requiredMessage;
16
- var _default = function _default() {
15
+ var _default = exports.default = function _default() {
17
16
  var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
18
17
  message = _ref.message;
19
18
  return function (msg) {
@@ -26,5 +25,4 @@ var _default = function _default() {
26
25
  message: msg
27
26
  }, options), options);
28
27
  };
29
- };
30
- exports.default = _default;
28
+ };
@@ -1,29 +1,24 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
3
  Object.defineProperty(exports, "__esModule", {
5
4
  value: true
6
5
  });
7
6
  exports.RULE_TYPE = void 0;
8
7
  exports.default = Rule;
9
- require("core-js/modules/web.dom-collections.for-each.js");
10
- require("core-js/modules/es.array.concat.js");
11
- require("core-js/modules/es.array.includes.js");
12
- require("core-js/modules/es.string.includes.js");
13
- var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
14
8
  var _object = require("../object");
15
9
  var _is = require("../is");
16
10
  var _required = _interopRequireDefault(require("./required"));
17
11
  var _length = _interopRequireDefault(require("./length"));
18
12
  var _type2 = _interopRequireDefault(require("./type"));
19
13
  var _regexp = _interopRequireDefault(require("./regexp"));
20
- var RULE_TYPE = 'RULE_OBJECT';
21
- exports.RULE_TYPE = RULE_TYPE;
14
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
16
+ var RULE_TYPE = exports.RULE_TYPE = 'RULE_OBJECT';
22
17
  var innerType = ['email', 'integer', 'number', 'url', 'json', 'hex', 'rgb', 'ipv4'];
23
18
  var mergeOptions = function mergeOptions() {
24
19
  var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
25
20
  if (!(0, _is.isObject)(opts)) {
26
- console.error(new Error("rules expect an object, got ".concat((0, _typeof2.default)(opts))));
21
+ console.error(new Error("rules expect an object, got ".concat(_typeof(opts))));
27
22
  return {};
28
23
  }
29
24
  for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
@@ -1,10 +1,10 @@
1
1
  import { ObjectType } from '../../common/type';
2
- export declare type ValueOf<T> = T[keyof T];
2
+ export type ValueOf<T> = T[keyof T];
3
3
  export interface ValidFunc<T = any> {
4
4
  (value: T | undefined, formValue: ObjectType, cb: (cbArgs: Error | true) => void, props: any): void | Promise<any>;
5
5
  }
6
- export declare type RuleTypeEnum = 'email' | 'integer' | 'number' | 'url' | 'json' | 'hex' | 'rgb' | 'ipv4';
7
- export declare type MessageType = string | ((props?: any) => string);
6
+ export type RuleTypeEnum = 'email' | 'integer' | 'number' | 'url' | 'json' | 'hex' | 'rgb' | 'ipv4';
7
+ export type MessageType = string | ((props?: any) => string);
8
8
  export interface Required {
9
9
  required?: boolean;
10
10
  message?: MessageType;
@@ -102,14 +102,14 @@ export interface RuleFuncResult {
102
102
  };
103
103
  isInnerValidator: true;
104
104
  }
105
- export declare type RuleResult = {
105
+ export type RuleResult = {
106
106
  [key: string]: RuleFuncResult;
107
107
  } | RuleCommonResult;
108
- export declare type RuleResultValue = ValueOf<RuleResult>;
109
- export declare type FormItemObjectRule = Type & RegExpParams & Range & Min & Max & Required & {
108
+ export type RuleResultValue = ValueOf<RuleResult>;
109
+ export type FormItemObjectRule = Type & RegExpParams & Range & Min & Max & Required & {
110
110
  func?: ValidFunc;
111
111
  };
112
- export declare type FormItemRule<Value, FormData = any, Props = any> = Array<RuleResultValue | FormItemObjectRule | ((value: Value, formData: FormData, callback: (cbArgs: boolean | Error) => void, props?: Props) => void)>;
112
+ export type FormItemRule<Value, FormData = any, Props = any> = Array<RuleResultValue | FormItemObjectRule | ((value: Value, formData: FormData, callback: (cbArgs: boolean | Error) => void, props?: Props) => void)>;
113
113
  export interface RuleParams {
114
114
  required?: Required;
115
115
  min?: Min;
@@ -129,7 +129,7 @@ export interface RuleParams {
129
129
  message?: MessageType;
130
130
  } | ValidFunc | undefined;
131
131
  }
132
- export declare type InnerRuleFunc<U> = U & {
132
+ export type InnerRuleFunc<U> = U & {
133
133
  isInnerValidator: true;
134
134
  };
135
135
  //# sourceMappingURL=rule.type.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"rule.type.d.ts","sourceRoot":"","sources":["rule.type.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C,oBAAY,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;AAEpC,MAAM,WAAW,SAAS,CAAC,CAAC,GAAG,GAAG;IAChC,CACE,KAAK,EAAE,CAAC,GAAG,SAAS,EACpB,SAAS,EAAE,UAAU,EACrB,EAAE,EAAE,CAAC,MAAM,EAAE,KAAK,GAAG,IAAI,KAAK,IAAI,EAClC,KAAK,EAAE,GAAG,GACT,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;CACxB;AA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E,KAAK,KACV,IAAI,CAAC,CACb,CAAC;AAGF,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,GAAG,CAAC,EAAE,GAAG,CAAC;IACV,GAAG,CAAC,EAAE,GAAG,CAAC;IACV,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,MAAM,CAAC,EAAE,YAAY,CAAC;IAEtB,KAAK,CAAC,EAAE,IAAI,CAAC;IACb,OAAO,CAAC,EAAE,IAAI,CAAC;IACf,MAAM,CAAC,EAAE,IAAI,CAAC;IACd,GAAG,CAAC,EAAE,IAAI,CAAC;IACX,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,GAAG,CAAC,EAAE,IAAI,CAAC;IACX,GAAG,CAAC,EAAE,IAAI,CAAC;IACX,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,CAAC,QAAQ,EAAE,MAAM,GACb;QACE,IAAI,CAAC,EAAE,SAAS,CAAC;QACjB,OAAO,CAAC,EAAE,WAAW,CAAC;KACvB,GACD,SAAS,GACT,SAAS,CAAC;CACf;AAGD,MAAM,MAAM,aAAa,CAAC,CAAC,IAAI,CAAC,GAAG;IAAE,gBAAgB,EAAE,IAAI,CAAA;CAAE,CAAC"}
@@ -4,6 +4,6 @@ export declare const typeMessage: (props: ObjectType) => "$rules.type" | "$rules
4
4
  declare const _default: (type: string, { message, tip }?: {
5
5
  message?: MessageType | undefined;
6
6
  tip?: string | undefined;
7
- }) => (msg: MessageType) => ObjectType<any>;
7
+ }) => (msg: MessageType) => ObjectType;
8
8
  export default _default;
9
9
  //# sourceMappingURL=type.d.ts.map
@@ -5,14 +5,13 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.typeMessage = exports.default = void 0;
7
7
  var _object = require("../object");
8
- var typeMessage = function typeMessage(props) {
8
+ var typeMessage = exports.typeMessage = function typeMessage(props) {
9
9
  return props.title ? '$rules.type' : '$rules.reg';
10
10
  };
11
- exports.typeMessage = typeMessage;
12
11
  var options = {
13
12
  skipUndefined: true
14
13
  };
15
- var _default = function _default(type) {
14
+ var _default = exports.default = function _default(type) {
16
15
  var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
17
16
  message = _ref.message,
18
17
  tip = _ref.tip;
@@ -27,5 +26,4 @@ var _default = function _default(type) {
27
26
  message: msg
28
27
  }, options), options);
29
28
  };
30
- };
31
- exports.default = _default;
29
+ };
@@ -1,18 +1,14 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
3
  Object.defineProperty(exports, "__esModule", {
5
4
  value: true
6
5
  });
7
6
  exports.compareColumns = compareColumns;
8
7
  exports.default = void 0;
9
8
  exports.shallowEqual = shallowEqual;
10
- require("core-js/modules/es.array.sort.js");
11
- require("core-js/modules/es.array.index-of.js");
12
- require("core-js/modules/es.array.includes.js");
13
- require("core-js/modules/es.string.includes.js");
14
- var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
15
9
  var _reactFastCompare = _interopRequireDefault(require("react-fast-compare"));
10
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
16
12
  var hasOwnProperty = Object.prototype.hasOwnProperty;
17
13
  function is(x, y) {
18
14
  if (x === y) {
@@ -46,7 +42,7 @@ function shallowEqual(objA, objB) {
46
42
  if (is(objA, objB)) {
47
43
  return true;
48
44
  }
49
- if ((0, _typeof2.default)(objA) !== 'object' || objA === null || (0, _typeof2.default)(objB) !== 'object' || objB === null) {
45
+ if (_typeof(objA) !== 'object' || objA === null || _typeof(objB) !== 'object' || objB === null) {
50
46
  return false;
51
47
  }
52
48
  var keysA = Object.keys(objA);
@@ -78,5 +74,4 @@ function shallowEqual(objA, objB) {
78
74
  }
79
75
  return true;
80
76
  }
81
- var _default = shallowEqual;
82
- exports.default = _default;
77
+ var _default = exports.default = shallowEqual;
@@ -5,13 +5,6 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.removeProtocol = removeProtocol;
7
7
  exports.substitute = substitute;
8
- require("core-js/modules/es.regexp.exec.js");
9
- require("core-js/modules/es.string.replace.js");
10
- require("core-js/modules/es.array.slice.js");
11
- require("core-js/modules/es.array.iterator.js");
12
- require("core-js/modules/web.dom-collections.iterator.js");
13
- require("core-js/modules/web.url.js");
14
- require("core-js/modules/web.url-search-params.js");
15
8
  /**
16
9
  *
17
10
  * 输入 substitute('请输入至少{min}个字符', {min: 50})
@@ -4,8 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.parseStyleUnitValue = parseStyleUnitValue;
7
- require("core-js/modules/es.regexp.exec.js");
8
- require("core-js/modules/es.string.match.js");
9
7
  var _is = require("./is");
10
8
  function parseStyleUnitValue(value) {
11
9
  if (value === undefined) return;
@@ -3,7 +3,7 @@ export declare const getFlattenTree: <T>(data: T[], childrenKey?: keyof T, wide?
3
3
  export declare const getFilterTree: <DataItem, K extends (node: DataItem) => KeygenResult>(treeNodes: DataItem[] | undefined, filterFunc: void | ((data: DataItem) => boolean) | undefined, filterExpandKeys: KeygenResult[] | undefined, keyFunc: K, childrenKey: keyof DataItem | undefined, showHitDescendants: boolean, firstMatchNode?: ((node: DataItem) => void) | undefined, { advanced, }?: {
4
4
  advanced?: boolean | undefined;
5
5
  }) => (DataItem | null)[];
6
- declare type FilterDatum<DataItem> = {
6
+ type FilterDatum<DataItem> = {
7
7
  data: DataItem[];
8
8
  childrenKey: any;
9
9
  getKey: (node: DataItem) => KeygenResult;
@@ -1 +1 @@
1
- {"version":3,"file":"tree.d.ts","sourceRoot":"","sources":["tree.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,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
1
1
  "use strict";
2
2
 
3
- require("core-js/modules/es.object.get-own-property-descriptors.js");
4
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
3
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
7
  exports.mergeFilteredTree = exports.getFlattenTree = exports.getFilterTree = void 0;
9
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
10
- var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
11
- require("core-js/modules/web.dom-collections.for-each.js");
12
- require("core-js/modules/es.array.concat.js");
13
- require("core-js/modules/es.array.filter.js");
14
- require("core-js/modules/es.array.map.js");
15
- require("core-js/modules/es.array.index-of.js");
16
8
  var _immer = require("../utils/immer");
17
9
  var _clone = require("./clone");
18
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
19
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
20
- var getFlattenTree = function getFlattenTree(data) {
10
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
11
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
12
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
13
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
14
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
15
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
16
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
17
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
18
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
19
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
20
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
21
+ var getFlattenTree = exports.getFlattenTree = function getFlattenTree(data) {
21
22
  var childrenKey = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'children';
22
23
  var wide = arguments.length > 2 ? arguments[2] : undefined;
23
24
  var arr = [];
@@ -25,20 +26,19 @@ var getFlattenTree = function getFlattenTree(data) {
25
26
  list.forEach(function (item) {
26
27
  var children = item[childrenKey];
27
28
  if (children && children.length > 0) {
28
- var clonedPath = (0, _toConsumableArray2.default)(path);
29
+ var clonedPath = _toConsumableArray(path);
29
30
  clonedPath.push(item);
30
31
  if (wide) arr.push(clonedPath);
31
32
  flatten(children, clonedPath);
32
33
  } else {
33
- arr.push([].concat((0, _toConsumableArray2.default)(path), [item]));
34
+ arr.push([].concat(_toConsumableArray(path), [item]));
34
35
  }
35
36
  });
36
37
  };
37
38
  flatten(data, []);
38
39
  return arr;
39
40
  };
40
- exports.getFlattenTree = getFlattenTree;
41
- var getFilterTree = function getFilterTree(treeNodes, filterFunc, filterExpandKeys, keyFunc) {
41
+ var getFilterTree = exports.getFilterTree = function getFilterTree(treeNodes, filterFunc, filterExpandKeys, keyFunc) {
42
42
  var childrenKey = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 'children';
43
43
  var showHitDescendants = arguments.length > 5 ? arguments[5] : undefined;
44
44
  var firstMatchNode = arguments.length > 6 ? arguments[6] : undefined;
@@ -60,7 +60,7 @@ var getFilterTree = function getFilterTree(treeNodes, filterFunc, filterExpandKe
60
60
  if (!node[childrenKey]) return node;
61
61
  var childNodes = showHitDescendants && match ? node[childrenKey] || [] : children;
62
62
  if (advanced && match && children.length > 0) childNodes = children;
63
- return _objectSpread(_objectSpread({}, node), {}, (0, _defineProperty2.default)({}, childrenKey, childNodes));
63
+ return _objectSpread(_objectSpread({}, node), {}, _defineProperty({}, childrenKey, childNodes));
64
64
  }
65
65
  return null;
66
66
  };
@@ -68,8 +68,7 @@ var getFilterTree = function getFilterTree(treeNodes, filterFunc, filterExpandKe
68
68
  return node;
69
69
  });
70
70
  };
71
- exports.getFilterTree = getFilterTree;
72
- var mergeFilteredTree = function mergeFilteredTree(filterDatum, rawDatum, tiledId) {
71
+ var mergeFilteredTree = exports.mergeFilteredTree = function mergeFilteredTree(filterDatum, rawDatum, tiledId) {
73
72
  var filterData = filterDatum.data;
74
73
  var childrenKey = filterDatum.childrenKey;
75
74
  if (tiledId.length === 0) return filterData;
@@ -89,5 +88,4 @@ var mergeFilteredTree = function mergeFilteredTree(filterDatum, rawDatum, tiledI
89
88
  return (0, _immer.produce)(filterData, function (draft) {
90
89
  draft.map(recursion);
91
90
  });
92
- };
93
- exports.mergeFilteredTree = mergeFilteredTree;
91
+ };
package/cjs/utils/uid.js CHANGED
@@ -5,17 +5,6 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.generateUUID = generateUUID;
7
7
  exports.getUidStr = getUidStr;
8
- require("core-js/modules/es.regexp.exec.js");
9
- require("core-js/modules/es.string.replace.js");
10
- require("core-js/modules/es.regexp.to-string.js");
11
- require("core-js/modules/es.array.iterator.js");
12
- require("core-js/modules/es.typed-array.uint32-array.js");
13
- require("core-js/modules/es.typed-array.fill.js");
14
- require("core-js/modules/es.typed-array.iterator.js");
15
- require("core-js/modules/es.typed-array.set.js");
16
- require("core-js/modules/es.typed-array.sort.js");
17
- require("core-js/modules/es.typed-array.to-string.js");
18
- require("core-js/modules/es.string.pad-start.js");
19
8
  function generateUUID() {
20
9
  var c = crypto || typeof window !== 'undefined' && window.crypto; // 获取加密库
21
10
  if (!c || !c.getRandomValues) {
@@ -1,37 +1,41 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
3
  Object.defineProperty(exports, "__esModule", {
5
4
  value: true
6
5
  });
7
6
  exports.FormError = void 0;
8
7
  exports.wrapFormError = wrapFormError;
9
- require("core-js/modules/es.array.map.js");
10
- var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
11
- var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
12
- var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
13
- var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
14
- var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
15
- var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
16
- var _wrapNativeSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/wrapNativeSuper"));
17
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
18
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
8
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
9
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
10
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
11
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
12
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
13
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
14
+ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
15
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
16
+ function _wrapNativeSuper(Class) { var _cache = typeof Map === "function" ? new Map() : undefined; _wrapNativeSuper = function _wrapNativeSuper(Class) { if (Class === null || !_isNativeFunction(Class)) return Class; if (typeof Class !== "function") { throw new TypeError("Super expression must either be null or a function"); } if (typeof _cache !== "undefined") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() { return _construct(Class, arguments, _getPrototypeOf(this).constructor); } Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _setPrototypeOf(Wrapper, Class); }; return _wrapNativeSuper(Class); }
17
+ function _construct(Parent, args, Class) { if (_isNativeReflectConstruct()) { _construct = Reflect.construct.bind(); } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }
19
18
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
20
- var FormError = /*#__PURE__*/function (_Error) {
21
- (0, _inherits2.default)(FormError, _Error);
19
+ function _isNativeFunction(fn) { try { return Function.toString.call(fn).indexOf("[native code]") !== -1; } catch (e) { return typeof fn === "function"; } }
20
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
21
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
22
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
23
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
24
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
25
+ var FormError = exports.FormError = /*#__PURE__*/function (_Error) {
26
+ _inherits(FormError, _Error);
22
27
  var _super = _createSuper(FormError);
23
28
  function FormError(message, props) {
24
29
  var _this;
25
- (0, _classCallCheck2.default)(this, FormError);
30
+ _classCallCheck(this, FormError);
26
31
  _this = _super.call(this, message);
27
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "props", void 0);
32
+ _defineProperty(_assertThisInitialized(_this), "props", void 0);
28
33
  _this.name = 'FormError';
29
34
  _this.props = props;
30
35
  return _this;
31
36
  }
32
- return (0, _createClass2.default)(FormError);
33
- }( /*#__PURE__*/(0, _wrapNativeSuper2.default)(Error));
34
- exports.FormError = FormError;
37
+ return _createClass(FormError);
38
+ }( /*#__PURE__*/_wrapNativeSuper(Error));
35
39
  function wrapFormError(error) {
36
40
  var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
37
41
  if (error instanceof FormError) return error;
@@ -1,17 +1,14 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
3
  Object.defineProperty(exports, "__esModule", {
5
4
  value: true
6
5
  });
7
6
  exports.default = getRule;
8
- require("core-js/modules/es.regexp.constructor.js");
9
- require("core-js/modules/es.regexp.exec.js");
10
- require("core-js/modules/es.regexp.to-string.js");
11
7
  var _nullable = _interopRequireDefault(require("./nullable"));
12
8
  var _is = require("../is");
13
9
  var _type = _interopRequireDefault(require("./type"));
14
10
  var _error = require("./error");
11
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
12
  function getRule(rule, props) {
16
13
  var po = props;
17
14
  var rulePo = rule;
@@ -1,6 +1,6 @@
1
1
  import { ObjectType } from '../../common/type';
2
2
  import { FormItemRule } from '../rule/rule.type';
3
3
  export * from './error';
4
- export declare const validate: <T>(value: T | undefined, formData: ObjectType, rules: FormItemRule<T, any, any>, p: ObjectType) => Promise<true | Error>;
4
+ export declare const validate: <T>(value: T | undefined, formData: ObjectType, rules: FormItemRule<T>, p: ObjectType) => Promise<true | Error>;
5
5
  export default validate;
6
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAIjD,cAAc,SAAS,CAAC;AAaxB,eAAO,MAAM,QAAQ,sCAET,UAAU,uCAEjB,UAAU,0BA4BX,CAAC;AAEL,eAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAIjD,cAAc,SAAS,CAAC;AAaxB,eAAO,MAAM,QAAQ,sCAET,UAAU,6BAEjB,UAAU,0BA4BX,CAAC;AAEL,eAAe,QAAQ,CAAC"}
@@ -1,7 +1,5 @@
1
1
  "use strict";
2
2
 
3
- require("core-js/modules/web.dom-collections.for-each.js");
4
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
5
3
  Object.defineProperty(exports, "__esModule", {
6
4
  value: true
7
5
  });
@@ -9,10 +7,6 @@ var _exportNames = {
9
7
  validate: true
10
8
  };
11
9
  exports.validate = exports.default = void 0;
12
- var _toArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toArray"));
13
- var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
14
- require("core-js/modules/es.promise.js");
15
- require("core-js/modules/es.array.slice.js");
16
10
  var _getRule = _interopRequireDefault(require("./get-rule"));
17
11
  var _array = require("../array");
18
12
  var _error = require("./error");
@@ -27,17 +21,25 @@ Object.keys(_error).forEach(function (key) {
27
21
  }
28
22
  });
29
23
  });
24
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
25
+ function _toArray(arr) { return _arrayWithHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableRest(); }
26
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
27
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
28
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
29
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
30
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
31
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
30
32
  var handleProps = function handleProps(props) {
31
33
  return Object.keys(props).reduce(function (acc, key) {
32
34
  var value = props[key];
33
- var type = (0, _typeof2.default)(value);
35
+ var type = _typeof(value);
34
36
  if (type === 'string' || type === 'number') {
35
37
  acc[key] = value;
36
38
  }
37
39
  return acc;
38
40
  }, {});
39
41
  };
40
- var validate = function validate(value, formData, rules, p) {
42
+ var validate = exports.validate = function validate(value, formData, rules, p) {
41
43
  return new Promise(function (resolve, reject) {
42
44
  if (!rules.length) {
43
45
  resolve(true);
@@ -45,7 +47,7 @@ var validate = function validate(value, formData, rules, p) {
45
47
  }
46
48
  var props = handleProps(p);
47
49
  var _ref = (0, _array.flattenArray)(rules),
48
- _ref2 = (0, _toArray2.default)(_ref),
50
+ _ref2 = _toArray(_ref),
49
51
  rule = _ref2[0],
50
52
  restRule = _ref2.slice(1);
51
53
  if (!rule) {
@@ -62,12 +64,10 @@ var validate = function validate(value, formData, rules, p) {
62
64
  var fn = (0, _getRule.default)(rule, props);
63
65
  var cb = fn(value, formData, callback, props);
64
66
  if (cb) {
65
- cb === null || cb === void 0 ? void 0 : cb.then(callback.bind(null, true)).catch(function (e) {
67
+ cb === null || cb === void 0 || cb.then(callback.bind(null, true)).catch(function (e) {
66
68
  reject((0, _error.wrapFormError)(e, props));
67
69
  });
68
70
  }
69
71
  });
70
72
  };
71
- exports.validate = validate;
72
- var _default = validate;
73
- exports.default = _default;
73
+ var _default = exports.default = validate;