yc-agent-ui 1.0.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (261) hide show
  1. package/README.md +22 -0
  2. package/es/components/data-table/src/data-table-pagination.vue.d.ts +3 -3
  3. package/es/components/data-table/src/data-table-toolbar.vue.d.ts +1 -1
  4. package/es/components/data-table/src/data-table.vue.d.ts +3 -3
  5. package/es/components/dialog-form/index.d.ts +4 -4
  6. package/es/components/dialog-form/src/index.vue.d.ts +4 -4
  7. package/es/components/display-item/index.d.ts +12 -12
  8. package/es/components/display-item/src/index.vue.d.ts +12 -12
  9. package/es/components/drawer-form/index.d.ts +10 -10
  10. package/es/components/drawer-form/src/index.vue.d.ts +6 -6
  11. package/es/components/form/index.d.ts +36 -36
  12. package/es/components/form/src/form-content.vue.d.ts +15 -15
  13. package/es/components/form/src/index.vue.d.ts +18 -18
  14. package/es/components/form-item/index.d.ts +37 -37
  15. package/es/components/form-item/src/index.vue.d.ts +16 -16
  16. package/es/components/index.d.ts +4 -0
  17. package/es/components/page/index.d.ts +897 -897
  18. package/es/components/page/src/index.vue.d.ts +302 -302
  19. package/es/components/search/index.d.ts +242 -242
  20. package/es/components/search/src/index.vue.d.ts +84 -84
  21. package/es/components/table/index.d.ts +18 -18
  22. package/es/components/table/src/index.vue.d.ts +2 -2
  23. package/es/components/table/src/table-column.vue.d.ts +24 -24
  24. package/es/components/virtual-table/index.d.ts +10 -10
  25. package/es/components/virtual-table/src/index.vue.d.ts +3 -3
  26. package/es/components/yc-controls/capability.d.ts +4 -0
  27. package/es/components/yc-controls/index.d.ts +17 -0
  28. package/es/components/yc-controls/src/choice-cards.vue.d.ts +16 -0
  29. package/es/components/yc-controls/src/segmented.vue.d.ts +16 -0
  30. package/es/components/yc-controls/src/switch-row.vue.d.ts +13 -0
  31. package/es/components/yc-controls/src/type.d.ts +39 -0
  32. package/es/components/yc-coss-table/src/coss-table.vue.d.ts +2 -2
  33. package/es/components/yc-coss-table/src/table-head.vue.d.ts +1 -1
  34. package/es/components/yc-date-picker/src/date-picker.vue.d.ts +1 -1
  35. package/es/components/yc-feedback/capability.d.ts +4 -0
  36. package/es/components/yc-feedback/index.d.ts +21 -0
  37. package/es/components/yc-feedback/src/banner.vue.d.ts +22 -0
  38. package/es/components/yc-feedback/src/empty-state.vue.d.ts +20 -0
  39. package/es/components/yc-feedback/src/key-value-list.vue.d.ts +22 -0
  40. package/es/components/yc-feedback/src/timeline.vue.d.ts +7 -0
  41. package/es/components/yc-feedback/src/type.d.ts +46 -0
  42. package/es/components/yc-input/capability.d.ts +4 -0
  43. package/es/components/yc-input/index.d.ts +21 -0
  44. package/es/components/yc-input/src/input.vue.d.ts +50 -0
  45. package/es/components/yc-input/src/money-input.vue.d.ts +26 -0
  46. package/es/components/yc-input/src/stepper-input.vue.d.ts +18 -0
  47. package/es/components/yc-input/src/textarea.vue.d.ts +35 -0
  48. package/es/components/yc-input/src/type.d.ts +82 -0
  49. package/es/components/yc-plus-page/src/header-filter-cell.vue.d.ts +8 -8
  50. package/es/components/yc-plus-page/src/index.vue.d.ts +917 -917
  51. package/es/components/yc-plus-tree/src/index.vue.d.ts +1 -1
  52. package/es/components/yc-property-table/capability.d.ts +4 -0
  53. package/es/components/yc-property-table/index.d.ts +30 -0
  54. package/es/components/yc-property-table/src/asset-table.vue.d.ts +17 -0
  55. package/es/components/yc-property-table/src/bill-table.vue.d.ts +18 -0
  56. package/es/components/yc-property-table/src/device-table.vue.d.ts +17 -0
  57. package/es/components/yc-property-table/src/order-table.vue.d.ts +18 -0
  58. package/es/components/yc-property-table/src/property-table.vue.d.ts +91 -0
  59. package/es/components/yc-property-table/src/type.d.ts +214 -0
  60. package/es/components/yc-questionnaire/src/index.vue.d.ts +1 -1
  61. package/es/components/yc-select-v2/src/index.vue.d.ts +1 -1
  62. package/es/hooks/usePlusFormReset.d.ts +66 -66
  63. package/es/index.css +9 -9
  64. package/es/index.mjs +4 -0
  65. package/es/packages/components/index.mjs +4 -0
  66. package/es/packages/components/table/capability.mjs +10 -29
  67. package/es/packages/components/yc-card/capability.mjs +53 -13
  68. package/es/packages/components/yc-controls/capability.mjs +100 -0
  69. package/es/packages/components/yc-controls/index.mjs +13 -0
  70. package/es/packages/components/yc-controls/src/choice-cards.vue.mjs +5 -0
  71. package/es/packages/components/yc-controls/src/choice-cards2.vue.mjs +157 -0
  72. package/es/packages/components/yc-controls/src/segmented.vue.mjs +5 -0
  73. package/es/packages/components/yc-controls/src/segmented2.vue.mjs +78 -0
  74. package/es/packages/components/yc-controls/src/switch-row.vue.mjs +5 -0
  75. package/es/packages/components/yc-controls/src/switch-row2.vue.mjs +95 -0
  76. package/es/packages/components/yc-controls/src/type.mjs +1 -0
  77. package/es/packages/components/yc-feedback/capability.mjs +109 -0
  78. package/es/packages/components/yc-feedback/index.mjs +16 -0
  79. package/es/packages/components/yc-feedback/src/banner.vue.mjs +5 -0
  80. package/es/packages/components/yc-feedback/src/banner2.vue.mjs +230 -0
  81. package/es/packages/components/yc-feedback/src/empty-state.vue.mjs +5 -0
  82. package/es/packages/components/yc-feedback/src/empty-state2.vue.mjs +97 -0
  83. package/es/packages/components/yc-feedback/src/key-value-list.vue.mjs +5 -0
  84. package/es/packages/components/yc-feedback/src/key-value-list2.vue.mjs +194 -0
  85. package/es/packages/components/yc-feedback/src/timeline.vue.mjs +5 -0
  86. package/es/packages/components/yc-feedback/src/timeline2.vue.mjs +134 -0
  87. package/es/packages/components/yc-feedback/src/type.mjs +1 -0
  88. package/es/packages/components/yc-input/capability.mjs +112 -0
  89. package/es/packages/components/yc-input/index.mjs +16 -0
  90. package/es/packages/components/yc-input/src/input.vue.mjs +5 -0
  91. package/es/packages/components/yc-input/src/input2.vue.mjs +427 -0
  92. package/es/packages/components/yc-input/src/money-input.vue.mjs +5 -0
  93. package/es/packages/components/yc-input/src/money-input2.vue.mjs +242 -0
  94. package/es/packages/components/yc-input/src/stepper-input.vue.mjs +5 -0
  95. package/es/packages/components/yc-input/src/stepper-input2.vue.mjs +211 -0
  96. package/es/packages/components/yc-input/src/textarea.vue.mjs +5 -0
  97. package/es/packages/components/yc-input/src/textarea2.vue.mjs +158 -0
  98. package/es/packages/components/yc-input/src/type.mjs +1 -0
  99. package/es/packages/components/yc-property-table/capability.mjs +350 -0
  100. package/es/packages/components/yc-property-table/index.mjs +24 -0
  101. package/es/packages/components/yc-property-table/src/asset-table.vue.mjs +5 -0
  102. package/es/packages/components/yc-property-table/src/asset-table2.vue.mjs +405 -0
  103. package/es/packages/components/yc-property-table/src/bill-table.vue.mjs +5 -0
  104. package/es/packages/components/yc-property-table/src/bill-table2.vue.mjs +654 -0
  105. package/es/packages/components/yc-property-table/src/device-table.vue.mjs +5 -0
  106. package/es/packages/components/yc-property-table/src/device-table2.vue.mjs +324 -0
  107. package/es/packages/components/yc-property-table/src/order-table.vue.mjs +5 -0
  108. package/es/packages/components/yc-property-table/src/order-table2.vue.mjs +363 -0
  109. package/es/packages/components/yc-property-table/src/property-table.vue.mjs +5 -0
  110. package/es/packages/components/yc-property-table/src/property-table2.vue.mjs +1228 -0
  111. package/es/packages/components/yc-property-table/src/type.mjs +1 -0
  112. package/es/version.d.ts +1 -1
  113. package/es/version.mjs +1 -1
  114. package/index.css +1 -1
  115. package/index.js +6385 -1362
  116. package/index.min.js +24 -24
  117. package/index.min.mjs +26 -26
  118. package/index.mjs +6341 -1355
  119. package/lib/components/data-table/src/data-table-pagination.vue.d.ts +3 -3
  120. package/lib/components/data-table/src/data-table-toolbar.vue.d.ts +1 -1
  121. package/lib/components/data-table/src/data-table.vue.d.ts +3 -3
  122. package/lib/components/dialog-form/index.d.ts +4 -4
  123. package/lib/components/dialog-form/src/index.vue.d.ts +4 -4
  124. package/lib/components/display-item/index.d.ts +12 -12
  125. package/lib/components/display-item/src/index.vue.d.ts +12 -12
  126. package/lib/components/drawer-form/index.d.ts +10 -10
  127. package/lib/components/drawer-form/src/index.vue.d.ts +6 -6
  128. package/lib/components/form/index.d.ts +36 -36
  129. package/lib/components/form/src/form-content.vue.d.ts +15 -15
  130. package/lib/components/form/src/index.vue.d.ts +18 -18
  131. package/lib/components/form-item/index.d.ts +37 -37
  132. package/lib/components/form-item/src/index.vue.d.ts +16 -16
  133. package/lib/components/index.d.ts +4 -0
  134. package/lib/components/page/index.d.ts +897 -897
  135. package/lib/components/page/src/index.vue.d.ts +302 -302
  136. package/lib/components/search/index.d.ts +242 -242
  137. package/lib/components/search/src/index.vue.d.ts +84 -84
  138. package/lib/components/table/index.d.ts +18 -18
  139. package/lib/components/table/src/index.vue.d.ts +2 -2
  140. package/lib/components/table/src/table-column.vue.d.ts +24 -24
  141. package/lib/components/virtual-table/index.d.ts +10 -10
  142. package/lib/components/virtual-table/src/index.vue.d.ts +3 -3
  143. package/lib/components/yc-controls/capability.d.ts +4 -0
  144. package/lib/components/yc-controls/index.d.ts +17 -0
  145. package/lib/components/yc-controls/src/choice-cards.vue.d.ts +16 -0
  146. package/lib/components/yc-controls/src/segmented.vue.d.ts +16 -0
  147. package/lib/components/yc-controls/src/switch-row.vue.d.ts +13 -0
  148. package/lib/components/yc-controls/src/type.d.ts +39 -0
  149. package/lib/components/yc-coss-table/src/coss-table.vue.d.ts +2 -2
  150. package/lib/components/yc-coss-table/src/table-head.vue.d.ts +1 -1
  151. package/lib/components/yc-date-picker/src/date-picker.vue.d.ts +1 -1
  152. package/lib/components/yc-feedback/capability.d.ts +4 -0
  153. package/lib/components/yc-feedback/index.d.ts +21 -0
  154. package/lib/components/yc-feedback/src/banner.vue.d.ts +22 -0
  155. package/lib/components/yc-feedback/src/empty-state.vue.d.ts +20 -0
  156. package/lib/components/yc-feedback/src/key-value-list.vue.d.ts +22 -0
  157. package/lib/components/yc-feedback/src/timeline.vue.d.ts +7 -0
  158. package/lib/components/yc-feedback/src/type.d.ts +46 -0
  159. package/lib/components/yc-input/capability.d.ts +4 -0
  160. package/lib/components/yc-input/index.d.ts +21 -0
  161. package/lib/components/yc-input/src/input.vue.d.ts +50 -0
  162. package/lib/components/yc-input/src/money-input.vue.d.ts +26 -0
  163. package/lib/components/yc-input/src/stepper-input.vue.d.ts +18 -0
  164. package/lib/components/yc-input/src/textarea.vue.d.ts +35 -0
  165. package/lib/components/yc-input/src/type.d.ts +82 -0
  166. package/lib/components/yc-plus-page/src/header-filter-cell.vue.d.ts +8 -8
  167. package/lib/components/yc-plus-page/src/index.vue.d.ts +917 -917
  168. package/lib/components/yc-plus-tree/src/index.vue.d.ts +1 -1
  169. package/lib/components/yc-property-table/capability.d.ts +4 -0
  170. package/lib/components/yc-property-table/index.d.ts +30 -0
  171. package/lib/components/yc-property-table/src/asset-table.vue.d.ts +17 -0
  172. package/lib/components/yc-property-table/src/bill-table.vue.d.ts +18 -0
  173. package/lib/components/yc-property-table/src/device-table.vue.d.ts +17 -0
  174. package/lib/components/yc-property-table/src/order-table.vue.d.ts +18 -0
  175. package/lib/components/yc-property-table/src/property-table.vue.d.ts +91 -0
  176. package/lib/components/yc-property-table/src/type.d.ts +214 -0
  177. package/lib/components/yc-questionnaire/src/index.vue.d.ts +1 -1
  178. package/lib/components/yc-select-v2/src/index.vue.d.ts +1 -1
  179. package/lib/hooks/usePlusFormReset.d.ts +66 -66
  180. package/lib/index.css +11 -11
  181. package/lib/index.js +176 -135
  182. package/lib/packages/components/index.js +172 -131
  183. package/lib/packages/components/table/capability.js +10 -29
  184. package/lib/packages/components/yc-card/capability.js +53 -13
  185. package/lib/packages/components/yc-controls/capability.js +104 -0
  186. package/lib/packages/components/yc-controls/index.js +23 -0
  187. package/lib/packages/components/yc-controls/src/choice-cards.vue.js +9 -0
  188. package/lib/packages/components/yc-controls/src/choice-cards2.vue.js +161 -0
  189. package/lib/packages/components/yc-controls/src/segmented.vue.js +9 -0
  190. package/lib/packages/components/yc-controls/src/segmented2.vue.js +82 -0
  191. package/lib/packages/components/yc-controls/src/switch-row.vue.js +9 -0
  192. package/lib/packages/components/yc-controls/src/switch-row2.vue.js +99 -0
  193. package/lib/packages/components/yc-controls/src/type.js +2 -0
  194. package/lib/packages/components/yc-feedback/capability.js +113 -0
  195. package/lib/packages/components/yc-feedback/index.js +28 -0
  196. package/lib/packages/components/yc-feedback/src/banner.vue.js +9 -0
  197. package/lib/packages/components/yc-feedback/src/banner2.vue.js +234 -0
  198. package/lib/packages/components/yc-feedback/src/empty-state.vue.js +9 -0
  199. package/lib/packages/components/yc-feedback/src/empty-state2.vue.js +101 -0
  200. package/lib/packages/components/yc-feedback/src/key-value-list.vue.js +9 -0
  201. package/lib/packages/components/yc-feedback/src/key-value-list2.vue.js +198 -0
  202. package/lib/packages/components/yc-feedback/src/timeline.vue.js +9 -0
  203. package/lib/packages/components/yc-feedback/src/timeline2.vue.js +138 -0
  204. package/lib/packages/components/yc-feedback/src/type.js +2 -0
  205. package/lib/packages/components/yc-input/capability.js +116 -0
  206. package/lib/packages/components/yc-input/index.js +28 -0
  207. package/lib/packages/components/yc-input/src/input.vue.js +9 -0
  208. package/lib/packages/components/yc-input/src/input2.vue.js +431 -0
  209. package/lib/packages/components/yc-input/src/money-input.vue.js +9 -0
  210. package/lib/packages/components/yc-input/src/money-input2.vue.js +246 -0
  211. package/lib/packages/components/yc-input/src/stepper-input.vue.js +9 -0
  212. package/lib/packages/components/yc-input/src/stepper-input2.vue.js +215 -0
  213. package/lib/packages/components/yc-input/src/textarea.vue.js +9 -0
  214. package/lib/packages/components/yc-input/src/textarea2.vue.js +162 -0
  215. package/lib/packages/components/yc-input/src/type.js +2 -0
  216. package/lib/packages/components/yc-property-table/capability.js +354 -0
  217. package/lib/packages/components/yc-property-table/index.js +43 -0
  218. package/lib/packages/components/yc-property-table/src/asset-table.vue.js +9 -0
  219. package/lib/packages/components/yc-property-table/src/asset-table2.vue.js +409 -0
  220. package/lib/packages/components/yc-property-table/src/bill-table.vue.js +9 -0
  221. package/lib/packages/components/yc-property-table/src/bill-table2.vue.js +658 -0
  222. package/lib/packages/components/yc-property-table/src/device-table.vue.js +9 -0
  223. package/lib/packages/components/yc-property-table/src/device-table2.vue.js +328 -0
  224. package/lib/packages/components/yc-property-table/src/order-table.vue.js +9 -0
  225. package/lib/packages/components/yc-property-table/src/order-table2.vue.js +367 -0
  226. package/lib/packages/components/yc-property-table/src/property-table.vue.js +9 -0
  227. package/lib/packages/components/yc-property-table/src/property-table2.vue.js +1232 -0
  228. package/lib/packages/components/yc-property-table/src/type.js +2 -0
  229. package/lib/version.d.ts +1 -1
  230. package/lib/version.js +1 -1
  231. package/locale/en.js +1 -1
  232. package/locale/en.min.js +1 -1
  233. package/locale/en.min.mjs +1 -1
  234. package/locale/en.mjs +1 -1
  235. package/locale/ja.js +1 -1
  236. package/locale/ja.min.js +1 -1
  237. package/locale/ja.min.mjs +1 -1
  238. package/locale/ja.mjs +1 -1
  239. package/locale/ko.js +1 -1
  240. package/locale/ko.min.js +1 -1
  241. package/locale/ko.min.mjs +1 -1
  242. package/locale/ko.mjs +1 -1
  243. package/locale/zh-cn.js +1 -1
  244. package/locale/zh-cn.min.js +1 -1
  245. package/locale/zh-cn.min.mjs +1 -1
  246. package/locale/zh-cn.mjs +1 -1
  247. package/locale/zh-tw.js +1 -1
  248. package/locale/zh-tw.min.js +1 -1
  249. package/locale/zh-tw.min.mjs +1 -1
  250. package/locale/zh-tw.mjs +1 -1
  251. package/package.json +1 -1
  252. package/theme-chalk/index.css +1 -1
  253. package/theme-chalk/plus-yc-controls.css +1 -0
  254. package/theme-chalk/plus-yc-feedback.css +1 -0
  255. package/theme-chalk/plus-yc-input.css +1 -0
  256. package/theme-chalk/plus-yc-property-table.css +1 -0
  257. package/theme-chalk/src/index.scss +4 -0
  258. package/theme-chalk/src/yc-controls.scss +316 -0
  259. package/theme-chalk/src/yc-feedback.scss +452 -0
  260. package/theme-chalk/src/yc-input.scss +473 -0
  261. package/theme-chalk/src/yc-property-table.scss +1700 -0
