@sheinx/hooks 3.0.0-alpha.3 → 3.0.0-alpha.31

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 (443) hide show
  1. package/cjs/common/use-click-away/index.d.ts +1 -0
  2. package/cjs/common/use-click-away/index.d.ts.map +1 -1
  3. package/cjs/common/use-click-away/index.js +6 -3
  4. package/cjs/common/use-default-value/index.js +1 -0
  5. package/cjs/common/use-drag-mock/index.js +1 -0
  6. package/cjs/common/use-filter/index.js +1 -0
  7. package/cjs/common/use-filter/use-filter.d.ts +4 -3
  8. package/cjs/common/use-filter/use-filter.d.ts.map +1 -1
  9. package/cjs/common/use-filter/use-filter.js +41 -23
  10. package/cjs/common/use-filter/use-filter.type.d.ts +3 -1
  11. package/cjs/common/use-filter/use-filter.type.d.ts.map +1 -1
  12. package/cjs/common/use-fork-ref/index.js +1 -0
  13. package/cjs/common/use-fork-ref/setRef.d.ts +0 -1
  14. package/cjs/common/use-fork-ref/setRef.d.ts.map +1 -1
  15. package/cjs/common/use-fork-ref/setRef.js +0 -1
  16. package/cjs/common/use-func-change/index.js +1 -0
  17. package/cjs/common/use-func-change/use-func-change.d.ts.map +1 -1
  18. package/cjs/common/use-func-change/use-func-change.js +1 -1
  19. package/cjs/common/use-input-able/index.js +1 -0
  20. package/cjs/common/use-input-able/use-Input-able.d.ts.map +1 -1
  21. package/cjs/common/use-input-able/use-Input-able.js +7 -3
  22. package/cjs/common/use-input-able/use-Input-able.type.d.ts +1 -0
  23. package/cjs/common/use-input-able/use-Input-able.type.d.ts.map +1 -1
  24. package/cjs/common/use-key-event/index.js +1 -0
  25. package/cjs/common/use-latest-obj/index.js +1 -0
  26. package/cjs/common/use-list-select/index.js +1 -0
  27. package/cjs/common/use-list-select/use-list-select-multiple.d.ts.map +1 -1
  28. package/cjs/common/use-list-select/use-list-select-multiple.js +10 -16
  29. package/cjs/common/use-pagination-list/index.d.ts +2 -1
  30. package/cjs/common/use-pagination-list/index.d.ts.map +1 -1
  31. package/cjs/common/use-pagination-list/index.js +3 -1
  32. package/cjs/common/use-persist-fn/index.js +1 -0
  33. package/cjs/common/use-position-style/get-position-style.d.ts +1 -0
  34. package/cjs/common/use-position-style/get-position-style.d.ts.map +1 -1
  35. package/cjs/common/use-position-style/get-position-style.js +6 -2
  36. package/cjs/common/use-position-style/index.d.ts +3 -3
  37. package/cjs/common/use-position-style/index.d.ts.map +1 -1
  38. package/cjs/common/use-position-style/index.js +47 -26
  39. package/cjs/common/use-previous/index.js +1 -0
  40. package/cjs/common/use-render/index.js +1 -0
  41. package/cjs/common/use-resize/index.js +1 -0
  42. package/cjs/common/use-safe-state/index.js +1 -0
  43. package/cjs/common/use-style/index.js +1 -0
  44. package/cjs/common/use-toggle/index.js +1 -0
  45. package/cjs/common/use-transform/index.js +1 -0
  46. package/cjs/common/use-transform/use-transform.d.ts.map +1 -1
  47. package/cjs/common/use-transform/use-transform.js +6 -9
  48. package/cjs/common/use-unmounted-ref/index.js +1 -0
  49. package/cjs/components/use-button/index.js +1 -0
  50. package/cjs/components/use-button/use-button.d.ts +2 -3
  51. package/cjs/components/use-button/use-button.d.ts.map +1 -1
  52. package/cjs/components/use-button/use-button.js +3 -19
  53. package/cjs/components/use-button/use-button.type.d.ts +51 -1
  54. package/cjs/components/use-button/use-button.type.d.ts.map +1 -1
  55. package/cjs/components/use-carousel/index.js +1 -0
  56. package/cjs/components/use-cascader/index.js +1 -0
  57. package/cjs/components/use-cascader/use-cascader.d.ts +6 -2
  58. package/cjs/components/use-cascader/use-cascader.d.ts.map +1 -1
  59. package/cjs/components/use-cascader/use-cascader.js +6 -3
  60. package/cjs/components/use-cascader/use-cascader.type.d.ts +3 -0
  61. package/cjs/components/use-cascader/use-cascader.type.d.ts.map +1 -1
  62. package/cjs/components/use-check/index.js +1 -0
  63. package/cjs/components/use-check/use-check.type.d.ts +25 -0
  64. package/cjs/components/use-check/use-check.type.d.ts.map +1 -1
  65. package/cjs/components/use-collapse/index.js +1 -0
  66. package/cjs/components/use-collapse/use-collapse-item.type.d.ts +17 -0
  67. package/cjs/components/use-collapse/use-collapse-item.type.d.ts.map +1 -1
  68. package/cjs/components/use-collapse/use-collapse.type.d.ts +13 -0
  69. package/cjs/components/use-collapse/use-collapse.type.d.ts.map +1 -1
  70. package/cjs/components/use-datepicker/index.js +1 -0
  71. package/cjs/components/use-datepicker/use-date.d.ts +1 -1
  72. package/cjs/components/use-datepicker/use-datepicker-format.d.ts +1 -1
  73. package/cjs/components/use-datepicker/use-datepicker-format.d.ts.map +1 -1
  74. package/cjs/components/use-datepicker/use-datepicker-format.js +5 -1
  75. package/cjs/components/use-datepicker/use-datepicker-range.d.ts.map +1 -1
  76. package/cjs/components/use-datepicker/use-datepicker-range.js +2 -1
  77. package/cjs/components/use-datepicker/use-month.d.ts +1 -1
  78. package/cjs/components/use-datepicker/use-quarter.d.ts +1 -1
  79. package/cjs/components/use-datepicker/use-time.js +1 -1
  80. package/cjs/components/use-datepicker/use-year.d.ts +1 -1
  81. package/cjs/components/use-descriptions/index.js +1 -0
  82. package/cjs/components/use-descriptions/use-descriptions.type.d.ts +41 -0
  83. package/cjs/components/use-descriptions/use-descriptions.type.d.ts.map +1 -1
  84. package/cjs/components/use-form/Provider.d.ts.map +1 -1
  85. package/cjs/components/use-form/Provider.js +11 -3
  86. package/cjs/components/use-form/form-bind-context.d.ts.map +1 -1
  87. package/cjs/components/use-form/form-bind-context.js +1 -0
  88. package/cjs/components/use-form/form-config-context.d.ts.map +1 -1
  89. package/cjs/components/use-form/form-config-context.js +1 -0
  90. package/cjs/components/use-form/form-func-context.d.ts.map +1 -1
  91. package/cjs/components/use-form/form-func-context.js +1 -0
  92. package/cjs/components/use-form/index.js +1 -0
  93. package/cjs/components/use-form/use-form-control/index.js +1 -0
  94. package/cjs/components/use-form/use-form-control/use-form-control.d.ts +1 -0
  95. package/cjs/components/use-form/use-form-control/use-form-control.d.ts.map +1 -1
  96. package/cjs/components/use-form/use-form-control/use-form-control.js +9 -5
  97. package/cjs/components/use-form/use-form-fieldset/fieldset-context.d.ts +1 -1
  98. package/cjs/components/use-form/use-form-fieldset/fieldset-context.d.ts.map +1 -1
  99. package/cjs/components/use-form/use-form-fieldset/fieldset-context.js +15 -7
  100. package/cjs/components/use-form/use-form-fieldset/index.js +1 -0
  101. package/cjs/components/use-form/use-form-fieldset/use-form-fieldset.d.ts +1 -1
  102. package/cjs/components/use-form/use-form-fieldset/use-form-fieldset.d.ts.map +1 -1
  103. package/cjs/components/use-form/use-form-fieldset/use-form-fieldset.js +7 -15
  104. package/cjs/components/use-form/use-form-flow/index.js +1 -0
  105. package/cjs/components/use-form/use-form-item/form-item-context.d.ts.map +1 -1
  106. package/cjs/components/use-form/use-form-item/form-item-context.js +1 -0
  107. package/cjs/components/use-form/use-form-item/index.js +1 -0
  108. package/cjs/components/use-form/use-form-item/use-form-item.js +1 -1
  109. package/cjs/components/use-form/use-form.d.ts.map +1 -1
  110. package/cjs/components/use-form/use-form.js +16 -4
  111. package/cjs/components/use-form/use-form.type.d.ts +4 -1
  112. package/cjs/components/use-form/use-form.type.d.ts.map +1 -1
  113. package/cjs/components/use-image/index.js +1 -0
  114. package/cjs/components/use-image/use-image.type.d.ts +76 -0
  115. package/cjs/components/use-image/use-image.type.d.ts.map +1 -1
  116. package/cjs/components/use-input/index.js +1 -0
  117. package/cjs/components/use-input/use-input-format.d.ts +1 -1
  118. package/cjs/components/use-input/use-input-format.type.d.ts +25 -5
  119. package/cjs/components/use-input/use-input-format.type.d.ts.map +1 -1
  120. package/cjs/components/use-input/use-input-number.d.ts +1 -1
  121. package/cjs/components/use-input/use-input-number.d.ts.map +1 -1
  122. package/cjs/components/use-input/use-input-number.js +1 -0
  123. package/cjs/components/use-input/use-input-number.type.d.ts +17 -0
  124. package/cjs/components/use-input/use-input-number.type.d.ts.map +1 -1
  125. package/cjs/components/use-input/use-input-password.type.d.ts +21 -0
  126. package/cjs/components/use-input/use-input-password.type.d.ts.map +1 -1
  127. package/cjs/components/use-input/use-input.d.ts.map +1 -1
  128. package/cjs/components/use-input/use-input.js +9 -3
  129. package/cjs/components/use-input/use-input.type.d.ts +44 -0
  130. package/cjs/components/use-input/use-input.type.d.ts.map +1 -1
  131. package/cjs/components/use-menu/index.js +1 -0
  132. package/cjs/components/use-pagination/index.js +1 -0
  133. package/cjs/components/use-popup/index.js +1 -0
  134. package/cjs/components/use-popup/popup-context.d.ts.map +1 -1
  135. package/cjs/components/use-popup/popup-context.js +1 -0
  136. package/cjs/components/use-popup/use-popup.d.ts.map +1 -1
  137. package/cjs/components/use-popup/use-popup.js +6 -2
  138. package/cjs/components/use-select/index.js +1 -0
  139. package/cjs/components/use-select/use-select.d.ts.map +1 -1
  140. package/cjs/components/use-select/use-select.js +6 -3
  141. package/cjs/components/use-select/use-select.type.d.ts +37 -0
  142. package/cjs/components/use-select/use-select.type.d.ts.map +1 -1
  143. package/cjs/components/use-slider/index.js +1 -0
  144. package/cjs/components/use-table/index.js +1 -0
  145. package/cjs/components/use-table/use-table-columns.js +9 -12
  146. package/cjs/components/use-table/use-table-layout.d.ts +1 -0
  147. package/cjs/components/use-table/use-table-layout.d.ts.map +1 -1
  148. package/cjs/components/use-table/use-table-layout.js +28 -13
  149. package/cjs/components/use-table/use-table-tree.d.ts +1 -1
  150. package/cjs/components/use-table/use-table-tree.d.ts.map +1 -1
  151. package/cjs/components/use-table/use-table-tree.js +38 -40
  152. package/cjs/components/use-table/use-table-virtual.d.ts.map +1 -1
  153. package/cjs/components/use-table/use-table-virtual.js +12 -2
  154. package/cjs/components/use-tabs/context.d.ts.map +1 -1
  155. package/cjs/components/use-tabs/context.js +1 -0
  156. package/cjs/components/use-tabs/context.type.d.ts +25 -0
  157. package/cjs/components/use-tabs/context.type.d.ts.map +1 -1
  158. package/cjs/components/use-tabs/index.js +1 -0
  159. package/cjs/components/use-tabs/use-tabs.type.d.ts +9 -0
  160. package/cjs/components/use-tabs/use-tabs.type.d.ts.map +1 -1
  161. package/cjs/components/use-textarea/index.js +1 -0
  162. package/cjs/components/use-textarea/use-textarea-format.type.d.ts +0 -4
  163. package/cjs/components/use-textarea/use-textarea-format.type.d.ts.map +1 -1
  164. package/cjs/components/use-textarea/use-textarea.type.d.ts +29 -0
  165. package/cjs/components/use-textarea/use-textarea.type.d.ts.map +1 -1
  166. package/cjs/components/use-transfer/index.js +1 -0
  167. package/cjs/components/use-transfer/use-transfer.type.d.ts +53 -0
  168. package/cjs/components/use-transfer/use-transfer.type.d.ts.map +1 -1
  169. package/cjs/components/use-tree/index.d.ts +1 -2
  170. package/cjs/components/use-tree/index.d.ts.map +1 -1
  171. package/cjs/components/use-tree/index.js +2 -8
  172. package/cjs/components/use-tree/use-tree.d.ts +14 -19
  173. package/cjs/components/use-tree/use-tree.d.ts.map +1 -1
  174. package/cjs/components/use-tree/use-tree.js +29 -25
  175. package/cjs/components/use-tree/use-tree.type.d.ts +75 -13
  176. package/cjs/components/use-tree/use-tree.type.d.ts.map +1 -1
  177. package/cjs/components/use-treeselect/index.js +1 -0
  178. package/cjs/components/use-treeselect/use-tiled.d.ts +2 -2
  179. package/cjs/components/use-treeselect/use-tiled.d.ts.map +1 -1
  180. package/cjs/components/use-treeselect/use-tiled.js +5 -12
  181. package/cjs/components/use-treeselect/use-tiled.type.d.ts +4 -3
  182. package/cjs/components/use-treeselect/use-tiled.type.d.ts.map +1 -1
  183. package/cjs/components/use-treeselect/use-treeselect.d.ts +1 -1
  184. package/cjs/components/use-treeselect/use-treeselect.d.ts.map +1 -1
  185. package/cjs/components/use-treeselect/use-treeselect.js +4 -2
  186. package/cjs/components/use-treeselect/use-treeselect.type.d.ts +2 -1
  187. package/cjs/components/use-treeselect/use-treeselect.type.d.ts.map +1 -1
  188. package/cjs/components/use-upload/index.js +1 -0
  189. package/cjs/components/use-upload/use-upload.js +8 -8
  190. package/cjs/components/use-upload/use-upload.type.d.ts +5 -1
  191. package/cjs/components/use-upload/use-upload.type.d.ts.map +1 -1
  192. package/cjs/components/use-validate/index.js +1 -0
  193. package/cjs/index.js +1 -0
  194. package/cjs/utils/attribute.d.ts +1 -1
  195. package/cjs/utils/attribute.d.ts.map +1 -1
  196. package/cjs/utils/attribute.js +3 -1
  197. package/cjs/utils/document.d.ts.map +1 -1
  198. package/cjs/utils/document.js +8 -1
  199. package/cjs/utils/dom/element.d.ts.map +1 -1
  200. package/cjs/utils/dom/element.js +9 -6
  201. package/cjs/utils/dom/ready.d.ts.map +1 -1
  202. package/cjs/utils/dom/ready.js +2 -0
  203. package/cjs/utils/immer.d.ts +10 -0
  204. package/cjs/utils/immer.d.ts.map +1 -0
  205. package/cjs/utils/immer.js +21 -0
  206. package/cjs/utils/index.d.ts +1 -0
  207. package/cjs/utils/index.d.ts.map +1 -1
  208. package/cjs/utils/index.js +12 -0
  209. package/cjs/utils/is.d.ts +1 -0
  210. package/cjs/utils/is.d.ts.map +1 -1
  211. package/cjs/utils/is.js +10 -3
  212. package/cjs/utils/tree.d.ts +1 -1
  213. package/cjs/utils/tree.d.ts.map +1 -1
  214. package/cjs/utils/tree.js +1 -1
  215. package/cjs/utils/uid.js +2 -2
  216. package/esm/common/use-click-away/index.d.ts +1 -0
  217. package/esm/common/use-click-away/index.d.ts.map +1 -1
  218. package/esm/common/use-click-away/index.js +6 -3
  219. package/esm/common/use-default-value/index.js +1 -0
  220. package/esm/common/use-drag-mock/index.js +1 -0
  221. package/esm/common/use-filter/index.js +1 -0
  222. package/esm/common/use-filter/use-filter.d.ts +4 -3
  223. package/esm/common/use-filter/use-filter.d.ts.map +1 -1
  224. package/esm/common/use-filter/use-filter.js +41 -23
  225. package/esm/common/use-filter/use-filter.type.d.ts +3 -1
  226. package/esm/common/use-filter/use-filter.type.d.ts.map +1 -1
  227. package/esm/common/use-fork-ref/index.js +1 -0
  228. package/esm/common/use-fork-ref/setRef.d.ts +0 -1
  229. package/esm/common/use-fork-ref/setRef.d.ts.map +1 -1
  230. package/esm/common/use-fork-ref/setRef.js +0 -1
  231. package/esm/common/use-func-change/index.js +1 -0
  232. package/esm/common/use-func-change/use-func-change.d.ts.map +1 -1
  233. package/esm/common/use-func-change/use-func-change.js +1 -1
  234. package/esm/common/use-input-able/index.js +1 -0
  235. package/esm/common/use-input-able/use-Input-able.d.ts.map +1 -1
  236. package/esm/common/use-input-able/use-Input-able.js +7 -3
  237. package/esm/common/use-input-able/use-Input-able.type.d.ts +1 -0
  238. package/esm/common/use-input-able/use-Input-able.type.d.ts.map +1 -1
  239. package/esm/common/use-key-event/index.js +1 -0
  240. package/esm/common/use-latest-obj/index.js +1 -0
  241. package/esm/common/use-list-select/index.js +1 -0
  242. package/esm/common/use-list-select/use-list-select-multiple.d.ts.map +1 -1
  243. package/esm/common/use-list-select/use-list-select-multiple.js +10 -16
  244. package/esm/common/use-pagination-list/index.d.ts +2 -1
  245. package/esm/common/use-pagination-list/index.d.ts.map +1 -1
  246. package/esm/common/use-pagination-list/index.js +3 -1
  247. package/esm/common/use-persist-fn/index.js +1 -0
  248. package/esm/common/use-position-style/get-position-style.d.ts +1 -0
  249. package/esm/common/use-position-style/get-position-style.d.ts.map +1 -1
  250. package/esm/common/use-position-style/get-position-style.js +6 -2
  251. package/esm/common/use-position-style/index.d.ts +3 -3
  252. package/esm/common/use-position-style/index.d.ts.map +1 -1
  253. package/esm/common/use-position-style/index.js +47 -26
  254. package/esm/common/use-previous/index.js +1 -0
  255. package/esm/common/use-render/index.js +1 -0
  256. package/esm/common/use-resize/index.js +1 -0
  257. package/esm/common/use-safe-state/index.js +1 -0
  258. package/esm/common/use-style/index.js +1 -0
  259. package/esm/common/use-toggle/index.js +1 -0
  260. package/esm/common/use-transform/index.js +1 -0
  261. package/esm/common/use-transform/use-transform.d.ts.map +1 -1
  262. package/esm/common/use-transform/use-transform.js +6 -9
  263. package/esm/common/use-unmounted-ref/index.js +1 -0
  264. package/esm/components/use-button/index.js +1 -0
  265. package/esm/components/use-button/use-button.d.ts +2 -3
  266. package/esm/components/use-button/use-button.d.ts.map +1 -1
  267. package/esm/components/use-button/use-button.js +3 -19
  268. package/esm/components/use-button/use-button.type.d.ts +51 -1
  269. package/esm/components/use-button/use-button.type.d.ts.map +1 -1
  270. package/esm/components/use-carousel/index.js +1 -0
  271. package/esm/components/use-cascader/index.js +1 -0
  272. package/esm/components/use-cascader/use-cascader.d.ts +6 -2
  273. package/esm/components/use-cascader/use-cascader.d.ts.map +1 -1
  274. package/esm/components/use-cascader/use-cascader.js +6 -3
  275. package/esm/components/use-cascader/use-cascader.type.d.ts +3 -0
  276. package/esm/components/use-cascader/use-cascader.type.d.ts.map +1 -1
  277. package/esm/components/use-check/index.js +1 -0
  278. package/esm/components/use-check/use-check.type.d.ts +25 -0
  279. package/esm/components/use-check/use-check.type.d.ts.map +1 -1
  280. package/esm/components/use-collapse/index.js +1 -0
  281. package/esm/components/use-collapse/use-collapse-item.type.d.ts +17 -0
  282. package/esm/components/use-collapse/use-collapse-item.type.d.ts.map +1 -1
  283. package/esm/components/use-collapse/use-collapse.type.d.ts +13 -0
  284. package/esm/components/use-collapse/use-collapse.type.d.ts.map +1 -1
  285. package/esm/components/use-datepicker/index.js +1 -0
  286. package/esm/components/use-datepicker/use-date.d.ts +1 -1
  287. package/esm/components/use-datepicker/use-datepicker-format.d.ts +1 -1
  288. package/esm/components/use-datepicker/use-datepicker-format.d.ts.map +1 -1
  289. package/esm/components/use-datepicker/use-datepicker-format.js +5 -1
  290. package/esm/components/use-datepicker/use-datepicker-range.d.ts.map +1 -1
  291. package/esm/components/use-datepicker/use-datepicker-range.js +2 -1
  292. package/esm/components/use-datepicker/use-month.d.ts +1 -1
  293. package/esm/components/use-datepicker/use-quarter.d.ts +1 -1
  294. package/esm/components/use-datepicker/use-time.js +1 -1
  295. package/esm/components/use-datepicker/use-year.d.ts +1 -1
  296. package/esm/components/use-descriptions/index.js +1 -0
  297. package/esm/components/use-descriptions/use-descriptions.type.d.ts +41 -0
  298. package/esm/components/use-descriptions/use-descriptions.type.d.ts.map +1 -1
  299. package/esm/components/use-form/Provider.d.ts.map +1 -1
  300. package/esm/components/use-form/Provider.js +11 -3
  301. package/esm/components/use-form/form-bind-context.d.ts.map +1 -1
  302. package/esm/components/use-form/form-bind-context.js +1 -0
  303. package/esm/components/use-form/form-config-context.d.ts.map +1 -1
  304. package/esm/components/use-form/form-config-context.js +1 -0
  305. package/esm/components/use-form/form-func-context.d.ts.map +1 -1
  306. package/esm/components/use-form/form-func-context.js +1 -0
  307. package/esm/components/use-form/index.js +1 -0
  308. package/esm/components/use-form/use-form-control/index.js +1 -0
  309. package/esm/components/use-form/use-form-control/use-form-control.d.ts +1 -0
  310. package/esm/components/use-form/use-form-control/use-form-control.d.ts.map +1 -1
  311. package/esm/components/use-form/use-form-control/use-form-control.js +9 -5
  312. package/esm/components/use-form/use-form-fieldset/fieldset-context.d.ts +1 -1
  313. package/esm/components/use-form/use-form-fieldset/fieldset-context.d.ts.map +1 -1
  314. package/esm/components/use-form/use-form-fieldset/fieldset-context.js +15 -7
  315. package/esm/components/use-form/use-form-fieldset/index.js +1 -0
  316. package/esm/components/use-form/use-form-fieldset/use-form-fieldset.d.ts +1 -1
  317. package/esm/components/use-form/use-form-fieldset/use-form-fieldset.d.ts.map +1 -1
  318. package/esm/components/use-form/use-form-fieldset/use-form-fieldset.js +7 -15
  319. package/esm/components/use-form/use-form-flow/index.js +1 -0
  320. package/esm/components/use-form/use-form-item/form-item-context.d.ts.map +1 -1
  321. package/esm/components/use-form/use-form-item/form-item-context.js +1 -0
  322. package/esm/components/use-form/use-form-item/index.js +1 -0
  323. package/esm/components/use-form/use-form-item/use-form-item.js +1 -1
  324. package/esm/components/use-form/use-form.d.ts.map +1 -1
  325. package/esm/components/use-form/use-form.js +16 -4
  326. package/esm/components/use-form/use-form.type.d.ts +4 -1
  327. package/esm/components/use-form/use-form.type.d.ts.map +1 -1
  328. package/esm/components/use-image/index.js +1 -0
  329. package/esm/components/use-image/use-image.type.d.ts +76 -0
  330. package/esm/components/use-image/use-image.type.d.ts.map +1 -1
  331. package/esm/components/use-input/index.js +1 -0
  332. package/esm/components/use-input/use-input-format.d.ts +1 -1
  333. package/esm/components/use-input/use-input-format.type.d.ts +25 -5
  334. package/esm/components/use-input/use-input-format.type.d.ts.map +1 -1
  335. package/esm/components/use-input/use-input-number.d.ts +1 -1
  336. package/esm/components/use-input/use-input-number.d.ts.map +1 -1
  337. package/esm/components/use-input/use-input-number.js +1 -0
  338. package/esm/components/use-input/use-input-number.type.d.ts +17 -0
  339. package/esm/components/use-input/use-input-number.type.d.ts.map +1 -1
  340. package/esm/components/use-input/use-input-password.type.d.ts +21 -0
  341. package/esm/components/use-input/use-input-password.type.d.ts.map +1 -1
  342. package/esm/components/use-input/use-input.d.ts.map +1 -1
  343. package/esm/components/use-input/use-input.js +9 -3
  344. package/esm/components/use-input/use-input.type.d.ts +44 -0
  345. package/esm/components/use-input/use-input.type.d.ts.map +1 -1
  346. package/esm/components/use-menu/index.js +1 -0
  347. package/esm/components/use-pagination/index.js +1 -0
  348. package/esm/components/use-popup/index.js +1 -0
  349. package/esm/components/use-popup/popup-context.d.ts.map +1 -1
  350. package/esm/components/use-popup/popup-context.js +1 -0
  351. package/esm/components/use-popup/use-popup.d.ts.map +1 -1
  352. package/esm/components/use-popup/use-popup.js +6 -2
  353. package/esm/components/use-select/index.js +1 -0
  354. package/esm/components/use-select/use-select.d.ts.map +1 -1
  355. package/esm/components/use-select/use-select.js +6 -3
  356. package/esm/components/use-select/use-select.type.d.ts +37 -0
  357. package/esm/components/use-select/use-select.type.d.ts.map +1 -1
  358. package/esm/components/use-slider/index.js +1 -0
  359. package/esm/components/use-table/index.js +1 -0
  360. package/esm/components/use-table/use-table-columns.js +9 -12
  361. package/esm/components/use-table/use-table-layout.d.ts +1 -0
  362. package/esm/components/use-table/use-table-layout.d.ts.map +1 -1
  363. package/esm/components/use-table/use-table-layout.js +28 -13
  364. package/esm/components/use-table/use-table-tree.d.ts +1 -1
  365. package/esm/components/use-table/use-table-tree.d.ts.map +1 -1
  366. package/esm/components/use-table/use-table-tree.js +38 -40
  367. package/esm/components/use-table/use-table-virtual.d.ts.map +1 -1
  368. package/esm/components/use-table/use-table-virtual.js +12 -2
  369. package/esm/components/use-tabs/context.d.ts.map +1 -1
  370. package/esm/components/use-tabs/context.js +1 -0
  371. package/esm/components/use-tabs/context.type.d.ts +25 -0
  372. package/esm/components/use-tabs/context.type.d.ts.map +1 -1
  373. package/esm/components/use-tabs/index.js +1 -0
  374. package/esm/components/use-tabs/use-tabs.type.d.ts +9 -0
  375. package/esm/components/use-tabs/use-tabs.type.d.ts.map +1 -1
  376. package/esm/components/use-textarea/index.js +1 -0
  377. package/esm/components/use-textarea/use-textarea-format.type.d.ts +0 -4
  378. package/esm/components/use-textarea/use-textarea-format.type.d.ts.map +1 -1
  379. package/esm/components/use-textarea/use-textarea.type.d.ts +29 -0
  380. package/esm/components/use-textarea/use-textarea.type.d.ts.map +1 -1
  381. package/esm/components/use-transfer/index.js +1 -0
  382. package/esm/components/use-transfer/use-transfer.type.d.ts +53 -0
  383. package/esm/components/use-transfer/use-transfer.type.d.ts.map +1 -1
  384. package/esm/components/use-tree/index.d.ts +1 -2
  385. package/esm/components/use-tree/index.d.ts.map +1 -1
  386. package/esm/components/use-tree/index.js +2 -8
  387. package/esm/components/use-tree/use-tree.d.ts +14 -19
  388. package/esm/components/use-tree/use-tree.d.ts.map +1 -1
  389. package/esm/components/use-tree/use-tree.js +29 -25
  390. package/esm/components/use-tree/use-tree.type.d.ts +75 -13
  391. package/esm/components/use-tree/use-tree.type.d.ts.map +1 -1
  392. package/esm/components/use-treeselect/index.js +1 -0
  393. package/esm/components/use-treeselect/use-tiled.d.ts +2 -2
  394. package/esm/components/use-treeselect/use-tiled.d.ts.map +1 -1
  395. package/esm/components/use-treeselect/use-tiled.js +5 -12
  396. package/esm/components/use-treeselect/use-tiled.type.d.ts +4 -3
  397. package/esm/components/use-treeselect/use-tiled.type.d.ts.map +1 -1
  398. package/esm/components/use-treeselect/use-treeselect.d.ts +1 -1
  399. package/esm/components/use-treeselect/use-treeselect.d.ts.map +1 -1
  400. package/esm/components/use-treeselect/use-treeselect.js +4 -2
  401. package/esm/components/use-treeselect/use-treeselect.type.d.ts +2 -1
  402. package/esm/components/use-treeselect/use-treeselect.type.d.ts.map +1 -1
  403. package/esm/components/use-upload/index.js +1 -0
  404. package/esm/components/use-upload/use-upload.js +8 -8
  405. package/esm/components/use-upload/use-upload.type.d.ts +5 -1
  406. package/esm/components/use-upload/use-upload.type.d.ts.map +1 -1
  407. package/esm/components/use-validate/index.js +1 -0
  408. package/esm/index.js +1 -0
  409. package/esm/utils/attribute.d.ts +1 -1
  410. package/esm/utils/attribute.d.ts.map +1 -1
  411. package/esm/utils/attribute.js +3 -1
  412. package/esm/utils/document.d.ts.map +1 -1
  413. package/esm/utils/document.js +8 -1
  414. package/esm/utils/dom/element.d.ts.map +1 -1
  415. package/esm/utils/dom/element.js +9 -6
  416. package/esm/utils/dom/ready.d.ts.map +1 -1
  417. package/esm/utils/dom/ready.js +2 -0
  418. package/esm/utils/immer.d.ts +10 -0
  419. package/esm/utils/immer.d.ts.map +1 -0
  420. package/esm/utils/immer.js +21 -0
  421. package/esm/utils/index.d.ts +1 -0
  422. package/esm/utils/index.d.ts.map +1 -1
  423. package/esm/utils/index.js +12 -0
  424. package/esm/utils/is.d.ts +1 -0
  425. package/esm/utils/is.d.ts.map +1 -1
  426. package/esm/utils/is.js +10 -3
  427. package/esm/utils/tree.d.ts +1 -1
  428. package/esm/utils/tree.d.ts.map +1 -1
  429. package/esm/utils/tree.js +1 -1
  430. package/esm/utils/uid.js +2 -2
  431. package/package.json +3 -2
  432. package/cjs/components/use-tree/use-placement.d.ts +0 -6
  433. package/cjs/components/use-tree/use-placement.d.ts.map +0 -1
  434. package/cjs/components/use-tree/use-placement.js +0 -25
  435. package/cjs/components/use-tree/use-placement.type.d.ts +0 -4
  436. package/cjs/components/use-tree/use-placement.type.d.ts.map +0 -1
  437. package/cjs/components/use-tree/use-placement.type.js +0 -5
  438. package/esm/components/use-tree/use-placement.d.ts +0 -6
  439. package/esm/components/use-tree/use-placement.d.ts.map +0 -1
  440. package/esm/components/use-tree/use-placement.js +0 -25
  441. package/esm/components/use-tree/use-placement.type.d.ts +0 -4
  442. package/esm/components/use-tree/use-placement.type.d.ts.map +0 -1
  443. package/esm/components/use-tree/use-placement.type.js +0 -5
