@qxs-bns/components 0.0.91 → 0.0.92

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 (415) hide show
  1. package/es/base/define.mjs +1 -1
  2. package/es/base/define.mjs.map +1 -1
  3. package/es/base/uid.mjs +1 -1
  4. package/es/base/uid.mjs.map +1 -1
  5. package/es/data-chart.mjs +15 -14
  6. package/es/data-chart.mjs.map +1 -1
  7. package/es/editor/blocksuite-editor.mjs +62 -51
  8. package/es/editor/blocksuite-editor.mjs.map +1 -1
  9. package/es/editor/content-format.mjs +8 -1
  10. package/es/editor/content-format.mjs.map +1 -1
  11. package/es/editor/index.mjs +1 -1
  12. package/es/editor/index.mjs.map +1 -1
  13. package/es/editor/toolbar.mjs +1 -1
  14. package/es/editor/toolbar.mjs.map +1 -1
  15. package/es/entry-data-chart.mjs +1 -1
  16. package/es/entry-editor.mjs +1 -1
  17. package/es/entry-file-upload.mjs +1 -1
  18. package/es/entry-fixed-action-bar.mjs +1 -1
  19. package/es/entry-icon.mjs +1 -1
  20. package/es/entry-image-upload.mjs +1 -1
  21. package/es/entry-photo-crop-tool.mjs +1 -1
  22. package/es/entry-subject.mjs +1 -1
  23. package/es/file-upload.mjs +25 -18
  24. package/es/file-upload.mjs.map +1 -1
  25. package/es/fixed-action-bar.mjs +5 -5
  26. package/es/fixed-action-bar.mjs.map +1 -1
  27. package/es/icon.mjs +7 -7
  28. package/es/icon.mjs.map +1 -1
  29. package/es/image-upload.mjs +26 -26
  30. package/es/image-upload.mjs.map +1 -1
  31. package/es/index.mjs +1 -1
  32. package/es/node_modules/.pnpm/marked@17.0.6/node_modules/marked/lib/marked.esm.mjs +59 -1
  33. package/es/node_modules/.pnpm/marked@17.0.6/node_modules/marked/lib/marked.esm.mjs.map +1 -1
  34. package/es/node_modules/.pnpm/turndown-plugin-gfm@1.0.2/node_modules/turndown-plugin-gfm/lib/turndown-plugin-gfm.es.mjs +16 -1
  35. package/es/node_modules/.pnpm/turndown-plugin-gfm@1.0.2/node_modules/turndown-plugin-gfm/lib/turndown-plugin-gfm.es.mjs.map +1 -1
  36. package/es/node_modules/.pnpm/turndown@7.2.4/node_modules/turndown/lib/turndown.browser.es.mjs +62 -0
  37. package/es/node_modules/.pnpm/turndown@7.2.4/node_modules/turndown/lib/turndown.browser.es.mjs.map +1 -0
  38. package/es/photo-crop-tool.mjs +12 -12
  39. package/es/photo-crop-tool.mjs.map +1 -1
  40. package/es/subject/action.mjs +58 -58
  41. package/es/subject/action.mjs.map +1 -1
  42. package/es/subject/blank-fill.mjs +80 -80
  43. package/es/subject/blank-fill.mjs.map +1 -1
  44. package/es/subject/draft.mjs +1 -1
  45. package/es/subject/draft.mjs.map +1 -1
  46. package/es/subject/layout.mjs +4 -4
  47. package/es/subject/layout.mjs.map +1 -1
  48. package/es/subject/page-end.mjs +5 -5
  49. package/es/subject/page-end.mjs.map +1 -1
  50. package/es/subject/pagination.mjs +1 -1
  51. package/es/subject/pagination.mjs.map +1 -1
  52. package/es/subject/runtime.mjs +1 -1
  53. package/es/subject/runtime.mjs.map +1 -1
  54. package/es/subject/scale.mjs +53 -50
  55. package/es/subject/scale.mjs.map +1 -1
  56. package/es/subject/shared-methods.mjs +1 -1
  57. package/es/subject/shared-methods.mjs.map +1 -1
  58. package/es/subject/shared-styles.mjs +53 -15
  59. package/es/subject/shared-styles.mjs.map +1 -1
  60. package/es/subject/single-interactions.mjs +2 -0
  61. package/es/subject/single-interactions.mjs.map +1 -0
  62. package/es/subject/single-model.mjs +2 -0
  63. package/es/subject/single-model.mjs.map +1 -0
  64. package/es/subject/single-state.mjs +2 -0
  65. package/es/subject/single-state.mjs.map +1 -0
  66. package/es/subject/single.mjs +177 -177
  67. package/es/subject/single.mjs.map +1 -1
  68. package/es/subject/sort-controller.mjs +1 -1
  69. package/es/subject/sort-controller.mjs.map +1 -1
  70. package/es/subject/sortable.mjs +13 -13
  71. package/es/subject/sortable.mjs.map +1 -1
  72. package/es/subject/sorting-card.mjs +12 -12
  73. package/es/subject/sorting-card.mjs.map +1 -1
  74. package/es/subject/subject-shared.mjs +2 -0
  75. package/es/subject/subject-shared.mjs.map +1 -0
  76. package/es/subject/text-fill.mjs +73 -73
  77. package/es/subject/text-fill.mjs.map +1 -1
  78. package/es/subject/title-prefix.mjs +1 -1
  79. package/es/subject/title-prefix.mjs.map +1 -1
  80. package/es/subject/types.mjs +1 -1
  81. package/es/subject/types.mjs.map +1 -1
  82. package/lib/base/define.cjs +1 -1
  83. package/lib/base/define.cjs.map +1 -1
  84. package/lib/base/uid.cjs +1 -1
  85. package/lib/base/uid.cjs.map +1 -1
  86. package/lib/data-chart.cjs +16 -15
  87. package/lib/data-chart.cjs.map +1 -1
  88. package/lib/editor/blocksuite-editor.cjs +62 -51
  89. package/lib/editor/blocksuite-editor.cjs.map +1 -1
  90. package/lib/editor/content-format.cjs +8 -1
  91. package/lib/editor/content-format.cjs.map +1 -1
  92. package/lib/editor/index.cjs +1 -1
  93. package/lib/editor/index.cjs.map +1 -1
  94. package/lib/editor/toolbar.cjs +1 -1
  95. package/lib/editor/toolbar.cjs.map +1 -1
  96. package/lib/entry-data-chart.cjs +1 -1
  97. package/lib/entry-editor.cjs +1 -1
  98. package/lib/entry-file-upload.cjs +1 -1
  99. package/lib/entry-fixed-action-bar.cjs +1 -1
  100. package/lib/entry-icon.cjs +1 -1
  101. package/lib/entry-image-upload.cjs +1 -1
  102. package/lib/entry-photo-crop-tool.cjs +1 -1
  103. package/lib/entry-subject.cjs +1 -1
  104. package/lib/file-upload.cjs +24 -17
  105. package/lib/file-upload.cjs.map +1 -1
  106. package/lib/fixed-action-bar.cjs +6 -6
  107. package/lib/fixed-action-bar.cjs.map +1 -1
  108. package/lib/icon.cjs +9 -9
  109. package/lib/icon.cjs.map +1 -1
  110. package/lib/image-upload.cjs +26 -26
  111. package/lib/image-upload.cjs.map +1 -1
  112. package/lib/index.cjs +1 -1
  113. package/lib/node_modules/.pnpm/marked@17.0.6/node_modules/marked/lib/marked.esm.cjs +59 -1
  114. package/lib/node_modules/.pnpm/marked@17.0.6/node_modules/marked/lib/marked.esm.cjs.map +1 -1
  115. package/lib/node_modules/.pnpm/turndown-plugin-gfm@1.0.2/node_modules/turndown-plugin-gfm/lib/turndown-plugin-gfm.es.cjs +16 -1
  116. package/lib/node_modules/.pnpm/turndown-plugin-gfm@1.0.2/node_modules/turndown-plugin-gfm/lib/turndown-plugin-gfm.es.cjs.map +1 -1
  117. package/lib/node_modules/.pnpm/turndown@7.2.4/node_modules/turndown/lib/turndown.browser.es.cjs +62 -0
  118. package/lib/node_modules/.pnpm/turndown@7.2.4/node_modules/turndown/lib/turndown.browser.es.cjs.map +1 -0
  119. package/lib/photo-crop-tool.cjs +11 -11
  120. package/lib/photo-crop-tool.cjs.map +1 -1
  121. package/lib/subject/action.cjs +42 -42
  122. package/lib/subject/action.cjs.map +1 -1
  123. package/lib/subject/blank-fill.cjs +80 -80
  124. package/lib/subject/blank-fill.cjs.map +1 -1
  125. package/lib/subject/draft.cjs +1 -1
  126. package/lib/subject/draft.cjs.map +1 -1
  127. package/lib/subject/layout.cjs +4 -4
  128. package/lib/subject/layout.cjs.map +1 -1
  129. package/lib/subject/page-end.cjs +4 -4
  130. package/lib/subject/page-end.cjs.map +1 -1
  131. package/lib/subject/pagination.cjs +1 -1
  132. package/lib/subject/pagination.cjs.map +1 -1
  133. package/lib/subject/runtime.cjs +1 -1
  134. package/lib/subject/runtime.cjs.map +1 -1
  135. package/lib/subject/scale.cjs +53 -50
  136. package/lib/subject/scale.cjs.map +1 -1
  137. package/lib/subject/shared-methods.cjs +1 -1
  138. package/lib/subject/shared-methods.cjs.map +1 -1
  139. package/lib/subject/shared-styles.cjs +54 -16
  140. package/lib/subject/shared-styles.cjs.map +1 -1
  141. package/lib/subject/single-interactions.cjs +2 -0
  142. package/lib/subject/single-interactions.cjs.map +1 -0
  143. package/lib/subject/single-model.cjs +2 -0
  144. package/lib/subject/single-model.cjs.map +1 -0
  145. package/lib/subject/single-state.cjs +2 -0
  146. package/lib/subject/single-state.cjs.map +1 -0
  147. package/lib/subject/single.cjs +177 -177
  148. package/lib/subject/single.cjs.map +1 -1
  149. package/lib/subject/sort-controller.cjs +1 -1
  150. package/lib/subject/sort-controller.cjs.map +1 -1
  151. package/lib/subject/sortable.cjs +15 -15
  152. package/lib/subject/sortable.cjs.map +1 -1
  153. package/lib/subject/sorting-card.cjs +12 -12
  154. package/lib/subject/sorting-card.cjs.map +1 -1
  155. package/lib/subject/subject-shared.cjs +2 -0
  156. package/lib/subject/subject-shared.cjs.map +1 -0
  157. package/lib/subject/text-fill.cjs +81 -81
  158. package/lib/subject/text-fill.cjs.map +1 -1
  159. package/lib/subject/title-prefix.cjs +1 -1
  160. package/lib/subject/title-prefix.cjs.map +1 -1
  161. package/lib/subject/types.cjs +1 -1
  162. package/lib/subject/types.cjs.map +1 -1
  163. package/package.json +5 -5
  164. package/types/editor/blocksuite-editor.d.ts +2 -0
  165. package/types/editor/toolbar.d.ts +1 -1
  166. package/types/file-upload.d.ts +2 -0
  167. package/types/subject/blank-fill.d.ts +1 -1
  168. package/types/subject/runtime.d.ts +1 -1
  169. package/types/subject/scale.d.ts +1 -1
  170. package/types/subject/single-interactions.d.ts +46 -0
  171. package/types/subject/single-model.d.ts +88 -0
  172. package/types/subject/single-state.d.ts +42 -0
  173. package/types/subject/single.d.ts +7 -85
  174. package/types/subject/sortable.d.ts +1 -1
  175. package/types/subject/subject-shared.d.ts +43 -0
  176. package/types/subject/text-fill.d.ts +1 -1
  177. package/README.md +0 -562
  178. package/es/node_modules/.pnpm/@iconify_vue@5.0.0_vue@3.5.18_typescript@5.9.2_/node_modules/@iconify/vue/dist/iconify.mjs +0 -2
  179. package/es/node_modules/.pnpm/@iconify_vue@5.0.0_vue@3.5.18_typescript@5.9.2_/node_modules/@iconify/vue/dist/iconify.mjs.map +0 -1
  180. package/es/node_modules/.pnpm/turndown@7.2.4/node_modules/turndown/lib/turndown.es.mjs +0 -2
  181. package/es/node_modules/.pnpm/turndown@7.2.4/node_modules/turndown/lib/turndown.es.mjs.map +0 -1
  182. package/es/package.json.mjs +0 -2
  183. package/es/package.json.mjs.map +0 -1
  184. package/es/src/alert/index.mjs +0 -2
  185. package/es/src/alert/index.mjs.map +0 -1
  186. package/es/src/alert/src/alert.mjs +0 -2
  187. package/es/src/alert/src/alert.mjs.map +0 -1
  188. package/es/src/components.mjs +0 -2
  189. package/es/src/components.mjs.map +0 -1
  190. package/es/src/data-chart/index.mjs +0 -2
  191. package/es/src/data-chart/index.mjs.map +0 -1
  192. package/es/src/defaults.mjs +0 -2
  193. package/es/src/defaults.mjs.map +0 -1
  194. package/es/src/dialog/src/dialog.mjs +0 -2
  195. package/es/src/dialog/src/dialog.mjs.map +0 -1
  196. package/es/src/feedback-plugin/index.mjs +0 -2
  197. package/es/src/feedback-plugin/index.mjs.map +0 -1
  198. package/es/src/file-upload/index.mjs +0 -2
  199. package/es/src/file-upload/index.mjs.map +0 -1
  200. package/es/src/icon/index.mjs +0 -2
  201. package/es/src/icon/index.mjs.map +0 -1
  202. package/es/src/icon/src/icon.mjs +0 -2
  203. package/es/src/icon/src/icon.mjs.map +0 -1
  204. package/es/src/image-upload/index.mjs +0 -2
  205. package/es/src/image-upload/index.mjs.map +0 -1
  206. package/es/src/make-installer.mjs +0 -2
  207. package/es/src/make-installer.mjs.map +0 -1
  208. package/es/src/message/src/message.mjs +0 -2
  209. package/es/src/message/src/message.mjs.map +0 -1
  210. package/es/src/photo-crop-tool/index.mjs +0 -2
  211. package/es/src/photo-crop-tool/index.mjs.map +0 -1
  212. package/es/src/tiny-mce-editor/index.mjs +0 -2
  213. package/es/src/tiny-mce-editor/index.mjs.map +0 -1
  214. package/es/src/tiny-mce-editor/src/tiny-mce-editor.vue.mjs +0 -2
  215. package/es/src/tiny-mce-editor/src/tiny-mce-editor.vue.mjs.map +0 -1
  216. package/es/src/tiny-mce-editor/src/tiny-mce-editor.vue2.mjs +0 -2
  217. package/es/src/tiny-mce-editor/src/tiny-mce-editor.vue2.mjs.map +0 -1
  218. package/es/src/ui/button/index.mjs +0 -2
  219. package/es/src/ui/button/index.mjs.map +0 -1
  220. package/es/src/ui/checkbox/index.mjs +0 -2
  221. package/es/src/ui/checkbox/index.mjs.map +0 -1
  222. package/es/src/ui/dialog/index.mjs +0 -2
  223. package/es/src/ui/dialog/index.mjs.map +0 -1
  224. package/es/src/ui/input/index.mjs +0 -2
  225. package/es/src/ui/input/index.mjs.map +0 -1
  226. package/es/src/ui/input-number/index.mjs +0 -2
  227. package/es/src/ui/input-number/index.mjs.map +0 -1
  228. package/es/src/ui/layout/index.mjs +0 -2
  229. package/es/src/ui/layout/index.mjs.map +0 -1
  230. package/es/src/ui/link/index.mjs +0 -2
  231. package/es/src/ui/link/index.mjs.map +0 -1
  232. package/es/src/ui/popover/index.mjs +0 -2
  233. package/es/src/ui/popover/index.mjs.map +0 -1
  234. package/es/src/ui/radio/index.mjs +0 -2
  235. package/es/src/ui/radio/index.mjs.map +0 -1
  236. package/es/src/ui/scrollbar/index.mjs +0 -2
  237. package/es/src/ui/scrollbar/index.mjs.map +0 -1
  238. package/es/src/ui/select/index.mjs +0 -2
  239. package/es/src/ui/select/index.mjs.map +0 -1
  240. package/es/src/ui/table/index.mjs +0 -2
  241. package/es/src/ui/table/index.mjs.map +0 -1
  242. package/es/src/ui/tag/index.mjs +0 -2
  243. package/es/src/ui/tag/index.mjs.map +0 -1
  244. package/es/src/wc-bridge.mjs +0 -2
  245. package/es/src/wc-bridge.mjs.map +0 -1
  246. package/es/src/withInstall.mjs +0 -2
  247. package/es/src/withInstall.mjs.map +0 -1
  248. package/lib/node_modules/.pnpm/@iconify_vue@5.0.0_vue@3.5.18_typescript@5.9.2_/node_modules/@iconify/vue/dist/iconify.cjs +0 -2
  249. package/lib/node_modules/.pnpm/@iconify_vue@5.0.0_vue@3.5.18_typescript@5.9.2_/node_modules/@iconify/vue/dist/iconify.cjs.map +0 -1
  250. package/lib/node_modules/.pnpm/turndown@7.2.4/node_modules/turndown/lib/turndown.es.cjs +0 -2
  251. package/lib/node_modules/.pnpm/turndown@7.2.4/node_modules/turndown/lib/turndown.es.cjs.map +0 -1
  252. package/lib/package.json.cjs +0 -2
  253. package/lib/package.json.cjs.map +0 -1
  254. package/lib/src/alert/index.cjs +0 -2
  255. package/lib/src/alert/index.cjs.map +0 -1
  256. package/lib/src/alert/src/alert.cjs +0 -2
  257. package/lib/src/alert/src/alert.cjs.map +0 -1
  258. package/lib/src/components.cjs +0 -2
  259. package/lib/src/components.cjs.map +0 -1
  260. package/lib/src/data-chart/index.cjs +0 -2
  261. package/lib/src/data-chart/index.cjs.map +0 -1
  262. package/lib/src/defaults.cjs +0 -2
  263. package/lib/src/defaults.cjs.map +0 -1
  264. package/lib/src/dialog/src/dialog.cjs +0 -2
  265. package/lib/src/dialog/src/dialog.cjs.map +0 -1
  266. package/lib/src/feedback-plugin/index.cjs +0 -2
  267. package/lib/src/feedback-plugin/index.cjs.map +0 -1
  268. package/lib/src/file-upload/index.cjs +0 -2
  269. package/lib/src/file-upload/index.cjs.map +0 -1
  270. package/lib/src/icon/index.cjs +0 -2
  271. package/lib/src/icon/index.cjs.map +0 -1
  272. package/lib/src/icon/src/icon.cjs +0 -2
  273. package/lib/src/icon/src/icon.cjs.map +0 -1
  274. package/lib/src/image-upload/index.cjs +0 -2
  275. package/lib/src/image-upload/index.cjs.map +0 -1
  276. package/lib/src/make-installer.cjs +0 -2
  277. package/lib/src/make-installer.cjs.map +0 -1
  278. package/lib/src/message/src/message.cjs +0 -2
  279. package/lib/src/message/src/message.cjs.map +0 -1
  280. package/lib/src/photo-crop-tool/index.cjs +0 -2
  281. package/lib/src/photo-crop-tool/index.cjs.map +0 -1
  282. package/lib/src/tiny-mce-editor/index.cjs +0 -2
  283. package/lib/src/tiny-mce-editor/index.cjs.map +0 -1
  284. package/lib/src/tiny-mce-editor/src/tiny-mce-editor.vue.cjs +0 -2
  285. package/lib/src/tiny-mce-editor/src/tiny-mce-editor.vue.cjs.map +0 -1
  286. package/lib/src/tiny-mce-editor/src/tiny-mce-editor.vue2.cjs +0 -2
  287. package/lib/src/tiny-mce-editor/src/tiny-mce-editor.vue2.cjs.map +0 -1
  288. package/lib/src/ui/button/index.cjs +0 -2
  289. package/lib/src/ui/button/index.cjs.map +0 -1
  290. package/lib/src/ui/checkbox/index.cjs +0 -2
  291. package/lib/src/ui/checkbox/index.cjs.map +0 -1
  292. package/lib/src/ui/dialog/index.cjs +0 -2
  293. package/lib/src/ui/dialog/index.cjs.map +0 -1
  294. package/lib/src/ui/input/index.cjs +0 -2
  295. package/lib/src/ui/input/index.cjs.map +0 -1
  296. package/lib/src/ui/input-number/index.cjs +0 -2
  297. package/lib/src/ui/input-number/index.cjs.map +0 -1
  298. package/lib/src/ui/layout/index.cjs +0 -2
  299. package/lib/src/ui/layout/index.cjs.map +0 -1
  300. package/lib/src/ui/link/index.cjs +0 -2
  301. package/lib/src/ui/link/index.cjs.map +0 -1
  302. package/lib/src/ui/popover/index.cjs +0 -2
  303. package/lib/src/ui/popover/index.cjs.map +0 -1
  304. package/lib/src/ui/radio/index.cjs +0 -2
  305. package/lib/src/ui/radio/index.cjs.map +0 -1
  306. package/lib/src/ui/scrollbar/index.cjs +0 -2
  307. package/lib/src/ui/scrollbar/index.cjs.map +0 -1
  308. package/lib/src/ui/select/index.cjs +0 -2
  309. package/lib/src/ui/select/index.cjs.map +0 -1
  310. package/lib/src/ui/table/index.cjs +0 -2
  311. package/lib/src/ui/table/index.cjs.map +0 -1
  312. package/lib/src/ui/tag/index.cjs +0 -2
  313. package/lib/src/ui/tag/index.cjs.map +0 -1
  314. package/lib/src/wc-bridge.cjs +0 -2
  315. package/lib/src/wc-bridge.cjs.map +0 -1
  316. package/lib/src/withInstall.cjs +0 -2
  317. package/lib/src/withInstall.cjs.map +0 -1
  318. package/types/index.d.ts.map +0 -1
  319. package/types/src/alert/index.d.ts +0 -66
  320. package/types/src/alert/index.d.ts.map +0 -1
  321. package/types/src/alert/src/alert.d.ts +0 -73
  322. package/types/src/alert/src/alert.d.ts.map +0 -1
  323. package/types/src/components.d.ts +0 -10
  324. package/types/src/components.d.ts.map +0 -1
  325. package/types/src/data-chart/index.d.ts +0 -13
  326. package/types/src/data-chart/index.d.ts.map +0 -1
  327. package/types/src/defaults.d.ts +0 -6
  328. package/types/src/defaults.d.ts.map +0 -1
  329. package/types/src/dialog/index.d.ts +0 -3
  330. package/types/src/dialog/index.d.ts.map +0 -1
  331. package/types/src/dialog/src/dialog.d.ts +0 -25
  332. package/types/src/dialog/src/dialog.d.ts.map +0 -1
  333. package/types/src/feedback-plugin/index.d.ts +0 -9
  334. package/types/src/feedback-plugin/index.d.ts.map +0 -1
  335. package/types/src/file-upload/index.d.ts +0 -12
  336. package/types/src/file-upload/index.d.ts.map +0 -1
  337. package/types/src/icon/index.d.ts +0 -56
  338. package/types/src/icon/index.d.ts.map +0 -1
  339. package/types/src/icon/src/icon.d.ts +0 -62
  340. package/types/src/icon/src/icon.d.ts.map +0 -1
  341. package/types/src/image-upload/index.d.ts +0 -12
  342. package/types/src/image-upload/index.d.ts.map +0 -1
  343. package/types/src/make-installer.d.ts +0 -6
  344. package/types/src/make-installer.d.ts.map +0 -1
  345. package/types/src/message/index.d.ts +0 -3
  346. package/types/src/message/index.d.ts.map +0 -1
  347. package/types/src/message/src/message.d.ts +0 -21
  348. package/types/src/message/src/message.d.ts.map +0 -1
  349. package/types/src/message/src/toaster.vue.d.ts +0 -3
  350. package/types/src/message/src/toaster.vue.d.ts.map +0 -1
  351. package/types/src/photo-crop-tool/index.d.ts +0 -12
  352. package/types/src/photo-crop-tool/index.d.ts.map +0 -1
  353. package/types/src/subject-action/index.d.ts +0 -93
  354. package/types/src/subject-action/index.d.ts.map +0 -1
  355. package/types/src/subject-action/src/subject-action.vue.d.ts +0 -92
  356. package/types/src/subject-action/src/subject-action.vue.d.ts.map +0 -1
  357. package/types/src/subject-layout/index.d.ts +0 -30
  358. package/types/src/subject-layout/index.d.ts.map +0 -1
  359. package/types/src/subject-layout/src/subject-layout.vue.d.ts +0 -20
  360. package/types/src/subject-layout/src/subject-layout.vue.d.ts.map +0 -1
  361. package/types/src/subject-list/index.d.ts +0 -20
  362. package/types/src/subject-list/index.d.ts.map +0 -1
  363. package/types/src/subject-list/src/components/SubjectPageEnd.vue.d.ts +0 -24
  364. package/types/src/subject-list/src/components/SubjectPageEnd.vue.d.ts.map +0 -1
  365. package/types/src/subject-list/src/components/subject-blank-fill.vue.d.ts +0 -32
  366. package/types/src/subject-list/src/components/subject-blank-fill.vue.d.ts.map +0 -1
  367. package/types/src/subject-list/src/components/subject-scale.vue.d.ts +0 -29
  368. package/types/src/subject-list/src/components/subject-scale.vue.d.ts.map +0 -1
  369. package/types/src/subject-list/src/components/subject-single.vue.d.ts +0 -37
  370. package/types/src/subject-list/src/components/subject-single.vue.d.ts.map +0 -1
  371. package/types/src/subject-list/src/components/subject-text-fill.vue.d.ts +0 -34
  372. package/types/src/subject-list/src/components/subject-text-fill.vue.d.ts.map +0 -1
  373. package/types/src/subject-list/src/subject-list.vue.d.ts +0 -21
  374. package/types/src/subject-list/src/subject-list.vue.d.ts.map +0 -1
  375. package/types/src/subject-type/index.d.ts +0 -8
  376. package/types/src/subject-type/index.d.ts.map +0 -1
  377. package/types/src/subject-type/src/subject-type.vue.d.ts +0 -7
  378. package/types/src/subject-type/src/subject-type.vue.d.ts.map +0 -1
  379. package/types/src/tiny-mce-editor/index.d.ts +0 -20
  380. package/types/src/tiny-mce-editor/index.d.ts.map +0 -1
  381. package/types/src/tiny-mce-editor/src/tiny-mce-editor.vue.d.ts +0 -32
  382. package/types/src/tiny-mce-editor/src/tiny-mce-editor.vue.d.ts.map +0 -1
  383. package/types/src/ui/button/index.d.ts +0 -96
  384. package/types/src/ui/button/index.d.ts.map +0 -1
  385. package/types/src/ui/checkbox/index.d.ts +0 -111
  386. package/types/src/ui/checkbox/index.d.ts.map +0 -1
  387. package/types/src/ui/dialog/index.d.ts +0 -134
  388. package/types/src/ui/dialog/index.d.ts.map +0 -1
  389. package/types/src/ui/index.d.ts +0 -16
  390. package/types/src/ui/index.d.ts.map +0 -1
  391. package/types/src/ui/input/index.d.ts +0 -132
  392. package/types/src/ui/input/index.d.ts.map +0 -1
  393. package/types/src/ui/input-number/index.d.ts +0 -106
  394. package/types/src/ui/input-number/index.d.ts.map +0 -1
  395. package/types/src/ui/layout/index.d.ts +0 -373
  396. package/types/src/ui/layout/index.d.ts.map +0 -1
  397. package/types/src/ui/link/index.d.ts +0 -57
  398. package/types/src/ui/link/index.d.ts.map +0 -1
  399. package/types/src/ui/popover/index.d.ts +0 -89
  400. package/types/src/ui/popover/index.d.ts.map +0 -1
  401. package/types/src/ui/radio/index.d.ts +0 -84
  402. package/types/src/ui/radio/index.d.ts.map +0 -1
  403. package/types/src/ui/scrollbar/index.d.ts +0 -35
  404. package/types/src/ui/scrollbar/index.d.ts.map +0 -1
  405. package/types/src/ui/select/index.d.ts +0 -113
  406. package/types/src/ui/select/index.d.ts.map +0 -1
  407. package/types/src/ui/table/index.d.ts +0 -152
  408. package/types/src/ui/table/index.d.ts.map +0 -1
  409. package/types/src/ui/tag/index.d.ts +0 -69
  410. package/types/src/ui/tag/index.d.ts.map +0 -1
  411. package/types/src/wc-bridge.d.ts +0 -23
  412. package/types/src/wc-bridge.d.ts.map +0 -1
  413. package/types/src/withInstall.d.ts +0 -4
  414. package/types/src/withInstall.d.ts.map +0 -1
  415. package/types/tsconfig.tsbuildinfo +0 -1
