@sheinx/hooks 3.0.0-alpha.9 → 3.0.0-rc.10

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 (724) 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 +3 -2
  4. package/cjs/common/use-click-away/index.d.ts.map +1 -1
  5. package/cjs/common/use-click-away/index.js +8 -6
  6. package/cjs/common/use-default-value/index.js +3 -2
  7. package/cjs/common/use-default-value/use-default-value.js +9 -5
  8. package/cjs/common/use-drag-mock/index.js +3 -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 +3 -2
  13. package/cjs/common/use-filter/use-filter.d.ts +2 -3
  14. package/cjs/common/use-filter/use-filter.d.ts.map +1 -1
  15. package/cjs/common/use-filter/use-filter.js +48 -36
  16. package/cjs/common/use-filter/use-filter.type.d.ts +2 -1
  17. package/cjs/common/use-filter/use-filter.type.d.ts.map +1 -1
  18. package/cjs/common/use-fork-ref/index.js +6 -10
  19. package/cjs/common/use-func-change/index.js +3 -2
  20. package/cjs/common/use-func-change/use-func-change.d.ts +1 -1
  21. package/cjs/common/use-func-change/use-func-change.d.ts.map +1 -1
  22. package/cjs/common/use-func-change/use-func-change.js +3 -4
  23. package/cjs/common/use-input-able/index.js +3 -2
  24. package/cjs/common/use-input-able/use-Input-able.d.ts.map +1 -1
  25. package/cjs/common/use-input-able/use-Input-able.js +15 -7
  26. package/cjs/common/use-input-able/use-Input-able.type.d.ts +2 -1
  27. package/cjs/common/use-input-able/use-Input-able.type.d.ts.map +1 -1
  28. package/cjs/common/use-key-event/index.js +7 -8
  29. package/cjs/common/use-latest-obj/index.js +2 -3
  30. package/cjs/common/use-list-select/index.js +3 -2
  31. package/cjs/common/use-list-select/use-list-select-multiple.d.ts.map +1 -1
  32. package/cjs/common/use-list-select/use-list-select-multiple.js +29 -44
  33. package/cjs/common/use-list-select/use-list-select-single.js +9 -11
  34. package/cjs/common/use-list-select/use-list-select.js +10 -12
  35. package/cjs/common/use-pagination-list/index.d.ts +2 -1
  36. package/cjs/common/use-pagination-list/index.d.ts.map +1 -1
  37. package/cjs/common/use-pagination-list/index.js +20 -16
  38. package/cjs/common/use-persist-fn/index.js +2 -2
  39. package/cjs/common/use-position-style/get-position-style.d.ts +1 -0
  40. package/cjs/common/use-position-style/get-position-style.d.ts.map +1 -1
  41. package/cjs/common/use-position-style/get-position-style.js +16 -9
  42. package/cjs/common/use-position-style/index.d.ts +6 -6
  43. package/cjs/common/use-position-style/index.d.ts.map +1 -1
  44. package/cjs/common/use-position-style/index.js +61 -46
  45. package/cjs/common/use-previous/index.js +2 -2
  46. package/cjs/common/use-render/index.js +9 -5
  47. package/cjs/common/use-resize/index.js +12 -9
  48. package/cjs/common/use-safe-state/index.js +9 -5
  49. package/cjs/common/use-style/index.js +1 -2
  50. package/cjs/common/use-toggle/index.d.ts +1 -1
  51. package/cjs/common/use-toggle/index.d.ts.map +1 -1
  52. package/cjs/common/use-toggle/index.js +8 -3
  53. package/cjs/common/use-transform/index.js +3 -2
  54. package/cjs/common/use-transform/use-transform.d.ts.map +1 -1
  55. package/cjs/common/use-transform/use-transform.js +19 -20
  56. package/cjs/common/use-unmounted-ref/index.js +2 -2
  57. package/cjs/components/use-button/index.js +3 -2
  58. package/cjs/components/use-button/use-button.d.ts +5 -6
  59. package/cjs/components/use-button/use-button.d.ts.map +1 -1
  60. package/cjs/components/use-button/use-button.js +15 -32
  61. package/cjs/components/use-button/use-button.type.d.ts +3 -8
  62. package/cjs/components/use-button/use-button.type.d.ts.map +1 -1
  63. package/cjs/components/use-carousel/index.js +3 -2
  64. package/cjs/components/use-carousel/use-carousel.d.ts +1 -1
  65. package/cjs/components/use-carousel/use-carousel.d.ts.map +1 -1
  66. package/cjs/components/use-carousel/use-carousel.js +9 -5
  67. package/cjs/components/use-cascader/index.js +3 -2
  68. package/cjs/components/use-cascader/use-cascader.d.ts +4 -0
  69. package/cjs/components/use-cascader/use-cascader.d.ts.map +1 -1
  70. package/cjs/components/use-cascader/use-cascader.js +6 -5
  71. package/cjs/components/use-cascader/use-cascader.type.d.ts +1 -0
  72. package/cjs/components/use-cascader/use-cascader.type.d.ts.map +1 -1
  73. package/cjs/components/use-check/index.js +3 -2
  74. package/cjs/components/use-check/use-check.d.ts +3 -3
  75. package/cjs/components/use-check/use-check.js +24 -17
  76. package/cjs/components/use-collapse/index.js +3 -2
  77. package/cjs/components/use-collapse/use-collapse-item.d.ts +4 -4
  78. package/cjs/components/use-collapse/use-collapse-item.js +7 -10
  79. package/cjs/components/use-collapse/use-collapse-item.type.d.ts +1 -1
  80. package/cjs/components/use-collapse/use-collapse-item.type.d.ts.map +1 -1
  81. package/cjs/components/use-collapse/use-collapse.js +14 -13
  82. package/cjs/components/use-datepicker/index.js +3 -2
  83. package/cjs/components/use-datepicker/use-date.d.ts +1 -1
  84. package/cjs/components/use-datepicker/use-date.js +13 -11
  85. package/cjs/components/use-datepicker/use-datepicker-format.d.ts +1 -1
  86. package/cjs/components/use-datepicker/use-datepicker-format.d.ts.map +1 -1
  87. package/cjs/components/use-datepicker/use-datepicker-format.js +30 -21
  88. package/cjs/components/use-datepicker/use-datepicker-format.type.d.ts +4 -4
  89. package/cjs/components/use-datepicker/use-datepicker-format.type.d.ts.map +1 -1
  90. package/cjs/components/use-datepicker/use-datepicker-range.d.ts.map +1 -1
  91. package/cjs/components/use-datepicker/use-datepicker-range.js +12 -8
  92. package/cjs/components/use-datepicker/use-datepicker-range.type.d.ts +1 -1
  93. package/cjs/components/use-datepicker/use-datepicker-range.type.d.ts.map +1 -1
  94. package/cjs/components/use-datepicker/use-month.d.ts +1 -1
  95. package/cjs/components/use-datepicker/use-month.js +13 -11
  96. package/cjs/components/use-datepicker/use-quarter.d.ts +1 -1
  97. package/cjs/components/use-datepicker/use-quarter.js +13 -12
  98. package/cjs/components/use-datepicker/use-time.js +3 -8
  99. package/cjs/components/use-datepicker/use-year.d.ts +1 -1
  100. package/cjs/components/use-datepicker/use-year.js +13 -11
  101. package/cjs/components/use-datepicker/util.d.ts +3 -3
  102. package/cjs/components/use-datepicker/util.d.ts.map +1 -1
  103. package/cjs/components/use-datepicker/util.js +13 -20
  104. package/cjs/components/use-descriptions/index.js +3 -2
  105. package/cjs/components/use-descriptions/use-descriptions.js +14 -11
  106. package/cjs/components/use-form/Provider.d.ts.map +1 -1
  107. package/cjs/components/use-form/Provider.js +16 -12
  108. package/cjs/components/use-form/form-bind-context.d.ts.map +1 -1
  109. package/cjs/components/use-form/form-bind-context.js +7 -11
  110. package/cjs/components/use-form/form-config-context.d.ts.map +1 -1
  111. package/cjs/components/use-form/form-config-context.js +7 -11
  112. package/cjs/components/use-form/form-func-context.d.ts.map +1 -1
  113. package/cjs/components/use-form/form-func-context.js +7 -11
  114. package/cjs/components/use-form/index.js +3 -3
  115. package/cjs/components/use-form/use-form-control/index.js +3 -2
  116. package/cjs/components/use-form/use-form-control/use-form-control.d.ts +1 -0
  117. package/cjs/components/use-form/use-form-control/use-form-control.d.ts.map +1 -1
  118. package/cjs/components/use-form/use-form-control/use-form-control.js +31 -27
  119. package/cjs/components/use-form/use-form-fieldset/fieldset-context.d.ts +1 -1
  120. package/cjs/components/use-form/use-form-fieldset/fieldset-context.d.ts.map +1 -1
  121. package/cjs/components/use-form/use-form-fieldset/fieldset-context.js +24 -25
  122. package/cjs/components/use-form/use-form-fieldset/index.js +3 -2
  123. package/cjs/components/use-form/use-form-fieldset/use-form-fieldset.d.ts +1 -1
  124. package/cjs/components/use-form/use-form-fieldset/use-form-fieldset.d.ts.map +1 -1
  125. package/cjs/components/use-form/use-form-fieldset/use-form-fieldset.js +9 -19
  126. package/cjs/components/use-form/use-form-flow/index.js +3 -2
  127. package/cjs/components/use-form/use-form-flow/use-form-datum.js +1 -2
  128. package/cjs/components/use-form/use-form-flow/use-form-flow.js +2 -3
  129. package/cjs/components/use-form/use-form-item/form-item-context.d.ts.map +1 -1
  130. package/cjs/components/use-form/use-form-item/form-item-context.js +6 -9
  131. package/cjs/components/use-form/use-form-item/index.js +3 -2
  132. package/cjs/components/use-form/use-form-item/use-form-item.js +13 -14
  133. package/cjs/components/use-form/use-form.d.ts +2 -2
  134. package/cjs/components/use-form/use-form.d.ts.map +1 -1
  135. package/cjs/components/use-form/use-form.js +44 -41
  136. package/cjs/components/use-form/use-form.type.d.ts +8 -5
  137. package/cjs/components/use-form/use-form.type.d.ts.map +1 -1
  138. package/cjs/components/use-image/index.js +3 -2
  139. package/cjs/components/use-image/use-image-gallery.d.ts +4 -4
  140. package/cjs/components/use-image/use-image-gallery.d.ts.map +1 -1
  141. package/cjs/components/use-image/use-image-gallery.js +18 -15
  142. package/cjs/components/use-image/use-image-gallery.type.d.ts +1 -1
  143. package/cjs/components/use-image/use-image-gallery.type.d.ts.map +1 -1
  144. package/cjs/components/use-image/use-image-group.d.ts +2 -2
  145. package/cjs/components/use-image/use-image-group.d.ts.map +1 -1
  146. package/cjs/components/use-image/use-image-group.js +9 -12
  147. package/cjs/components/use-image/use-image-magnify.js +13 -13
  148. package/cjs/components/use-image/use-image.d.ts +3 -3
  149. package/cjs/components/use-image/use-image.d.ts.map +1 -1
  150. package/cjs/components/use-image/use-image.js +17 -23
  151. package/cjs/components/use-image/use-image.type.d.ts +4 -4
  152. package/cjs/components/use-image/use-image.type.d.ts.map +1 -1
  153. package/cjs/components/use-input/index.js +3 -2
  154. package/cjs/components/use-input/use-input-format.d.ts +1 -1
  155. package/cjs/components/use-input/use-input-format.js +13 -15
  156. package/cjs/components/use-input/use-input-format.type.d.ts +1 -1
  157. package/cjs/components/use-input/use-input-format.type.d.ts.map +1 -1
  158. package/cjs/components/use-input/use-input-number.d.ts +1 -1
  159. package/cjs/components/use-input/use-input-number.d.ts.map +1 -1
  160. package/cjs/components/use-input/use-input-number.js +16 -16
  161. package/cjs/components/use-input/use-input-number.type.d.ts +1 -1
  162. package/cjs/components/use-input/use-input-number.type.d.ts.map +1 -1
  163. package/cjs/components/use-input/use-input-password.js +11 -9
  164. package/cjs/components/use-input/use-input-password.type.d.ts +1 -1
  165. package/cjs/components/use-input/use-input-password.type.d.ts.map +1 -1
  166. package/cjs/components/use-input/use-input.d.ts +3 -3
  167. package/cjs/components/use-input/use-input.d.ts.map +1 -1
  168. package/cjs/components/use-input/use-input.js +37 -30
  169. package/cjs/components/use-input/use-input.type.d.ts +6 -5
  170. package/cjs/components/use-input/use-input.type.d.ts.map +1 -1
  171. package/cjs/components/use-menu/index.js +3 -2
  172. package/cjs/components/use-menu/use-menu-item.d.ts +1 -1
  173. package/cjs/components/use-menu/use-menu-item.d.ts.map +1 -1
  174. package/cjs/components/use-menu/use-menu-item.js +11 -12
  175. package/cjs/components/use-menu/use-menu.js +2 -8
  176. package/cjs/components/use-menu/use-menu.type.d.ts +1 -1
  177. package/cjs/components/use-menu/use-menu.type.d.ts.map +1 -1
  178. package/cjs/components/use-pagination/index.js +3 -2
  179. package/cjs/components/use-pagination/use-pagination.d.ts +1 -1
  180. package/cjs/components/use-pagination/use-pagination.d.ts.map +1 -1
  181. package/cjs/components/use-pagination/use-pagination.js +19 -13
  182. package/cjs/components/use-popup/index.js +3 -2
  183. package/cjs/components/use-popup/popup-context.d.ts.map +1 -1
  184. package/cjs/components/use-popup/popup-context.js +2 -2
  185. package/cjs/components/use-popup/use-popup.d.ts.map +1 -1
  186. package/cjs/components/use-popup/use-popup.js +20 -13
  187. package/cjs/components/use-popup/use-popup.type.d.ts +1 -1
  188. package/cjs/components/use-popup/use-popup.type.d.ts.map +1 -1
  189. package/cjs/components/use-select/index.js +3 -2
  190. package/cjs/components/use-select/use-select-group.js +13 -10
  191. package/cjs/components/use-select/use-select.d.ts.map +1 -1
  192. package/cjs/components/use-select/use-select.js +7 -5
  193. package/cjs/components/use-select/use-select.type.d.ts +2 -1
  194. package/cjs/components/use-select/use-select.type.d.ts.map +1 -1
  195. package/cjs/components/use-slider/index.js +3 -2
  196. package/cjs/components/use-slider/use-slider.js +15 -10
  197. package/cjs/components/use-table/index.js +3 -2
  198. package/cjs/components/use-table/use-table-columns.d.ts +1 -1
  199. package/cjs/components/use-table/use-table-columns.d.ts.map +1 -1
  200. package/cjs/components/use-table/use-table-columns.js +13 -20
  201. package/cjs/components/use-table/use-table-expand.js +19 -20
  202. package/cjs/components/use-table/use-table-group.js +1 -7
  203. package/cjs/components/use-table/use-table-layout.d.ts +1 -0
  204. package/cjs/components/use-table/use-table-layout.d.ts.map +1 -1
  205. package/cjs/components/use-table/use-table-layout.js +60 -45
  206. package/cjs/components/use-table/use-table-row.js +8 -9
  207. package/cjs/components/use-table/use-table-sort.d.ts +1 -1
  208. package/cjs/components/use-table/use-table-sort.d.ts.map +1 -1
  209. package/cjs/components/use-table/use-table-sort.js +21 -22
  210. package/cjs/components/use-table/use-table-tree.d.ts +1 -1
  211. package/cjs/components/use-table/use-table-tree.d.ts.map +1 -1
  212. package/cjs/components/use-table/use-table-tree.js +48 -57
  213. package/cjs/components/use-table/use-table-virtual.d.ts.map +1 -1
  214. package/cjs/components/use-table/use-table-virtual.js +23 -15
  215. package/cjs/components/use-table/use-table.type.d.ts +4 -4
  216. package/cjs/components/use-table/use-table.type.d.ts.map +1 -1
  217. package/cjs/components/use-tabs/context.d.ts.map +1 -1
  218. package/cjs/components/use-tabs/context.js +8 -13
  219. package/cjs/components/use-tabs/index.js +3 -2
  220. package/cjs/components/use-tabs/use-tabs.js +9 -6
  221. package/cjs/components/use-tabs/use-tabs.type.d.ts +2 -1
  222. package/cjs/components/use-tabs/use-tabs.type.d.ts.map +1 -1
  223. package/cjs/components/use-textarea/index.js +3 -2
  224. package/cjs/components/use-textarea/use-textarea-format.js +5 -7
  225. package/cjs/components/use-textarea/use-textarea-format.type.d.ts +1 -5
  226. package/cjs/components/use-textarea/use-textarea-format.type.d.ts.map +1 -1
  227. package/cjs/components/use-textarea/use-textarea.d.ts +2 -2
  228. package/cjs/components/use-textarea/use-textarea.js +23 -18
  229. package/cjs/components/use-textarea/use-textarea.type.d.ts +3 -3
  230. package/cjs/components/use-textarea/use-textarea.type.d.ts.map +1 -1
  231. package/cjs/components/use-transfer/index.js +3 -2
  232. package/cjs/components/use-transfer/use-transfer.js +20 -19
  233. package/cjs/components/use-transfer/use-transfer.type.d.ts +1 -1
  234. package/cjs/components/use-transfer/use-transfer.type.d.ts.map +1 -1
  235. package/cjs/components/use-tree/index.js +3 -2
  236. package/cjs/components/use-tree/use-tree-node.js +11 -7
  237. package/cjs/components/use-tree/use-tree-node.type.d.ts +2 -2
  238. package/cjs/components/use-tree/use-tree-node.type.d.ts.map +1 -1
  239. package/cjs/components/use-tree/use-tree.d.ts +4 -9
  240. package/cjs/components/use-tree/use-tree.d.ts.map +1 -1
  241. package/cjs/components/use-tree/use-tree.js +20 -29
  242. package/cjs/components/use-tree/use-tree.type.d.ts +3 -3
  243. package/cjs/components/use-tree/use-tree.type.d.ts.map +1 -1
  244. package/cjs/components/use-treeselect/index.js +3 -2
  245. package/cjs/components/use-treeselect/use-tiled.d.ts +2 -2
  246. package/cjs/components/use-treeselect/use-tiled.d.ts.map +1 -1
  247. package/cjs/components/use-treeselect/use-tiled.js +18 -21
  248. package/cjs/components/use-treeselect/use-tiled.type.d.ts +4 -3
  249. package/cjs/components/use-treeselect/use-tiled.type.d.ts.map +1 -1
  250. package/cjs/components/use-treeselect/use-treeselect.d.ts.map +1 -1
  251. package/cjs/components/use-treeselect/use-treeselect.js +5 -4
  252. package/cjs/components/use-treeselect/use-treeselect.type.d.ts +1 -0
  253. package/cjs/components/use-treeselect/use-treeselect.type.d.ts.map +1 -1
  254. package/cjs/components/use-upload/index.js +3 -2
  255. package/cjs/components/use-upload/use-upload.js +44 -42
  256. package/cjs/components/use-upload/use-upload.type.d.ts +5 -1
  257. package/cjs/components/use-upload/use-upload.type.d.ts.map +1 -1
  258. package/cjs/components/use-upload/xhr.js +0 -1
  259. package/cjs/components/use-validate/index.js +3 -2
  260. package/cjs/components/use-validate/use-validate.js +9 -5
  261. package/cjs/index.js +5 -9
  262. package/cjs/utils/accept.d.ts +1 -1
  263. package/cjs/utils/accept.d.ts.map +1 -1
  264. package/cjs/utils/accept.js +0 -4
  265. package/cjs/utils/array.js +2 -4
  266. package/cjs/utils/attribute.d.ts +1 -1
  267. package/cjs/utils/attribute.d.ts.map +1 -1
  268. package/cjs/utils/attribute.js +6 -6
  269. package/cjs/utils/clone.js +11 -20
  270. package/cjs/utils/document.d.ts.map +1 -1
  271. package/cjs/utils/document.js +10 -5
  272. package/cjs/utils/dom/element.d.ts.map +1 -1
  273. package/cjs/utils/dom/element.js +20 -17
  274. package/cjs/utils/dom/index.js +2 -3
  275. package/cjs/utils/dom/ready.d.ts.map +1 -1
  276. package/cjs/utils/dom/ready.js +2 -0
  277. package/cjs/utils/dom/responsiveObserve.js +10 -15
  278. package/cjs/utils/dom/responsiveObserve.type.d.ts +4 -4
  279. package/cjs/utils/dom/responsiveObserve.type.d.ts.map +1 -1
  280. package/cjs/utils/dom/scroll-behavior.js +2 -3
  281. package/cjs/utils/extract-event-handlers.js +0 -6
  282. package/cjs/utils/func.js +3 -5
  283. package/cjs/utils/immer.d.ts +3 -0
  284. package/cjs/utils/immer.d.ts.map +1 -0
  285. package/cjs/utils/immer.js +24 -0
  286. package/cjs/utils/index.d.ts +1 -0
  287. package/cjs/utils/index.d.ts.map +1 -1
  288. package/cjs/utils/index.js +14 -3
  289. package/cjs/utils/is.d.ts +2 -1
  290. package/cjs/utils/is.d.ts.map +1 -1
  291. package/cjs/utils/is.js +37 -55
  292. package/cjs/utils/lazyload.d.ts +1 -1
  293. package/cjs/utils/lazyload.d.ts.map +1 -1
  294. package/cjs/utils/lazyload.js +0 -1
  295. package/cjs/utils/number.js +0 -7
  296. package/cjs/utils/object.d.ts +4 -4
  297. package/cjs/utils/object.d.ts.map +1 -1
  298. package/cjs/utils/object.js +18 -37
  299. package/cjs/utils/position.js +4 -3
  300. package/cjs/utils/react-render.d.ts +1 -1
  301. package/cjs/utils/react-render.d.ts.map +1 -1
  302. package/cjs/utils/react-render.js +17 -24
  303. package/cjs/utils/render.d.ts +1 -1
  304. package/cjs/utils/render.d.ts.map +1 -1
  305. package/cjs/utils/render.js +3 -5
  306. package/cjs/utils/rule/index.js +2 -2
  307. package/cjs/utils/rule/length.d.ts +1 -1
  308. package/cjs/utils/rule/length.js +9 -11
  309. package/cjs/utils/rule/regexp.d.ts +1 -1
  310. package/cjs/utils/rule/regexp.js +4 -9
  311. package/cjs/utils/rule/required.d.ts +1 -1
  312. package/cjs/utils/rule/required.js +3 -5
  313. package/cjs/utils/rule/rule.js +4 -9
  314. package/cjs/utils/rule/rule.type.d.ts +8 -8
  315. package/cjs/utils/rule/rule.type.d.ts.map +1 -1
  316. package/cjs/utils/rule/type.d.ts +1 -1
  317. package/cjs/utils/rule/type.js +3 -5
  318. package/cjs/utils/shallow-equal.js +4 -9
  319. package/cjs/utils/string.js +0 -7
  320. package/cjs/utils/style-unit.js +0 -2
  321. package/cjs/utils/tree.d.ts +2 -2
  322. package/cjs/utils/tree.d.ts.map +1 -1
  323. package/cjs/utils/tree.js +20 -22
  324. package/cjs/utils/uid.js +2 -13
  325. package/cjs/utils/validate/error.js +22 -18
  326. package/cjs/utils/validate/get-rule.js +1 -4
  327. package/cjs/utils/validate/index.d.ts +1 -1
  328. package/cjs/utils/validate/index.d.ts.map +1 -1
  329. package/cjs/utils/validate/index.js +13 -13
  330. package/cjs/utils/validate/isJson.js +2 -5
  331. package/cjs/utils/validate/nullable.js +2 -3
  332. package/cjs/utils/validate/type.d.ts +1 -1
  333. package/cjs/utils/validate/type.d.ts.map +1 -1
  334. package/cjs/utils/validate/type.js +4 -9
  335. package/esm/common/type.d.ts +15 -15
  336. package/esm/common/type.d.ts.map +1 -1
  337. package/esm/common/type.js +1 -5
  338. package/esm/common/use-click-away/index.d.ts +3 -2
  339. package/esm/common/use-click-away/index.d.ts.map +1 -1
  340. package/esm/common/use-click-away/index.js +14 -20
  341. package/esm/common/use-default-value/index.js +3 -26
  342. package/esm/common/use-default-value/use-default-value.js +16 -19
  343. package/esm/common/use-default-value/use-previous.js +4 -10
  344. package/esm/common/use-drag-mock/index.js +4 -33
  345. package/esm/common/use-drag-mock/use-drag-mock.js +17 -20
  346. package/esm/common/use-drag-mock/use-drag-move.js +25 -28
  347. package/esm/common/use-drag-mock/use-drag-resize.js +19 -22
  348. package/esm/common/use-filter/index.js +2 -19
  349. package/esm/common/use-filter/use-filter.d.ts +2 -3
  350. package/esm/common/use-filter/use-filter.d.ts.map +1 -1
  351. package/esm/common/use-filter/use-filter.js +62 -56
  352. package/esm/common/use-filter/use-filter.type.d.ts +2 -1
  353. package/esm/common/use-filter/use-filter.type.d.ts.map +1 -1
  354. package/esm/common/use-filter/use-filter.type.js +1 -5
  355. package/esm/common/use-fork-ref/index.js +6 -20
  356. package/esm/common/use-fork-ref/setRef.js +1 -7
  357. package/esm/common/use-func-change/index.js +2 -19
  358. package/esm/common/use-func-change/use-func-change.d.ts +1 -1
  359. package/esm/common/use-func-change/use-func-change.d.ts.map +1 -1
  360. package/esm/common/use-func-change/use-func-change.js +8 -16
  361. package/esm/common/use-input-able/index.js +2 -19
  362. package/esm/common/use-input-able/use-Input-able.d.ts.map +1 -1
  363. package/esm/common/use-input-able/use-Input-able.js +27 -26
  364. package/esm/common/use-input-able/use-Input-able.type.d.ts +2 -1
  365. package/esm/common/use-input-able/use-Input-able.type.d.ts.map +1 -1
  366. package/esm/common/use-input-able/use-Input-able.type.js +1 -5
  367. package/esm/common/use-key-event/index.js +8 -15
  368. package/esm/common/use-latest-obj/index.js +5 -12
  369. package/esm/common/use-list-select/index.js +4 -33
  370. package/esm/common/use-list-select/use-list-select-multiple.d.ts.map +1 -1
  371. package/esm/common/use-list-select/use-list-select-multiple.js +44 -69
  372. package/esm/common/use-list-select/use-list-select-single.js +17 -26
  373. package/esm/common/use-list-select/use-list-select.js +16 -25
  374. package/esm/common/use-list-select/use-list.type.js +1 -5
  375. package/esm/common/use-pagination-list/index.d.ts +2 -1
  376. package/esm/common/use-pagination-list/index.d.ts.map +1 -1
  377. package/esm/common/use-pagination-list/index.js +25 -27
  378. package/esm/common/use-persist-fn/index.js +6 -11
  379. package/esm/common/use-position-style/get-position-style.d.ts +1 -0
  380. package/esm/common/use-position-style/get-position-style.d.ts.map +1 -1
  381. package/esm/common/use-position-style/get-position-style.js +16 -15
  382. package/esm/common/use-position-style/index.d.ts +6 -6
  383. package/esm/common/use-position-style/index.d.ts.map +1 -1
  384. package/esm/common/use-position-style/index.js +67 -62
  385. package/esm/common/use-previous/index.js +6 -13
  386. package/esm/common/use-render/index.js +16 -19
  387. package/esm/common/use-resize/index.js +18 -21
  388. package/esm/common/use-safe-state/index.js +16 -19
  389. package/esm/common/use-style/index.js +4 -11
  390. package/esm/common/use-toggle/index.d.ts +1 -1
  391. package/esm/common/use-toggle/index.d.ts.map +1 -1
  392. package/esm/common/use-toggle/index.js +13 -14
  393. package/esm/common/use-transform/index.js +2 -19
  394. package/esm/common/use-transform/use-transform.d.ts.map +1 -1
  395. package/esm/common/use-transform/use-transform.js +29 -36
  396. package/esm/common/use-transform/use-transform.type.js +1 -5
  397. package/esm/common/use-unmounted-ref/index.js +6 -13
  398. package/esm/components/use-button/index.js +2 -19
  399. package/esm/components/use-button/use-button-group.type.js +1 -5
  400. package/esm/components/use-button/use-button.d.ts +5 -6
  401. package/esm/components/use-button/use-button.d.ts.map +1 -1
  402. package/esm/components/use-button/use-button.js +20 -43
  403. package/esm/components/use-button/use-button.type.d.ts +3 -8
  404. package/esm/components/use-button/use-button.type.d.ts.map +1 -1
  405. package/esm/components/use-button/use-button.type.js +1 -5
  406. package/esm/components/use-carousel/index.js +2 -19
  407. package/esm/components/use-carousel/use-carousel.d.ts +1 -1
  408. package/esm/components/use-carousel/use-carousel.d.ts.map +1 -1
  409. package/esm/components/use-carousel/use-carousel.js +21 -24
  410. package/esm/components/use-cascader/index.js +2 -19
  411. package/esm/components/use-cascader/use-cascader.d.ts +4 -0
  412. package/esm/components/use-cascader/use-cascader.d.ts.map +1 -1
  413. package/esm/components/use-cascader/use-cascader.js +9 -15
  414. package/esm/components/use-cascader/use-cascader.type.d.ts +1 -0
  415. package/esm/components/use-cascader/use-cascader.type.d.ts.map +1 -1
  416. package/esm/components/use-cascader/use-cascader.type.js +1 -5
  417. package/esm/components/use-check/index.js +2 -19
  418. package/esm/components/use-check/use-check.d.ts +3 -3
  419. package/esm/components/use-check/use-check.js +32 -31
  420. package/esm/components/use-check/use-check.type.js +1 -5
  421. package/esm/components/use-collapse/index.js +3 -26
  422. package/esm/components/use-collapse/use-collapse-item.d.ts +4 -4
  423. package/esm/components/use-collapse/use-collapse-item.js +9 -18
  424. package/esm/components/use-collapse/use-collapse-item.type.d.ts +1 -1
  425. package/esm/components/use-collapse/use-collapse-item.type.d.ts.map +1 -1
  426. package/esm/components/use-collapse/use-collapse-item.type.js +1 -5
  427. package/esm/components/use-collapse/use-collapse.js +17 -22
  428. package/esm/components/use-collapse/use-collapse.type.js +1 -5
  429. package/esm/components/use-datepicker/index.js +9 -62
  430. package/esm/components/use-datepicker/use-date.d.ts +1 -1
  431. package/esm/components/use-datepicker/use-date.js +53 -57
  432. package/esm/components/use-datepicker/use-date.type.js +1 -5
  433. package/esm/components/use-datepicker/use-datepicker-format.d.ts +1 -1
  434. package/esm/components/use-datepicker/use-datepicker-format.d.ts.map +1 -1
  435. package/esm/components/use-datepicker/use-datepicker-format.js +58 -56
  436. package/esm/components/use-datepicker/use-datepicker-format.type.d.ts +4 -4
  437. package/esm/components/use-datepicker/use-datepicker-format.type.d.ts.map +1 -1
  438. package/esm/components/use-datepicker/use-datepicker-format.type.js +1 -5
  439. package/esm/components/use-datepicker/use-datepicker-range.d.ts.map +1 -1
  440. package/esm/components/use-datepicker/use-datepicker-range.js +44 -47
  441. package/esm/components/use-datepicker/use-datepicker-range.type.d.ts +1 -1
  442. package/esm/components/use-datepicker/use-datepicker-range.type.d.ts.map +1 -1
  443. package/esm/components/use-datepicker/use-datepicker-range.type.js +1 -5
  444. package/esm/components/use-datepicker/use-month.d.ts +1 -1
  445. package/esm/components/use-datepicker/use-month.js +37 -41
  446. package/esm/components/use-datepicker/use-month.type.js +1 -5
  447. package/esm/components/use-datepicker/use-quarter.d.ts +1 -1
  448. package/esm/components/use-datepicker/use-quarter.js +36 -41
  449. package/esm/components/use-datepicker/use-quarter.type.js +1 -5
  450. package/esm/components/use-datepicker/use-time.js +23 -35
  451. package/esm/components/use-datepicker/use-time.type.js +1 -5
  452. package/esm/components/use-datepicker/use-year.d.ts +1 -1
  453. package/esm/components/use-datepicker/use-year.js +37 -41
  454. package/esm/components/use-datepicker/use-year.type.js +1 -5
  455. package/esm/components/use-datepicker/util.d.ts +3 -3
  456. package/esm/components/use-datepicker/util.d.ts.map +1 -1
  457. package/esm/components/use-datepicker/util.js +67 -80
  458. package/esm/components/use-descriptions/index.js +2 -19
  459. package/esm/components/use-descriptions/use-descriptions.js +24 -27
  460. package/esm/components/use-descriptions/use-descriptions.type.js +1 -5
  461. package/esm/components/use-form/Provider.d.ts.map +1 -1
  462. package/esm/components/use-form/Provider.js +19 -25
  463. package/esm/components/use-form/form-bind-context.d.ts.map +1 -1
  464. package/esm/components/use-form/form-bind-context.js +5 -17
  465. package/esm/components/use-form/form-config-context.d.ts.map +1 -1
  466. package/esm/components/use-form/form-config-context.js +5 -17
  467. package/esm/components/use-form/form-func-context.d.ts.map +1 -1
  468. package/esm/components/use-form/form-func-context.js +5 -17
  469. package/esm/components/use-form/index.js +8 -87
  470. package/esm/components/use-form/use-form-control/index.js +2 -19
  471. package/esm/components/use-form/use-form-control/use-form-control.d.ts +1 -0
  472. package/esm/components/use-form/use-form-control/use-form-control.d.ts.map +1 -1
  473. package/esm/components/use-form/use-form-control/use-form-control.js +64 -69
  474. package/esm/components/use-form/use-form-control/use-form-control.type.js +1 -5
  475. package/esm/components/use-form/use-form-fieldset/fieldset-context.d.ts +1 -1
  476. package/esm/components/use-form/use-form-fieldset/fieldset-context.d.ts.map +1 -1
  477. package/esm/components/use-form/use-form-fieldset/fieldset-context.js +27 -35
  478. package/esm/components/use-form/use-form-fieldset/index.js +3 -26
  479. package/esm/components/use-form/use-form-fieldset/use-form-fieldset.d.ts +1 -1
  480. package/esm/components/use-form/use-form-fieldset/use-form-fieldset.d.ts.map +1 -1
  481. package/esm/components/use-form/use-form-fieldset/use-form-fieldset.js +11 -28
  482. package/esm/components/use-form/use-form-fieldset/use-form-fieldset.type.js +1 -5
  483. package/esm/components/use-form/use-form-flow/index.js +3 -26
  484. package/esm/components/use-form/use-form-flow/use-form-datum.js +4 -11
  485. package/esm/components/use-form/use-form-flow/use-form-flow.js +9 -17
  486. package/esm/components/use-form/use-form-flow/use-form-flow.type.js +1 -5
  487. package/esm/components/use-form/use-form-item/form-item-context.d.ts.map +1 -1
  488. package/esm/components/use-form/use-form-item/form-item-context.js +4 -15
  489. package/esm/components/use-form/use-form-item/index.js +2 -19
  490. package/esm/components/use-form/use-form-item/use-form-item.js +21 -32
  491. package/esm/components/use-form/use-form.d.ts +2 -2
  492. package/esm/components/use-form/use-form.d.ts.map +1 -1
  493. package/esm/components/use-form/use-form.js +80 -86
  494. package/esm/components/use-form/use-form.type.d.ts +8 -5
  495. package/esm/components/use-form/use-form.type.d.ts.map +1 -1
  496. package/esm/components/use-form/use-form.type.js +1 -5
  497. package/esm/components/use-image/index.js +5 -40
  498. package/esm/components/use-image/use-image-gallery.d.ts +4 -4
  499. package/esm/components/use-image/use-image-gallery.d.ts.map +1 -1
  500. package/esm/components/use-image/use-image-gallery.js +34 -37
  501. package/esm/components/use-image/use-image-gallery.type.d.ts +1 -1
  502. package/esm/components/use-image/use-image-gallery.type.d.ts.map +1 -1
  503. package/esm/components/use-image/use-image-gallery.type.js +1 -5
  504. package/esm/components/use-image/use-image-group.d.ts +2 -2
  505. package/esm/components/use-image/use-image-group.d.ts.map +1 -1
  506. package/esm/components/use-image/use-image-group.js +15 -24
  507. package/esm/components/use-image/use-image-group.type.js +1 -5
  508. package/esm/components/use-image/use-image-magnify.js +17 -26
  509. package/esm/components/use-image/use-image-magnify.type.js +1 -5
  510. package/esm/components/use-image/use-image.d.ts +3 -3
  511. package/esm/components/use-image/use-image.d.ts.map +1 -1
  512. package/esm/components/use-image/use-image.js +28 -41
  513. package/esm/components/use-image/use-image.type.d.ts +4 -4
  514. package/esm/components/use-image/use-image.type.d.ts.map +1 -1
  515. package/esm/components/use-image/use-image.type.js +1 -5
  516. package/esm/components/use-input/index.js +5 -40
  517. package/esm/components/use-input/use-input-format.d.ts +1 -1
  518. package/esm/components/use-input/use-input-format.js +18 -27
  519. package/esm/components/use-input/use-input-format.type.d.ts +1 -1
  520. package/esm/components/use-input/use-input-format.type.d.ts.map +1 -1
  521. package/esm/components/use-input/use-input-format.type.js +1 -5
  522. package/esm/components/use-input/use-input-number.d.ts +1 -1
  523. package/esm/components/use-input/use-input-number.d.ts.map +1 -1
  524. package/esm/components/use-input/use-input-number.js +24 -31
  525. package/esm/components/use-input/use-input-number.type.d.ts +1 -1
  526. package/esm/components/use-input/use-input-number.type.d.ts.map +1 -1
  527. package/esm/components/use-input/use-input-number.type.js +1 -5
  528. package/esm/components/use-input/use-input-password.js +16 -21
  529. package/esm/components/use-input/use-input-password.type.d.ts +1 -1
  530. package/esm/components/use-input/use-input-password.type.d.ts.map +1 -1
  531. package/esm/components/use-input/use-input-password.type.js +1 -5
  532. package/esm/components/use-input/use-input.d.ts +3 -3
  533. package/esm/components/use-input/use-input.d.ts.map +1 -1
  534. package/esm/components/use-input/use-input.js +41 -43
  535. package/esm/components/use-input/use-input.type.d.ts +6 -5
  536. package/esm/components/use-input/use-input.type.d.ts.map +1 -1
  537. package/esm/components/use-input/use-input.type.js +1 -5
  538. package/esm/components/use-menu/index.js +3 -20
  539. package/esm/components/use-menu/use-menu-item.d.ts +1 -1
  540. package/esm/components/use-menu/use-menu-item.d.ts.map +1 -1
  541. package/esm/components/use-menu/use-menu-item.js +23 -31
  542. package/esm/components/use-menu/use-menu.js +15 -28
  543. package/esm/components/use-menu/use-menu.type.d.ts +1 -1
  544. package/esm/components/use-menu/use-menu.type.d.ts.map +1 -1
  545. package/esm/components/use-menu/use-menu.type.js +1 -5
  546. package/esm/components/use-pagination/index.js +2 -19
  547. package/esm/components/use-pagination/use-pagination.d.ts +1 -1
  548. package/esm/components/use-pagination/use-pagination.d.ts.map +1 -1
  549. package/esm/components/use-pagination/use-pagination.js +25 -25
  550. package/esm/components/use-pagination/use-pagination.type.js +1 -5
  551. package/esm/components/use-popup/index.js +2 -19
  552. package/esm/components/use-popup/popup-context.d.ts.map +1 -1
  553. package/esm/components/use-popup/popup-context.js +4 -9
  554. package/esm/components/use-popup/use-popup.d.ts.map +1 -1
  555. package/esm/components/use-popup/use-popup.js +40 -40
  556. package/esm/components/use-popup/use-popup.type.d.ts +1 -1
  557. package/esm/components/use-popup/use-popup.type.d.ts.map +1 -1
  558. package/esm/components/use-popup/use-popup.type.js +1 -5
  559. package/esm/components/use-select/index.js +3 -26
  560. package/esm/components/use-select/use-select-group.js +19 -22
  561. package/esm/components/use-select/use-select-group.type.js +1 -5
  562. package/esm/components/use-select/use-select.d.ts.map +1 -1
  563. package/esm/components/use-select/use-select.js +11 -15
  564. package/esm/components/use-select/use-select.type.d.ts +2 -1
  565. package/esm/components/use-select/use-select.type.d.ts.map +1 -1
  566. package/esm/components/use-select/use-select.type.js +1 -5
  567. package/esm/components/use-slider/index.js +2 -19
  568. package/esm/components/use-slider/use-slider.js +30 -32
  569. package/esm/components/use-slider/use-slider.type.js +1 -5
  570. package/esm/components/use-table/index.js +9 -68
  571. package/esm/components/use-table/use-table-columns.d.ts +1 -1
  572. package/esm/components/use-table/use-table-columns.d.ts.map +1 -1
  573. package/esm/components/use-table/use-table-columns.js +17 -31
  574. package/esm/components/use-table/use-table-expand.js +24 -35
  575. package/esm/components/use-table/use-table-group.js +5 -17
  576. package/esm/components/use-table/use-table-layout.d.ts +1 -0
  577. package/esm/components/use-table/use-table-layout.d.ts.map +1 -1
  578. package/esm/components/use-table/use-table-layout.js +89 -83
  579. package/esm/components/use-table/use-table-row.js +18 -25
  580. package/esm/components/use-table/use-table-sort.d.ts +1 -1
  581. package/esm/components/use-table/use-table-sort.d.ts.map +1 -1
  582. package/esm/components/use-table/use-table-sort.js +34 -41
  583. package/esm/components/use-table/use-table-tree.d.ts +1 -1
  584. package/esm/components/use-table/use-table-tree.d.ts.map +1 -1
  585. package/esm/components/use-table/use-table-tree.js +61 -76
  586. package/esm/components/use-table/use-table-virtual.d.ts.map +1 -1
  587. package/esm/components/use-table/use-table-virtual.js +40 -38
  588. package/esm/components/use-table/use-table.type.d.ts +4 -4
  589. package/esm/components/use-table/use-table.type.d.ts.map +1 -1
  590. package/esm/components/use-table/use-table.type.js +1 -5
  591. package/esm/components/use-tabs/context.d.ts.map +1 -1
  592. package/esm/components/use-tabs/context.js +8 -21
  593. package/esm/components/use-tabs/context.type.js +1 -5
  594. package/esm/components/use-tabs/index.js +3 -26
  595. package/esm/components/use-tabs/use-tabs.js +13 -16
  596. package/esm/components/use-tabs/use-tabs.type.d.ts +2 -1
  597. package/esm/components/use-tabs/use-tabs.type.d.ts.map +1 -1
  598. package/esm/components/use-tabs/use-tabs.type.js +1 -5
  599. package/esm/components/use-textarea/index.js +3 -26
  600. package/esm/components/use-textarea/use-textarea-format.js +6 -15
  601. package/esm/components/use-textarea/use-textarea-format.type.d.ts +1 -5
  602. package/esm/components/use-textarea/use-textarea-format.type.d.ts.map +1 -1
  603. package/esm/components/use-textarea/use-textarea-format.type.js +1 -5
  604. package/esm/components/use-textarea/use-textarea.d.ts +2 -2
  605. package/esm/components/use-textarea/use-textarea.js +31 -32
  606. package/esm/components/use-textarea/use-textarea.type.d.ts +3 -3
  607. package/esm/components/use-textarea/use-textarea.type.d.ts.map +1 -1
  608. package/esm/components/use-textarea/use-textarea.type.js +1 -5
  609. package/esm/components/use-transfer/index.js +2 -19
  610. package/esm/components/use-transfer/use-transfer.js +33 -38
  611. package/esm/components/use-transfer/use-transfer.type.d.ts +1 -1
  612. package/esm/components/use-transfer/use-transfer.type.d.ts.map +1 -1
  613. package/esm/components/use-transfer/use-transfer.type.js +1 -5
  614. package/esm/components/use-tree/index.js +3 -26
  615. package/esm/components/use-tree/use-tree-node.js +17 -20
  616. package/esm/components/use-tree/use-tree-node.type.d.ts +2 -2
  617. package/esm/components/use-tree/use-tree-node.type.d.ts.map +1 -1
  618. package/esm/components/use-tree/use-tree-node.type.js +1 -5
  619. package/esm/components/use-tree/use-tree.d.ts +4 -9
  620. package/esm/components/use-tree/use-tree.d.ts.map +1 -1
  621. package/esm/components/use-tree/use-tree.js +33 -49
  622. package/esm/components/use-tree/use-tree.type.d.ts +3 -3
  623. package/esm/components/use-tree/use-tree.type.d.ts.map +1 -1
  624. package/esm/components/use-tree/use-tree.type.js +1 -5
  625. package/esm/components/use-treeselect/index.js +3 -26
  626. package/esm/components/use-treeselect/use-tiled.d.ts +2 -2
  627. package/esm/components/use-treeselect/use-tiled.d.ts.map +1 -1
  628. package/esm/components/use-treeselect/use-tiled.js +27 -36
  629. package/esm/components/use-treeselect/use-tiled.type.d.ts +4 -3
  630. package/esm/components/use-treeselect/use-tiled.type.d.ts.map +1 -1
  631. package/esm/components/use-treeselect/use-tiled.type.js +1 -5
  632. package/esm/components/use-treeselect/use-treeselect.d.ts.map +1 -1
  633. package/esm/components/use-treeselect/use-treeselect.js +7 -12
  634. package/esm/components/use-treeselect/use-treeselect.type.d.ts +1 -0
  635. package/esm/components/use-treeselect/use-treeselect.type.d.ts.map +1 -1
  636. package/esm/components/use-treeselect/use-treeselect.type.js +1 -5
  637. package/esm/components/use-upload/index.js +2 -19
  638. package/esm/components/use-upload/use-upload.js +62 -67
  639. package/esm/components/use-upload/use-upload.type.d.ts +5 -1
  640. package/esm/components/use-upload/use-upload.type.d.ts.map +1 -1
  641. package/esm/components/use-upload/use-upload.type.js +1 -5
  642. package/esm/components/use-upload/xhr.js +1 -8
  643. package/esm/components/use-validate/index.js +2 -19
  644. package/esm/components/use-validate/use-validate.js +16 -19
  645. package/esm/components/use-validate/use-validate.type.js +1 -5
  646. package/esm/index.js +49 -547
  647. package/esm/utils/accept.d.ts +1 -1
  648. package/esm/utils/accept.d.ts.map +1 -1
  649. package/esm/utils/accept.js +1 -11
  650. package/esm/utils/array.js +2 -10
  651. package/esm/utils/attribute.d.ts +1 -1
  652. package/esm/utils/attribute.d.ts.map +1 -1
  653. package/esm/utils/attribute.js +6 -12
  654. package/esm/utils/clone.js +19 -34
  655. package/esm/utils/document.d.ts.map +1 -1
  656. package/esm/utils/document.js +11 -13
  657. package/esm/utils/dom/element.d.ts.map +1 -1
  658. package/esm/utils/dom/element.js +30 -37
  659. package/esm/utils/dom/index.js +5 -69
  660. package/esm/utils/dom/normalize-wheel.js +1 -7
  661. package/esm/utils/dom/normalize-wheel.type.js +1 -5
  662. package/esm/utils/dom/ready.d.ts.map +1 -1
  663. package/esm/utils/dom/ready.js +3 -7
  664. package/esm/utils/dom/responsiveObserve.js +10 -21
  665. package/esm/utils/dom/responsiveObserve.type.d.ts +4 -4
  666. package/esm/utils/dom/responsiveObserve.type.d.ts.map +1 -1
  667. package/esm/utils/dom/responsiveObserve.type.js +1 -5
  668. package/esm/utils/dom/scroll-behavior.js +2 -9
  669. package/esm/utils/extract-event-handlers.js +1 -13
  670. package/esm/utils/func.js +3 -11
  671. package/esm/utils/immer.d.ts +3 -0
  672. package/esm/utils/immer.d.ts.map +1 -0
  673. package/esm/utils/immer.js +13 -0
  674. package/esm/utils/index.d.ts +1 -0
  675. package/esm/utils/index.d.ts.map +1 -1
  676. package/esm/utils/index.js +22 -257
  677. package/esm/utils/is.d.ts +2 -1
  678. package/esm/utils/is.d.ts.map +1 -1
  679. package/esm/utils/is.js +36 -65
  680. package/esm/utils/lazyload.d.ts +1 -1
  681. package/esm/utils/lazyload.d.ts.map +1 -1
  682. package/esm/utils/lazyload.js +6 -15
  683. package/esm/utils/number.js +6 -24
  684. package/esm/utils/object.d.ts +4 -4
  685. package/esm/utils/object.d.ts.map +1 -1
  686. package/esm/utils/object.js +30 -59
  687. package/esm/utils/position.js +8 -13
  688. package/esm/utils/react-render.d.ts +1 -1
  689. package/esm/utils/react-render.d.ts.map +1 -1
  690. package/esm/utils/react-render.js +16 -31
  691. package/esm/utils/render.d.ts +1 -1
  692. package/esm/utils/render.d.ts.map +1 -1
  693. package/esm/utils/render.js +4 -13
  694. package/esm/utils/rule/index.js +1 -19
  695. package/esm/utils/rule/length.d.ts +1 -1
  696. package/esm/utils/rule/length.js +11 -19
  697. package/esm/utils/rule/regexp.d.ts +1 -1
  698. package/esm/utils/rule/regexp.js +7 -18
  699. package/esm/utils/rule/required.d.ts +1 -1
  700. package/esm/utils/rule/required.js +6 -14
  701. package/esm/utils/rule/rule.js +20 -33
  702. package/esm/utils/rule/rule.type.d.ts +8 -8
  703. package/esm/utils/rule/rule.type.d.ts.map +1 -1
  704. package/esm/utils/rule/rule.type.js +1 -5
  705. package/esm/utils/rule/type.d.ts +1 -1
  706. package/esm/utils/rule/type.js +6 -14
  707. package/esm/utils/shallow-equal.js +7 -21
  708. package/esm/utils/string.js +2 -16
  709. package/esm/utils/style-unit.js +3 -11
  710. package/esm/utils/tree.d.ts +2 -2
  711. package/esm/utils/tree.d.ts.map +1 -1
  712. package/esm/utils/tree.js +24 -32
  713. package/esm/utils/uid.js +4 -22
  714. package/esm/utils/validate/error.js +23 -26
  715. package/esm/utils/validate/get-rule.js +16 -26
  716. package/esm/utils/validate/index.d.ts +1 -1
  717. package/esm/utils/validate/index.d.ts.map +1 -1
  718. package/esm/utils/validate/index.js +20 -40
  719. package/esm/utils/validate/isJson.js +3 -12
  720. package/esm/utils/validate/nullable.js +2 -9
  721. package/esm/utils/validate/type.d.ts +1 -1
  722. package/esm/utils/validate/type.d.ts.map +1 -1
  723. package/esm/utils/validate/type.js +8 -19
  724. package/package.json +5 -3