@@ -25,7 +25,7 @@ var _Provider = require("./Provider");
25
25
  var _useLatestObj = _interopRequireDefault(require("../../common/use-latest-obj"));
26
26
  var _usePersistFn = _interopRequireDefault(require("../../common/use-persist-fn"));
27
27
  var _attribute = require("../../utils/attribute");
28
- var _immer = require("immer");
28
+ var _immer = require("../../utils/immer");
29
29
  var _utils = require("../../utils");
30
30
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
31
31
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
@@ -70,7 +70,9 @@ var useForm = function useForm(props) {
70
70
  serverErrors: {},
71
71
  lastValue: props.value || emptyObj,
72
72
  resetTime: 0,
73
- mounted: false
73
+ mounted: false,
74
+ unmounted: false,
75
+ removeLock: false
74
76
  }),
75
77
  context = _React$useRef.current;
76
78
  var update = function update(name) {
@@ -154,6 +156,7 @@ var useForm = function useForm(props) {
154
156
  });
155
157
  var remove = function remove() {
156
158
  if (!context.removeArr.size) return;
159
+ if (context.unmounted) return;
157
160
  onChange(function (v) {
158
161
  context.removeArr.forEach(function (n) {
159
162
  (0, _utils.deepRemove)(v, n);
@@ -311,15 +314,15 @@ var useForm = function useForm(props) {
311
314
  onChange(function (v) {
312
315
  (0, _utils.deepSet)(v, n, df, deepSetOptions);
313
316
  });
314
- update(n);
315
317
  }
318
+ update(n);
316
319
  },
317
320
  unbind: function unbind(n, reserveAble) {
318
321
  delete context.validateMap[n];
319
322
  delete context.defaultValues[n];
320
323
  delete context.updateMap[n];
321
324
  context.names.delete(n);
322
- if (!reserveAble) {
325
+ if (!reserveAble && !context.removeLock) {
323
326
  addRemove(n);
324
327
  }
325
328
  },
@@ -395,6 +398,7 @@ var useForm = function useForm(props) {
395
398
 
396
399
  // 默认值更新
397
400
  React.useEffect(function () {
401
+ context.removeLock = false;
398
402
  if (props.value === context.lastValue) return;
399
403
  context.value = props.value || emptyObj;
400
404
  if (initValidate && !context.resetTime) {
@@ -411,7 +415,15 @@ var useForm = function useForm(props) {
411
415
  }, [props.value]);
412
416
  React.useEffect(function () {
413
417
  context.mounted = true;
418
+ context.unmounted = false;
419
+ return function () {
420
+ context.mounted = false;
421
+ context.unmounted = true;
422
+ };
414
423
  }, []);
424
+ if (props.value !== context.lastValue) {
425
+ context.removeLock = true;
426
+ }
415
427
  return {
416
428
  getFormProps: getFormProps,
417
429
  Provider: _Provider.Provider,
@@ -113,7 +113,8 @@ export interface BaseFormProps<T> extends FormCommonConfig {
113
113
  */
114
114
  scrollToError?: boolean | number;
115
115
  /**
116
- * @private 内部属性
116
+ * @en rules validation callback
117
+ * @cn rules 校验回调
117
118
  */
118
119
  onError?: (error: Error) => void;
119
120
  /**
@@ -158,6 +159,8 @@ export declare type FormContext = {
158
159
  value: ObjectType;
159
160
  errors: ObjectType<Error | undefined>;
160
161
  serverErrors: ObjectType<Error | undefined>;
162
+ unmounted: boolean;
163
+ removeLock: boolean;
161
164
  };
162
165
  export declare type UseFormSlotOwnProps = {
163
166
  onSubmit: any;
@@ -1 +1 @@
1
- {"version":3,"file":"use-form.type.d.ts","sourceRoot":"","sources":["use-form.type.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE1D,MAAM,WAAW,oBAAoB;IACnC,IAAI,CAAC,EAAE;QACL,MAAM,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;QACnD,IAAI,EAAE,CACJ,CAAC,EAAE,MAAM,EACT,EAAE,EAAE,GAAG,EACP,QAAQ,EAAE,CACR,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,GAAG,EACV,QAAQ,EAAE,UAAU,EACpB,MAAM,EAAE;YACN,UAAU,CAAC,EAAE,OAAO,CAAC;SACtB,KACE,IAAI,EACT,MAAM,EAAE,CACN,SAAS,EAAE,UAAU,EACrB,MAAM,EAAE,UAAU,CAAC,KAAK,CAAC,EACzB,YAAY,EAAE,UAAU,CAAC,KAAK,CAAC,KAC5B,IAAI,KACN,IAAI,CAAC;QACV,YAAY,EAAE,CAAC,SAAS,EACtB,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,YAAY,CAAC,SAAS,CAAC,KAC/B,YAAY,CAAC,SAAS,CAAC,CAAC;QAC7B,KAAK,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,SAAS,EAAE,MAAM,EAAE,MAAM,IAAI,KAAK,IAAI,CAAC;QACjE,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,SAAS,EAAE,MAAM,EAAE,MAAM,IAAI,KAAK,IAAI,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,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IAEjB,SAAS,EAAE,UAAU,CAAC;IAEtB,OAAO,EAAE,UAAU,CAAC,GAAG,CAAC,MAAM,IAAI,CAAC,CAAC,CAAC;IACrC,KAAK,EAAE,UAAU,CAAC;IAClB,MAAM,EAAE,UAAU,CAAC,KAAK,GAAG,SAAS,CAAC,CAAC;IACtC,YAAY,EAAE,UAAU,CAAC,KAAK,GAAG,SAAS,CAAC,CAAC;IAC5C,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF,oBAAY,mBAAmB,GAAG;IAChC,QAAQ,EAAE,GAAG,CAAC;IACd,OAAO,EAAE,GAAG,CAAC;CACd,CAAC;AAEF,oBAAY,gBAAgB,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,UAAU,CACzE,mBAAmB,EACnB,MAAM,CACP,CAAC"}
@@ -1,4 +1,5 @@
1
1
  "use strict";
2
+ "use client";
2
3
 
3
4
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
5
  Object.defineProperty(exports, "__esModule", {
@@ -18,27 +18,58 @@ export interface BaseImageProps {
18
18
  * @default -
19
19
  *
20
20
  */
21
+ /**
22
+ * @en Image fill type
23
+ * @cn 图片填充方式
24
+ */
21
25
  fit?: ImageFitType;
22
26
  /**
23
27
  * @title 懒加载容器
24
28
  * @description 指定懒加载的容器,如: #id
25
29
  * @default -
26
30
  */
31
+ /**
32
+ * @en Lazy load container
33
+ * @cn 懒加载容器
34
+ */
27
35
  container?: string | HTMLElement;
28
36
  /**
29
37
  * @title 自定义错误内容
30
38
  * @description 当图片加载失败时,允许自定义渲染对应的的内容。
31
39
  * @default -
32
40
  */
41
+ /**
42
+ * @en Custom error content
43
+ * @cn 自定义错误内容
44
+ */
33
45
  error?: React.ReactNode;
46
+ /**
47
+ * @en Original picture address
48
+ * @cn 原始图片地址
49
+ */
34
50
  href?: string;
51
+ /**
52
+ * @en Whether to delay loading, number to set lazy offset
53
+ * @cn 是否延迟加载,如果为数字则表示懒加载偏移量
54
+ * @default false
55
+ */
35
56
  lazy?: boolean | number;
57
+ /**
58
+ * @en The original property of html
59
+ * @cn 是否禁止 img 元素原生 draggable 属性
60
+ * @default false
61
+ */
36
62
  noImgDrag?: boolean;
37
63
  /**
38
64
  * @title 图加载时的占位内容
39
65
  * @description 图片加载过程中,允许自定义渲染加载时的的内容。
40
66
  * @default 'loading'
41
67
  */
68
+ /**
69
+ * @en Loading image placeholder content
70
+ * @cn 图加载时的占位内容
71
+ * @default 'loading
72
+ */
42
73
  placeholder?: React.ReactNode;
43
74
  /**
44
75
  * @title 图片形状
@@ -48,16 +79,61 @@ export interface BaseImageProps {
48
79
  * - thumbnail: 缩略图
49
80
  * @default 'rounded'
50
81
  */
82
+ /**
83
+ * @en Image shape
84
+ * @cn 图片形状
85
+ * @default 'rounded'
86
+ */
51
87
  shape?: ImageShapeType;
88
+ /**
89
+ * @en Target of image
90
+ * @cn 图片打开方式
91
+ * @default '_modal'
92
+ */
52
93
  target?: ImageTargetType;
94
+ /**
95
+ * @en The width of the image
96
+ * @cn 图片宽度
97
+ * @default '100%'
98
+ */
53
99
  width?: number | string;
100
+ /**
101
+ * @en The height of the image
102
+ * @cn 图片高度
103
+ * @default '100%'
104
+ */
54
105
  height?: number | string;
106
+ /**
107
+ * @en The picture address
108
+ * @cn 图片地址
109
+ */
55
110
  src?: string;
111
+ /**
112
+ * @en The original property of html
113
+ * @cn 原生 title 属性
114
+ */
56
115
  title?: string;
57
116
  imageRef?: React.RefObject<HTMLImageElement>;
117
+ /**
118
+ * @en The callback of click
119
+ * @cn 点击图片的回调
120
+ */
58
121
  onClick?: React.MouseEventHandler;
122
+ /**
123
+ * @en Alternate address, applied when src is invalid
124
+ * @cn 备用地址,src无效时会应用
125
+ */
59
126
  alt?: string;
127
+ /**
128
+ * @en Auto transform protocol
129
+ * @cn 是否根据页面自动转换协议
130
+ * @default false
131
+ */
60
132
  autoSSL?: boolean;
133
+ /**
134
+ * @en Callback of image src or alt request fail
135
+ * @cn src或alt 地址请求出错回调
136
+ */
61
137
  onError?: (e: Event, type: number) => void;
62
138
  }
63
139
  //# sourceMappingURL=use-image.type.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"use-image.type.d.ts","sourceRoot":"","sources":["use-image.type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,oBAAY,cAAc,GAAG,SAAS,GAAG,QAAQ,GAAG,WAAW,CAAC;AAChE,oBAAY,YAAY,GAAG,MAAM,GAAG,QAAQ,GAAG,KAAK,GAAG,SAAS,CAAC;AACjE,oBAAY,eAAe,GAAG,OAAO,GAAG,QAAQ,GAAG,QAAQ,GAAG,WAAW,CAAC;AAE1E,oBAAY,MAAM,GAAG;IACnB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CACvB,CAAC;AAEF,MAAM,WAAW,cAAc;IAC7B;;;;;;;;;OASG;IACH,GAAG,CAAC,EAAE,YAAY,CAAC;IAEnB;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,WAAW,CAAC;IAEjC;;;;OAIG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAExB,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,IAAI,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAExB,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;;;OAIG;IACH,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAE9B;;;;;;;OAOG;IACH,KAAK,CAAC,EAAE,cAAc,CAAC;IACvB,MAAM,CAAC,EAAE,eAAe,CAAC;IACzB,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,GAAG,MA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S,CAAC,EAAE,OAAO,CAAC;IAEpB;;;;OAIG;IACH;;;;OAIG;IACH,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAE9B;;;;;;;OAOG;IACH;;;;OAIG;IACH,KAAK,CAAC,EAAE,cAAc,CAAC;IACvB;;;;OAIG;IACH,MAAM,CAAC,EAAE,eAAe,CAAC;IACzB;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC;IAC7C;;;OAGG;IACH,OAAO,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC;IAClC;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;OAGG;IACH,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CAC5C"}
@@ -1,4 +1,5 @@
1
1
  "use strict";
2
+ "use client";
2
3
 
3
4
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
5
  Object.defineProperty(exports, "__esModule", {
@@ -5,7 +5,7 @@ declare const useInputFormat: (props: InputFormatProps) => {
5
5
  onBlur: (e: React.FocusEvent) => void;
6
6
  onFocus: (e: React.FocusEvent) => void;
7
7
  value: string | undefined;
8
- type: "reset" | "submit" | "search" | "color" | "button" | "time" | "image" | "text" | "email" | "url" | "range" | "tel" | (string & {}) | "checkbox" | "radio" | "hidden" | "month" | "week" | "date" | "datetime-local" | "file" | "password" | undefined;
8
+ type: "reset" | "submit" | "search" | "color" | "button" | "time" | "image" | "text" | "email" | "url" | "range" | "tel" | (string & {}) | "month" | "week" | "date" | "hidden" | "checkbox" | "datetime-local" | "file" | "password" | "radio" | undefined;
9
9
  };
10
10
  export default useInputFormat;
11
11
  //# sourceMappingURL=use-input-format.d.ts.map
@@ -4,28 +4,48 @@ export interface InputFormatProps {
4
4
  value: InputValue;
5
5
  onChange: (value: InputValue) => void;
6
6
  /**
7
- * 是否去除前后空格
7
+ * @en Whether to remove leading and trailing spaces
8
+ * @cn 是否去除前后空格
8
9
  */
9
10
  trim?: boolean;
11
+ /**
12
+ * @en Same as the type of the native input tag
13
+ * @cn 同原生 input 标签的 type
14
+ * @override string
15
+ * @default 'text'
16
+ */
10
17
  type?: React.InputHTMLAttributes<HTMLInputElement>['type'];
18
+ /**
19
+ * @en Number type supports "positive" and "non-negative", only works when type = number
20
+ * @cn 设置数字类型 支持 "positive" 和 "non-negative", 仅在 type = number 下生效
21
+ */
11
22
  numType?: 'non-negative' | 'positive';
23
+ /**
24
+ * @en Show as thousands separator, valid only when type is "number"
25
+ * @cn 以千位分隔符展示,仅当 type 为 number 时有效
26
+ * @default false
27
+ */
12
28
  coin?: boolean;
13
29
  /**
14
- * 整数位数限制, 仅在 type = number 下生效
30
+ * @en Integer limit, only works when type = number
31
+ * @cn 整数位数限制, 仅在 type = number 下生效
15
32
  */
16
33
  integerLimit?: number;
17
34
  /**
18
- * 小数位数限制, 仅在 type = number 下生效
35
+ * @en Decimal limit, only works when type = number
36
+ * @cn 小数位数限制, 仅在 type = number 下生效
19
37
  */
20
38
  digits?: number;
21
39
  /**
22
- * 是否自动补全小数位数, 仅在 type = number 下生效
40
+ * @en Whether to automatically complete the number of decimal places, only works when type = number
41
+ * @cn 是否自动补全小数位数, 仅在 type = number 下生效
23
42
  */
24
43
  autoFix?: boolean;
25
44
  onBlur?: React.FocusEventHandler;
26
45
  onFocus?: React.FocusEventHandler;
27
46
  /**
28
- * 取消 blur 触发 onChange,用于多层嵌套的格式化,只在最外层触发一次onChange
47
+ * @en Cancel blur trigger onChange, used for multi-layer nesting of formatting, only trigger onChange once at the outermost layer
48
+ * @cn 取消 blur 触发 onChange,用于多层嵌套的格式化,只在最外层触发一次onChange
29
49
  */
30
50
  cancelBlurChange?: boolean;
31
51
  }
@@ -1 +1 @@
1
- {"version":3,"file":"use-input-format.type.d.ts","sourceRoot":"","sources":["use-input-format.type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,oBAAY,UAAU,GAAG,MAAM,GAAG,SAAS,CAAC;AAC5C,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,UAAU,CAAC;IAClB,QAAQ,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,CAAC;IACtC;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,IAAI,CAAC,EAAE,KAAK,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,CAAC,MAAM,CAAC,CAAC;IAC3D,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC;IACtC,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC;IACjC,OAAO,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC;IAClC;;OAEG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B"}
1
+ {"version":3,"file":"use-input-format.type.d.ts","sourceRoot":"","sources":["use-input-format.type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,oBAAY,UAAU,GAAG,MAAM,GAAG,SAAS,CAAC;AAC5C,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,UAAU,CAAC;IAClB,QAAQ,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,CAAC;IACtC;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;;;;OAKG;IACH,IAAI,CAAC,EAAE,KAAK,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,CAAC,MAAM,CAAC,CAAC;IAC3D;;;OAGG;IACH,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC;IACtC;;;;OAIG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB,MAAM,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC;IACjC,OAAO,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC;IAClC;;;OAGG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B"}
@@ -7,7 +7,7 @@ declare const useNumberFormat: (props: InputNumberProps) => {
7
7
  onBlur: (e: React.FocusEvent<Element, Element>) => void;
8
8
  onFocus: (e: React.FocusEvent<Element, Element>) => void;
9
9
  value: string | undefined;
10
- type: "reset" | "submit" | "search" | "color" | "button" | "time" | "image" | "text" | "email" | "url" | "range" | "tel" | (string & {}) | "checkbox" | "radio" | "hidden" | "month" | "week" | "date" | "datetime-local" | "file" | "password" | undefined;
10
+ type: "reset" | "submit" | "search" | "color" | "button" | "time" | "image" | "text" | "email" | "url" | "range" | "tel" | (string & {}) | "month" | "week" | "date" | "hidden" | "checkbox" | "datetime-local" | "file" | "password" | "radio" | undefined;
11
11
  };
12
12
  export default useNumberFormat;
13
13
  //# sourceMappingURL=use-input-number.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"use-input-number.d.ts","sourceRoot":"","sources":["use-input-number.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAI3D,QAAA,MAAM,eAAe,UAAW,gBAAgB;;;;;;;;CA4H/C,CAAC;AAEF,eAAe,eAAe,CAAC"}
1
+ {"version":3,"file":"use-input-number.d.ts","sourceRoot":"","sources":["use-input-number.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAI3D,QAAA,MAAM,eAAe,UAAW,gBAAgB;;;;;;;;CA6H/C,CAAC;AAEF,eAAe,eAAe,CAAC"}
@@ -119,6 +119,7 @@ var useNumberFormat = function useNumberFormat(props) {
119
119
  digits: digits,
120
120
  onChange: onNumberChange,
121
121
  onBlur: onNumberBlur,
122
+ onFocus: props.onFocus,
122
123
  cancelBlurChange: true
123
124
  })), {}, {
124
125
  onPlus: handlePlus,
@@ -3,9 +3,26 @@ export declare type NumberValue = string | number | undefined | null;
3
3
  export interface InputNumberProps extends Omit<InputFormatProps, 'value' | 'onChange' | 'autoFix' | 'trim' | 'coin' | 'type'> {
4
4
  value: NumberValue;
5
5
  onChange: (value: NumberValue) => void | undefined;
6
+ /**
7
+ * @en Minimum value
8
+ * @cn 最小值
9
+ */
6
10
  min?: number;
11
+ /**
12
+ * @en Maximum value
13
+ * @cn 最大值
14
+ */
7
15
  max?: number;
16
+ /**
17
+ * @en Allow value is null
18
+ * @cn 清空后值为 null
19
+ */
8
20
  allowNull?: boolean;
21
+ /**
22
+ * @en Change the digital span. It can be decimal
23
+ * @cn 改变数字跨度,可为小数
24
+ * @default 1
25
+ */
9
26
  step?: number;
10
27
  disabled?: boolean;
11
28
  }
@@ -1 +1 @@
1
- {"version":3,"file":"use-input-number.type.d.ts","sourceRoot":"","sources":["use-input-number.type.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAE3D,oBAAY,WAAW,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,GAAG,IAAI,CAAC;AAC7D,MAAM,WAAW,gBACf,SAAQ,IAAI,CAAC,gBAAgB,EAAE,OAAO,GAAG,UAAU,GAAG,SAAS,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;IAC3F,KAAK,EAAE,WAAW,CAAC;IACnB,QAAQ,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,IAAI,GAAG,SAAS,CAAC;IACnD,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB"}
1
+ {"version":3,"file":"use-input-number.type.d.ts","sourceRoot":"","sources":["use-input-number.type.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAE3D,oBAAY,WAAW,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,GAAG,IAAI,CAAC;AAC7D,MAAM,WAAW,gBACf,SAAQ,IAAI,CAAC,gBAAgB,EAAE,OAAO,GAAG,UAAU,GAAG,SAAS,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;IAC3F,KAAK,EAAE,WAAW,CAAC;IACnB,QAAQ,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,IAAI,GAAG,SAAS,CAAC;IACnD;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB"}
@@ -2,10 +2,31 @@ export declare type PasswordValue = string | undefined;
2
2
  export interface InputPasswordProps {
3
3
  value: PasswordValue;
4
4
  onChange: (value: PasswordValue) => void;
5
+ /**
6
+ * @cn 密码符号
7
+ * @en Password symbol
8
+ * @default '•'
9
+ */
5
10
  point?: string;
11
+ /**
12
+ * @cn 是否显示切换密码可见状态的按钮
13
+ * @en Whether to display the button to toggle the visibility of the password
14
+ */
6
15
  visibilityToggle?: boolean;
16
+ /**
17
+ * @cn 是否显示密码
18
+ * @en Whether to display the password
19
+ */
7
20
  visibility?: boolean;
21
+ /**
22
+ * @cn 初始状态是否显示密码
23
+ * @en Whether to display the password initially
24
+ */
8
25
  defaultVisibility?: boolean;
26
+ /**
27
+ * @cn 切换密码可见状态的按钮的图标
28
+ * @en The icon of the button to toggle the visibility of the password
29
+ */
9
30
  onVisibilityChange?: (visibility: boolean) => void;
10
31
  }
11
32
  //# sourceMappingURL=use-input-password.type.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"use-input-password.type.d.ts","sourceRoot":"","sources":["use-input-password.type.ts"],"names":[],"mappings":"AAAA,oBAAY,aAAa,GAAG,MAAM,GAAG,SAAS,CAAC;AAC/C,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,aAAa,CAAC;IACrB,QAAQ,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;IACzC,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAE3B,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAE5B,kBAAkB,CAAC,EAAE,CAAC,UAAU,EAAE,OAAO,KAAK,IAAI,CAAC;CACpD"}
1
+ {"version":3,"file":"use-input-password.type.d.ts","sourceRoot":"","sources":["use-input-password.type.ts"],"names":[],"mappings":"AAAA,oBAAY,aAAa,GAAG,MAAM,GAAG,SAAS,CAAC;AAC/C,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,aAAa,CAAC;IACrB,QAAQ,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;IACzC;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;OAGG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B;;;OAGG;IACH,kBAAkB,CAAC,EAAE,CAAC,UAAU,EAAE,OAAO,KAAK,IAAI,CAAC;CACpD"}
@@ -1 +1 @@
1
- {"version":3,"file":"use-input.d.ts","sourceRoot":"","sources":["use-input.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,qBAAqB,EACrB,iBAAiB,EAClB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAe,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAa5D,QAAA,MAAM,QAAQ,WAAY,cAAc;;;;;;;CAkIvC,CAAC;AAEF,eAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"use-input.d.ts","sourceRoot":"","sources":["use-input.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,qBAAqB,EACrB,iBAAiB,EAClB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAe,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAa5D,QAAA,MAAM,QAAQ,WAAY,cAAc;;;;;;;CAyIvC,CAAC;AAEF,eAAe,QAAQ,CAAC"}
@@ -18,7 +18,7 @@ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/h
18
18
  var _useForkRef = _interopRequireDefault(require("../../common/use-fork-ref"));
19
19
  var React = _interopRequireWildcard(require("react"));
20
20
  var _utils = require("../../utils");
21
- var _excluded = ["inputRef", "rootRef", "value", "onChange", "onFocus", "onBlur", "clearable", "disabled", "autoSelect", "onClear", "onClick", "showClear"];
21
+ var _excluded = ["inputRef", "rootRef", "value", "onChange", "onFocus", "onBlur", "clearable", "disabled", "autoSelect", "onClear", "onClick", "showClear", "onFocusedChange"];
22
22
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
23
23
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
24
24
  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; }
@@ -47,12 +47,17 @@ var useInput = function useInput(params) {
47
47
  onClear = params.onClear,
48
48
  onClick = params.onClick,
49
49
  showClear = params.showClear,
50
+ onFocusedChange = params.onFocusedChange,
50
51
  propsToForward = (0, _objectWithoutProperties2.default)(params, _excluded);
51
52
  var inputRef = React.useRef(null);
52
53
  var _React$useState = React.useState(false),
53
54
  _React$useState2 = (0, _slicedToArray2.default)(_React$useState, 2),
54
55
  focused = _React$useState2[0],
55
- setFocused = _React$useState2[1];
56
+ changeFocued = _React$useState2[1];
57
+ var setFocused = function setFocused(focus) {
58
+ changeFocued(focus);
59
+ onFocusedChange === null || onFocusedChange === void 0 ? void 0 : onFocusedChange(focus);
60
+ };
56
61
  var handleClick = function handleClick(otherHandlers) {
57
62
  return function (event) {
58
63
  var _otherHandlers$onClic;
@@ -126,6 +131,7 @@ var useInput = function useInput(params) {
126
131
  event.preventDefault();
127
132
  if (!focused) {
128
133
  var _inputRef$current;
134
+ setFocused(true);
129
135
  (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.focus();
130
136
  }
131
137
  if (onClear) {
@@ -147,7 +153,7 @@ var useInput = function useInput(params) {
147
153
  return {
148
154
  focused: focused,
149
155
  disabled: disabled,
150
- showClear: showClearValue,
156
+ showClear: !disabled && showClearValue,
151
157
  getRootProps: getRootProps,
152
158
  getInputProps: getInputProps,
153
159
  getClearProps: getClearProps
@@ -3,22 +3,66 @@ import { AddNoProps } from '../../common/type';
3
3
  export interface InputPropsOwn {
4
4
  /**
5
5
  * The default value. Use when the component is not controlled.
6
+ * @en Value
7
+ * @cn 输入值
6
8
  */
7
9
  value?: string;
10
+ /**
11
+ * @en Value change callback
12
+ * @cn 值改变回调
13
+ */
8
14
  onChange?: (value: string) => void;
15
+ /**
16
+ * @en The callback of blur
17
+ * @cn 失去焦点后的回调
18
+ */
9
19
  onBlur?: React.FocusEventHandler;
20
+ /**
21
+ * @en The callback when Textarea focus
22
+ * @cn 聚焦后的回调
23
+ */
10
24
  onFocus?: React.FocusEventHandler;
25
+ /**
26
+ * @en Click callback
27
+ * @cn 点击回调
28
+ */
11
29
  onClick?: React.MouseEventHandler;
30
+ /**
31
+ * @en Disable component
32
+ * @cn 禁用组件
33
+ * @default false
34
+ */
12
35
  disabled?: boolean;
36
+ /**
37
+ * @en Can click the clear icon to delete the content of the input box
38
+ * @cn 可点击清空图标删除输入框内容
39
+ * @default false
40
+ */
13
41
  clearable?: boolean;
14
42
  /**
15
43
  * focus后自动全选数据
44
+ * @en Automatically select all data after mouse click
45
+ * @cn 是否自动获得焦点
46
+ * @default false
16
47
  */
17
48
  autoSelect?: boolean;
49
+ /**
50
+ * @en Get input dom
51
+ * @cn 获取input dom
52
+ */
18
53
  inputRef?: React.Ref<HTMLInputElement>;
54
+ /**
55
+ * @en Get root node dom
56
+ * @cn 获取root节点 dom
57
+ */
19
58
  rootRef?: React.Ref<HTMLElement>;
59
+ /**
60
+ * @en Click to clear callback
61
+ * @cn 点击清空回调
62
+ */
20
63
  onClear?: () => void;
21
64
  showClear?: boolean;
65
+ onFocusedChange?: (focused?: boolean) => void;
22
66
  }
23
67
  export interface BaseInputProps extends InputPropsOwn, Omit<React.InputHTMLAttributes<HTMLInputElement>, keyof InputPropsOwn | 'size' | 'prefix' | 'onError'> {
24
68
  }
@@ -1 +1 @@
1
- {"version":3,"file":"use-input.type.d.ts","sourceRoot":"","sources":["use-input.type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C,MAAM,WAAW,aAAa;IAC5B;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,MAAM,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC;IACjC,OAAO,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC;IAClC,OAAO,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC;IAClC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;IACvC,OAAO,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;IAEjC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IAErB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,WAAW,cACf,SAAQ,aAA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AAG,SAAS,CACnE,GACC,wBAAwB,CAAC;AAE3B,oBAAY,oBAAoB,GAAG;IACjC,OAAO,EAAE,KAAK,CAAC,iBAAiB,CAAC;IACjC,MAAM,EAAE,KAAK,CAAC,iBAAiB,CAAC;IAChC,QAAQ,EAAE,KAAK,CAAC,kBAAkB,CAAC,gBAAgB,CAAC,CAAC;IACrD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,GAAG,EAAE,KAAK,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;IACjC,KAAK,EAAE,GAAG,CAAC;CACZ,CAAC;AAEF,oBAAY,iBAAiB,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,IAAI,CACpE,MAAM,EACN,MAAM,oBAAoB,CAC3B,GACC,oBAAoB,CAAC;AAEvB,oBAAY,qBAAqB,GAAG;IAClC,WAAW,EAAE,KAAK,CAAC,iBAAiB,CAAC;CACtC,CAAC;AAEF,oBAAY,kBAAkB,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,UAAU,CAC3E,qBAAqB,EACrB,MAAM,CACP,CAAC"}
@@ -1,4 +1,5 @@
1
1
  "use strict";
2
+ "use client";
2
3
 
3
4
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
5
  Object.defineProperty(exports, "__esModule", {
@@ -1,4 +1,5 @@
1
1
  "use strict";
2
+ "use client";
2
3
 
3
4
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
5
  Object.defineProperty(exports, "__esModule", {
@@ -1,4 +1,5 @@
1
1
  "use strict";
2
+ "use client";
2
3
 
3
4
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
5
  Object.defineProperty(exports, "__esModule", {
@@ -1 +1 @@
1
- {"version":3,"file":"popup-context.d.ts","sourceRoot":"","sources":["popup-context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAwB,MAAM,OAAO,CAAC;AAO7C,QAAA,MAAM,OAAO;sBAJO,MAAM,gBAAgB,CAAC,WAAW,GAAG,IAAI,CAAC;wBACxC,MAAM,gBAAgB,CAAC,WAAW,GAAG,IAAI,CAAC;EAGnB,CAAC;AAE9C,eAAe,OAAO,CAAC"}
1
+ {"version":3,"file":"popup-context.d.ts","sourceRoot":"","sources":["popup-context.ts"],"names":[],"mappings":"AACA,OAAO,KAAwB,MAAM,OAAO,CAAC;AAO7C,QAAA,MAAM,OAAO;sBAJO,MAAM,gBAAgB,CAAC,WAAW,GAAG,IAAI,CAAC;wBACxC,MAAM,gBAAgB,CAAC,WAAW,GAAG,IAAI,CAAC;EAGnB,CAAC;AAE9C,eAAe,OAAO,CAAC"}
@@ -1,4 +1,5 @@
1
1
  "use strict";
2
+ "use client";
2
3
 
3
4
  Object.defineProperty(exports, "__esModule", {
4
5
  value: true
@@ -1 +1 @@
1
- {"version":3,"file":"use-popup.d.ts","sourceRoot":"","sources":["use-popup.ts"],"names":[],"mappings":"AAAA,OAAO,KAA2D,MAAM,OAAO,CAAC;AAChF,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAMhE,QAAA,MAAM,QAAQ,UAAW,cAAc;;;;;;0BAwGK;YAAE,MAAM,EAAE,WAAW,GAAG,IAAI,CAAA;SAAE;0BAM9B;YAAE,MAAM,EAAE,WAAW,GAAG,IAAI,CAAA;SAAE;;;;;qBA5B7B;YAAE,MAAM,EAAE,WAAW,GAAG,IAAI,CAAA;SAAE;;;;;;;;;;;;;;;;;;;;;;;;;2BA4ElD,MAAM,gBAAgB,CAAC,WAAW,GAAG,IAAI,CAAC;6BAGxC,MAAM,gBAAgB,CAAC,WAAW,GAAG,IAAI,CAAC;;CAqBpE,CAAC;AAEF,eAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"use-popup.d.ts","sourceRoot":"","sources":["use-popup.ts"],"names":[],"mappings":"AAAA,OAAO,KAA2D,MAAM,OAAO,CAAC;AAChF,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAMhE,QAAA,MAAM,QAAQ,UAAW,cAAc;;;;;;0BA4GK;YAAE,MAAM,EAAE,WAAW,GAAG,IAAI,CAAA;SAAE;0BAM9B;YAAE,MAAM,EAAE,WAAW,GAAG,IAAI,CAAA;SAAE;;;;;qBA5B7B;YAAE,MAAM,EAAE,WAAW,GAAG,IAAI,CAAA;SAAE;;;;;;;;;;;;;;;;;;;;;;;;;2BA6ElD,MAAM,gBAAgB,CAAC,WAAW,GAAG,IAAI,CAAC;6BAGxC,MAAM,gBAAgB,CAAC,WAAW,GAAG,IAAI,CAAC;;CAqBpE,CAAC;AAEF,eAAe,QAAQ,CAAC"}
@@ -39,13 +39,16 @@ var usePopup = function usePopup(props) {
39
39
  removeChild(popupRef);
40
40
  };
41
41
  }, []);
42
+ (0, _react.useEffect)(function () {
43
+ setOpenState(!!props.open);
44
+ }, [props.open]);
42
45
  var _useRef = (0, _react.useRef)({
43
46
  triggerTimer: null,
44
47
  // 记录所有的子popup 点击子 popup 不关闭弹窗
45
48
  chain: [targetRef, popupRef]
46
49
  }),
47
50
  context = _useRef.current;
48
- var open = props.open !== undefined ? props.open : openState;
51
+ var open = openState;
49
52
  var changeOpen = function changeOpen(openIn, delay) {
50
53
  if (context.triggerTimer) clearTimeout(context.triggerTimer);
51
54
  context.triggerTimer = setTimeout(function () {
@@ -164,7 +167,8 @@ var usePopup = function usePopup(props) {
164
167
  return handleBlur();
165
168
  },
166
169
  target: context.chain,
167
- effect: (trigger === 'click' || trigger === 'hover') && open
170
+ effect: (trigger === 'click' || trigger === 'hover') && open,
171
+ event: 'mousedown'
168
172
  });
169
173
  var providerValue = (0, _react.useMemo)(function () {
170
174
  return {
@@ -1,4 +1,5 @@
1
1
  "use strict";
2
+ "use client";
2
3
 
3
4
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
5
  Object.defineProperty(exports, "__esModule", {
@@ -1 +1 @@
1
- {"version":3,"file":"use-select.d.ts","sourceRoot":"","sources":["use-select.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,QAAA,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwCd,CAAC;AAEF,eAAe,SAAS,CAAC"}
1
+ {"version":3,"file":"use-select.d.ts","sourceRoot":"","sources":["use-select.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAGpD,QAAA,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0Cd,CAAC;AAEF,eAAe,SAAS,CAAC"}