@rdeam/qui 2.0.0

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 (434) hide show
  1. package/README.md +59 -0
  2. package/es/_virtual/_@oxc-project_runtime@0.127.0/helpers/defineProperty.mjs +12 -0
  3. package/es/_virtual/_@oxc-project_runtime@0.127.0/helpers/toPrimitive.mjs +14 -0
  4. package/es/_virtual/_@oxc-project_runtime@0.127.0/helpers/toPropertyKey.mjs +9 -0
  5. package/es/_virtual/_@oxc-project_runtime@0.127.0/helpers/typeof.mjs +11 -0
  6. package/es/component.d.ts +3 -0
  7. package/es/component.mjs +39 -0
  8. package/es/component.mjs.map +1 -0
  9. package/es/components/date-picker/index.d.ts +6 -0
  10. package/es/components/date-picker/index.mjs +9 -0
  11. package/es/components/date-picker/index.mjs.map +1 -0
  12. package/es/components/date-picker/src/date-picker.d.ts +19 -0
  13. package/es/components/date-picker/src/date-picker.mjs +28 -0
  14. package/es/components/date-picker/src/date-picker.mjs.map +1 -0
  15. package/es/components/date-picker/src/date-picker.vue.d.ts +33 -0
  16. package/es/components/date-picker/src/date-picker.vue.mjs +7 -0
  17. package/es/components/date-picker/src/date-picker.vue.mjs.map +1 -0
  18. package/es/components/date-picker/src/date-picker.vue_vue_type_script_setup_true_lang.mjs +42 -0
  19. package/es/components/date-picker/src/date-picker.vue_vue_type_script_setup_true_lang.mjs.map +1 -0
  20. package/es/components/date-picker/src/instance.d.ts +2 -0
  21. package/es/components/date-picker/src/instance.mjs +0 -0
  22. package/es/components/date-picker/style/index.d.ts +1 -0
  23. package/es/components/descriptions/index.d.ts +6 -0
  24. package/es/components/descriptions/index.mjs +9 -0
  25. package/es/components/descriptions/index.mjs.map +1 -0
  26. package/es/components/descriptions/src/descriptions.d.ts +42 -0
  27. package/es/components/descriptions/src/descriptions.mjs +86 -0
  28. package/es/components/descriptions/src/descriptions.mjs.map +1 -0
  29. package/es/components/descriptions/src/idescriptions.d.ts +72 -0
  30. package/es/components/descriptions/src/idescriptions.mjs +55 -0
  31. package/es/components/descriptions/src/idescriptions.mjs.map +1 -0
  32. package/es/components/descriptions/src/instance.d.ts +2 -0
  33. package/es/components/descriptions/src/instance.mjs +0 -0
  34. package/es/components/descriptions/style/index.d.ts +1 -0
  35. package/es/components/ellipsis-tag/index.d.ts +6 -0
  36. package/es/components/ellipsis-tag/index.mjs +9 -0
  37. package/es/components/ellipsis-tag/index.mjs.map +1 -0
  38. package/es/components/ellipsis-tag/src/ellipsis-tag.d.ts +20 -0
  39. package/es/components/ellipsis-tag/src/ellipsis-tag.mjs +19 -0
  40. package/es/components/ellipsis-tag/src/ellipsis-tag.mjs.map +1 -0
  41. package/es/components/ellipsis-tag/src/ellipsis-tag.vue.d.ts +51 -0
  42. package/es/components/ellipsis-tag/src/ellipsis-tag.vue.mjs +7 -0
  43. package/es/components/ellipsis-tag/src/ellipsis-tag.vue.mjs.map +1 -0
  44. package/es/components/ellipsis-tag/src/ellipsis-tag.vue_vue_type_script_setup_true_lang.mjs +74 -0
  45. package/es/components/ellipsis-tag/src/ellipsis-tag.vue_vue_type_script_setup_true_lang.mjs.map +1 -0
  46. package/es/components/ellipsis-tag/src/instance.d.ts +2 -0
  47. package/es/components/ellipsis-tag/src/instance.mjs +0 -0
  48. package/es/components/ellipsis-tag/style/index.d.ts +1 -0
  49. package/es/components/empty/index.d.ts +6 -0
  50. package/es/components/empty/index.mjs +9 -0
  51. package/es/components/empty/index.mjs.map +1 -0
  52. package/es/components/empty/src/empty.d.ts +86 -0
  53. package/es/components/empty/src/empty.mjs +158 -0
  54. package/es/components/empty/src/empty.mjs.map +1 -0
  55. package/es/components/empty/src/iempty.d.ts +41 -0
  56. package/es/components/empty/src/iempty.mjs +44 -0
  57. package/es/components/empty/src/iempty.mjs.map +1 -0
  58. package/es/components/empty/src/instance.d.ts +2 -0
  59. package/es/components/empty/src/instance.mjs +0 -0
  60. package/es/components/empty/style/index.d.ts +1 -0
  61. package/es/components/index.d.ts +16 -0
  62. package/es/components/index.mjs +33 -0
  63. package/es/components/jdata-viewer/index.d.ts +6 -0
  64. package/es/components/jdata-viewer/index.mjs +9 -0
  65. package/es/components/jdata-viewer/index.mjs.map +1 -0
  66. package/es/components/jdata-viewer/src/ijdata-viewer.d.ts +40 -0
  67. package/es/components/jdata-viewer/src/ijdata-viewer.mjs +43 -0
  68. package/es/components/jdata-viewer/src/ijdata-viewer.mjs.map +1 -0
  69. package/es/components/jdata-viewer/src/instance.d.ts +2 -0
  70. package/es/components/jdata-viewer/src/instance.mjs +0 -0
  71. package/es/components/jdata-viewer/src/jdata-viewer.d.ts +87 -0
  72. package/es/components/jdata-viewer/src/jdata-viewer.mjs +125 -0
  73. package/es/components/jdata-viewer/src/jdata-viewer.mjs.map +1 -0
  74. package/es/components/jdata-viewer/src/use-view.d.ts +7 -0
  75. package/es/components/jdata-viewer/src/use-view.mjs +98 -0
  76. package/es/components/jdata-viewer/src/use-view.mjs.map +1 -0
  77. package/es/components/jdata-viewer/style/index.d.ts +1 -0
  78. package/es/components/radio/index.d.ts +6 -0
  79. package/es/components/radio/index.mjs +9 -0
  80. package/es/components/radio/index.mjs.map +1 -0
  81. package/es/components/radio/src/instance.d.ts +2 -0
  82. package/es/components/radio/src/instance.mjs +0 -0
  83. package/es/components/radio/src/radio.d.ts +16 -0
  84. package/es/components/radio/src/radio.mjs +37 -0
  85. package/es/components/radio/src/radio.mjs.map +1 -0
  86. package/es/components/radio/src/radio.vue.d.ts +25 -0
  87. package/es/components/radio/src/radio.vue.mjs +7 -0
  88. package/es/components/radio/src/radio.vue.mjs.map +1 -0
  89. package/es/components/radio/src/radio.vue_vue_type_script_setup_true_lang.mjs +44 -0
  90. package/es/components/radio/src/radio.vue_vue_type_script_setup_true_lang.mjs.map +1 -0
  91. package/es/components/radio/style/index.d.ts +1 -0
  92. package/es/components/remote-search/index.d.ts +6 -0
  93. package/es/components/remote-search/index.mjs +9 -0
  94. package/es/components/remote-search/index.mjs.map +1 -0
  95. package/es/components/remote-search/src/instance.d.ts +2 -0
  96. package/es/components/remote-search/src/instance.mjs +0 -0
  97. package/es/components/remote-search/src/iremote-search.d.ts +26 -0
  98. package/es/components/remote-search/src/iremote-search.mjs +94 -0
  99. package/es/components/remote-search/src/iremote-search.mjs.map +1 -0
  100. package/es/components/remote-search/src/remote-search.d.ts +72 -0
  101. package/es/components/remote-search/src/remote-search.mjs +191 -0
  102. package/es/components/remote-search/src/remote-search.mjs.map +1 -0
  103. package/es/components/remote-search/style/index.d.ts +1 -0
  104. package/es/components/search-form/index.d.ts +6 -0
  105. package/es/components/search-form/index.mjs +9 -0
  106. package/es/components/search-form/index.mjs.map +1 -0
  107. package/es/components/search-form/src/components/Grid/components/GridItem.vue.d.ts +33 -0
  108. package/es/components/search-form/src/components/Grid/components/GridItem.vue.mjs +7 -0
  109. package/es/components/search-form/src/components/Grid/components/GridItem.vue.mjs.map +1 -0
  110. package/es/components/search-form/src/components/Grid/components/GridItem.vue_vue_type_script_setup_true_lang.mjs +54 -0
  111. package/es/components/search-form/src/components/Grid/components/GridItem.vue_vue_type_script_setup_true_lang.mjs.map +1 -0
  112. package/es/components/search-form/src/components/Grid/index.vue.d.ts +28 -0
  113. package/es/components/search-form/src/components/Grid/index.vue.mjs +7 -0
  114. package/es/components/search-form/src/components/Grid/index.vue.mjs.map +1 -0
  115. package/es/components/search-form/src/components/Grid/index.vue_vue_type_script_setup_true_lang.mjs +62 -0
  116. package/es/components/search-form/src/components/Grid/index.vue_vue_type_script_setup_true_lang.mjs.map +1 -0
  117. package/es/components/search-form/src/components/Grid/interface/index.d.ts +5 -0
  118. package/es/components/search-form/src/components/Grid/interface/index.mjs +0 -0
  119. package/es/components/search-form/src/components/SearchFormItem.vue.d.ts +36 -0
  120. package/es/components/search-form/src/components/SearchFormItem.vue.mjs +7 -0
  121. package/es/components/search-form/src/components/SearchFormItem.vue.mjs.map +1 -0
  122. package/es/components/search-form/src/components/SearchFormItem.vue_vue_type_script_lang.mjs +103 -0
  123. package/es/components/search-form/src/components/SearchFormItem.vue_vue_type_script_lang.mjs.map +1 -0
  124. package/es/components/search-form/src/instance.d.ts +2 -0
  125. package/es/components/search-form/src/instance.mjs +0 -0
  126. package/es/components/search-form/src/isearch-form.d.ts +76 -0
  127. package/es/components/search-form/src/isearch-form.mjs +63 -0
  128. package/es/components/search-form/src/isearch-form.mjs.map +1 -0
  129. package/es/components/search-form/src/search-form.d.ts +55 -0
  130. package/es/components/search-form/src/search-form.mjs +319 -0
  131. package/es/components/search-form/src/search-form.mjs.map +1 -0
  132. package/es/components/search-form/style/index.d.ts +1 -0
  133. package/es/components/sticky-container/index.d.ts +6 -0
  134. package/es/components/sticky-container/index.mjs +9 -0
  135. package/es/components/sticky-container/index.mjs.map +1 -0
  136. package/es/components/sticky-container/src/instance.d.ts +2 -0
  137. package/es/components/sticky-container/src/instance.mjs +0 -0
  138. package/es/components/sticky-container/src/isticky-container.d.ts +4 -0
  139. package/es/components/sticky-container/src/isticky-container.mjs +8 -0
  140. package/es/components/sticky-container/src/isticky-container.mjs.map +1 -0
  141. package/es/components/sticky-container/src/sticky-container.d.ts +2 -0
  142. package/es/components/sticky-container/src/sticky-container.mjs +32 -0
  143. package/es/components/sticky-container/src/sticky-container.mjs.map +1 -0
  144. package/es/components/sticky-container/style/index.d.ts +1 -0
  145. package/es/components/table/index.d.ts +6 -0
  146. package/es/components/table/index.mjs +9 -0
  147. package/es/components/table/index.mjs.map +1 -0
  148. package/es/components/table/src/components/Setting.vue.d.ts +30 -0
  149. package/es/components/table/src/components/Setting.vue.mjs +7 -0
  150. package/es/components/table/src/components/Setting.vue.mjs.map +1 -0
  151. package/es/components/table/src/components/Setting.vue_vue_type_script_setup_true_lang.mjs +67 -0
  152. package/es/components/table/src/components/Setting.vue_vue_type_script_setup_true_lang.mjs.map +1 -0
  153. package/es/components/table/src/components/TableColumn.vue.d.ts +15 -0
  154. package/es/components/table/src/components/TableColumn.vue.mjs +7 -0
  155. package/es/components/table/src/components/TableColumn.vue.mjs.map +1 -0
  156. package/es/components/table/src/components/TableColumn.vue_vue_type_script_setup_true_lang.mjs +132 -0
  157. package/es/components/table/src/components/TableColumn.vue_vue_type_script_setup_true_lang.mjs.map +1 -0
  158. package/es/components/table/src/instance.d.ts +2 -0
  159. package/es/components/table/src/instance.mjs +0 -0
  160. package/es/components/table/src/table.d.ts +84 -0
  161. package/es/components/table/src/table.mjs +139 -0
  162. package/es/components/table/src/table.mjs.map +1 -0
  163. package/es/components/table/src/table.vue.d.ts +384 -0
  164. package/es/components/table/src/table.vue.mjs +7 -0
  165. package/es/components/table/src/table.vue.mjs.map +1 -0
  166. package/es/components/table/src/table.vue_vue_type_script_setup_true_lang.mjs +143 -0
  167. package/es/components/table/src/table.vue_vue_type_script_setup_true_lang.mjs.map +1 -0
  168. package/es/components/table/src/use-controller.d.ts +10 -0
  169. package/es/components/table/src/use-controller.mjs +117 -0
  170. package/es/components/table/src/use-controller.mjs.map +1 -0
  171. package/es/components/table/src/use-table.d.ts +26 -0
  172. package/es/components/table/src/use-table.mjs +188 -0
  173. package/es/components/table/src/use-table.mjs.map +1 -0
  174. package/es/components/table/style/index.d.ts +1 -0
  175. package/es/components/table-editor/index.d.ts +6 -0
  176. package/es/components/table-editor/index.mjs +9 -0
  177. package/es/components/table-editor/index.mjs.map +1 -0
  178. package/es/components/table-editor/src/components/BaseItem.vue.d.ts +15 -0
  179. package/es/components/table-editor/src/components/BaseItem.vue.mjs +7 -0
  180. package/es/components/table-editor/src/components/BaseItem.vue.mjs.map +1 -0
  181. package/es/components/table-editor/src/components/BaseItem.vue_vue_type_script_lang.mjs +37 -0
  182. package/es/components/table-editor/src/components/BaseItem.vue_vue_type_script_lang.mjs.map +1 -0
  183. package/es/components/table-editor/src/instance.d.ts +2 -0
  184. package/es/components/table-editor/src/instance.mjs +0 -0
  185. package/es/components/table-editor/src/table-editor.d.ts +45 -0
  186. package/es/components/table-editor/src/table-editor.mjs +24 -0
  187. package/es/components/table-editor/src/table-editor.mjs.map +1 -0
  188. package/es/components/table-editor/src/table-editor.vue.d.ts +82 -0
  189. package/es/components/table-editor/src/table-editor.vue.mjs +7 -0
  190. package/es/components/table-editor/src/table-editor.vue.mjs.map +1 -0
  191. package/es/components/table-editor/src/table-editor.vue_vue_type_script_setup_true_lang.mjs +75 -0
  192. package/es/components/table-editor/src/table-editor.vue_vue_type_script_setup_true_lang.mjs.map +1 -0
  193. package/es/components/table-editor/style/index.d.ts +1 -0
  194. package/es/components/tabs/index.d.ts +6 -0
  195. package/es/components/tabs/index.mjs +9 -0
  196. package/es/components/tabs/index.mjs.map +1 -0
  197. package/es/components/tabs/src/instance.d.ts +2 -0
  198. package/es/components/tabs/src/instance.mjs +0 -0
  199. package/es/components/tabs/src/itabs.d.ts +31 -0
  200. package/es/components/tabs/src/itabs.mjs +33 -0
  201. package/es/components/tabs/src/itabs.mjs.map +1 -0
  202. package/es/components/tabs/src/tabs.d.ts +55 -0
  203. package/es/components/tabs/src/tabs.mjs +58 -0
  204. package/es/components/tabs/src/tabs.mjs.map +1 -0
  205. package/es/components/tabs/style/index.d.ts +1 -0
  206. package/es/components/tarea-tag/index.d.ts +6 -0
  207. package/es/components/tarea-tag/index.mjs +9 -0
  208. package/es/components/tarea-tag/index.mjs.map +1 -0
  209. package/es/components/tarea-tag/src/instance.d.ts +2 -0
  210. package/es/components/tarea-tag/src/instance.mjs +0 -0
  211. package/es/components/tarea-tag/src/tarea-tag.d.ts +10 -0
  212. package/es/components/tarea-tag/src/tarea-tag.mjs +29 -0
  213. package/es/components/tarea-tag/src/tarea-tag.mjs.map +1 -0
  214. package/es/components/tarea-tag/src/tarea-tag.vue.d.ts +23 -0
  215. package/es/components/tarea-tag/src/tarea-tag.vue.mjs +7 -0
  216. package/es/components/tarea-tag/src/tarea-tag.vue.mjs.map +1 -0
  217. package/es/components/tarea-tag/src/tarea-tag.vue_vue_type_script_setup_true_lang.mjs +149 -0
  218. package/es/components/tarea-tag/src/tarea-tag.vue_vue_type_script_setup_true_lang.mjs.map +1 -0
  219. package/es/components/tarea-tag/style/index.d.ts +1 -0
  220. package/es/components/text-ellipsis/index.d.ts +5 -0
  221. package/es/components/text-ellipsis/index.mjs +9 -0
  222. package/es/components/text-ellipsis/index.mjs.map +1 -0
  223. package/es/components/text-ellipsis/src/instance.d.ts +2 -0
  224. package/es/components/text-ellipsis/src/instance.mjs +0 -0
  225. package/es/components/text-ellipsis/src/itext-ellipsis.d.ts +11 -0
  226. package/es/components/text-ellipsis/src/itext-ellipsis.mjs +16 -0
  227. package/es/components/text-ellipsis/src/itext-ellipsis.mjs.map +1 -0
  228. package/es/components/text-ellipsis/src/text-ellipsis.d.ts +25 -0
  229. package/es/components/text-ellipsis/src/text-ellipsis.mjs +115 -0
  230. package/es/components/text-ellipsis/src/text-ellipsis.mjs.map +1 -0
  231. package/es/components/text-ellipsis/src/use-window-size.d.ts +5 -0
  232. package/es/components/text-ellipsis/src/use-window-size.mjs +28 -0
  233. package/es/components/text-ellipsis/src/use-window-size.mjs.map +1 -0
  234. package/es/components/text-ellipsis/src/utils.d.ts +22 -0
  235. package/es/components/text-ellipsis/src/utils.mjs +26 -0
  236. package/es/components/text-ellipsis/src/utils.mjs.map +1 -0
  237. package/es/components/text-ellipsis/style/index.d.ts +1 -0
  238. package/es/components/time-line/index.d.ts +6 -0
  239. package/es/components/time-line/index.mjs +9 -0
  240. package/es/components/time-line/index.mjs.map +1 -0
  241. package/es/components/time-line/src/instance.d.ts +2 -0
  242. package/es/components/time-line/src/instance.mjs +0 -0
  243. package/es/components/time-line/src/time-line.d.ts +28 -0
  244. package/es/components/time-line/src/time-line.mjs +25 -0
  245. package/es/components/time-line/src/time-line.mjs.map +1 -0
  246. package/es/components/time-line/src/time-line.vue.d.ts +81 -0
  247. package/es/components/time-line/src/time-line.vue.mjs +7 -0
  248. package/es/components/time-line/src/time-line.vue.mjs.map +1 -0
  249. package/es/components/time-line/src/time-line.vue_vue_type_script_setup_true_lang.mjs +37 -0
  250. package/es/components/time-line/src/time-line.vue_vue_type_script_setup_true_lang.mjs.map +1 -0
  251. package/es/components/time-line/style/index.d.ts +1 -0
  252. package/es/components/uploader/index.d.ts +6 -0
  253. package/es/components/uploader/index.mjs +9 -0
  254. package/es/components/uploader/index.mjs.map +1 -0
  255. package/es/components/uploader/src/UploadInfo.vue.d.ts +30 -0
  256. package/es/components/uploader/src/UploadInfo.vue.mjs +7 -0
  257. package/es/components/uploader/src/UploadInfo.vue.mjs.map +1 -0
  258. package/es/components/uploader/src/UploadInfo.vue_vue_type_script_setup_true_lang.mjs +167 -0
  259. package/es/components/uploader/src/UploadInfo.vue_vue_type_script_setup_true_lang.mjs.map +1 -0
  260. package/es/components/uploader/src/instance.d.ts +2 -0
  261. package/es/components/uploader/src/instance.mjs +0 -0
  262. package/es/components/uploader/src/toast.d.ts +1 -0
  263. package/es/components/uploader/src/toast.mjs +37 -0
  264. package/es/components/uploader/src/toast.mjs.map +1 -0
  265. package/es/components/uploader/src/uploader.d.ts +32 -0
  266. package/es/components/uploader/src/uploader.mjs +104 -0
  267. package/es/components/uploader/src/uploader.mjs.map +1 -0
  268. package/es/components/uploader/src/uploader.vue.d.ts +98 -0
  269. package/es/components/uploader/src/uploader.vue.mjs +7 -0
  270. package/es/components/uploader/src/uploader.vue.mjs.map +1 -0
  271. package/es/components/uploader/src/uploader.vue_vue_type_script_setup_true_lang.mjs +48 -0
  272. package/es/components/uploader/src/uploader.vue_vue_type_script_setup_true_lang.mjs.map +1 -0
  273. package/es/components/uploader/src/use-uploader.d.ts +20 -0
  274. package/es/components/uploader/src/use-uploader.mjs +263 -0
  275. package/es/components/uploader/src/use-uploader.mjs.map +1 -0
  276. package/es/components/uploader/style/index.d.ts +1 -0
  277. package/es/defaults.d.ts +5 -0
  278. package/es/defaults.mjs +8 -0
  279. package/es/defaults.mjs.map +1 -0
  280. package/es/directives/copy/index.d.ts +3 -0
  281. package/es/directives/copy/index.mjs +31 -0
  282. package/es/directives/copy/index.mjs.map +1 -0
  283. package/es/directives/draggable/index.d.ts +3 -0
  284. package/es/directives/draggable/index.mjs +28 -0
  285. package/es/directives/draggable/index.mjs.map +1 -0
  286. package/es/directives/index.d.ts +4 -0
  287. package/es/directives/index.mjs +5 -0
  288. package/es/directives/longpress/index.d.ts +7 -0
  289. package/es/directives/longpress/index.mjs +32 -0
  290. package/es/directives/longpress/index.mjs.map +1 -0
  291. package/es/directives/resize-element/index.d.ts +3 -0
  292. package/es/directives/resize-element/index.mjs +30 -0
  293. package/es/directives/resize-element/index.mjs.map +1 -0
  294. package/es/directives/show-tip/index.d.ts +3 -0
  295. package/es/directives/show-tip/index.mjs +19 -0
  296. package/es/directives/show-tip/index.mjs.map +1 -0
  297. package/es/hooks/_configurable.d.ts +27 -0
  298. package/es/hooks/_configurable.mjs +10 -0
  299. package/es/hooks/_configurable.mjs.map +1 -0
  300. package/es/hooks/index.d.ts +1 -0
  301. package/es/hooks/index.mjs +2 -0
  302. package/es/hooks/toRef/index.d.ts +14 -0
  303. package/es/hooks/toRef/index.mjs +19 -0
  304. package/es/hooks/toRef/index.mjs.map +1 -0
  305. package/es/hooks/tryOnScopeDispose/index.d.ts +7 -0
  306. package/es/hooks/tryOnScopeDispose/index.mjs +18 -0
  307. package/es/hooks/tryOnScopeDispose/index.mjs.map +1 -0
  308. package/es/hooks/unrefElement/index.d.ts +12 -0
  309. package/es/hooks/unrefElement/index.mjs +16 -0
  310. package/es/hooks/unrefElement/index.mjs.map +1 -0
  311. package/es/hooks/use-full-screen/index.d.ts +1 -0
  312. package/es/hooks/use-full-screen/index.mjs +32 -0
  313. package/es/hooks/use-full-screen/index.mjs.map +1 -0
  314. package/es/hooks/useEventListener/index.d.ts +83 -0
  315. package/es/hooks/useEventListener/index.mjs +47 -0
  316. package/es/hooks/useEventListener/index.mjs.map +1 -0
  317. package/es/hooks/useFullscreen/index.d.ts +25 -0
  318. package/es/hooks/useFullscreen/index.mjs +121 -0
  319. package/es/hooks/useFullscreen/index.mjs.map +1 -0
  320. package/es/hooks/useMounted/index.d.ts +6 -0
  321. package/es/hooks/useMounted/index.mjs +19 -0
  322. package/es/hooks/useMounted/index.mjs.map +1 -0
  323. package/es/hooks/useSupported/index.d.ts +2 -0
  324. package/es/hooks/useSupported/index.mjs +14 -0
  325. package/es/hooks/useSupported/index.mjs.map +1 -0
  326. package/es/hooks/utils/filters.d.ts +84 -0
  327. package/es/hooks/utils/filters.mjs +141 -0
  328. package/es/hooks/utils/filters.mjs.map +1 -0
  329. package/es/hooks/utils/general.d.ts +49 -0
  330. package/es/hooks/utils/general.mjs +85 -0
  331. package/es/hooks/utils/general.mjs.map +1 -0
  332. package/es/hooks/utils/index.d.ts +6 -0
  333. package/es/hooks/utils/index.mjs +6 -0
  334. package/es/hooks/utils/is.d.ts +13 -0
  335. package/es/hooks/utils/is.mjs +29 -0
  336. package/es/hooks/utils/is.mjs.map +1 -0
  337. package/es/hooks/utils/port.d.ts +2 -0
  338. package/es/hooks/utils/port.mjs +17 -0
  339. package/es/hooks/utils/port.mjs.map +1 -0
  340. package/es/hooks/utils/types.d.ts +117 -0
  341. package/es/hooks/utils/types.mjs +0 -0
  342. package/es/hooks/utils/vue.d.ts +1 -0
  343. package/es/hooks/utils/vue.mjs +9 -0
  344. package/es/hooks/utils/vue.mjs.map +1 -0
  345. package/es/hooks/watchImmediate/index.d.ts +5 -0
  346. package/es/hooks/watchImmediate/index.mjs +17 -0
  347. package/es/hooks/watchImmediate/index.mjs.map +1 -0
  348. package/es/index.d.ts +8 -0
  349. package/es/index.mjs +47 -0
  350. package/es/index.mjs.map +1 -0
  351. package/es/make-installer.d.ts +5 -0
  352. package/es/make-installer.mjs +15 -0
  353. package/es/make-installer.mjs.map +1 -0
  354. package/es/share/dist/index.d.ts +60 -0
  355. package/es/share/dist/index.mjs +16 -0
  356. package/es/share/dist/index.mjs.map +1 -0
  357. package/es/utils/browser.d.ts +3 -0
  358. package/es/utils/browser.mjs +9 -0
  359. package/es/utils/browser.mjs.map +1 -0
  360. package/es/utils/console-log/index.d.ts +3 -0
  361. package/es/utils/console-log/index.mjs +23 -0
  362. package/es/utils/console-log/index.mjs.map +1 -0
  363. package/es/utils/create/index.d.ts +21 -0
  364. package/es/utils/create/index.mjs +43 -0
  365. package/es/utils/create/index.mjs.map +1 -0
  366. package/es/utils/dom/index.d.ts +2 -0
  367. package/es/utils/dom/index.mjs +3 -0
  368. package/es/utils/dom/scroll.d.ts +11 -0
  369. package/es/utils/dom/scroll.mjs +107 -0
  370. package/es/utils/dom/scroll.mjs.map +1 -0
  371. package/es/utils/dom/style.d.ts +5 -0
  372. package/es/utils/dom/style.mjs +35 -0
  373. package/es/utils/dom/style.mjs.map +1 -0
  374. package/es/utils/easings.d.ts +1 -0
  375. package/es/utils/easings.mjs +11 -0
  376. package/es/utils/easings.mjs.map +1 -0
  377. package/es/utils/index.d.ts +11 -0
  378. package/es/utils/index.mjs +14 -0
  379. package/es/utils/objects.d.ts +8 -0
  380. package/es/utils/objects.mjs +19 -0
  381. package/es/utils/objects.mjs.map +1 -0
  382. package/es/utils/raf.d.ts +2 -0
  383. package/es/utils/raf.mjs +8 -0
  384. package/es/utils/raf.mjs.map +1 -0
  385. package/es/utils/request/index.d.ts +25 -0
  386. package/es/utils/request/index.mjs +49 -0
  387. package/es/utils/request/index.mjs.map +1 -0
  388. package/es/utils/types.d.ts +10 -0
  389. package/es/utils/types.mjs +22 -0
  390. package/es/utils/types.mjs.map +1 -0
  391. package/es/utils/typescript.d.ts +12 -0
  392. package/es/utils/typescript.mjs +6 -0
  393. package/es/utils/typescript.mjs.map +1 -0
  394. package/es/utils/vue/index.d.ts +3 -0
  395. package/es/utils/vue/index.mjs +3 -0
  396. package/es/utils/vue/install.d.ts +50 -0
  397. package/es/utils/vue/install.mjs +74 -0
  398. package/es/utils/vue/install.mjs.map +1 -0
  399. package/es/utils/vue/props/index.d.ts +3 -0
  400. package/es/utils/vue/props/index.mjs +2 -0
  401. package/es/utils/vue/props/runtime.d.ts +29 -0
  402. package/es/utils/vue/props/runtime.mjs +59 -0
  403. package/es/utils/vue/props/runtime.mjs.map +1 -0
  404. package/es/utils/vue/props/types.d.ts +120 -0
  405. package/es/utils/vue/props/types.mjs +0 -0
  406. package/es/utils/vue/props/util.d.ts +8 -0
  407. package/es/utils/vue/props/util.mjs +0 -0
  408. package/es/utils/vue/typescript.d.ts +6 -0
  409. package/es/utils/vue/typescript.mjs +0 -0
  410. package/es/version.d.ts +1 -0
  411. package/es/version.mjs +6 -0
  412. package/es/version.mjs.map +1 -0
  413. package/global.d.ts +1 -0
  414. package/package.json +80 -0
  415. package/resolvers/index.d.mts +19 -0
  416. package/resolvers/index.d.ts +19 -0
  417. package/resolvers/index.mjs +32 -0
  418. package/theme-chalk/hd-date-picker.css +1 -0
  419. package/theme-chalk/hd-descriptions.css +1 -0
  420. package/theme-chalk/hd-ellipsis-tag.css +1 -0
  421. package/theme-chalk/hd-empty.css +2 -0
  422. package/theme-chalk/hd-jdata-viewer.css +1 -0
  423. package/theme-chalk/hd-radio.css +1 -0
  424. package/theme-chalk/hd-remote-search.css +1 -0
  425. package/theme-chalk/hd-search-form.css +1 -0
  426. package/theme-chalk/hd-sticky-container.css +1 -0
  427. package/theme-chalk/hd-table-editor.css +1 -0
  428. package/theme-chalk/hd-table.css +1 -0
  429. package/theme-chalk/hd-tabs.css +1 -0
  430. package/theme-chalk/hd-tarea-tag.css +1 -0
  431. package/theme-chalk/hd-text-ellipsis.css +1 -0
  432. package/theme-chalk/hd-time-line.css +1 -0
  433. package/theme-chalk/hd-uploader.css +1 -0
  434. package/theme-chalk/index.css +1 -0