@@ -1,18 +1,17 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.default = void 0;
8
- require("core-js/modules/es.array.index-of.js");
9
- require("core-js/modules/es.array.splice.js");
10
- var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
11
- var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
12
- var _react = require("react");
13
- var _useTree3 = require("../use-tree");
14
- var _tree = require("../../utils/tree");
15
- var _jsxRuntime = require("react/jsx-runtime");
1
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
2
+ 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."); }
3
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
4
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
5
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
6
+ 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."); }
7
+ 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); }
8
+ 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; }
9
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
10
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
11
+ import { useState } from 'react';
12
+ import { useTree } from "../use-tree";
13
+ import { mergeFilteredTree } from "../../utils/tree";
14
+ import { jsx as _jsx } from "react/jsx-runtime";
16
15
  var useTiled = function useTiled(props) {
17
16
  var data = props.data,
18
17
  keygen = props.keygen,
@@ -26,51 +25,44 @@ var useTiled = function useTiled(props) {
26
25
  originIcon = props.originIcon,
27
26
  moreIcon = props.moreIcon,
28
27
  onAdvancedFilter = props.onAdvancedFilter;
29
- var _useState = (0, _react.useState)([]),
30
- _useState2 = (0, _slicedToArray2.default)(_useState, 2),
28
+ var _useState = useState([]),
29
+ _useState2 = _slicedToArray(_useState, 2),
31
30
  tileds = _useState2[0],
32
31
  setTileds = _useState2[1];
33
- var _useTree = (0, _useTree3.useTree)({
32
+ var _useTree = useTree({
34
33
  data: data,
35
34
  childrenKey: childrenKey,
36
35
  keygen: keygen,
37
36
  isControlled: false
38
37
  }),
39
38
  datum = _useTree.datum;
40
- var _useTree2 = (0, _useTree3.useTree)({
39
+ var _useTree2 = useTree({
41
40
  data: rawData,
42
41
  childrenKey: childrenKey,
43
42
  keygen: keygen,
44
43
  isControlled: false
45
44
  }),
46
- rawDatum = _useTree2.datum,
47
- getRawKey = _useTree2.getKey,
48
- getRawDataById = _useTree2.getDataById;
45
+ rawDatum = _useTree2.datum;
49
46
  var handleToggle = function handleToggle(e, key) {
50
47
  e.stopPropagation();
51
- var nextTileds = (0, _toConsumableArray2.default)(tileds);
48
+ var nextTileds = _toConsumableArray(tileds);
52
49
  var index = nextTileds.indexOf(key);
53
50
  if (index >= 0) nextTileds.splice(index, 1);else nextTileds.push(key);
54
51
  setTileds(nextTileds);
55
52
  };
56
- var handleFilter = function handleFilter(text) {
53
+ var handleFilter = function handleFilter(text, from) {
57
54
  if (!text) setTileds([]);
58
- if (onFilter) onFilter(text);
55
+ if (onFilter) onFilter(text, from);
59
56
  };
60
57
  var getIcon = function getIcon(item) {
61
- var key = getRawKey(item);
62
- var rawDataItem = getRawDataById(key);
58
+ var key = rawDatum.getKey(item);
59
+ var rawDataItem = rawDatum.getDataById(key);
63
60
  if (!item || !rawDataItem) return originIcon;
64
-
65
- // const sameCount =
66
- // item[childrenKey] &&
67
- // rawDataItem[childrenKey] &&
68
- // (item[childrenKey] as DataItem[]).length === (rawDataItem[childrenKey] as DataItem[]).length;
69
61
  if (expanded.indexOf(key) === -1) return originIcon;
70
62
  var handleClick = function handleClick(e) {
71
63
  handleToggle(e, key);
72
64
  };
73
- return /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
65
+ return /*#__PURE__*/_jsx("span", {
74
66
  style: {
75
67
  display: 'inline-flex',
76
68
  alignItems: 'center',
@@ -88,12 +80,11 @@ var useTiled = function useTiled(props) {
88
80
  onFilter: onFilter
89
81
  };
90
82
  }
91
- var nextData = (0, _tree.mergeFilteredTree)(datum, rawDatum, tileds);
83
+ var nextData = mergeFilteredTree(datum, rawDatum, tileds);
92
84
  return {
93
85
  data: nextData,
94
86
  onFilter: handleFilter,
95
87
  expandIcons: [getIcon, getIcon]
96
88
  };
97
89
  };
98
- var _default = useTiled;
99
- exports.default = _default;
90
+ export default useTiled;
@@ -1,11 +1,12 @@
1
1
  import React from 'react';
2
- import { TreeKeygenType, KeygenResult } from '../../common/type';
2
+ import { TreeKeygenType, KeygenResult, ObjectKey } from '../../common/type';
3
+ export type FilterFormType = 'blur' | 'edit';
3
4
  export interface UseTiledProps<DataItem> {
4
5
  data: DataItem[];
5
6
  rawData: DataItem[];
6
- onFilter?: (text: string) => void;
7
+ onFilter?: (text: string, from?: string) => void;
7
8
  keygen: TreeKeygenType<DataItem>;
8
- childrenKey?: keyof DataItem & string;
9
+ childrenKey?: ObjectKey<DataItem>;
9
10
  expanded?: KeygenResult[];
10
11
  filterText?: string;
11
12
  originIcon: React.ReactNode;
@@ -1 +1 @@
1
- {"version":3,"file":"use-tiled.type.d.ts","sourceRoot":"","sources":["use-tiled.type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjE,MAAM,WAAW,aAAa,CAAC,QAAQ;IACrC,IAAI,EAAE,QAAQ,EAAE,CAAC;IACjB,OAAO,EAAE,QAAQ,EAAE,CAAC;IACpB,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,MAAM,EAAE,cAAc,CAAC,QAAQ,CAAC,CAAC;IACjC,WAAW,CAAC,EAAE,MAAM,QAAQ,GAAG,MAAM,CAAC;IACtC,QAAQ,CAAC,EAAE,YAAY,EAAE,CAAC;IAC1B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,KAAK,CAAC,SAAS,CAAC;IAC5B,QAAQ,EAAE,MAAM,KAAK,CAAC,SAAS,CAAC;IAChC,gBAAgB,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,CAAC,IAAI,EAAE,QAAQ,KAAK,OAAO,CAAC;CAClE"}
1
+ {"version":3,"file":"use-tiled.type.d.ts","sourceRoot":"","sources":["use-tiled.type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAE5E,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,MAAM,CAAC;AAE7C,MAAM,WAAW,aAAa,CAAC,QAAQ;IACrC,IAAI,EAAE,QAAQ,EAAE,CAAC;IACjB,OAAO,EAAE,QAAQ,EAAE,CAAC;IACpB,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACjD,MAAM,EAAE,cAAc,CAAC,QAAQ,CAAC,CAAC;IACjC,WAAW,CAAC,EAAE,SAAS,CAAC,QAAQ,CAAC,CAAC;IAClC,QAAQ,CAAC,EAAE,YAAY,EAAE,CAAC;IAC1B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,KAAK,CAAC,SAAS,CAAC;IAC5B,QAAQ,EAAE,MAAM,KAAK,CAAC,SAAS,CAAC;IAChC,gBAAgB,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,CAAC,IAAI,EAAE,QAAQ,KAAK,OAAO,CAAC;CAClE"}
@@ -1,5 +1 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
1
+ export {};
@@ -1 +1 @@
1
- {"version":3,"file":"use-treeselect.d.ts","sourceRoot":"","sources":["use-treeselect.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAG5D,QAAA,MAAM,aAAa;;;CAelB,CAAC;AAEF,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"use-treeselect.d.ts","sourceRoot":"","sources":["use-treeselect.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,QAAA,MAAM,aAAa;;;CAuBlB,CAAC;AAEF,eAAe,aAAa,CAAC"}
@@ -1,22 +1,18 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _useInputAble2 = require("../../common/use-input-able");
1
+ import { useInputAble } from "../../common/use-input-able";
8
2
  var useTreeSelect = function useTreeSelect(props) {
9
3
  var valueProp = props.value,
10
4
  defaultValue = props.defaultValue,
11
5
  control = props.control,
12
6
  beforeChange = props.beforeChange,
13
- onChangeProp = props.onChange;
14
- var _useInputAble = (0, _useInputAble2.useInputAble)({
7
+ onChangeProp = props.onChange,
8
+ filterSameChange = props.filterSameChange;
9
+ var _useInputAble = useInputAble({
15
10
  value: valueProp,
16
11
  control: control,
17
12
  defaultValue: defaultValue,
18
13
  beforeChange: beforeChange,
19
- onChange: onChangeProp
14
+ onChange: onChangeProp,
15
+ filterSameChange: filterSameChange
20
16
  }),
21
17
  value = _useInputAble.value,
22
18
  onChange = _useInputAble.onChange;
@@ -25,5 +21,4 @@ var useTreeSelect = function useTreeSelect(props) {
25
21
  onChange: onChange
26
22
  };
27
23
  };
28
- var _default = useTreeSelect;
29
- exports.default = _default;
24
+ export default useTreeSelect;
@@ -5,5 +5,6 @@ export interface BaseTreeSelectProps<DataItem, Value> {
5
5
  control: boolean;
6
6
  beforeChange?: (value: Value) => any;
7
7
  onChange?: (value: Value, selected?: DataItem, path?: (string | number)[]) => void;
8
+ filterSameChange?: boolean;
8
9
  }
9
10
  //# sourceMappingURL=use-treeselect.type.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"use-treeselect.type.d.ts","sourceRoot":"","sources":["use-treeselect.type.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,mBAAmB,CAAC,QAAQ,EAAE,KAAK;IAClD,IAAI,CAAC,EAAE,QAAQ,EAAE,CAAC;IAClB,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,YAAY,CAAC,EAAE,KAAK,CAAC;IACrB,OAAO,EAAE,OAAO,CAAC;IACjB,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,GAAG,CAAC;IACrC,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,CAAC,EAAE,QAAQ,EAAE,IAAI,CAAC,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,KAAK,IAAI,CAAC;CACpF"}
1
+ {"version":3,"file":"use-treeselect.type.d.ts","sourceRoot":"","sources":["use-treeselect.type.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,mBAAmB,CAAC,QAAQ,EAAE,KAAK;IAClD,IAAI,CAAC,EAAE,QAAQ,EAAE,CAAC;IAClB,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,YAAY,CAAC,EAAE,KAAK,CAAC;IACrB,OAAO,EAAE,OAAO,CAAC;IACjB,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,GAAG,CAAC;IACrC,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,CAAC,EAAE,QAAQ,EAAE,IAAI,CAAC,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,KAAK,IAAI,CAAC;IACnF,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B"}
@@ -1,5 +1 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
1
+ export {};
@@ -1,19 +1,2 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- Object.defineProperty(exports, "default", {
8
- enumerable: true,
9
- get: function get() {
10
- return _useUpload.default;
11
- }
12
- });
13
- Object.defineProperty(exports, "useUpload", {
14
- enumerable: true,
15
- get: function get() {
16
- return _useUpload.default;
17
- }
18
- });
19
- var _useUpload = _interopRequireDefault(require("./use-upload"));
1
+ "use client";
2
+ export { default as useUpload, default } from "./use-upload";
@@ -1,33 +1,29 @@
1
- "use strict";
2
-
3
- require("core-js/modules/es.array.filter.js");
4
- require("core-js/modules/web.dom-collections.for-each.js");
5
- require("core-js/modules/es.object.get-own-property-descriptors.js");
6
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
7
- Object.defineProperty(exports, "__esModule", {
8
- value: true
9
- });
10
- exports.default = void 0;
11
- var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
12
- var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
13
- var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
14
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
15
- var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
16
- require("core-js/modules/es.promise.js");
17
- require("core-js/modules/es.regexp.exec.js");
18
- require("core-js/modules/es.array.from.js");
19
- require("core-js/modules/es.array.iterator.js");
20
- require("core-js/modules/web.dom-collections.iterator.js");
21
- require("core-js/modules/es.array.splice.js");
22
- var _react = require("react");
23
- var _immer = require("immer");
24
- var _useLatestObj = _interopRequireDefault(require("../../common/use-latest-obj"));
25
- var _xhr = _interopRequireDefault(require("./xhr"));
26
- var _accept = require("../../utils/accept");
27
- var _utils = require("../../utils");
28
- var _ = require("../..");
29
- 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; }
30
- 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; }
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 _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
3
+ 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."); }
4
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
5
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
6
+ function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
7
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
8
+ function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
9
+ 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; }
10
+ 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; }
11
+ 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; }
12
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
13
+ 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); }
14
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
15
+ 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."); }
16
+ 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); }
17
+ 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; }
18
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
19
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
20
+ import { useState } from 'react';
21
+ import { produce } from "../../utils/immer";
22
+ import useLatestObj from "../../common/use-latest-obj";
23
+ import xhrUpload from "./xhr";
24
+ import { attrAccept } from "../../utils/accept";
25
+ import { getUidStr } from "../../utils/uid";
26
+ import { usePersistFn, util } from "../..";
31
27
  var VALIDATORITEMS = [{
32
28
  key: 'size',
33
29
  param: function param(blob) {
@@ -68,12 +64,12 @@ var useUpload = function useUpload(props) {
68
64
  value = _props$value === void 0 ? [] : _props$value;
69
65
  var accept = props.forceAccept || props.accept;
70
66
  var forceAccept = !!props.forceAccept;
71
- var _useState = (0, _react.useState)({}),
72
- _useState2 = (0, _slicedToArray2.default)(_useState, 2),
67
+ var _useState = useState({}),
68
+ _useState2 = _slicedToArray(_useState, 2),
73
69
  filesState = _useState2[0],
74
70
  setFiles = _useState2[1];
75
- var _useState3 = (0, _react.useState)([]),
76
- _useState4 = (0, _slicedToArray2.default)(_useState3, 2),
71
+ var _useState3 = useState([]),
72
+ _useState4 = _slicedToArray(_useState3, 2),
77
73
  recycleValues = _useState4[0],
78
74
  setRecycleValues = _useState4[1];
79
75
  var restLength = limit - value.length - Object.keys(filesState).length;
@@ -82,9 +78,9 @@ var useUpload = function useUpload(props) {
82
78
  invalidImage: 'invalidImage'
83
79
  }, props.text);
84
80
  var validateFile = /*#__PURE__*/function () {
85
- var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(blob, image) {
81
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(blob, image) {
86
82
  var validator, error, i, acceptRes, item;
87
- return _regenerator.default.wrap(function _callee$(_context) {
83
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
88
84
  while (1) switch (_context.prev = _context.next) {
89
85
  case 0:
90
86
  validator = props.validator;
@@ -94,7 +90,7 @@ var useUpload = function useUpload(props) {
94
90
  _context.next = 7;
95
91
  break;
96
92
  }
97
- acceptRes = (0, _accept.attrAccept)(blob, accept);
93
+ acceptRes = attrAccept(blob, accept);
98
94
  if (acceptRes) {
99
95
  _context.next = 7;
100
96
  break;
@@ -161,20 +157,20 @@ var useUpload = function useUpload(props) {
161
157
  if (onError) message = onError(xhr, file) || message;
162
158
  if (onHttpError) message = onHttpError(xhr, file) || message;
163
159
  setFiles(function (files) {
164
- return (0, _immer.produce)(files, function (draft) {
160
+ return produce(files, function (draft) {
165
161
  if (!draft[id]) return draft;
166
- draft[id].status = 'error';
162
+ draft[id].status = 3;
167
163
  draft[id].message = message;
168
164
  });
169
165
  });
170
166
  };
171
- var getCurrent = (0, _.usePersistFn)(function () {
167
+ var getCurrent = usePersistFn(function () {
172
168
  return {
173
169
  filesState: filesState
174
170
  };
175
171
  });
176
172
  var uploadFile = function uploadFile(id, file, data) {
177
- var request = props.request || _xhr.default;
173
+ var request = props.request || xhrUpload;
178
174
  var throttle = false;
179
175
  var options = {
180
176
  url: getAction(file),
@@ -216,21 +212,21 @@ var useUpload = function useUpload(props) {
216
212
  }
217
213
  if (result instanceof Error) {
218
214
  setFiles(function (files) {
219
- return (0, _immer.produce)(files, function (draft) {
215
+ return produce(files, function (draft) {
220
216
  if (!draft[id]) return draft;
221
- draft[id].status = 'error';
217
+ draft[id].status = 3;
222
218
  draft[id].name = file.name;
223
219
  draft[id].message = result.message;
224
220
  });
225
221
  });
226
222
  } else {
227
223
  setFiles(function (files) {
228
- return (0, _immer.produce)(files, function (draft) {
224
+ return produce(files, function (draft) {
229
225
  delete draft[id];
230
226
  });
231
227
  });
232
228
  // add value
233
- var values = (0, _immer.produce)(value, function (draft) {
229
+ var values = produce(value, function (draft) {
234
230
  draft.push(result);
235
231
  });
236
232
  props.onChange(values);
@@ -284,9 +280,9 @@ var useUpload = function useUpload(props) {
284
280
  });
285
281
  };
286
282
  var addFiles = /*#__PURE__*/function () {
287
- var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(files) {
288
- var fileList, newFiles, resetLength, list, _loop, i, _ret;
289
- return _regenerator.default.wrap(function _callee2$(_context3) {
283
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(files) {
284
+ var fileList, newFiles, resetLength, list, _loop, _ret, i;
285
+ return _regeneratorRuntime().wrap(function _callee2$(_context3) {
290
286
  while (1) switch (_context3.prev = _context3.next) {
291
287
  case 0:
292
288
  if (!props.disabled) {
@@ -308,17 +304,17 @@ var useUpload = function useUpload(props) {
308
304
  list = Array.from({
309
305
  length: Math.min(fileList.length, resetLength)
310
306
  });
311
- _loop = /*#__PURE__*/_regenerator.default.mark(function _loop() {
307
+ _loop = /*#__PURE__*/_regeneratorRuntime().mark(function _loop() {
312
308
  var blob, id, fileRecord, error, imageResult, beforeUploadResult;
313
- return _regenerator.default.wrap(function _loop$(_context2) {
309
+ return _regeneratorRuntime().wrap(function _loop$(_context2) {
314
310
  while (1) switch (_context2.prev = _context2.next) {
315
311
  case 0:
316
312
  blob = fileList[i];
317
- id = (0, _utils.getUidStr)();
313
+ id = getUidStr();
318
314
  fileRecord = {
319
315
  name: blob.name,
320
316
  process: -1,
321
- status: 'uploading',
317
+ status: 1,
322
318
  blob: blob
323
319
  };
324
320
  newFiles[id] = fileRecord;
@@ -360,12 +356,12 @@ var useUpload = function useUpload(props) {
360
356
  }
361
357
  delete newFiles[id];
362
358
  setFiles(_objectSpread({}, newFiles));
363
- return _context2.abrupt("return", "continue");
359
+ return _context2.abrupt("return", 0);
364
360
  case 26:
365
361
  fileRecord.message = error.message;
366
- fileRecord.status = 'error';
362
+ fileRecord.status = 3;
367
363
  setFiles(_objectSpread({}, newFiles));
368
- return _context2.abrupt("return", "continue");
364
+ return _context2.abrupt("return", 0);
369
365
  case 30:
370
366
  if (!props.beforeUpload) {
371
367
  _context2.next = 37;
@@ -385,7 +381,7 @@ var useUpload = function useUpload(props) {
385
381
  delete newFiles[id];
386
382
  setFiles(_objectSpread({}, newFiles));
387
383
  });
388
- return _context2.abrupt("return", "continue");
384
+ return _context2.abrupt("return", 0);
389
385
  case 35:
390
386
  _context2.next = 39;
391
387
  break;
@@ -407,7 +403,7 @@ var useUpload = function useUpload(props) {
407
403
  return _context3.delegateYield(_loop(), "t0", 13);
408
404
  case 13:
409
405
  _ret = _context3.t0;
410
- if (!(_ret === "continue")) {
406
+ if (!(_ret === 0)) {
411
407
  _context3.next = 16;
412
408
  break;
413
409
  }
@@ -430,17 +426,17 @@ var useUpload = function useUpload(props) {
430
426
  var beforeCancel = props.beforeCancel,
431
427
  onErrorRemove = props.onErrorRemove;
432
428
  var file = filesState[id];
433
- if (beforeCancel && _.util.isFunc(beforeCancel)) beforeCancel(file);
429
+ if (beforeCancel && util.isFunc(beforeCancel)) beforeCancel(file);
434
430
  if (file) {
435
431
  if (file.xhr && file.xhr.abort) file.xhr.abort();
436
432
  setFiles(function (pre) {
437
- return (0, _immer.produce)(pre, function (draft) {
433
+ return produce(pre, function (draft) {
438
434
  var newFiles = _objectSpread({}, draft);
439
435
  delete newFiles[id];
440
436
  return newFiles;
441
437
  });
442
438
  });
443
- if (file.status === 'error' && onErrorRemove) {
439
+ if (file.status === 3 && onErrorRemove) {
444
440
  onErrorRemove(file.xhr, file.blob, file);
445
441
  }
446
442
  }
@@ -452,12 +448,12 @@ var useUpload = function useUpload(props) {
452
448
  var current = props.value[index];
453
449
  var startRemove = typeof beforeRemove === 'function' ? beforeRemove(current) : Promise.resolve();
454
450
  startRemove.then(function () {
455
- var newRecycle = (0, _toConsumableArray2.default)(recycleValues);
451
+ var newRecycle = _toConsumableArray(recycleValues);
456
452
  if (typeof recoverAble !== 'number' ? !!recoverAble : recycleValues.length < recoverAble) {
457
453
  newRecycle.push(value[index]);
458
454
  }
459
455
  setRecycleValues(newRecycle);
460
- var newValue = (0, _immer.produce)(props.value, function (draft) {
456
+ var newValue = produce(props.value, function (draft) {
461
457
  draft.splice(index, 1);
462
458
  });
463
459
  props.onChange(newValue);
@@ -465,16 +461,16 @@ var useUpload = function useUpload(props) {
465
461
  };
466
462
  var recoverValue = function recoverValue(index) {
467
463
  if (props.disabled) return;
468
- props.onChange((0, _immer.produce)(props.value, function (draft) {
464
+ props.onChange(produce(props.value, function (draft) {
469
465
  draft.push(recycleValues[index]);
470
466
  }));
471
467
  setRecycleValues(function (pre) {
472
- var newRecycle = (0, _toConsumableArray2.default)(pre);
468
+ var newRecycle = _toConsumableArray(pre);
473
469
  newRecycle.splice(index, 1);
474
470
  return newRecycle;
475
471
  });
476
472
  };
477
- var func = (0, _useLatestObj.default)({
473
+ var func = useLatestObj({
478
474
  addFiles: addFiles,
479
475
  removeFile: removeFile,
480
476
  removeValue: removeValue,
@@ -488,5 +484,4 @@ var useUpload = function useUpload(props) {
488
484
  func: func
489
485
  };
490
486
  };
491
- var _default = useUpload;
492
- exports.default = _default;
487
+ export default useUpload;
@@ -11,7 +11,11 @@ export interface XhrResult {
11
11
  export interface FileRecord {
12
12
  name: string;
13
13
  process: number;
14
- status: 'error' | 'success' | 'uploading';
14
+ /**
15
+ * @en 1: uploading, 2: success, 3: error
16
+ * @cn 1: 上传中, 2: 成功, 3: 失败
17
+ */
18
+ status: 1 | 2 | 3;
15
19
  blob: File;
16
20
  xhr?: XhrResult | void;
17
21
  message?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"use-upload.type.d.ts","sourceRoot":"","sources":["use-upload.type.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C,MAAM,WAAW,SAAS;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,0BAA0B,CAAC;IAC1C,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,GAAG,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,IAAI,CAAC;IACnB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB;AACD,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAA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,OAAO,CAAC,GAAG,CAAC,CAAC;CACtD;AAED,MAAM,WAAW,aAAa,CAAC,CAAC;IAC9B;;;OAGG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ;;;OAGG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;;;OAIG;IACH,eAAe,EAAE,OAAO,CAAC;IACzB;;;OAGG;IACH,YAAY,EAAE,cAAc,CAAC,cAAc,CAAC,CAAC;IAC7C;;;OAGG;IACH,IAAI,EAAE,IAAI,CAAC;IACX;;;;OAIG;IACH,OAAO,CAAC,EAAE,UAAU,CAAC;IACrB;;;OAGG;IACH,OAAO,EAAE,CAAC,GAAG,EAAE,SAAS,KAAK,IAAI,CAAC;IAClC;;;OAGG;IACH,MAAM,EAAE,CAAC,GAAG,EAAE,SAAS,KAAK,IAAI,CAAC;IACjC;;;OAGG;IACH,UAAU,EAAE,CAAC,KAAK,EAAE,aAAa,EAAE,GAAG,CAAC,EAAE,MAAM,KAAK,GAAG,CAAC;IACxD;;;OAGG;IACH,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;IAC/B;;;OAGG;IACH,SAAS,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE,SAAS,KAAK,CAAC,GAAG,KAAK,CAAC;IAClF;;;;OAIG;IACH,MAAM,CAAC,EAAE,UAAU,CAAC;CACrB"}
@@ -1,5 +1 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
1
+ export {};
@@ -1,10 +1,3 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = _default;
7
- require("core-js/modules/web.dom-collections.for-each.js");
8
1
  function createCORSRequest(method, url) {
9
2
  var xhr = new XMLHttpRequest();
10
3
  if ('withCredentials' in xhr) {
@@ -20,7 +13,7 @@ function createCORSRequest(method, url) {
20
13
  }
21
14
  return xhr;
22
15
  }
23
- function _default(args) {
16
+ export default function (args) {
24
17
  var url = args.url,
25
18
  name = args.name,
26
19
  file = args.file,
@@ -1,19 +1,2 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- Object.defineProperty(exports, "default", {
8
- enumerable: true,
9
- get: function get() {
10
- return _useValidate.default;
11
- }
12
- });
13
- Object.defineProperty(exports, "useValidate", {
14
- enumerable: true,
15
- get: function get() {
16
- return _useValidate.default;
17
- }
18
- });
19
- var _useValidate = _interopRequireDefault(require("./use-validate"));
1
+ "use client";
2
+ export { default, default as useValidate } from "./use-validate";