@sheinx/hooks 3.0.0-rc.2 → 3.0.0-rc.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 (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 +4 -4
  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 +4 -4
  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,29 +1,16 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.RULE_TYPE = void 0;
8
- 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
- var _object = require("../object");
15
- var _is = require("../is");
16
- var _required = _interopRequireDefault(require("./required"));
17
- var _length = _interopRequireDefault(require("./length"));
18
- var _type2 = _interopRequireDefault(require("./type"));
19
- var _regexp = _interopRequireDefault(require("./regexp"));
20
- var RULE_TYPE = 'RULE_OBJECT';
21
- exports.RULE_TYPE = RULE_TYPE;
1
+ 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); }
2
+ import { deepMerge, objectValues } from "../object";
3
+ import { isObject } from "../is";
4
+ import required from "./required";
5
+ import length from "./length";
6
+ import _type from "./type";
7
+ import regExp from "./regexp";
8
+ export var RULE_TYPE = 'RULE_OBJECT';
22
9
  var innerType = ['email', 'integer', 'number', 'url', 'json', 'hex', 'rgb', 'ipv4'];
23
10
  var mergeOptions = function mergeOptions() {
24
11
  var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
25
- if (!(0, _is.isObject)(opts)) {
26
- console.error(new Error("rules expect an object, got ".concat((0, _typeof2.default)(opts))));
12
+ if (!isObject(opts)) {
13
+ console.error(new Error("rules expect an object, got ".concat(_typeof(opts))));
27
14
  return {};
28
15
  }
29
16
  for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
@@ -36,21 +23,21 @@ var mergeOptions = function mergeOptions() {
36
23
  func: arg[k]
37
24
  };
38
25
  });
39
- var a = (0, _object.deepMerge)(opts, arg);
26
+ var a = deepMerge(opts, arg);
40
27
  return mergeOptions.apply(void 0, [a].concat(args));
41
28
  };
