yc-agent-ui 1.2.8 → 1.2.11

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 (223) hide show
  1. package/es/components/data-table/src/data-table.vue.d.ts +2 -2
  2. package/es/components/display-item/index.d.ts +3 -3
  3. package/es/components/display-item/src/index.vue.d.ts +1 -1
  4. package/es/components/drawer-form/index.d.ts +6 -6
  5. package/es/components/drawer-form/src/index.vue.d.ts +2 -2
  6. package/es/components/page/index.d.ts +100 -100
  7. package/es/components/page/src/index.vue.d.ts +33 -33
  8. package/es/components/table/index.d.ts +18 -18
  9. package/es/components/table/src/index.vue.d.ts +2 -2
  10. package/es/components/table/src/table-column.vue.d.ts +10 -10
  11. package/es/components/virtual-table/index.d.ts +7 -7
  12. package/es/components/virtual-table/src/index.vue.d.ts +2 -2
  13. package/es/components/yc-ai-chat/src/bubble.vue.d.ts +1 -1
  14. package/es/components/yc-ai-chat/src/file-card.vue.d.ts +1 -1
  15. package/es/components/yc-ai-chat/src/sender.vue.d.ts +1 -1
  16. package/es/components/yc-coss-table/src/coss-table.vue.d.ts +3 -3
  17. package/es/components/yc-coss-table/src/table.vue.d.ts +1 -1
  18. package/es/components/yc-display-cards/index.d.ts +218 -3
  19. package/es/components/yc-display-cards/src/card-renderer.vue.d.ts +16 -0
  20. package/es/components/yc-display-cards/src/elements/action-bar.vue.d.ts +12 -0
  21. package/es/components/yc-display-cards/src/elements/card-shell.vue.d.ts +24 -0
  22. package/es/components/yc-display-cards/src/elements/choice-group.vue.d.ts +14 -0
  23. package/es/components/yc-display-cards/src/elements/data-table.vue.d.ts +10 -0
  24. package/es/components/yc-display-cards/src/elements/field-control.vue.d.ts +22 -0
  25. package/es/components/yc-display-cards/src/elements/field-utils.d.ts +16 -0
  26. package/es/components/yc-display-cards/src/elements/form-field.vue.d.ts +18 -0
  27. package/es/components/yc-display-cards/src/elements/inline-alert.vue.d.ts +14 -0
  28. package/es/components/yc-display-cards/src/elements/input.vue.d.ts +20 -0
  29. package/es/components/yc-display-cards/src/elements/kv-list.vue.d.ts +8 -0
  30. package/es/components/yc-display-cards/src/elements/metric-grid.vue.d.ts +7 -0
  31. package/es/components/yc-display-cards/src/elements/status-tag.vue.d.ts +6 -0
  32. package/es/components/yc-display-cards/src/elements/switch.vue.d.ts +10 -0
  33. package/es/components/yc-display-cards/src/elements/upload.vue.d.ts +17 -0
  34. package/es/components/yc-display-cards/src/elements/use-card-form.d.ts +23 -0
  35. package/es/components/yc-display-cards/src/form-card.vue.d.ts +5 -2
  36. package/es/components/yc-display-cards/src/table-card.vue.d.ts +1 -2
  37. package/es/components/yc-display-cards/src/types.d.ts +179 -10
  38. package/es/components/yc-feedback/src/banner.vue.d.ts +1 -1
  39. package/es/components/yc-feedback/src/key-value-list.vue.d.ts +1 -1
  40. package/es/components/yc-input/src/textarea.vue.d.ts +2 -2
  41. package/es/components/yc-plus-page/src/header-filter-cell.vue.d.ts +8 -8
  42. package/es/components/yc-plus-page/src/index.vue.d.ts +115 -115
  43. package/es/components/yc-property-table/src/property-table.vue.d.ts +2 -2
  44. package/es/hooks/usePlusFormReset.d.ts +18 -18
  45. package/es/index.css +30 -24
  46. package/es/index.mjs +3 -1
  47. package/es/packages/components/index.mjs +3 -1
  48. package/es/packages/components/yc-display-cards/capability.mjs +57 -1
  49. package/es/packages/components/yc-display-cards/index.mjs +31 -1
  50. package/es/packages/components/yc-display-cards/src/card-renderer.vue.mjs +6 -0
  51. package/es/packages/components/yc-display-cards/src/card-renderer2.vue.mjs +295 -0
  52. package/es/packages/components/yc-display-cards/src/detail-card.vue.mjs +1 -1
  53. package/es/packages/components/yc-display-cards/src/detail-card2.vue.mjs +28 -94
  54. package/es/packages/components/yc-display-cards/src/elements/action-bar.vue.mjs +6 -0
  55. package/es/packages/components/yc-display-cards/src/elements/action-bar2.vue.mjs +38 -0
  56. package/es/packages/components/yc-display-cards/src/elements/card-shell.vue.mjs +6 -0
  57. package/es/packages/components/yc-display-cards/src/elements/card-shell2.vue.mjs +85 -0
  58. package/es/packages/components/yc-display-cards/src/elements/choice-group.vue.mjs +6 -0
  59. package/es/packages/components/yc-display-cards/src/elements/choice-group2.vue.mjs +57 -0
  60. package/es/packages/components/yc-display-cards/src/elements/data-table.vue.mjs +6 -0
  61. package/es/packages/components/yc-display-cards/src/elements/data-table2.vue.mjs +184 -0
  62. package/es/packages/components/yc-display-cards/src/elements/field-control.vue.mjs +5 -0
  63. package/es/packages/components/yc-display-cards/src/elements/field-control2.vue.mjs +92 -0
  64. package/es/packages/components/yc-display-cards/src/elements/field-utils.mjs +121 -0
  65. package/es/packages/components/yc-display-cards/src/elements/form-field.vue.mjs +6 -0
  66. package/es/packages/components/yc-display-cards/src/elements/form-field2.vue.mjs +68 -0
  67. package/es/packages/components/yc-display-cards/src/elements/inline-alert.vue.mjs +6 -0
  68. package/es/packages/components/yc-display-cards/src/elements/inline-alert2.vue.mjs +29 -0
  69. package/es/packages/components/yc-display-cards/src/elements/input.vue.mjs +6 -0
  70. package/es/packages/components/yc-display-cards/src/elements/input2.vue.mjs +148 -0
  71. package/es/packages/components/yc-display-cards/src/elements/kv-list.vue.mjs +6 -0
  72. package/es/packages/components/yc-display-cards/src/elements/kv-list2.vue.mjs +63 -0
  73. package/es/packages/components/yc-display-cards/src/elements/metric-grid.vue.mjs +6 -0
  74. package/es/packages/components/yc-display-cards/src/elements/metric-grid2.vue.mjs +97 -0
  75. package/es/packages/components/yc-display-cards/src/elements/status-tag.vue.mjs +6 -0
  76. package/es/packages/components/yc-display-cards/src/elements/status-tag2.vue.mjs +25 -0
  77. package/es/packages/components/yc-display-cards/src/elements/switch.vue.mjs +6 -0
  78. package/es/packages/components/yc-display-cards/src/elements/switch2.vue.mjs +35 -0
  79. package/es/packages/components/yc-display-cards/src/elements/upload.vue.mjs +6 -0
  80. package/es/packages/components/yc-display-cards/src/elements/upload2.vue.mjs +196 -0
  81. package/es/packages/components/yc-display-cards/src/elements/use-card-form.mjs +80 -0
  82. package/es/packages/components/yc-display-cards/src/form-card.vue.mjs +1 -1
  83. package/es/packages/components/yc-display-cards/src/form-card2.vue.mjs +169 -1140
  84. package/es/packages/components/yc-display-cards/src/metrics-card.vue.mjs +1 -1
  85. package/es/packages/components/yc-display-cards/src/metrics-card2.vue.mjs +19 -114
  86. package/es/packages/components/yc-display-cards/src/table-card.vue.mjs +1 -1
  87. package/es/packages/components/yc-display-cards/src/table-card2.vue.mjs +50 -232
  88. package/es/packages/components/yc-status-dialog/src/index.vue.mjs +1 -1
  89. package/es/version.d.ts +1 -1
  90. package/es/version.mjs +1 -1
  91. package/index.css +20 -14
  92. package/index.js +2204 -2354
  93. package/index.min.css +19 -13
  94. package/index.min.js +37 -43
  95. package/index.min.mjs +36 -42
  96. package/index.mjs +2184 -2353
  97. package/lib/components/data-table/src/data-table.vue.d.ts +2 -2
  98. package/lib/components/display-item/index.d.ts +3 -3
  99. package/lib/components/display-item/src/index.vue.d.ts +1 -1
  100. package/lib/components/drawer-form/index.d.ts +6 -6
  101. package/lib/components/drawer-form/src/index.vue.d.ts +2 -2
  102. package/lib/components/page/index.d.ts +100 -100
  103. package/lib/components/page/src/index.vue.d.ts +33 -33
  104. package/lib/components/table/index.d.ts +18 -18
  105. package/lib/components/table/src/index.vue.d.ts +2 -2
  106. package/lib/components/table/src/table-column.vue.d.ts +10 -10
  107. package/lib/components/virtual-table/index.d.ts +7 -7
  108. package/lib/components/virtual-table/src/index.vue.d.ts +2 -2
  109. package/lib/components/yc-ai-chat/src/bubble.vue.d.ts +1 -1
  110. package/lib/components/yc-ai-chat/src/file-card.vue.d.ts +1 -1
  111. package/lib/components/yc-ai-chat/src/sender.vue.d.ts +1 -1
  112. package/lib/components/yc-coss-table/src/coss-table.vue.d.ts +3 -3
  113. package/lib/components/yc-coss-table/src/table.vue.d.ts +1 -1
  114. package/lib/components/yc-display-cards/index.d.ts +218 -3
  115. package/lib/components/yc-display-cards/src/card-renderer.vue.d.ts +16 -0
  116. package/lib/components/yc-display-cards/src/elements/action-bar.vue.d.ts +12 -0
  117. package/lib/components/yc-display-cards/src/elements/card-shell.vue.d.ts +24 -0
  118. package/lib/components/yc-display-cards/src/elements/choice-group.vue.d.ts +14 -0
  119. package/lib/components/yc-display-cards/src/elements/data-table.vue.d.ts +10 -0
  120. package/lib/components/yc-display-cards/src/elements/field-control.vue.d.ts +22 -0
  121. package/lib/components/yc-display-cards/src/elements/field-utils.d.ts +16 -0
  122. package/lib/components/yc-display-cards/src/elements/form-field.vue.d.ts +18 -0
  123. package/lib/components/yc-display-cards/src/elements/inline-alert.vue.d.ts +14 -0
  124. package/lib/components/yc-display-cards/src/elements/input.vue.d.ts +20 -0
  125. package/lib/components/yc-display-cards/src/elements/kv-list.vue.d.ts +8 -0
  126. package/lib/components/yc-display-cards/src/elements/metric-grid.vue.d.ts +7 -0
  127. package/lib/components/yc-display-cards/src/elements/status-tag.vue.d.ts +6 -0
  128. package/lib/components/yc-display-cards/src/elements/switch.vue.d.ts +10 -0
  129. package/lib/components/yc-display-cards/src/elements/upload.vue.d.ts +17 -0
  130. package/lib/components/yc-display-cards/src/elements/use-card-form.d.ts +23 -0
  131. package/lib/components/yc-display-cards/src/form-card.vue.d.ts +5 -2
  132. package/lib/components/yc-display-cards/src/table-card.vue.d.ts +1 -2
  133. package/lib/components/yc-display-cards/src/types.d.ts +179 -10
  134. package/lib/components/yc-feedback/src/banner.vue.d.ts +1 -1
  135. package/lib/components/yc-feedback/src/key-value-list.vue.d.ts +1 -1
  136. package/lib/components/yc-input/src/textarea.vue.d.ts +2 -2
  137. package/lib/components/yc-plus-page/src/header-filter-cell.vue.d.ts +8 -8
  138. package/lib/components/yc-plus-page/src/index.vue.d.ts +115 -115
  139. package/lib/components/yc-property-table/src/property-table.vue.d.ts +2 -2
  140. package/lib/hooks/usePlusFormReset.d.ts +18 -18
  141. package/lib/index.css +29 -23
  142. package/lib/index.js +28 -7
  143. package/lib/packages/components/index.js +28 -7
  144. package/lib/packages/components/yc-display-cards/capability.js +56 -0
  145. package/lib/packages/components/yc-display-cards/index.js +49 -0
  146. package/lib/packages/components/yc-display-cards/src/card-renderer.vue.js +10 -0
  147. package/lib/packages/components/yc-display-cards/src/card-renderer2.vue.js +299 -0
  148. package/lib/packages/components/yc-display-cards/src/detail-card.vue.js +1 -1
  149. package/lib/packages/components/yc-display-cards/src/detail-card2.vue.js +27 -93
  150. package/lib/packages/components/yc-display-cards/src/elements/action-bar.vue.js +10 -0
  151. package/lib/packages/components/yc-display-cards/src/elements/action-bar2.vue.js +42 -0
  152. package/lib/packages/components/yc-display-cards/src/elements/card-shell.vue.js +10 -0
  153. package/lib/packages/components/yc-display-cards/src/elements/card-shell2.vue.js +89 -0
  154. package/lib/packages/components/yc-display-cards/src/elements/choice-group.vue.js +10 -0
  155. package/lib/packages/components/yc-display-cards/src/elements/choice-group2.vue.js +61 -0
  156. package/lib/packages/components/yc-display-cards/src/elements/data-table.vue.js +10 -0
  157. package/lib/packages/components/yc-display-cards/src/elements/data-table2.vue.js +188 -0
  158. package/lib/packages/components/yc-display-cards/src/elements/field-control.vue.js +9 -0
  159. package/lib/packages/components/yc-display-cards/src/elements/field-control2.vue.js +96 -0
  160. package/lib/packages/components/yc-display-cards/src/elements/field-utils.js +134 -0
  161. package/lib/packages/components/yc-display-cards/src/elements/form-field.vue.js +10 -0
  162. package/lib/packages/components/yc-display-cards/src/elements/form-field2.vue.js +72 -0
  163. package/lib/packages/components/yc-display-cards/src/elements/inline-alert.vue.js +10 -0
  164. package/lib/packages/components/yc-display-cards/src/elements/inline-alert2.vue.js +33 -0
  165. package/lib/packages/components/yc-display-cards/src/elements/input.vue.js +10 -0
  166. package/lib/packages/components/yc-display-cards/src/elements/input2.vue.js +152 -0
  167. package/lib/packages/components/yc-display-cards/src/elements/kv-list.vue.js +10 -0
  168. package/lib/packages/components/yc-display-cards/src/elements/kv-list2.vue.js +67 -0
  169. package/lib/packages/components/yc-display-cards/src/elements/metric-grid.vue.js +10 -0
  170. package/lib/packages/components/yc-display-cards/src/elements/metric-grid2.vue.js +101 -0
  171. package/lib/packages/components/yc-display-cards/src/elements/status-tag.vue.js +10 -0
  172. package/lib/packages/components/yc-display-cards/src/elements/status-tag2.vue.js +29 -0
  173. package/lib/packages/components/yc-display-cards/src/elements/switch.vue.js +10 -0
  174. package/lib/packages/components/yc-display-cards/src/elements/switch2.vue.js +39 -0
  175. package/lib/packages/components/yc-display-cards/src/elements/upload.vue.js +10 -0
  176. package/lib/packages/components/yc-display-cards/src/elements/upload2.vue.js +200 -0
  177. package/lib/packages/components/yc-display-cards/src/elements/use-card-form.js +82 -0
  178. package/lib/packages/components/yc-display-cards/src/form-card.vue.js +1 -1
  179. package/lib/packages/components/yc-display-cards/src/form-card2.vue.js +168 -1139
  180. package/lib/packages/components/yc-display-cards/src/metrics-card.vue.js +1 -1
  181. package/lib/packages/components/yc-display-cards/src/metrics-card2.vue.js +18 -113
  182. package/lib/packages/components/yc-display-cards/src/table-card.vue.js +1 -1
  183. package/lib/packages/components/yc-display-cards/src/table-card2.vue.js +49 -231
  184. package/lib/packages/components/yc-status-dialog/src/index.vue.js +1 -1
  185. package/lib/version.d.ts +1 -1
  186. package/lib/version.js +1 -1
  187. package/locale/en.js +1 -1
  188. package/locale/en.min.js +1 -1
  189. package/locale/en.min.mjs +1 -1
  190. package/locale/en.mjs +1 -1
  191. package/locale/ja.js +1 -1
  192. package/locale/ja.min.js +1 -1
  193. package/locale/ja.min.mjs +1 -1
  194. package/locale/ja.mjs +1 -1
  195. package/locale/ko.js +1 -1
  196. package/locale/ko.min.js +1 -1
  197. package/locale/ko.min.mjs +1 -1
  198. package/locale/ko.mjs +1 -1
  199. package/locale/zh-cn.js +1 -1
  200. package/locale/zh-cn.min.js +1 -1
  201. package/locale/zh-cn.min.mjs +1 -1
  202. package/locale/zh-cn.mjs +1 -1
  203. package/locale/zh-tw.js +1 -1
  204. package/locale/zh-tw.min.js +1 -1
  205. package/locale/zh-tw.min.mjs +1 -1
  206. package/locale/zh-tw.mjs +1 -1
  207. package/package.json +1 -2
  208. package/theme-chalk/index.css +20 -14
  209. package/theme-chalk/plus-dialog.css +1 -1
  210. package/theme-chalk/plus-yc-status-dialog.css +1 -1
  211. package/theme-chalk/src/dialog.scss +0 -6
  212. package/theme-chalk/src/index.scss +1 -2
  213. package/theme-chalk/src/yc-status-dialog.scss +2 -2
  214. package/es/_virtual/_commonjsHelpers.mjs +0 -7
  215. package/es/_virtual/toastify.mjs +0 -3
  216. package/es/components/yc-display-cards/src/toast.d.ts +0 -4
  217. package/es/node_modules/.pnpm/toastify-js@1.12.0/node_modules/toastify-js/src/toastify.mjs +0 -456
  218. package/es/packages/components/yc-display-cards/src/toast.mjs +0 -35
  219. package/lib/_virtual/_commonjsHelpers.js +0 -10
  220. package/lib/_virtual/toastify.js +0 -5
  221. package/lib/components/yc-display-cards/src/toast.d.ts +0 -4
  222. package/lib/node_modules/.pnpm/toastify-js@1.12.0/node_modules/toastify-js/src/toastify.js +0 -460
  223. package/lib/packages/components/yc-display-cards/src/toast.js +0 -37
