@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,117 @@
1
+ import { nextTick, onBeforeMount, ref, watch } from "vue";
2
+ //#region packages/components/table/src/use-controller.ts
3
+ var useController = (props, _ElTableInstance) => {
4
+ const ElTableInstance = _ElTableInstance;
5
+ const _columns = ref([]);
6
+ let _cacheSaveColumns = null;
7
+ _columns.value = _ideepClone(props === null || props === void 0 ? void 0 : props.columns);
8
+ const setColumns = ref([]);
9
+ const SettingInstance = ref();
10
+ const handleSetting = () => {
11
+ getShowHideColumns();
12
+ SettingInstance.value.actionDialog();
13
+ };
14
+ const HandleSetSave = () => {
15
+ const newColumns = _ideepClone(props.columns);
16
+ setColumns.value.forEach((item) => {
17
+ newColumns === null || newColumns === void 0 || newColumns.forEach((column) => {
18
+ if (item.prop === column.prop) column.show = item.checked;
19
+ });
20
+ });
21
+ _columns.value = newColumns;
22
+ nextTick(() => {
23
+ var _ElTableInstance$valu;
24
+ (_ElTableInstance$valu = ElTableInstance.value) === null || _ElTableInstance$valu === void 0 || _ElTableInstance$valu.doLayout();
25
+ });
26
+ if (props.tableKey) window.localStorage.setItem(props.tableKey, JSON.stringify(setColumns.value));
27
+ else _cacheSaveColumns = _ideepClone(setColumns.value);
28
+ };
29
+ const getShowHideColumns = () => {
30
+ const _cacheSetColumns = getCacheColumns();
31
+ if (_cacheSetColumns) {
32
+ setColumns.value = _cacheSetColumns;
33
+ return;
34
+ } else if (_cacheSaveColumns) {
35
+ setColumns.value = _ideepClone(_cacheSaveColumns);
36
+ return;
37
+ }
38
+ const isChecked = (prop) => {
39
+ const { showHideFields } = props;
40
+ if (Array.isArray(showHideFields) && showHideFields.includes(prop)) return {
41
+ checked: showHideFields.includes(prop),
42
+ prop
43
+ };
44
+ if ((showHideFields === null || showHideFields === void 0 ? void 0 : showHideFields.fields) && (showHideFields === null || showHideFields === void 0 ? void 0 : showHideFields.showFields) && showHideFields.fields.includes(prop)) return {
45
+ checked: showHideFields.fields.includes(prop) && showHideFields.showFields.includes(prop),
46
+ prop
47
+ };
48
+ return true;
49
+ };
50
+ setColumns.value = props === null || props === void 0 ? void 0 : props.columns.map((item) => {
51
+ const isColumnChecked = isChecked(item.prop);
52
+ const checkedValue = typeof isColumnChecked === "boolean" ? isColumnChecked : isColumnChecked.checked;
53
+ return {
54
+ label: item.label,
55
+ prop: item.prop,
56
+ checked: checkedValue,
57
+ disabled: isColumnChecked === true ? true : false
58
+ };
59
+ });
60
+ };
61
+ const getCacheColumns = () => {
62
+ let cacheSetColumns = window.localStorage.getItem(props.tableKey);
63
+ if (!cacheSetColumns) return "";
64
+ try {
65
+ cacheSetColumns = JSON.parse(cacheSetColumns);
66
+ } catch (error) {
67
+ console.error("getCacheColumns 解析失败--", error);
68
+ }
69
+ return cacheSetColumns;
70
+ };
71
+ watch(() => props.columns, () => {
72
+ if (props.showHideFields) {
73
+ getShowHideColumns();
74
+ HandleSetSave();
75
+ } else {
76
+ _columns.value = _ideepClone(props.columns);
77
+ nextTick(() => {
78
+ var _ElTableInstance$valu2;
79
+ (_ElTableInstance$valu2 = ElTableInstance.value) === null || _ElTableInstance$valu2 === void 0 || _ElTableInstance$valu2.doLayout();
80
+ });
81
+ }
82
+ });
83
+ const _showColumn = (column) => {
84
+ if (column.hide && typeof column.hide === "function") return column.hide();
85
+ else return column.show !== false;
86
+ };
87
+ onBeforeMount(() => {
88
+ if (props.showHideFields) {
89
+ getShowHideColumns();
90
+ HandleSetSave();
91
+ }
92
+ });
93
+ return {
94
+ _columns,
95
+ _showColumn,
96
+ setColumns,
97
+ SettingInstance,
98
+ handleSetting,
99
+ HandleSetSave
100
+ };
101
+ };
102
+ function _ideepClone(obj) {
103
+ if (obj === null || typeof obj !== "object") return obj;
104
+ if (Array.isArray(obj)) return obj.map((item) => _ideepClone(item));
105
+ if (obj instanceof Object) {
106
+ const copy = Object.create(Object.getPrototypeOf(obj));
107
+ Object.keys(obj).forEach((key) => {
108
+ copy[key] = _ideepClone(obj[key]);
109
+ });
110
+ return copy;
111
+ }
112
+ throw new Error("Unable to copy obj! Its type isn't supported.");
113
+ }
114
+ //#endregion
115
+ export { useController as default };
116
+
117
+ //# sourceMappingURL=use-controller.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-controller.mjs","names":[],"sources":["../../../../../../packages/components/table/src/use-controller.ts"],"sourcesContent":["import type { TableProps, ColumnsItemProps } from './table'\nimport { ref, onBeforeMount, watch, nextTick } from 'vue'\nconst useController = (props: TableProps, _ElTableInstance: any) => {\n const ElTableInstance: any = _ElTableInstance\n const _columns = ref<any>([])\n let _cacheSaveColumns: any = null\n _columns.value = _ideepClone(props?.columns)\n const setColumns: any = ref([])\n const SettingInstance = ref()\n const handleSetting = () => {\n getShowHideColumns()\n SettingInstance.value.actionDialog()\n }\n const HandleSetSave = () => {\n const newColumns = _ideepClone(props.columns)\n setColumns.value.forEach((item: any) => {\n newColumns?.forEach((column: ColumnsItemProps) => {\n if (item.prop === column.prop) {\n column.show = item.checked\n }\n })\n })\n _columns.value = newColumns\n nextTick(() => {\n ElTableInstance.value?.doLayout()\n })\n if (props.tableKey) {\n window.localStorage.setItem(props.tableKey, JSON.stringify(setColumns.value))\n } else {\n _cacheSaveColumns = _ideepClone(setColumns.value)\n }\n }\n\n const getShowHideColumns = () => {\n const _cacheSetColumns = getCacheColumns()\n if (_cacheSetColumns) {\n setColumns.value = _cacheSetColumns\n return\n } else if (_cacheSaveColumns) {\n setColumns.value = _ideepClone(_cacheSaveColumns)\n return\n }\n const isChecked = (prop: string) => {\n const { showHideFields } = props as any\n if (Array.isArray(showHideFields) && showHideFields.includes(prop)) {\n return {\n checked: showHideFields.includes(prop),\n prop,\n }\n }\n if (showHideFields?.fields && showHideFields?.showFields && showHideFields.fields.includes(prop)) {\n return {\n checked: showHideFields.fields.includes(prop) && showHideFields.showFields.includes(prop),\n prop,\n }\n }\n return true\n }\n const _columns = props?.columns.map((item: ColumnsItemProps) => {\n const isColumnChecked = isChecked(item.prop as string)\n const checkedValue = typeof isColumnChecked === 'boolean' ? isColumnChecked : isColumnChecked.checked\n return {\n label: item.label,\n prop: item.prop,\n checked: checkedValue,\n disabled: isColumnChecked === true ? true : false,\n }\n })\n setColumns.value = _columns\n }\n\n const getCacheColumns = () => {\n let cacheSetColumns = window.localStorage.getItem(props.tableKey) as any\n if (!cacheSetColumns) return ''\n try {\n cacheSetColumns = JSON.parse(cacheSetColumns)\n } catch (error) {\n console.error('getCacheColumns 解析失败--', error)\n }\n return cacheSetColumns\n }\n\n watch(\n () => props.columns,\n () => {\n if (props.showHideFields) {\n getShowHideColumns()\n HandleSetSave()\n } else {\n _columns.value = _ideepClone(props.columns)\n nextTick(() => {\n ElTableInstance.value?.doLayout()\n })\n }\n },\n )\n\n const _showColumn = (column: any) => {\n if (column.hide && typeof column.hide === 'function') {\n return column.hide()\n } else {\n return column.show !== false\n }\n }\n\n onBeforeMount(() => {\n if (props.showHideFields) {\n getShowHideColumns()\n HandleSetSave()\n }\n })\n return {\n _columns,\n _showColumn,\n setColumns,\n SettingInstance,\n handleSetting,\n HandleSetSave,\n }\n}\n\nfunction _ideepClone<T>(obj: T): T {\n if (obj === null || typeof obj !== 'object') {\n return obj\n }\n\n if (Array.isArray(obj)) {\n const copy = obj.map((item) => _ideepClone(item))\n return copy as T\n }\n\n if (obj instanceof Object) {\n const copy = Object.create(Object.getPrototypeOf(obj))\n Object.keys(obj).forEach((key) => {\n ;(copy as any)[key] = _ideepClone((obj as any)[key])\n })\n return copy as T\n }\n\n throw new Error(\"Unable to copy obj! Its type isn't supported.\")\n}\n\nexport default useController\n"],"mappings":"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"}
@@ -0,0 +1,26 @@
1
+ import type { TableProps, UpdatePageParams } from './table.js';
2
+ declare const useTable: (props: TableProps, _ElTableInstance: any, emits: any) => {
3
+ _loading: any;
4
+ cpaginationShow: any;
5
+ isDataEmpty: any;
6
+ _showSummary: any;
7
+ _tdata: any;
8
+ _defaultSort: any;
9
+ _total: any;
10
+ paginationParams: any;
11
+ getTableData: (params?: {}) => Promise<undefined>;
12
+ handleSortChange: (item: {
13
+ prop: string;
14
+ order: string;
15
+ column: any;
16
+ }) => void;
17
+ handleSizeChange: (num: number) => void;
18
+ handlePageChange: (num: number) => void;
19
+ updateTableData: (params?: {}) => void;
20
+ resetTableData: (params: any) => void;
21
+ resetPage: () => void;
22
+ updatePage: (obj: UpdatePageParams) => void;
23
+ getData: () => any;
24
+ clearSort: () => void;
25
+ };
26
+ export default useTable;
@@ -0,0 +1,188 @@
1
+ import { computed, nextTick, onMounted, reactive, ref, watch } from "vue";
2
+ //#region packages/components/table/src/use-table.ts
3
+ var useTable = (props, _ElTableInstance, emits) => {
4
+ var _props$pageSizes$, _props$pageSizes;
5
+ const ElTableInstance = _ElTableInstance;
6
+ const _loading = ref(false);
7
+ const _tableData = ref([]);
8
+ const _tableDataTotal = ref(0);
9
+ const _showSummary = ref(false);
10
+ const paginationParams = reactive({
11
+ currentPage: props.currentPage,
12
+ pageSize: (_props$pageSizes$ = (_props$pageSizes = props.pageSizes) === null || _props$pageSizes === void 0 ? void 0 : _props$pageSizes[0]) !== null && _props$pageSizes$ !== void 0 ? _props$pageSizes$ : props.pageSize
13
+ });
14
+ let resetTableDataParams = {};
15
+ let _sortItem = null;
16
+ const _sortFormat = (item) => {
17
+ if (item && item.order) return {
18
+ sortField: item.prop,
19
+ sortBy: item.order === "descending" ? "desc" : "asc"
20
+ };
21
+ return {};
22
+ };
23
+ const _total = computed(() => {
24
+ return props.requestApi ? _tableDataTotal.value : props.total;
25
+ });
26
+ const _tdata = computed(() => {
27
+ return props.requestApi ? _tableData.value : props.tableData;
28
+ });
29
+ const _lastPage = computed(() => {
30
+ return Math.ceil(_tableDataTotal.value / paginationParams.pageSize) || 1;
31
+ });
32
+ const _defaultSort = computed(() => {
33
+ if (typeof props.defaultSort === "function") return props.defaultSort();
34
+ else if (props.defaultSort) return props.defaultSort;
35
+ else return {
36
+ prop: "",
37
+ order: ""
38
+ };
39
+ });
40
+ const cpaginationShow = computed(() => {
41
+ if (props.paginationHide) return false;
42
+ if (props.paginationHideAuto) {
43
+ const minPageSize = props.pageSizes && props.pageSizes[0] || props.pageSize;
44
+ return _total.value >= minPageSize;
45
+ }
46
+ return true;
47
+ });
48
+ const isDataEmpty = computed(() => {
49
+ return props.requestApi ? _tableData.value.length : props.tableData.length;
50
+ });
51
+ const _sortFun = props.sortFormat || _sortFormat;
52
+ const _sortFieldFormat = (sort) => {
53
+ const curSort = sort || _sortItem || _defaultSort.value;
54
+ if (curSort) return _sortFun(curSort);
55
+ return {};
56
+ };
57
+ const getTableData = async (params = {}) => {
58
+ if (!props.requestApi || typeof props.requestApi !== "function") return;
59
+ _loading.value = props.requestLoadingHide ? false : true;
60
+ let _requestParams = props.requestParams;
61
+ if (typeof props.requestParams === "function") _requestParams = props.requestParams();
62
+ const _params = {
63
+ ..._sortFieldFormat(),
64
+ ...resetTableDataParams,
65
+ ..._requestParams,
66
+ ...params
67
+ };
68
+ if (!props.paginationHide) {
69
+ _params[props.currentPageKey] = props.pageLimit === 0 ? paginationParams.currentPage - 1 : paginationParams.currentPage;
70
+ _params[props.pageSizeKey] = paginationParams.pageSize;
71
+ }
72
+ try {
73
+ let result = await props.requestApi(_params) || [];
74
+ _loading.value = false;
75
+ if (props.dataCallback && typeof props.dataCallback === "function") result = props.dataCallback(result);
76
+ if (Array.isArray(result)) {
77
+ _tableData.value = result;
78
+ _tableDataTotal.value = 0;
79
+ } else {
80
+ _tableData.value = result[props.dataKey] || [];
81
+ _tableDataTotal.value = result.total || 0;
82
+ }
83
+ await nextTick();
84
+ props.dataUpdateAfter(_params, result);
85
+ } catch (error) {
86
+ _loading.value = false;
87
+ console.error("表格请求数据发生错误...");
88
+ return Promise.reject(error);
89
+ } finally {
90
+ resetTableDataParams = {};
91
+ }
92
+ };
93
+ const handlePaginationChange = (type, num) => {
94
+ if (type === "size") {
95
+ paginationParams.currentPage = 1;
96
+ paginationParams.pageSize = num;
97
+ }
98
+ emits("on-table", type, {
99
+ currentPage: paginationParams.currentPage,
100
+ pageSize: type === "size" ? num : paginationParams.pageSize
101
+ }, _sortItem);
102
+ if (props.tableChange && typeof props.tableChange === "function") props.tableChange(type, num);
103
+ if (props.tableActionIsCallApi) getTableData();
104
+ };
105
+ const handleSizeChange = (num) => {
106
+ handlePaginationChange("size", num);
107
+ };
108
+ const handlePageChange = (num) => {
109
+ handlePaginationChange("page", num);
110
+ };
111
+ const handleSortChange = (item) => {
112
+ _sortItem = item && item.order ? item : null;
113
+ paginationParams.currentPage = 1;
114
+ emits("on-table", "sort", item);
115
+ if (props.tableChange && typeof props.tableChange === "function") props.tableChange("sort", item);
116
+ if (props.tableActionIsCallApi && !props.tableChange) getTableData(_sortFieldFormat(item));
117
+ };
118
+ const updateTableData = (params = {}) => {
119
+ getTableData(params);
120
+ };
121
+ const resetTableData = (params) => {
122
+ paginationParams.currentPage = 1;
123
+ if (props.defaultSort) {
124
+ if (params) resetTableDataParams = params;
125
+ try {
126
+ ElTableInstance.value.sort(_defaultSort.value.prop, _defaultSort.value.order);
127
+ } catch (error) {
128
+ console.error(error);
129
+ }
130
+ } else getTableData(params);
131
+ };
132
+ const resetPage = () => {
133
+ var _props$pageSizes$2, _props$pageSizes2;
134
+ paginationParams.currentPage = 1;
135
+ paginationParams.pageSize = (_props$pageSizes$2 = (_props$pageSizes2 = props.pageSizes) === null || _props$pageSizes2 === void 0 ? void 0 : _props$pageSizes2[0]) !== null && _props$pageSizes$2 !== void 0 ? _props$pageSizes$2 : props.pageSize;
136
+ };
137
+ const updatePage = (obj) => {
138
+ var _obj$currentPage, _obj$pageSize;
139
+ paginationParams.currentPage = (_obj$currentPage = obj.currentPage) !== null && _obj$currentPage !== void 0 ? _obj$currentPage : paginationParams.currentPage;
140
+ paginationParams.pageSize = (_obj$pageSize = obj.pageSize) !== null && _obj$pageSize !== void 0 ? _obj$pageSize : paginationParams.pageSize;
141
+ };
142
+ const clearSort = () => {
143
+ var _ElTableInstance$valu;
144
+ _sortItem = null;
145
+ (_ElTableInstance$valu = ElTableInstance.value) === null || _ElTableInstance$valu === void 0 || _ElTableInstance$valu.clearSort();
146
+ };
147
+ const getData = () => {
148
+ return _tableData.value;
149
+ };
150
+ watch(() => _tdata.value, () => {
151
+ if (_tdata.value && !_tdata.value.length && _lastPage.value === paginationParams.currentPage - 1 && paginationParams.currentPage > 1) {
152
+ updatePage({
153
+ ...paginationParams,
154
+ currentPage: paginationParams.currentPage - 1
155
+ });
156
+ updateTableData();
157
+ }
158
+ });
159
+ onMounted(() => {
160
+ var _ElTableInstance$valu2;
161
+ _showSummary.value = (_ElTableInstance$valu2 = ElTableInstance.value) === null || _ElTableInstance$valu2 === void 0 ? void 0 : _ElTableInstance$valu2.showSummary;
162
+ if (props.requestAuto) getTableData();
163
+ });
164
+ return {
165
+ _loading,
166
+ cpaginationShow,
167
+ isDataEmpty,
168
+ _showSummary,
169
+ _tdata,
170
+ _defaultSort,
171
+ _total,
172
+ paginationParams,
173
+ getTableData,
174
+ handleSortChange,
175
+ handleSizeChange,
176
+ handlePageChange,
177
+ updateTableData,
178
+ resetTableData,
179
+ resetPage,
180
+ updatePage,
181
+ getData,
182
+ clearSort
183
+ };
184
+ };
185
+ //#endregion
186
+ export { useTable as default };
187
+
188
+ //# sourceMappingURL=use-table.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-table.mjs","names":[],"sources":["../../../../../../packages/components/table/src/use-table.ts"],"sourcesContent":["import type { TableProps, UpdatePageParams } from './table'\nimport { ref, onMounted, computed, watch, nextTick, reactive } from 'vue'\nconst useTable = (props: TableProps, _ElTableInstance: any, emits: any) => {\n const ElTableInstance: any = _ElTableInstance\n const _loading = ref(false)\n const _tableData = ref<any>([])\n const _tableDataTotal = ref(0)\n const _showSummary = ref(false)\n const paginationParams = reactive({\n currentPage: props.currentPage,\n pageSize: props.pageSizes?.[0] ?? props.pageSize,\n })\n let resetTableDataParams = {}\n let _sortItem: any = null\n const _sortFormat = (item?: any) => {\n if (item && item.order) {\n return {\n sortField: item.prop,\n sortBy: item.order === 'descending' ? 'desc' : 'asc',\n }\n }\n return {}\n }\n\n const _total = computed(() => {\n return props.requestApi ? _tableDataTotal.value : props.total\n })\n\n const _tdata = computed(() => {\n return props.requestApi ? _tableData.value : props.tableData\n })\n\n const _lastPage = computed(() => {\n return Math.ceil(_tableDataTotal.value / paginationParams.pageSize) || 1\n })\n const _defaultSort = computed(() => {\n if (typeof props.defaultSort === 'function') {\n return props.defaultSort()\n } else if (props.defaultSort) {\n return props.defaultSort\n } else {\n return { prop: '', order: '' }\n }\n })\n\n const cpaginationShow = computed(() => {\n // 如果明确设置了隐藏分页,则不显示\n if (props.paginationHide) {\n return false\n }\n\n // 如果设置了自动隐藏,则只在总数大于1页时显示\n if (props.paginationHideAuto) {\n const minPageSize = (props.pageSizes && props.pageSizes[0]) || props.pageSize\n return _total.value >= minPageSize\n }\n\n // 默认显示分页\n return true\n })\n\n const isDataEmpty = computed(() => {\n return props.requestApi ? _tableData.value.length : props.tableData.length\n })\n const _sortFun = props.sortFormat || _sortFormat\n const _sortFieldFormat = (sort?: any) => {\n const curSort = sort || _sortItem || _defaultSort.value\n if (curSort) {\n return _sortFun(curSort)\n }\n return {}\n }\n\n const getTableData = async (params = {}) => {\n if (!props.requestApi || typeof props.requestApi !== 'function') return\n _loading.value = props.requestLoadingHide ? false : true\n let _requestParams = props.requestParams\n if (typeof props.requestParams === 'function') {\n _requestParams = props.requestParams()\n }\n const _params: any = {\n ..._sortFieldFormat(),\n ...resetTableDataParams,\n ..._requestParams,\n ...params,\n }\n if (!props.paginationHide) {\n _params[props.currentPageKey] =\n props.pageLimit === 0 ? paginationParams.currentPage - 1 : paginationParams.currentPage\n _params[props.pageSizeKey] = paginationParams.pageSize\n }\n try {\n let result = (await props.requestApi(_params)) || []\n _loading.value = false\n if (props.dataCallback && typeof props.dataCallback === 'function') {\n result = props.dataCallback(result)\n }\n if (Array.isArray(result)) {\n _tableData.value = result\n _tableDataTotal.value = 0\n } else {\n _tableData.value = result[props.dataKey] || []\n _tableDataTotal.value = result.total || 0\n }\n await nextTick()\n props.dataUpdateAfter(_params, result)\n } catch (error) {\n _loading.value = false\n console.error('表格请求数据发生错误...')\n return Promise.reject(error)\n } finally {\n resetTableDataParams = {}\n }\n }\n\n const handlePaginationChange = (type: 'size' | 'page' | 'sort', num: number): void => {\n if (type === 'size') {\n paginationParams.currentPage = 1 // 只有在改变大小时才重置当前页码\n paginationParams.pageSize = num\n }\n emits(\n 'on-table',\n type,\n {\n currentPage: paginationParams.currentPage,\n pageSize: type === 'size' ? num : paginationParams.pageSize,\n },\n _sortItem,\n )\n\n // 如果不需要通过API请求数据,则直接调用tableChange\n if (props.tableChange && typeof props.tableChange === 'function') {\n props.tableChange(type, num)\n }\n\n if (props.tableActionIsCallApi) {\n getTableData()\n }\n }\n\n // 用于分页大小变化\n const handleSizeChange = (num: number): void => {\n handlePaginationChange('size', num)\n }\n\n // 用于分页页码变化\n const handlePageChange = (num: number) => {\n handlePaginationChange('page', num)\n }\n\n // 用于表格排序\n const handleSortChange = (item: { prop: string; order: string; column: any }) => {\n _sortItem = item && item.order ? item : null\n paginationParams.currentPage = 1\n emits('on-table', 'sort', item)\n // 为了兼容以前旧的 api\n if (props.tableChange && typeof props.tableChange === 'function') {\n props.tableChange('sort', item)\n }\n // 如果设置为调用API,则获取表格数据\n if (props.tableActionIsCallApi && !props.tableChange) {\n getTableData(_sortFieldFormat(item))\n }\n }\n\n const updateTableData = (params = {}) => {\n getTableData(params)\n }\n\n const resetTableData = (params: any) => {\n paginationParams.currentPage = 1\n if (props.defaultSort) {\n if (params) {\n resetTableDataParams = params\n }\n try {\n ElTableInstance.value.sort(_defaultSort.value.prop, _defaultSort.value.order)\n } catch (error) {\n console.error(error)\n }\n } else {\n getTableData(params)\n }\n }\n\n const resetPage = () => {\n paginationParams.currentPage = 1\n paginationParams.pageSize = props.pageSizes?.[0] ?? props.pageSize\n }\n\n const updatePage = (obj: UpdatePageParams) => {\n paginationParams.currentPage = obj.currentPage ?? paginationParams.currentPage\n paginationParams.pageSize = obj.pageSize ?? paginationParams.pageSize\n }\n\n const clearSort = () => {\n _sortItem = null\n ElTableInstance.value?.clearSort()\n }\n const getData = () => {\n return _tableData.value\n }\n\n watch(\n () => _tdata.value,\n () => {\n if (\n _tdata.value &&\n !_tdata.value.length &&\n _lastPage.value === paginationParams.currentPage - 1 &&\n paginationParams.currentPage > 1\n ) {\n updatePage({ ...paginationParams, currentPage: paginationParams.currentPage - 1 })\n updateTableData()\n }\n },\n )\n\n onMounted(() => {\n _showSummary.value = ElTableInstance.value?.showSummary\n if (props.requestAuto) {\n getTableData()\n }\n })\n return {\n _loading,\n cpaginationShow,\n isDataEmpty,\n _showSummary,\n _tdata,\n _defaultSort,\n _total,\n paginationParams,\n getTableData,\n handleSortChange,\n handleSizeChange,\n handlePageChange,\n updateTableData,\n resetTableData,\n resetPage,\n updatePage,\n getData,\n clearSort,\n }\n}\nexport default useTable\n"],"mappings":"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"}
@@ -0,0 +1 @@
1
+ import '../src/table.scss';
@@ -0,0 +1,6 @@
1
+ import TableEditor from './src/table-editor.vue.js';
2
+ import type { SFCWithInstall } from '../../utils/index.js';
3
+ export declare const HdTableEditor: SFCWithInstall<typeof TableEditor>;
4
+ export default HdTableEditor;
5
+ export * from './src/table-editor.js';
6
+ export type { TableEditorInstance } from './src/instance.js';
@@ -0,0 +1,9 @@
1
+ import { withInstall } from "../../utils/vue/install.mjs";
2
+ import { tableEditorEmits, tableEditorProps } from "./src/table-editor.mjs";
3
+ import table_editor_default from "./src/table-editor.vue.mjs";
4
+ //#region packages/components/table-editor/index.ts
5
+ var HdTableEditor = withInstall(table_editor_default);
6
+ //#endregion
7
+ export { HdTableEditor, HdTableEditor as default, tableEditorEmits, tableEditorProps };
8
+
9
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../../../../../packages/components/table-editor/index.ts"],"sourcesContent":["import { withInstall } from '@hd-custom/utils'\n\nimport TableEditor from './src/table-editor.vue'\nimport type { SFCWithInstall } from '@hd-custom/utils'\n\nexport const HdTableEditor: SFCWithInstall<typeof TableEditor> = withInstall(TableEditor)\nexport default HdTableEditor\n\nexport * from './src/table-editor'\nexport type { TableEditorInstance } from './src/instance'\n"],"mappings":";;;;AAKA,IAAa,gBAAoD,YAAY,qBAAY"}
@@ -0,0 +1,15 @@
1
+ import { ITableEditorAnyObject } from '../table-editor.js';
2
+ import { PropType } from 'vue';
3
+ declare const _default: typeof __VLS_export;
4
+ export default _default;
5
+ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
6
+ config: {
7
+ type: PropType<ITableEditorAnyObject>;
8
+ required: true;
9
+ };
10
+ }>, (() => import("vue/jsx-runtime").JSX.Element) | undefined, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
11
+ config: {
12
+ type: PropType<ITableEditorAnyObject>;
13
+ required: true;
14
+ };
15
+ }>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -0,0 +1,7 @@
1
+ import BaseItem_vue_vue_type_script_lang_default from "./BaseItem.vue_vue_type_script_lang.mjs";
2
+ //#region packages/components/table-editor/src/components/BaseItem.vue
3
+ var BaseItem_default = BaseItem_vue_vue_type_script_lang_default;
4
+ //#endregion
5
+ export { BaseItem_default as default };
6
+
7
+ //# sourceMappingURL=BaseItem.vue.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BaseItem.vue.mjs","names":[],"sources":["../../../../../../../packages/components/table-editor/src/components/BaseItem.vue"],"sourcesContent":["<script lang=\"tsx\">\nimport { ITableEditorAnyObject } from '../table-editor'\nimport { ElInput, ElSelect, ElTreeSelect, ElDatePicker, ElTimePicker, ElSwitch, ElTimeSelect } from 'element-plus'\nimport { defineComponent, PropType } from 'vue'\n\nconst _elNameMap: ITableEditorAnyObject = {\n input: ElInput,\n select: ElSelect,\n 'tree-select': ElTreeSelect,\n 'date-picker': ElDatePicker,\n 'time-picker': ElTimePicker,\n 'time-select': ElTimeSelect,\n switch: ElSwitch,\n checkbox: 'ElCheckbox',\n cascader: 'ElCascader',\n autocomplete: 'ElAutocomplete',\n}\n\nexport default defineComponent({\n props: {\n config: {\n type: Object as PropType<ITableEditorAnyObject>,\n required: true,\n },\n },\n setup(props) {\n const { itemType, placeholder } = props?.config || {}\n if (!itemType) return\n // const elName: any = _elNameMap[itemType]\n if (itemType) {\n const ElInputComponent = _elNameMap[itemType]\n const inPlaceholder = placeholder || props.config.type === 'input' ? '请输入' : '请选择'\n const itemConfig = {\n options: props?.config?.options,\n }\n const inConfig = props?.config.itemProps || {}\n return () => (\n <ElInputComponent clearable {...itemConfig} {...inConfig} placeholder={inPlaceholder}></ElInputComponent>\n )\n } else {\n console.error('table-edit组件类型不存在')\n }\n },\n})\n</script>\n"],"mappings":""}
@@ -0,0 +1,37 @@
1
+ import { createVNode, defineComponent, mergeProps } from "vue";
2
+ import { ElDatePicker, ElInput, ElSelect, ElSwitch, ElTimePicker, ElTimeSelect, ElTreeSelect } from "element-plus";
3
+ //#region packages/components/table-editor/src/components/BaseItem.vue?vue&type=script&lang.tsx
4
+ var _elNameMap = {
5
+ input: ElInput,
6
+ select: ElSelect,
7
+ "tree-select": ElTreeSelect,
8
+ "date-picker": ElDatePicker,
9
+ "time-picker": ElTimePicker,
10
+ "time-select": ElTimeSelect,
11
+ switch: ElSwitch,
12
+ checkbox: "ElCheckbox",
13
+ cascader: "ElCascader",
14
+ autocomplete: "ElAutocomplete"
15
+ };
16
+ var BaseItem_vue_vue_type_script_lang_default = /* @__PURE__ */ defineComponent({
17
+ props: { config: {
18
+ type: Object,
19
+ required: true
20
+ } },
21
+ setup(props) {
22
+ const { itemType, placeholder } = (props === null || props === void 0 ? void 0 : props.config) || {};
23
+ if (!itemType) return;
24
+ if (itemType) {
25
+ var _props$config;
26
+ const ElInputComponent = _elNameMap[itemType];
27
+ const inPlaceholder = placeholder || props.config.type === "input" ? "请输入" : "请选择";
28
+ const itemConfig = { options: props === null || props === void 0 || (_props$config = props.config) === null || _props$config === void 0 ? void 0 : _props$config.options };
29
+ const inConfig = (props === null || props === void 0 ? void 0 : props.config.itemProps) || {};
30
+ return () => createVNode(ElInputComponent, mergeProps({ "clearable": true }, itemConfig, inConfig, { "placeholder": inPlaceholder }), null);
31
+ } else console.error("table-edit组件类型不存在");
32
+ }
33
+ });
34
+ //#endregion
35
+ export { BaseItem_vue_vue_type_script_lang_default as default };
36
+
37
+ //# sourceMappingURL=BaseItem.vue_vue_type_script_lang.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BaseItem.vue_vue_type_script_lang.mjs","names":[],"sources":["../../../../../../../packages/components/table-editor/src/components/BaseItem.vue"],"sourcesContent":["<script lang=\"tsx\">\nimport { ITableEditorAnyObject } from '../table-editor'\nimport { ElInput, ElSelect, ElTreeSelect, ElDatePicker, ElTimePicker, ElSwitch, ElTimeSelect } from 'element-plus'\nimport { defineComponent, PropType } from 'vue'\n\nconst _elNameMap: ITableEditorAnyObject = {\n input: ElInput,\n select: ElSelect,\n 'tree-select': ElTreeSelect,\n 'date-picker': ElDatePicker,\n 'time-picker': ElTimePicker,\n 'time-select': ElTimeSelect,\n switch: ElSwitch,\n checkbox: 'ElCheckbox',\n cascader: 'ElCascader',\n autocomplete: 'ElAutocomplete',\n}\n\nexport default defineComponent({\n props: {\n config: {\n type: Object as PropType<ITableEditorAnyObject>,\n required: true,\n },\n },\n setup(props) {\n const { itemType, placeholder } = props?.config || {}\n if (!itemType) return\n // const elName: any = _elNameMap[itemType]\n if (itemType) {\n const ElInputComponent = _elNameMap[itemType]\n const inPlaceholder = placeholder || props.config.type === 'input' ? '请输入' : '请选择'\n const itemConfig = {\n options: props?.config?.options,\n }\n const inConfig = props?.config.itemProps || {}\n return () => (\n <ElInputComponent clearable {...itemConfig} {...inConfig} placeholder={inPlaceholder}></ElInputComponent>\n )\n } else {\n console.error('table-edit组件类型不存在')\n }\n },\n})\n</script>\n"],"mappings":";;;AAKA,IAAM,aAAoC;CACxC,OAAO;CACP,QAAQ;CACR,eAAe;CACf,eAAe;CACf,eAAe;CACf,eAAe;CACf,QAAQ;CACR,UAAU;CACV,UAAU;CACV,cAAc;CAChB;AAEA,IAAA,4CAAe,gCAAgB;CAC7B,OAAO,EACL,QAAQ;EACN,MAAM;EACN,UAAU;EACZ,EACD;CACD,MAAM,OAAO;EACX,MAAM,EAAE,UAAU,iBAAA,UAAA,QAAA,UAAA,KAAA,IAAA,KAAA,IAAgB,MAAO,WAAU,EAAC;AACpD,MAAI,CAAC,SAAU;AAEf,MAAI,UAAU;;GACZ,MAAM,mBAAmB,WAAW;GACpC,MAAM,gBAAgB,eAAe,MAAM,OAAO,SAAS,UAAU,QAAQ;GAC7E,MAAM,aAAa,EACjB,SAAA,UAAA,QAAA,UAAA,KAAA,MAAA,gBAAS,MAAO,YAAA,QAAA,kBAAA,KAAA,IAAA,KAAA,IAAA,cAAQ,SAC1B;GACA,MAAM,YAAA,UAAA,QAAA,UAAA,KAAA,IAAA,KAAA,IAAW,MAAO,OAAO,cAAa,EAAC;AAC7C,gBAAO,YAAA,kBAAA,WAAA,EAAA,aAAA,MAAA,EAC2B,YAAgB,UAAQ,EAAA,eAAe,eAAa,CAAA,EAAA,KACtF;QAEA,SAAQ,MAAM,oBAAmB;;CAGtC,CAAA"}
@@ -0,0 +1,2 @@
1
+ import type TableEditor from './table-editor.vue.js';
2
+ export type TableEditorInstance = InstanceType<typeof TableEditor>;
File without changes
@@ -0,0 +1,45 @@
1
+ import type { ExtractPropTypes, PropType } from 'vue';
2
+ export interface ITableEditorAnyObject {
3
+ [key: string]: any;
4
+ }
5
+ export interface IColumn {
6
+ itemType: IItemType;
7
+ label?: string;
8
+ prop: string;
9
+ disabled?: (row: ITableEditorAnyObject) => boolean | boolean;
10
+ isHidden?: (row: ITableEditorAnyObject) => boolean | boolean;
11
+ formateText?: (row: ITableEditorAnyObject) => string;
12
+ [key: string]: any;
13
+ }
14
+ type IItemType = 'input' | 'select' | 'tree-select' | 'date-picker' | 'time-picker' | 'time-select' | 'switch' | 'checkbox' | 'cascader' | 'autocomplete';
15
+ export declare const tableEditorProps: {
16
+ columns: {
17
+ readonly type: PropType<IColumn[]>;
18
+ readonly required: false;
19
+ readonly validator: ((val: unknown) => boolean) | undefined;
20
+ __hdPropKey: true;
21
+ };
22
+ setProp: {
23
+ readonly type: PropType<(prop: string, value: any) => string>;
24
+ readonly required: false;
25
+ readonly validator: ((val: unknown) => boolean) | undefined;
26
+ __hdPropKey: true;
27
+ };
28
+ setRules: {
29
+ readonly type: PropType<(prop: string, value: any) => ITableEditorAnyObject>;
30
+ readonly required: false;
31
+ readonly validator: ((val: unknown) => boolean) | undefined;
32
+ __hdPropKey: true;
33
+ };
34
+ operateWidth: {
35
+ readonly type: PropType<number>;
36
+ readonly required: false;
37
+ readonly validator: ((val: unknown) => boolean) | undefined;
38
+ __hdPropKey: true;
39
+ };
40
+ disabled: import("../../../utils/index.js").EpPropFinalized<BooleanConstructor, unknown, unknown, boolean, boolean>;
41
+ readonly: import("../../../utils/index.js").EpPropFinalized<BooleanConstructor, unknown, unknown, boolean, boolean>;
42
+ };
43
+ export declare const tableEditorEmits: never[];
44
+ export type TableEditorProps = ExtractPropTypes<typeof tableEditorProps>;
45
+ export {};
@@ -0,0 +1,24 @@
1
+ import { buildProps } from "../../../utils/vue/props/runtime.mjs";
2
+ //#region packages/components/table-editor/src/table-editor.ts
3
+ var tableEditorProps = buildProps({
4
+ columns: {
5
+ type: Array,
6
+ required: true
7
+ },
8
+ setProp: { type: Function },
9
+ setRules: { type: Function },
10
+ operateWidth: { type: Number },
11
+ disabled: {
12
+ type: Boolean,
13
+ default: false
14
+ },
15
+ readonly: {
16
+ type: Boolean,
17
+ default: false
18
+ }
19
+ });
20
+ var tableEditorEmits = [];
21
+ //#endregion
22
+ export { tableEditorEmits, tableEditorProps };
23
+
24
+ //# sourceMappingURL=table-editor.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"table-editor.mjs","names":[],"sources":["../../../../../../packages/components/table-editor/src/table-editor.ts"],"sourcesContent":["import type { ExtractPropTypes, PropType } from 'vue'\nimport { buildProps } from '@hd-custom/utils'\n\nexport interface ITableEditorAnyObject {\n [key: string]: any\n}\n\nexport interface IColumn {\n itemType: IItemType\n label?: string\n prop: string\n disabled?: (row: ITableEditorAnyObject) => boolean | boolean // 是否禁用\n isHidden?: (row: ITableEditorAnyObject) => boolean | boolean // 是否隐藏\n formateText?: (row: ITableEditorAnyObject) => string // 只读状态下格式化文本\n [key: string]: any\n}\n\ntype IItemType =\n | 'input'\n | 'select'\n | 'tree-select'\n | 'date-picker'\n | 'time-picker'\n | 'time-select'\n | 'switch'\n | 'checkbox'\n | 'cascader'\n | 'autocomplete'\n\nexport const tableEditorProps = buildProps({\n columns: {\n type: Array as PropType<IColumn[]>,\n required: true,\n },\n setProp: {\n type: Function as PropType<(prop: string, value: any) => string>,\n },\n setRules: {\n type: Function as PropType<(prop: string, value: any) => ITableEditorAnyObject>,\n },\n operateWidth: {\n type: Number,\n },\n disabled: {\n type: Boolean,\n default: false,\n },\n readonly: {\n type: Boolean,\n default: false,\n },\n})\n\nexport const tableEditorEmits = []\n\nexport type TableEditorProps = ExtractPropTypes<typeof tableEditorProps>\n"],"mappings":";;AA6BA,IAAa,mBAAmB,WAAW;CACzC,SAAS;EACP,MAAM;EACN,UAAU;EACX;CACD,SAAS,EACP,MAAM,UACP;CACD,UAAU,EACR,MAAM,UACP;CACD,cAAc,EACZ,MAAM,QACP;CACD,UAAU;EACR,MAAM;EACN,SAAS;EACV;CACD,UAAU;EACR,MAAM;EACN,SAAS;EACV;CACF,CAAC;AAEF,IAAa,mBAAmB,EAAE"}
@@ -0,0 +1,82 @@
1
+ import { IColumn, ITableEditorAnyObject } from './table-editor.js';
2
+ declare var __VLS_16: `${any}-cell`, __VLS_17: {
3
+ row: any;
4
+ }, __VLS_26: any, __VLS_27: {
5
+ row: any;
6
+ }, __VLS_41: {
7
+ row: any;
8
+ index: any;
9
+ };
10
+ type __VLS_Slots = {} & {
11
+ [K in NonNullable<typeof __VLS_16>]?: (props: typeof __VLS_17) => any;
12
+ } & {
13
+ [K in NonNullable<typeof __VLS_26>]?: (props: typeof __VLS_27) => any;
14
+ } & {
15
+ operate?: (props: typeof __VLS_41) => any;
16
+ };
17
+ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
18
+ columns: {
19
+ readonly type: import("vue").PropType<IColumn[]>;
20
+ readonly required: false;
21
+ readonly validator: ((val: unknown) => boolean) | undefined;
22
+ __hdPropKey: true;
23
+ };
24
+ setProp: {
25
+ readonly type: import("vue").PropType<(prop: string, value: any) => string>;
26
+ readonly required: false;
27
+ readonly validator: ((val: unknown) => boolean) | undefined;
28
+ __hdPropKey: true;
29
+ };
30
+ setRules: {
31
+ readonly type: import("vue").PropType<(prop: string, value: any) => ITableEditorAnyObject>;
32
+ readonly required: false;
33
+ readonly validator: ((val: unknown) => boolean) | undefined;
34
+ __hdPropKey: true;
35
+ };
36
+ operateWidth: {
37
+ readonly type: import("vue").PropType<number>;
38
+ readonly required: false;
39
+ readonly validator: ((val: unknown) => boolean) | undefined;
40
+ __hdPropKey: true;
41
+ };
42
+ disabled: import("../../../utils/index.js").EpPropFinalized<BooleanConstructor, unknown, unknown, boolean, boolean>;
43
+ readonly: import("../../../utils/index.js").EpPropFinalized<BooleanConstructor, unknown, unknown, boolean, boolean>;
44
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
45
+ columns: {
46
+ readonly type: import("vue").PropType<IColumn[]>;
47
+ readonly required: false;
48
+ readonly validator: ((val: unknown) => boolean) | undefined;
49
+ __hdPropKey: true;
50
+ };
51
+ setProp: {
52
+ readonly type: import("vue").PropType<(prop: string, value: any) => string>;
53
+ readonly required: false;
54
+ readonly validator: ((val: unknown) => boolean) | undefined;
55
+ __hdPropKey: true;
56
+ };
57
+ setRules: {
58
+ readonly type: import("vue").PropType<(prop: string, value: any) => ITableEditorAnyObject>;
59
+ readonly required: false;
60
+ readonly validator: ((val: unknown) => boolean) | undefined;
61
+ __hdPropKey: true;
62
+ };
63
+ operateWidth: {
64
+ readonly type: import("vue").PropType<number>;
65
+ readonly required: false;
66
+ readonly validator: ((val: unknown) => boolean) | undefined;
67
+ __hdPropKey: true;
68
+ };
69
+ disabled: import("../../../utils/index.js").EpPropFinalized<BooleanConstructor, unknown, unknown, boolean, boolean>;
70
+ readonly: import("../../../utils/index.js").EpPropFinalized<BooleanConstructor, unknown, unknown, boolean, boolean>;
71
+ }>> & Readonly<{}>, {
72
+ disabled: import("../../../utils/index.js").EpPropMergeType<BooleanConstructor, unknown, unknown>;
73
+ readonly: import("../../../utils/index.js").EpPropMergeType<BooleanConstructor, unknown, unknown>;
74
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
75
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
76
+ declare const _default: typeof __VLS_export;
77
+ export default _default;
78
+ type __VLS_WithSlots<T, S> = T & {
79
+ new (): {
80
+ $slots: S;
81
+ };
82
+ };
@@ -0,0 +1,7 @@
1
+ import table_editor_vue_vue_type_script_setup_true_lang_default from "./table-editor.vue_vue_type_script_setup_true_lang.mjs";
2
+ //#region packages/components/table-editor/src/table-editor.vue
3
+ var table_editor_default = table_editor_vue_vue_type_script_setup_true_lang_default;
4
+ //#endregion
5
+ export { table_editor_default as default };
6
+
7
+ //# sourceMappingURL=table-editor.vue.mjs.map