yc-agent-ui 1.2.7 → 1.2.10

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 (311) hide show
  1. package/es/components/chart/src/chart-card.vue.d.ts +21 -21
  2. package/es/components/chart/src/chart-container.vue.d.ts +2 -2
  3. package/es/components/chart/src/metric-card.vue.d.ts +1 -1
  4. package/es/components/data-table/src/data-table.vue.d.ts +10 -10
  5. package/es/components/descriptions/index.d.ts +9 -9
  6. package/es/components/descriptions/src/index.vue.d.ts +3 -3
  7. package/es/components/dialog/index.d.ts +6 -6
  8. package/es/components/dialog/src/index.vue.d.ts +2 -2
  9. package/es/components/dialog-form/index.d.ts +10 -10
  10. package/es/components/dialog-form/src/index.vue.d.ts +6 -6
  11. package/es/components/display-item/index.d.ts +12 -12
  12. package/es/components/display-item/src/index.vue.d.ts +12 -12
  13. package/es/components/drawer-form/index.d.ts +19 -19
  14. package/es/components/drawer-form/src/index.vue.d.ts +9 -9
  15. package/es/components/form/index.d.ts +45 -45
  16. package/es/components/form/src/form-content.vue.d.ts +18 -18
  17. package/es/components/form/src/index.vue.d.ts +21 -21
  18. package/es/components/form-item/index.d.ts +43 -43
  19. package/es/components/form-item/src/index.vue.d.ts +18 -18
  20. package/es/components/input-tag/index.d.ts +3 -3
  21. package/es/components/input-tag/src/index.vue.d.ts +3 -3
  22. package/es/components/page/index.d.ts +1160 -1160
  23. package/es/components/page/src/index.vue.d.ts +391 -391
  24. package/es/components/pagination/index.d.ts +3 -3
  25. package/es/components/pagination/src/index.vue.d.ts +1 -1
  26. package/es/components/radio/index.d.ts +5 -5
  27. package/es/components/radio/src/index.vue.d.ts +5 -5
  28. package/es/components/render/index.d.ts +1 -1
  29. package/es/components/render/src/index.vue.d.ts +1 -1
  30. package/es/components/search/index.d.ts +308 -308
  31. package/es/components/search/src/index.vue.d.ts +106 -106
  32. package/es/components/table/index.d.ts +18 -18
  33. package/es/components/table/src/index.vue.d.ts +2 -2
  34. package/es/components/table/src/table-action-bar.vue.d.ts +2 -2
  35. package/es/components/table/src/table-column.vue.d.ts +24 -24
  36. package/es/components/utils/index.d.ts +3 -3
  37. package/es/components/virtual-table/index.d.ts +13 -13
  38. package/es/components/virtual-table/src/index.vue.d.ts +4 -4
  39. package/es/components/yc-ai-chat/src/bubble.vue.d.ts +2 -2
  40. package/es/components/yc-ai-chat/src/file-card.vue.d.ts +1 -1
  41. package/es/components/yc-ai-chat/src/mobile-frame.vue.d.ts +1 -1
  42. package/es/components/yc-ai-chat/src/select.vue.d.ts +5 -5
  43. package/es/components/yc-ai-chat/src/sender.vue.d.ts +2 -2
  44. package/es/components/yc-ai-chat/src/sidebar.vue.d.ts +3 -3
  45. package/es/components/yc-ai-chat/src/studio.vue.d.ts +1 -1
  46. package/es/components/yc-controls/src/choice-cards.vue.d.ts +2 -2
  47. package/es/components/yc-controls/src/segmented.vue.d.ts +1 -1
  48. package/es/components/yc-coss-table/src/coss-table.vue.d.ts +6 -6
  49. package/es/components/yc-coss-table/src/table-head.vue.d.ts +2 -2
  50. package/es/components/yc-coss-table/src/table.vue.d.ts +1 -1
  51. package/es/components/yc-date-picker/src/date-picker.vue.d.ts +1 -1
  52. package/es/components/yc-display-cards/index.d.ts +221 -5
  53. package/es/components/yc-display-cards/src/card-renderer.vue.d.ts +16 -0
  54. package/es/components/yc-display-cards/src/elements/action-bar.vue.d.ts +12 -0
  55. package/es/components/yc-display-cards/src/elements/card-shell.vue.d.ts +24 -0
  56. package/es/components/yc-display-cards/src/elements/choice-group.vue.d.ts +14 -0
  57. package/es/components/yc-display-cards/src/elements/data-table.vue.d.ts +10 -0
  58. package/es/components/yc-display-cards/src/elements/field-control.vue.d.ts +22 -0
  59. package/es/components/yc-display-cards/src/elements/field-utils.d.ts +16 -0
  60. package/es/components/yc-display-cards/src/elements/form-field.vue.d.ts +18 -0
  61. package/es/components/yc-display-cards/src/elements/inline-alert.vue.d.ts +14 -0
  62. package/es/components/yc-display-cards/src/elements/input.vue.d.ts +20 -0
  63. package/es/components/yc-display-cards/src/elements/kv-list.vue.d.ts +8 -0
  64. package/es/components/yc-display-cards/src/elements/metric-grid.vue.d.ts +7 -0
  65. package/es/components/yc-display-cards/src/elements/status-tag.vue.d.ts +6 -0
  66. package/es/components/yc-display-cards/src/elements/switch.vue.d.ts +10 -0
  67. package/es/components/yc-display-cards/src/elements/upload.vue.d.ts +17 -0
  68. package/es/components/yc-display-cards/src/elements/use-card-form.d.ts +23 -0
  69. package/es/components/yc-display-cards/src/form-card.vue.d.ts +7 -3
  70. package/es/components/yc-display-cards/src/table-card.vue.d.ts +2 -3
  71. package/es/components/yc-display-cards/src/types.d.ts +190 -0
  72. package/es/components/yc-feedback/src/banner.vue.d.ts +1 -1
  73. package/es/components/yc-feedback/src/key-value-list.vue.d.ts +1 -1
  74. package/es/components/yc-gradient-card/src/index.vue.d.ts +2 -2
  75. package/es/components/yc-input/src/input.vue.d.ts +5 -5
  76. package/es/components/yc-input/src/money-input.vue.d.ts +4 -4
  77. package/es/components/yc-input/src/stepper-input.vue.d.ts +3 -3
  78. package/es/components/yc-input/src/textarea.vue.d.ts +3 -3
  79. package/es/components/yc-input-otp/src/index.vue.d.ts +3 -3
  80. package/es/components/yc-pagination/src/index.vue.d.ts +2 -2
  81. package/es/components/yc-plus-page/src/header-filter-cell.vue.d.ts +8 -8
  82. package/es/components/yc-plus-page/src/index.vue.d.ts +1180 -1180
  83. package/es/components/yc-plus-tree/src/index.vue.d.ts +2 -2
  84. package/es/components/yc-property-table/src/asset-table.vue.d.ts +2 -2
  85. package/es/components/yc-property-table/src/bill-table.vue.d.ts +2 -2
  86. package/es/components/yc-property-table/src/device-table.vue.d.ts +2 -2
  87. package/es/components/yc-property-table/src/order-table.vue.d.ts +2 -2
  88. package/es/components/yc-property-table/src/property-table.vue.d.ts +8 -8
  89. package/es/components/yc-questionnaire/src/index.vue.d.ts +1 -1
  90. package/es/components/yc-select-v2/src/index.vue.d.ts +4 -4
  91. package/es/components/yc-status-dialog/src/index.vue.d.ts +1 -1
  92. package/es/components/yc-svg-icon/src/index.vue.d.ts +1 -1
  93. package/es/hooks/usePlusFormReset.d.ts +168 -168
  94. package/es/index.css +29 -16
  95. package/es/index.mjs +3 -1
  96. package/es/packages/components/index.mjs +3 -1
  97. package/es/packages/components/yc-display-cards/capability.mjs +57 -1
  98. package/es/packages/components/yc-display-cards/index.mjs +31 -1
  99. package/es/packages/components/yc-display-cards/src/card-renderer.vue.mjs +6 -0
  100. package/es/packages/components/yc-display-cards/src/card-renderer2.vue.mjs +295 -0
  101. package/es/packages/components/yc-display-cards/src/detail-card.vue.mjs +1 -1
  102. package/es/packages/components/yc-display-cards/src/detail-card2.vue.mjs +28 -94
  103. package/es/packages/components/yc-display-cards/src/elements/action-bar.vue.mjs +6 -0
  104. package/es/packages/components/yc-display-cards/src/elements/action-bar2.vue.mjs +38 -0
  105. package/es/packages/components/yc-display-cards/src/elements/card-shell.vue.mjs +6 -0
  106. package/es/packages/components/yc-display-cards/src/elements/card-shell2.vue.mjs +85 -0
  107. package/es/packages/components/yc-display-cards/src/elements/choice-group.vue.mjs +6 -0
  108. package/es/packages/components/yc-display-cards/src/elements/choice-group2.vue.mjs +57 -0
  109. package/es/packages/components/yc-display-cards/src/elements/data-table.vue.mjs +6 -0
  110. package/es/packages/components/yc-display-cards/src/elements/data-table2.vue.mjs +184 -0
  111. package/es/packages/components/yc-display-cards/src/elements/field-control.vue.mjs +5 -0
  112. package/es/packages/components/yc-display-cards/src/elements/field-control2.vue.mjs +92 -0
  113. package/es/packages/components/yc-display-cards/src/elements/field-utils.mjs +121 -0
  114. package/es/packages/components/yc-display-cards/src/elements/form-field.vue.mjs +6 -0
  115. package/es/packages/components/yc-display-cards/src/elements/form-field2.vue.mjs +68 -0
  116. package/es/packages/components/yc-display-cards/src/elements/inline-alert.vue.mjs +6 -0
  117. package/es/packages/components/yc-display-cards/src/elements/inline-alert2.vue.mjs +29 -0
  118. package/es/packages/components/yc-display-cards/src/elements/input.vue.mjs +6 -0
  119. package/es/packages/components/yc-display-cards/src/elements/input2.vue.mjs +142 -0
  120. package/es/packages/components/yc-display-cards/src/elements/kv-list.vue.mjs +6 -0
  121. package/es/packages/components/yc-display-cards/src/elements/kv-list2.vue.mjs +63 -0
  122. package/es/packages/components/yc-display-cards/src/elements/metric-grid.vue.mjs +6 -0
  123. package/es/packages/components/yc-display-cards/src/elements/metric-grid2.vue.mjs +97 -0
  124. package/es/packages/components/yc-display-cards/src/elements/status-tag.vue.mjs +6 -0
  125. package/es/packages/components/yc-display-cards/src/elements/status-tag2.vue.mjs +25 -0
  126. package/es/packages/components/yc-display-cards/src/elements/switch.vue.mjs +6 -0
  127. package/es/packages/components/yc-display-cards/src/elements/switch2.vue.mjs +35 -0
  128. package/es/packages/components/yc-display-cards/src/elements/upload.vue.mjs +6 -0
  129. package/es/packages/components/yc-display-cards/src/elements/upload2.vue.mjs +196 -0
  130. package/es/packages/components/yc-display-cards/src/elements/use-card-form.mjs +80 -0
  131. package/es/packages/components/yc-display-cards/src/form-card.vue.mjs +1 -1
  132. package/es/packages/components/yc-display-cards/src/form-card2.vue.mjs +171 -783
  133. package/es/packages/components/yc-display-cards/src/metrics-card.vue.mjs +1 -1
  134. package/es/packages/components/yc-display-cards/src/metrics-card2.vue.mjs +19 -114
  135. package/es/packages/components/yc-display-cards/src/table-card.vue.mjs +1 -1
  136. package/es/packages/components/yc-display-cards/src/table-card2.vue.mjs +50 -232
  137. package/es/packages/components/yc-status-dialog/src/index.vue.mjs +1 -1
  138. package/es/version.d.ts +1 -1
  139. package/es/version.mjs +1 -1
  140. package/index.css +20 -7
  141. package/index.js +2235 -1546
  142. package/index.min.css +19 -6
  143. package/index.min.js +37 -37
  144. package/index.min.mjs +36 -36
  145. package/index.mjs +2215 -1545
  146. package/lib/components/chart/src/chart-card.vue.d.ts +21 -21
  147. package/lib/components/chart/src/chart-container.vue.d.ts +2 -2
  148. package/lib/components/chart/src/metric-card.vue.d.ts +1 -1
  149. package/lib/components/data-table/src/data-table.vue.d.ts +10 -10
  150. package/lib/components/descriptions/index.d.ts +9 -9
  151. package/lib/components/descriptions/src/index.vue.d.ts +3 -3
  152. package/lib/components/dialog/index.d.ts +6 -6
  153. package/lib/components/dialog/src/index.vue.d.ts +2 -2
  154. package/lib/components/dialog-form/index.d.ts +10 -10
  155. package/lib/components/dialog-form/src/index.vue.d.ts +6 -6
  156. package/lib/components/display-item/index.d.ts +12 -12
  157. package/lib/components/display-item/src/index.vue.d.ts +12 -12
  158. package/lib/components/drawer-form/index.d.ts +19 -19
  159. package/lib/components/drawer-form/src/index.vue.d.ts +9 -9
  160. package/lib/components/form/index.d.ts +45 -45
  161. package/lib/components/form/src/form-content.vue.d.ts +18 -18
  162. package/lib/components/form/src/index.vue.d.ts +21 -21
  163. package/lib/components/form-item/index.d.ts +43 -43
  164. package/lib/components/form-item/src/index.vue.d.ts +18 -18
  165. package/lib/components/input-tag/index.d.ts +3 -3
  166. package/lib/components/input-tag/src/index.vue.d.ts +3 -3
  167. package/lib/components/page/index.d.ts +1160 -1160
  168. package/lib/components/page/src/index.vue.d.ts +391 -391
  169. package/lib/components/pagination/index.d.ts +3 -3
  170. package/lib/components/pagination/src/index.vue.d.ts +1 -1
  171. package/lib/components/radio/index.d.ts +5 -5
  172. package/lib/components/radio/src/index.vue.d.ts +5 -5
  173. package/lib/components/render/index.d.ts +1 -1
  174. package/lib/components/render/src/index.vue.d.ts +1 -1
  175. package/lib/components/search/index.d.ts +308 -308
  176. package/lib/components/search/src/index.vue.d.ts +106 -106
  177. package/lib/components/table/index.d.ts +18 -18
  178. package/lib/components/table/src/index.vue.d.ts +2 -2
  179. package/lib/components/table/src/table-action-bar.vue.d.ts +2 -2
  180. package/lib/components/table/src/table-column.vue.d.ts +24 -24
  181. package/lib/components/utils/index.d.ts +3 -3
  182. package/lib/components/virtual-table/index.d.ts +13 -13
  183. package/lib/components/virtual-table/src/index.vue.d.ts +4 -4
  184. package/lib/components/yc-ai-chat/src/bubble.vue.d.ts +2 -2
  185. package/lib/components/yc-ai-chat/src/file-card.vue.d.ts +1 -1
  186. package/lib/components/yc-ai-chat/src/mobile-frame.vue.d.ts +1 -1
  187. package/lib/components/yc-ai-chat/src/select.vue.d.ts +5 -5
  188. package/lib/components/yc-ai-chat/src/sender.vue.d.ts +2 -2
  189. package/lib/components/yc-ai-chat/src/sidebar.vue.d.ts +3 -3
  190. package/lib/components/yc-ai-chat/src/studio.vue.d.ts +1 -1
  191. package/lib/components/yc-controls/src/choice-cards.vue.d.ts +2 -2
  192. package/lib/components/yc-controls/src/segmented.vue.d.ts +1 -1
  193. package/lib/components/yc-coss-table/src/coss-table.vue.d.ts +6 -6
  194. package/lib/components/yc-coss-table/src/table-head.vue.d.ts +2 -2
  195. package/lib/components/yc-coss-table/src/table.vue.d.ts +1 -1
  196. package/lib/components/yc-date-picker/src/date-picker.vue.d.ts +1 -1
  197. package/lib/components/yc-display-cards/index.d.ts +221 -5
  198. package/lib/components/yc-display-cards/src/card-renderer.vue.d.ts +16 -0
  199. package/lib/components/yc-display-cards/src/elements/action-bar.vue.d.ts +12 -0
  200. package/lib/components/yc-display-cards/src/elements/card-shell.vue.d.ts +24 -0
  201. package/lib/components/yc-display-cards/src/elements/choice-group.vue.d.ts +14 -0
  202. package/lib/components/yc-display-cards/src/elements/data-table.vue.d.ts +10 -0
  203. package/lib/components/yc-display-cards/src/elements/field-control.vue.d.ts +22 -0
  204. package/lib/components/yc-display-cards/src/elements/field-utils.d.ts +16 -0
  205. package/lib/components/yc-display-cards/src/elements/form-field.vue.d.ts +18 -0
  206. package/lib/components/yc-display-cards/src/elements/inline-alert.vue.d.ts +14 -0
  207. package/lib/components/yc-display-cards/src/elements/input.vue.d.ts +20 -0
  208. package/lib/components/yc-display-cards/src/elements/kv-list.vue.d.ts +8 -0
  209. package/lib/components/yc-display-cards/src/elements/metric-grid.vue.d.ts +7 -0
  210. package/lib/components/yc-display-cards/src/elements/status-tag.vue.d.ts +6 -0
  211. package/lib/components/yc-display-cards/src/elements/switch.vue.d.ts +10 -0
  212. package/lib/components/yc-display-cards/src/elements/upload.vue.d.ts +17 -0
  213. package/lib/components/yc-display-cards/src/elements/use-card-form.d.ts +23 -0
  214. package/lib/components/yc-display-cards/src/form-card.vue.d.ts +7 -3
  215. package/lib/components/yc-display-cards/src/table-card.vue.d.ts +2 -3
  216. package/lib/components/yc-display-cards/src/types.d.ts +190 -0
  217. package/lib/components/yc-feedback/src/banner.vue.d.ts +1 -1
  218. package/lib/components/yc-feedback/src/key-value-list.vue.d.ts +1 -1
  219. package/lib/components/yc-gradient-card/src/index.vue.d.ts +2 -2
  220. package/lib/components/yc-input/src/input.vue.d.ts +5 -5
  221. package/lib/components/yc-input/src/money-input.vue.d.ts +4 -4
  222. package/lib/components/yc-input/src/stepper-input.vue.d.ts +3 -3
  223. package/lib/components/yc-input/src/textarea.vue.d.ts +3 -3
  224. package/lib/components/yc-input-otp/src/index.vue.d.ts +3 -3
  225. package/lib/components/yc-pagination/src/index.vue.d.ts +2 -2
  226. package/lib/components/yc-plus-page/src/header-filter-cell.vue.d.ts +8 -8
  227. package/lib/components/yc-plus-page/src/index.vue.d.ts +1180 -1180
  228. package/lib/components/yc-plus-tree/src/index.vue.d.ts +2 -2
  229. package/lib/components/yc-property-table/src/asset-table.vue.d.ts +2 -2
  230. package/lib/components/yc-property-table/src/bill-table.vue.d.ts +2 -2
  231. package/lib/components/yc-property-table/src/device-table.vue.d.ts +2 -2
  232. package/lib/components/yc-property-table/src/order-table.vue.d.ts +2 -2
  233. package/lib/components/yc-property-table/src/property-table.vue.d.ts +8 -8
  234. package/lib/components/yc-questionnaire/src/index.vue.d.ts +1 -1
  235. package/lib/components/yc-select-v2/src/index.vue.d.ts +4 -4
  236. package/lib/components/yc-status-dialog/src/index.vue.d.ts +1 -1
  237. package/lib/components/yc-svg-icon/src/index.vue.d.ts +1 -1
  238. package/lib/hooks/usePlusFormReset.d.ts +168 -168
  239. package/lib/index.css +28 -15
  240. package/lib/index.js +28 -7
  241. package/lib/packages/components/index.js +28 -7
  242. package/lib/packages/components/yc-display-cards/capability.js +56 -0
  243. package/lib/packages/components/yc-display-cards/index.js +49 -0
  244. package/lib/packages/components/yc-display-cards/src/card-renderer.vue.js +10 -0
  245. package/lib/packages/components/yc-display-cards/src/card-renderer2.vue.js +299 -0
  246. package/lib/packages/components/yc-display-cards/src/detail-card.vue.js +1 -1
  247. package/lib/packages/components/yc-display-cards/src/detail-card2.vue.js +27 -93
  248. package/lib/packages/components/yc-display-cards/src/elements/action-bar.vue.js +10 -0
  249. package/lib/packages/components/yc-display-cards/src/elements/action-bar2.vue.js +42 -0
  250. package/lib/packages/components/yc-display-cards/src/elements/card-shell.vue.js +10 -0
  251. package/lib/packages/components/yc-display-cards/src/elements/card-shell2.vue.js +89 -0
  252. package/lib/packages/components/yc-display-cards/src/elements/choice-group.vue.js +10 -0
  253. package/lib/packages/components/yc-display-cards/src/elements/choice-group2.vue.js +61 -0
  254. package/lib/packages/components/yc-display-cards/src/elements/data-table.vue.js +10 -0
  255. package/lib/packages/components/yc-display-cards/src/elements/data-table2.vue.js +188 -0
  256. package/lib/packages/components/yc-display-cards/src/elements/field-control.vue.js +9 -0
  257. package/lib/packages/components/yc-display-cards/src/elements/field-control2.vue.js +96 -0
  258. package/lib/packages/components/yc-display-cards/src/elements/field-utils.js +134 -0
  259. package/lib/packages/components/yc-display-cards/src/elements/form-field.vue.js +10 -0
  260. package/lib/packages/components/yc-display-cards/src/elements/form-field2.vue.js +72 -0
  261. package/lib/packages/components/yc-display-cards/src/elements/inline-alert.vue.js +10 -0
  262. package/lib/packages/components/yc-display-cards/src/elements/inline-alert2.vue.js +33 -0
  263. package/lib/packages/components/yc-display-cards/src/elements/input.vue.js +10 -0
  264. package/lib/packages/components/yc-display-cards/src/elements/input2.vue.js +146 -0
  265. package/lib/packages/components/yc-display-cards/src/elements/kv-list.vue.js +10 -0
  266. package/lib/packages/components/yc-display-cards/src/elements/kv-list2.vue.js +67 -0
  267. package/lib/packages/components/yc-display-cards/src/elements/metric-grid.vue.js +10 -0
  268. package/lib/packages/components/yc-display-cards/src/elements/metric-grid2.vue.js +101 -0
  269. package/lib/packages/components/yc-display-cards/src/elements/status-tag.vue.js +10 -0
  270. package/lib/packages/components/yc-display-cards/src/elements/status-tag2.vue.js +29 -0
  271. package/lib/packages/components/yc-display-cards/src/elements/switch.vue.js +10 -0
  272. package/lib/packages/components/yc-display-cards/src/elements/switch2.vue.js +39 -0
  273. package/lib/packages/components/yc-display-cards/src/elements/upload.vue.js +10 -0
  274. package/lib/packages/components/yc-display-cards/src/elements/upload2.vue.js +200 -0
  275. package/lib/packages/components/yc-display-cards/src/elements/use-card-form.js +82 -0
  276. package/lib/packages/components/yc-display-cards/src/form-card.vue.js +1 -1
  277. package/lib/packages/components/yc-display-cards/src/form-card2.vue.js +170 -782
  278. package/lib/packages/components/yc-display-cards/src/metrics-card.vue.js +1 -1
  279. package/lib/packages/components/yc-display-cards/src/metrics-card2.vue.js +18 -113
  280. package/lib/packages/components/yc-display-cards/src/table-card.vue.js +1 -1
  281. package/lib/packages/components/yc-display-cards/src/table-card2.vue.js +49 -231
  282. package/lib/packages/components/yc-status-dialog/src/index.vue.js +1 -1
  283. package/lib/version.d.ts +1 -1
  284. package/lib/version.js +1 -1
  285. package/locale/en.js +1 -1
  286. package/locale/en.min.js +1 -1
  287. package/locale/en.min.mjs +1 -1
  288. package/locale/en.mjs +1 -1
  289. package/locale/ja.js +1 -1
  290. package/locale/ja.min.js +1 -1
  291. package/locale/ja.min.mjs +1 -1
  292. package/locale/ja.mjs +1 -1
  293. package/locale/ko.js +1 -1
  294. package/locale/ko.min.js +1 -1
  295. package/locale/ko.min.mjs +1 -1
  296. package/locale/ko.mjs +1 -1
  297. package/locale/zh-cn.js +1 -1
  298. package/locale/zh-cn.min.js +1 -1
  299. package/locale/zh-cn.min.mjs +1 -1
  300. package/locale/zh-cn.mjs +1 -1
  301. package/locale/zh-tw.js +1 -1
  302. package/locale/zh-tw.min.js +1 -1
  303. package/locale/zh-tw.min.mjs +1 -1
  304. package/locale/zh-tw.mjs +1 -1
  305. package/package.json +1 -1
  306. package/theme-chalk/index.css +20 -7
  307. package/theme-chalk/plus-dialog.css +1 -1
  308. package/theme-chalk/plus-yc-status-dialog.css +1 -1
  309. package/theme-chalk/src/dialog.scss +0 -6
  310. package/theme-chalk/src/index.scss +1 -2
  311. package/theme-chalk/src/yc-status-dialog.scss +2 -2