42
- function Rule() {
29
+ export default function Rule() {
43
30
  for (var _len2 = arguments.length, opts = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
44
31
  opts[_key2] = arguments[_key2];
45
32
  }
46
33
  var options = mergeOptions.apply(void 0, [{}].concat(opts));
47
34
  var rules = {
48
- required: (0, _required.default)(options.required),
49
- max: (0, _length.default)('max', options.max),
50
- min: (0, _length.default)('min', options.min),
51
- regExp: (0, _regexp.default)(options.regExp),
35
+ required: required(options.required),
36
+ max: length('max', options.max),
37
+ min: length('min', options.min),
38
+ regExp: regExp(options.regExp),
52
39
  type: function type(t) {
53
- return (0, _type2.default)(t, options.type);
40
+ return _type(t, options.type);
54
41
  }
55
42
  };
56
43
  rules.length = function (min, max, msg) {
@@ -60,12 +47,12 @@ function Rule() {
60
47
  return [rules.min(min, msg), rules.max(max, msg)];
61
48
  };
62
49
  innerType.forEach(function (k) {
63
- rules[k] = (0, _type2.default)(k, options[k] || options.type);
50
+ rules[k] = _type(k, options[k] || options.type);
64
51
  });
65
52
  var ruleKeys = Object.keys(rules);
66
53
  Object.keys(options).forEach(function (k) {
67
54
  if (!ruleKeys.includes(k)) {
68
- if ((0, _is.isObject)(options[k])) {
55
+ if (isObject(options[k])) {
69
56
  rules[k] = function (args) {
70
57
  return Object.assign({}, options[k], {
71
58
  args: args
@@ -76,7 +63,7 @@ function Rule() {
76
63
  }
77
64
  }
78
65
  });
79
- (0, _object.objectValues)(rules).forEach(function (rule) {
66
+ objectValues(rules).forEach(function (rule) {
80
67
  rule.isInnerValidator = true;
81
68
  });
82
69
  rules.$$type = RULE_TYPE;
@@ -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;IA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,KAAK,GAAG,GAAG,IAAI,KAAK,CAChE,eAAe,GACf,kBAAkB,GAClB,CAAC,CACC,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,CAAC,MAAM,EAAE,OAAO,GAAG,KAAK,KAAK,IAAI,EAC3C,KAAK,CAAC,EAAE,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"}
@@ -1,5 +1 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
1
+ export {};
@@ -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
@@ -1,31 +1,23 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.typeMessage = exports.default = void 0;
7
- var _object = require("../object");
8
- var typeMessage = function typeMessage(props) {
1
+ import { deepMerge } from "../object";
2
+ export var typeMessage = function typeMessage(props) {
9
3
  return props.title ? '$rules.type' : '$rules.reg';
10
4
  };
11
- exports.typeMessage = typeMessage;
12
5
  var options = {
13
6
  skipUndefined: true
14
7
  };
15
- var _default = function _default(type) {
8
+ export default (function (type) {
16
9
  var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
17
10
  message = _ref.message,
18
11
  tip = _ref.tip;
19
12
  return function (msg) {
20
- return (0, _object.deepMerge)({
13
+ return deepMerge({
21
14
  type: type,
22
15
  message: typeMessage
23
- }, (0, _object.deepMerge)({
16
+ }, deepMerge({
24
17
  message: message,
25
18
  tip: tip
26
19
  }, {
27
20
  message: msg
28
21
  }, options), options);
29
22
  };
30
- };
31
- exports.default = _default;
23
+ });
@@ -1,18 +1,5 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.compareColumns = compareColumns;
8
- exports.default = void 0;
9
- 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
- var _reactFastCompare = _interopRequireDefault(require("react-fast-compare"));
1
+ 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); }
2
+ import deepEqual from 'react-fast-compare';
16
3
  var hasOwnProperty = Object.prototype.hasOwnProperty;
17
4
  function is(x, y) {
18
5
  if (x === y) {
@@ -26,7 +13,7 @@ function getOption(options, key) {
26
13
  var val = options[key];
27
14
  return Array.isArray(val) ? val : [val];
28
15
  }
29
- function compareColumns(columns1, columns2) {
16
+ export function compareColumns(columns1, columns2) {
30
17
  if (!columns1 || !columns2) return true;
31
18
  if (columns1.length !== columns2.length) return false;
32
19
  var simpleCompare = columns1.every(function (c, i) {
@@ -41,12 +28,12 @@ function compareColumns(columns1, columns2) {
41
28
  });
42
29
  return complexCompare;
43
30
  }
44
- function shallowEqual(objA, objB) {
31
+ export function shallowEqual(objA, objB) {
45
32
  var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
46
33
  if (is(objA, objB)) {
47
34
  return true;
48
35
  }
49
- if ((0, _typeof2.default)(objA) !== 'object' || objA === null || (0, _typeof2.default)(objB) !== 'object' || objB === null) {
36
+ if (_typeof(objA) !== 'object' || objA === null || _typeof(objB) !== 'object' || objB === null) {
50
37
  return false;
51
38
  }
52
39
  var keysA = Object.keys(objA);
@@ -70,7 +57,7 @@ function shallowEqual(objA, objB) {
70
57
  continue;
71
58
  }
72
59
  if (deep.includes(k)) {
73
- if (!(0, _reactFastCompare.default)(objA[k], objB[k])) return false;
60
+ if (!deepEqual(objA[k], objB[k])) return false;
74
61
  } else {
75
62
  return false;
76
63
  }
@@ -78,5 +65,4 @@ function shallowEqual(objA, objB) {
78
65
  }
79
66
  return true;
80
67
  }
81
- var _default = shallowEqual;
82
- exports.default = _default;
68
+ export default shallowEqual;
@@ -1,23 +1,9 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.removeProtocol = removeProtocol;
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
1
  /**
16
2
  *
17
3
  * 输入 substitute('请输入至少{min}个字符', {min: 50})
18
4
  * 输出 请输入至少50个字符
19
5
  */
20
- function substitute(str, obj) {
6
+ export function substitute(str, obj) {
21
7
  if (typeof str === 'string') {
22
8
  if (str.indexOf('{') < 0) {
23
9
  return str;
@@ -41,7 +27,7 @@ function substitute(str, obj) {
41
27
  * 输入 'https://github.com/'
42
28
  * 输出 '//github.com/'
43
29
  */
44
- function removeProtocol(url) {
30
+ export function removeProtocol(url) {
45
31
  if (url.indexOf('http') !== 0) return url;
46
32
  try {
47
33
  var _URL = new URL(url),
@@ -1,15 +1,7 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.parseStyleUnitValue = parseStyleUnitValue;
7
- require("core-js/modules/es.regexp.exec.js");
8
- require("core-js/modules/es.string.match.js");
9
- var _is = require("./is");
10
- function parseStyleUnitValue(value) {
1
+ import { isNumber } from "./is";
2
+ export function parseStyleUnitValue(value) {
11
3
  if (value === undefined) return;
12
- if ((0, _is.isNumber)(value)) {
4
+ if (isNumber(value)) {
13
5
  return {
14
6
  value: value,
15
7
  unit: 'px'
@@ -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,gBAAgB,CAAC;AAG9C,eAAO,MAAM,cAAc,+CAGlB,OAAO,UAkBf,CAAC;AAEF,eAAO,MAAM,aAAa,2CAA4C,YAAY,6EAE5B,OAAO,iCACzC,YAAY,EAAE,GAAG,SAAS,2EAGxB,OAAO,wCACU,IAAI;;yBA4B1C,CAAC;AAEF,aAAK,WAAW,CAAC,QAAQ,IAAI;IAC3B,IAAI,EAAE,QAAQ,EAAE,CAAC;IACjB,WAAW,EAAE,GAAG,CAAC;IACjB,MAAM,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,YAAY,CAAC;IACzC,WAAW,EAAE,CAAC,EAAE,EAAE,YAAY,KAAK,QAAQ,CAAC;CAC7C,CAAC;AAEF,eAAO,MAAM,iBAAiB,gBACf,YAAY,GAAG,CAAC,YACnB,YAAY,GAAG,CAAC,WACjB,YAAY,EAAE,UAqBxB,CAAC"}
1
+ {"version":3,"file":"tree.d.ts","sourceRoot":"","sources":["tree.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAG9C,eAAO,MAAM,cAAc,+CAGlB,OAAO,UAkBf,CAAC;AAEF,eAAO,MAAM,aAAa,2CAA4C,YAAY,6EAE5B,OAAO,iCACzC,YAAY,EAAE,GAAG,SAAS,2EAGxB,OAAO,wCACU,IAAI;;yBA4B1C,CAAC;AAEF,KAAK,WAAW,CAAC,QAAQ,IAAI;IAC3B,IAAI,EAAE,QAAQ,EAAE,CAAC;IACjB,WAAW,EAAE,GAAG,CAAC;IACjB,MAAM,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,YAAY,CAAC;IACzC,WAAW,EAAE,CAAC,EAAE,EAAE,YAAY,KAAK,QAAQ,CAAC;CAC7C,CAAC;AAEF,eAAO,MAAM,iBAAiB,gBACf,YAAY,GAAG,CAAC,YACnB,YAAY,GAAG,CAAC,WACjB,YAAY,EAAE,UAqBxB,CAAC"}
package/esm/utils/tree.js CHANGED
@@ -1,23 +1,18 @@
1
- "use strict";
2
-
3
- require("core-js/modules/es.object.get-own-property-descriptors.js");
4
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- 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
- var _immer = require("../utils/immer");
17
- 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) {
1
+ 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); }
2
+ 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; }
3
+ 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; }
4
+ 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; }
5
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
6
+ 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); }
7
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
8
+ 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."); }
9
+ 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); }
10
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
11
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
12
+ 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; }
13
+ import { produce } from "../utils/immer";
14
+ import { deepClone } from "./clone";
15
+ export var getFlattenTree = function getFlattenTree(data) {
21
16
  var childrenKey = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'children';
22
17
  var wide = arguments.length > 2 ? arguments[2] : undefined;
23
18
  var arr = [];
@@ -25,20 +20,19 @@ var getFlattenTree = function getFlattenTree(data) {
25
20
  list.forEach(function (item) {
26
21
  var children = item[childrenKey];
27
22
  if (children && children.length > 0) {
28
- var clonedPath = (0, _toConsumableArray2.default)(path);
23
+ var clonedPath = _toConsumableArray(path);
29
24
  clonedPath.push(item);
30
25
  if (wide) arr.push(clonedPath);
31
26
  flatten(children, clonedPath);
32
27
  } else {
33
- arr.push([].concat((0, _toConsumableArray2.default)(path), [item]));
28
+ arr.push([].concat(_toConsumableArray(path), [item]));
34
29
  }
35
30
  });
36
31
  };
37
32
  flatten(data, []);
38
33
  return arr;
39
34
  };
40
- exports.getFlattenTree = getFlattenTree;
41
- var getFilterTree = function getFilterTree(treeNodes, filterFunc, filterExpandKeys, keyFunc) {
35
+ export var getFilterTree = function getFilterTree(treeNodes, filterFunc, filterExpandKeys, keyFunc) {
42
36
  var childrenKey = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 'children';
43
37
  var showHitDescendants = arguments.length > 5 ? arguments[5] : undefined;
44
38
  var firstMatchNode = arguments.length > 6 ? arguments[6] : undefined;
@@ -60,7 +54,7 @@ var getFilterTree = function getFilterTree(treeNodes, filterFunc, filterExpandKe
60
54
  if (!node[childrenKey]) return node;
61
55
  var childNodes = showHitDescendants && match ? node[childrenKey] || [] : children;
62
56
  if (advanced && match && children.length > 0) childNodes = children;
63
- return _objectSpread(_objectSpread({}, node), {}, (0, _defineProperty2.default)({}, childrenKey, childNodes));
57
+ return _objectSpread(_objectSpread({}, node), {}, _defineProperty({}, childrenKey, childNodes));
64
58
  }
65
59
  return null;
66
60
  };
@@ -68,26 +62,24 @@ var getFilterTree = function getFilterTree(treeNodes, filterFunc, filterExpandKe
68
62
  return node;
69
63
  });
70
64
  };
71
- exports.getFilterTree = getFilterTree;
72
- var mergeFilteredTree = function mergeFilteredTree(filterDatum, rawDatum, tiledId) {
65
+ export var mergeFilteredTree = function mergeFilteredTree(filterDatum, rawDatum, tiledId) {
73
66
  var filterData = filterDatum.data;
74
67
  var childrenKey = filterDatum.childrenKey;
75
68
  if (tiledId.length === 0) return filterData;
76
69
  var recursion = function recursion(node) {
77
70
  var nodeKey = filterDatum.getKey(node);
78
71
  if (tiledId.indexOf(nodeKey) >= 0) {
79
- node[childrenKey] = (0, _clone.deepClone)(rawDatum.getDataById(nodeKey)[childrenKey] || []);
72
+ node[childrenKey] = deepClone(rawDatum.getDataById(nodeKey)[childrenKey] || []);
80
73
  } else {
81
74
  var item = filterDatum.getDataById(nodeKey);
82
75
  if (item && item[childrenKey]) {
83
- node[childrenKey] = (0, _clone.deepClone)(item[childrenKey] || []);
76
+ node[childrenKey] = deepClone(item[childrenKey] || []);
84
77
  }
85
78
  }
86
79
  var children = node[childrenKey] || [];
87
80
  children.map(recursion);
88
81
  };
89
- return (0, _immer.produce)(filterData, function (draft) {
82
+ return produce(filterData, function (draft) {
90
83
  draft.map(recursion);
91
84
  });
92
- };
93
- exports.mergeFilteredTree = mergeFilteredTree;
85
+ };
package/esm/utils/uid.js CHANGED
@@ -1,22 +1,4 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.generateUUID = generateUUID;
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
- function generateUUID() {
1
+ export function generateUUID() {
20
2
  var c = crypto || typeof window !== 'undefined' && window.crypto; // 获取加密库
21
3
  if (!c || !c.getRandomValues) {
22
4
  // 如果不支持就返回一个随机的UUID v4 版本
@@ -34,7 +16,7 @@ function generateUUID() {
34
16
  };
35
17
  return (intToHex(uuid[0]) + '-' + intToHex(uuid[1]) + '-' + intToHex(uuid[2]) + '-' + intToHex(uuid[3])).toLowerCase();
36
18
  }
37
- function getUidStr() {
19
+ export function getUidStr() {
38
20
  // dom id cannot start with number
39
21
  return "a".concat(generateUUID());
40
22
  }
@@ -1,38 +1,35 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.FormError = void 0;
8
- 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); }; }
1
+ 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); }
2
+ 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); } }
3
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
4
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
5
+ 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); }
6
+ 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); }; }
7
+ 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); }
8
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
9
+ 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); }
10
+ 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
11
  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);
12
+ function _isNativeFunction(fn) { try { return Function.toString.call(fn).indexOf("[native code]") !== -1; } catch (e) { return typeof fn === "function"; } }
13
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
14
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
15
+ 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; }
16
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
17
+ 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); }
18
+ export var FormError = /*#__PURE__*/function (_Error) {
19
+ _inherits(FormError, _Error);
22
20
  var _super = _createSuper(FormError);
23
21
  function FormError(message, props) {
24
22
  var _this;
25
- (0, _classCallCheck2.default)(this, FormError);
23
+ _classCallCheck(this, FormError);
26
24
  _this = _super.call(this, message);
27
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "props", void 0);
25
+ _defineProperty(_assertThisInitialized(_this), "props", void 0);
28
26
  _this.name = 'FormError';
29
27
  _this.props = props;
30
28
  return _this;
31
29
  }
32
- return (0, _createClass2.default)(FormError);
33
- }( /*#__PURE__*/(0, _wrapNativeSuper2.default)(Error));
34
- exports.FormError = FormError;
35
- function wrapFormError(error) {
30
+ return _createClass(FormError);
31
+ }( /*#__PURE__*/_wrapNativeSuper(Error));
32
+ export function wrapFormError(error) {
36
33
  var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
37
34
  if (error instanceof FormError) return error;
38
35
  if (error instanceof Error) {