@@ -0,0 +1,85 @@
1
+ import { defineComponent, openBlock, createElementBlock, normalizeClass, createCommentVNode, createElementVNode, toDisplayString, renderSlot, createBlock } from 'vue';
2
+ import StatusTag from './status-tag.vue.mjs';
3
+
4
+ const _hoisted_1 = {
5
+ key: 0,
6
+ class: "yc-card-shell__header"
7
+ };
8
+ const _hoisted_2 = {
9
+ key: 0,
10
+ class: "yc-card-shell__accent"
11
+ };
12
+ const _hoisted_3 = { class: "yc-card-shell__titles" };
13
+ const _hoisted_4 = {
14
+ key: 0,
15
+ class: "yc-card-shell__title"
16
+ };
17
+ const _hoisted_5 = {
18
+ key: 1,
19
+ class: "yc-card-shell__subtitle"
20
+ };
21
+ const _hoisted_6 = {
22
+ key: 1,
23
+ class: "yc-card-shell__footer"
24
+ };
25
+ var _sfc_main = /* @__PURE__ */ defineComponent({
26
+ ...{ name: "YcCardShell" },
27
+ __name: "card-shell",
28
+ props: {
29
+ title: { default: "" },
30
+ subtitle: { default: "" },
31
+ badge: { default: void 0 },
32
+ accent: { type: Boolean, default: false },
33
+ compact: { type: Boolean, default: false }
34
+ },
35
+ setup(__props) {
36
+ return (_ctx, _cache) => {
37
+ var _a;
38
+ return openBlock(), createElementBlock(
39
+ "div",
40
+ {
41
+ class: normalizeClass(["yc-card-shell", { "is-accent": __props.accent, "is-compact": __props.compact }])
42
+ },
43
+ [
44
+ __props.title || __props.subtitle || ((_a = __props.badge) == null ? void 0 : _a.text) || _ctx.$slots.extra ? (openBlock(), createElementBlock("div", _hoisted_1, [
45
+ __props.accent ? (openBlock(), createElementBlock("span", _hoisted_2)) : createCommentVNode("v-if", true),
46
+ createElementVNode("div", _hoisted_3, [
47
+ __props.title ? (openBlock(), createElementBlock(
48
+ "div",
49
+ _hoisted_4,
50
+ toDisplayString(__props.title),
51
+ 1
52
+ /* TEXT */
53
+ )) : createCommentVNode("v-if", true),
54
+ __props.subtitle ? (openBlock(), createElementBlock(
55
+ "div",
56
+ _hoisted_5,
57
+ toDisplayString(__props.subtitle),
58
+ 1
59
+ /* TEXT */
60
+ )) : createCommentVNode("v-if", true)
61
+ ]),
62
+ renderSlot(_ctx.$slots, "extra", {}, () => {
63
+ var _a2;
64
+ return [
65
+ ((_a2 = __props.badge) == null ? void 0 : _a2.text) ? (openBlock(), createBlock(StatusTag, {
66
+ key: 0,
67
+ text: __props.badge.text,
68
+ tone: __props.badge.tone
69
+ }, null, 8, ["text", "tone"])) : createCommentVNode("v-if", true)
70
+ ];
71
+ }, true)
72
+ ])) : createCommentVNode("v-if", true),
73
+ renderSlot(_ctx.$slots, "default", {}, void 0, true),
74
+ _ctx.$slots.footer ? (openBlock(), createElementBlock("div", _hoisted_6, [
75
+ renderSlot(_ctx.$slots, "footer", {}, void 0, true)
76
+ ])) : createCommentVNode("v-if", true)
77
+ ],
78
+ 2
79
+ /* CLASS */
80
+ );
81
+ };
82
+ }
83
+ });
84
+
85
+ export { _sfc_main as default };
@@ -0,0 +1,6 @@
1
+ import _sfc_main from './choice-group2.vue.mjs';
2
+ import _export_sfc from '../../../../../_virtual/_plugin-vue_export-helper.mjs';
3
+
4
+ var ChoiceGroup = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-1e3f5da2"]]);
5
+
6
+ export { ChoiceGroup as default };
@@ -0,0 +1,57 @@
1
+ import { defineComponent, openBlock, createElementBlock, Fragment, renderList, normalizeClass, toDisplayString } from 'vue';
2
+
3
+ const _hoisted_1 = ["role"];
4
+ const _hoisted_2 = ["role", "aria-checked", "disabled", "onClick"];
5
+ var _sfc_main = /* @__PURE__ */ defineComponent({
6
+ ...{ name: "YcCardChoice" },
7
+ __name: "choice-group",
8
+ props: {
9
+ modelValue: { default: void 0 },
10
+ options: { default: () => [] },
11
+ multiple: { type: Boolean, default: false },
12
+ disabled: { type: Boolean, default: false }
13
+ },
14
+ emits: ["update:modelValue"],
15
+ setup(__props, { emit: __emit }) {
16
+ const props = __props;
17
+ const emit = __emit;
18
+ function isSelected(value) {
19
+ return props.multiple ? Array.isArray(props.modelValue) && props.modelValue.includes(value) : props.modelValue === value;
20
+ }
21
+ function toggle(value) {
22
+ if (props.disabled) return;
23
+ if (!props.multiple) return emit("update:modelValue", value);
24
+ const current = Array.isArray(props.modelValue) ? [...props.modelValue] : [];
25
+ const idx = current.indexOf(value);
26
+ if (idx >= 0) current.splice(idx, 1);
27
+ else current.push(value);
28
+ emit("update:modelValue", current.length ? current : void 0);
29
+ }
30
+ return (_ctx, _cache) => {
31
+ return openBlock(), createElementBlock("div", {
32
+ class: "yc-choice-group",
33
+ role: __props.multiple ? "group" : "radiogroup"
34
+ }, [
35
+ (openBlock(true), createElementBlock(
36
+ Fragment,
37
+ null,
38
+ renderList(__props.options, (opt) => {
39
+ return openBlock(), createElementBlock("button", {
40
+ key: String(opt.value),
41
+ type: "button",
42
+ role: __props.multiple ? "checkbox" : "radio",
43
+ "aria-checked": isSelected(opt.value),
44
+ disabled: __props.disabled,
45
+ class: normalizeClass(["yc-choice-group__item", { "is-selected": isSelected(opt.value) }]),
46
+ onClick: ($event) => toggle(opt.value)
47
+ }, toDisplayString(opt.label), 11, _hoisted_2);
48
+ }),
49
+ 128
50
+ /* KEYED_FRAGMENT */
51
+ ))
52
+ ], 8, _hoisted_1);
53
+ };
54
+ }
55
+ });
56
+
57
+ export { _sfc_main as default };
@@ -0,0 +1,6 @@
1
+ import _sfc_main from './data-table2.vue.mjs';
2
+ import _export_sfc from '../../../../../_virtual/_plugin-vue_export-helper.mjs';
3
+
4
+ var DataTable = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-070f55c2"]]);
5
+
6
+ export { DataTable as default };
@@ -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 };