@@ -0,0 +1,246 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var vue = require('vue');
6
+
7
+ const _hoisted_1 = {
8
+ key: 0,
9
+ class: "yc-field__top"
10
+ };
11
+ const _hoisted_2 = {
12
+ key: 0,
13
+ class: "yc-field__req",
14
+ "aria-hidden": "true"
15
+ };
16
+ const _hoisted_3 = { class: "yc-input-group" };
17
+ const _hoisted_4 = {
18
+ key: 0,
19
+ class: "yc-input__prefix yc-money-input__currency"
20
+ };
21
+ const _hoisted_5 = ["value", "placeholder", "disabled", "readonly"];
22
+ const _hoisted_6 = {
23
+ key: 1,
24
+ class: "yc-input__suffix"
25
+ };
26
+ const _hoisted_7 = {
27
+ key: 1,
28
+ class: "yc-input__affix-text yc-money-input__unit"
29
+ };
30
+ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
31
+ ...{
32
+ name: "YcMoneyInput"
33
+ },
34
+ __name: "money-input",
35
+ props: {
36
+ modelValue: { default: null },
37
+ label: {},
38
+ hint: {},
39
+ error: {},
40
+ placeholder: { default: "0.00" },
41
+ currency: { default: "\xA5" },
42
+ unit: { default: "\u5143" },
43
+ precision: { default: 2 },
44
+ min: {},
45
+ max: {},
46
+ size: { default: "default" },
47
+ variant: { default: "outline" },
48
+ clearable: { type: Boolean, default: false },
49
+ disabled: { type: Boolean, default: false },
50
+ readonly: { type: Boolean, default: false },
51
+ required: { type: Boolean, default: false }
52
+ },
53
+ emits: ["update:modelValue", "change", "focus", "blur"],
54
+ setup(__props, { emit: __emit }) {
55
+ let uid = 0;
56
+ const inputId = `yc-money-input-${++uid}`;
57
+ const props = __props;
58
+ const emit = __emit;
59
+ const inputRef = vue.ref(null);
60
+ const focused = vue.ref(false);
61
+ const draft = vue.ref("");
62
+ const parseNumber = (raw) => {
63
+ if (raw === "" || raw === null || raw === void 0) return null;
64
+ const cleaned = String(raw).replace(/,/g, "").trim();
65
+ if (!cleaned || cleaned === "-" || cleaned === ".") return null;
66
+ const num = Number(cleaned);
67
+ return Number.isFinite(num) ? num : null;
68
+ };
69
+ const clampAndRound = (num) => {
70
+ let next = num;
71
+ if (props.min !== void 0 && next < props.min) next = props.min;
72
+ if (props.max !== void 0 && next > props.max) next = props.max;
73
+ const factor = 10 ** props.precision;
74
+ return Math.round(next * factor) / factor;
75
+ };
76
+ const formatThousand = (num) => num.toLocaleString("zh-CN", {
77
+ minimumFractionDigits: props.precision,
78
+ maximumFractionDigits: props.precision
79
+ });
80
+ const numericValue = vue.computed(() => parseNumber(props.modelValue));
81
+ const displayValue = vue.computed(() => {
82
+ if (focused.value) return draft.value;
83
+ if (numericValue.value === null) return "";
84
+ return formatThousand(numericValue.value);
85
+ });
86
+ const showClear = vue.computed(
87
+ () => props.clearable && !props.disabled && !props.readonly && numericValue.value !== null
88
+ );
89
+ vue.watch(
90
+ () => props.modelValue,
91
+ (val) => {
92
+ if (!focused.value) {
93
+ const parsed = parseNumber(val);
94
+ draft.value = parsed === null ? "" : parsed.toFixed(props.precision);
95
+ }
96
+ },
97
+ { immediate: true }
98
+ );
99
+ const focusInput = () => {
100
+ var _a;
101
+ if (!props.disabled) (_a = inputRef.value) == null ? void 0 : _a.focus();
102
+ };
103
+ const onFocus = (event) => {
104
+ focused.value = true;
105
+ draft.value = numericValue.value === null ? "" : String(numericValue.value);
106
+ emit("focus", event);
107
+ };
108
+ const onInput = (event) => {
109
+ const raw = event.target.value.replace(/[^\d.-]/g, "");
110
+ draft.value = raw;
111
+ const parsed = parseNumber(raw);
112
+ emit("update:modelValue", parsed === null ? null : clampAndRound(parsed));
113
+ };
114
+ const onBlur = (event) => {
115
+ focused.value = false;
116
+ const parsed = parseNumber(draft.value);
117
+ const settled = parsed === null ? null : clampAndRound(parsed);
118
+ emit("update:modelValue", settled);
119
+ emit("change", settled);
120
+ emit("blur", event);
121
+ };
122
+ const clearValue = () => {
123
+ var _a;
124
+ draft.value = "";
125
+ emit("update:modelValue", null);
126
+ emit("change", null);
127
+ (_a = inputRef.value) == null ? void 0 : _a.focus();
128
+ };
129
+ return (_ctx, _cache) => {
130
+ return vue.openBlock(), vue.createElementBlock(
131
+ "div",
132
+ {
133
+ class: vue.normalizeClass(["yc-field yc-money-input", [
134
+ `is-size-${__props.size}`,
135
+ `is-variant-${__props.variant}`,
136
+ `is-status-${__props.error ? "error" : "default"}`,
137
+ { "is-disabled": __props.disabled, "is-focused": focused.value }
138
+ ]])
139
+ },
140
+ [
141
+ __props.label ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
142
+ vue.createElementVNode("label", {
143
+ class: "yc-field__label",
144
+ for: inputId
145
+ }, [
146
+ vue.createElementVNode(
147
+ "span",
148
+ null,
149
+ vue.toDisplayString(__props.label),
150
+ 1
151
+ /* TEXT */
152
+ ),
153
+ __props.required ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_2, "*")) : vue.createCommentVNode("v-if", true)
154
+ ])
155
+ ])) : vue.createCommentVNode("v-if", true),
156
+ vue.createElementVNode("div", _hoisted_3, [
157
+ vue.createElementVNode("div", {
158
+ class: "yc-input-control",
159
+ onClick: focusInput
160
+ }, [
161
+ __props.currency ? (vue.openBlock(), vue.createElementBlock(
162
+ "span",
163
+ _hoisted_4,
164
+ vue.toDisplayString(__props.currency),
165
+ 1
166
+ /* TEXT */
167
+ )) : vue.createCommentVNode("v-if", true),
168
+ vue.createElementVNode("input", {
169
+ id: inputId,
170
+ ref_key: "inputRef",
171
+ ref: inputRef,
172
+ type: "text",
173
+ inputmode: "decimal",
174
+ class: "yc-input__inner is-mono yc-money-input__inner",
175
+ value: displayValue.value,
176
+ placeholder: __props.placeholder,
177
+ disabled: __props.disabled,
178
+ readonly: __props.readonly,
179
+ onInput,
180
+ onFocus,
181
+ onBlur
182
+ }, null, 40, _hoisted_5),
183
+ showClear.value || __props.unit ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_6, [
184
+ showClear.value ? (vue.openBlock(), vue.createElementBlock(
185
+ "button",
186
+ {
187
+ key: 0,
188
+ type: "button",
189
+ class: "yc-input__icon-btn",
190
+ tabindex: "-1",
191
+ "aria-label": "\u6E05\u7A7A",
192
+ onMousedown: _cache[0] || (_cache[0] = vue.withModifiers(() => {
193
+ }, ["prevent"])),
194
+ onClick: vue.withModifiers(clearValue, ["stop"])
195
+ },
196
+ [..._cache[1] || (_cache[1] = [
197
+ vue.createElementVNode(
198
+ "svg",
199
+ {
200
+ viewBox: "0 0 24 24",
201
+ width: "13",
202
+ height: "13",
203
+ fill: "none",
204
+ stroke: "currentColor",
205
+ "stroke-width": "2",
206
+ "stroke-linecap": "round"
207
+ },
208
+ [
209
+ vue.createElementVNode("path", { d: "M18 6 6 18M6 6l12 12" })
210
+ ],
211
+ -1
212
+ /* CACHED */
213
+ )
214
+ ])],
215
+ 32
216
+ /* NEED_HYDRATION */
217
+ )) : vue.createCommentVNode("v-if", true),
218
+ __props.unit ? (vue.openBlock(), vue.createElementBlock(
219
+ "span",
220
+ _hoisted_7,
221
+ vue.toDisplayString(__props.unit),
222
+ 1
223
+ /* TEXT */
224
+ )) : vue.createCommentVNode("v-if", true)
225
+ ])) : vue.createCommentVNode("v-if", true)
226
+ ])
227
+ ]),
228
+ __props.error || __props.hint ? (vue.openBlock(), vue.createElementBlock(
229
+ "p",
230
+ {
231
+ key: 1,
232
+ class: vue.normalizeClass(["yc-field__message", { "is-error": !!__props.error }])
233
+ },
234
+ vue.toDisplayString(__props.error || __props.hint),
235
+ 3
236
+ /* TEXT, CLASS */
237
+ )) : vue.createCommentVNode("v-if", true)
238
+ ],
239
+ 2
240
+ /* CLASS */
241
+ );
242
+ };
243
+ }
244
+ });
245
+
246
+ exports.default = _sfc_main;
@@ -0,0 +1,9 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var stepperInput_vue_vue_type_script_setup_true_lang = require('./stepper-input2.vue.js');
6
+
7
+
8
+
9
+ exports.default = stepperInput_vue_vue_type_script_setup_true_lang.default;
@@ -0,0 +1,215 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var vue = require('vue');
6
+
7
+ const _hoisted_1 = {
8
+ key: 0,
9
+ class: "yc-field__top"
10
+ };
11
+ const _hoisted_2 = { class: "yc-stepper__control" };
12
+ const _hoisted_3 = ["disabled"];
13
+ const _hoisted_4 = { class: "yc-stepper__value-wrap" };
14
+ const _hoisted_5 = ["value", "placeholder", "disabled", "readonly"];
15
+ const _hoisted_6 = {
16
+ key: 0,
17
+ class: "yc-stepper__unit"
18
+ };
19
+ const _hoisted_7 = ["disabled"];
20
+ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
21
+ ...{
22
+ name: "YcStepperInput"
23
+ },
24
+ __name: "stepper-input",
25
+ props: {
26
+ modelValue: { default: 0 },
27
+ label: {},
28
+ hint: {},
29
+ error: {},
30
+ min: {},
31
+ max: {},
32
+ step: { default: 1 },
33
+ precision: { default: 0 },
34
+ unit: {},
35
+ size: { default: "default" },
36
+ disabled: { type: Boolean, default: false },
37
+ readonly: { type: Boolean, default: false },
38
+ placeholder: { default: "0" }
39
+ },
40
+ emits: ["update:modelValue", "change"],
41
+ setup(__props, { emit: __emit }) {
42
+ let uid = 0;
43
+ const stepperId = `yc-stepper-${++uid}`;
44
+ const props = __props;
45
+ const emit = __emit;
46
+ const focused = vue.ref(false);
47
+ const normalize = (val) => {
48
+ let next = val;
49
+ if (props.min !== void 0 && next < props.min) next = props.min;
50
+ if (props.max !== void 0 && next > props.max) next = props.max;
51
+ const factor = 10 ** props.precision;
52
+ return Math.round(next * factor) / factor;
53
+ };
54
+ const current = vue.computed(
55
+ () => props.modelValue === null || props.modelValue === void 0 || Number.isNaN(Number(props.modelValue)) ? null : Number(props.modelValue)
56
+ );
57
+ const displayText = vue.computed(() => {
58
+ if (current.value === null) return "";
59
+ return props.precision > 0 ? current.value.toFixed(props.precision) : String(current.value);
60
+ });
61
+ const canDecrease = vue.computed(() => {
62
+ var _a;
63
+ return props.min === void 0 || ((_a = current.value) != null ? _a : 0) > props.min;
64
+ });
65
+ const canIncrease = vue.computed(() => {
66
+ var _a;
67
+ return props.max === void 0 || ((_a = current.value) != null ? _a : 0) < props.max;
68
+ });
69
+ const stepBy = (dir) => {
70
+ var _a, _b;
71
+ if (props.disabled || props.readonly) return;
72
+ const base = (_b = (_a = current.value) != null ? _a : props.min) != null ? _b : 0;
73
+ const next = normalize(base + dir * props.step);
74
+ emit("update:modelValue", next);
75
+ emit("change", next);
76
+ };
77
+ const onInput = (event) => {
78
+ const raw = event.target.value.replace(/[^\d.-]/g, "");
79
+ if (!raw || raw === "-" || raw === ".") {
80
+ emit("update:modelValue", null);
81
+ return;
82
+ }
83
+ const num = Number(raw);
84
+ if (Number.isFinite(num)) {
85
+ emit("update:modelValue", normalize(num));
86
+ }
87
+ };
88
+ const onBlur = () => {
89
+ focused.value = false;
90
+ if (current.value !== null) {
91
+ const settled = normalize(current.value);
92
+ emit("update:modelValue", settled);
93
+ emit("change", settled);
94
+ }
95
+ };
96
+ return (_ctx, _cache) => {
97
+ return vue.openBlock(), vue.createElementBlock(
98
+ "div",
99
+ {
100
+ class: vue.normalizeClass(["yc-field yc-stepper", [
101
+ `is-size-${__props.size}`,
102
+ `is-status-${__props.error ? "error" : "default"}`,
103
+ { "is-disabled": __props.disabled, "is-focused": focused.value }
104
+ ]])
105
+ },
106
+ [
107
+ __props.label ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
108
+ vue.createElementVNode(
109
+ "label",
110
+ {
111
+ class: "yc-field__label",
112
+ for: stepperId
113
+ },
114
+ vue.toDisplayString(__props.label),
115
+ 1
116
+ /* TEXT */
117
+ )
118
+ ])) : vue.createCommentVNode("v-if", true),
119
+ vue.createElementVNode("div", _hoisted_2, [
120
+ vue.createElementVNode("button", {
121
+ type: "button",
122
+ class: "yc-stepper__btn is-minus",
123
+ disabled: __props.disabled || __props.readonly || !canDecrease.value,
124
+ "aria-label": "\u51CF\u5C11",
125
+ onClick: _cache[0] || (_cache[0] = ($event) => stepBy(-1))
126
+ }, [..._cache[5] || (_cache[5] = [
127
+ vue.createElementVNode(
128
+ "svg",
129
+ {
130
+ viewBox: "0 0 24 24",
131
+ width: "13",
132
+ height: "13",
133
+ fill: "none",
134
+ stroke: "currentColor",
135
+ "stroke-width": "2",
136
+ "stroke-linecap": "round"
137
+ },
138
+ [
139
+ vue.createElementVNode("path", { d: "M5 12h14" })
140
+ ],
141
+ -1
142
+ /* CACHED */
143
+ )
144
+ ])], 8, _hoisted_3),
145
+ vue.createElementVNode("div", _hoisted_4, [
146
+ vue.createElementVNode("input", {
147
+ id: stepperId,
148
+ type: "text",
149
+ inputmode: "decimal",
150
+ class: "yc-stepper__inner",
151
+ value: displayText.value,
152
+ placeholder: __props.placeholder,
153
+ disabled: __props.disabled,
154
+ readonly: __props.readonly,
155
+ onInput,
156
+ onFocus: _cache[1] || (_cache[1] = ($event) => focused.value = true),
157
+ onBlur,
158
+ onKeydown: [
159
+ _cache[2] || (_cache[2] = vue.withKeys(vue.withModifiers(($event) => stepBy(1), ["prevent"]), ["up"])),
160
+ _cache[3] || (_cache[3] = vue.withKeys(vue.withModifiers(($event) => stepBy(-1), ["prevent"]), ["down"]))
161
+ ]
162
+ }, null, 40, _hoisted_5),
163
+ __props.unit ? (vue.openBlock(), vue.createElementBlock(
164
+ "span",
165
+ _hoisted_6,
166
+ vue.toDisplayString(__props.unit),
167
+ 1
168
+ /* TEXT */
169
+ )) : vue.createCommentVNode("v-if", true)
170
+ ]),
171
+ vue.createElementVNode("button", {
172
+ type: "button",
173
+ class: "yc-stepper__btn is-plus",
174
+ disabled: __props.disabled || __props.readonly || !canIncrease.value,
175
+ "aria-label": "\u589E\u52A0",
176
+ onClick: _cache[4] || (_cache[4] = ($event) => stepBy(1))
177
+ }, [..._cache[6] || (_cache[6] = [
178
+ vue.createElementVNode(
179
+ "svg",
180
+ {
181
+ viewBox: "0 0 24 24",
182
+ width: "13",
183
+ height: "13",
184
+ fill: "none",
185
+ stroke: "currentColor",
186
+ "stroke-width": "2",
187
+ "stroke-linecap": "round"
188
+ },
189
+ [
190
+ vue.createElementVNode("path", { d: "M12 5v14M5 12h14" })
191
+ ],
192
+ -1
193
+ /* CACHED */
194
+ )
195
+ ])], 8, _hoisted_7)
196
+ ]),
197
+ __props.error || __props.hint ? (vue.openBlock(), vue.createElementBlock(
198
+ "p",
199
+ {
200
+ key: 1,
201
+ class: vue.normalizeClass(["yc-field__message", { "is-error": !!__props.error }])
202
+ },
203
+ vue.toDisplayString(__props.error || __props.hint),
204
+ 3
205
+ /* TEXT, CLASS */
206
+ )) : vue.createCommentVNode("v-if", true)
207
+ ],
208
+ 2
209
+ /* CLASS */
210
+ );
211
+ };
212
+ }
213
+ });
214
+
215
+ exports.default = _sfc_main;
@@ -0,0 +1,9 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var textarea_vue_vue_type_script_setup_true_lang = require('./textarea2.vue.js');
6
+
7
+
8
+
9
+ exports.default = textarea_vue_vue_type_script_setup_true_lang.default;
@@ -0,0 +1,162 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var vue = require('vue');
6
+
7
+ const _hoisted_1 = {
8
+ key: 0,
9
+ class: "yc-field__top"
10
+ };
11
+ const _hoisted_2 = {
12
+ key: 0,
13
+ class: "yc-field__req",
14
+ "aria-hidden": "true"
15
+ };
16
+ const _hoisted_3 = ["rows", "value", "placeholder", "disabled", "readonly", "maxlength"];
17
+ const _hoisted_4 = {
18
+ key: 0,
19
+ class: "yc-textarea__footer"
20
+ };
21
+ const _hoisted_5 = {
22
+ key: 0,
23
+ class: "yc-textarea__count"
24
+ };
25
+ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
26
+ ...{
27
+ name: "YcTextarea"
28
+ },
29
+ __name: "textarea",
30
+ props: {
31
+ modelValue: { default: "" },
32
+ label: {},
33
+ hint: {},
34
+ error: {},
35
+ placeholder: {},
36
+ rows: { default: 3 },
37
+ maxRows: { default: 8 },
38
+ autoResize: { type: Boolean, default: true },
39
+ maxlength: {},
40
+ showCount: { type: Boolean, default: true },
41
+ variant: { default: "outline" },
42
+ disabled: { type: Boolean, default: false },
43
+ readonly: { type: Boolean, default: false },
44
+ required: { type: Boolean, default: false }
45
+ },
46
+ emits: ["update:modelValue", "input", "change", "focus", "blur"],
47
+ setup(__props, { emit: __emit }) {
48
+ let uid = 0;
49
+ const textareaId = `yc-textarea-${++uid}`;
50
+ const props = __props;
51
+ const emit = __emit;
52
+ const textareaRef = vue.ref(null);
53
+ const focused = vue.ref(false);
54
+ const syncHeight = () => {
55
+ const el = textareaRef.value;
56
+ if (!el || !props.autoResize) return;
57
+ el.style.height = "auto";
58
+ const lineHeight = 20;
59
+ const maxHeight = props.maxRows * lineHeight + 18;
60
+ el.style.height = `${Math.min(el.scrollHeight, maxHeight)}px`;
61
+ };
62
+ vue.onMounted(syncHeight);
63
+ vue.watch(
64
+ () => props.modelValue,
65
+ () => vue.nextTick(syncHeight)
66
+ );
67
+ const focusTextarea = () => {
68
+ var _a;
69
+ if (!props.disabled) (_a = textareaRef.value) == null ? void 0 : _a.focus();
70
+ };
71
+ const onInput = (event) => {
72
+ const next = event.target.value;
73
+ emit("update:modelValue", next);
74
+ emit("input", next);
75
+ vue.nextTick(syncHeight);
76
+ };
77
+ const onFocus = (event) => {
78
+ focused.value = true;
79
+ emit("focus", event);
80
+ };
81
+ const onBlur = (event) => {
82
+ var _a;
83
+ focused.value = false;
84
+ emit("blur", event);
85
+ emit("change", (_a = props.modelValue) != null ? _a : "");
86
+ };
87
+ return (_ctx, _cache) => {
88
+ var _a;
89
+ return vue.openBlock(), vue.createElementBlock(
90
+ "div",
91
+ {
92
+ class: vue.normalizeClass(["yc-field yc-textarea", [
93
+ `is-variant-${__props.variant}`,
94
+ `is-status-${__props.error ? "error" : "default"}`,
95
+ { "is-disabled": __props.disabled, "is-focused": focused.value }
96
+ ]])
97
+ },
98
+ [
99
+ __props.label ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
100
+ vue.createElementVNode("label", {
101
+ class: "yc-field__label",
102
+ for: textareaId
103
+ }, [
104
+ vue.createElementVNode(
105
+ "span",
106
+ null,
107
+ vue.toDisplayString(__props.label),
108
+ 1
109
+ /* TEXT */
110
+ ),
111
+ __props.required ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_2, "*")) : vue.createCommentVNode("v-if", true)
112
+ ])
113
+ ])) : vue.createCommentVNode("v-if", true),
114
+ vue.createElementVNode("div", {
115
+ class: "yc-textarea__box",
116
+ onClick: focusTextarea
117
+ }, [
118
+ vue.createElementVNode("textarea", {
119
+ id: textareaId,
120
+ ref_key: "textareaRef",
121
+ ref: textareaRef,
122
+ class: "yc-textarea__inner",
123
+ rows: __props.rows,
124
+ value: __props.modelValue,
125
+ placeholder: __props.placeholder,
126
+ disabled: __props.disabled,
127
+ readonly: __props.readonly,
128
+ maxlength: __props.maxlength,
129
+ onInput,
130
+ onFocus,
131
+ onBlur
132
+ }, null, 40, _hoisted_3),
133
+ __props.showCount && __props.maxlength || _ctx.$slots.footer ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4, [
134
+ vue.renderSlot(_ctx.$slots, "footer"),
135
+ __props.showCount && __props.maxlength ? (vue.openBlock(), vue.createElementBlock(
136
+ "span",
137
+ _hoisted_5,
138
+ vue.toDisplayString(((_a = __props.modelValue) != null ? _a : "").length) + " / " + vue.toDisplayString(__props.maxlength),
139
+ 1
140
+ /* TEXT */
141
+ )) : vue.createCommentVNode("v-if", true)
142
+ ])) : vue.createCommentVNode("v-if", true)
143
+ ]),
144
+ __props.error || __props.hint ? (vue.openBlock(), vue.createElementBlock(
145
+ "p",
146
+ {
147
+ key: 1,
148
+ class: vue.normalizeClass(["yc-field__message", { "is-error": !!__props.error }])
149
+ },
150
+ vue.toDisplayString(__props.error || __props.hint),
151
+ 3
152
+ /* TEXT, CLASS */
153
+ )) : vue.createCommentVNode("v-if", true)
154
+ ],
155
+ 2
156
+ /* CLASS */
157
+ );
158
+ };
159
+ }
160
+ });
161
+
162
+ exports.default = _sfc_main;
@@ -0,0 +1,2 @@
1
+ 'use strict';
2
+