@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 @@
1
+ {"version":3,"file":"iempty.mjs","names":[],"sources":["../../../../../../packages/components/empty/src/iempty.ts"],"sourcesContent":["import type { ExtractPropTypes } from 'vue'\n\nexport const emptyProps = {\n size: {\n type: String,\n default: 'small',\n },\n largeSize: {\n type: Object,\n default: () => ({ width: '240px', height: '120px' }),\n },\n smallSize: {\n type: Object,\n default: () => ({ width: '120px', height: '60px' }),\n },\n miniSize: {\n type: Object,\n default: () => ({ width: '80px', height: '40px' }),\n },\n desc: {\n type: String,\n default: '暂无数据',\n },\n hidesc: {\n type: Boolean,\n default: false,\n },\n hideImg: {\n type: Boolean,\n default: false,\n },\n}\n\nexport type EmptyProps = ExtractPropTypes<typeof emptyProps>\n"],"mappings":";AAEA,IAAa,aAAa;CACxB,MAAM;EACJ,MAAM;EACN,SAAS;EACV;CACD,WAAW;EACT,MAAM;EACN,gBAAgB;GAAE,OAAO;GAAS,QAAQ;GAAS;EACpD;CACD,WAAW;EACT,MAAM;EACN,gBAAgB;GAAE,OAAO;GAAS,QAAQ;GAAQ;EACnD;CACD,UAAU;EACR,MAAM;EACN,gBAAgB;GAAE,OAAO;GAAQ,QAAQ;GAAQ;EAClD;CACD,MAAM;EACJ,MAAM;EACN,SAAS;EACV;CACD,QAAQ;EACN,MAAM;EACN,SAAS;EACV;CACD,SAAS;EACP,MAAM;EACN,SAAS;EACV;CACF"}
@@ -0,0 +1,2 @@
1
+ import type Empty from './empty.js';
2
+ export type EmptyInstance = InstanceType<typeof Empty>;
File without changes
@@ -0,0 +1 @@
1
+ import '../src/empty.scss';
@@ -0,0 +1,16 @@
1
+ export * from './date-picker/index.js';
2
+ export * from './descriptions/index.js';
3
+ export * from './ellipsis-tag/index.js';
4
+ export * from './empty/index.js';
5
+ export * from './jdata-viewer/index.js';
6
+ export * from './radio/index.js';
7
+ export * from './remote-search/index.js';
8
+ export * from './search-form/index.js';
9
+ export * from './sticky-container/index.js';
10
+ export * from './table/index.js';
11
+ export * from './table-editor/index.js';
12
+ export * from './tabs/index.js';
13
+ export * from './tarea-tag/index.js';
14
+ export * from './text-ellipsis/index.js';
15
+ export * from './time-line/index.js';
16
+ export * from './uploader/index.js';
@@ -0,0 +1,33 @@
1
+ import { datePickerEmits, datePickerProps } from "./date-picker/src/date-picker.mjs";
2
+ import { HdDatePicker } from "./date-picker/index.mjs";
3
+ import { descriptionsProps } from "./descriptions/src/idescriptions.mjs";
4
+ import { HdDescriptions } from "./descriptions/index.mjs";
5
+ import { ellipsisTagProps } from "./ellipsis-tag/src/ellipsis-tag.mjs";
6
+ import { HdEllipsisTag } from "./ellipsis-tag/index.mjs";
7
+ import { emptyProps } from "./empty/src/iempty.mjs";
8
+ import { HdEmpty } from "./empty/index.mjs";
9
+ import { jdataViewerProps } from "./jdata-viewer/src/ijdata-viewer.mjs";
10
+ import { HdJdataViewer } from "./jdata-viewer/index.mjs";
11
+ import { radioEmits, radioProps } from "./radio/src/radio.mjs";
12
+ import { HdRadio } from "./radio/index.mjs";
13
+ import { remoteSearchEmits, remoteSearchProps } from "./remote-search/src/iremote-search.mjs";
14
+ import { HdRemoteSearch } from "./remote-search/index.mjs";
15
+ import { searchFormEmits, searchFormProps } from "./search-form/src/isearch-form.mjs";
16
+ import { HdSearchForm } from "./search-form/index.mjs";
17
+ import { stickyContainerEmits, stickyContainerProps } from "./sticky-container/src/isticky-container.mjs";
18
+ import { HdStickyContainer } from "./sticky-container/index.mjs";
19
+ import { tableEmits, tableProps } from "./table/src/table.mjs";
20
+ import { HdTable } from "./table/index.mjs";
21
+ import { tableEditorEmits, tableEditorProps } from "./table-editor/src/table-editor.mjs";
22
+ import { HdTableEditor } from "./table-editor/index.mjs";
23
+ import { tabsEmits, tabsProps } from "./tabs/src/itabs.mjs";
24
+ import { HdTabs } from "./tabs/index.mjs";
25
+ import { tareaTagEmits, tareaTagProps } from "./tarea-tag/src/tarea-tag.mjs";
26
+ import { HdTareaTag } from "./tarea-tag/index.mjs";
27
+ import { textEllipsisEmits, textEllipsisProps } from "./text-ellipsis/src/itext-ellipsis.mjs";
28
+ import { HdTextEllipsis } from "./text-ellipsis/index.mjs";
29
+ import { timeLineEmits, timeLineProps } from "./time-line/src/time-line.mjs";
30
+ import { HdTimeLine } from "./time-line/index.mjs";
31
+ import { uploaderEmits, uploaderProps } from "./uploader/src/uploader.mjs";
32
+ import { HdUploader } from "./uploader/index.mjs";
33
+ export { HdDatePicker, HdDescriptions, HdEllipsisTag, HdEmpty, HdJdataViewer, HdRadio, HdRemoteSearch, HdSearchForm, HdStickyContainer, HdTable, HdTableEditor, HdTabs, HdTareaTag, HdTextEllipsis, HdTimeLine, HdUploader, datePickerEmits, datePickerProps, descriptionsProps, ellipsisTagProps, emptyProps, jdataViewerProps, radioEmits, radioProps, remoteSearchEmits, remoteSearchProps, searchFormEmits, searchFormProps, stickyContainerEmits, stickyContainerProps, tableEditorEmits, tableEditorProps, tableEmits, tableProps, tabsEmits, tabsProps, tareaTagEmits, tareaTagProps, textEllipsisEmits, textEllipsisProps, timeLineEmits, timeLineProps, uploaderEmits, uploaderProps };
@@ -0,0 +1,6 @@
1
+ import JdataViewer from './src/jdata-viewer.js';
2
+ import type { SFCWithInstall } from '../../utils/index.js';
3
+ export declare const HdJdataViewer: SFCWithInstall<typeof JdataViewer>;
4
+ export default HdJdataViewer;
5
+ export * from './src/ijdata-viewer.js';
6
+ export type { JdataViewerInstance } from './src/instance.js';
@@ -0,0 +1,9 @@
1
+ import { withInstall } from "../../utils/vue/install.mjs";
2
+ import { jdataViewerProps } from "./src/ijdata-viewer.mjs";
3
+ import jdata_viewer_default from "./src/jdata-viewer.mjs";
4
+ //#region packages/components/jdata-viewer/index.ts
5
+ var HdJdataViewer = withInstall(jdata_viewer_default);
6
+ //#endregion
7
+ export { HdJdataViewer, HdJdataViewer as default, jdataViewerProps };
8
+
9
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../../../../../packages/components/jdata-viewer/index.ts"],"sourcesContent":["import { withInstall } from '@hd-custom/utils'\n\nimport JdataViewer from './src/jdata-viewer'\nimport type { SFCWithInstall } from '@hd-custom/utils'\n\nexport const HdJdataViewer: SFCWithInstall<typeof JdataViewer> = withInstall(JdataViewer)\nexport default HdJdataViewer\n\nexport * from './src/ijdata-viewer'\nexport type { JdataViewerInstance } from './src/instance'\n"],"mappings":";;;;AAKA,IAAa,gBAAoD,YAAY,qBAAY"}
@@ -0,0 +1,40 @@
1
+ import type { ExtractPropTypes } from 'vue';
2
+ export declare const jdataViewerProps: {
3
+ data: {
4
+ type: (ObjectConstructor | StringConstructor)[];
5
+ required: boolean;
6
+ };
7
+ expanded: {
8
+ type: BooleanConstructor;
9
+ default: boolean;
10
+ };
11
+ copy: {
12
+ type: BooleanConstructor;
13
+ default: boolean;
14
+ };
15
+ theme: {
16
+ type: StringConstructor;
17
+ default: string;
18
+ };
19
+ rootTagStart: {
20
+ type: StringConstructor;
21
+ default: string;
22
+ };
23
+ rootTagEnd: {
24
+ type: StringConstructor;
25
+ default: string;
26
+ };
27
+ renderHTag: {
28
+ type: BooleanConstructor;
29
+ default: boolean;
30
+ };
31
+ hideSearch: {
32
+ type: BooleanConstructor;
33
+ default: boolean;
34
+ };
35
+ splacholder: {
36
+ type: StringConstructor;
37
+ default: string;
38
+ };
39
+ };
40
+ export type JdataViewerProps = ExtractPropTypes<typeof jdataViewerProps>;
@@ -0,0 +1,43 @@
1
+ //#region packages/components/jdata-viewer/src/ijdata-viewer.ts
2
+ var jdataViewerProps = {
3
+ data: {
4
+ type: [Object, String],
5
+ required: true
6
+ },
7
+ expanded: {
8
+ type: Boolean,
9
+ default: false
10
+ },
11
+ copy: {
12
+ type: Boolean,
13
+ default: false
14
+ },
15
+ theme: {
16
+ type: String,
17
+ default: "light"
18
+ },
19
+ rootTagStart: {
20
+ type: String,
21
+ default: "{"
22
+ },
23
+ rootTagEnd: {
24
+ type: String,
25
+ default: "}"
26
+ },
27
+ renderHTag: {
28
+ type: Boolean,
29
+ default: true
30
+ },
31
+ hideSearch: {
32
+ type: Boolean,
33
+ default: false
34
+ },
35
+ splacholder: {
36
+ type: String,
37
+ default: "请输入 key 或者 value 进行搜索"
38
+ }
39
+ };
40
+ //#endregion
41
+ export { jdataViewerProps };
42
+
43
+ //# sourceMappingURL=ijdata-viewer.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ijdata-viewer.mjs","names":[],"sources":["../../../../../../packages/components/jdata-viewer/src/ijdata-viewer.ts"],"sourcesContent":["import type { ExtractPropTypes } from 'vue'\n\nexport const jdataViewerProps = {\n data: {\n type: [Object, String],\n required: true,\n },\n expanded: {\n type: Boolean,\n default: false,\n },\n copy: {\n type: Boolean,\n default: false,\n },\n theme: {\n type: String,\n default: 'light',\n },\n rootTagStart: {\n type: String,\n default: '{',\n },\n rootTagEnd: {\n type: String,\n default: '}',\n },\n renderHTag: {\n type: Boolean,\n default: true,\n },\n hideSearch: {\n type: Boolean,\n default: false,\n },\n splacholder: {\n type: String,\n default: '请输入 key 或者 value 进行搜索',\n },\n}\n\nexport type JdataViewerProps = ExtractPropTypes<typeof jdataViewerProps>\n"],"mappings":";AAEA,IAAa,mBAAmB;CAC9B,MAAM;EACJ,MAAM,CAAC,QAAQ,OAAO;EACtB,UAAU;EACX;CACD,UAAU;EACR,MAAM;EACN,SAAS;EACV;CACD,MAAM;EACJ,MAAM;EACN,SAAS;EACV;CACD,OAAO;EACL,MAAM;EACN,SAAS;EACV;CACD,cAAc;EACZ,MAAM;EACN,SAAS;EACV;CACD,YAAY;EACV,MAAM;EACN,SAAS;EACV;CACD,YAAY;EACV,MAAM;EACN,SAAS;EACV;CACD,YAAY;EACV,MAAM;EACN,SAAS;EACV;CACD,aAAa;EACX,MAAM;EACN,SAAS;EACV;CACF"}
@@ -0,0 +1,2 @@
1
+ import type JdataViewer from './jdata-viewer.js';
2
+ export type JdataViewerInstance = InstanceType<typeof JdataViewer>;
File without changes
@@ -0,0 +1,87 @@
1
+ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
2
+ data: {
3
+ type: (ObjectConstructor | StringConstructor)[];
4
+ required: boolean;
5
+ };
6
+ expanded: {
7
+ type: BooleanConstructor;
8
+ default: boolean;
9
+ };
10
+ copy: {
11
+ type: BooleanConstructor;
12
+ default: boolean;
13
+ };
14
+ theme: {
15
+ type: StringConstructor;
16
+ default: string;
17
+ };
18
+ rootTagStart: {
19
+ type: StringConstructor;
20
+ default: string;
21
+ };
22
+ rootTagEnd: {
23
+ type: StringConstructor;
24
+ default: string;
25
+ };
26
+ renderHTag: {
27
+ type: BooleanConstructor;
28
+ default: boolean;
29
+ };
30
+ hideSearch: {
31
+ type: BooleanConstructor;
32
+ default: boolean;
33
+ };
34
+ splacholder: {
35
+ type: StringConstructor;
36
+ default: string;
37
+ };
38
+ }>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
39
+ data: {
40
+ type: (ObjectConstructor | StringConstructor)[];
41
+ required: boolean;
42
+ };
43
+ expanded: {
44
+ type: BooleanConstructor;
45
+ default: boolean;
46
+ };
47
+ copy: {
48
+ type: BooleanConstructor;
49
+ default: boolean;
50
+ };
51
+ theme: {
52
+ type: StringConstructor;
53
+ default: string;
54
+ };
55
+ rootTagStart: {
56
+ type: StringConstructor;
57
+ default: string;
58
+ };
59
+ rootTagEnd: {
60
+ type: StringConstructor;
61
+ default: string;
62
+ };
63
+ renderHTag: {
64
+ type: BooleanConstructor;
65
+ default: boolean;
66
+ };
67
+ hideSearch: {
68
+ type: BooleanConstructor;
69
+ default: boolean;
70
+ };
71
+ splacholder: {
72
+ type: StringConstructor;
73
+ default: string;
74
+ };
75
+ }>> & Readonly<{}>, {
76
+ copy: boolean;
77
+ expanded: boolean;
78
+ theme: string;
79
+ rootTagStart: string;
80
+ rootTagEnd: string;
81
+ renderHTag: boolean;
82
+ hideSearch: boolean;
83
+ splacholder: string;
84
+ }, {}, {
85
+ Transition: import("vue").FunctionalComponent<import("vue").TransitionProps, {}, any, {}>;
86
+ }, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
87
+ export default _default;
@@ -0,0 +1,125 @@
1
+ import { jdataViewerProps } from "./ijdata-viewer.mjs";
2
+ import { useView } from "./use-view.mjs";
3
+ import { Fragment, Transition, createTextVNode, createVNode, defineComponent, vShow, withDirectives } from "vue";
4
+ //#region packages/components/jdata-viewer/src/jdata-viewer.tsx
5
+ var jdata_viewer_default = /* @__PURE__ */ defineComponent({
6
+ name: "JdataViewer",
7
+ components: { Transition },
8
+ props: jdataViewerProps,
9
+ setup(props) {
10
+ const { _nodes, isCollapsed, toggleRoot, handleCopy } = useView(props);
11
+ const css = (value) => value;
12
+ const parseKey = (key) => {
13
+ const keys = key.split(".");
14
+ return keys[keys.length - 1];
15
+ };
16
+ const COLORS = [
17
+ "#fa541c",
18
+ "#fa8c16",
19
+ "#faad14",
20
+ "#fadb14",
21
+ "#a0d911",
22
+ "#722ed1",
23
+ "#eb2f96"
24
+ ];
25
+ const isHtml = (node) => {
26
+ return /<[^>]*>/g.test(node.value);
27
+ };
28
+ const valueRender = (node) => {
29
+ if (node.value === null) return createVNode("span", { "class": "jv-n" }, [createTextVNode("null")]);
30
+ switch (node.nodeType) {
31
+ case "string": try {
32
+ if (props.renderHTag && isHtml(node)) {
33
+ const htmlStr = node.value.replace(/^"|"$/g, "");
34
+ const processJsonInHtml = (str) => {
35
+ return str.replace(/\{([^}]+)\}/g, (match) => {
36
+ try {
37
+ const jsonObj = JSON.parse(match);
38
+ return JSON.stringify(jsonObj);
39
+ } catch (_unused) {
40
+ return match;
41
+ }
42
+ });
43
+ };
44
+ return createVNode("div", {
45
+ "class": "html-content",
46
+ "innerHTML": processJsonInHtml(htmlStr)
47
+ }, null);
48
+ }
49
+ return createVNode("span", { "class": "jv-greed" }, [JSON.stringify(node.value)]);
50
+ } catch (_unused2) {
51
+ return createVNode("span", { "class": "jv-greed" }, [JSON.stringify(node.value)]);
52
+ }
53
+ case "number": return createVNode("span", { "class": "jv-red" }, [node.value]);
54
+ case "boolean": return createVNode("span", { "class": "jv-red" }, [String(node.value)]);
55
+ default: return createVNode("span", { "class": "jv-greed" }, [JSON.stringify(node.value)]);
56
+ }
57
+ };
58
+ const toggleExpand = (node) => {
59
+ node.collapse = !node.collapse;
60
+ };
61
+ const CollapseArrow = ({ toggleClick, isCollapsed }) => createVNode("div", {
62
+ "style": css({
63
+ cursor: "pointer",
64
+ display: "inline-block"
65
+ }),
66
+ "class": `color-f triangle-arrow ${isCollapsed ? "triangle-right" : "triangle-down"}`,
67
+ "onClick": toggleClick
68
+ }, null);
69
+ const JsonNode = ({ node }) => {
70
+ const renderNode = (key, value, children, type, index = 0, childNode) => {
71
+ const _node = childNode || node;
72
+ if ((type === "object" || type === "array") && value !== null) {
73
+ const colorIndex = index % COLORS.length;
74
+ return createVNode("div", { "style": css({
75
+ padding: "2px 0",
76
+ transition: "background-color 0.2s"
77
+ }) }, [
78
+ createVNode(CollapseArrow, {
79
+ "toggleClick": () => toggleExpand(_node),
80
+ "isCollapsed": _node.collapse
81
+ }, null),
82
+ createVNode("div", { "style": "display:inline-block;word-break: break-all;" }, [!_node.isArrayChild && createVNode(Fragment, null, [createVNode("span", null, [parseKey(key)]), createVNode("span", { "style": "fontWeight:bold" }, [createTextVNode(":")])]), createVNode("strong", { "style": css({ color: COLORS[colorIndex] }) }, [type === "object" ? "{" : "["])]),
83
+ _node.collapse ? createVNode("span", { "style": css({ color: COLORS[colorIndex] }) }, [createTextVNode("...")]) : "",
84
+ createVNode(Transition, { "name": "expand" }, { default: () => [withDirectives(createVNode("div", { "style": css({ paddingLeft: "16px" }) }, [children.map((child) => {
85
+ return createVNode("div", { "key": child.level }, [renderNode(child.key, child.value, child._children, child.nodeType, child.level, child)]);
86
+ })]), [[vShow, !_node.collapse]])] }),
87
+ createVNode("span", { "style": css({ color: COLORS[colorIndex] }) }, [createVNode("strong", null, [type === "object" ? "}" : "]"])]),
88
+ _node.isArrayChild && createVNode("span", null, [createTextVNode(",")])
89
+ ]);
90
+ } else return createVNode("div", { "style": css({
91
+ display: props.renderHTag && isHtml(node) ? "flex" : "inline-block",
92
+ wordBreak: "break-all"
93
+ }) }, [
94
+ type !== "array" && createVNode(Fragment, null, [!_node.isArrayChild && createVNode(Fragment, null, [createVNode("span", {
95
+ "class": "json-key-span",
96
+ "style": "display:inline-block"
97
+ }, [parseKey(key)]), createVNode("span", { "style": "fontWeight:bold" }, [createTextVNode(":")])])]),
98
+ valueRender(_node),
99
+ _node.isArrayChild && createVNode("span", null, [createTextVNode(",")])
100
+ ]);
101
+ };
102
+ return createVNode("div", null, [renderNode(node.key, node.value, node._children, node.nodeType, 0, node)]);
103
+ };
104
+ const JsonTree = (data = []) => {
105
+ return createVNode("div", null, [createVNode("div", null, [
106
+ createVNode(CollapseArrow, {
107
+ "toggleClick": toggleRoot,
108
+ "isCollapsed": isCollapsed.value
109
+ }, null),
110
+ createVNode("span", { "class": "json-key-span" }, [props.rootTagStart]),
111
+ isCollapsed.value && createVNode(Fragment, null, [createVNode("span", null, [createTextVNode("...")]), createVNode("span", { "class": "json-key-span" }, [props.rootTagEnd])])
112
+ ]), createVNode(Transition, null, { default: () => [withDirectives(createVNode("div", { "style": css({ marginLeft: "16px" }) }, [createVNode("div", { "style": css({ paddingLeft: "16px" }) }, [data.map((node) => createVNode(JsonNode, { "node": node }, null))]), createVNode("span", { "class": "json-key-span" }, [props.rootTagEnd])]), [[vShow, !isCollapsed.value]])] })]);
113
+ };
114
+ return () => {
115
+ return createVNode("div", { "class": `jdata-viewer ${props.theme === "light" ? "jdata-viewer-light" : "jdata-viewer-dark"}` }, [props.copy && createVNode("div", {
116
+ "class": "json-copy",
117
+ "onClick": handleCopy
118
+ }, [createTextVNode("复制")]), createVNode("div", { "class": "jdata-tree" }, [JsonTree(_nodes.value)])]);
119
+ };
120
+ }
121
+ });
122
+ //#endregion
123
+ export { jdata_viewer_default as default };
124
+
125
+ //# sourceMappingURL=jdata-viewer.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jdata-viewer.mjs","names":["defineComponent","Transition","Fragment","createTextVNode","_createTextVNode","createVNode","_createVNode","_Fragment","vShow","_vShow","withDirectives","_withDirectives","jdataViewerProps","useView","name","components","props","setup","_nodes","isCollapsed","toggleRoot","handleCopy","css","value","parseKey","key","keys","split","length","COLORS","isHtml","node","test","valueRender","nodeType","renderHTag","htmlStr","replace","processJsonInHtml","str","match","jsonObj","JSON","parse","stringify","processedHtml","String","toggleExpand","collapse","CollapseArrow","toggleClick","cursor","display","JsonNode","renderNode","children","type","index","childNode","_node","colorIndex","padding","transition","isArrayChild","color","default","paddingLeft","map","child","level","_children","wordBreak","JsonTree","data","rootTagStart","rootTagEnd","marginLeft","theme","copy"],"sources":["../../../../../../packages/components/jdata-viewer/src/jdata-viewer.tsx"],"sourcesContent":["import { defineComponent, Transition, Fragment } from 'vue'\nimport { jdataViewerProps } from './ijdata-viewer'\nimport { useView } from './use-view'\nimport type { StyleValue } from 'vue'\n\nexport default defineComponent({\n name: 'JdataViewer',\n components: {\n Transition,\n },\n props: jdataViewerProps,\n setup(props: any) {\n const { _nodes, isCollapsed, toggleRoot, handleCopy } = useView(props)\n const css = (value: Record<string, string>) => value as StyleValue\n\n // 修复拼写错误:paseKey -> parseKey\n const parseKey = (key: string) => {\n const keys = key.split('.')\n return keys[keys.length - 1]\n }\n\n // 将颜色定义提取为常量,便于维护\n const COLORS = ['#fa541c', '#fa8c16', '#faad14', '#fadb14', '#a0d911', '#722ed1', '#eb2f96']\n\n const isHtml = (node: any) => {\n return /<[^>]*>/g.test(node.value)\n }\n\n // 优化 valueRender 函数,提高可读性\n const valueRender = (node: any) => {\n if (node.value === null) {\n return <span class=\"jv-n\">null</span>\n }\n\n switch (node.nodeType) {\n case 'string':\n try {\n // 只有在 renderHTag 为 true 时才处理 HTML 标签\n if (props.renderHTag && isHtml(node)) {\n // 移除字符串两端的引号\n const htmlStr = node.value.replace(/^\"|\"$/g, '')\n // 解析可能包含的JSON字符串\n const processJsonInHtml = (str: string) => {\n return str.replace(/\\{([^}]+)\\}/g, (match) => {\n try {\n const jsonObj = JSON.parse(match)\n return JSON.stringify(jsonObj)\n } catch {\n return match\n }\n })\n }\n const processedHtml = processJsonInHtml(htmlStr)\n return <div class=\"html-content\" innerHTML={processedHtml}></div>\n }\n return <span class=\"jv-greed\">{JSON.stringify(node.value)}</span>\n } catch {\n return <span class=\"jv-greed\">{JSON.stringify(node.value)}</span>\n }\n case 'number':\n return <span class=\"jv-red\">{node.value}</span>\n case 'boolean':\n return <span class=\"jv-red\">{String(node.value)}</span>\n default:\n return <span class=\"jv-greed\">{JSON.stringify(node.value)}</span>\n }\n }\n\n const toggleExpand = (node: any) => {\n node.collapse = !node.collapse\n }\n\n // 定义一个箭头组件,用于显示展开和收起的状态\n const CollapseArrow = ({ toggleClick, isCollapsed }: any) => (\n <div\n style={css({ cursor: 'pointer', display: 'inline-block' })}\n class={`color-f triangle-arrow ${isCollapsed ? 'triangle-right' : 'triangle-down'}`}\n onClick={toggleClick}\n ></div>\n )\n\n // 渲染单个节点的组件\n const JsonNode = ({ node }: any) => {\n // 渲染节点内容\n const renderNode = (key: string, value: any, children: [], type: string, index = 0, childNode: any) => {\n const _node = childNode || node\n if ((type === 'object' || type === 'array') && value !== null) {\n const colorIndex = index % COLORS.length\n return (\n <div\n style={css({\n padding: '2px 0',\n transition: 'background-color 0.2s',\n })}\n >\n <CollapseArrow toggleClick={() => toggleExpand(_node)} isCollapsed={_node.collapse} />\n <div style=\"display:inline-block;word-break: break-all;\">\n {!_node.isArrayChild && (\n <Fragment>\n <span>{parseKey(key)}</span>\n <span style=\"fontWeight:bold\">:</span>\n </Fragment>\n )}\n <strong style={css({ color: COLORS[colorIndex] })}>{type === 'object' ? '{' : '['}</strong>\n </div>\n {_node.collapse ? <span style={css({ color: COLORS[colorIndex] })}>...</span> : ''}\n <Transition name=\"expand\">\n <div v-show={!_node.collapse} style={css({ paddingLeft: '16px' })}>\n {children.map((child: any) => {\n return (\n <div key={child.level}>\n {renderNode(child.key, child.value, child._children, child.nodeType, child.level, child)}\n </div>\n )\n })}\n </div>\n </Transition>\n <span style={css({ color: COLORS[colorIndex] })}>\n <strong>{type === 'object' ? '}' : ']'}</strong>\n </span>\n {_node.isArrayChild && <span>,</span>}\n </div>\n )\n } else {\n return (\n <div\n style={css({\n display: props.renderHTag && isHtml(node) ? 'flex' : 'inline-block',\n wordBreak: 'break-all',\n })}\n >\n {type !== 'array' && (\n <Fragment>\n {!_node.isArrayChild && (\n <Fragment>\n <span class=\"json-key-span\" style=\"display:inline-block\">\n {parseKey(key)}\n </span>\n <span style=\"fontWeight:bold\">:</span>\n </Fragment>\n )}\n </Fragment>\n )}\n {valueRender(_node)}\n {_node.isArrayChild && <span>,</span>}\n </div>\n )\n }\n }\n\n return <div>{renderNode(node.key, node.value, node._children, node.nodeType, 0, node)}</div>\n }\n\n // 根组件,渲染整个JSON树\n const JsonTree = (data = []) => {\n return (\n <div>\n <div>\n <CollapseArrow toggleClick={toggleRoot} isCollapsed={isCollapsed.value} />\n <span class=\"json-key-span\">{props.rootTagStart}</span>\n {isCollapsed.value && (\n <Fragment>\n <span>...</span>\n <span class=\"json-key-span\">{props.rootTagEnd}</span>\n </Fragment>\n )}\n </div>\n <Transition>\n <div v-show={!isCollapsed.value} style={css({ marginLeft: '16px' })}>\n <div style={css({ paddingLeft: '16px' })}>\n {data.map((node: any) => (\n <JsonNode node={node} />\n ))}\n </div>\n <span class=\"json-key-span\">{props.rootTagEnd}</span>\n </div>\n </Transition>\n </div>\n )\n }\n\n return () => {\n return (\n <div class={`jdata-viewer ${props.theme === 'light' ? 'jdata-viewer-light' : 'jdata-viewer-dark'}`}>\n {props.copy && (\n <div class=\"json-copy\" onClick={handleCopy}>\n 复制\n </div>\n )}\n <div class=\"jdata-tree\">{JsonTree(_nodes.value)}</div>\n </div>\n )\n }\n },\n})\n"],"mappings":";;;;AAKA,IAAA,uBAAeA,gCAAgB;CAC7Bc,MAAM;CACNC,YAAY,EACVd,YACD;CACDe,OAAOJ;CACPK,MAAMD,OAAY;EAChB,MAAM,EAAEE,QAAQC,aAAaC,YAAYC,eAAeR,QAAQG,MAAM;EACtE,MAAMM,OAAOC,UAAkCA;EAG/C,MAAMC,YAAYC,QAAgB;GAChC,MAAMC,OAAOD,IA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A;IAAA,SAAA;IAAA,WACuBe;IAAU,EAAA,CAAAjB,gBAAA,KAAA,CAAA,CAG3C,EAAAE,YAAA,OAAA,EAAA,SAAA,cAAA,EAAA,CACwBkE,SAAStD,OAAOK,MAAM,CAAA,CAAA,CAAA,CAAA;;;CAKxD,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { JdataViewerProps } from './ijdata-viewer.js';
2
+ export declare const useView: (props: JdataViewerProps) => {
3
+ isCollapsed: any;
4
+ _nodes: any;
5
+ handleCopy: () => Promise<void>;
6
+ toggleRoot: () => void;
7
+ };
@@ -0,0 +1,98 @@
1
+ import { ref, watchEffect } from "vue";
2
+ import { ElMessage } from "element-plus";
3
+ //#region packages/components/jdata-viewer/src/use-view.ts
4
+ var useView = (props) => {
5
+ const _nodes = ref([]);
6
+ const isCollapsed = ref(false);
7
+ const toggleRoot = () => {
8
+ isCollapsed.value = !isCollapsed.value;
9
+ };
10
+ const copyed = ref(false);
11
+ const handleCopy = async () => {
12
+ try {
13
+ const copyData = JSON.stringify(props.data);
14
+ await navigator.clipboard.writeText(copyData);
15
+ copyed.value = true;
16
+ ElMessage.success("复制成功");
17
+ } catch (error) {
18
+ console.log("复制失败", error);
19
+ }
20
+ };
21
+ watchEffect(() => {
22
+ isCollapsed.value = false;
23
+ _nodes.value = jsonToNestedArray(props.data);
24
+ });
25
+ return {
26
+ isCollapsed,
27
+ _nodes,
28
+ handleCopy,
29
+ toggleRoot
30
+ };
31
+ };
32
+ function jsonToNestedArray(obj) {
33
+ if (obj === void 0) {
34
+ console.error("JSON Viewer: 输入数据不能为空");
35
+ return [];
36
+ }
37
+ let jsonData;
38
+ try {
39
+ if (typeof obj === "string") jsonData = JSON.parse(obj);
40
+ else if (obj && typeof obj === "object") jsonData = obj;
41
+ else {
42
+ console.error("JSON Viewer: 输入数据必须是 JSON 对象或 JSON 字符串");
43
+ return [];
44
+ }
45
+ } catch (error) {
46
+ console.error("JSON Viewer: JSON 字符串解析失败,请检查格式是否正确", error);
47
+ return [];
48
+ }
49
+ if (!jsonData || typeof jsonData !== "object" || jsonData === null) {
50
+ console.warn("JSON Viewer: 解析后的数据必须是有效的对象或数组");
51
+ return [];
52
+ }
53
+ function processNode(key, value, path, level, isArrayChild = false) {
54
+ const fullPath = path ? `${path}.${key}` : key;
55
+ const node = {
56
+ key: fullPath,
57
+ value: "",
58
+ nodeType: typeof value,
59
+ _children: [],
60
+ level,
61
+ collapse: false
62
+ };
63
+ if (typeof value === "object" && value !== null) if (Array.isArray(value)) {
64
+ node.nodeType = "array";
65
+ node.value = JSON.stringify(value);
66
+ node.isArrayChild = isArrayChild;
67
+ value.forEach((item, index) => {
68
+ node._children.push(processNode(`${index}`, item, "", level + 1, true));
69
+ });
70
+ } else {
71
+ node.nodeType = "object";
72
+ node.value = JSON.stringify(value);
73
+ node.isArrayChild = isArrayChild;
74
+ Object.entries(value).forEach(([childKey, childValue]) => {
75
+ node._children.push(processNode(childKey, childValue, fullPath, level + 1));
76
+ });
77
+ }
78
+ else if (typeof value === "function") {
79
+ node.nodeType = "function";
80
+ node.value = value === null || value === void 0 ? void 0 : value.toString();
81
+ node.isArrayChild = isArrayChild;
82
+ } else {
83
+ node.nodeType = typeof value;
84
+ node.value = value;
85
+ node.isArrayChild = isArrayChild;
86
+ }
87
+ return node;
88
+ }
89
+ const result = [];
90
+ Object.entries(jsonData).forEach(([key, value]) => {
91
+ result.push(processNode(key, value, "", 0));
92
+ });
93
+ return result;
94
+ }
95
+ //#endregion
96
+ export { useView };
97
+
98
+ //# sourceMappingURL=use-view.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-view.mjs","names":[],"sources":["../../../../../../packages/components/jdata-viewer/src/use-view.ts"],"sourcesContent":["import { JdataViewerProps } from './ijdata-viewer'\nimport { ElMessage } from 'element-plus'\nimport { ref, watchEffect } from 'vue'\n\nexport const useView = (props: JdataViewerProps) => {\n const _nodes = ref([])\n const isCollapsed = ref(false)\n const toggleRoot = () => {\n isCollapsed.value = !isCollapsed.value\n }\n const copyed = ref(false)\n const handleCopy = async () => {\n try {\n const copyData = JSON.stringify(props.data)\n\n // 使用现代的 Clipboared API\n await navigator.clipboard.writeText(copyData)\n copyed.value = true\n ElMessage.success('复制成功')\n } catch (error) {\n console.log('复制失败', error)\n }\n }\n\n watchEffect(() => {\n isCollapsed.value = false\n _nodes.value = jsonToNestedArray(props.data)\n })\n\n return {\n isCollapsed,\n _nodes,\n handleCopy,\n toggleRoot,\n }\n}\n\nfunction jsonToNestedArray(obj: Record<string, any> | string | undefined) {\n // 处理 undefined 情况\n if (obj === undefined) {\n console.error('JSON Viewer: 输入数据不能为空')\n return []\n }\n\n let jsonData: Record<string, any>\n\n // 校验并转换输入数据\n try {\n if (typeof obj === 'string') {\n // 如果是字符串,尝试解析成 JSON 对象\n jsonData = JSON.parse(obj)\n } else if (obj && typeof obj === 'object') {\n // 如果是对象,直接使用\n jsonData = obj\n } else {\n console.error('JSON Viewer: 输入数据必须是 JSON 对象或 JSON 字符串')\n return []\n }\n } catch (error) {\n console.error('JSON Viewer: JSON 字符串解析失败,请检查格式是否正确', error)\n return []\n }\n\n // 校验转换后的数据是否为有效对象\n if (!jsonData || typeof jsonData !== 'object' || jsonData === null) {\n console.warn('JSON Viewer: 解析后的数据必须是有效的对象或数组')\n return []\n }\n\n // 定义一个帮助函数递归地处理对象和数组,新增一个level参数来表示当前层级\n function processNode(key: any, value: any, path: any, level: any, isArrayChild = false) {\n // 获取完整的路径\n const fullPath = path ? `${path}.${key}` : key\n // 初始化节点,增加level属性\n const node: any = {\n key: fullPath,\n value: '',\n nodeType: typeof value,\n _children: [],\n level: level,\n collapse: false,\n }\n\n if (typeof value === 'object' && value !== null) {\n // 如果值是一个对象,则为每个子属性创建新的节点\n if (Array.isArray(value)) {\n // 处理数组类型\n node.nodeType = 'array'\n // node.value = value.toString();\n node.value = JSON.stringify(value)\n node.isArrayChild = isArrayChild\n // node.type = \"array\";\n value.forEach((item, index) => {\n node._children.push(processNode(`${index}`, item, '', level + 1, true))\n })\n } else {\n // 处理对象类型\n node.nodeType = 'object'\n // node.value = value?.toString();\n node.value = JSON.stringify(value)\n node.isArrayChild = isArrayChild\n // node.type = \"object\";\n Object.entries(value).forEach(([childKey, childValue]) => {\n node._children.push(processNode(childKey, childValue, fullPath, level + 1))\n })\n }\n } else if (typeof value === 'function') {\n // 如果值不是对象或数组,直接设置值和类型\n node.nodeType = 'function'\n node.value = value?.toString()\n node.isArrayChild = isArrayChild\n } else {\n node.nodeType = typeof value\n node.value = value\n node.isArrayChild = isArrayChild\n }\n return node\n }\n\n const result: any = []\n Object.entries(jsonData).forEach(([key, value]) => {\n result.push(processNode(key, value, '', 0))\n })\n\n return result\n}\n"],"mappings":";;;AAIA,IAAa,WAAW,UAA4B;CAClD,MAAM,SAAS,IAAI,EAAE,CAAC;CACtB,MAAM,cAAc,IAAI,MAAM;CAC9B,MAAM,mBAAmB;AACvB,cAAY,QAAQ,CAAC,YAAY;;CAEnC,MAAM,SAAS,IAAI,MAAM;CACzB,MAAM,aAAa,YAAY;AAC7B,MAAI;GACF,MAAM,WAAW,KAAK,UAAU,MAAM,KAAK;AAG3C,SAAM,UAAU,UAAU,UAAU,SAAS;AAC7C,UAAO,QAAQ;AACf,aAAU,QAAQ,OAAO;WAClB,OAAO;AACd,WAAQ,IAAI,QAAQ,MAAM;;;AAI9B,mBAAkB;AAChB,cAAY,QAAQ;AACpB,SAAO,QAAQ,kBAAkB,MAAM,KAAK;GAC5C;AAEF,QAAO;EACL;EACA;EACA;EACA;EACD;;AAGH,SAAS,kBAAkB,KAA+C;AAExE,KAAI,QAAQ,KAAA,GAAW;AACrB,UAAQ,MAAM,wBAAwB;AACtC,SAAO,EAAE;;CAGX,IAAI;AAGJ,KAAI;AACF,MAAI,OAAO,QAAQ,SAEjB,YAAW,KAAK,MAAM,IAAI;WACjB,OAAO,OAAO,QAAQ,SAE/B,YAAW;OACN;AACL,WAAQ,MAAM,yCAAyC;AACvD,UAAO,EAAE;;UAEJ,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
+ import '../src/jdata-viewer.scss';
@@ -0,0 +1,6 @@
1
+ import Radio from './src/radio.vue.js';
2
+ import type { SFCWithInstall } from '../../utils/index.js';
3
+ export declare const HdRadio: SFCWithInstall<typeof Radio>;
4
+ export default HdRadio;
5
+ export * from './src/radio.js';
6
+ export type { RadioInstance } from './src/instance.js';
@@ -0,0 +1,9 @@
1
+ import { withInstall } from "../../utils/vue/install.mjs";
2
+ import { radioEmits, radioProps } from "./src/radio.mjs";
3
+ import radio_default from "./src/radio.vue.mjs";
4
+ //#region packages/components/radio/index.ts
5
+ var HdRadio = withInstall(radio_default);
6
+ //#endregion
7
+ export { HdRadio, HdRadio as default, radioEmits, radioProps };
8
+
9
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../../../../../packages/components/radio/index.ts"],"sourcesContent":["import { withInstall } from '@hd-custom/utils'\n\nimport Radio from './src/radio.vue'\nimport type { SFCWithInstall } from '@hd-custom/utils'\n\nexport const HdRadio: SFCWithInstall<typeof Radio> = withInstall(Radio)\nexport default HdRadio\n\nexport * from './src/radio'\nexport type { RadioInstance } from './src/instance'\n"],"mappings":";;;;AAKA,IAAa,UAAwC,YAAY,cAAM"}
@@ -0,0 +1,2 @@
1
+ import type Radio from './radio.vue.js';
2
+ export type RadioInstance = InstanceType<typeof Radio>;
File without changes
@@ -0,0 +1,16 @@
1
+ import type { ExtractPropTypes } from 'vue';
2
+ export interface RadioOptionProp {
3
+ label: string;
4
+ value: any;
5
+ [key: string]: any;
6
+ }
7
+ export declare const radioProps: {
8
+ options: import("../../../utils/index.js").EpPropFinalized<(new (...args: any[]) => RadioOptionProp[]) | (() => RadioOptionProp[]) | (((new (...args: any[]) => RadioOptionProp[]) | (() => RadioOptionProp[])) | null)[], unknown, unknown, () => never[], boolean>;
9
+ modelValue: import("../../../utils/index.js").EpPropFinalized<(NumberConstructor | StringConstructor | BooleanConstructor)[], unknown, unknown, string, boolean>;
10
+ value: import("../../../utils/index.js").EpPropFinalized<StringConstructor, unknown, unknown, string, boolean>;
11
+ label: import("../../../utils/index.js").EpPropFinalized<StringConstructor, unknown, unknown, string, boolean>;
12
+ cancel: import("../../../utils/index.js").EpPropFinalized<BooleanConstructor, unknown, unknown, boolean, boolean>;
13
+ disabled: import("../../../utils/index.js").EpPropFinalized<BooleanConstructor, unknown, unknown, boolean, boolean>;
14
+ };
15
+ export declare const radioEmits: string[];
16
+ export type RadioProps = ExtractPropTypes<typeof radioProps>;
@@ -0,0 +1,37 @@
1
+ import { buildProps } from "../../../utils/vue/props/runtime.mjs";
2
+ //#region packages/components/radio/src/radio.ts
3
+ var radioProps = buildProps({
4
+ options: {
5
+ type: Array,
6
+ default: () => []
7
+ },
8
+ modelValue: {
9
+ type: [
10
+ String,
11
+ Number,
12
+ Boolean
13
+ ],
14
+ default: ""
15
+ },
16
+ value: {
17
+ type: String,
18
+ default: "value"
19
+ },
20
+ label: {
21
+ type: String,
22
+ default: "label"
23
+ },
24
+ cancel: {
25
+ type: Boolean,
26
+ default: true
27
+ },
28
+ disabled: {
29
+ type: Boolean,
30
+ default: false
31
+ }
32
+ });
33
+ var radioEmits = ["update:modelValue", "change"];
34
+ //#endregion
35
+ export { radioEmits, radioProps };
36
+
37
+ //# sourceMappingURL=radio.mjs.map