@@ -0,0 +1,141 @@
1
+ import { noop } from "./is.mjs";
2
+ import { toRef as toRef$1 } from "../toRef/index.mjs";
3
+ import { isRef, readonly, toValue } from "vue";
4
+ //#region packages/hooks/utils/filters.ts
5
+ /**
6
+ * @internal
7
+ */
8
+ function createFilterWrapper(filter, fn) {
9
+ function wrapper(...args) {
10
+ return new Promise((resolve, reject) => {
11
+ Promise.resolve(filter(() => fn.apply(this, args), {
12
+ fn,
13
+ thisArg: this,
14
+ args
15
+ })).then(resolve).catch(reject);
16
+ });
17
+ }
18
+ return wrapper;
19
+ }
20
+ var bypassFilter = (invoke) => {
21
+ return invoke();
22
+ };
23
+ /**
24
+ * Create an EventFilter that debounce the events
25
+ */
26
+ function debounceFilter(ms, options = {}) {
27
+ let timer;
28
+ let maxTimer;
29
+ let lastRejector = noop;
30
+ const _clearTimeout = (timer) => {
31
+ clearTimeout(timer);
32
+ lastRejector();
33
+ lastRejector = noop;
34
+ };
35
+ let lastInvoker;
36
+ const filter = (invoke) => {
37
+ const duration = toValue(ms);
38
+ const maxDuration = toValue(options.maxWait);
39
+ if (timer) _clearTimeout(timer);
40
+ if (duration <= 0 || maxDuration !== void 0 && maxDuration <= 0) {
41
+ if (maxTimer) {
42
+ _clearTimeout(maxTimer);
43
+ maxTimer = null;
44
+ }
45
+ return Promise.resolve(invoke());
46
+ }
47
+ return new Promise((resolve, reject) => {
48
+ lastRejector = options.rejectOnCancel ? reject : resolve;
49
+ lastInvoker = invoke;
50
+ if (maxDuration && !maxTimer) maxTimer = setTimeout(() => {
51
+ if (timer) _clearTimeout(timer);
52
+ maxTimer = null;
53
+ resolve(lastInvoker());
54
+ }, maxDuration);
55
+ timer = setTimeout(() => {
56
+ if (maxTimer) _clearTimeout(maxTimer);
57
+ maxTimer = null;
58
+ resolve(invoke());
59
+ }, duration);
60
+ });
61
+ };
62
+ return filter;
63
+ }
64
+ function throttleFilter(...args) {
65
+ let lastExec = 0;
66
+ let timer;
67
+ let isLeading = true;
68
+ let lastRejector = noop;
69
+ let lastValue;
70
+ let ms;
71
+ let trailing;
72
+ let leading;
73
+ let rejectOnCancel;
74
+ if (!isRef(args[0]) && typeof args[0] === "object") ({delay: ms, trailing = true, leading = true, rejectOnCancel = false} = args[0]);
75
+ else [ms, trailing = true, leading = true, rejectOnCancel = false] = args;
76
+ const clear = () => {
77
+ if (timer) {
78
+ clearTimeout(timer);
79
+ timer = void 0;
80
+ lastRejector();
81
+ lastRejector = noop;
82
+ }
83
+ };
84
+ const filter = (_invoke) => {
85
+ const duration = toValue(ms);
86
+ const elapsed = Date.now() - lastExec;
87
+ const invoke = () => {
88
+ return lastValue = _invoke();
89
+ };
90
+ clear();
91
+ if (duration <= 0) {
92
+ lastExec = Date.now();
93
+ return invoke();
94
+ }
95
+ if (elapsed > duration && (leading || !isLeading)) {
96
+ lastExec = Date.now();
97
+ invoke();
98
+ } else if (trailing) lastValue = new Promise((resolve, reject) => {
99
+ lastRejector = rejectOnCancel ? reject : resolve;
100
+ timer = setTimeout(() => {
101
+ lastExec = Date.now();
102
+ isLeading = true;
103
+ resolve(invoke());
104
+ clear();
105
+ }, Math.max(0, duration - elapsed));
106
+ });
107
+ if (!leading && !timer) timer = setTimeout(() => isLeading = true, duration);
108
+ isLeading = false;
109
+ return lastValue;
110
+ };
111
+ return filter;
112
+ }
113
+ /**
114
+ * EventFilter that gives extra controls to pause and resume the filter
115
+ *
116
+ * @param extendFilter Extra filter to apply when the PausableFilter is active, default to none
117
+ * @param options Options to configure the filter
118
+ */
119
+ function pausableFilter(extendFilter = bypassFilter, options = {}) {
120
+ const { initialState = "active" } = options;
121
+ const isActive = toRef$1(initialState === "active");
122
+ function pause() {
123
+ isActive.value = false;
124
+ }
125
+ function resume() {
126
+ isActive.value = true;
127
+ }
128
+ const eventFilter = (...args) => {
129
+ if (isActive.value) extendFilter(...args);
130
+ };
131
+ return {
132
+ isActive: readonly(isActive),
133
+ pause,
134
+ resume,
135
+ eventFilter
136
+ };
137
+ }
138
+ //#endregion
139
+ export { bypassFilter, createFilterWrapper, debounceFilter, pausableFilter, throttleFilter };
140
+
141
+ //# sourceMappingURL=filters.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"filters.mjs","names":[],"sources":["../../../../../packages/hooks/utils/filters.ts"],"sourcesContent":["import type { MaybeRefOrGetter } from 'vue'\nimport type { AnyFn, ArgumentsType, Awaited, Pausable, Promisify } from './types'\nimport { isRef, readonly, toValue } from 'vue'\nimport { toRef } from '../toRef'\nimport { noop } from './is'\n\nexport type FunctionArgs<Args extends any[] = any[], Return = void> = (...args: Args) => Return\n\nexport interface FunctionWrapperOptions<Args extends any[] = any[], This = any> {\n fn: FunctionArgs<Args, This>\n args: Args\n thisArg: This\n}\n\nexport type EventFilter<Args extends any[] = any[], This = any, Invoke extends AnyFn = AnyFn> = (\n invoke: Invoke,\n options: FunctionWrapperOptions<Args, This>,\n) => ReturnType<Invoke> | Promisify<ReturnType<Invoke>>\n\nexport interface ConfigurableEventFilter {\n /**\n * Filter for if events should to be received.\n *\n * @see https://vueuse.org/guide/config.html#event-filters\n */\n eventFilter?: EventFilter\n}\n\nexport interface DebounceFilterOptions {\n /**\n * The maximum time allowed to be delayed before it's invoked.\n * In milliseconds.\n */\n maxWait?: MaybeRefOrGetter<number>\n\n /**\n * Whether to reject the last call if it's been cancel.\n *\n * @default false\n */\n rejectOnCancel?: boolean\n}\n\n/**\n * @internal\n */\nexport function createFilterWrapper<T extends AnyFn>(filter: EventFilter, fn: T) {\n function wrapper(this: any, ...args: ArgumentsType<T>) {\n return new Promise<Awaited<ReturnType<T>>>((resolve, reject) => {\n // make sure it's a promise\n Promise.resolve(filter(() => fn.apply(this, args), { fn, thisArg: this, args }))\n .then(resolve)\n .catch(reject)\n })\n }\n\n return wrapper\n}\n\nexport const bypassFilter: EventFilter = (invoke) => {\n return invoke()\n}\n\n/**\n * Create an EventFilter that debounce the events\n */\nexport function debounceFilter(ms: MaybeRefOrGetter<number>, options: DebounceFilterOptions = {}) {\n let timer: ReturnType<typeof setTimeout> | undefined\n let maxTimer: ReturnType<typeof setTimeout> | undefined | null\n let lastRejector: AnyFn = noop\n\n const _clearTimeout = (timer: ReturnType<typeof setTimeout>) => {\n clearTimeout(timer)\n lastRejector()\n lastRejector = noop\n }\n\n let lastInvoker: () => void\n\n const filter: EventFilter = (invoke) => {\n const duration = toValue(ms)\n const maxDuration = toValue(options.maxWait)\n\n if (timer) _clearTimeout(timer)\n\n if (duration <= 0 || (maxDuration !== undefined && maxDuration <= 0)) {\n if (maxTimer) {\n _clearTimeout(maxTimer)\n maxTimer = null\n }\n return Promise.resolve(invoke())\n }\n\n return new Promise((resolve, reject) => {\n lastRejector = options.rejectOnCancel ? reject : resolve\n lastInvoker = invoke\n // Create the maxTimer. Clears the regular timer on invoke\n if (maxDuration && !maxTimer) {\n maxTimer = setTimeout(() => {\n if (timer) _clearTimeout(timer)\n maxTimer = null\n resolve(lastInvoker())\n }, maxDuration)\n }\n\n // Create the regular timer. Clears the max timer on invoke\n timer = setTimeout(() => {\n if (maxTimer) _clearTimeout(maxTimer)\n maxTimer = null\n resolve(invoke())\n }, duration)\n })\n }\n\n return filter\n}\n\nexport interface ThrottleFilterOptions {\n /**\n * The maximum time allowed to be delayed before it's invoked.\n */\n delay: MaybeRefOrGetter<number>\n /**\n * Whether to invoke on the trailing edge of the timeout.\n */\n trailing?: boolean\n /**\n * Whether to invoke on the leading edge of the timeout.\n */\n leading?: boolean\n /**\n * Whether to reject the last call if it's been cancel.\n */\n rejectOnCancel?: boolean\n}\n\n// TODO v11: refactor the params to object\n/**\n * Create an EventFilter that throttle the events\n *\n * @param ms\n * @param [trailing]\n * @param [leading]\n * @param [rejectOnCancel]\n */\nexport function throttleFilter(\n ms: MaybeRefOrGetter<number>,\n trailing?: boolean,\n leading?: boolean,\n rejectOnCancel?: boolean,\n): EventFilter\nexport function throttleFilter(options: ThrottleFilterOptions): EventFilter\nexport function throttleFilter(...args: any[]) {\n let lastExec = 0\n let timer: ReturnType<typeof setTimeout> | undefined\n let isLeading = true\n let lastRejector: AnyFn = noop\n let lastValue: any\n let ms: MaybeRefOrGetter<number>\n let trailing: boolean\n let leading: boolean\n let rejectOnCancel: boolean\n if (!isRef(args[0]) && typeof args[0] === 'object')\n ({ delay: ms, trailing = true, leading = true, rejectOnCancel = false } = args[0])\n else [ms, trailing = true, leading = true, rejectOnCancel = false] = args\n const clear = () => {\n if (timer) {\n clearTimeout(timer)\n timer = undefined\n lastRejector()\n lastRejector = noop\n }\n }\n\n const filter: EventFilter = (_invoke) => {\n const duration = toValue(ms)\n const elapsed = Date.now() - lastExec\n const invoke = () => {\n return (lastValue = _invoke())\n }\n\n clear()\n\n if (duration <= 0) {\n lastExec = Date.now()\n return invoke()\n }\n\n if (elapsed > duration && (leading || !isLeading)) {\n lastExec = Date.now()\n invoke()\n } else if (trailing) {\n lastValue = new Promise((resolve, reject) => {\n lastRejector = rejectOnCancel ? reject : resolve\n timer = setTimeout(\n () => {\n lastExec = Date.now()\n isLeading = true\n resolve(invoke())\n clear()\n },\n Math.max(0, duration - elapsed),\n )\n })\n }\n\n if (!leading && !timer) timer = setTimeout(() => (isLeading = true), duration)\n\n isLeading = false\n return lastValue\n }\n\n return filter\n}\n\nexport interface PausableFilterOptions {\n /**\n * The initial state\n *\n * @default 'active'\n */\n initialState?: 'active' | 'paused'\n}\n\n/**\n * EventFilter that gives extra controls to pause and resume the filter\n *\n * @param extendFilter Extra filter to apply when the PausableFilter is active, default to none\n * @param options Options to configure the filter\n */\nexport function pausableFilter(\n extendFilter: EventFilter = bypassFilter,\n options: PausableFilterOptions = {},\n): Pausable & { eventFilter: EventFilter } {\n const { initialState = 'active' } = options\n\n const isActive = toRef(initialState === 'active')\n\n function pause() {\n isActive.value = false\n }\n function resume() {\n isActive.value = true\n }\n\n const eventFilter: EventFilter = (...args) => {\n if (isActive.value) extendFilter(...args)\n }\n\n return { isActive: readonly(isActive), pause, resume, eventFilter }\n}\n"],"mappings":";;;;;;;AA8CA,SAAgB,oBAAqC,QAAqB,IAAO;CAC/E,SAAS,QAAmB,GAAG,MAAwB;AACrD,SAAO,IAAI,SAAiC,SAAS,WAAW;AAE9D,WAAQ,QAAQ,aAAa,GAAG,MAAM,MAAM,KAAK,EAAE;IAAE;IAAI,SAAS;IAAM;IAAM,CAAC,CAAC,CAC7E,KAAK,QAAQ,CACb,MAAM,OAAO;IAChB;;AAGJ,QAAO;;AAGT,IAAa,gBAA6B,WAAW;AACnD,QAAO,QAAQ;;;;;AAMjB,SAAgB,eAAe,IAA8B,UAAiC,EAAE,EAAE;CAChG,IAAI;CACJ,IAAI;CACJ,IAAI,eAAsB;CAE1B,MAAM,iBAAiB,UAAyC;AAC9D,eAAa,MAAM;AACnB,gBAAc;AACd,iBAAe;;CAGjB,IAAI;CAEJ,MAAM,UAAuB,WAAW;EACtC,MAAM,WAAW,QAAQ,GAAG;EAC5B,MAAM,cAAc,QAAQ,QAAQ,QAAQ;AAE5C,MAAI,MAAO,eAAc,MAAM;AAE/B,MAAI,YAAY,KAAM,gBAAgB,KAAA,KAAa,eAAe,GAAI;AACpE,OAAI,UAAU;AACZ,kBAAc,SAAS;AACvB,eAAW;;AAEb,UAAO,QAAQ,QAAQ,QAAQ,CAAC;;AAGlC,SAAO,IAAI,SAAS,SAAS,WAAW;AACtC,kBAAe,QAAQ,iBAAiB,SAAS;AACjD,iBAAc;AAEd,OAAI,eAAe,CAAC,SAClB,YAAW,iBAAiB;AAC1B,QAAI,MAAO,eAAc,MAAM;AAC/B,eAAW;AACX,YAAQ,aAAa,CAAC;MACrB,YAAY;AAIjB,WAAQ,iBAAiB;AACvB,QAAI,SAAU,eAAc,SAAS;AACrC,eAAW;AACX,YAAQ,QAAQ,CAAC;MAChB,SAAS;IACZ;;AAGJ,QAAO;;AAsCT,SAAgB,eAAe,GAAG,MAAa;CAC7C,IAAI,WAAW;CACf,IAAI;CACJ,IAAI,YAAY;CAChB,IAAI,eAAsB;CAC1B,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;AACJ,KAAI,CAAC,MAAM,KAAK,GAAG,IAAI,OAAO,KAAK,OAAO,SACxC,EAAC,CAAE,OAAO,IAAI,WAAW,MAAM,UAAU,MAAM,iBAAiB,SAAU,KAAK;KAC5E,EAAC,IAAI,WAAW,MAAM,UAAU,MAAM,iBAAiB,SAAS;CACrE,MAAM,cAAc;AAClB,MAAI,OAAO;AACT,gBAAa,MAAM;AACnB,WAAQ,KAAA;AACR,iBAAc;AACd,kBAAe;;;CAInB,MAAM,UAAuB,YAAY;EACvC,MAAM,WAAW,QAAQ,GAAG;EAC5B,MAAM,UAAU,KAAK,KAAK,GAAG;EAC7B,MAAM,eAAe;AACnB,UAAQ,YAAY,SAAS;;AAG/B,SAAO;AAEP,MAAI,YAAY,GAAG;AACjB,cAAW,KAAK,KAAK;AACrB,UAAO,QAAQ;;AAGjB,MAAI,UAAU,aAAa,WAAW,CAAC,YAAY;AACjD,cAAW,KAAK,KAAK;AACrB,WAAQ;aACC,SACT,aAAY,IAAI,SAAS,SAAS,WAAW;AAC3C,kBAAe,iBAAiB,SAAS;AACzC,WAAQ,iBACA;AACJ,eAAW,KAAK,KAAK;AACrB,gBAAY;AACZ,YAAQ,QAAQ,CAAC;AACjB,WAAO;MAET,KAAK,IAAI,GAAG,WAAW,QAAQ,CAChC;IACD;AAGJ,MAAI,CAAC,WAAW,CAAC,MAAO,SAAQ,iBAAkB,YAAY,MAAO,SAAS;AAE9E,cAAY;AACZ,SAAO;;AAGT,QAAO;;;;;;;;AAkBT,SAAgB,eACd,eAA4B,cAC5B,UAAiC,EAAE,EACM;CACzC,MAAM,EAAE,eAAe,aAAa;CAEpC,MAAM,WAAW,QAAM,iBAAiB,SAAS;CAEjD,SAAS,QAAQ;AACf,WAAS,QAAQ;;CAEnB,SAAS,SAAS;AAChB,WAAS,QAAQ;;CAGnB,MAAM,eAA4B,GAAG,SAAS;AAC5C,MAAI,SAAS,MAAO,cAAa,GAAG,KAAK;;AAG3C,QAAO;EAAE,UAAU,SAAS,SAAS;EAAE;EAAO;EAAQ;EAAa"}
@@ -0,0 +1,49 @@
1
+ export declare function promiseTimeout(ms: number, throwOnTimeout?: boolean, reason?: string): Promise<void>;
2
+ export declare function identity<T>(arg: T): T;
3
+ export interface SingletonPromiseReturn<T> {
4
+ (): Promise<T>;
5
+ /**
6
+ * Reset current staled promise.
7
+ * await it to have proper shutdown.
8
+ */
9
+ reset: () => Promise<void>;
10
+ }
11
+ /**
12
+ * Create singleton promise function
13
+ *
14
+ * @example
15
+ * ```
16
+ * const promise = createSingletonPromise(async () => { ... })
17
+ *
18
+ * await promise()
19
+ * await promise() // all of them will be bind to a single promise instance
20
+ * await promise() // and be resolved together
21
+ * ```
22
+ */
23
+ export declare function createSingletonPromise<T>(fn: () => Promise<T>): SingletonPromiseReturn<T>;
24
+ export declare function invoke<T>(fn: () => T): T;
25
+ export declare function containsProp(obj: object, ...props: string[]): boolean;
26
+ /**
27
+ * Increase string a value with unit
28
+ *
29
+ * @example '2px' + 1 = '3px'
30
+ * @example '15em' + (-2) = '13em'
31
+ */
32
+ export declare function increaseWithUnit(target: number, delta: number): number;
33
+ export declare function increaseWithUnit(target: string, delta: number): string;
34
+ export declare function increaseWithUnit(target: string | number, delta: number): string | number;
35
+ /**
36
+ * Get a px value for SSR use, do not rely on this method outside of SSR as REM unit is assumed at 16px, which might not be the case on the client
37
+ */
38
+ export declare function pxValue(px: string): number;
39
+ /**
40
+ * Create a new subset object by giving keys
41
+ */
42
+ export declare function objectPick<O extends object, T extends keyof O>(obj: O, keys: T[], omitUndefined?: boolean): Pick<O, T>;
43
+ /**
44
+ * Create a new subset object by omit giving keys
45
+ */
46
+ export declare function objectOmit<O extends object, T extends keyof O>(obj: O, keys: T[], omitUndefined?: boolean): Omit<O, T>;
47
+ export declare function objectEntries<T extends object>(obj: T): Array<[keyof T, T[keyof T]]>;
48
+ export declare function toArray<T>(value: T | readonly T[]): readonly T[];
49
+ export declare function toArray<T>(value: T | T[]): T[];
@@ -0,0 +1,85 @@
1
+ //#region packages/hooks/utils/general.ts
2
+ function promiseTimeout(ms, throwOnTimeout = false, reason = "Timeout") {
3
+ return new Promise((resolve, reject) => {
4
+ if (throwOnTimeout) setTimeout(() => reject(reason), ms);
5
+ else setTimeout(resolve, ms);
6
+ });
7
+ }
8
+ function identity(arg) {
9
+ return arg;
10
+ }
11
+ /**
12
+ * Create singleton promise function
13
+ *
14
+ * @example
15
+ * ```
16
+ * const promise = createSingletonPromise(async () => { ... })
17
+ *
18
+ * await promise()
19
+ * await promise() // all of them will be bind to a single promise instance
20
+ * await promise() // and be resolved together
21
+ * ```
22
+ */
23
+ function createSingletonPromise(fn) {
24
+ let _promise;
25
+ function wrapper() {
26
+ if (!_promise) _promise = fn();
27
+ return _promise;
28
+ }
29
+ wrapper.reset = async () => {
30
+ const _prev = _promise;
31
+ _promise = void 0;
32
+ if (_prev) await _prev;
33
+ };
34
+ return wrapper;
35
+ }
36
+ function invoke(fn) {
37
+ return fn();
38
+ }
39
+ function containsProp(obj, ...props) {
40
+ return props.some((k) => k in obj);
41
+ }
42
+ function increaseWithUnit(target, delta) {
43
+ var _target$match;
44
+ if (typeof target === "number") return target + delta;
45
+ const value = ((_target$match = target.match(/^-?\d+\.?\d*/)) === null || _target$match === void 0 ? void 0 : _target$match[0]) || "";
46
+ const unit = target.slice(value.length);
47
+ const result = Number.parseFloat(value) + delta;
48
+ if (Number.isNaN(result)) return target;
49
+ return result + unit;
50
+ }
51
+ /**
52
+ * Get a px value for SSR use, do not rely on this method outside of SSR as REM unit is assumed at 16px, which might not be the case on the client
53
+ */
54
+ function pxValue(px) {
55
+ return px.endsWith("rem") ? Number.parseFloat(px) * 16 : Number.parseFloat(px);
56
+ }
57
+ /**
58
+ * Create a new subset object by giving keys
59
+ */
60
+ function objectPick(obj, keys, omitUndefined = false) {
61
+ return keys.reduce((n, k) => {
62
+ if (k in obj) {
63
+ if (!omitUndefined || obj[k] !== void 0) n[k] = obj[k];
64
+ }
65
+ return n;
66
+ }, {});
67
+ }
68
+ /**
69
+ * Create a new subset object by omit giving keys
70
+ */
71
+ function objectOmit(obj, keys, omitUndefined = false) {
72
+ return Object.fromEntries(Object.entries(obj).filter(([key, value]) => {
73
+ return (!omitUndefined || value !== void 0) && !keys.includes(key);
74
+ }));
75
+ }
76
+ function objectEntries(obj) {
77
+ return Object.entries(obj);
78
+ }
79
+ function toArray(value) {
80
+ return Array.isArray(value) ? value : [value];
81
+ }
82
+ //#endregion
83
+ export { containsProp, createSingletonPromise, identity, increaseWithUnit, invoke, objectEntries, objectOmit, objectPick, promiseTimeout, pxValue, toArray };
84
+
85
+ //# sourceMappingURL=general.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"general.mjs","names":[],"sources":["../../../../../packages/hooks/utils/general.ts"],"sourcesContent":["export function promiseTimeout(ms: number, throwOnTimeout = false, reason = 'Timeout'): Promise<void> {\r\n return new Promise((resolve, reject) => {\r\n if (throwOnTimeout) setTimeout(() => reject(reason), ms)\r\n else setTimeout(resolve, ms)\r\n })\r\n}\r\n\r\nexport function identity<T>(arg: T): T {\r\n return arg\r\n}\r\n\r\nexport interface SingletonPromiseReturn<T> {\r\n (): Promise<T>\r\n /**\r\n * Reset current staled promise.\r\n * await it to have proper shutdown.\r\n */\r\n reset: () => Promise<void>\r\n}\r\n/**\r\n * Create singleton promise function\r\n *\r\n * @example\r\n * ```\r\n * const promise = createSingletonPromise(async () => { ... })\r\n *\r\n * await promise()\r\n * await promise() // all of them will be bind to a single promise instance\r\n * await promise() // and be resolved together\r\n * ```\r\n */\r\n\r\nexport function createSingletonPromise<T>(fn: () => Promise<T>): SingletonPromiseReturn<T> {\r\n let _promise: Promise<T> | undefined\r\n\r\n function wrapper() {\r\n if (!_promise) _promise = fn()\r\n return _promise\r\n }\r\n wrapper.reset = async () => {\r\n const _prev = _promise\r\n _promise = undefined\r\n if (_prev) await _prev\r\n }\r\n\r\n return wrapper\r\n}\r\n\r\nexport function invoke<T>(fn: () => T): T {\r\n return fn()\r\n}\r\n\r\nexport function containsProp(obj: object, ...props: string[]) {\r\n return props.some((k) => k in obj)\r\n}\r\n/**\r\n * Increase string a value with unit\r\n *\r\n * @example '2px' + 1 = '3px'\r\n * @example '15em' + (-2) = '13em'\r\n */\r\n\r\nexport function increaseWithUnit(target: number, delta: number): number\r\nexport function increaseWithUnit(target: string, delta: number): string\r\nexport function increaseWithUnit(target: string | number, delta: number): string | number\r\nexport function increaseWithUnit(target: string | number, delta: number): string | number {\r\n if (typeof target === 'number') return target + delta\r\n const value = target.match(/^-?\\d+\\.?\\d*/)?.[0] || ''\r\n const unit = target.slice(value.length)\r\n const result = Number.parseFloat(value) + delta\r\n if (Number.isNaN(result)) return target\r\n return result + unit\r\n}\r\n/**\r\n * Get a px value for SSR use, do not rely on this method outside of SSR as REM unit is assumed at 16px, which might not be the case on the client\r\n */\r\n\r\nexport function pxValue(px: string) {\r\n return px.endsWith('rem') ? Number.parseFloat(px) * 16 : Number.parseFloat(px)\r\n}\r\n/**\r\n * Create a new subset object by giving keys\r\n */\r\n\r\nexport function objectPick<O extends object, T extends keyof O>(obj: O, keys: T[], omitUndefined = false) {\r\n return keys.reduce(\r\n (n, k) => {\r\n if (k in obj) {\r\n if (!omitUndefined || obj[k] !== undefined) n[k] = obj[k]\r\n }\r\n return n\r\n },\r\n {} as Pick<O, T>,\r\n )\r\n}\r\n/**\r\n * Create a new subset object by omit giving keys\r\n */\r\n\r\nexport function objectOmit<O extends object, T extends keyof O>(obj: O, keys: T[], omitUndefined = false) {\r\n return Object.fromEntries(\r\n Object.entries(obj).filter(([key, value]) => {\r\n return (!omitUndefined || value !== undefined) && !keys.includes(key as T)\r\n }),\r\n ) as Omit<O, T>\r\n}\r\n\r\nexport function objectEntries<T extends object>(obj: T) {\r\n return Object.entries(obj) as Array<[keyof T, T[keyof T]]>\r\n}\r\n\r\nexport function toArray<T>(value: T | readonly T[]): readonly T[]\r\nexport function toArray<T>(value: T | T[]): T[]\r\nexport function toArray<T>(value: T | T[]): T[] {\r\n return Array.isArray(value) ? value : [value]\r\n}\r\n"],"mappings":";AAAA,SAAgB,eAAe,IAAY,iBAAiB,OAAO,SAAS,WAA0B;AACpG,QAAO,IAAI,SAAS,SAAS,WAAW;AACtC,MAAI,eAAgB,kBAAiB,OAAO,OAAO,EAAE,GAAG;MACnD,YAAW,SAAS,GAAG;GAC5B;;AAGJ,SAAgB,SAAY,KAAW;AACrC,QAAO;;;;;;;;;;;;;;AAwBT,SAAgB,uBAA0B,IAAiD;CACzF,IAAI;CAEJ,SAAS,UAAU;AACjB,MAAI,CAAC,SAAU,YAAW,IAAI;AAC9B,SAAO;;AAET,SAAQ,QAAQ,YAAY;EAC1B,MAAM,QAAQ;AACd,aAAW,KAAA;AACX,MAAI,MAAO,OAAM;;AAGnB,QAAO;;AAGT,SAAgB,OAAU,IAAgB;AACxC,QAAO,IAAI;;AAGb,SAAgB,aAAa,KAAa,GAAG,OAAiB;AAC5D,QAAO,MAAM,MAAM,MAAM,KAAK,IAAI;;AAYpC,SAAgB,iBAAiB,QAAyB,OAAgC;;AACxF,KAAI,OAAO,WAAW,SAAU,QAAO,SAAS;CAChD,MAAM,UAAA,gBAAQ,OAAO,MAAM,eAAe,MAAA,QAAA,kBAAA,KAAA,IAAA,KAAA,IAAA,cAAG,OAAM;CACnD,MAAM,OAAO,OAAO,MAAM,MAAM,OAAO;CACvC,MAAM,SAAS,OAAO,WAAW,MAAM,GAAG;AAC1C,KAAI,OAAO,MAAM,OAAO,CAAE,QAAO;AACjC,QAAO,SAAS;;;;;AAMlB,SAAgB,QAAQ,IAAY;AAClC,QAAO,GAAG,SAAS,MAAM,GAAG,OAAO,WAAW,GAAG,GAAG,KAAK,OAAO,WAAW,GAAG;;;;;AAMhF,SAAgB,WAAgD,KAAQ,MAAW,gBAAgB,OAAO;AACxG,QAAO,KAAK,QACT,GAAG,MAAM;AACR,MAAI,KAAK;OACH,CAAC,iBAAiB,IAAI,OAAO,KAAA,EAAW,GAAE,KAAK,IAAI;;AAEzD,SAAO;IAET,EAAE,CACH;;;;;AAMH,SAAgB,WAAgD,KAAQ,MAAW,gBAAgB,OAAO;AACxG,QAAO,OAAO,YACZ,OAAO,QAAQ,IAAI,CAAC,QAAQ,CAAC,KAAK,WAAW;AAC3C,UAAQ,CAAC,iBAAiB,UAAU,KAAA,MAAc,CAAC,KAAK,SAAS,IAAS;GAC1E,CACH;;AAGH,SAAgB,cAAgC,KAAQ;AACtD,QAAO,OAAO,QAAQ,IAAI;;AAK5B,SAAgB,QAAW,OAAqB;AAC9C,QAAO,MAAM,QAAQ,MAAM,GAAG,QAAQ,CAAC,MAAM"}
@@ -0,0 +1,6 @@
1
+ export * from './filters.js';
2
+ export * from './general.js';
3
+ export * from './is.js';
4
+ export * from './port.js';
5
+ export * from './types.js';
6
+ export * from './vue.js';
@@ -0,0 +1,6 @@
1
+ import { assert, clamp, hasOwn, isClient, isDef, isIOS, isObject, isWorker, noop, notNullish, now, rand, timestamp } from "./is.mjs";
2
+ import { bypassFilter, createFilterWrapper, debounceFilter, pausableFilter, throttleFilter } from "./filters.mjs";
3
+ import { containsProp, createSingletonPromise, identity, increaseWithUnit, invoke, objectEntries, objectOmit, objectPick, promiseTimeout, pxValue, toArray } from "./general.mjs";
4
+ import { camelize, hyphenate } from "./port.mjs";
5
+ import { getLifeCycleTarget } from "./vue.mjs";
6
+ export { assert, bypassFilter, camelize, clamp, containsProp, createFilterWrapper, createSingletonPromise, debounceFilter, getLifeCycleTarget, hasOwn, hyphenate, identity, increaseWithUnit, invoke, isClient, isDef, isIOS, isObject, isWorker, noop, notNullish, now, objectEntries, objectOmit, objectPick, pausableFilter, promiseTimeout, pxValue, rand, throttleFilter, timestamp, toArray };
@@ -0,0 +1,13 @@
1
+ export declare const isClient: boolean;
2
+ export declare const isWorker: boolean;
3
+ export declare const isDef: <T = any>(val?: T) => val is T;
4
+ export declare const notNullish: <T = any>(val?: T | null | undefined) => val is T;
5
+ export declare const assert: (condition: boolean, ...infos: any[]) => void;
6
+ export declare const isObject: (val: any) => val is object;
7
+ export declare const now: () => number;
8
+ export declare const timestamp: () => number;
9
+ export declare const clamp: (n: number, min: number, max: number) => number;
10
+ export declare const noop: () => void;
11
+ export declare const rand: (min: number, max: number) => number;
12
+ export declare const hasOwn: <T extends object, K extends keyof T>(val: T, key: K) => key is K;
13
+ export declare const isIOS: boolean | "";
@@ -0,0 +1,29 @@
1
+ //#region packages/hooks/utils/is.ts
2
+ var isClient = typeof window !== "undefined" && typeof document !== "undefined";
3
+ var isWorker = typeof WorkerGlobalScope !== "undefined" && globalThis instanceof WorkerGlobalScope;
4
+ var isDef = (val) => typeof val !== "undefined";
5
+ var notNullish = (val) => val != null;
6
+ var assert = (condition, ...infos) => {
7
+ if (!condition) console.warn(...infos);
8
+ };
9
+ var toString = Object.prototype.toString;
10
+ var isObject = (val) => toString.call(val) === "[object Object]";
11
+ var now = () => Date.now();
12
+ var timestamp = () => +Date.now();
13
+ var clamp = (n, min, max) => Math.min(max, Math.max(min, n));
14
+ var noop = () => {};
15
+ var rand = (min, max) => {
16
+ min = Math.ceil(min);
17
+ max = Math.floor(max);
18
+ return Math.floor(Math.random() * (max - min + 1)) + min;
19
+ };
20
+ var hasOwn = (val, key) => Object.prototype.hasOwnProperty.call(val, key);
21
+ var isIOS = /* @__PURE__ */ getIsIOS();
22
+ function getIsIOS() {
23
+ var _window, _window2, _window3;
24
+ return isClient && ((_window = window) === null || _window === void 0 || (_window = _window.navigator) === null || _window === void 0 ? void 0 : _window.userAgent) && (/iP(?:ad|hone|od)/.test(window.navigator.userAgent) || ((_window2 = window) === null || _window2 === void 0 || (_window2 = _window2.navigator) === null || _window2 === void 0 ? void 0 : _window2.maxTouchPoints) > 2 && /iPad|Macintosh/.test((_window3 = window) === null || _window3 === void 0 ? void 0 : _window3.navigator.userAgent));
25
+ }
26
+ //#endregion
27
+ export { assert, clamp, hasOwn, isClient, isDef, isIOS, isObject, isWorker, noop, notNullish, now, rand, timestamp };
28
+
29
+ //# sourceMappingURL=is.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"is.mjs","names":[],"sources":["../../../../../packages/hooks/utils/is.ts"],"sourcesContent":["export const isClient = typeof window !== 'undefined' && typeof document !== 'undefined'\n// @ts-expect-error - WorkerGlobalScope is not defined in the global scope\nexport const isWorker = typeof WorkerGlobalScope !== 'undefined' && globalThis instanceof WorkerGlobalScope\nexport const isDef = <T = any>(val?: T): val is T => typeof val !== 'undefined'\nexport const notNullish = <T = any>(val?: T | null | undefined): val is T => val != null\nexport const assert = (condition: boolean, ...infos: any[]) => {\n if (!condition) console.warn(...infos)\n}\nconst toString = Object.prototype.toString\nexport const isObject = (val: any): val is object => toString.call(val) === '[object Object]'\nexport const now = () => Date.now()\nexport const timestamp = () => +Date.now()\nexport const clamp = (n: number, min: number, max: number) => Math.min(max, Math.max(min, n))\nexport const noop = () => {}\nexport const rand = (min: number, max: number) => {\n min = Math.ceil(min)\n max = Math.floor(max)\n return Math.floor(Math.random() * (max - min + 1)) + min\n}\nexport const hasOwn = <T extends object, K extends keyof T>(val: T, key: K): key is K =>\n Object.prototype.hasOwnProperty.call(val, key)\n\nexport const isIOS = /* #__PURE__ */ getIsIOS()\n\nfunction getIsIOS() {\n return (\n isClient &&\n window?.navigator?.userAgent &&\n (/iP(?:ad|hone|od)/.test(window.navigator.userAgent) ||\n // The new iPad Pro Gen3 does not identify itself as iPad, but as Macintosh.\n // https://github.com/vueuse/vueuse/issues/3577\n (window?.navigator?.maxTouchPoints > 2 && /iPad|Macintosh/.test(window?.navigator.userAgent)))\n )\n}\n"],"mappings":";AAAA,IAAa,WAAW,OAAO,WAAW,eAAe,OAAO,aAAa;AAE7E,IAAa,WAAW,OAAO,sBAAsB,eAAe,sBAAsB;AAC1F,IAAa,SAAkB,QAAsB,OAAO,QAAQ;AACpE,IAAa,cAAuB,QAAyC,OAAO;AACpF,IAAa,UAAU,WAAoB,GAAG,UAAiB;AAC7D,KAAI,CAAC,UAAW,SAAQ,KAAK,GAAG,MAAM;;AAExC,IAAM,WAAW,OAAO,UAAU;AAClC,IAAa,YAAY,QAA4B,SAAS,KAAK,IAAI,KAAK;AAC5E,IAAa,YAAY,KAAK,KAAK;AACnC,IAAa,kBAAkB,CAAC,KAAK,KAAK;AAC1C,IAAa,SAAS,GAAW,KAAa,QAAgB,KAAK,IAAI,KAAK,KAAK,IAAI,KAAK,EAAE,CAAC;AAC7F,IAAa,aAAa;AAC1B,IAAa,QAAQ,KAAa,QAAgB;AAChD,OAAM,KAAK,KAAK,IAAI;AACpB,OAAM,KAAK,MAAM,IAAI;AACrB,QAAO,KAAK,MAAM,KAAK,QAAQ,IAAI,MAAM,MAAM,GAAG,GAAG;;AAEvD,IAAa,UAA+C,KAAQ,QAClE,OAAO,UAAU,eAAe,KAAK,KAAK,IAAI;AAEhD,IAAa,QAAwB,0BAAU;AAE/C,SAAS,WAAW;;AAClB,QACE,cAAA,UACA,YAAA,QAAA,YAAA,KAAA,MAAA,UAAA,QAAQ,eAAA,QAAA,YAAA,KAAA,IAAA,KAAA,IAAA,QAAW,eAClB,mBAAmB,KAAK,OAAO,UAAU,UAAU,MAAA,WAGjD,YAAA,QAAA,aAAA,KAAA,MAAA,WAAA,SAAQ,eAAA,QAAA,aAAA,KAAA,IAAA,KAAA,IAAA,SAAW,kBAAiB,KAAK,iBAAiB,MAAA,WAAK,YAAA,QAAA,aAAA,KAAA,IAAA,KAAA,IAAA,SAAQ,UAAU,UAAU"}
@@ -0,0 +1,2 @@
1
+ export declare const hyphenate: (str: string) => string;
2
+ export declare const camelize: (str: string) => string;
@@ -0,0 +1,17 @@
1
+ //#region packages/hooks/utils/port.ts
2
+ function cacheStringFunction(fn) {
3
+ const cache = Object.create(null);
4
+ return ((str) => {
5
+ return cache[str] || (cache[str] = fn(str));
6
+ });
7
+ }
8
+ var hyphenateRE = /\B([A-Z])/g;
9
+ var hyphenate = cacheStringFunction((str) => str.replace(hyphenateRE, "-$1").toLowerCase());
10
+ var camelizeRE = /-(\w)/g;
11
+ var camelize = cacheStringFunction((str) => {
12
+ return str.replace(camelizeRE, (_, c) => c ? c.toUpperCase() : "");
13
+ });
14
+ //#endregion
15
+ export { camelize, hyphenate };
16
+
17
+ //# sourceMappingURL=port.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"port.mjs","names":[],"sources":["../../../../../packages/hooks/utils/port.ts"],"sourcesContent":["// copied from vue: https://github.com/vuejs/core/blob/3be4e3cbe34b394096210897c1be8deeb6d748d8/packages/shared/src/general.ts#L90-L112\r\nfunction cacheStringFunction<T extends (str: string) => string>(fn: T): T {\r\n const cache: Record<string, string> = Object.create(null)\r\n return ((str: string) => {\r\n const hit = cache[str]\r\n return hit || (cache[str] = fn(str))\r\n }) as T\r\n}\r\n\r\nconst hyphenateRE = /\\B([A-Z])/g\r\nexport const hyphenate = cacheStringFunction((str: string) => str.replace(hyphenateRE, '-$1').toLowerCase())\r\n\r\nconst camelizeRE = /-(\\w)/g\r\nexport const camelize = cacheStringFunction((str: string): string => {\r\n return str.replace(camelizeRE, (_, c) => (c ? c.toUpperCase() : ''))\r\n})\r\n"],"mappings":";AACA,SAAS,oBAAuD,IAAU;CACxE,MAAM,QAAgC,OAAO,OAAO,KAAK;AACzD,UAAS,QAAgB;AAEvB,SADY,MAAM,SACH,MAAM,OAAO,GAAG,IAAI;;;AAIvC,IAAM,cAAc;AACpB,IAAa,YAAY,qBAAqB,QAAgB,IAAI,QAAQ,aAAa,MAAM,CAAC,aAAa,CAAC;AAE5G,IAAM,aAAa;AACnB,IAAa,WAAW,qBAAqB,QAAwB;AACnE,QAAO,IAAI,QAAQ,aAAa,GAAG,MAAO,IAAI,EAAE,aAAa,GAAG,GAAI;EACpE"}
@@ -0,0 +1,117 @@
1
+ import type { ComputedRef, MaybeRef, MaybeRefOrGetter, Ref, ShallowRef, WatchOptions, WatchSource } from 'vue';
2
+ export type {
3
+ /**
4
+ * @deprecated use `MaybeRef` from `vue` instead
5
+ */
6
+ MaybeRef,
7
+ /**
8
+ * @deprecated use `MaybeRefOrGetter` from `vue` instead
9
+ */
10
+ MaybeRefOrGetter, };
11
+ /**
12
+ * Void function
13
+ */
14
+ export type Fn = () => void;
15
+ /**
16
+ * Any function
17
+ */
18
+ export type AnyFn = (...args: any[]) => any;
19
+ /**
20
+ * A ref that allow to set null or undefined
21
+ */
22
+ export type RemovableRef<T> = Omit<Ref<T>, 'value'> & {
23
+ get value(): T;
24
+ set value(value: T | null | undefined);
25
+ };
26
+ /**
27
+ * Maybe it's a computed ref, or a readonly value, or a getter function
28
+ */
29
+ export type ReadonlyRefOrGetter<T> = ComputedRef<T> | (() => T);
30
+ /**
31
+ * Make all the nested attributes of an object or array to MaybeRef<T>
32
+ *
33
+ * Good for accepting options that will be wrapped with `reactive` or `ref`
34
+ *
35
+ * ```ts
36
+ * UnwrapRef<DeepMaybeRef<T>> === T
37
+ * ```
38
+ */
39
+ export type DeepMaybeRef<T> = T extends Ref<infer V> ? MaybeRef<V> : T extends Array<any> | object ? {
40
+ [K in keyof T]: DeepMaybeRef<T[K]>;
41
+ } : MaybeRef<T>;
42
+ export type Arrayable<T> = T[] | T;
43
+ /**
44
+ * Infers the element type of an array
45
+ */
46
+ export type ElementOf<T> = T extends (infer E)[] ? E : never;
47
+ export type ShallowUnwrapRef<T> = T extends Ref<infer P> ? P : T;
48
+ export type Awaitable<T> = Promise<T> | T;
49
+ export type ArgumentsType<T> = T extends (...args: infer U) => any ? U : never;
50
+ /**
51
+ * Compatible with versions below TypeScript 4.5 Awaited
52
+ */
53
+ export type Awaited<T> = T extends null | undefined ? T : T extends object & {
54
+ then: (onfulfilled: infer F, ...args: infer _) => any;
55
+ } ? F extends (value: infer V, ...args: infer _) => any ? Awaited<V> : never : T;
56
+ export type Promisify<T> = Promise<Awaited<T>>;
57
+ export type PromisifyFn<T extends AnyFn> = (...args: ArgumentsType<T>) => Promisify<ReturnType<T>>;
58
+ export interface Pausable {
59
+ /**
60
+ * A ref indicate whether a pausable instance is active
61
+ */
62
+ isActive: Readonly<ShallowRef<boolean>>;
63
+ /**
64
+ * Temporary pause the effect from executing
65
+ */
66
+ pause: Fn;
67
+ /**
68
+ * Resume the effects
69
+ */
70
+ resume: Fn;
71
+ }
72
+ export interface Stoppable<StartFnArgs extends any[] = any[]> {
73
+ /**
74
+ * A ref indicate whether a stoppable instance is executing
75
+ */
76
+ isPending: Readonly<Ref<boolean>>;
77
+ /**
78
+ * Stop the effect from executing
79
+ */
80
+ stop: Fn;
81
+ /**
82
+ * Start the effects
83
+ */
84
+ start: (...args: StartFnArgs) => void;
85
+ }
86
+ export interface ConfigurableFlush {
87
+ /**
88
+ * Timing for monitoring changes, refer to WatchOptions for more details
89
+ *
90
+ * @default 'pre'
91
+ */
92
+ flush?: WatchOptions['flush'];
93
+ }
94
+ export interface ConfigurableFlushSync {
95
+ /**
96
+ * Timing for monitoring changes, refer to WatchOptions for more details.
97
+ * Unlike `watch()`, the default is set to `sync`
98
+ *
99
+ * @default 'sync'
100
+ */
101
+ flush?: WatchOptions['flush'];
102
+ }
103
+ export type MultiWatchSources = (WatchSource<unknown> | object)[];
104
+ export type MapSources<T> = {
105
+ [K in keyof T]: T[K] extends WatchSource<infer V> ? V : never;
106
+ };
107
+ export type MapOldSources<T, Immediate> = {
108
+ [K in keyof T]: T[K] extends WatchSource<infer V> ? (Immediate extends true ? V | undefined : V) : never;
109
+ };
110
+ export type Mutable<T> = {
111
+ -readonly [P in keyof T]: T[P];
112
+ };
113
+ export type IfAny<T, Y, N> = 0 extends 1 & T ? Y : N;
114
+ /**
115
+ * will return `true` if `T` is `any`, or `false` otherwise
116
+ */
117
+ export type IsAny<T> = IfAny<T, true, false>;
File without changes
@@ -0,0 +1 @@
1
+ export declare function getLifeCycleTarget(target?: any): any;
@@ -0,0 +1,9 @@
1
+ import { getCurrentInstance } from "vue";
2
+ //#region packages/hooks/utils/vue.ts
3
+ function getLifeCycleTarget(target) {
4
+ return target || getCurrentInstance();
5
+ }
6
+ //#endregion
7
+ export { getLifeCycleTarget };
8
+
9
+ //# sourceMappingURL=vue.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vue.mjs","names":[],"sources":["../../../../../packages/hooks/utils/vue.ts"],"sourcesContent":["import { getCurrentInstance } from 'vue'\r\n\r\nexport function getLifeCycleTarget(target?: any) {\r\n return target || getCurrentInstance()\r\n}\r\n"],"mappings":";;AAEA,SAAgB,mBAAmB,QAAc;AAC/C,QAAO,UAAU,oBAAoB"}
@@ -0,0 +1,5 @@
1
+ import type { WatchCallback, WatchOptions, WatchSource, WatchStopHandle } from 'vue';
2
+ import type { MapOldSources, MapSources } from '../utils/types.js';
3
+ export declare function watchImmediate<T extends Readonly<WatchSource<unknown>[]>>(source: [...T], cb: WatchCallback<MapSources<T>, MapOldSources<T, true>>, options?: Omit<WatchOptions<true>, 'immediate'>): WatchStopHandle;
4
+ export declare function watchImmediate<T>(source: WatchSource<T>, cb: WatchCallback<T, T | undefined>, options?: Omit<WatchOptions<true>, 'immediate'>): WatchStopHandle;
5
+ export declare function watchImmediate<T extends object>(source: T, cb: WatchCallback<T, T | undefined>, options?: Omit<WatchOptions<true>, 'immediate'>): WatchStopHandle;
@@ -0,0 +1,17 @@
1
+ import { watch } from "vue";
2
+ //#region packages/hooks/watchImmediate/index.ts
3
+ /**
4
+ * Shorthand for watching value with {immediate: true}
5
+ *
6
+ * @see https://vueuse.org/watchImmediate
7
+ */
8
+ function watchImmediate(source, cb, options) {
9
+ return watch(source, cb, {
10
+ ...options,
11
+ immediate: true
12
+ });
13
+ }
14
+ //#endregion
15
+ export { watchImmediate };
16
+
17
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../../../../../packages/hooks/watchImmediate/index.ts"],"sourcesContent":["import type { WatchCallback, WatchOptions, WatchSource, WatchStopHandle } from 'vue'\r\nimport type { MapOldSources, MapSources } from '../utils/types'\r\n\r\nimport { watch } from 'vue'\r\n\r\n// overloads\r\nexport function watchImmediate<T extends Readonly<WatchSource<unknown>[]>>(\r\n source: [...T],\r\n cb: WatchCallback<MapSources<T>, MapOldSources<T, true>>,\r\n options?: Omit<WatchOptions<true>, 'immediate'>,\r\n): WatchStopHandle\r\n\r\nexport function watchImmediate<T>(\r\n source: WatchSource<T>,\r\n cb: WatchCallback<T, T | undefined>,\r\n options?: Omit<WatchOptions<true>, 'immediate'>,\r\n): WatchStopHandle\r\n\r\nexport function watchImmediate<T extends object>(\r\n source: T,\r\n cb: WatchCallback<T, T | undefined>,\r\n options?: Omit<WatchOptions<true>, 'immediate'>,\r\n): WatchStopHandle\r\n\r\n/**\r\n * Shorthand for watching value with {immediate: true}\r\n *\r\n * @see https://vueuse.org/watchImmediate\r\n */\r\nexport function watchImmediate<T = any>(source: T, cb: any, options?: Omit<WatchOptions, 'immediate'>) {\r\n return watch(source as any, cb, {\r\n ...options,\r\n immediate: true,\r\n })\r\n}\r\n"],"mappings":";;;;;;;AA6BA,SAAgB,eAAwB,QAAW,IAAS,SAA2C;AACrG,QAAO,MAAM,QAAe,IAAI;EAC9B,GAAG;EACH,WAAW;EACZ,CAAC"}
package/es/index.d.ts ADDED
@@ -0,0 +1,8 @@
1
+ import installer from './defaults.js';
2
+ export * from './components/index.js';
3
+ export * from './directives/index.js';
4
+ export * from './hooks/index.js';
5
+ export * from './make-installer.js';
6
+ export declare const install: (app: import("vue").App) => void;
7
+ export declare const version: string;
8
+ export default installer;
package/es/index.mjs ADDED
@@ -0,0 +1,47 @@
1
+ import { datePickerEmits, datePickerProps } from "./components/date-picker/src/date-picker.mjs";
2
+ import { HdDatePicker } from "./components/date-picker/index.mjs";
3
+ import { descriptionsProps } from "./components/descriptions/src/idescriptions.mjs";
4
+ import { HdDescriptions } from "./components/descriptions/index.mjs";
5
+ import { ellipsisTagProps } from "./components/ellipsis-tag/src/ellipsis-tag.mjs";
6
+ import copy from "./directives/copy/index.mjs";
7
+ import draggable from "./directives/draggable/index.mjs";
8
+ import resizeElement from "./directives/resize-element/index.mjs";
9
+ import showTip from "./directives/show-tip/index.mjs";
10
+ import { HdEllipsisTag } from "./components/ellipsis-tag/index.mjs";
11
+ import { emptyProps } from "./components/empty/src/iempty.mjs";
12
+ import { HdEmpty } from "./components/empty/index.mjs";
13
+ import { jdataViewerProps } from "./components/jdata-viewer/src/ijdata-viewer.mjs";
14
+ import { HdJdataViewer } from "./components/jdata-viewer/index.mjs";
15
+ import { radioEmits, radioProps } from "./components/radio/src/radio.mjs";
16
+ import { HdRadio } from "./components/radio/index.mjs";
17
+ import { remoteSearchEmits, remoteSearchProps } from "./components/remote-search/src/iremote-search.mjs";
18
+ import { HdRemoteSearch } from "./components/remote-search/index.mjs";
19
+ import { searchFormEmits, searchFormProps } from "./components/search-form/src/isearch-form.mjs";
20
+ import { HdSearchForm } from "./components/search-form/index.mjs";
21
+ import { stickyContainerEmits, stickyContainerProps } from "./components/sticky-container/src/isticky-container.mjs";
22
+ import { HdStickyContainer } from "./components/sticky-container/index.mjs";
23
+ import { tableEmits, tableProps } from "./components/table/src/table.mjs";
24
+ import { HdTable } from "./components/table/index.mjs";
25
+ import { tableEditorEmits, tableEditorProps } from "./components/table-editor/src/table-editor.mjs";
26
+ import { HdTableEditor } from "./components/table-editor/index.mjs";
27
+ import { tabsEmits, tabsProps } from "./components/tabs/src/itabs.mjs";
28
+ import { HdTabs } from "./components/tabs/index.mjs";
29
+ import { tareaTagEmits, tareaTagProps } from "./components/tarea-tag/src/tarea-tag.mjs";
30
+ import { HdTareaTag } from "./components/tarea-tag/index.mjs";
31
+ import { textEllipsisEmits, textEllipsisProps } from "./components/text-ellipsis/src/itext-ellipsis.mjs";
32
+ import { HdTextEllipsis } from "./components/text-ellipsis/index.mjs";
33
+ import { timeLineEmits, timeLineProps } from "./components/time-line/src/time-line.mjs";
34
+ import { HdTimeLine } from "./components/time-line/index.mjs";
35
+ import { uploaderEmits, uploaderProps } from "./components/uploader/src/uploader.mjs";
36
+ import { HdUploader } from "./components/uploader/index.mjs";
37
+ import { makeInstaller } from "./make-installer.mjs";
38
+ import defaults_default from "./defaults.mjs";
39
+ import { useFullscreen } from "./hooks/useFullscreen/index.mjs";
40
+ //#region packages/hd-custom/index.ts
41
+ var install = defaults_default.install;
42
+ var version = defaults_default.version;
43
+ var hd_custom_default = defaults_default;
44
+ //#endregion
45
+ export { copy as Copy, draggable as Draggable, HdDatePicker, HdDescriptions, HdEllipsisTag, HdEmpty, HdJdataViewer, HdRadio, HdRemoteSearch, HdSearchForm, HdStickyContainer, HdTable, HdTableEditor, HdTabs, HdTareaTag, HdTextEllipsis, HdTimeLine, HdUploader, resizeElement as ResizeElement, showTip as ShowTip, datePickerEmits, datePickerProps, hd_custom_default as default, descriptionsProps, ellipsisTagProps, emptyProps, install, jdataViewerProps, makeInstaller, radioEmits, radioProps, remoteSearchEmits, remoteSearchProps, searchFormEmits, searchFormProps, stickyContainerEmits, stickyContainerProps, tableEditorEmits, tableEditorProps, tableEmits, tableProps, tabsEmits, tabsProps, tareaTagEmits, tareaTagProps, textEllipsisEmits, textEllipsisProps, timeLineEmits, timeLineProps, uploaderEmits, uploaderProps, useFullscreen, version };
46
+
47
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../../../packages/hd-custom/index.ts"],"sourcesContent":["import installer from './defaults'\n\nexport * from '@hd-custom/components'\nexport * from '@hd-custom/directives'\nexport * from '@hd-custom/hooks'\nexport * from './make-installer'\n\nexport const install = installer.install\nexport const version = installer.version\n\nexport default installer\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA,IAAa,UAAU,iBAAU;AACjC,IAAa,UAAU,iBAAU;AAEjC,IAAA,oBAAe"}
@@ -0,0 +1,5 @@
1
+ import type { App, Plugin } from 'vue';
2
+ export declare const makeInstaller: (components?: Plugin[]) => {
3
+ version: string;
4
+ install: (app: App) => void;
5
+ };