@@ -0,0 +1,184 @@
1
+ import { defineComponent, ref, computed, watch, openBlock, createElementBlock, normalizeClass, withDirectives, createElementVNode, vModelText, createCommentVNode, Fragment, renderList, normalizeStyle, toDisplayString } from 'vue';
2
+
3
+ const _hoisted_1 = {
4
+ key: 0,
5
+ class: "yc-data-table__search"
6
+ };
7
+ const _hoisted_2 = { class: "yc-data-table__scroll" };
8
+ const _hoisted_3 = {
9
+ key: 0,
10
+ class: "yc-data-table__table"
11
+ };
12
+ const _hoisted_4 = {
13
+ key: 1,
14
+ class: "yc-data-table__empty"
15
+ };
16
+ const _hoisted_5 = {
17
+ key: 1,
18
+ class: "yc-data-table__pager"
19
+ };
20
+ const _hoisted_6 = ["disabled"];
21
+ const _hoisted_7 = { class: "yc-data-table__page" };
22
+ const _hoisted_8 = ["disabled"];
23
+ var _sfc_main = /* @__PURE__ */ defineComponent({
24
+ ...{ name: "YcCardTable" },
25
+ __name: "data-table",
26
+ props: {
27
+ columns: { default: () => [] },
28
+ rows: { default: () => [] },
29
+ maxRows: { default: 10 },
30
+ bordered: { type: Boolean, default: false }
31
+ },
32
+ setup(__props) {
33
+ const props = __props;
34
+ const query = ref("");
35
+ const page = ref(1);
36
+ const normalizedColumns = computed(() => {
37
+ if (props.columns.length > 0) return props.columns;
38
+ const first = props.rows[0];
39
+ if (!first || typeof first !== "object") return [];
40
+ return Object.keys(first).map((key) => ({ key, label: key }));
41
+ });
42
+ const filteredRows = computed(() => {
43
+ const keyword = query.value.trim().toLowerCase();
44
+ if (!keyword) return props.rows;
45
+ return props.rows.filter(
46
+ (row) => normalizedColumns.value.some((col) => formatCell(row, col).toLowerCase().includes(keyword))
47
+ );
48
+ });
49
+ const pageCount = computed(
50
+ () => Math.max(1, Math.ceil(filteredRows.value.length / props.maxRows))
51
+ );
52
+ const showControls = computed(() => props.rows.length > props.maxRows);
53
+ const visibleRows = computed(() => {
54
+ if (!showControls.value) return filteredRows.value;
55
+ const start = (page.value - 1) * props.maxRows;
56
+ return filteredRows.value.slice(start, start + props.maxRows);
57
+ });
58
+ watch(query, () => {
59
+ page.value = 1;
60
+ });
61
+ watch(pageCount, (count) => {
62
+ if (page.value > count) page.value = count;
63
+ });
64
+ function stepPage(delta) {
65
+ page.value = Math.min(pageCount.value, Math.max(1, page.value + delta));
66
+ }
67
+ function formatCell(row, col) {
68
+ const raw = row == null ? void 0 : row[col.key];
69
+ if (raw === void 0 || raw === null || raw === "") return "\u2014";
70
+ const text = typeof raw === "object" ? JSON.stringify(raw) : String(raw);
71
+ return col.unit ? `${text} ${col.unit}` : text;
72
+ }
73
+ return (_ctx, _cache) => {
74
+ return openBlock(), createElementBlock(
75
+ "div",
76
+ {
77
+ class: normalizeClass(["yc-data-table", { "is-bordered": __props.bordered }])
78
+ },
79
+ [
80
+ showControls.value ? (openBlock(), createElementBlock("div", _hoisted_1, [
81
+ withDirectives(createElementVNode(
82
+ "input",
83
+ {
84
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => query.value = $event),
85
+ type: "search",
86
+ class: "yc-data-table__search-input",
87
+ placeholder: "\u641C\u7D22\u8868\u683C",
88
+ "aria-label": "\u641C\u7D22\u8868\u683C"
89
+ },
90
+ null,
91
+ 512
92
+ /* NEED_PATCH */
93
+ ), [
94
+ [vModelText, query.value]
95
+ ])
96
+ ])) : createCommentVNode("v-if", true),
97
+ createElementVNode("div", _hoisted_2, [
98
+ normalizedColumns.value.length && __props.rows.length ? (openBlock(), createElementBlock("table", _hoisted_3, [
99
+ createElementVNode("thead", null, [
100
+ createElementVNode("tr", null, [
101
+ (openBlock(true), createElementBlock(
102
+ Fragment,
103
+ null,
104
+ renderList(normalizedColumns.value, (col) => {
105
+ var _a;
106
+ return openBlock(), createElementBlock(
107
+ "th",
108
+ {
109
+ key: col.key,
110
+ style: normalizeStyle({ textAlign: (_a = col.align) != null ? _a : "left" })
111
+ },
112
+ toDisplayString(col.label),
113
+ 5
114
+ /* TEXT, STYLE */
115
+ );
116
+ }),
117
+ 128
118
+ /* KEYED_FRAGMENT */
119
+ ))
120
+ ])
121
+ ]),
122
+ createElementVNode("tbody", null, [
123
+ (openBlock(true), createElementBlock(
124
+ Fragment,
125
+ null,
126
+ renderList(visibleRows.value, (row, idx) => {
127
+ return openBlock(), createElementBlock("tr", { key: idx }, [
128
+ (openBlock(true), createElementBlock(
129
+ Fragment,
130
+ null,
131
+ renderList(normalizedColumns.value, (col) => {
132
+ var _a;
133
+ return openBlock(), createElementBlock(
134
+ "td",
135
+ {
136
+ key: col.key,
137
+ style: normalizeStyle({ textAlign: (_a = col.align) != null ? _a : "left" })
138
+ },
139
+ toDisplayString(formatCell(row, col)),
140
+ 5
141
+ /* TEXT, STYLE */
142
+ );
143
+ }),
144
+ 128
145
+ /* KEYED_FRAGMENT */
146
+ ))
147
+ ]);
148
+ }),
149
+ 128
150
+ /* KEYED_FRAGMENT */
151
+ ))
152
+ ])
153
+ ])) : (openBlock(), createElementBlock("div", _hoisted_4, "\u6682\u65E0\u53EF\u5C55\u793A\u7684\u8868\u683C\u6570\u636E"))
154
+ ]),
155
+ showControls.value ? (openBlock(), createElementBlock("div", _hoisted_5, [
156
+ createElementVNode("button", {
157
+ type: "button",
158
+ class: "yc-data-table__page-btn",
159
+ disabled: page.value <= 1,
160
+ onClick: _cache[1] || (_cache[1] = ($event) => stepPage(-1))
161
+ }, " \u4E0A\u4E00\u9875 ", 8, _hoisted_6),
162
+ createElementVNode(
163
+ "span",
164
+ _hoisted_7,
165
+ toDisplayString(page.value) + " / " + toDisplayString(pageCount.value) + " \xB7 " + toDisplayString(filteredRows.value.length) + " \u6761 ",
166
+ 1
167
+ /* TEXT */
168
+ ),
169
+ createElementVNode("button", {
170
+ type: "button",
171
+ class: "yc-data-table__page-btn",
172
+ disabled: page.value >= pageCount.value,
173
+ onClick: _cache[2] || (_cache[2] = ($event) => stepPage(1))
174
+ }, " \u4E0B\u4E00\u9875 ", 8, _hoisted_8)
175
+ ])) : createCommentVNode("v-if", true)
176
+ ],
177
+ 2
178
+ /* CLASS */
179
+ );
180
+ };
181
+ }
182
+ });
183
+
184
+ export { _sfc_main as default };
@@ -0,0 +1,5 @@
1
+ import _sfc_main from './field-control2.vue.mjs';
2
+
3
+
4
+
5
+ export { _sfc_main as default };
@@ -0,0 +1,92 @@
1
+ import { defineComponent, computed, openBlock, createBlock, withCtx } from 'vue';
2
+ import ChoiceGroup from './choice-group.vue.mjs';
3
+ import { resolveFieldKind, normalizeOptions } from './field-utils.mjs';
4
+ import FormField from './form-field.vue.mjs';
5
+ import Input from './input.vue.mjs';
6
+ import Switch from './switch.vue.mjs';
7
+ import Upload from './upload.vue.mjs';
8
+
9
+ var _sfc_main = /* @__PURE__ */ defineComponent({
10
+ ...{ name: "YcCardFieldControl" },
11
+ __name: "field-control",
12
+ props: {
13
+ field: {},
14
+ modelValue: { default: void 0 },
15
+ options: { default: void 0 },
16
+ loadingOptions: { type: Boolean, default: false },
17
+ disabled: { type: Boolean, default: false },
18
+ error: { default: "" },
19
+ hint: { default: "" },
20
+ uploadFile: { type: Function, default: void 0 }
21
+ },
22
+ emits: ["update:modelValue", "blur", "focus", "upload-error"],
23
+ setup(__props, { emit: __emit }) {
24
+ const props = __props;
25
+ const emit = __emit;
26
+ const kind = computed(() => resolveFieldKind(props.field));
27
+ const label = computed(() => props.field.label || props.field.name);
28
+ const resolvedOptions = computed(() => {
29
+ var _a;
30
+ return (_a = props.options) != null ? _a : normalizeOptions(props.field);
31
+ });
32
+ const placeholder = computed(
33
+ () => props.field.placeholder || (kind.value === "select" ? `\u8BF7\u9009\u62E9${label.value}` : `\u8BF7\u8F93\u5165${label.value}`)
34
+ );
35
+ const inputKind = computed(() => {
36
+ if (kind.value === "number") return props.field.type === "integer" ? "integer" : "number";
37
+ return kind.value;
38
+ });
39
+ function update(value) {
40
+ emit("update:modelValue", value);
41
+ }
42
+ return (_ctx, _cache) => {
43
+ return openBlock(), createBlock(FormField, {
44
+ label: label.value,
45
+ required: __props.field.required,
46
+ hint: __props.hint,
47
+ error: __props.error,
48
+ "full-row": kind.value === "textarea" || kind.value === "image" || kind.value === "file"
49
+ }, {
50
+ default: withCtx(() => [
51
+ kind.value === "radio" || kind.value === "checkbox" ? (openBlock(), createBlock(ChoiceGroup, {
52
+ key: 0,
53
+ "model-value": __props.modelValue,
54
+ options: resolvedOptions.value,
55
+ multiple: kind.value === "checkbox",
56
+ disabled: __props.disabled,
57
+ "onUpdate:modelValue": update
58
+ }, null, 8, ["model-value", "options", "multiple", "disabled"])) : kind.value === "switch" ? (openBlock(), createBlock(Switch, {
59
+ key: 1,
60
+ "model-value": Boolean(__props.modelValue),
61
+ disabled: __props.disabled,
62
+ "onUpdate:modelValue": update
63
+ }, null, 8, ["model-value", "disabled"])) : kind.value === "image" || kind.value === "file" ? (openBlock(), createBlock(Upload, {
64
+ key: 2,
65
+ "model-value": Array.isArray(__props.modelValue) ? __props.modelValue : [],
66
+ accept: kind.value,
67
+ disabled: __props.disabled,
68
+ "upload-file": __props.uploadFile,
69
+ "onUpdate:modelValue": update,
70
+ onError: _cache[0] || (_cache[0] = ($event) => emit("upload-error", $event))
71
+ }, null, 8, ["model-value", "accept", "disabled", "upload-file"])) : (openBlock(), createBlock(Input, {
72
+ key: 3,
73
+ "model-value": __props.modelValue,
74
+ kind: inputKind.value,
75
+ placeholder: placeholder.value,
76
+ options: resolvedOptions.value,
77
+ loading: __props.loadingOptions,
78
+ disabled: __props.disabled,
79
+ invalid: Boolean(__props.error),
80
+ "onUpdate:modelValue": update,
81
+ onFocus: _cache[1] || (_cache[1] = ($event) => emit("focus")),
82
+ onBlur: _cache[2] || (_cache[2] = ($event) => emit("blur"))
83
+ }, null, 8, ["model-value", "kind", "placeholder", "options", "loading", "disabled", "invalid"]))
84
+ ]),
85
+ _: 1
86
+ /* STABLE */
87
+ }, 8, ["label", "required", "hint", "error", "full-row"]);
88
+ };
89
+ }
90
+ });
91
+
92
+ export { _sfc_main as default };
@@ -0,0 +1,121 @@
1
+ function isPlainObject(value) {
2
+ return Boolean(value) && typeof value === "object" && !Array.isArray(value);
3
+ }
4
+ function isBlankValue(value) {
5
+ if (Array.isArray(value)) return value.length === 0;
6
+ return value === void 0 || value === null || String(value).trim() === "";
7
+ }
8
+ function toOptionValue(raw) {
9
+ return typeof raw === "string" || typeof raw === "number" || typeof raw === "boolean" ? raw : String(raw);
10
+ }
11
+ function normalizeOptions(field) {
12
+ var _a;
13
+ const options = [];
14
+ if (Array.isArray(field.options)) {
15
+ for (const item of field.options) {
16
+ if (typeof item === "string" || typeof item === "number") {
17
+ options.push({ label: String(item), value: item });
18
+ } else if (isPlainObject(item) && item.value !== void 0 && item.value !== null) {
19
+ options.push({ label: String((_a = item.label) != null ? _a : item.value), value: toOptionValue(item.value) });
20
+ }
21
+ }
22
+ }
23
+ if (!options.length && Array.isArray(field.enum)) {
24
+ for (const item of field.enum) {
25
+ options.push({ label: String(item), value: toOptionValue(item) });
26
+ }
27
+ }
28
+ return options;
29
+ }
30
+ function extractOptions(data, labelKey, valueKey) {
31
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
32
+ const rows = Array.isArray(data) ? data : isPlainObject(data) ? (_a = extractRows(data)) != null ? _a : [] : [];
33
+ const options = [];
34
+ for (const row of rows) {
35
+ if (typeof row === "string" || typeof row === "number") {
36
+ options.push({ label: String(row), value: row });
37
+ continue;
38
+ }
39
+ if (!isPlainObject(row)) continue;
40
+ const rawValue = (_f = (_e = (_d = (_c = (_b = valueKey ? row[valueKey] : void 0) != null ? _b : row.id) != null ? _c : row.value) != null ? _d : row.code) != null ? _e : row.key) != null ? _f : row.name;
41
+ if (rawValue === void 0 || rawValue === null) continue;
42
+ const rawLabel = (_j = (_i = (_h = (_g = labelKey ? row[labelKey] : void 0) != null ? _g : row.name) != null ? _h : row.label) != null ? _i : row.title) != null ? _j : rawValue;
43
+ options.push({ label: String(rawLabel), value: toOptionValue(rawValue) });
44
+ }
45
+ return options;
46
+ }
47
+ function extractRows(obj) {
48
+ for (const key of ["data", "rows", "items", "list", "records"]) {
49
+ if (Array.isArray(obj[key])) return obj[key];
50
+ }
51
+ return null;
52
+ }
53
+ function resolveFieldKind(field) {
54
+ var _a, _b;
55
+ const widget = field.widget;
56
+ if (widget === "radio" || widget === "checkbox") return widget;
57
+ if (widget === "image" || widget === "file") return widget;
58
+ if (widget === "date" || widget === "datetime") return widget;
59
+ if (widget === "phone" || widget === "tel") return "phone";
60
+ if (widget === "email") return "email";
61
+ if (widget === "textarea") return "textarea";
62
+ if (widget === "switch" || field.type === "boolean") return "switch";
63
+ if (widget === "select" || field.options_operation || ((_a = field.options) == null ? void 0 : _a.length) || ((_b = field.enum) == null ? void 0 : _b.length)) {
64
+ return "select";
65
+ }
66
+ if (widget === "number" || field.type === "number" || field.type === "integer") return "number";
67
+ return "text";
68
+ }
69
+ function isUploadField(field) {
70
+ const kind = resolveFieldKind(field);
71
+ return kind === "image" || kind === "file";
72
+ }
73
+ function validateFieldValue(field, value) {
74
+ const label = field.label || field.name;
75
+ if (isBlankValue(value)) {
76
+ if (!field.required) return "";
77
+ return isUploadField(field) ? `\u8BF7\u5148\u4E0A\u4F20\u300C${label}\u300D` : `\u8BF7\u5148\u586B\u5199\u300C${label}\u300D`;
78
+ }
79
+ const kind = resolveFieldKind(field);
80
+ const text = String(value).trim();
81
+ if (kind === "phone") {
82
+ const normalized = text.replace(/[\s-]/g, "");
83
+ if (!/^1[3-9]\d{9}$/.test(normalized) && !/^0\d{2,3}\d{7,8}$/.test(normalized)) {
84
+ return `\u8BF7\u8F93\u5165\u6B63\u786E\u7684\u300C${label}\u300D\uFF0811\u4F4D\u624B\u673A\u53F7\u6216\u56FA\u8BDD\uFF09`;
85
+ }
86
+ }
87
+ if (kind === "email" && !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(text)) {
88
+ return `\u8BF7\u8F93\u5165\u6B63\u786E\u7684\u300C${label}\u300D\u90AE\u7BB1\u683C\u5F0F`;
89
+ }
90
+ return "";
91
+ }
92
+ function attachmentsOf(value) {
93
+ return Array.isArray(value) ? value.filter((item) => isPlainObject(item) && "fileName" in item) : [];
94
+ }
95
+ function displayFieldValue(field, value, options = normalizeOptions(field)) {
96
+ if (isUploadField(field)) {
97
+ const files = attachmentsOf(value);
98
+ return files.length ? `\u5DF2\u4E0A\u4F20 ${files.length} \u4E2A\u9644\u4EF6\uFF08${files.map((file) => file.fileName).join("\u3001")}\uFF09` : "";
99
+ }
100
+ const labelOf = (raw) => {
101
+ const option = options.find((opt) => opt.value === raw);
102
+ return !option || option.label === String(raw) ? String(raw) : `${option.label}\uFF08${String(raw)}\uFF09`;
103
+ };
104
+ if (Array.isArray(value)) return value.map(labelOf).join("\u3001");
105
+ if (typeof value === "boolean") return value ? "\u662F" : "\u5426";
106
+ return labelOf(value);
107
+ }
108
+ function buildReplyText(prefix, fields, values, optionsOf = normalizeOptions) {
109
+ const lines = [];
110
+ for (const field of fields) {
111
+ const value = values[field.name];
112
+ if (isBlankValue(value)) continue;
113
+ lines.push(`${field.label || field.name}\uFF1A${displayFieldValue(field, value, optionsOf(field))}`);
114
+ }
115
+ return [`${prefix}\uFF1A`, ...lines].join("\n");
116
+ }
117
+ function collectAttachments(fields, values) {
118
+ return fields.filter(isUploadField).flatMap((field) => attachmentsOf(values[field.name]));
119
+ }
120
+
121
+ export { attachmentsOf, buildReplyText, collectAttachments, displayFieldValue, extractOptions, extractRows, isBlankValue, isPlainObject, isUploadField, normalizeOptions, resolveFieldKind, validateFieldValue };
@@ -0,0 +1,6 @@
1
+ import _sfc_main from './form-field2.vue.mjs';
2
+ import _export_sfc from '../../../../../_virtual/_plugin-vue_export-helper.mjs';
3
+
4
+ var FormField = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-354eb9c0"]]);
5
+
6
+ export { FormField as default };
@@ -0,0 +1,68 @@
1
+ import { defineComponent, openBlock, createElementBlock, normalizeClass, createCommentVNode, createTextVNode, toDisplayString, renderSlot } from 'vue';
2
+
3
+ const _hoisted_1 = {
4
+ key: 0,
5
+ class: "yc-form-field__label"
6
+ };
7
+ const _hoisted_2 = {
8
+ key: 0,
9
+ class: "yc-form-field__required"
10
+ };
11
+ const _hoisted_3 = {
12
+ key: 1,
13
+ class: "yc-form-field__hint"
14
+ };
15
+ const _hoisted_4 = {
16
+ key: 1,
17
+ class: "yc-form-field__error"
18
+ };
19
+ var _sfc_main = /* @__PURE__ */ defineComponent({
20
+ ...{ name: "YcCardField" },
21
+ __name: "form-field",
22
+ props: {
23
+ label: { default: "" },
24
+ required: { type: Boolean, default: false },
25
+ hint: { default: "" },
26
+ error: { default: "" },
27
+ fullRow: { type: Boolean, default: false }
28
+ },
29
+ setup(__props) {
30
+ return (_ctx, _cache) => {
31
+ return openBlock(), createElementBlock(
32
+ "div",
33
+ {
34
+ class: normalizeClass(["yc-form-field", { "is-full-row": __props.fullRow }])
35
+ },
36
+ [
37
+ __props.label ? (openBlock(), createElementBlock("label", _hoisted_1, [
38
+ __props.required ? (openBlock(), createElementBlock("span", _hoisted_2, "*")) : createCommentVNode("v-if", true),
39
+ createTextVNode(
40
+ " " + toDisplayString(__props.label) + " ",
41
+ 1
42
+ /* TEXT */
43
+ ),
44
+ __props.hint ? (openBlock(), createElementBlock(
45
+ "span",
46
+ _hoisted_3,
47
+ toDisplayString(__props.hint),
48
+ 1
49
+ /* TEXT */
50
+ )) : createCommentVNode("v-if", true)
51
+ ])) : createCommentVNode("v-if", true),
52
+ renderSlot(_ctx.$slots, "default", {}, void 0, true),
53
+ __props.error ? (openBlock(), createElementBlock(
54
+ "span",
55
+ _hoisted_4,
56
+ toDisplayString(__props.error),
57
+ 1
58
+ /* TEXT */
59
+ )) : createCommentVNode("v-if", true)
60
+ ],
61
+ 2
62
+ /* CLASS */
63
+ );
64
+ };
65
+ }
66
+ });
67
+
68
+ export { _sfc_main as default };
@@ -0,0 +1,6 @@
1
+ import _sfc_main from './inline-alert2.vue.mjs';
2
+ import _export_sfc from '../../../../../_virtual/_plugin-vue_export-helper.mjs';
3
+
4
+ var InlineAlert = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-2c7c2c97"]]);
5
+
6
+ export { InlineAlert as default };
@@ -0,0 +1,29 @@
1
+ import { defineComponent, openBlock, createElementBlock, normalizeClass, renderSlot, createTextVNode, toDisplayString } from 'vue';
2
+
3
+ const _hoisted_1 = ["role"];
4
+ var _sfc_main = /* @__PURE__ */ defineComponent({
5
+ ...{ name: "YcCardAlert" },
6
+ __name: "inline-alert",
7
+ props: {
8
+ text: {},
9
+ tone: { default: "info" }
10
+ },
11
+ setup(__props) {
12
+ return (_ctx, _cache) => {
13
+ return openBlock(), createElementBlock("div", {
14
+ class: normalizeClass(["yc-inline-alert", `is-${__props.tone}`]),
15
+ role: __props.tone === "error" ? "alert" : "status"
16
+ }, [
17
+ renderSlot(_ctx.$slots, "default", {}, () => [
18
+ createTextVNode(
19
+ toDisplayString(__props.text),
20
+ 1
21
+ /* TEXT */
22
+ )
23
+ ], true)
24
+ ], 10, _hoisted_1);
25
+ };
26
+ }
27
+ });
28
+
29
+ export { _sfc_main as default };
@@ -0,0 +1,6 @@
1
+ import _sfc_main from './input2.vue.mjs';
2
+ import _export_sfc from '../../../../../_virtual/_plugin-vue_export-helper.mjs';
3
+
4
+ var Input = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-730a2f3c"]]);
5
+
6
+ export { Input as default };
@@ -0,0 +1,142 @@
1
+ import { defineComponent, computed, openBlock, createElementBlock, normalizeClass, createElementVNode, toDisplayString, Fragment, renderList } from 'vue';
2
+
3
+ const _hoisted_1 = ["value", "disabled"];
4
+ const _hoisted_2 = { value: "" };
5
+ const _hoisted_3 = ["value"];
6
+ const _hoisted_4 = ["value", "disabled", "placeholder"];
7
+ const _hoisted_5 = ["type", "inputmode", "step", "maxlength", "value", "disabled", "placeholder"];
8
+ var _sfc_main = /* @__PURE__ */ defineComponent({
9
+ ...{ name: "YcCardInput" },
10
+ __name: "input",
11
+ props: {
12
+ modelValue: { default: void 0 },
13
+ kind: { default: "text" },
14
+ placeholder: { default: "" },
15
+ options: { default: () => [] },
16
+ loading: { type: Boolean, default: false },
17
+ disabled: { type: Boolean, default: false },
18
+ invalid: { type: Boolean, default: false }
19
+ },
20
+ emits: ["update:modelValue", "blur", "focus"],
21
+ setup(__props, { emit: __emit }) {
22
+ const props = __props;
23
+ const emit = __emit;
24
+ const textValue = computed(() => {
25
+ const value = props.modelValue;
26
+ if (value === void 0 || value === null) return "";
27
+ if (props.kind === "datetime") return String(value).replace(" ", "T").slice(0, 16);
28
+ if (props.kind === "date") return String(value).slice(0, 10);
29
+ return String(value);
30
+ });
31
+ const inputType = computed(() => {
32
+ switch (props.kind) {
33
+ case "phone":
34
+ return "tel";
35
+ case "email":
36
+ return "email";
37
+ case "number":
38
+ case "integer":
39
+ return "number";
40
+ case "date":
41
+ return "date";
42
+ case "datetime":
43
+ return "datetime-local";
44
+ default:
45
+ return "text";
46
+ }
47
+ });
48
+ const inputMode = computed(() => {
49
+ switch (props.kind) {
50
+ case "phone":
51
+ return "tel";
52
+ case "email":
53
+ return "email";
54
+ case "integer":
55
+ return "numeric";
56
+ case "number":
57
+ return "decimal";
58
+ default:
59
+ return void 0;
60
+ }
61
+ });
62
+ function handleInput(event) {
63
+ var _a, _b;
64
+ const raw = (_b = (_a = event.target) == null ? void 0 : _a.value) != null ? _b : "";
65
+ if (props.kind === "number" || props.kind === "integer") {
66
+ if (raw.trim() === "") return emit("update:modelValue", void 0);
67
+ const num = Number(raw);
68
+ return emit("update:modelValue", Number.isNaN(num) ? raw : num);
69
+ }
70
+ if (props.kind === "date" || props.kind === "datetime") {
71
+ return emit(
72
+ "update:modelValue",
73
+ raw ? props.kind === "datetime" ? raw.replace("T", " ") : raw : void 0
74
+ );
75
+ }
76
+ emit("update:modelValue", raw);
77
+ }
78
+ function handleSelect(event) {
79
+ var _a, _b;
80
+ const raw = (_b = (_a = event.target) == null ? void 0 : _a.value) != null ? _b : "";
81
+ if (raw === "") return emit("update:modelValue", void 0);
82
+ const matched = props.options.find((opt) => String(opt.value) === raw);
83
+ emit("update:modelValue", matched ? matched.value : raw);
84
+ }
85
+ return (_ctx, _cache) => {
86
+ return __props.kind === "select" ? (openBlock(), createElementBlock("select", {
87
+ key: 0,
88
+ value: __props.modelValue === void 0 || __props.modelValue === null ? "" : String(__props.modelValue),
89
+ disabled: __props.disabled,
90
+ class: normalizeClass(["yc-input is-select", { "is-invalid": __props.invalid }]),
91
+ onFocus: _cache[0] || (_cache[0] = ($event) => emit("focus")),
92
+ onChange: handleSelect,
93
+ onBlur: _cache[1] || (_cache[1] = ($event) => emit("blur"))
94
+ }, [
95
+ createElementVNode(
96
+ "option",
97
+ _hoisted_2,
98
+ toDisplayString(__props.loading ? "\u52A0\u8F7D\u9009\u9879\u4E2D\u2026" : __props.placeholder),
99
+ 1
100
+ /* TEXT */
101
+ ),
102
+ (openBlock(true), createElementBlock(
103
+ Fragment,
104
+ null,
105
+ renderList(__props.options, (opt) => {
106
+ return openBlock(), createElementBlock("option", {
107
+ key: String(opt.value),
108
+ value: String(opt.value)
109
+ }, toDisplayString(opt.label), 9, _hoisted_3);
110
+ }),
111
+ 128
112
+ /* KEYED_FRAGMENT */
113
+ ))
114
+ ], 42, _hoisted_1)) : __props.kind === "textarea" ? (openBlock(), createElementBlock("textarea", {
115
+ key: 1,
116
+ rows: "3",
117
+ value: textValue.value,
118
+ disabled: __props.disabled,
119
+ placeholder: __props.placeholder,
120
+ class: normalizeClass(["yc-input is-textarea", { "is-invalid": __props.invalid }]),
121
+ onFocus: _cache[2] || (_cache[2] = ($event) => emit("focus")),
122
+ onInput: handleInput,
123
+ onBlur: _cache[3] || (_cache[3] = ($event) => emit("blur"))
124
+ }, null, 42, _hoisted_4)) : (openBlock(), createElementBlock("input", {
125
+ key: 2,
126
+ type: inputType.value,
127
+ inputmode: inputMode.value,
128
+ step: __props.kind === "integer" ? "1" : __props.kind === "number" ? "any" : void 0,
129
+ maxlength: __props.kind === "phone" ? 20 : void 0,
130
+ value: textValue.value,
131
+ disabled: __props.disabled,
132
+ placeholder: __props.placeholder,
133
+ class: normalizeClass(["yc-input", { "is-invalid": __props.invalid }]),
134
+ onFocus: _cache[4] || (_cache[4] = ($event) => emit("focus")),
135
+ onInput: handleInput,
136
+ onBlur: _cache[5] || (_cache[5] = ($event) => emit("blur"))
137
+ }, null, 42, _hoisted_5));
138
+ };
139
+ }
140
+ });
141
+
142
+ export { _sfc_main as default };
@@ -0,0 +1,6 @@
1
+ import _sfc_main from './kv-list2.vue.mjs';
2
+ import _export_sfc from '../../../../../_virtual/_plugin-vue_export-helper.mjs';
3
+
4
+ var KvList = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-4227c8cd"]]);
5
+
6
+ export { KvList as default };