@@ -1,2 +0,0 @@
1
- import{version as n}from"../package.json.mjs";function o(o){return{version:n,install:n=>{for(const t in o){const s=o[t];s&&"object"==typeof s&&"install"in s&&n.use(s)}}}}export{o as makeInstaller};
2
- //# sourceMappingURL=make-installer.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"make-installer.mjs","sources":["../../../../packages/components/src/make-installer.ts"],"sourcesContent":["import { version } from '../package.json'\n\nfunction makeInstaller(components: Record<string, any>) {\n const install = (app: any) => {\n for (const n in components) {\n const component = components[n]\n if (component && typeof component === 'object' && 'install' in component) {\n app.use(component)\n }\n }\n }\n\n return {\n version,\n install,\n }\n}\n\nexport { makeInstaller }\n"],"names":["makeInstaller","components","version","install","app","n","component","use"],"mappings":"8CAEA,SAASA,EAAcC,GAUrB,MAAO,CACLC,UACAC,QAXeC,IACf,IAAA,MAAWC,KAAKJ,EAAY,CAC1B,MAAMK,EAAYL,EAAWI,GACzBC,GAAkC,iBAAdA,GAA0B,YAAaA,GAC7DF,EAAIG,IAAID,EAEZ,GAOJ"}
@@ -1,2 +0,0 @@
1
- function t(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"info";const o=function(t){return"string"==typeof t?{message:t}:t}(t),s=function(t){switch(t){case"success":return{bgColor:"#ecfdf5",borderColor:"#a7f3d0",textColor:"#065f46"};case"warning":return{bgColor:"#fffbeb",borderColor:"#fde68a",textColor:"#92400e"};case"error":return{bgColor:"#fef2f2",borderColor:"#fecaca",textColor:"#991b1b"};default:return{bgColor:"#eff6ff",borderColor:"#bfdbfe",textColor:"#1e40af"}}}(e),a=document.getElementById("qxs-message-container")||function(){const t=document.createElement("div");return t.id="qxs-message-container",t.className="qxs-toast-container",document.body.appendChild(t),t}(),r=document.createElement("div");r.className=`qxs-toast qxs-toast--${e}`,r.setAttribute("role","status"),r.setAttribute("aria-live","polite");const i=document.createElement("div");i.className="qxs-toast__content";const c=document.createElement("span");c.className="qxs-toast__text",c.textContent=o.message;const l=document.createElement("button");l.className="qxs-toast__close",l.setAttribute("aria-label","Close"),l.type="button",l.innerHTML='<svg width="14" height="14" viewBox="0 0 14 14" fill="none"><path d="M3.5 3.5l7 7m0-7l-7 7" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/></svg>',i.append(c,l),r.appendChild(i),r.style.cssText=`\n --toast-bg: ${s.bgColor};\n --toast-border: ${s.borderColor};\n --toast-text: ${s.textColor};\n `,l.onclick=()=>n(r),a.appendChild(r),requestAnimationFrame(()=>{r.classList.add("qxs-toast--enter"),requestAnimationFrame(()=>{r.classList.remove("qxs-toast--enter")})});const d=o.duration??3e3,x=setTimeout(()=>{n(r)},d);return r.onmouseenter=()=>clearTimeout(x),r.onmouseleave=()=>{setTimeout(()=>n(r),1e3)},{close:()=>n(r)}}function n(t){t.classList.add("qxs-toast--leave"),setTimeout(()=>t.remove(),200)}const e=function(n){return t(n)};if(e.success=n=>t(n,"success"),e.warning=n=>t(n,"warning"),e.info=n=>t(n,"info"),e.error=n=>t(n,"error"),e.closeAll=()=>{document.querySelectorAll(".qxs-toast").forEach(t=>t.remove())},"undefined"!=typeof document&&!document.getElementById("qxs-toast-styles")){const t=document.createElement("style");t.id="qxs-toast-styles",t.textContent="\n .qxs-toast-container {\n position: fixed;\n top: 20px;\n right: 20px;\n z-index: 9999;\n display: flex;\n flex-direction: column;\n gap: 8px;\n max-width: 320px;\n width: auto;\n pointer-events: none;\n }\n\n .qxs-toast {\n position: relative;\n overflow: hidden;\n border-radius: 10px;\n border: 1px solid var(--toast-border);\n background: var(--toast-bg);\n box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(0, 0, 0, 0.02);\n pointer-events: all;\n animation: qxs-toast-in 0.3s cubic-bezier(0.21, 1.02, 0.73, 1);\n }\n\n .qxs-toast--enter {\n animation: qxs-toast-in 0.3s cubic-bezier(0.21, 1.02, 0.73, 1);\n }\n\n .qxs-toast--leave {\n animation: qxs-toast-out 0.2s cubic-bezier(0.21, 1.02, 0.73, 1) forwards;\n }\n\n .qxs-toast__content {\n display: flex;\n align-items: center;\n padding: 12px 14px;\n gap: 8px;\n }\n\n .qxs-toast__text {\n flex: 1;\n font-size: 14px;\n font-weight: 500;\n line-height: 1.5;\n color: var(--toast-text);\n }\n\n .qxs-toast__close {\n flex-shrink: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n width: 24px;\n height: 24px;\n padding: 0;\n margin: -4px -4px -4px 0;\n background: transparent;\n border: none;\n border-radius: 6px;\n cursor: pointer;\n color: var(--toast-text);\n opacity: 0.5;\n transition: all 0.15s;\n }\n\n .qxs-toast__close:hover {\n opacity: 1;\n background: rgba(0, 0, 0, 0.05);\n }\n\n @keyframes qxs-toast-in {\n 0% {\n opacity: 0;\n transform: translateX(100%) scale(0.95);\n }\n 100% {\n opacity: 1;\n transform: translateX(0) scale(1);\n }\n }\n\n @keyframes qxs-toast-out {\n 0% {\n opacity: 1;\n transform: translateX(0) scale(1);\n }\n 100% {\n opacity: 0;\n transform: translateX(100%) scale(0.95);\n }\n }\n\n @media (max-width: 480px) {\n .qxs-toast-container {\n top: 10px;\n right: 10px;\n left: 10px;\n max-width: none;\n }\n }\n ",document.head.appendChild(t)}export{e as QxsMessage,e as default};
2
- //# sourceMappingURL=message.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"message.mjs","sources":["../../../../../../packages/components/src/message/src/message.ts"],"sourcesContent":["export interface QxsMessageOptions {\n message: string\n duration?: number\n}\n\nexport type QxsMessageParams = QxsMessageOptions | string\n\ninterface QxsMessageInstance {\n close: () => void\n}\n\nfunction normalizeParams(params: QxsMessageParams): QxsMessageOptions {\n return typeof params === 'string' ? { message: params } : params\n}\n\nfunction getTypeConfig(type: string) {\n switch (type) {\n case 'success':\n return {\n bgColor: '#ecfdf5',\n borderColor: '#a7f3d0',\n textColor: '#065f46',\n }\n case 'warning':\n return {\n bgColor: '#fffbeb',\n borderColor: '#fde68a',\n textColor: '#92400e',\n }\n case 'error':\n return {\n bgColor: '#fef2f2',\n borderColor: '#fecaca',\n textColor: '#991b1b',\n }\n case 'info':\n default:\n return {\n bgColor: '#eff6ff',\n borderColor: '#bfdbfe',\n textColor: '#1e40af',\n }\n }\n}\n\nfunction createMessage(params: QxsMessageParams, type: 'success' | 'warning' | 'info' | 'error' = 'info'): QxsMessageInstance {\n const options = normalizeParams(params)\n const config = getTypeConfig(type)\n\n const container = document.getElementById('qxs-message-container') || createContainer()\n\n const messageEl = document.createElement('div')\n messageEl.className = `qxs-toast qxs-toast--${type}`\n messageEl.setAttribute('role', 'status')\n messageEl.setAttribute('aria-live', 'polite')\n\n const content = document.createElement('div')\n content.className = 'qxs-toast__content'\n\n const text = document.createElement('span')\n text.className = 'qxs-toast__text'\n text.textContent = options.message\n\n const closeBtn = document.createElement('button')\n closeBtn.className = 'qxs-toast__close'\n closeBtn.setAttribute('aria-label', 'Close')\n closeBtn.type = 'button'\n closeBtn.innerHTML = '<svg width=\"14\" height=\"14\" viewBox=\"0 0 14 14\" fill=\"none\"><path d=\"M3.5 3.5l7 7m0-7l-7 7\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\"/></svg>'\n\n content.append(text, closeBtn)\n messageEl.appendChild(content)\n\n messageEl.style.cssText = `\n --toast-bg: ${config.bgColor};\n --toast-border: ${config.borderColor};\n --toast-text: ${config.textColor};\n `\n\n closeBtn.onclick = () => removeMessage(messageEl)\n\n container.appendChild(messageEl)\n\n requestAnimationFrame(() => {\n messageEl.classList.add('qxs-toast--enter')\n requestAnimationFrame(() => {\n messageEl.classList.remove('qxs-toast--enter')\n })\n })\n\n const duration = options.duration ?? 3000\n\n const timer = setTimeout(() => {\n removeMessage(messageEl)\n }, duration)\n\n messageEl.onmouseenter = () => clearTimeout(timer)\n messageEl.onmouseleave = () => {\n setTimeout(() => removeMessage(messageEl), 1000)\n }\n\n return {\n close: () => removeMessage(messageEl),\n }\n}\n\nfunction createContainer(): HTMLElement {\n const container = document.createElement('div')\n container.id = 'qxs-message-container'\n container.className = 'qxs-toast-container'\n document.body.appendChild(container)\n return container\n}\n\nfunction removeMessage(el: HTMLElement) {\n el.classList.add('qxs-toast--leave')\n setTimeout(() => el.remove(), 200)\n}\n\nexport interface QxsMessageFunction {\n (params: QxsMessageParams): QxsMessageInstance\n success: (params: QxsMessageParams) => QxsMessageInstance\n warning: (params: QxsMessageParams) => QxsMessageInstance\n info: (params: QxsMessageParams) => QxsMessageInstance\n error: (params: QxsMessageParams) => QxsMessageInstance\n closeAll: () => void\n}\n\nconst QxsMessage = function (params: QxsMessageParams): QxsMessageInstance {\n return createMessage(params)\n} as QxsMessageFunction\n\nQxsMessage.success = (params: QxsMessageParams) => createMessage(params, 'success')\nQxsMessage.warning = (params: QxsMessageParams) => createMessage(params, 'warning')\nQxsMessage.info = (params: QxsMessageParams) => createMessage(params, 'info')\nQxsMessage.error = (params: QxsMessageParams) => createMessage(params, 'error')\nQxsMessage.closeAll = () => {\n document.querySelectorAll('.qxs-toast').forEach(el => el.remove())\n}\n\nexport { QxsMessage }\nexport type { QxsMessageInstance }\nexport default QxsMessage\n\nif (typeof document !== 'undefined' && !document.getElementById('qxs-toast-styles')) {\n const style = document.createElement('style')\n style.id = 'qxs-toast-styles'\n style.textContent = `\n .qxs-toast-container {\n position: fixed;\n top: 20px;\n right: 20px;\n z-index: 9999;\n display: flex;\n flex-direction: column;\n gap: 8px;\n max-width: 320px;\n width: auto;\n pointer-events: none;\n }\n\n .qxs-toast {\n position: relative;\n overflow: hidden;\n border-radius: 10px;\n border: 1px solid var(--toast-border);\n background: var(--toast-bg);\n box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(0, 0, 0, 0.02);\n pointer-events: all;\n animation: qxs-toast-in 0.3s cubic-bezier(0.21, 1.02, 0.73, 1);\n }\n\n .qxs-toast--enter {\n animation: qxs-toast-in 0.3s cubic-bezier(0.21, 1.02, 0.73, 1);\n }\n\n .qxs-toast--leave {\n animation: qxs-toast-out 0.2s cubic-bezier(0.21, 1.02, 0.73, 1) forwards;\n }\n\n .qxs-toast__content {\n display: flex;\n align-items: center;\n padding: 12px 14px;\n gap: 8px;\n }\n\n .qxs-toast__text {\n flex: 1;\n font-size: 14px;\n font-weight: 500;\n line-height: 1.5;\n color: var(--toast-text);\n }\n\n .qxs-toast__close {\n flex-shrink: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n width: 24px;\n height: 24px;\n padding: 0;\n margin: -4px -4px -4px 0;\n background: transparent;\n border: none;\n border-radius: 6px;\n cursor: pointer;\n color: var(--toast-text);\n opacity: 0.5;\n transition: all 0.15s;\n }\n\n .qxs-toast__close:hover {\n opacity: 1;\n background: rgba(0, 0, 0, 0.05);\n }\n\n @keyframes qxs-toast-in {\n 0% {\n opacity: 0;\n transform: translateX(100%) scale(0.95);\n }\n 100% {\n opacity: 1;\n transform: translateX(0) scale(1);\n }\n }\n\n @keyframes qxs-toast-out {\n 0% {\n opacity: 1;\n transform: translateX(0) scale(1);\n }\n 100% {\n opacity: 0;\n transform: translateX(100%) scale(0.95);\n }\n }\n\n @media (max-width: 480px) {\n .qxs-toast-container {\n top: 10px;\n right: 10px;\n left: 10px;\n max-width: none;\n }\n }\n `\n document.head.appendChild(style)\n}\n"],"names":["createMessage","params","type","arguments","length","undefined","options","message","normalizeParams","config","bgColor","borderColor","textColor","getTypeConfig","container","document","getElementById","createElement","id","className","body","appendChild","createContainer","messageEl","setAttribute","content","text","textContent","closeBtn","innerHTML","append","style","cssText","onclick","removeMessage","requestAnimationFrame","classList","add","remove","duration","timer","setTimeout","onmouseenter","clearTimeout","onmouseleave","close","el","QxsMessage","success","warning","info","error","closeAll","querySelectorAll","forEach","head"],"mappings":"AA6CA,SAASA,EAAcC,GAAuG,IAA7EC,EAAAC,UAAAC,OAAA,QAAAC,IAAAF,UAAA,GAAAA,UAAA,GAAiD,OAChG,MAAMG,EAnCR,SAAyBL,GACvB,MAAyB,iBAAXA,EAAsB,CAAEM,QAASN,GAAWA,CAC5D,CAiCkBO,CAAgBP,GAC1BQ,EAhCR,SAAuBP,GACrB,OAAQA,GACN,IAAK,UACH,MAAO,CACLQ,QAAS,UACTC,YAAa,UACbC,UAAW,WAEf,IAAK,UACH,MAAO,CACLF,QAAS,UACTC,YAAa,UACbC,UAAW,WAEf,IAAK,QACH,MAAO,CACLF,QAAS,UACTC,YAAa,UACbC,UAAW,WAGf,QACE,MAAO,CACLF,QAAS,UACTC,YAAa,UACbC,UAAW,WAGnB,CAIiBC,CAAcX,GAEvBY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,EAAcC,EAAQ,WACzE8C,EAAWE,QAAWhD,GAA6BD,EAAcC,EAAQ,WACzE8C,EAAWG,KAAQjD,GAA6BD,EAAcC,EAAQ,QACtE8C,EAAWI,MAASlD,GAA6BD,EAAcC,EAAQ,SACvE8C,EAAWK,SAAW,KACpBrC,SAASsC,iBAAiB,cAAcC,QAAQR,GAAMA,EAAGR,WAOnC,oBAAbvB,WAA6BA,SAASC,eAAe,oBAAqB,CACnF,MAAMe,EAAQhB,SAASE,cAAc,SACrCc,EAAMb,GAAK,mBACXa,EAAMJ,YAAc,ouEAsGpBZ,SAASwC,KAAKlC,YAAYU,EAC5B"}
@@ -1,2 +0,0 @@
1
- import"@qxs-bns/components-wc";import{withInstall as o}from"../withInstall.mjs";import{createCustomElementBridge as e,createNullableProp as t}from"../wc-bridge.mjs";const p=o(e({name:"QxsPhotoCropTool",tag:"qxs-photo-crop-tool",props:{imgFile:t(),aspectRatio:t(),defaultWidth:t(),defaultHeight:t(),zoomType:t()},createExpose:o=>({getElement:()=>o.value,crop:()=>o.value?.crop?.(),resize:()=>o.value?.resize?.()})}));export{p as QxsPhotoCropTool,p as default};
2
- //# sourceMappingURL=index.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.mjs","sources":["../../../../../packages/components/src/photo-crop-tool/index.ts"],"sourcesContent":["import '@qxs-bns/components-wc'\nimport { withInstall } from '../withInstall'\nimport { createCustomElementBridge, createNullableProp } from '../wc-bridge'\n\nconst component = createCustomElementBridge({\n name: 'QxsPhotoCropTool',\n tag: 'qxs-photo-crop-tool',\n props: {\n imgFile: createNullableProp<File | null>(),\n aspectRatio: createNullableProp<string>(),\n defaultWidth: createNullableProp<number>(),\n defaultHeight: createNullableProp<number>(),\n zoomType: createNullableProp<'fixed' | 'free'>(),\n },\n createExpose: elementRef => ({\n getElement: () => elementRef.value,\n crop: () => (elementRef.value as any)?.crop?.(),\n resize: () => (elementRef.value as any)?.resize?.(),\n }),\n})\n\nexport const QxsPhotoCropTool = withInstall(component)\n\nexport default QxsPhotoCropTool\n"],"names":["QxsPhotoCropTool","withInstall","createCustomElementBridge","name","tag","props","imgFile","createNullableProp","aspectRatio","defaultWidth","defaultHeight","zoomType","createExpose","elementRef","getElement","value","crop","resize"],"mappings":"qKAIA,MAiBaA,EAAmBC,EAjBdC,EAA0B,CAC1CC,KAAM,mBACNC,IAAK,sBACLC,MAAO,CACLC,QAASC,IACTC,YAAaD,IACbE,aAAcF,IACdG,cAAeH,IACfI,SAAUJ,KAEZK,aAAcC,IAAA,CACZC,WAAYA,IAAMD,EAAWE,MAC7BC,KAAMA,IAAOH,EAAWE,OAAeC,SACvCC,OAAQA,IAAOJ,EAAWE,OAAeE"}
@@ -1,2 +0,0 @@
1
- import{withInstall as t}from"../withInstall.mjs";import m from"./src/tiny-mce-editor.vue.mjs";const o=t(m);export{o as QxsTinyMceEditor,o as default};
2
- //# sourceMappingURL=index.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.mjs","sources":["../../../../../packages/components/src/tiny-mce-editor/index.ts"],"sourcesContent":["import { withInstall } from '../withInstall'\nimport component from './src/tiny-mce-editor.vue'\n\nconst QxsTinyMceEditor = withInstall(component)\n\nexport {\n QxsTinyMceEditor,\n}\n\nexport default QxsTinyMceEditor\n"],"names":["QxsTinyMceEditor","withInstall","component"],"mappings":"8FAGA,MAAMA,EAAmBC,EAAYC"}
@@ -1,2 +0,0 @@
1
- import{defineComponent as e,shallowRef as t,ref as i,computed as n,watch as a,onMounted as l,onBeforeUnmount as o,createElementBlock as r,openBlock as s,normalizeClass as m,unref as u,createCommentVNode as c,withDirectives as p,createElementVNode as d,vModelText as g}from"vue";import{useNamespace as y}from"@qxs-bns/hooks";import{merge as f}from"lodash-es";import h from"tinymce/tinymce";import"tinymce/themes/silver/theme";import"tinymce/icons/default/icons";import"tinymce/models/dom";import"tinymce/plugins/autolink";import"tinymce/plugins/autoresize";import"tinymce/plugins/fullscreen";import"tinymce/plugins/image";import"tinymce/plugins/insertdatetime";import"tinymce/plugins/link";import"tinymce/plugins/lists";import"tinymce/plugins/media";import"tinymce/plugins/preview";import"tinymce/plugins/table";import"tinymce/plugins/wordcount";import"tinymce/plugins/code";import"tinymce/plugins/searchreplace";import"tinymce/plugins/nonbreaking";const v=["id","name"];var b=e({name:"QxsTinyMceEditor",__name:"tiny-mce-editor",props:{modelValue:{type:String,required:!0,default:""},config:{type:Object,required:!1,default:()=>({})},assetsBasePath:{type:String,required:!1,default:""}},emits:["update:modelValue"],setup(e,{emit:b}){const k=b,_=y("tiny-mce-editor"),x=e.assetsBasePath||"node_modules/",w=t(null),S=i(`tiny-mce-textarea-${Date.now()}-${Math.random().toString(36).substr(2,9)}`),V=n({get:()=>e.modelValue,set(e){k("update:modelValue",e)}}),$={selector:`textarea#${S.value}`,promotion:!1,license_key:"gpl",elementpath:!1,language:"zh-Hans",language_url:`${x}tinymce/langs/zh-Hans.js`,skin_url:`${x}tinymce/skins/ui/oxide`,content_css:`${x}tinymce/skins/content/default/content.min.css`,min_height:300,max_height:700,plugins:"autolink autoresize fullscreen image insertdatetime link lists media preview table wordcount code searchreplace nonbreaking",toolbar:"undo redo | bold italic underline strikethrough | blocks | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | forecolor backcolor removeformat | link image media table insertdatetime searchreplace | preview code",branding:!1,autoresize:!0,menubar:!1,nonbreaking_force_tab:!0,toolbar_mode:"sliding",insertdatetime_formats:["%Y年%m月%d日","%H点%M分%S秒","%Y-%m-%d","%H:%M:%S"],setup:t=>{t.on("init",()=>{w.value=t,t.setContent(V.value)}),t.on("input change undo redo",()=>{V.value=t.getContent()}),e.config?.expandSetup?.(t)}},z=n(()=>{const t=$;return e.config.images_upload_handler||("string"==typeof t.plugins?t.plugins=t.plugins.replace("image",""):Array.isArray(t.plugins)&&(t.plugins=t.plugins.filter(e=>"image"!==e))),f(t,e.config)});return a(()=>e.modelValue,e=>{try{w.value&&e!==w.value?.getContent()&&w.value.setContent(e)}catch(e){}}),l(async()=>{"undefined"!=typeof window&&h.init(z.value)}),o(()=>{w.value&&(w.value.destroy(),w.value=null)}),(e,t)=>(s(),r("div",{class:m(u(_).e("tiny-mce"))},[c(" 使用动态生成的 id "),p(d("textarea",{id:S.value,"onUpdate:modelValue":t[0]||(t[0]=e=>V.value=e),name:S.value},null,8,v),[[g,V.value]])],2))}});export{b as default};
2
- //# sourceMappingURL=tiny-mce-editor.vue.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tiny-mce-editor.vue.mjs","sources":["../../../../../../packages/components/src/tiny-mce-editor/src/tiny-mce-editor.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { Editor, RawEditorOptions } from 'tinymce/tinymce'\nimport { useNamespace } from '@qxs-bns/hooks'\nimport { merge } from 'lodash-es'\nimport tinymce from 'tinymce/tinymce'\nimport { computed, onBeforeUnmount, onMounted, ref, shallowRef, watch } from 'vue'\n\n// 导入核心功能\nimport 'tinymce/themes/silver/theme'\nimport 'tinymce/icons/default/icons'\nimport 'tinymce/models/dom'\n\nimport 'tinymce/plugins/autolink'\nimport 'tinymce/plugins/autoresize'\nimport 'tinymce/plugins/fullscreen'\nimport 'tinymce/plugins/image'\nimport 'tinymce/plugins/insertdatetime'\nimport 'tinymce/plugins/link'\nimport 'tinymce/plugins/lists'\nimport 'tinymce/plugins/media'\nimport 'tinymce/plugins/preview'\nimport 'tinymce/plugins/table'\nimport 'tinymce/plugins/wordcount'\nimport 'tinymce/plugins/code'\nimport 'tinymce/plugins/searchreplace'\nimport 'tinymce/plugins/nonbreaking'\n// 导入语言包\n\ndefineOptions({\n name: 'QxsTinyMceEditor',\n})\n\nconst {\n modelValue = '',\n config = {},\n assetsBasePath = '',\n} = defineProps<{\n modelValue: string\n config?: RawEditorOptions & {\n expandSetup?: RawEditorOptions['setup']\n }\n assetsBasePath?: string\n}>()\n\nconst emit = defineEmits(['update:modelValue'])\n\nconst ns = useNamespace('tiny-mce-editor')\n\nconst colorScheme = 'light'\nconst basePath = assetsBasePath || 'node_modules/'\n// 存储编辑器实例的引用\nconst editorInstance = shallowRef<Editor | null>(null)\n// 生成唯一的 id\nconst uniqueId = ref(\n `tiny-mce-textarea-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`,\n)\n\nconst content = computed({\n get() {\n return modelValue\n },\n set(val) {\n emit('update:modelValue', val)\n },\n})\n\nconst defaultSetting: RawEditorOptions = {\n // 使用动态生成的 id\n selector: `textarea#${uniqueId.value}`,\n promotion: false, // 禁用推广信息\n license_key: 'gpl',\n elementpath: false,\n language: 'zh-Hans',\n language_url: `${basePath}tinymce/langs/zh-Hans.js`,\n skin_url: `${basePath}${\n colorScheme === 'light' ? 'tinymce/skins/ui/oxide' : 'tinymce/skins/ui/oxide-dark'\n }`,\n content_css: `${basePath}${\n colorScheme === 'light'\n ? 'tinymce/skins/content/default/content.min.css'\n : 'tinymce/skins/content/dark/content.min.css'\n }`,\n min_height: 300,\n max_height: 700,\n plugins:\n 'autolink autoresize fullscreen image insertdatetime link lists media preview table wordcount code searchreplace nonbreaking',\n toolbar:\n 'undo redo | bold italic underline strikethrough | blocks | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | forecolor backcolor removeformat | link image media table insertdatetime searchreplace | preview code',\n branding: false,\n autoresize: true,\n menubar: false,\n nonbreaking_force_tab: true,\n toolbar_mode: 'sliding',\n insertdatetime_formats: [\n '%Y年%m月%d日',\n '%H点%M分%S秒',\n '%Y-%m-%d',\n '%H:%M:%S',\n ],\n // https://www.tiny.cloud/docs/tinymce/6/file-image-upload/#images_upload_handler\n // images_upload_handler: async (blobInfo: any, progress: any) => {\n // // blobInfo, succFun, failFun, progress\n // const files = blobInfo.blob()\n // const formData = new FormData()\n // formData.append('image', files)\n\n // const { res, error } = await useApi({\n // // ...commonUrls.uploadImage,\n // params: {\n // bucketType: classify,\n // },\n // data: formData,\n // onUploadProgress: (e: any) => {\n // progress((e.loaded / e.total) * 100)\n // },\n // })\n // if (res) {\n // const { normal } = res\n // console.log('normal: ', res)\n // return normal\n // }\n // if (error) {\n // console.log(error.message)\n // return Promise.reject(error.message)\n // }\n // },\n setup: (editor: Editor) => {\n // 编辑器初始化完成后设置内容\n editor.on('init', () => {\n // 保存编辑器实例\n editorInstance.value = editor\n editor.setContent(content.value)\n })\n\n // 监听编辑器内容变化\n editor.on('input change undo redo', () => {\n content.value = editor.getContent()\n })\n\n config?.expandSetup?.(editor)\n },\n}\n\nconst initSetting = computed(() => {\n const dealDefaultSetting = defaultSetting\n if (!config.images_upload_handler) {\n // 删除 image 图片 plugin\n if (typeof dealDefaultSetting.plugins === 'string') {\n dealDefaultSetting.plugins = dealDefaultSetting.plugins.replace(\n 'image',\n '',\n )\n }\n else if (Array.isArray(dealDefaultSetting.plugins)) {\n dealDefaultSetting.plugins = dealDefaultSetting.plugins.filter(\n plugin => plugin !== 'image',\n )\n }\n }\n return merge(dealDefaultSetting, config)\n})\n\n// 监听 modelValue 的变化\nwatch(() => modelValue, (newVal) => {\n try {\n // 确保编辑器已初始化且内容确实发生变化\n if (editorInstance.value && newVal !== editorInstance.value?.getContent()) {\n editorInstance.value.setContent(newVal)\n }\n }\n catch (error) {\n console.error('设置编辑器内容时出错:', error)\n }\n})\n\nonMounted(async () => {\n if (typeof window !== 'undefined') {\n tinymce.init(initSetting.value)\n }\n})\n\n// 组件卸载时清理\nonBeforeUnmount(() => {\n if (editorInstance.value) {\n editorInstance.value.destroy()\n editorInstance.value = null\n }\n})\n</script>\n\n<template>\n <div :class=\"ns.e('tiny-mce')\">\n <!-- 使用动态生成的 id -->\n <textarea\n :id=\"uniqueId\"\n v-model=\"content\"\n :name=\"uniqueId\"\n />\n </div>\n</template>\n"],"names":["emit","__emit","ns","useNamespace","basePath","__props","assetsBasePath","editorInstance","shallowRef","uniqueId","ref","Date","now","Math","random","toString","substr","content","computed","get","modelValue","set","val","defaultSetting","selector","value","promotion","license_key","elementpath","language","language_url","skin_url","content_css","min_height","max_height","plugins","toolbar","branding","autoresize","menubar","nonbreaking_force_tab","toolbar_mode","insertdatetime_formats","setup","editor","on","setContent","getContent","config","expandSetup","initSetting","dealDefaultSetting","images_upload_handler","replace","Array","isArray","filter","plugin","merge","watch","newVal","error","onMounted","async","window","tinymce","init","onBeforeUnmount","destroy","_createElementBlock","class","_normalizeClass","_unref","e","_createCommentVNode","_createElementVNode","id","$event","name"],"mappings":"gtCA4CA,MAAMA,EAAOC,EAEPC,EAAKC,EAAa,mBAGlBC,EAAWC,EAAAC,gBAAkB,gBAE7BC,EAAiBC,EAA0B,MAE3CC,EAAWC,EACf,qBAAqBC,KAAKC,SAASC,KAAKC,SAASC,SAAS,IAAIC,OAAO,EAAG,MAGpEC,EAAUC,EAAS,CACvBC,IAAA,IACSd,EAAAe,WAET,GAAAC,CAAIC,GACFtB,EAAK,oBAAqBsB,EAC5B,IAGIC,EAAmC,CAEvCC,SAAU,YAAYf,EAASgB,QAC/BC,WAAW,EACXC,YAAa,MACbC,aAAa,EACbC,SAAU,UACVC,aAAc,GAAG1B,4BACjB2B,SAAU,GAAG3B,0BAGb4B,YAAa,GAAG5B,iDAKhB6B,WAAY,IACZC,WAAY,IACZC,QACE,8HACFC,QACE,oPACFC,UAAU,EACVC,YAAY,EACZC,SAAS,EACTC,uBAAuB,EACvBC,aAAc,UACdC,uBAAwB,CACtB,YACA,YACA,WACA,YA6BFC,MAAQC,IAENA,EAAOC,GAAG,OAAQ,KAEhBtC,EAAekB,MAAQmB,EACvBA,EAAOE,WAAW7B,EAAQQ,SAI5BmB,EAAOC,GAAG,yBAA0B,KAClC5B,EAAQQ,MAAQmB,EAAOG,eAGzB1C,EAAA2C,QAAQC,cAAcL,KAIpBM,EAAchC,EAAS,KAC3B,MAAMiC,EAAqB5B,EAe3B,OAdKlB,EAAA2C,OAAOI,wBAEgC,iBAA/BD,EAAmBhB,QAC5BgB,EAAmBhB,QAAUgB,EAAmBhB,QAAQkB,QACtD,QACA,IAGKC,MAAMC,QAAQJ,EAAmBhB,WACxCgB,EAAmBhB,QAAUgB,EAAmBhB,QAAQqB,UACjC,UAAXC,KAITC,EAAMP,EAAoB9C,EAAA2C,iBAInCW,EAAM,IAAMtD,EAAAe,WAAawC,IACvB,IAEMrD,EAAekB,OAASmC,IAAWrD,EAAekB,OAAOsB,cAC3DxC,EAAekB,MAAMqB,WAAWc,EAEpC,OACOC,GAEP,IAGFC,EAAUC,UACc,oBAAXC,QACTC,EAAQC,KAAKhB,EAAYzB,SAK7B0C,EAAgB,KACV5D,EAAekB,QACjBlB,EAAekB,MAAM2C,UACrB7D,EAAekB,MAAQ,oBAMzB4C,EAOM,MAAA,CAPAC,MAAKC,EAAEC,EAAAtE,GAAGuE,EAAC,eACfC,EAAA,kBACAC,EAIE,WAAA,CAHCC,GAAInE,EAAAgB,2CACIR,EAAOQ,MAAAoD,GACfC,KAAMrE,EAAAgB,qBADER,EAAAQ"}
@@ -1,2 +0,0 @@
1
- import e from"./tiny-mce-editor.vue.mjs";export{e as default};
2
- //# sourceMappingURL=tiny-mce-editor.vue2.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tiny-mce-editor.vue2.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- import{defineComponent as t,h as e}from"vue";const l=t({name:"QxsButton",props:{type:{type:String,default:"default"},size:{type:String,default:"default"},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},plain:{type:Boolean,default:!1},round:{type:Boolean,default:!1},circle:{type:Boolean,default:!1},nativeType:{type:String,default:"button"},icon:{type:[String,Object],default:""}},emits:["click"],setup(t,l){let{slots:o,emit:a}=l;const i=e=>{t.disabled||t.loading||a("click",e)};return()=>e("button",{class:["qxs-button",`qxs-button--${t.type}`,`qxs-button--${t.size}`,{"is-disabled":t.disabled,"is-loading":t.loading,"is-plain":t.plain,"is-round":t.round,"is-circle":t.circle}],disabled:t.disabled||t.loading,type:t.nativeType,onClick:i},[t.loading&&e("span",{class:"qxs-button__loading"},[e("svg",{class:"qxs-button__loading-icon",viewBox:"0 0 24 24"},[e("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"2",fill:"none","stroke-dasharray":"60","stroke-dashoffset":"20"})])]),o.default?.()])}});export{l as QxsButton,l as default};
2
- //# sourceMappingURL=index.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.mjs","sources":["../../../../../../packages/components/src/ui/button/index.ts"],"sourcesContent":["import { defineComponent, h, type PropType, type VNode } from 'vue'\n\nexport type ButtonType = 'primary' | 'success' | 'warning' | 'danger' | 'info' | 'default'\nexport type ButtonSize = 'large' | 'default' | 'small'\n\nexport const QxsButton = defineComponent({\n name: 'QxsButton',\n props: {\n type: { type: String as PropType<ButtonType>, default: 'default' },\n size: { type: String as PropType<ButtonSize>, default: 'default' },\n disabled: { type: Boolean, default: false },\n loading: { type: Boolean, default: false },\n plain: { type: Boolean, default: false },\n round: { type: Boolean, default: false },\n circle: { type: Boolean, default: false },\n nativeType: { type: String as PropType<'button' | 'submit' | 'reset'>, default: 'button' },\n icon: { type: [String, Object] as PropType<string | VNode>, default: '' },\n },\n emits: ['click'],\n setup(props, { slots, emit }) {\n const handleClick = (e: MouseEvent) => {\n if (!props.disabled && !props.loading) {\n emit('click', e)\n }\n }\n\n return () => h('button', {\n class: [\n 'qxs-button',\n `qxs-button--${props.type}`,\n `qxs-button--${props.size}`,\n {\n 'is-disabled': props.disabled,\n 'is-loading': props.loading,\n 'is-plain': props.plain,\n 'is-round': props.round,\n 'is-circle': props.circle,\n },\n ],\n disabled: props.disabled || props.loading,\n type: props.nativeType,\n onClick: handleClick,\n }, [\n props.loading && h('span', { class: 'qxs-button__loading' }, [\n h('svg', { class: 'qxs-button__loading-icon', viewBox: '0 0 24 24' }, [\n h('circle', { 'cx': '12', 'cy': '12', 'r': '10', 'stroke': 'currentColor', 'stroke-width': '2', 'fill': 'none', 'stroke-dasharray': '60', 'stroke-dashoffset': '20' }),\n ]),\n ]),\n slots.default?.(),\n ])\n },\n})\n\nexport default QxsButton\n"],"names":["QxsButton","defineComponent","name","props","type","String","default","size","disabled","Boolean","loading","plain","round","circle","nativeType","icon","Object","emits","setup","_ref","slots","emit","handleClick","e","h","class","onClick","viewBox","cx","cy","r","stroke","fill"],"mappings":"6CAKO,MAAMA,EAAYC,EAAgB,CACvCC,KAAM,YACNC,MAAO,CACLC,KAAM,CAAEA,KAAMC,OAAgCC,QAAS,WACvDC,KAAM,CAAEH,KAAMC,OAAgCC,QAAS,WACvDE,SAAU,CAAEJ,KAAMK,QAASH,SAAS,GACpCI,QAAS,CAAEN,KAAMK,QAASH,SAAS,GACnCK,MAAO,CAAEP,KAAMK,QAASH,SAAS,GACjCM,MAAO,CAAER,KAAMK,QAASH,SAAS,GACjCO,OAAQ,CAAET,KAAMK,QAASH,SAAS,GAClCQ,WAAY,CAAEV,KAAMC,OAAmDC,QAAS,UAChFS,KAAM,CAAEX,KAAM,CAACC,OAAQW,QAAqCV,QAAS,KAEvEW,MAAO,CAAC,SACRC,KAAAA,CAAMf,EAAAgB,GAAwB,IAAjBC,MAAEA,EAAAC,KAAOA,GAAKF,EACzB,MAAMG,EAAeC,IACdpB,EAAMK,UAAaL,EAAMO,SAC5BW,EAAK,QAASE,IAIlB,MAAO,IAAMC,EAAE,SAAU,CACvBC,MAAO,CACL,aACA,eAAetB,EAAMC,OACrB,eAAeD,EAAMI,OACrB,CACE,cAAeJ,EAAMK,SACrB,aAAcL,EAAMO,QACpB,WAAYP,EAAMQ,MAClB,WAAYR,EAAMS,MAClB,YAAaT,EAAMU,SAGvBL,SAAUL,EAAMK,UAAYL,EAAMO,QAClCN,KAAMD,EAAMW,WACZY,QAASJ,GACR,CACDnB,EAAMO,SAAWc,EAAE,OAAQ,CAAEC,MAAO,uBAAyB,CAC3DD,EAAE,MAAO,CAAEC,MAAO,2BAA4BE,QAAS,aAAe,CACpEH,EAAE,SAAU,CAAEI,GAAM,KAAMC,GAAM,KAAMC,EAAK,KAAMC,OAAU,eAAgB,eAAgB,IAAKC,KAAQ,OAAQ,mBAAoB,KAAM,oBAAqB,WAGnKZ,EAAMd,aAEV"}
@@ -1,2 +0,0 @@
1
- import{defineComponent as e,h as l}from"vue";const a=e({name:"QxsCheckbox",props:{modelValue:{type:[Boolean,String,Number,Array],default:!1},disabled:{type:Boolean,default:!1},label:{type:[String,Number,Boolean],default:""},indeterminate:{type:Boolean,default:!1},trueLabel:{type:[String,Number],default:void 0},falseLabel:{type:[String,Number],default:void 0}},emits:["update:modelValue","change"],setup(e,a){let{slots:t,emit:d}=a;const o=()=>Array.isArray(e.modelValue)?e.modelValue.includes(e.label):void 0!==e.trueLabel||void 0!==e.falseLabel?e.modelValue===e.trueLabel:Boolean(e.modelValue),s=l=>{if(e.disabled)return;const a=l.target.checked;if(Array.isArray(e.modelValue)){const l=[...e.modelValue];if(a)l.push(e.label);else{const a=l.indexOf(e.label);a>-1&&l.splice(a,1)}d("update:modelValue",l),d("change",l)}else if(void 0!==e.trueLabel||void 0!==e.falseLabel){const l=a?e.trueLabel:e.falseLabel;d("update:modelValue",l),d("change",l)}else d("update:modelValue",a),d("change",a)};return()=>l("label",{class:["qxs-checkbox",{"is-checked":o(),"is-disabled":e.disabled,"is-indeterminate":e.indeterminate}],style:{display:"inline-flex",alignItems:"center",cursor:e.disabled?"not-allowed":"pointer",marginRight:"12px"}},[l("input",{type:"checkbox",class:"qxs-checkbox__input",checked:o(),disabled:e.disabled,onChange:s,style:{marginRight:"8px",cursor:e.disabled?"not-allowed":"pointer"}}),(t.default?.()||e.label)&&l("span",{class:"qxs-checkbox__label",style:{fontSize:"14px",color:e.disabled?"var(--qxs-text-color-disabled, #c0c4cc)":void 0}},t.default?.()||e.label)])}}),t=e({name:"QxsCheckboxGroup",props:{modelValue:{type:Array,default:()=>[]},disabled:{type:Boolean,default:!1},min:{type:Number,default:void 0},max:{type:Number,default:void 0}},emits:["update:modelValue","change"],setup(e,a){let{slots:t}=a;return()=>l("div",{class:"qxs-checkbox-group",style:{display:"inline-flex",flexWrap:"wrap",gap:"8px"}},t.default?.())}});export{a as QxsCheckbox,t as QxsCheckboxGroup,a as default};
2
- //# sourceMappingURL=index.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.mjs","sources":["../../../../../../packages/components/src/ui/checkbox/index.ts"],"sourcesContent":["import { defineComponent, h, type PropType } from 'vue'\n\nexport const QxsCheckbox = defineComponent({\n name: 'QxsCheckbox',\n props: {\n modelValue: { type: [Boolean, String, Number, Array] as PropType<boolean | string | number | any[]>, default: false },\n disabled: { type: Boolean, default: false },\n label: { type: [String, Number, Boolean], default: '' },\n indeterminate: { type: Boolean, default: false },\n trueLabel: { type: [String, Number], default: undefined },\n falseLabel: { type: [String, Number], default: undefined },\n },\n emits: ['update:modelValue', 'change'],\n setup(props, { slots, emit }) {\n const isChecked = () => {\n if (Array.isArray(props.modelValue)) {\n return props.modelValue.includes(props.label)\n }\n if (props.trueLabel !== undefined || props.falseLabel !== undefined) {\n return props.modelValue === props.trueLabel\n }\n return Boolean(props.modelValue)\n }\n\n const handleChange = (e: Event) => {\n if (props.disabled) { return }\n\n const checked = (e.target as HTMLInputElement).checked\n\n if (Array.isArray(props.modelValue)) {\n const value = [...props.modelValue]\n if (checked) {\n value.push(props.label)\n }\n else {\n const index = value.indexOf(props.label)\n if (index > -1) {\n value.splice(index, 1)\n }\n }\n emit('update:modelValue', value)\n emit('change', value)\n }\n else if (props.trueLabel !== undefined || props.falseLabel !== undefined) {\n const value = checked ? props.trueLabel : props.falseLabel\n emit('update:modelValue', value)\n emit('change', value)\n }\n else {\n emit('update:modelValue', checked)\n emit('change', checked)\n }\n }\n\n return () => h('label', {\n class: [\n 'qxs-checkbox',\n {\n 'is-checked': isChecked(),\n 'is-disabled': props.disabled,\n 'is-indeterminate': props.indeterminate,\n },\n ],\n style: {\n display: 'inline-flex',\n alignItems: 'center',\n cursor: props.disabled ? 'not-allowed' : 'pointer',\n marginRight: '12px',\n },\n }, [\n h('input', {\n type: 'checkbox',\n class: 'qxs-checkbox__input',\n checked: isChecked(),\n disabled: props.disabled,\n onChange: handleChange,\n style: {\n marginRight: '8px',\n cursor: props.disabled ? 'not-allowed' : 'pointer',\n },\n }),\n (slots.default?.() || props.label) && h('span', {\n class: 'qxs-checkbox__label',\n style: {\n fontSize: '14px',\n color: props.disabled ? 'var(--qxs-text-color-disabled, #c0c4cc)' : undefined,\n },\n }, slots.default?.() || props.label),\n ])\n },\n})\n\nexport const QxsCheckboxGroup = defineComponent({\n name: 'QxsCheckboxGroup',\n props: {\n modelValue: { type: Array as PropType<any[]>, default: () => [] },\n disabled: { type: Boolean, default: false },\n min: { type: Number, default: undefined },\n max: { type: Number, default: undefined },\n },\n emits: ['update:modelValue', 'change'],\n setup(_props, { slots }) {\n return () => h('div', {\n class: 'qxs-checkbox-group',\n style: {\n display: 'inline-flex',\n flexWrap: 'wrap',\n gap: '8px',\n },\n }, slots.default?.())\n },\n})\n\nexport default QxsCheckbox\n"],"names":["QxsCheckbox","defineComponent","name","props","modelValue","type","Boolean","String","Number","Array","default","disabled","label","indeterminate","trueLabel","falseLabel","emits","setup","_ref","slots","emit","isChecked","isArray","includes","handleChange","e","checked","target","value","push","index","indexOf","splice","h","class","style","display","alignItems","cursor","marginRight","onChange","fontSize","color","QxsCheckboxGroup","min","max","_props","_ref2","flexWrap","gap"],"mappings":"6CAEO,MAAMA,EAAcC,EAAgB,CACzCC,KAAM,cACNC,MAAO,CACLC,WAAY,CAAEC,KAAM,CAACC,QAASC,OAAQC,OAAQC,OAAuDC,SAAS,GAC9GC,SAAU,CAAEN,KAAMC,QAASI,SAAS,GACpCE,MAAO,CAAEP,KAAM,CAACE,OAAQC,OAAQF,SAAUI,QAAS,IACnDG,cAAe,CAAER,KAAMC,QAASI,SAAS,GACzCI,UAAW,CAAET,KAAM,CAACE,OAAQC,QAASE,aAAS,GAC9CK,WAAY,CAAEV,KAAM,CAACE,OAAQC,QAASE,aAAS,IAEjDM,MAAO,CAAC,oBAAqB,UAC7BC,KAAAA,CAAMd,EAAAe,GAAwB,IAAjBC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VC,MAAOvC,EAAMQ,SAAW,+CAA4C,IAErEQ,EAAMT,aAAeP,EAAMS,QAElC,IAGW+B,EAAmB1C,EAAgB,CAC9CC,KAAM,mBACNC,MAAO,CACLC,WAAY,CAAEC,KAAMI,MAA0BC,QAASA,IAAM,IAC7DC,SAAU,CAAEN,KAAMC,QAASI,SAAS,GACpCkC,IAAK,CAAEvC,KAAMG,OAAQE,aAAS,GAC9BmC,IAAK,CAAExC,KAAMG,OAAQE,aAAS,IAEhCM,MAAO,CAAC,oBAAqB,UAC7BC,KAAAA,CAAM6B,EAAAC,GAAmB,IAAX5B,MAAEA,GAAM4B,EACpB,MAAO,IAAMd,EAAE,MAAO,CACpBC,MAAO,qBACPC,MAAO,CACLC,QAAS,cACTY,SAAU,OACVC,IAAK,QAEN9B,EAAMT,YACX"}
@@ -1,2 +0,0 @@
1
- import{defineComponent as e,ref as o,watch as l,onMounted as t,onBeforeUnmount as a,h as s,Teleport as d}from"vue";const n=e({name:"QxsDialog",inheritAttrs:!1,props:{modelValue:{type:Boolean,required:!0},title:{type:String,default:""},width:{type:[String,Number],default:"50%"},showClose:{type:Boolean,default:!0},closeOnClickModal:{type:Boolean,default:!0},closeOnPressEscape:{type:Boolean,default:!0},destroyOnClose:{type:Boolean,default:!1},appendToBody:{type:Boolean,default:!0},lockScroll:{type:Boolean,default:!0},customClass:{type:String,default:""},top:{type:String,default:"15vh"},center:{type:Boolean,default:!1}},emits:["update:modelValue","open","close"],setup(e,n){let{emit:r,slots:i}=n;const c=o(e.modelValue);l(()=>e.modelValue,e=>{c.value=e,e?u():p()});const u=()=>{r("open"),e.lockScroll&&(document.body.style.overflow="hidden")},p=()=>{r("close"),r("update:modelValue",!1),e.lockScroll&&(document.body.style.overflow="")},y=()=>{e.closeOnClickModal&&p()},f=o=>{"Escape"===o.key&&e.closeOnPressEscape&&c.value&&p()};return t(()=>{e.closeOnPressEscape&&document.addEventListener("keydown",f)}),a(()=>{document.removeEventListener("keydown",f),e.lockScroll&&(document.body.style.overflow="")}),()=>{if(e.destroyOnClose&&!c.value)return null;const o="number"==typeof e.width?`${e.width}px`:e.width,l=()=>c.value?s("div",{class:"qxs-dialog-container"},[s("div",{class:"qxs-overlay",onClick:y}),s("div",{class:["qxs-dialog__wrapper",e.center&&"qxs-dialog__wrapper--center"],onClick:e=>{e.target.classList.contains("qxs-dialog__wrapper")&&y()}},[s("div",{class:["qxs-dialog",e.customClass],style:{width:o,marginTop:e.center?"0":e.top},role:"dialog","aria-modal":"true","aria-label":e.title},[(i.header||e.title||e.showClose)&&s("div",{class:"qxs-dialog__header"},[i.header?i.header():s("span",{class:"qxs-dialog__title"},e.title),e.showClose&&s("button",{class:"qxs-dialog__close",type:"button","aria-label":"Close",onClick:p},"×")]),s("div",{class:"qxs-dialog__body"},i.default?.()),i.footer&&s("div",{class:"qxs-dialog__footer"},i.footer())])])]):null;return e.appendToBody?s(d,{to:"body"},[l()]):l()}}});export{n as QxsDialogComponent,n as default};
2
- //# sourceMappingURL=index.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.mjs","sources":["../../../../../../packages/components/src/ui/dialog/index.ts"],"sourcesContent":["import { defineComponent, h, onBeforeUnmount, onMounted, type PropType, ref, Teleport, watch } from 'vue'\n\nexport interface QxsDialogProps {\n modelValue: boolean\n title?: string\n width?: string | number\n showClose?: boolean\n closeOnClickModal?: boolean\n closeOnPressEscape?: boolean\n destroyOnClose?: boolean\n appendToBody?: boolean\n lockScroll?: boolean\n customClass?: string\n top?: string\n center?: boolean\n}\n\nexport const QxsDialogComponent = defineComponent({\n name: 'QxsDialog',\n inheritAttrs: false,\n props: {\n modelValue: { type: Boolean, required: true },\n title: { type: String, default: '' },\n width: { type: [String, Number] as PropType<string | number>, default: '50%' },\n showClose: { type: Boolean, default: true },\n closeOnClickModal: { type: Boolean, default: true },\n closeOnPressEscape: { type: Boolean, default: true },\n destroyOnClose: { type: Boolean, default: false },\n appendToBody: { type: Boolean, default: true },\n lockScroll: { type: Boolean, default: true },\n customClass: { type: String, default: '' },\n top: { type: String, default: '15vh' },\n center: { type: Boolean, default: false },\n },\n emits: ['update:modelValue', 'open', 'close'],\n setup(props, { emit, slots }) {\n const visible = ref(props.modelValue)\n\n watch(() => props.modelValue, (val) => {\n visible.value = val\n if (val) {\n handleOpen()\n }\n else {\n handleClose()\n }\n })\n\n const handleOpen = () => {\n emit('open')\n if (props.lockScroll) {\n document.body.style.overflow = 'hidden'\n }\n }\n\n const handleClose = () => {\n emit('close')\n emit('update:modelValue', false)\n if (props.lockScroll) {\n document.body.style.overflow = ''\n }\n }\n\n const handleOverlayClick = () => {\n if (props.closeOnClickModal) {\n handleClose()\n }\n }\n\n const handleKeydown = (e: KeyboardEvent) => {\n if (e.key === 'Escape' && props.closeOnPressEscape && visible.value) {\n handleClose()\n }\n }\n\n onMounted(() => {\n if (props.closeOnPressEscape) {\n document.addEventListener('keydown', handleKeydown)\n }\n })\n\n onBeforeUnmount(() => {\n document.removeEventListener('keydown', handleKeydown)\n if (props.lockScroll) {\n document.body.style.overflow = ''\n }\n })\n\n return () => {\n if (props.destroyOnClose && !visible.value) {\n return null\n }\n\n const dialogWidth = typeof props.width === 'number' ? `${props.width}px` : props.width\n\n const renderDialog = () => {\n if (!visible.value) { return null }\n\n return h('div', { class: 'qxs-dialog-container' }, [\n h('div', { class: 'qxs-overlay', onClick: handleOverlayClick }),\n h('div', {\n class: ['qxs-dialog__wrapper', props.center && 'qxs-dialog__wrapper--center'],\n onClick: (e: MouseEvent) => {\n if ((e.target as HTMLElement).classList.contains('qxs-dialog__wrapper')) {\n handleOverlayClick()\n }\n },\n }, [\n h('div', {\n 'class': ['qxs-dialog', props.customClass],\n 'style': {\n width: dialogWidth,\n marginTop: props.center ? '0' : props.top,\n },\n 'role': 'dialog',\n 'aria-modal': 'true',\n 'aria-label': props.title,\n }, [\n (slots.header || props.title || props.showClose) && h('div', { class: 'qxs-dialog__header' }, [\n slots.header ? slots.header() : h('span', { class: 'qxs-dialog__title' }, props.title),\n props.showClose && h('button', {\n 'class': 'qxs-dialog__close',\n 'type': 'button',\n 'aria-label': 'Close',\n 'onClick': handleClose,\n }, '×'),\n ]),\n h('div', { class: 'qxs-dialog__body' }, slots.default?.()),\n slots.footer && h('div', { class: 'qxs-dialog__footer' }, slots.footer()),\n ]),\n ]),\n ])\n }\n\n if (props.appendToBody) {\n return h(Teleport, { to: 'body' }, [renderDialog()])\n }\n\n return renderDialog()\n }\n },\n})\n\nexport default QxsDialogComponent\n"],"names":["QxsDialogComponent","defineComponent","name","inheritAttrs","props","modelValue","type","Boolean","required","title","String","default","width","Number","showClose","closeOnClickModal","closeOnPressEscape","destroyOnClose","appendToBody","lockScroll","customClass","top","center","emits","setup","_ref","emit","slots","visible","ref","watch","val","value","handleOpen","handleClose","document","body","style","overflow","handleOverlayClick","handleKeydown","e","key","onMounted","addEventListener","onBeforeUnmount","removeEventListener","dialogWidth","renderDialog","h","class","onClick","target","classList","contains","marginTop","role","header","footer","Teleport","to"],"mappings":"mHAiBO,MAAMA,EAAqBC,EAAgB,CAChDC,KAAM,YACNC,cAAc,EACdC,MAAO,CACLC,WAAY,CAAEC,KAAMC,QAASC,UAAU,GACvCC,MAAO,CAAEH,KAAMI,OAAQC,QAAS,IAChCC,MAAO,CAAEN,KAAM,CAACI,OAAQG,QAAsCF,QAAS,OACvEG,UAAW,CAAER,KAAMC,QAASI,SAAS,GACrCI,kBAAmB,CAAET,KAAMC,QAASI,SAAS,GAC7CK,mBAAoB,CAAEV,KAAMC,QAASI,SAAS,GAC9CM,eAAgB,CAAEX,KAAMC,QAASI,SAAS,GAC1CO,aAAc,CAAEZ,KAAMC,QAASI,SAAS,GACxCQ,WAAY,CAAEb,KAAMC,QAASI,SAAS,GACtCS,YAAa,CAAEd,KAAMI,OAAQC,QAAS,IACtCU,IAAK,CAAEf,KAAMI,OAAQC,QAAS,QAC9BW,OAAQ,CAAEhB,KAAMC,QAASI,SAAS,IAEpCY,MAAO,CAAC,oBAAqB,OAAQ,SACrC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M8B,QAAUrD,EAAMK,OAASL,EAAMU,YAAcmC,EAAE,MAAO,CAAEC,MAAO,sBAAwB,CAC5FvB,EAAM8B,OAAS9B,EAAM8B,SAAWR,EAAE,OAAQ,CAAEC,MAAO,qBAAuB9C,EAAMK,OAChFL,EAAMU,WAAamC,EAAE,SAAU,CAC7BC,MAAS,oBACT5C,KAAQ,SACR,aAAc,QACd6C,QAAWjB,GACV,OAELe,EAAE,MAAO,CAAEC,MAAO,oBAAsBvB,EAAMhB,aAC9CgB,EAAM+B,QAAUT,EAAE,MAAO,CAAEC,MAAO,sBAAwBvB,EAAM+B,gBAhCzC,KAsC/B,OAAItD,EAAMc,aACD+B,EAAEU,EAAU,CAAEC,GAAI,QAAU,CAACZ,MAG/BA,IAEX"}
@@ -1,2 +0,0 @@
1
- import{defineComponent as e,ref as t,watch as a,nextTick as l,h as o}from"vue";const n=e({name:"QxsInput",props:{modelValue:{type:[String,Number],default:""},type:{type:String,default:"text"},placeholder:{type:String,default:""},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},clearable:{type:Boolean,default:!1},size:{type:String,default:"default"},maxlength:{type:Number,default:void 0},showWordLimit:{type:Boolean,default:!1},rows:{type:[Number,String],default:2},autosize:{type:[Boolean,Object],default:!1},resize:{type:String,default:"none"}},emits:["update:modelValue","input","change","focus","blur","clear"],setup(e,n){let{emit:u,slots:s}=n;const r=t(),d=()=>"textarea"===e.type,i=t=>{const a=t.target.value;u("update:modelValue",a),u("input",a),d()&&e.autosize&&g()},p=e=>{u("change",e.target.value)},m=e=>{u("focus",e)},c=e=>{u("blur",e)},x=()=>{u("update:modelValue",""),u("clear")},g=()=>{if(!r.value)return;const t=r.value;t.style.height="auto";let a=0,l=1/0;if("object"==typeof e.autosize){const o=Number.parseInt(getComputedStyle(t).lineHeight)||20,n=Number.parseInt(getComputedStyle(t).paddingTop)+Number.parseInt(getComputedStyle(t).paddingBottom)||0;a=(e.autosize.minRows||1)*o+n,l=e.autosize.maxRows?e.autosize.maxRows*o+n:1/0}const o=t.scrollHeight,n=Math.min(Math.max(o,a),l);t.style.height=`${n}px`};a(()=>e.modelValue,()=>{d()&&e.autosize&&l(g)});return()=>o("div",{class:d()?["qxs-textarea",`qxs-textarea--${e.size}`]:["qxs-input",`qxs-input--${e.size}`]},[s.prefix?.(),d()?o("textarea",{ref:r,class:"qxs-textarea__inner",value:e.modelValue,placeholder:e.placeholder,disabled:e.disabled,readonly:e.readonly,maxlength:e.maxlength,rows:e.rows,style:d()?{resize:e.resize}:{},onInput:i,onChange:p,onFocus:m,onBlur:c}):o("input",{class:"qxs-input__inner",type:e.type,value:e.modelValue,placeholder:e.placeholder,disabled:e.disabled,readonly:e.readonly,maxlength:e.maxlength,onInput:i,onChange:p,onFocus:m,onBlur:c}),!d()&&e.clearable&&e.modelValue&&!e.disabled&&o("span",{class:"qxs-input__clear",onClick:x},"×"),s.suffix?.(),e.showWordLimit&&e.maxlength&&o("span",{class:d()?"qxs-textarea__count":"qxs-input__count"},`${String(e.modelValue).length}/${e.maxlength}`)])}});export{n as QxsInput,n as default};
2
- //# sourceMappingURL=index.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.mjs","sources":["../../../../../../packages/components/src/ui/input/index.ts"],"sourcesContent":["import { type CSSProperties, defineComponent, h, nextTick, ref, watch } from 'vue'\n\nexport const QxsInput = defineComponent({\n name: 'QxsInput',\n props: {\n modelValue: { type: [String, Number], default: '' },\n type: { type: String, default: 'text' },\n placeholder: { type: String, default: '' },\n disabled: { type: Boolean, default: false },\n readonly: { type: Boolean, default: false },\n clearable: { type: Boolean, default: false },\n size: { type: String as () => 'large' | 'default' | 'small', default: 'default' },\n maxlength: { type: Number, default: undefined },\n showWordLimit: { type: Boolean, default: false },\n rows: { type: [Number, String], default: 2 },\n autosize: { type: [Boolean, Object] as unknown as () => boolean | { minRows?: number, maxRows?: number }, default: false },\n resize: { type: String as () => 'none' | 'both' | 'horizontal' | 'vertical', default: 'none' },\n },\n emits: ['update:modelValue', 'input', 'change', 'focus', 'blur', 'clear'],\n setup(props, { emit, slots }) {\n const textareaRef = ref<HTMLTextAreaElement>()\n const isTextarea = () => props.type === 'textarea'\n\n const handleInput = (e: Event) => {\n const value = (e.target as HTMLInputElement | HTMLTextAreaElement).value\n emit('update:modelValue', value)\n emit('input', value)\n if (isTextarea() && props.autosize) {\n adjustTextareaHeight()\n }\n }\n\n const handleChange = (e: Event) => {\n emit('change', (e.target as HTMLInputElement | HTMLTextAreaElement).value)\n }\n\n const handleFocus = (e: FocusEvent) => {\n emit('focus', e)\n }\n\n const handleBlur = (e: FocusEvent) => {\n emit('blur', e)\n }\n\n const handleClear = () => {\n emit('update:modelValue', '')\n emit('clear')\n }\n\n const adjustTextareaHeight = () => {\n if (!textareaRef.value) { return }\n\n const textarea = textareaRef.value\n textarea.style.height = 'auto'\n\n let minHeight = 0\n let maxHeight = Infinity\n\n if (typeof props.autosize === 'object') {\n const lineHeight = Number.parseInt(getComputedStyle(textarea).lineHeight) || 20\n const paddingHeight = Number.parseInt(getComputedStyle(textarea).paddingTop) + Number.parseInt(getComputedStyle(textarea).paddingBottom) || 0\n minHeight = (props.autosize.minRows || 1) * lineHeight + paddingHeight\n maxHeight = props.autosize.maxRows ? props.autosize.maxRows * lineHeight + paddingHeight : Infinity\n }\n\n const scrollHeight = textarea.scrollHeight\n const newHeight = Math.min(Math.max(scrollHeight, minHeight), maxHeight)\n textarea.style.height = `${newHeight}px`\n }\n\n watch(() => props.modelValue, () => {\n if (isTextarea() && props.autosize) {\n nextTick(adjustTextareaHeight)\n }\n })\n\n const getContainerClass = () => {\n const classes = isTextarea() ? ['qxs-textarea', `qxs-textarea--${props.size}`] : ['qxs-input', `qxs-input--${props.size}`]\n return classes\n }\n\n const getInnerStyle = (): CSSProperties => {\n if (isTextarea()) {\n return {\n resize: props.resize,\n }\n }\n return {}\n }\n\n return () => h('div', { class: getContainerClass() }, [\n slots.prefix?.(),\n isTextarea()\n ? h('textarea', {\n ref: textareaRef,\n class: 'qxs-textarea__inner',\n value: props.modelValue,\n placeholder: props.placeholder,\n disabled: props.disabled,\n readonly: props.readonly,\n maxlength: props.maxlength,\n rows: props.rows,\n style: getInnerStyle(),\n onInput: handleInput,\n onChange: handleChange,\n onFocus: handleFocus,\n onBlur: handleBlur,\n })\n : h('input', {\n class: 'qxs-input__inner',\n type: props.type,\n value: props.modelValue,\n placeholder: props.placeholder,\n disabled: props.disabled,\n readonly: props.readonly,\n maxlength: props.maxlength,\n onInput: handleInput,\n onChange: handleChange,\n onFocus: handleFocus,\n onBlur: handleBlur,\n }),\n !isTextarea() && props.clearable && props.modelValue && !props.disabled && h('span', {\n class: 'qxs-input__clear',\n onClick: handleClear,\n }, '×'),\n slots.suffix?.(),\n props.showWordLimit && props.maxlength && h('span', {\n class: isTextarea() ? 'qxs-textarea__count' : 'qxs-input__count',\n }, `${String(props.modelValue).length}/${props.maxlength}`),\n ])\n },\n})\n\nexport default QxsInput\n"],"names":["QxsInput","defineComponent","name","props","modelValue","type","String","Number","default","placeholder","disabled","Boolean","readonly","clearable","size","maxlength","showWordLimit","rows","autosize","Object","resize","emits","setup","_ref","emit","slots","textareaRef","ref","isTextarea","handleInput","e","value","target","adjustTextareaHeight","handleChange","handleFocus","handleBlur","handleClear","textarea","style","height","minHeight","maxHeight","Infinity","lineHeight","parseInt","getComputedStyle","paddingHeight","paddingTop","paddingBottom","minRows","maxRows","scrollHeight","newHeight","Math","min","max","watch","nextTick","h","class","prefix","onInput","onChange","onFocus","onBlur","onClick","suffix","length"],"mappings":"+EAEO,MAAMA,EAAWC,EAAgB,CACtCC,KAAM,WACNC,MAAO,CACLC,WAAY,CAAEC,KAAM,CAACC,OAAQC,QAASC,QAAS,IAC/CH,KAAM,CAAEA,KAAMC,OAAQE,QAAS,QAC/BC,YAAa,CAAEJ,KAAMC,OAAQE,QAAS,IACtCE,SAAU,CAAEL,KAAMM,QAASH,SAAS,GACpCI,SAAU,CAAEP,KAAMM,QAASH,SAAS,GACpCK,UAA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",props:{modelValue:{type:Number,default:0},min:{type:Number,default:-1/0},max:{type:Number,default:1/0},step:{type:Number,default:1},precision:{type:Number,default:void 0},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},controls:{type:Boolean,default:!0},size:{type:String,default:"default"},placeholder:{type:String,default:""}},emits:["update:modelValue","change","focus","blur","input"],setup(e,t){let{emit:n}=t;const r=l(),d=l(null),i=a(()=>{if(null!==d.value)return d.value;let l=e.modelValue;return void 0!==e.precision&&"number"==typeof l&&(l=Number.parseFloat(l.toFixed(e.precision))),l}),u=a(()=>e.modelValue<=e.min),s=a(()=>e.modelValue>=e.max),p=l=>void 0===e.precision?l:Number.parseFloat(l.toFixed(e.precision)),c=()=>{if(e.disabled||e.readonly||s.value)return;const l=p(e.modelValue+e.step),a=Math.min(l,e.max);n("update:modelValue",a),n("change",a,e.modelValue)},b=()=>{if(e.disabled||e.readonly||u.value)return;const l=p(e.modelValue-e.step),a=Math.max(l,e.min);n("update:modelValue",a),n("change",a,e.modelValue)},m=e=>{const l=e.target.value;d.value=l,n("input",l)},x=l=>{const a=l.target.value;let o=""===a?0:Number(a);Number.isNaN(o)||(void 0!==e.precision&&(o=p(o)),o=Math.max(e.min,Math.min(e.max,o)),n("update:modelValue",o),n("change",o,e.modelValue)),d.value=null},f=e=>{n("focus",e)},v=e=>{n("blur",e),d.value=null},y=a(()=>"large"===e.size?"40px":"small"===e.size?"24px":"32px");return()=>o("div",{class:["qxs-input-number",`qxs-input-number--${e.size}`,{"is-disabled":e.disabled,"is-controls":e.controls}],style:{display:"inline-flex",alignItems:"center",position:"relative"}},[e.controls&&o("button",{class:["qxs-input-number__decrease",{"is-disabled":u.value||e.disabled}],disabled:u.value||e.disabled,onClick:b,style:{width:y.value,height:y.value,border:"1px solid var(--qxs-border-color, #dcdfe6)",borderRight:"none",background:"var(--qxs-fill-color-blank, #fff)",cursor:u.value||e.disabled?"not-allowed":"pointer",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"14px",borderRadius:"4px 0 0 4px"}},"−"),o("input",{ref:r,class:"qxs-input-number__inner",type:"text",value:i.value,placeholder:e.placeholder,disabled:e.disabled,readonly:e.readonly,onInput:m,onChange:x,onFocus:f,onBlur:v,style:{width:e.controls?`calc(100% - ${y.value} * 2)`:"100%",height:y.value,padding:"0 12px",border:"1px solid var(--qxs-border-color, #dcdfe6)",borderLeft:e.controls?"none":void 0,borderRight:e.controls?"none":void 0,outline:"none",textAlign:"center",fontSize:"large"===e.size?"14px":"small"===e.size?"12px":"13px",borderRadius:e.controls?"0":"4px"}}),e.controls&&o("button",{class:["qxs-input-number__increase",{"is-disabled":s.value||e.disabled}],disabled:s.value||e.disabled,onClick:c,style:{width:y.value,height:y.value,border:"1px solid var(--qxs-border-color, #dcdfe6)",borderLeft:"none",background:"var(--qxs-fill-color-blank, #fff)",cursor:s.value||e.disabled?"not-allowed":"pointer",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"14px",borderRadius:"0 4px 4px 0"}},"+")])}});export{t as QxsInputNumber,t as default};
2
- //# sourceMappingURL=index.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.mjs","sources":["../../../../../../packages/components/src/ui/input-number/index.ts"],"sourcesContent":["import { computed, defineComponent, h, type PropType, ref } from 'vue'\n\nexport type InputNumberSize = 'large' | 'default' | 'small'\n\nexport const QxsInputNumber = defineComponent({\n name: 'QxsInputNumber',\n props: {\n modelValue: { type: Number, default: 0 },\n min: { type: Number, default: -Infinity },\n max: { type: Number, default: Infinity },\n step: { type: Number, default: 1 },\n precision: { type: Number, default: undefined },\n disabled: { type: Boolean, default: false },\n readonly: { type: Boolean, default: false },\n controls: { type: Boolean, default: true },\n size: { type: String as PropType<InputNumberSize>, default: 'default' },\n placeholder: { type: String, default: '' },\n },\n emits: ['update:modelValue', 'change', 'focus', 'blur', 'input'],\n setup(props, { emit }) {\n const inputRef = ref<HTMLInputElement>()\n const userInput = ref<string | null>(null)\n\n const displayValue = computed(() => {\n if (userInput.value !== null) {\n return userInput.value\n }\n\n let value = props.modelValue\n if (props.precision !== undefined && typeof value === 'number') {\n value = Number.parseFloat(value.toFixed(props.precision))\n }\n return value\n })\n\n const minDisabled = computed(() => {\n return props.modelValue <= props.min\n })\n\n const maxDisabled = computed(() => {\n return props.modelValue >= props.max\n })\n\n const toPrecision = (num: number) => {\n if (props.precision === undefined) { return num }\n return Number.parseFloat(num.toFixed(props.precision))\n }\n\n const increase = () => {\n if (props.disabled || props.readonly || maxDisabled.value) { return }\n const newValue = toPrecision(props.modelValue + props.step)\n const value = Math.min(newValue, props.max)\n emit('update:modelValue', value)\n emit('change', value, props.modelValue)\n }\n\n const decrease = () => {\n if (props.disabled || props.readonly || minDisabled.value) { return }\n const newValue = toPrecision(props.modelValue - props.step)\n const value = Math.max(newValue, props.min)\n emit('update:modelValue', value)\n emit('change', value, props.modelValue)\n }\n\n const handleInput = (e: Event) => {\n const value = (e.target as HTMLInputElement).value\n userInput.value = value\n emit('input', value)\n }\n\n const handleChange = (e: Event) => {\n const value = (e.target as HTMLInputElement).value\n let newValue = value === '' ? 0 : Number(value)\n\n if (Number.isNaN(newValue)) {\n userInput.value = null\n return\n }\n\n if (props.precision !== undefined) {\n newValue = toPrecision(newValue)\n }\n\n newValue = Math.max(props.min, Math.min(props.max, newValue))\n\n emit('update:modelValue', newValue)\n emit('change', newValue, props.modelValue)\n userInput.value = null\n }\n\n const handleFocus = (e: FocusEvent) => {\n emit('focus', e)\n }\n\n const handleBlur = (e: FocusEvent) => {\n emit('blur', e)\n userInput.value = null\n }\n\n const buttonSize = computed(() => {\n return props.size === 'large' ? '40px' : props.size === 'small' ? '24px' : '32px'\n })\n\n return () => h('div', {\n class: [\n 'qxs-input-number',\n `qxs-input-number--${props.size}`,\n {\n 'is-disabled': props.disabled,\n 'is-controls': props.controls,\n },\n ],\n style: {\n display: 'inline-flex',\n alignItems: 'center',\n position: 'relative',\n },\n }, [\n props.controls && h('button', {\n class: ['qxs-input-number__decrease', { 'is-disabled': minDisabled.value || props.disabled }],\n disabled: minDisabled.value || props.disabled,\n onClick: decrease,\n style: {\n width: buttonSize.value,\n height: buttonSize.value,\n border: '1px solid var(--qxs-border-color, #dcdfe6)',\n borderRight: 'none',\n background: 'var(--qxs-fill-color-blank, #fff)',\n cursor: minDisabled.value || props.disabled ? 'not-allowed' : 'pointer',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n fontSize: '14px',\n borderRadius: '4px 0 0 4px',\n },\n }, '−'),\n h('input', {\n ref: inputRef,\n class: 'qxs-input-number__inner',\n type: 'text',\n value: displayValue.value,\n placeholder: props.placeholder,\n disabled: props.disabled,\n readonly: props.readonly,\n onInput: handleInput,\n onChange: handleChange,\n onFocus: handleFocus,\n onBlur: handleBlur,\n style: {\n width: props.controls ? `calc(100% - ${buttonSize.value} * 2)` : '100%',\n height: buttonSize.value,\n padding: '0 12px',\n border: '1px solid var(--qxs-border-color, #dcdfe6)',\n borderLeft: props.controls ? 'none' : undefined,\n borderRight: props.controls ? 'none' : undefined,\n outline: 'none',\n textAlign: 'center',\n fontSize: props.size === 'large' ? '14px' : props.size === 'small' ? '12px' : '13px',\n borderRadius: props.controls ? '0' : '4px',\n },\n }),\n props.controls && h('button', {\n class: ['qxs-input-number__increase', { 'is-disabled': maxDisabled.value || props.disabled }],\n disabled: maxDisabled.value || props.disabled,\n onClick: increase,\n style: {\n width: buttonSize.value,\n height: buttonSize.value,\n border: '1px solid var(--qxs-border-color, #dcdfe6)',\n borderLeft: 'none',\n background: 'var(--qxs-fill-color-blank, #fff)',\n cursor: maxDisabled.value || props.disabled ? 'not-allowed' : 'pointer',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n fontSize: '14px',\n borderRadius: '0 4px 4px 0',\n },\n }, '+'),\n ])\n },\n})\n\nexport default QxsInputNumber\n"],"names":["QxsInputNumber","defineComponent","name","props","modelValue","type","Number","default","min","Infinity","max","step","precision","disabled","Boolean","readonly","controls","size","String","placeholder","emits","setup","_ref","emit","inputRef","ref","userInput","displayValue","computed","value","parseFloat","toFixed","minDisabled","maxDisabled","toPrecision","num","increase","newValue","Math","decrease","handleInput","e","target","handleChange","isNaN","handleFocus","handleBlur","buttonSize","h","class","style","display","alignItems","position","onClick","width","height","border","borderRight","background","cursor","justifyContent","fontSize","borderRadius","onInput","onChange","onFocus","onBlur","padding","borderLeft","outline","textAlign"],"mappings":"oEAIO,MAAMA,EAAiBC,EAAgB,CAC5CC,KAAM,iBACNC,MAAO,CACLC,WAAY,CAAEC,KAAMC,OAAQC,QAAS,GACrCC,IAAK,CAAEH,KAAMC,OAAQC,SAASE,KAC9BC,IAAK,CAAEL,KAAMC,OAAQC,QAASE,KAC9BE,KAAM,CAAEN,KAAMC,OAAQC,QAAS,GAC/BK,UAAW,CAAEP,KAAMC,OAAQC,aAAS,GACpCM,SAAU,CAAER,KAAMS,QAASP,SAAS,GACpCQ,SAAU,CAAEV,KAAMS,QAASP,SAAS,GACpCS,SAAU,CAAEX,KAAMS,QAASP,SAAS,GACpCU,KAAM,CAAEZ,KAAMa,OAAqCX,QAAS,WAC5DY,YAAa,CAAEd,KAAMa,OAAQX,QAAS,KAExCa,MAAO,CAAC,oBAAqB,SAAU,QAAS,OAAQ,SACxDC,KAAAA,CAAMlB,EAAAmB,GAAiB,IAAVC,KAAEA,GAAKD,EAClB,MAAME,EAAWC,IACXC,EAAYD,EAAmB,MAE/BE,EAAeC,EAAS,KAC5B,GAAwB,OAApBF,EAAUG,MACZ,OAAOH,EAAUG,MAGnB,IAAIA,EAAQ1B,EAAMC,WAIlB,YAHwB,IAApBD,EAAMS,WAA4C,iBAAViB,IAC1CA,EAAQvB,OAAOwB,WAAWD,EAAME,QAAQ5B,EAAMS,aAEzCiB,IAGHG,EAAcJ,EAAS,IACpBzB,EAAMC,YAAcD,EAAMK,KAG7ByB,EAAcL,EAAS,IACpBzB,EAAMC,YAAcD,EAAMO,KAG7BwB,EAAeC,QACK,IAApBhC,EAAMS,UAAkCuB,EACrC7B,OAAOwB,WAA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ZC,OAAQ3B,EAAYJ,OAAS1B,EAAMU,SAAW,cAAgB,UAC9DsC,QAAS,OACTC,WAAY,SACZS,eAAgB,SAChBC,SAAU,OACVC,aAAc,gBAEf,MAEP"}
@@ -1,2 +0,0 @@
1
- import{defineComponent as e,provide as t,computed as l,h as s,inject as u}from"vue";const p=Symbol("QxsRow"),a=e({name:"QxsRow",props:{gutter:{type:Number,default:0},justify:{type:String,default:"start"},align:{type:String,default:"top"},tag:{type:String,default:"div"}},setup(e,u){let{slots:a}=u;t(p,{gutter:l(()=>e.gutter)});const r={display:"flex",flexWrap:"wrap",justifyContent:{start:"flex-start",end:"flex-end",center:"center","space-around":"space-around","space-between":"space-between","space-evenly":"space-evenly"}[e.justify],alignItems:{top:"flex-start",middle:"center",bottom:"flex-end"}[e.align]};return e.gutter&&(r.marginLeft=-e.gutter/2+"px",r.marginRight=-e.gutter/2+"px"),()=>s(e.tag,{class:"qxs-row",style:r},a.default?.())}}),r=e({name:"QxsCol",props:{span:{type:Number,default:24},offset:{type:Number,default:0},push:{type:Number,default:0},pull:{type:Number,default:0},tag:{type:String,default:"div"},xs:{type:[Number,Object],default:void 0},sm:{type:[Number,Object],default:void 0},md:{type:[Number,Object],default:void 0},lg:{type:[Number,Object],default:void 0},xl:{type:[Number,Object],default:void 0}},setup(e,t){let{slots:l}=t;const a=u(p,null),r=a?.gutter.value||0,o={boxSizing:"border-box"};r&&(o.paddingLeft=r/2+"px",o.paddingRight=r/2+"px");const f=100/24*e.span;return o.maxWidth=`${f}%`,o.flex=`0 0 ${f}%`,e.offset&&(o.marginLeft=100/24*e.offset+"%"),e.push&&(o.position="relative",o.left=100/24*e.push+"%"),e.pull&&(o.position="relative",o.right=100/24*e.pull+"%"),()=>s(e.tag,{class:["qxs-col",`qxs-col-${e.span}`,e.offset&&`qxs-col-offset-${e.offset}`,e.push&&`qxs-col-push-${e.push}`,e.pull&&`qxs-col-pull-${e.pull}`],style:o},l.default?.())}});export{r as QxsCol,a as QxsRow};
2
- //# sourceMappingURL=index.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.mjs","sources":["../../../../../../packages/components/src/ui/layout/index.ts"],"sourcesContent":["import { computed, type CSSProperties, defineComponent, h, inject, type InjectionKey, type PropType, provide, type Ref } from 'vue'\n\nexport type RowJustify = 'start' | 'end' | 'center' | 'space-around' | 'space-between' | 'space-evenly'\nexport type RowAlign = 'top' | 'middle' | 'bottom'\n\ninterface RowContext {\n gutter: Ref<number>\n}\n\nconst ROW_INJECTION_KEY: InjectionKey<RowContext> = Symbol('QxsRow')\n\nexport const QxsRow = defineComponent({\n name: 'QxsRow',\n props: {\n gutter: { type: Number, default: 0 },\n justify: { type: String as PropType<RowJustify>, default: 'start' },\n align: { type: String as PropType<RowAlign>, default: 'top' },\n tag: { type: String, default: 'div' },\n },\n setup(props, { slots }) {\n provide(ROW_INJECTION_KEY, {\n gutter: computed(() => props.gutter),\n })\n\n const justifyMap: Record<RowJustify, string> = {\n 'start': 'flex-start',\n 'end': 'flex-end',\n 'center': 'center',\n 'space-around': 'space-around',\n 'space-between': 'space-between',\n 'space-evenly': 'space-evenly',\n }\n\n const alignMap: Record<RowAlign, string> = {\n top: 'flex-start',\n middle: 'center',\n bottom: 'flex-end',\n }\n\n const rowStyle: CSSProperties = {\n display: 'flex',\n flexWrap: 'wrap',\n justifyContent: justifyMap[props.justify],\n alignItems: alignMap[props.align],\n }\n\n if (props.gutter) {\n rowStyle.marginLeft = `${-props.gutter / 2}px`\n rowStyle.marginRight = `${-props.gutter / 2}px`\n }\n\n return () => h(props.tag, {\n class: 'qxs-row',\n style: rowStyle,\n }, slots.default?.())\n },\n})\n\nexport const QxsCol = defineComponent({\n name: 'QxsCol',\n props: {\n span: { type: Number, default: 24 },\n offset: { type: Number, default: 0 },\n push: { type: Number, default: 0 },\n pull: { type: Number, default: 0 },\n tag: { type: String, default: 'div' },\n xs: { type: [Number, Object] as PropType<number | { span?: number, offset?: number }>, default: undefined },\n sm: { type: [Number, Object] as PropType<number | { span?: number, offset?: number }>, default: undefined },\n md: { type: [Number, Object] as PropType<number | { span?: number, offset?: number }>, default: undefined },\n lg: { type: [Number, Object] as PropType<number | { span?: number, offset?: number }>, default: undefined },\n xl: { type: [Number, Object] as PropType<number | { span?: number, offset?: number }>, default: undefined },\n },\n setup(props, { slots }) {\n const row = inject(ROW_INJECTION_KEY, null)\n\n const gutter = row?.gutter.value || 0\n\n const colStyle: CSSProperties = {\n boxSizing: 'border-box',\n }\n\n if (gutter) {\n colStyle.paddingLeft = `${gutter / 2}px`\n colStyle.paddingRight = `${gutter / 2}px`\n }\n\n const spanWidth = (100 / 24) * props.span\n colStyle.maxWidth = `${spanWidth}%`\n colStyle.flex = `0 0 ${spanWidth}%`\n\n if (props.offset) {\n colStyle.marginLeft = `${(100 / 24) * props.offset}%`\n }\n\n if (props.push) {\n colStyle.position = 'relative'\n colStyle.left = `${(100 / 24) * props.push}%`\n }\n\n if (props.pull) {\n colStyle.position = 'relative'\n colStyle.right = `${(100 / 24) * props.pull}%`\n }\n\n return () => h(props.tag, {\n class: [\n 'qxs-col',\n `qxs-col-${props.span}`,\n props.offset && `qxs-col-offset-${props.offset}`,\n props.push && `qxs-col-push-${props.push}`,\n props.pull && `qxs-col-pull-${props.pull}`,\n ],\n style: colStyle,\n }, slots.default?.())\n },\n})\n\nexport default { QxsRow, QxsCol }\n"],"names":["ROW_INJECTION_KEY","Symbol","QxsRow","defineComponent","name","props","gutter","type","Number","default","justify","String","align","tag","setup","_ref","slots","provide","computed","rowStyle","display","flexWrap","justifyContent","start","end","center","alignItems","top","middle","bottom","marginLeft","marginRight","h","class","style","QxsCol","span","offset","push","pull","xs","Object","sm","md","lg","xl","_ref2","row","inject","value","colStyle","boxSizing","paddingLeft","paddingRight","spanWidth","maxWidth","flex","position","left","right"],"mappings":"oFASA,MAAMA,EAA8CC,OAAO,UAE9CC,EAASC,EAAgB,CACpCC,KAAM,SACNC,MAAO,CACLC,OAAQ,CAAEC,KAAMC,OAAQC,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AElGK,KAAAA,CAAMT,EAAAyC,GAAkB,IAAX9B,MAAEA,GAAM8B,EACnB,MAAMC,EAAMC,EAAOhD,EAAmB,MAEhCM,EAASyC,GAAKzC,OAAO2C,OAAS,EAE9BC,EAA0B,CAC9BC,UAAW,cAGT7C,IACF4C,EAASE,YAAiB9C,EAAS,EAAZ,KACvB4C,EAASG,aAAkB/C,EAAS,EAAZ,MAG1B,MAAMgD,EAAa,IAAM,GAAMjD,EAAM+B,KAkBrC,OAjBAc,EAASK,SAAW,GAAGD,KACvBJ,EAASM,KAAO,OAAOF,KAEnBjD,EAAMgC,SACRa,EAASpB,WAAiB,IAAM,GAAMzB,EAAMgC,OAAtB,KAGpBhC,EAAMiC,OACRY,EAASO,SAAW,WACpBP,EAASQ,KAAW,IAAM,GAAMrD,EAAMiC,KAAtB,KAGdjC,EAAMkC,OACRW,EAASO,SAAW,WACpBP,EAASS,MAAY,IAAM,GAAMtD,EAAMkC,KAAtB,KAGZ,IAAMP,EAAE3B,EAAMQ,IAAK,CACxBoB,MAAO,CACL,UACA,WAAW5B,EAAM+B,OACjB/B,EAAMgC,QAAU,kBAAkBhC,EAAMgC,SACxChC,EAAMiC,MAAQ,gBAAgBjC,EAAMiC,OACpCjC,EAAMkC,MAAQ,gBAAgBlC,EAAMkC,QAEtCL,MAAOgB,GACNlC,EAAMP,YACX"}
@@ -1,2 +0,0 @@
1
- import{defineComponent as e,h as t}from"vue";const l=e({name:"QxsLink",props:{type:{type:String,default:"default"},href:{type:String,default:""},target:{type:String,default:"_self"},disabled:{type:Boolean,default:!1},underline:{type:Boolean,default:!0}},emits:["click"],setup(e,l){let{slots:d,emit:i}=l;const a=t=>{e.disabled?t.preventDefault():(e.href||t.preventDefault(),i("click",t))};return()=>t("a",{class:["qxs-link",`qxs-link--${e.type}`,{"is-disabled":e.disabled,"is-underline":e.underline}],href:e.disabled?void 0:e.href,target:e.disabled?void 0:e.target,onClick:a,style:{cursor:e.disabled?"not-allowed":"pointer",textDecoration:e.underline?"underline":"none",opacity:e.disabled?"0.5":"1",color:e.disabled?"var(--qxs-text-color-disabled, #c0c4cc)":void 0}},d.default?.())}});export{l as QxsLink,l as default};
2
- //# sourceMappingURL=index.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.mjs","sources":["../../../../../../packages/components/src/ui/link/index.ts"],"sourcesContent":["import { defineComponent, h, type PropType } from 'vue'\n\nexport type LinkType = 'primary' | 'success' | 'warning' | 'danger' | 'info' | 'default'\n\nexport const QxsLink = defineComponent({\n name: 'QxsLink',\n props: {\n type: { type: String as PropType<LinkType>, default: 'default' },\n href: { type: String, default: '' },\n target: { type: String as PropType<'_blank' | '_self' | '_parent' | '_top'>, default: '_self' },\n disabled: { type: Boolean, default: false },\n underline: { type: Boolean, default: true },\n },\n emits: ['click'],\n setup(props, { slots, emit }) {\n const handleClick = (e: MouseEvent) => {\n if (props.disabled) {\n e.preventDefault()\n return\n }\n if (!props.href) {\n e.preventDefault()\n }\n emit('click', e)\n }\n\n return () => h('a', {\n class: [\n 'qxs-link',\n `qxs-link--${props.type}`,\n {\n 'is-disabled': props.disabled,\n 'is-underline': props.underline,\n },\n ],\n href: props.disabled ? undefined : props.href,\n target: props.disabled ? undefined : props.target,\n onClick: handleClick,\n style: {\n cursor: props.disabled ? 'not-allowed' : 'pointer',\n textDecoration: props.underline ? 'underline' : 'none',\n opacity: props.disabled ? '0.5' : '1',\n color: props.disabled ? 'var(--qxs-text-color-disabled, #c0c4cc)' : undefined,\n },\n }, slots.default?.())\n },\n})\n\nexport default QxsLink\n"],"names":["QxsLink","defineComponent","name","props","type","String","default","href","target","disabled","Boolean","underline","emits","setup","_ref","slots","emit","handleClick","e","preventDefault","h","class","onClick","style","cursor","textDecoration","opacity","color"],"mappings":"6CAIO,MAAMA,EAAUC,EAAgB,CACrCC,KAAM,UACNC,MAAO,CACLC,KAAM,CAAEA,KAAMC,OAA8BC,QAAS,WACrDC,KAAM,CAAEH,KAAMC,OAAQC,QAAS,IAC/BE,OAAQ,CAAEJ,KAAMC,OAA6DC,QAAS,SACtFG,SAAU,CAAEL,KAAMM,QAASJ,SAAS,GACpCK,UAAW,CAAEP,KAAMM,QAASJ,SAAS,IAEvCM,MAAO,CAAC,SACRC,KAAAA,CAAMV,EAAAW,GAAwB,IAAjBC,MAAEA,EAAAC,KAAOA,GAAKF,EACzB,MAAMG,EAAeC,IACff,EAAMM,SACRS,EAAEC,kBAGChB,EAAMI,MACTW,EAAEC,iBAEJH,EAAK,QAASE,KAGhB,MAAO,IAAME,EAAE,IAAK,CAClBC,MAAO,CACL,WACA,aAAalB,EAAMC,OACnB,CACE,cAAeD,EAAMM,SACrB,eAAgBN,EAAMQ,YAG1BJ,KAAMJ,EAAMM,cAAW,EAAYN,EAAMI,KACzCC,OAAQL,EAAMM,cAAW,EAAYN,EAAMK,OAC3Cc,QAASL,EACTM,MAAO,CACLC,OAAQrB,EAAMM,SAAW,cAAgB,UACzCgB,eAAgBtB,EAAMQ,UAAY,YAAc,OAChDe,QAASvB,EAAMM,SAAW,MAAQ,IAClCkB,MAAOxB,EAAMM,SAAW,+CAA4C,IAErEM,EAAMT,YACX"}
@@ -1,2 +0,0 @@
1
- import{defineComponent as e,ref as t,computed as o,onMounted as r,onBeforeUnmount as i,h as l}from"vue";const a=e({name:"QxsPopover",props:{content:{type:String,default:""},placement:{type:String,default:"bottom"},trigger:{type:String,default:"hover"},disabled:{type:Boolean,default:!1},width:{type:[String,Number],default:150},visible:{type:Boolean,default:void 0},offset:{type:Number,default:12},showArrow:{type:Boolean,default:!0}},emits:["update:visible","show","hide","after-enter","after-leave"],setup(e,a){let{slots:n,emit:s}=a;const u=t(!1),d=t(),p=t();let c=null;const v=void 0!==e.visible,g=o(()=>v?e.visible:u.value),f=()=>{e.disabled||(c&&(clearTimeout(c),c=null),v||(u.value=!0),s("update:visible",!0),s("show"))},b=()=>{c&&clearTimeout(c),c=setTimeout(()=>{v||(u.value=!1),s("update:visible",!1),s("hide")},200)},m=()=>{"hover"===e.trigger&&f()},h=()=>{"hover"===e.trigger&&b()},x=()=>{"click"===e.trigger&&(g.value?b():f())},k=()=>{"focus"===e.trigger&&f()},y=()=>{"focus"===e.trigger&&b()},w=()=>{"hover"===e.trigger&&c&&(clearTimeout(c),c=null)},q=()=>{"hover"===e.trigger&&b()},S=t=>{if("click"!==e.trigger)return;const o=t.target;d.value?.contains(o)||p.value?.contains(o)||b()};r(()=>{"click"===e.trigger&&document.addEventListener("click",S)}),i(()=>{"click"===e.trigger&&document.removeEventListener("click",S),c&&clearTimeout(c)});return()=>l("div",{class:"qxs-popover",style:{display:"inline-block",position:"relative"}},[l("div",{ref:d,class:"qxs-popover__reference",onMouseenter:m,onMouseleave:h,onClick:x,onFocus:k,onBlur:y},n.reference?.()||n.default?.()),g.value&&l("div",{ref:p,class:["qxs-popover__popper",`qxs-popover__popper--${e.placement}`],style:{position:"absolute",zIndex:2e3,width:"number"==typeof e.width?`${e.width}px`:e.width,padding:"12px",backgroundColor:"var(--qxs-fill-color-blank, #fff)",border:"1px solid var(--qxs-border-color-light, #e4e7ed)",borderRadius:"4px",boxShadow:"0 2px 12px 0 rgba(0, 0, 0, 0.1)",fontSize:"14px",lineHeight:"1.4",wordBreak:"break-all"},onMouseenter:w,onMouseleave:q},n.default?.()||e.content)])}});export{a as QxsPopover,a as default};
2
- //# sourceMappingURL=index.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.mjs","sources":["../../../../../../packages/components/src/ui/popover/index.ts"],"sourcesContent":["import { computed, defineComponent, h, onBeforeUnmount, onMounted, type PropType, ref } from 'vue'\n\nexport type PopoverPlacement = 'top' | 'top-start' | 'top-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'left' | 'left-start' | 'left-end' | 'right' | 'right-start' | 'right-end'\nexport type PopoverTrigger = 'hover' | 'click' | 'focus' | 'manual'\n\nexport const QxsPopover = defineComponent({\n name: 'QxsPopover',\n props: {\n content: { type: String, default: '' },\n placement: { type: String as PropType<PopoverPlacement>, default: 'bottom' },\n trigger: { type: String as PropType<PopoverTrigger>, default: 'hover' },\n disabled: { type: Boolean, default: false },\n width: { type: [String, Number], default: 150 },\n visible: { type: Boolean, default: undefined },\n offset: { type: Number, default: 12 },\n showArrow: { type: Boolean, default: true },\n },\n emits: ['update:visible', 'show', 'hide', 'after-enter', 'after-leave'],\n setup(props, { slots, emit }) {\n const popoverVisible = ref(false)\n const referenceRef = ref<HTMLElement>()\n const popperRef = ref<HTMLElement>()\n let hideTimer: ReturnType<typeof setTimeout> | null = null\n\n const isControlled = props.visible !== undefined\n\n const currentVisible = computed(() => isControlled ? props.visible : popoverVisible.value)\n\n const show = () => {\n if (props.disabled) { return }\n if (hideTimer) {\n clearTimeout(hideTimer)\n hideTimer = null\n }\n if (!isControlled) {\n popoverVisible.value = true\n }\n emit('update:visible', true)\n emit('show')\n }\n\n const hide = () => {\n if (hideTimer) {\n clearTimeout(hideTimer)\n }\n hideTimer = setTimeout(() => {\n if (!isControlled) {\n popoverVisible.value = false\n }\n emit('update:visible', false)\n emit('hide')\n }, 200)\n }\n\n const handleReferenceMouseEnter = () => {\n if (props.trigger === 'hover') {\n show()\n }\n }\n\n const handleReferenceMouseLeave = () => {\n if (props.trigger === 'hover') {\n hide()\n }\n }\n\n const handleReferenceClick = () => {\n if (props.trigger === 'click') {\n if (currentVisible.value) {\n hide()\n }\n else {\n show()\n }\n }\n }\n\n const handleReferenceFocus = () => {\n if (props.trigger === 'focus') {\n show()\n }\n }\n\n const handleReferenceBlur = () => {\n if (props.trigger === 'focus') {\n hide()\n }\n }\n\n const handlePopperMouseEnter = () => {\n if (props.trigger === 'hover' && hideTimer) {\n clearTimeout(hideTimer)\n hideTimer = null\n }\n }\n\n const handlePopperMouseLeave = () => {\n if (props.trigger === 'hover') {\n hide()\n }\n }\n\n const handleClickOutside = (e: MouseEvent) => {\n if (props.trigger !== 'click') { return }\n const target = e.target as Node\n if (\n referenceRef.value?.contains(target)\n || popperRef.value?.contains(target)\n ) {\n return\n }\n hide()\n }\n\n onMounted(() => {\n if (props.trigger === 'click') {\n document.addEventListener('click', handleClickOutside)\n }\n })\n\n onBeforeUnmount(() => {\n if (props.trigger === 'click') {\n document.removeEventListener('click', handleClickOutside)\n }\n if (hideTimer) {\n clearTimeout(hideTimer)\n }\n })\n\n const getPopperStyle = () => {\n const width = typeof props.width === 'number' ? `${props.width}px` : props.width\n return {\n position: 'absolute' as const,\n zIndex: 2000,\n width,\n padding: '12px',\n backgroundColor: 'var(--qxs-fill-color-blank, #fff)',\n border: '1px solid var(--qxs-border-color-light, #e4e7ed)',\n borderRadius: '4px',\n boxShadow: '0 2px 12px 0 rgba(0, 0, 0, 0.1)',\n fontSize: '14px',\n lineHeight: '1.4',\n wordBreak: 'break-all' as const,\n }\n }\n\n return () => h('div', {\n class: 'qxs-popover',\n style: {\n display: 'inline-block',\n position: 'relative',\n },\n }, [\n h('div', {\n ref: referenceRef,\n class: 'qxs-popover__reference',\n onMouseenter: handleReferenceMouseEnter,\n onMouseleave: handleReferenceMouseLeave,\n onClick: handleReferenceClick,\n onFocus: handleReferenceFocus,\n onBlur: handleReferenceBlur,\n }, slots.reference?.() || slots.default?.()),\n currentVisible.value && h('div', {\n ref: popperRef,\n class: ['qxs-popover__popper', `qxs-popover__popper--${props.placement}`],\n style: getPopperStyle(),\n onMouseenter: handlePopperMouseEnter,\n onMouseleave: handlePopperMouseLeave,\n }, slots.default?.() || props.content),\n ])\n },\n})\n\nexport default QxsPopover\n"],"names":["QxsPopover","defineComponent","name","props","content","type","String","default","placement","trigger","disabled","Boolean","width","Number","visible","offset","showArrow","emits","setup","_ref","slots","emit","popoverVisible","ref","referenceRef","popperRef","hideTimer","isControlled","currentVisible","computed","value","show","clearTimeout","hide","setTimeout","handleReferenceMouseEnter","handleReferenceMouseLeave","handleReferenceClick","handleReferenceFocus","handleReferenceBlur","handlePopperMouseEnter","handlePopperMouseLeave","handleClickOutside","e","target","contains","onMounted","document","addEventListener","onBeforeUnmount","removeEventListener","h","class","style","display","position","onMouseenter","onMouseleave","onClick","onFocus","onBlur","reference","zIndex","padding","backgroundColor","border","borderRadius","boxShadow","fontSize","lineHeight","wordBreak"],"mappings":"wGAKO,MAAMA,EAAaC,EAAgB,CACxCC,KAAM,aACNC,MAAO,CACLC,QAAS,CAAEC,KAAMC,OAAQC,QAAS,IAClCC,UAAW,CAAEH,KAAMC,OAAsCC,QAAS,UAClEE,QAAS,CAAEJ,KAAMC,OAAoCC,QAAS,SAC9DG,SAAU,CAAEL,KAAMM,QAASJ,SAAS,GACpCK,MAAO,CAAEP,KAAM,CAACC,OAAQO,QAASN,QAAS,KAC1CO,QAAS,CAAET,KAAMM,QAASJ,aAAS,GACnCQ,OAAQ,CAAEV,KAAMQ,OAAQN,QAAS,IACjCS,UAAW,CAAEX,KAAMM,QAASJ,SAAS,IAEvCU,MAAO,CAAC,iBAAkB,OAAQ,OAAQ,cAAe,eACzDC,KAAAA,CAAMf,EAAAgB,GAAwB,IAAjBC,MAAEA,EAAAC,KAAOA,GAAKF,EACzB,MAAMG,EAAiBC,GAAI,GACrBC,EAAeD,IACfE,EAAYF,IAClB,IAAIG,EAAkD,KAEtD,MAAMC,OAAiC,IAAlBxB,EAAMW,QAErBc,EAAiBC,EAAS,IAAMF,EAAexB,EAAMW,QAAUQ,EAAeQ,OAE9EC,EAAOA,KACP5B,EAAMO,WACNgB,IACFM,aAAaN,GACbA,EAAY,MAETC,IACHL,EAAeQ,OAAQ,GAEzBT,EAAK,kBAAkB,GACvBA,EAAK,UAGDY,EAAOA,KACPP,GACFM,aAAaN,GAEfA,EAAYQ,WAAW,KAChBP,IACHL,EAAeQ,OAAQ,GAEzBT,EAAK,kBAAkB,GACvBA,EAAK,SACJ,MAGCc,EAA4BA,KACV,UAAlBhC,EAAMM,SACRsB,KAIEK,EAA4BA,KACV,UAAlBjC,EAAMM,SACRwB,KAIEI,EAAuBA,KACL,UAAlBlC,EAAMM,UACJmB,EAAeE,MACjBG,IAGAF,MAKAO,EAAuBA,KACL,UAAlBnC,EAAMM,SACRsB,KAIEQ,EAAsBA,KACJ,UAAlBpC,EAAMM,SACRwB,KAIEO,EAAyBA,KACP,UAAlBrC,EAAMM,SAAuBiB,IAC/BM,aAAaN,GACbA,EAAY,OAIVe,EAAyBA,KACP,UAAlBtC,EAAMM,SACRwB,KAIES,EAAsBC,IAC1B,GAAsB,UAAlBxC,EAAMM,QAAuB,OACjC,MAAMmC,EAASD,EAAEC,OAEfpB,EAAaM,OAAOe,SAASD,IAC1BnB,EAAUK,OAAOe,SAASD,IAI/BX,KAGFa,EAAU,KACc,UAAlB3C,EAAMM,SACRsC,SAASC,iBAAiB,QAASN,KAIvCO,EAAgB,KACQ,UAAlB9C,EAAMM,SACRsC,SAASG,oBAAoB,QAASR,GAEpChB,GACFM,aAAaN,KAqBjB,MAAO,IAAMyB,EAAE,MAAO,CACpBC,MAAO,cACPC,MAAO,CACLC,QAAS,eACTC,SAAU,aAEX,CACDJ,EAAE,MAAO,CACP5B,IAAKC,EACL4B,MAAO,yBACPI,aAAcrB,EACdsB,aAAcrB,EACdsB,QAASrB,EACTsB,QAASrB,EACTsB,OAAQrB,GACPnB,EAAMyC,eAAiBzC,EAAMb,aAChCqB,EAAeE,OAASqB,EAAE,MAAO,CAC/B5B,IAAKE,EACL2B,MAAO,CAAC,sBAAuB,wBAAwBjD,EAAMK,aAC7D6C,MAlCK,CACLE,SAAU,WACVO,OAAQ,IACRlD,MAJmC,iBAAhBT,EAAMS,MAAqB,GAAGT,EAAMS,UAAYT,EAAMS,MAKzEmD,QAAS,OACTC,gBAAiB,oCACjBC,OAAQ,mDACRC,aAAc,MACdC,UAAW,kCACXC,SAAU,OACVC,WAAY,MACZC,UAAW,aAwBXd,aAAchB,EACdiB,aAAchB,GACbrB,EAAMb,aAAeJ,EAAMC,UAElC"}
@@ -1,2 +0,0 @@
1
- import{defineComponent as e,inject as l,computed as a,h as t,provide as d}from"vue";const o=Symbol("radioGroup"),s=e({name:"QxsRadio",props:{modelValue:{type:[String,Number,Boolean],default:""},label:{type:[String,Number,Boolean],default:""},disabled:{type:Boolean,default:!1},name:{type:String,default:""}},emits:["update:modelValue","change"],setup(e,d){let{slots:s,emit:i}=d;const n=l(o,null),u=a(()=>n?n.value===e.label:e.modelValue===e.label),r=()=>{e.disabled||(n?n.value=e.label:i("update:modelValue",e.label),i("change",e.label))};return()=>t("label",{class:["qxs-radio",{"is-checked":u.value,"is-disabled":e.disabled}],style:{display:"inline-flex",alignItems:"center",cursor:e.disabled?"not-allowed":"pointer",marginRight:"12px"}},[t("input",{type:"radio",class:"qxs-radio__input",value:e.label,checked:u.value,disabled:e.disabled,name:e.name,onChange:r,style:{marginRight:"8px",cursor:e.disabled?"not-allowed":"pointer"}}),t("span",{class:"qxs-radio__label",style:{fontSize:"14px",color:e.disabled?"var(--qxs-text-color-disabled, #c0c4cc)":void 0}},s.default?.()||e.label)])}}),i=e({name:"QxsRadioGroup",props:{modelValue:{type:[String,Number,Boolean],default:""},disabled:{type:Boolean,default:!1},name:{type:String,default:""}},emits:["update:modelValue","change"],setup(e,l){let{slots:s,emit:i}=l;const n=a({get:()=>e.modelValue,set:e=>{i("update:modelValue",e),i("change",e)}});return d(o,n),()=>t("div",{class:"qxs-radio-group",style:{display:"inline-flex",flexDirection:"column",gap:"12px"}},s.default?.())}});export{s as QxsRadio,i as QxsRadioGroup,s as default};
2
- //# sourceMappingURL=index.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.mjs","sources":["../../../../../../packages/components/src/ui/radio/index.ts"],"sourcesContent":["import { computed, defineComponent, h, inject, type InjectionKey, type PropType, provide, type WritableComputedRef } from 'vue'\n\nconst radioGroupKey: InjectionKey<WritableComputedRef<string | number | boolean>> = Symbol('radioGroup')\n\nexport const QxsRadio = defineComponent({\n name: 'QxsRadio',\n props: {\n modelValue: { type: [String, Number, Boolean] as PropType<string | number | boolean>, default: '' },\n label: { type: [String, Number, Boolean] as PropType<string | number | boolean>, default: '' },\n disabled: { type: Boolean, default: false },\n name: { type: String, default: '' },\n },\n emits: ['update:modelValue', 'change'],\n setup(props, { slots, emit }) {\n const radioGroup = inject(radioGroupKey, null)\n\n const isChecked = computed(() => {\n if (radioGroup) {\n return radioGroup.value === props.label\n }\n return props.modelValue === props.label\n })\n\n const handleChange = () => {\n if (!props.disabled) {\n if (radioGroup) {\n radioGroup.value = props.label\n }\n else {\n emit('update:modelValue', props.label)\n }\n emit('change', props.label)\n }\n }\n\n return () => h('label', {\n class: ['qxs-radio', { 'is-checked': isChecked.value, 'is-disabled': props.disabled }],\n style: {\n display: 'inline-flex',\n alignItems: 'center',\n cursor: props.disabled ? 'not-allowed' : 'pointer',\n marginRight: '12px',\n },\n }, [\n h('input', {\n type: 'radio',\n class: 'qxs-radio__input',\n value: props.label,\n checked: isChecked.value,\n disabled: props.disabled,\n name: props.name,\n onChange: handleChange,\n style: {\n marginRight: '8px',\n cursor: props.disabled ? 'not-allowed' : 'pointer',\n },\n }),\n h('span', {\n class: 'qxs-radio__label',\n style: {\n fontSize: '14px',\n color: props.disabled ? 'var(--qxs-text-color-disabled, #c0c4cc)' : undefined,\n },\n }, slots.default?.() || props.label),\n ])\n },\n})\n\nexport const QxsRadioGroup = defineComponent({\n name: 'QxsRadioGroup',\n props: {\n modelValue: { type: [String, Number, Boolean] as PropType<string | number | boolean>, default: '' },\n disabled: { type: Boolean, default: false },\n name: { type: String, default: '' },\n },\n emits: ['update:modelValue', 'change'],\n setup(props, { slots, emit }) {\n const modelValue = computed({\n get: () => props.modelValue,\n set: (val) => {\n emit('update:modelValue', val)\n emit('change', val)\n },\n })\n\n provide(radioGroupKey, modelValue)\n\n return () => h('div', {\n class: 'qxs-radio-group',\n style: {\n display: 'inline-flex',\n flexDirection: 'column',\n gap: '12px',\n },\n }, slots.default?.())\n },\n})\n\nexport default QxsRadio\n"],"names":["radioGroupKey","Symbol","QxsRadio","defineComponent","name","props","modelValue","type","String","Number","Boolean","default","label","disabled","emits","setup","_ref","slots","emit","radioGroup","inject","isChecked","computed","value","handleChange","h","class","style","display","alignItems","cursor","marginRight","checked","onChange","fontSize","color","QxsRadioGroup","_ref2","get","set","val","provide","flexDirection","gap"],"mappings":"oFAEA,MAAMA,EAA8EC,OAAO,cAE9EC,EAAWC,EAAgB,CACtCC,KAAM,WACNC,MAAO,CACLC,WAAY,CAAEC,KAAM,CAACC,OAAQC,OAAQC,SAAiDC,QAAS,IAC/FC,MAAO,CAAEL,KAAM,CAACC,OAAQC,OAAQC,SAAiDC,QAAS,IAC1FE,SAAU,CAAEN,KAAMG,QAASC,SAAS,GACpCP,KAAM,CAAEG,KAAMC,OAAQG,QAAS,KAEjCG,MAAO,CAAC,oBAAqB,UAC7BC,KAAAA,CAAMV,EAAAW,GAAwB,IAAjBC,MAAEA,EAAAC,KAAOA,GAAKF,EACzB,MAAMG,EAAaC,EAAOpB,EAAe,MAEnCqB,EAAYC,EAAS,IACrBH,EACKA,EAAWI,QAAUlB,EAAMO,MAE7BP,EAAMC,aAAeD,EAAMO,OAG9BY,EAAeA,KACdnB,EAAMQ,WACLM,EACFA,EAAWI,MAAQlB,EAAMO,MAGzBM,EAAK,oBAAqBb,EAAMO,OAElCM,EAAK,SAAUb,EAAMO,SAIzB,MAAO,IAAMa,EAAE,QAAS,CACtBC,MAAO,CAAC,YAAa,CAAE,aAAcL,EAAUE,MAAO,cAAelB,EAAMQ,WAC3Ec,MAAO,CACLC,QAAS,cACTC,WAAY,SACZC,OAAQzB,EAAMQ,SAAW,cAAgB,UACzCkB,YAAa,SAEd,CACDN,EAAE,QAAS,CACTlB,KAAM,QACNmB,MAAO,mBACPH,MAAOlB,EAAMO,MACboB,QAASX,EAAUE,MACnBV,SAAUR,EAAMQ,SAChBT,KAAMC,EAAMD,KACZ6B,SAAUT,EACVG,MAAO,CACLI,YAAa,MACbD,OAAQzB,EAAMQ,SAAW,cAAgB,aAG7CY,EAAE,OAAQ,CACRC,MAAO,mBACPC,MAAO,CACLO,SAAU,OACVC,MAAO9B,EAAMQ,SAAW,+CAA4C,IAErEI,EAAMN,aAAeN,EAAMO,QAElC,IAGWwB,EAAgBjC,EAAgB,CAC3CC,KAAM,gBACNC,MAAO,CACLC,WAAY,CAAEC,KAAM,CAACC,OAAQC,OAAQC,SAAiDC,QAAS,IAC/FE,SAAU,CAAEN,KAAMG,QAASC,SAAS,GACpCP,KAAM,CAAEG,KAAMC,OAAQG,QAAS,KAEjCG,MAAO,CAAC,oBAAqB,UAC7BC,KAAAA,CAAMV,EAAAgC,GAAwB,IAAjBpB,MAAEA,EAAAC,KAAOA,GAAKmB,EACzB,MAAM/B,EAAagB,EAAS,CAC1BgB,IAAKA,IAAMjC,EAAMC,WACjBiC,IAAMC,IACJtB,EAAK,oBAAqBsB,GAC1BtB,EAAK,SAAUsB,MAMnB,OAFAC,EAAQzC,EAAeM,GAEhB,IAAMmB,EAAE,MAAO,CACpBC,MAAO,kBACPC,MAAO,CACLC,QAAS,cACTc,cAAe,SACfC,IAAK,SAEN1B,EAAMN,YACX"}
@@ -1,2 +0,0 @@
1
- import{defineComponent as r,h as a}from"vue";const e=r({name:"QxsScrollbar",props:{height:{type:[String,Number],default:""},maxHeight:{type:[String,Number],default:""},always:{type:Boolean,default:!1}},setup(r,e){let{slots:l}=e;const t=r=>"number"==typeof r?`${r}px`:r,o={overflow:"auto",position:"relative"};r.height&&(o.height=t(r.height)),r.maxHeight&&(o.maxHeight=t(r.maxHeight));const s=`\n .qxs-scrollbar__wrapper::-webkit-scrollbar {\n width: 8px;\n height: 8px;\n }\n .qxs-scrollbar__wrapper::-webkit-scrollbar-thumb {\n background-color: rgba(144, 147, 153, 0.3);\n border-radius: 4px;\n }\n .qxs-scrollbar__wrapper::-webkit-scrollbar-thumb:hover {\n background-color: rgba(144, 147, 153, 0.5);\n }\n .qxs-scrollbar__wrapper::-webkit-scrollbar-track {\n background-color: transparent;\n }\n ${r.always?"":"\n .qxs-scrollbar__wrapper::-webkit-scrollbar {\n display: none;\n }\n .qxs-scrollbar__wrapper:hover::-webkit-scrollbar {\n display: block;\n }\n "}\n `;return()=>a("div",{class:"qxs-scrollbar",style:{position:"relative"}},[a("style",s),a("div",{class:"qxs-scrollbar__wrapper",style:o},l.default?.())])}});export{e as QxsScrollbar,e as default};
2
- //# sourceMappingURL=index.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.mjs","sources":["../../../../../../packages/components/src/ui/scrollbar/index.ts"],"sourcesContent":["import { type CSSProperties, defineComponent, h } from 'vue'\n\nexport const QxsScrollbar = defineComponent({\n name: 'QxsScrollbar',\n props: {\n height: { type: [String, Number], default: '' },\n maxHeight: { type: [String, Number], default: '' },\n always: { type: Boolean, default: false },\n },\n setup(props, { slots }) {\n const getHeight = (value: string | number) => {\n if (typeof value === 'number') { return `${value}px` }\n return value\n }\n\n const wrapperStyle: CSSProperties = {\n overflow: 'auto',\n position: 'relative',\n }\n\n if (props.height) {\n wrapperStyle.height = getHeight(props.height)\n }\n\n if (props.maxHeight) {\n wrapperStyle.maxHeight = getHeight(props.maxHeight)\n }\n\n const scrollbarStyles = `\n .qxs-scrollbar__wrapper::-webkit-scrollbar {\n width: 8px;\n height: 8px;\n }\n .qxs-scrollbar__wrapper::-webkit-scrollbar-thumb {\n background-color: rgba(144, 147, 153, 0.3);\n border-radius: 4px;\n }\n .qxs-scrollbar__wrapper::-webkit-scrollbar-thumb:hover {\n background-color: rgba(144, 147, 153, 0.5);\n }\n .qxs-scrollbar__wrapper::-webkit-scrollbar-track {\n background-color: transparent;\n }\n ${props.always\n ? ''\n : `\n .qxs-scrollbar__wrapper::-webkit-scrollbar {\n display: none;\n }\n .qxs-scrollbar__wrapper:hover::-webkit-scrollbar {\n display: block;\n }\n `}\n `\n\n return () => h('div', {\n class: 'qxs-scrollbar',\n style: { position: 'relative' },\n }, [\n h('style', scrollbarStyles),\n h('div', {\n class: 'qxs-scrollbar__wrapper',\n style: wrapperStyle,\n }, slots.default?.()),\n ])\n },\n})\n\nexport default QxsScrollbar\n"],"names":["QxsScrollbar","defineComponent","name","props","height","type","String","Number","default","maxHeight","always","Boolean","setup","_ref","slots","getHeight","value","wrapperStyle","overflow","position","scrollbarStyles","h","class","style"],"mappings":"6CAEO,MAAMA,EAAeC,EAAgB,CAC1CC,KAAM,eACNC,MAAO,CACLC,OAAQ,CAAEC,KAAM,CAACC,OAAQC,QAASC,QAAS,IAC3CC,UAAW,CAAEJ,KAAM,CAACC,OAAQC,QAASC,QAAS,IAC9CE,OAAQ,CAAEL,KAAMM,QAASH,SAAS,IAEpCI,KAAAA,CAAMT,EAAAU,GAAkB,IAAXC,MAAEA,GAAMD,EACnB,MAAME,EAAaC,GACI,iBAAVA,EAA6B,GAAGA,MACpCA,EAGHC,EAA8B,CAClCC,SAAU,OACVC,SAAU,YAGRhB,EAAMC,SACRa,EAAab,OAASW,EAAUZ,EAAMC,SAGpCD,EAAMM,YACRQ,EAAaR,UAAYM,EAAUZ,EAAMM,YAG3C,MAAMW,EAAkB,ifAepBjB,EAAMO,OACJ,GACA,gNAUN,MAAO,IAAMW,EAAE,MAAO,CACpBC,MAAO,gBACPC,MAAO,CAAEJ,SAAU,aAClB,CACDE,EAAE,QAASD,GACXC,EAAE,MAAO,CACPC,MAAO,yBACPC,MAAON,GACNH,EAAMN,cAEb"}
@@ -1,2 +0,0 @@
1
- import{defineComponent as e,inject as l,computed as a,h as t,ref as o,watch as s,provide as r}from"vue";const i=Symbol("QxsSelect"),n=e({name:"QxsOption",props:{value:{type:[String,Number,Boolean,Object],required:!0},label:{type:String,default:""},disabled:{type:Boolean,default:!1}},setup(e,o){let{slots:s}=o;const r=l(i);if(!r)return()=>null;r.registerOption(e.value,e.label||String(e.value));const n=a(()=>r.multiple.value?Array.isArray(r.modelValue.value)&&r.modelValue.value.includes(e.value):r.modelValue.value===e.value),d=()=>{e.disabled||r.handleSelect(e.value,e.label||String(e.value))};return()=>t("div",{class:["qxs-option",{"is-selected":n.value,"is-disabled":e.disabled}],onClick:d,style:{padding:"4px 8px",cursor:e.disabled?"not-allowed":"pointer",backgroundColor:n.value?"rgba(61, 97, 227, 0.1)":"transparent",color:n.value?"var(--qxs-color-primary, #3D61E3)":e.disabled?"#c0c4cc":"#606266",fontSize:"14px",lineHeight:"1.25",borderRadius:"4px",fontWeight:n.value?"500":"400",marginBottom:"2px"},onMouseenter:l=>{e.disabled||(l.currentTarget.style.backgroundColor=n.value?"rgba(61, 97, 227, 0.1)":"#f5f7fa")},onMouseleave:l=>{e.disabled||(l.currentTarget.style.backgroundColor=n.value?"rgba(61, 97, 227, 0.1)":"transparent")}},s.default?.()||e.label)}}),d=e({name:"QxsSelect",props:{modelValue:{type:[String,Number,Boolean,Array,Object],default:""},disabled:{type:Boolean,default:!1},placeholder:{type:String,default:"请选择"},clearable:{type:Boolean,default:!1},multiple:{type:Boolean,default:!1},size:{type:String,default:"default"},filterable:{type:Boolean,default:!1}},emits:["update:modelValue","change","clear","visible-change","remove-tag","focus","blur"],setup(e,l){let{slots:n,emit:d}=l;const u=o(!1),p=o(""),c=o(),x=o([]),g=o(new Map);s(()=>e.modelValue,l=>{e.multiple&&Array.isArray(l)&&(x.value=l.map(e=>({value:e,label:g.value.get(e)||String(e)})))},{immediate:!0,deep:!0});const b=a(()=>e.multiple&&Array.isArray(e.modelValue)?e.modelValue.length>0?`已选择 ${e.modelValue.length} 项`:"":p.value),f=l=>{l.stopPropagation(),e.multiple?(d("update:modelValue",[]),x.value=[]):(d("update:modelValue",""),p.value=""),d("clear")},v=()=>{e.disabled||(u.value=!u.value,d("visible-change",u.value))},m=e=>{d("focus",e)},y=e=>{d("blur",e)};r(i,{modelValue:a(()=>e.modelValue),multiple:a(()=>e.multiple),handleSelect:(l,a)=>{if(e.multiple){const t=Array.isArray(e.modelValue)?[...e.modelValue]:[],o=t.findIndex(e=>e===l);if(o>-1){t.splice(o,1);const e=x.value.findIndex(e=>e.value===l);e>-1&&x.value.splice(e,1),d("remove-tag",l)}else t.push(l),x.value.push({value:l,label:a});d("update:modelValue",t),d("change",t)}else p.value=a,d("update:modelValue",l),d("change",l),u.value=!1},registerOption:(e,l)=>{g.value.set(e,l)}});const h=a(()=>"large"===e.size?"40px":"small"===e.size?"24px":"32px");return()=>t("div",{class:["qxs-select",`qxs-select--${e.size}`,{"is-disabled":e.disabled,"is-focus":u.value}],style:{position:"relative",display:"inline-block",width:"100%"}},[t("div",{class:"qxs-select__wrapper",onClick:v,style:{position:"relative",cursor:e.disabled?"not-allowed":"pointer"}},[e.multiple?t("div",{class:"qxs-select__tags",style:{display:"flex",flexWrap:"wrap",gap:"4px",padding:"4px 30px 4px 8px",minHeight:h.value,border:"1px solid hsl(214.3 31.8% 91.4%)",borderRadius:"6px",backgroundColor:e.disabled?"hsl(210 40% 96.1%)":"#fff",cursor:e.disabled?"not-allowed":"pointer",alignItems:"center"}},[...x.value.map(l=>t("span",{class:"qxs-select__tag",style:{display:"inline-flex",alignItems:"center",gap:"2px",padding:"1px 6px",backgroundColor:"var(--qxs-color-primary, #3D61E3)",border:"none",borderRadius:"4px",fontSize:"12px",color:"#fff",fontWeight:"500",lineHeight:"1.2"}},[t("span",null,l.label),!e.disabled&&t("span",{class:"qxs-select__tag-close",onClick:a=>((l,a)=>{if(a.stopPropagation(),e.multiple){const a=Array.isArray(e.modelValue)?[...e.modelValue]:[],t=a.findIndex(e=>e===l);if(t>-1){a.splice(t,1);const e=x.value.findIndex(e=>e.value===l);e>-1&&x.value.splice(e,1),d("remove-tag",l),d("update:modelValue",a),d("change",a)}}})(l.value,a),style:{cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",width:"12px",height:"12px",borderRadius:"50%",fontSize:"9px",color:"#fff",transition:"all 0.2s"},onMouseenter:e=>{e.currentTarget.style.backgroundColor="rgba(255, 255, 255, 0.2)"},onMouseleave:e=>{e.currentTarget.style.backgroundColor="transparent"}},"×")])),0===x.value.length&&t("span",{style:{color:"hsl(215 20.2% 65.1%)",fontSize:"14px"}},e.placeholder)]):t("input",{ref:c,class:"qxs-select__inner",type:"text",readonly:!e.filterable,value:b.value,placeholder:e.placeholder,disabled:e.disabled,onFocus:m,onBlur:y,style:{width:"100%",height:h.value,padding:"0 30px 0 12px",border:"1px solid hsl(214.3 31.8% 91.4%)",borderRadius:"6px",outline:"none",fontSize:"14px",backgroundColor:e.disabled?"hsl(210 40% 96.1%)":"#fff",cursor:e.disabled?"not-allowed":"pointer",transition:"border-color 0.2s"}}),t("span",{class:"qxs-select__suffix",style:{position:"absolute",right:"10px",top:"50%",transform:"translateY(-50%)",display:"flex",alignItems:"center",gap:"4px"}},[e.clearable&&b.value&&!e.disabled&&t("span",{class:"qxs-select__clear",onClick:f,style:{fontSize:"14px",cursor:"pointer"}},"×"),t("span",{class:"qxs-select__caret",style:{fontSize:"12px",transform:u.value?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.3s"}},"▼")])]),u.value&&t("div",{class:"qxs-select__dropdown",style:{position:"absolute",top:"100%",left:"0",right:"0",marginTop:"4px",backgroundColor:"#fff",border:"1px solid hsl(214.3 31.8% 91.4%)",borderRadius:"6px",boxShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1)",zIndex:2e3,maxHeight:"274px",overflowY:"auto",padding:"4px"}},n.default?.())])}});export{n as QxsOption,d as QxsSelect,d as default};
2
- //# sourceMappingURL=index.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.mjs","sources":["../../../../../../packages/components/src/ui/select/index.ts"],"sourcesContent":["import { computed, defineComponent, h, inject, type InjectionKey, type PropType, provide, ref, type Ref, watch } from 'vue'\n\nexport type SelectSize = 'large' | 'default' | 'small'\n\ninterface SelectContext {\n modelValue: Ref<any>\n multiple: Ref<boolean>\n handleSelect: (value: any, label: string) => void\n registerOption: (value: any, label: string) => void\n}\n\nconst SELECT_INJECTION_KEY: InjectionKey<SelectContext> = Symbol('QxsSelect')\n\nexport const QxsOption = defineComponent({\n name: 'QxsOption',\n props: {\n value: { type: [String, Number, Boolean, Object], required: true },\n label: { type: String, default: '' },\n disabled: { type: Boolean, default: false },\n },\n setup(props, { slots }) {\n const select = inject(SELECT_INJECTION_KEY)\n\n if (!select) {\n console.warn('QxsOption must be used inside QxsSelect')\n return () => null\n }\n\n select.registerOption(props.value, props.label || String(props.value))\n\n const isSelected = computed(() => {\n if (select.multiple.value) {\n return Array.isArray(select.modelValue.value)\n && select.modelValue.value.includes(props.value)\n }\n return select.modelValue.value === props.value\n })\n\n const handleClick = () => {\n if (props.disabled) { return }\n select.handleSelect(props.value, props.label || String(props.value))\n }\n\n return () => h('div', {\n class: [\n 'qxs-option',\n {\n 'is-selected': isSelected.value,\n 'is-disabled': props.disabled,\n },\n ],\n onClick: handleClick,\n style: {\n padding: '4px 8px',\n cursor: props.disabled ? 'not-allowed' : 'pointer',\n backgroundColor: isSelected.value ? 'rgba(61, 97, 227, 0.1)' : 'transparent',\n color: isSelected.value ? 'var(--qxs-color-primary, #3D61E3)' : props.disabled ? '#c0c4cc' : '#606266',\n fontSize: '14px',\n lineHeight: '1.25',\n borderRadius: '4px',\n fontWeight: isSelected.value ? '500' : '400',\n marginBottom: '2px',\n },\n onMouseenter: (e: MouseEvent) => {\n if (!props.disabled) {\n (e.currentTarget as HTMLElement).style.backgroundColor\n = isSelected.value ? 'rgba(61, 97, 227, 0.1)' : '#f5f7fa'\n }\n },\n onMouseleave: (e: MouseEvent) => {\n if (!props.disabled) {\n (e.currentTarget as HTMLElement).style.backgroundColor\n = isSelected.value ? 'rgba(61, 97, 227, 0.1)' : 'transparent'\n }\n },\n }, slots.default?.() || props.label)\n },\n})\n\nexport const QxsSelect = defineComponent({\n name: 'QxsSelect',\n props: {\n modelValue: { type: [String, Number, Boolean, Array, Object], default: '' },\n disabled: { type: Boolean, default: false },\n placeholder: { type: String, default: '请选择' },\n clearable: { type: Boolean, default: false },\n multiple: { type: Boolean, default: false },\n size: { type: String as PropType<SelectSize>, default: 'default' },\n filterable: { type: Boolean, default: false },\n },\n emits: ['update:modelValue', 'change', 'clear', 'visible-change', 'remove-tag', 'focus', 'blur'],\n setup(props, { slots, emit }) {\n const visible = ref(false)\n const selectedLabel = ref('')\n const inputRef = ref<HTMLInputElement>()\n const selectedTags = ref<{ value: any, label: string }[]>([])\n const optionsMap = ref<Map<any, string>>(new Map())\n\n const registerOption = (value: any, label: string) => {\n optionsMap.value.set(value, label)\n }\n\n watch(() => props.modelValue, (newVal) => {\n if (props.multiple && Array.isArray(newVal)) {\n selectedTags.value = newVal.map(v => ({\n value: v,\n label: optionsMap.value.get(v) || String(v),\n }))\n }\n }, { immediate: true, deep: true })\n\n const displayValue = computed(() => {\n if (props.multiple && Array.isArray(props.modelValue)) {\n return props.modelValue.length > 0 ? `已选择 ${props.modelValue.length} 项` : ''\n }\n return selectedLabel.value\n })\n\n const handleSelect = (value: any, label: string) => {\n if (props.multiple) {\n const values = Array.isArray(props.modelValue) ? [...props.modelValue] : []\n const index = values.findIndex(v => v === value)\n\n if (index > -1) {\n values.splice(index, 1)\n const tagIndex = selectedTags.value.findIndex(t => t.value === value)\n if (tagIndex > -1) {\n selectedTags.value.splice(tagIndex, 1)\n }\n emit('remove-tag', value)\n }\n else {\n values.push(value)\n selectedTags.value.push({ value, label })\n }\n\n emit('update:modelValue', values)\n emit('change', values)\n }\n else {\n selectedLabel.value = label\n emit('update:modelValue', value)\n emit('change', value)\n visible.value = false\n }\n }\n\n const removeTag = (value: any, e: MouseEvent) => {\n e.stopPropagation()\n if (props.multiple) {\n const values = Array.isArray(props.modelValue) ? [...props.modelValue] : []\n const index = values.findIndex(v => v === value)\n\n if (index > -1) {\n values.splice(index, 1)\n const tagIndex = selectedTags.value.findIndex(t => t.value === value)\n if (tagIndex > -1) {\n selectedTags.value.splice(tagIndex, 1)\n }\n emit('remove-tag', value)\n emit('update:modelValue', values)\n emit('change', values)\n }\n }\n }\n\n const handleClear = (e: MouseEvent) => {\n e.stopPropagation()\n if (props.multiple) {\n emit('update:modelValue', [])\n selectedTags.value = []\n }\n else {\n emit('update:modelValue', '')\n selectedLabel.value = ''\n }\n emit('clear')\n }\n\n const toggleDropdown = () => {\n if (props.disabled) { return }\n visible.value = !visible.value\n emit('visible-change', visible.value)\n }\n\n const handleFocus = (e: FocusEvent) => {\n emit('focus', e)\n }\n\n const handleBlur = (e: FocusEvent) => {\n emit('blur', e)\n }\n\n provide(SELECT_INJECTION_KEY, {\n modelValue: computed(() => props.modelValue),\n multiple: computed(() => props.multiple),\n handleSelect,\n registerOption,\n })\n\n const inputHeight = computed(() => {\n return props.size === 'large' ? '40px' : props.size === 'small' ? '24px' : '32px'\n })\n\n return () => h('div', {\n class: [\n 'qxs-select',\n `qxs-select--${props.size}`,\n {\n 'is-disabled': props.disabled,\n 'is-focus': visible.value,\n },\n ],\n style: {\n position: 'relative',\n display: 'inline-block',\n width: '100%',\n },\n }, [\n h('div', {\n class: 'qxs-select__wrapper',\n onClick: toggleDropdown,\n style: {\n position: 'relative',\n cursor: props.disabled ? 'not-allowed' : 'pointer',\n },\n }, [\n props.multiple\n ? h('div', {\n class: 'qxs-select__tags',\n style: {\n display: 'flex',\n flexWrap: 'wrap',\n gap: '4px',\n padding: '4px 30px 4px 8px',\n minHeight: inputHeight.value,\n border: '1px solid hsl(214.3 31.8% 91.4%)',\n borderRadius: '6px',\n backgroundColor: props.disabled ? 'hsl(210 40% 96.1%)' : '#fff',\n cursor: props.disabled ? 'not-allowed' : 'pointer',\n alignItems: 'center',\n },\n }, [\n ...selectedTags.value.map(tag => h('span', {\n class: 'qxs-select__tag',\n style: {\n display: 'inline-flex',\n alignItems: 'center',\n gap: '2px',\n padding: '1px 6px',\n backgroundColor: 'var(--qxs-color-primary, #3D61E3)',\n border: 'none',\n borderRadius: '4px',\n fontSize: '12px',\n color: '#fff',\n fontWeight: '500',\n lineHeight: '1.2',\n },\n }, [\n h('span', null, tag.label),\n !props.disabled && h('span', {\n class: 'qxs-select__tag-close',\n onClick: (e: MouseEvent) => removeTag(tag.value, e),\n style: {\n cursor: 'pointer',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n width: '12px',\n height: '12px',\n borderRadius: '50%',\n fontSize: '9px',\n color: '#fff',\n transition: 'all 0.2s',\n },\n onMouseenter: (e: MouseEvent) => {\n const el = e.currentTarget as HTMLElement\n el.style.backgroundColor = 'rgba(255, 255, 255, 0.2)'\n },\n onMouseleave: (e: MouseEvent) => {\n const el = e.currentTarget as HTMLElement\n el.style.backgroundColor = 'transparent'\n },\n }, '×'),\n ])),\n selectedTags.value.length === 0 && h('span', {\n style: {\n color: 'hsl(215 20.2% 65.1%)',\n fontSize: '14px',\n },\n }, props.placeholder),\n ])\n : h('input', {\n ref: inputRef,\n class: 'qxs-select__inner',\n type: 'text',\n readonly: !props.filterable,\n value: displayValue.value,\n placeholder: props.placeholder,\n disabled: props.disabled,\n onFocus: handleFocus,\n onBlur: handleBlur,\n style: {\n width: '100%',\n height: inputHeight.value,\n padding: '0 30px 0 12px',\n border: '1px solid hsl(214.3 31.8% 91.4%)',\n borderRadius: '6px',\n outline: 'none',\n fontSize: '14px',\n backgroundColor: props.disabled ? 'hsl(210 40% 96.1%)' : '#fff',\n cursor: props.disabled ? 'not-allowed' : 'pointer',\n transition: 'border-color 0.2s',\n },\n }),\n h('span', {\n class: 'qxs-select__suffix',\n style: {\n position: 'absolute',\n right: '10px',\n top: '50%',\n transform: 'translateY(-50%)',\n display: 'flex',\n alignItems: 'center',\n gap: '4px',\n },\n }, [\n props.clearable && displayValue.value && !props.disabled && h('span', {\n class: 'qxs-select__clear',\n onClick: handleClear,\n style: {\n fontSize: '14px',\n cursor: 'pointer',\n },\n }, '×'),\n h('span', {\n class: 'qxs-select__caret',\n style: {\n fontSize: '12px',\n transform: visible.value ? 'rotate(180deg)' : 'rotate(0deg)',\n transition: 'transform 0.3s',\n },\n }, '▼'),\n ]),\n ]),\n visible.value && h('div', {\n class: 'qxs-select__dropdown',\n style: {\n position: 'absolute',\n top: '100%',\n left: '0',\n right: '0',\n marginTop: '4px',\n backgroundColor: '#fff',\n border: '1px solid hsl(214.3 31.8% 91.4%)',\n borderRadius: '6px',\n boxShadow: '0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1)',\n zIndex: 2000,\n maxHeight: '274px',\n overflowY: 'auto',\n padding: '4px',\n },\n }, slots.default?.()),\n ])\n },\n})\n\nexport default QxsSelect\n"],"names":["SELECT_INJECTION_KEY","Symbol","QxsOption","defineComponent","name","props","value","type","String","Number","Boolean","Object","required","label","default","disabled","setup","_ref","slots","select","inject","registerOption","isSelected","computed","multiple","Array","isArray","modelValue","includes","handleClick","handleSelect","h","class","onClick","style","padding","cursor","backgroundColor","color","fontSize","lineHeight","borderRadius","fontWeight","marginBottom","onMouseenter","e","currentTarget","onMouseleave","QxsSelect","placeholder","clearable","size","filterable","emits","_ref2","emit","visible","ref","selectedLabel","inputRef","selectedTags","optionsMap","Map","watch","newVal","map","v","get","immediate","deep","displayValue","length","handleClear","stopPropagation","toggleDropdown","handleFocus","handleBlur","provide","values","index","findIndex","splice","tagIndex","t","push","set","inputHeight","position","display","width","flexWrap","gap","minHeight","border","alignItems","tag","removeTag","justifyContent","height","transition","readonly","onFocus","onBlur","outline","right","top","transform","left","marginTop","boxShadow","zIndex","maxHeight","overflowY"],"mappings":"wGAWA,MAAMA,EAAoDC,OAAO,aAEpDC,EAAYC,EAAgB,CACvCC,KAAM,YACNC,MAAO,CACLC,MAAO,CAAEC,KAAM,CAACC,OAAQC,OAAQC,QAASC,QAASC,UAAU,GAC5DC,MAAO,CAAEN,KAAMC,OAAQM,QAAS,IAChCC,SAAU,CAAER,KAAMG,QAASI,SAAS,IAEtCE,KAAAA,CAAMX,EAAAY,GAAkB,IAAXC,MAAEA,GAAMD,EACnB,MAAME,EAASC,EAAOpB,GAEtB,IAAKmB,EAEH,MAAO,IAAM,KAGfA,EAAOE,eAAehB,EAAMC,MAAOD,EAAMQ,OAASL,OAAOH,EAAMC,QAE/D,MAAMgB,EAAaC,EAAS,IACtBJ,EAAOK,SAASlB,MACXmB,MAAMC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,SAChBsF,QAAS1B,EACT2B,OAAQ1B,EACR1C,MAAO,CACLuD,MAAO,OACPS,OAAQZ,EAAYhF,MACpB6B,QAAS,gBACT0D,OAAQ,mCACRpD,aAAc,MACd8D,QAAS,OACThE,SAAU,OACVF,gBAAiBhC,EAAMU,SAAW,qBAAuB,OACzDqB,OAAQ/B,EAAMU,SAAW,cAAgB,UACzCoF,WAAY,uBAGpBpE,EAAE,OAAQ,CACRC,MAAO,qBACPE,MAAO,CACLqD,SAAU,WACViB,MAAO,OACPC,IAAK,MACLC,UAAW,mBACXlB,QAAS,OACTM,WAAY,SACZH,IAAK,QAEN,CACDtF,EAAM6C,WAAaoB,EAAahE,QAAUD,EAAMU,UAAYgB,EAAE,OAAQ,CACpEC,MAAO,oBACPC,QAASuC,EACTtC,MAAO,CACLK,SAAU,OACVH,OAAQ,YAET,KACHL,EAAE,OAAQ,CACRC,MAAO,oBACPE,MAAO,CACLK,SAAU,OACVmE,UAAWlD,EAAQlD,MAAQ,iBAAmB,eAC9C6F,WAAY,mBAEb,SAGP3C,EAAQlD,OAASyB,EAAE,MAAO,CACxBC,MAAO,uBACPE,MAAO,CACLqD,SAAU,WACVkB,IAAK,OACLE,KAAM,IACNH,MAAO,IACPI,UAAW,MACXvE,gBAAiB,OACjBwD,OAAQ,mCACRpD,aAAc,MACdoE,UAAW,uEACXC,OAAQ,IACRC,UAAW,QACXC,UAAW,OACX7E,QAAS,QAEVjB,EAAMJ,cAEb"}
@@ -1,2 +0,0 @@
1
- import{defineComponent as e,inject as t,ref as l,reactive as r,provide as a,computed as s,h as n}from"vue";const o=Symbol("tableColumns"),d=Symbol("tableRegisterColumn"),i=e({name:"QxsTableColumn",props:{prop:{type:String,default:""},label:{type:String,default:""},width:{type:[String,Number],default:""},minWidth:{type:[String,Number],default:""},align:{type:String,default:"left"},sortable:{type:Boolean,default:!1},fixed:{type:[String,Boolean],default:!1},showOverflowTooltip:{type:Boolean,default:!1}},setup(e,l){let{slots:r}=l;const a=t(d),s={prop:e.prop,label:e.label,width:e.width,minWidth:e.minWidth,align:e.align,sortable:e.sortable,fixed:e.fixed,renderHeader:()=>r.header?n("div",{},r.header()):e.label,renderCell:t=>r.default?n("div",{},r.default({row:t})):e.prop?t[e.prop]??"--":"--"};return a&&a(s),()=>null}}),p=e({name:"QxsTable",props:{data:{type:Array,default:()=>[]},stripe:{type:Boolean,default:!1},border:{type:Boolean,default:!1},height:{type:[String,Number],default:""},rowKey:{type:[String,Function],default:""},emptyText:{type:String,default:"暂无数据"}},setup(e,t){let{slots:i}=t;const p=l([]),c=r({prop:null,order:null});a(d,e=>{p.value.push(e)}),a(o,p);const u=s(()=>{if(!c.prop||!c.order)return e.data;const t=[...e.data],{prop:l,order:r}=c;return t.sort((e,t)=>{const a=e[l],s=t[l];if(a===s)return 0;const n=a>s?1:-1;return"ascending"===r?n:-n})}),b=(t,l)=>"function"==typeof e.rowKey?e.rowKey(t):"string"==typeof e.rowKey&&e.rowKey?t[e.rowKey]:String(l),h=()=>n("thead",{class:"qxs-table__header"},[n("tr",{},p.value.map(e=>{const t=["qxs-table__cell",`qxs-table__cell--${e.align||"left"}`,{"qxs-table__cell--sortable":e.sortable,"is-sorting":c.prop===e.prop}],l={};e.width&&(l.width="number"==typeof e.width?`${e.width}px`:e.width),e.minWidth&&(l.minWidth="number"==typeof e.minWidth?`${e.minWidth}px`:e.minWidth);const r=e.renderHeader?e.renderHeader():e.label,a=e.sortable?n("span",{class:"qxs-table__sort-icon"},[n("i",{class:["qxs-table__sort-caret","ascending",{"is-active":c.prop===e.prop&&"ascending"===c.order}]}),n("i",{class:["qxs-table__sort-caret","descending",{"is-active":c.prop===e.prop&&"descending"===c.order}]})]):null;return n("th",{class:t,style:l,onClick:()=>(e=>{e.sortable&&e.prop&&(c.prop===e.prop?"ascending"===c.order?c.order="descending":"descending"===c.order?(c.prop=null,c.order=null):c.order="ascending":(c.prop=e.prop,c.order="ascending"))})(e)},[n("div",{class:"qxs-table__cell-content"},[r,a])])}))]);return()=>{i.default&&i.default();const t=["qxs-table",{"qxs-table--striped":e.stripe,"qxs-table--border":e.border}],l={};return e.height&&(l.height="number"==typeof e.height?`${e.height}px`:e.height),n("div",{class:"qxs-table-wrapper",style:l},[n("table",{class:t},[h(),u.value.length?n("tbody",{class:"qxs-table__body"},u.value.map((t,l)=>{const r=["qxs-table__row",{"qxs-table__row--striped":e.stripe&&l%2==1}];return n("tr",{class:r,key:b(t,l)},p.value.map(e=>{const r=["qxs-table__cell",`qxs-table__cell--${e.align||"left"}`],a={};e.width&&(a.width="number"==typeof e.width?`${e.width}px`:e.width),e.minWidth&&(a.minWidth="number"==typeof e.minWidth?`${e.minWidth}px`:e.minWidth);const s=e.renderCell?e.renderCell(t,l):"--";return n("td",{class:r,style:a},[n("div",{class:"qxs-table__cell-content"},[s])])}))})):n("tbody",{class:"qxs-table__body"},[n("tr",{class:"qxs-table__empty-row"},[n("td",{class:"qxs-table__empty-cell",colspan:p.value.length},[n("div",{class:"qxs-table__empty-text"},[i.empty?i.empty():e.emptyText])])])])])])}}});export{p as QxsTable,i as QxsTableColumn,p as default};
2
- //# sourceMappingURL=index.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.mjs","sources":["../../../../../../packages/components/src/ui/table/index.ts"],"sourcesContent":["import { computed, defineComponent, h, inject, type PropType, provide, reactive, ref, type Ref, type VNode } from 'vue'\n\n// Types\nexport type TableColumnAlign = 'left' | 'center' | 'right'\nexport type TableColumnFixed = 'left' | 'right' | boolean\n\nexport interface TableColumnConfig {\n prop?: string\n label?: string\n width?: string | number\n minWidth?: string | number\n align?: TableColumnAlign\n sortable?: boolean\n fixed?: TableColumnFixed\n renderHeader?: () => VNode | string\n renderCell?: (row: any, index: number) => VNode | string\n}\n\ninterface SortState {\n prop: string | null\n order: 'ascending' | 'descending' | null\n}\n\n// Provide/Inject keys\nconst TABLE_COLUMNS_KEY = Symbol('tableColumns')\nconst TABLE_REGISTER_COLUMN_KEY = Symbol('tableRegisterColumn')\n\n// QxsTableColumn Component\nexport const QxsTableColumn = defineComponent({\n name: 'QxsTableColumn',\n props: {\n prop: { type: String, default: '' },\n label: { type: String, default: '' },\n width: { type: [String, Number], default: '' },\n minWidth: { type: [String, Number], default: '' },\n align: { type: String as PropType<TableColumnAlign>, default: 'left' },\n sortable: { type: Boolean, default: false },\n fixed: { type: [String, Boolean] as PropType<TableColumnFixed>, default: false },\n showOverflowTooltip: { type: Boolean, default: false },\n },\n setup(props, { slots }) {\n const registerColumn = inject<(config: TableColumnConfig) => void>(TABLE_REGISTER_COLUMN_KEY)\n\n const columnConfig: TableColumnConfig = {\n prop: props.prop,\n label: props.label,\n width: props.width,\n minWidth: props.minWidth,\n align: props.align,\n sortable: props.sortable,\n fixed: props.fixed,\n renderHeader: () => {\n if (slots.header) {\n return h('div', {}, slots.header())\n }\n return props.label\n },\n renderCell: (row: any) => {\n if (slots.default) {\n return h('div', {}, slots.default({ row }))\n }\n return props.prop ? (row[props.prop] ?? '--') : '--'\n },\n }\n\n if (registerColumn) {\n registerColumn(columnConfig)\n }\n\n return () => null\n },\n})\n\n// QxsTable Component\nexport const QxsTable = defineComponent({\n name: 'QxsTable',\n props: {\n data: { type: Array as PropType<any[]>, default: () => [] },\n stripe: { type: Boolean, default: false },\n border: { type: Boolean, default: false },\n height: { type: [String, Number], default: '' },\n rowKey: { type: [String, Function] as PropType<string | ((row: any) => string)>, default: '' },\n emptyText: { type: String, default: '暂无数据' },\n },\n setup(props, { slots }) {\n const columns: Ref<TableColumnConfig[]> = ref([])\n const sortState = reactive<SortState>({ prop: null, order: null })\n\n // Register column\n const registerColumn = (config: TableColumnConfig) => {\n columns.value.push(config)\n }\n\n provide(TABLE_REGISTER_COLUMN_KEY, registerColumn)\n provide(TABLE_COLUMNS_KEY, columns)\n\n // Sorted data\n const sortedData = computed(() => {\n if (!sortState.prop || !sortState.order) {\n return props.data\n }\n\n const data = [...props.data]\n const { prop, order } = sortState\n\n return data.sort((a, b) => {\n const aVal = a[prop]\n const bVal = b[prop]\n\n if (aVal === bVal) { return 0 }\n\n const result = aVal > bVal ? 1 : -1\n return order === 'ascending' ? result : -result\n })\n })\n\n // Handle sort\n const handleSort = (column: TableColumnConfig) => {\n if (!column.sortable || !column.prop) { return }\n\n if (sortState.prop === column.prop) {\n if (sortState.order === 'ascending') {\n sortState.order = 'descending'\n }\n else if (sortState.order === 'descending') {\n sortState.prop = null\n sortState.order = null\n }\n else {\n sortState.order = 'ascending'\n }\n }\n else {\n sortState.prop = column.prop\n sortState.order = 'ascending'\n }\n }\n\n // Get row key\n const getRowKey = (row: any, index: number): string => {\n if (typeof props.rowKey === 'function') {\n return props.rowKey(row)\n }\n if (typeof props.rowKey === 'string' && props.rowKey) {\n return row[props.rowKey]\n }\n return String(index)\n }\n\n // Render table header\n const renderHeader = () => {\n return h('thead', { class: 'qxs-table__header' }, [\n h('tr', {}, columns.value.map((column) => {\n const thClass = [\n 'qxs-table__cell',\n `qxs-table__cell--${column.align || 'left'}`,\n {\n 'qxs-table__cell--sortable': column.sortable,\n 'is-sorting': sortState.prop === column.prop,\n },\n ]\n\n const thStyle: Record<string, string> = {}\n if (column.width) {\n thStyle.width = typeof column.width === 'number' ? `${column.width}px` : column.width\n }\n if (column.minWidth) {\n thStyle.minWidth = typeof column.minWidth === 'number' ? `${column.minWidth}px` : column.minWidth\n }\n\n const headerContent = column.renderHeader ? column.renderHeader() : column.label\n\n const sortIcon = column.sortable\n ? h('span', { class: 'qxs-table__sort-icon' }, [\n h('i', {\n class: [\n 'qxs-table__sort-caret',\n 'ascending',\n { 'is-active': sortState.prop === column.prop && sortState.order === 'ascending' },\n ],\n }),\n h('i', {\n class: [\n 'qxs-table__sort-caret',\n 'descending',\n { 'is-active': sortState.prop === column.prop && sortState.order === 'descending' },\n ],\n }),\n ])\n : null\n\n return h('th', {\n class: thClass,\n style: thStyle,\n onClick: () => handleSort(column),\n }, [\n h('div', { class: 'qxs-table__cell-content' }, [\n headerContent,\n sortIcon,\n ]),\n ])\n })),\n ])\n }\n\n // Render table body\n const renderBody = () => {\n if (!sortedData.value.length) {\n return h('tbody', { class: 'qxs-table__body' }, [\n h('tr', { class: 'qxs-table__empty-row' }, [\n h('td', {\n class: 'qxs-table__empty-cell',\n colspan: columns.value.length,\n }, [\n h('div', { class: 'qxs-table__empty-text' }, [\n slots.empty ? slots.empty() : props.emptyText,\n ]),\n ]),\n ]),\n ])\n }\n\n return h('tbody', { class: 'qxs-table__body' }, sortedData.value.map((row, rowIndex) => {\n const rowClass = [\n 'qxs-table__row',\n {\n 'qxs-table__row--striped': props.stripe && rowIndex % 2 === 1,\n },\n ]\n\n return h('tr', {\n class: rowClass,\n key: getRowKey(row, rowIndex),\n }, columns.value.map((column) => {\n const tdClass = [\n 'qxs-table__cell',\n `qxs-table__cell--${column.align || 'left'}`,\n ]\n\n const tdStyle: Record<string, string> = {}\n if (column.width) {\n tdStyle.width = typeof column.width === 'number' ? `${column.width}px` : column.width\n }\n if (column.minWidth) {\n tdStyle.minWidth = typeof column.minWidth === 'number' ? `${column.minWidth}px` : column.minWidth\n }\n\n const cellContent = column.renderCell ? column.renderCell(row, rowIndex) : '--'\n\n return h('td', {\n class: tdClass,\n style: tdStyle,\n }, [\n h('div', { class: 'qxs-table__cell-content' }, [cellContent]),\n ])\n }))\n }))\n }\n\n return () => {\n // Render default slot to collect columns\n if (slots.default) {\n slots.default()\n }\n\n const tableClass = [\n 'qxs-table',\n {\n 'qxs-table--striped': props.stripe,\n 'qxs-table--border': props.border,\n },\n ]\n\n const tableStyle: Record<string, string> = {}\n if (props.height) {\n tableStyle.height = typeof props.height === 'number' ? `${props.height}px` : props.height\n }\n\n return h('div', {\n class: 'qxs-table-wrapper',\n style: tableStyle,\n }, [\n h('table', { class: tableClass }, [\n renderHeader(),\n renderBody(),\n ]),\n ])\n }\n },\n})\n\nexport default QxsTable\n"],"names":["TABLE_COLUMNS_KEY","Symbol","TABLE_REGISTER_COLUMN_KEY","QxsTableColumn","defineComponent","name","props","prop","type","String","default","label","width","Number","minWidth","align","sortable","Boolean","fixed","showOverflowTooltip","setup","_ref","slots","registerColumn","inject","columnConfig","renderHeader","header","h","renderCell","row","QxsTable","data","Array","stripe","border","height","rowKey","Function","emptyText","_ref2","columns","ref","sortState","reactive","order","provide","config","value","push","sortedData","computed","sort","a","b","aVal","bVal","result","getRowKey","index","class","map","column","thClass","thStyle","headerContent","sortIcon","style","onClick","handleSort","tableClass","tableStyle","length","rowIndex","rowClass","key","tdClass","tdStyle","cellContent","colspan","empty"],"mappings":"2GAwBA,MAAMA,EAAoBC,OAAO,gBAC3BC,EAA4BD,OAAO,uBAG5BE,EAAiBC,EAAgB,CAC5CC,KAAM,iBACNC,MAAO,CACLC,KAAM,CAAEC,KAAMC,OAAQC,QAAS,IAC/BC,MAAO,CAAEH,KAAMC,OAAQC,QAAS,IAChCE,MAAO,CAAEJ,KAAM,CAACC,OAAQI,QAASH,QAAS,IAC1CI,SAAU,CAAEN,KAAM,CAACC,OAAQI,QAASH,QAAS,IAC7CK,MAAO,CAAEP,KAAMC,OAAsCC,QAAS,QAC9DM,SAAU,CAAER,KAAMS,QAASP,SAAS,GACpCQ,MAAO,CAAEV,KAAM,CAACC,OAAQQ,SAAwCP,SAAS,GACzES,oBAAqB,CAAEX,KAAMS,QAASP,SAAS,IAEjDU,KAAAA,CAAMd,EAAAe,GAAkB,IAAXC,MAAEA,GAAMD,EACnB,MAAME,EAAiBC,EAA4CtB,GAE7DuB,EAAkC,CACtClB,KAAMD,EAAMC,KACZI,MAAOL,EAAMK,MACbC,MAAON,EAAMM,MACbE,SAAUR,EAAMQ,SAChBC,MAAOT,EAAMS,MACbC,SAAUV,EAAMU,SAChBE,MAAOZ,EAAMY,MACbQ,aAAcA,IACRJ,EAAMK,OACDC,EAAE,MAAO,CAAA,EAAIN,EAAMK,UAErBrB,EAAMK,MAEfkB,WAAaC,GACPR,EAAMZ,QACDkB,EAAE,MAAO,GAAIN,EAAMZ,QAAQ,CAAEoB,SAE/BxB,EAAMC,KA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yBAA2B,CAC3CtC,EAAM0D,MAAQ1D,EAAM0D,QAAU1E,EAAMiC,sBAyElD"}
@@ -1,2 +0,0 @@
1
- import{defineComponent as o,h as e}from"vue";const l=o({name:"QxsTag",props:{type:{type:String,default:"primary"},size:{type:String,default:"default"},effect:{type:String,default:"light"},closable:{type:Boolean,default:!1},round:{type:Boolean,default:!1},color:{type:String,default:""}},emits:["close","click"],setup(o,l){let{slots:r,emit:t}=l;const a=o=>{o.stopPropagation(),t("close",o)},s=o=>{t("click",o)};return()=>e("span",{class:["qxs-tag",`qxs-tag--${o.type}`,`qxs-tag--${o.size}`,`qxs-tag--${o.effect}`,{"is-round":o.round,"is-closable":o.closable}],style:{display:"inline-flex",alignItems:"center",padding:"large"===o.size?"8px 16px":"small"===o.size?"2px 8px":"4px 12px",fontSize:"large"===o.size?"14px":"small"===o.size?"12px":"13px",borderRadius:o.round?"9999px":"4px",border:"1px solid",lineHeight:"1",whiteSpace:"nowrap",...o.color?"dark"===o.effect?{backgroundColor:o.color,borderColor:o.color,color:"#fff"}:"light"===o.effect?{backgroundColor:`${o.color}1a`,borderColor:`${o.color}4d`,color:o.color}:{backgroundColor:"transparent",borderColor:o.color,color:o.color}:{}},onClick:s},[r.default?.(),o.closable&&e("span",{class:"qxs-tag__close",onClick:a,style:{marginLeft:"6px",cursor:"pointer",fontSize:"12px",fontWeight:"bold"}},"×")])}});export{l as QxsTag,l as default};
2
- //# sourceMappingURL=index.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.mjs","sources":["../../../../../../packages/components/src/ui/tag/index.ts"],"sourcesContent":["import { defineComponent, h, type PropType } from 'vue'\n\nexport type TagType = 'primary' | 'success' | 'warning' | 'danger' | 'info'\nexport type TagSize = 'large' | 'default' | 'small'\nexport type TagEffect = 'dark' | 'light' | 'plain'\n\nexport const QxsTag = defineComponent({\n name: 'QxsTag',\n props: {\n type: { type: String as PropType<TagType>, default: 'primary' },\n size: { type: String as PropType<TagSize>, default: 'default' },\n effect: { type: String as PropType<TagEffect>, default: 'light' },\n closable: { type: Boolean, default: false },\n round: { type: Boolean, default: false },\n color: { type: String, default: '' },\n },\n emits: ['close', 'click'],\n setup(props, { slots, emit }) {\n const handleClose = (e: MouseEvent) => {\n e.stopPropagation()\n emit('close', e)\n }\n\n const handleClick = (e: MouseEvent) => {\n emit('click', e)\n }\n\n const getColorStyles = () => {\n if (!props.color) { return {} }\n\n if (props.effect === 'dark') {\n return {\n backgroundColor: props.color,\n borderColor: props.color,\n color: '#fff',\n }\n }\n else if (props.effect === 'light') {\n return {\n backgroundColor: `${props.color}1a`,\n borderColor: `${props.color}4d`,\n color: props.color,\n }\n }\n else {\n return {\n backgroundColor: 'transparent',\n borderColor: props.color,\n color: props.color,\n }\n }\n }\n\n return () => h('span', {\n class: [\n 'qxs-tag',\n `qxs-tag--${props.type}`,\n `qxs-tag--${props.size}`,\n `qxs-tag--${props.effect}`,\n {\n 'is-round': props.round,\n 'is-closable': props.closable,\n },\n ],\n style: {\n display: 'inline-flex',\n alignItems: 'center',\n padding: props.size === 'large' ? '8px 16px' : props.size === 'small' ? '2px 8px' : '4px 12px',\n fontSize: props.size === 'large' ? '14px' : props.size === 'small' ? '12px' : '13px',\n borderRadius: props.round ? '9999px' : '4px',\n border: '1px solid',\n lineHeight: '1',\n whiteSpace: 'nowrap',\n ...getColorStyles(),\n },\n onClick: handleClick,\n }, [\n slots.default?.(),\n props.closable && h('span', {\n class: 'qxs-tag__close',\n onClick: handleClose,\n style: {\n marginLeft: '6px',\n cursor: 'pointer',\n fontSize: '12px',\n fontWeight: 'bold',\n },\n }, '×'),\n ])\n },\n})\n\nexport default QxsTag\n"],"names":["QxsTag","defineComponent","name","props","type","String","default","size","effect","closable","Boolean","round","color","emits","setup","_ref","slots","emit","handleClose","e","stopPropagation","handleClick","h","class","style","display","alignItems","padding","fontSize","borderRadius","border","lineHeight","whiteSpace","backgroundColor","borderColor","onClick","marginLeft","cursor","fontWeight"],"mappings":"6CAMO,MAAMA,E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NH,EAAMM,UAAYa,EAAE,OAAQ,CAC1BC,MAAO,iBACPY,QAASjB,EACTM,MAAO,CACLY,WAAY,MACZC,OAAQ,UACRT,SAAU,OACVU,WAAY,SAEb,MAEP"}
@@ -1,2 +0,0 @@
1
- import{defineComponent as t,ref as e,h as o,cloneVNode as r}from"vue";function n(){return{type:null,default:void 0}}function s(n){return t({name:n.name,inheritAttrs:!1,props:n.props,setup(t,s){let{attrs:u,slots:p,expose:l}=s;const f=e(null);return n.createExpose&&l(n.createExpose(f)),()=>{const e={...u,ref:f};for(const o of Object.keys(n.props)){const r=t[o];void 0!==r&&(e[o]=r)}return o(n.tag,e,function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const o=[];t.default&&o.push(...t.default());for(const n of e)"default"!==n&&t[n]&&o.push(...t[n]().map(t=>r(t,{slot:n})));return o}(p,n.slotNames))}}})}export{s as createCustomElementBridge,n as createNullableProp};
2
- //# sourceMappingURL=wc-bridge.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"wc-bridge.mjs","sources":["../../../../packages/components/src/wc-bridge.ts"],"sourcesContent":["import { cloneVNode, defineComponent, h, ref, type PropType, type SetupContext, type Slots, type VNode } from 'vue'\n\ntype ExposeFactory = (elRef: ReturnType<typeof ref<HTMLElement | null>>) => Record<string, unknown>\n\nfunction collectSlotChildren(slots: Slots, slotNames: string[] = []) {\n const children: VNode[] = []\n\n if (slots.default) {\n children.push(...slots.default())\n }\n\n for (const slotName of slotNames) {\n if (slotName === 'default' || !slots[slotName]) {\n continue\n }\n children.push(...slots[slotName]!().map(vnode => cloneVNode(vnode, { slot: slotName })))\n }\n\n return children\n}\n\nexport function createNullableProp<T>() {\n return {\n type: null as unknown as PropType<T>,\n default: undefined,\n }\n}\n\nexport function createCustomElementBridge(options: {\n name: string\n tag: string\n props: Record<string, any>\n slotNames?: string[]\n createExpose?: ExposeFactory\n}) {\n return defineComponent({\n name: options.name,\n inheritAttrs: false,\n props: options.props as any,\n setup(props: Record<string, unknown>, { attrs, slots, expose }: SetupContext) {\n const elementRef = ref<HTMLElement | null>(null)\n\n if (options.createExpose) {\n expose(options.createExpose(elementRef))\n }\n\n return () => {\n const bindings: Record<string, unknown> = {\n ...attrs,\n ref: elementRef,\n }\n\n for (const key of Object.keys(options.props)) {\n const value = (props as Record<string, unknown>)[key]\n if (value !== undefined) {\n bindings[key] = value\n }\n }\n\n return h(options.tag, bindings, collectSlotChildren(slots, options.slotNames))\n }\n },\n })\n}\n"],"names":["createNullableProp","type","default","createCustomElementBridge","options","defineComponent","name","inheritAttrs","props","setup","_ref","attrs","slots","expose","elementRef","ref","createExpose","bindings","key","Object","keys","value","h","tag","slotNames","arguments","length","undefined","children","push","slotName","map","vnode","cloneVNode","slot","collectSlotChildren"],"mappings":"sEAqBO,SAASA,IACd,MAAO,CACLC,KAAM,KACNC,aAAS,EAEb,CAEO,SAASC,EAA0BC,GAOxC,OAAOC,EAAgB,CACrBC,KAAMF,EAAQE,KACdC,cAAc,EACdC,MAAOJ,EAAQI,MACfC,KAAAA,CAAMD,EAAAE,GAAwE,IAAxCC,MAAEA,EAAAC,MAAOA,EAAAC,OAAOA,GAAOH,EAC3D,MAAMI,EAAaC,EAAwB,MAM3C,OAJIX,EAAQY,cACVH,EAAOT,EAAQY,aAAaF,IAGvB,KACL,MAAMG,EAAoC,IACrCN,EACHI,IAAKD,GAGP,IAAA,MAAWI,KAAOC,OAAOC,KAAKhB,EAAQI,OAAQ,CAC5C,MAAMa,EAASb,EAAkCU,QACnC,IAAVG,IACFJ,EAASC,GAAOG,EAEpB,CAEA,OAAOC,EAAElB,EAAQmB,IAAKN,EAvD9B,SAA6BL,GAAwC,IAA1BY,EAAAC,UAAAC,OAAA,QAAAC,IAAAF,UAAA,GAAAA,UAAA,GAAsB,GAC/D,MAAMG,EAAoB,GAEtBhB,EAAMV,SACR0B,EAASC,QAAQjB,EAAMV,WAGzB,IAAA,MAAW4B,KAAYN,EACJ,YAAbM,GAA2BlB,EAAMkB,IAGrCF,EAASC,QAAQjB,EAAMkB,KAAaC,IAAIC,GAASC,EAAWD,EAAO,CAAEE,KAAMJ,MAG7E,OAAOF,CACT,CAwCwCO,CAAoBvB,EAAOR,EAAQoB,YAEvE,GAEJ"}
@@ -1,2 +0,0 @@
1
- function n(n,o){return n.install=o=>{for(const t of[n,...Object.values({})])o.component(t.name,t)},n}export{n as withInstall};
2
- //# sourceMappingURL=withInstall.mjs.map