@yh-ui/components 0.1.21 → 0.1.23

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 (485) hide show
  1. package/README.md +2 -0
  2. package/dist/breadcrumb/src/breadcrumb-item.vue +10 -6
  3. package/dist/form/index.cjs +1 -1
  4. package/dist/form/index.d.ts +1 -1
  5. package/dist/form/index.mjs +1 -1
  6. package/dist/icon/index.cjs +1 -1
  7. package/dist/icon/index.d.ts +1 -1
  8. package/dist/icon/index.mjs +1 -1
  9. package/dist/loading/index.cjs +1 -1
  10. package/dist/loading/index.d.ts +1 -1
  11. package/dist/loading/index.mjs +1 -1
  12. package/dist/message/src/method.cjs +1 -1
  13. package/dist/message/src/method.d.ts +1 -1
  14. package/dist/message/src/method.mjs +1 -1
  15. package/dist/message-box/index.cjs +1 -1
  16. package/dist/message-box/index.d.ts +1 -1
  17. package/dist/message-box/index.mjs +1 -1
  18. package/dist/notification/src/method.cjs +1 -1
  19. package/dist/notification/src/method.d.ts +1 -1
  20. package/dist/notification/src/method.mjs +1 -1
  21. package/dist/resolver.cjs +1 -1
  22. package/dist/resolver.d.ts +7 -5
  23. package/dist/resolver.mjs +1 -1
  24. package/dist/style.css +584 -0
  25. package/package.json +9 -8
  26. package/dist/affix/__tests__/affix.bottom.test.cjs +0 -101
  27. package/dist/affix/__tests__/affix.bottom.test.mjs +0 -88
  28. package/dist/affix/__tests__/affix.ssr.test.cjs +0 -38
  29. package/dist/affix/__tests__/affix.ssr.test.mjs +0 -51
  30. package/dist/affix/__tests__/affix.test.cjs +0 -185
  31. package/dist/affix/__tests__/affix.test.mjs +0 -180
  32. package/dist/ai-action-group/__tests__/ai-action-group.ssr.test.cjs +0 -55
  33. package/dist/ai-action-group/__tests__/ai-action-group.ssr.test.mjs +0 -39
  34. package/dist/ai-action-group/__tests__/ai-action-group.test.cjs +0 -235
  35. package/dist/ai-action-group/__tests__/ai-action-group.test.mjs +0 -157
  36. package/dist/ai-agent-card/__tests__/ai-agent-card.ssr.test.cjs +0 -61
  37. package/dist/ai-agent-card/__tests__/ai-agent-card.ssr.test.mjs +0 -65
  38. package/dist/ai-agent-card/__tests__/ai-agent-card.test.cjs +0 -205
  39. package/dist/ai-agent-card/__tests__/ai-agent-card.test.mjs +0 -133
  40. package/dist/ai-artifacts/__tests__/ai-artifacts.ssr.test.cjs +0 -73
  41. package/dist/ai-artifacts/__tests__/ai-artifacts.ssr.test.mjs +0 -68
  42. package/dist/ai-artifacts/__tests__/ai-artifacts.test.cjs +0 -128
  43. package/dist/ai-artifacts/__tests__/ai-artifacts.test.mjs +0 -109
  44. package/dist/ai-attachments/__tests__/ai-attachments.ssr.test.cjs +0 -50
  45. package/dist/ai-attachments/__tests__/ai-attachments.ssr.test.mjs +0 -33
  46. package/dist/ai-attachments/__tests__/ai-attachments.test.cjs +0 -113
  47. package/dist/ai-attachments/__tests__/ai-attachments.test.mjs +0 -81
  48. package/dist/ai-bubble/__tests__/ai-bubble.ssr.test.cjs +0 -95
  49. package/dist/ai-bubble/__tests__/ai-bubble.ssr.test.mjs +0 -66
  50. package/dist/ai-bubble/__tests__/ai-bubble.test.cjs +0 -624
  51. package/dist/ai-bubble/__tests__/ai-bubble.test.mjs +0 -393
  52. package/dist/ai-bubble-list/__tests__/ai-bubble-list.ssr.test.cjs +0 -51
  53. package/dist/ai-bubble-list/__tests__/ai-bubble-list.ssr.test.mjs +0 -51
  54. package/dist/ai-bubble-list/__tests__/ai-bubble-list.test.cjs +0 -138
  55. package/dist/ai-bubble-list/__tests__/ai-bubble-list.test.mjs +0 -112
  56. package/dist/ai-chat/__tests__/ai-chat.ssr.test.cjs +0 -90
  57. package/dist/ai-chat/__tests__/ai-chat.ssr.test.mjs +0 -77
  58. package/dist/ai-chat/__tests__/ai-chat.test.cjs +0 -177
  59. package/dist/ai-chat/__tests__/ai-chat.test.mjs +0 -129
  60. package/dist/ai-code-block/__tests__/ai-code-block.ssr.test.cjs +0 -75
  61. package/dist/ai-code-block/__tests__/ai-code-block.ssr.test.mjs +0 -57
  62. package/dist/ai-code-block/__tests__/ai-code-block.test.cjs +0 -174
  63. package/dist/ai-code-block/__tests__/ai-code-block.test.mjs +0 -108
  64. package/dist/ai-code-editor/__tests__/ai-code-editor.ssr.test.cjs +0 -46
  65. package/dist/ai-code-editor/__tests__/ai-code-editor.ssr.test.mjs +0 -39
  66. package/dist/ai-code-editor/__tests__/ai-code-editor.test.cjs +0 -90
  67. package/dist/ai-code-editor/__tests__/ai-code-editor.test.mjs +0 -78
  68. package/dist/ai-code-runner/__tests__/ai-code-runner.ssr.test.cjs +0 -28
  69. package/dist/ai-code-runner/__tests__/ai-code-runner.ssr.test.mjs +0 -26
  70. package/dist/ai-code-runner/__tests__/ai-code-runner.test.cjs +0 -69
  71. package/dist/ai-code-runner/__tests__/ai-code-runner.test.mjs +0 -66
  72. package/dist/ai-conversations/__tests__/ai-conversations.ssr.test.cjs +0 -50
  73. package/dist/ai-conversations/__tests__/ai-conversations.ssr.test.mjs +0 -42
  74. package/dist/ai-conversations/__tests__/ai-conversations.test.cjs +0 -67
  75. package/dist/ai-conversations/__tests__/ai-conversations.test.mjs +0 -51
  76. package/dist/ai-editor-sender/__tests__/ai-editor-sender.ssr.test.cjs +0 -62
  77. package/dist/ai-editor-sender/__tests__/ai-editor-sender.ssr.test.mjs +0 -50
  78. package/dist/ai-editor-sender/__tests__/ai-editor-sender.test.cjs +0 -315
  79. package/dist/ai-editor-sender/__tests__/ai-editor-sender.test.mjs +0 -226
  80. package/dist/ai-file-card/__tests__/ai-file-card.ssr.test.cjs +0 -45
  81. package/dist/ai-file-card/__tests__/ai-file-card.ssr.test.mjs +0 -29
  82. package/dist/ai-file-card/__tests__/ai-file-card.test.cjs +0 -160
  83. package/dist/ai-file-card/__tests__/ai-file-card.test.mjs +0 -109
  84. package/dist/ai-mention/__tests__/ai-mention.ssr.test.cjs +0 -38
  85. package/dist/ai-mention/__tests__/ai-mention.ssr.test.mjs +0 -37
  86. package/dist/ai-mention/__tests__/ai-mention.test.cjs +0 -113
  87. package/dist/ai-mention/__tests__/ai-mention.test.mjs +0 -84
  88. package/dist/ai-mermaid/__tests__/ai-mermaid.ssr.test.cjs +0 -43
  89. package/dist/ai-mermaid/__tests__/ai-mermaid.ssr.test.mjs +0 -33
  90. package/dist/ai-mermaid/__tests__/ai-mermaid.test.cjs +0 -113
  91. package/dist/ai-mermaid/__tests__/ai-mermaid.test.mjs +0 -92
  92. package/dist/ai-prompts/__tests__/ai-prompts.ssr.test.cjs +0 -49
  93. package/dist/ai-prompts/__tests__/ai-prompts.ssr.test.mjs +0 -41
  94. package/dist/ai-prompts/__tests__/ai-prompts.test.cjs +0 -54
  95. package/dist/ai-prompts/__tests__/ai-prompts.test.mjs +0 -38
  96. package/dist/ai-provider/__tests__/ai-provider.ssr.test.cjs +0 -33
  97. package/dist/ai-provider/__tests__/ai-provider.ssr.test.mjs +0 -34
  98. package/dist/ai-provider/__tests__/ai-provider.test.cjs +0 -38
  99. package/dist/ai-provider/__tests__/ai-provider.test.mjs +0 -33
  100. package/dist/ai-sender/__tests__/ai-sender.ssr.test.cjs +0 -46
  101. package/dist/ai-sender/__tests__/ai-sender.ssr.test.mjs +0 -37
  102. package/dist/ai-sender/__tests__/ai-sender.test.cjs +0 -511
  103. package/dist/ai-sender/__tests__/ai-sender.test.mjs +0 -322
  104. package/dist/ai-sources/__tests__/ai-sources.ssr.test.cjs +0 -72
  105. package/dist/ai-sources/__tests__/ai-sources.ssr.test.mjs +0 -82
  106. package/dist/ai-sources/__tests__/ai-sources.test.cjs +0 -200
  107. package/dist/ai-sources/__tests__/ai-sources.test.mjs +0 -160
  108. package/dist/ai-thinking/__tests__/ai-thinking.ssr.test.cjs +0 -56
  109. package/dist/ai-thinking/__tests__/ai-thinking.ssr.test.mjs +0 -42
  110. package/dist/ai-thinking/__tests__/ai-thinking.test.cjs +0 -151
  111. package/dist/ai-thinking/__tests__/ai-thinking.test.mjs +0 -96
  112. package/dist/ai-thought-chain/__tests__/ai-thought-chain.ssr.test.cjs +0 -88
  113. package/dist/ai-thought-chain/__tests__/ai-thought-chain.ssr.test.mjs +0 -55
  114. package/dist/ai-thought-chain/__tests__/ai-thought-chain.test.cjs +0 -344
  115. package/dist/ai-thought-chain/__tests__/ai-thought-chain.test.mjs +0 -237
  116. package/dist/ai-voice-trigger/__tests__/ai-voice-trigger.ssr.test.cjs +0 -32
  117. package/dist/ai-voice-trigger/__tests__/ai-voice-trigger.ssr.test.mjs +0 -25
  118. package/dist/ai-voice-trigger/__tests__/ai-voice-trigger.test.cjs +0 -130
  119. package/dist/ai-voice-trigger/__tests__/ai-voice-trigger.test.mjs +0 -103
  120. package/dist/ai-welcome/__tests__/ai-welcome.ssr.test.cjs +0 -57
  121. package/dist/ai-welcome/__tests__/ai-welcome.ssr.test.mjs +0 -39
  122. package/dist/ai-welcome/__tests__/ai-welcome.test.cjs +0 -169
  123. package/dist/ai-welcome/__tests__/ai-welcome.test.mjs +0 -113
  124. package/dist/alert/__tests__/alert.ssr.test.cjs +0 -28
  125. package/dist/alert/__tests__/alert.ssr.test.mjs +0 -29
  126. package/dist/alert/__tests__/alert.test.cjs +0 -123
  127. package/dist/alert/__tests__/alert.test.mjs +0 -110
  128. package/dist/autocomplete/__tests__/autocomplete.ssr.test.cjs +0 -54
  129. package/dist/autocomplete/__tests__/autocomplete.ssr.test.mjs +0 -47
  130. package/dist/autocomplete/__tests__/autocomplete.test.cjs +0 -299
  131. package/dist/autocomplete/__tests__/autocomplete.test.mjs +0 -263
  132. package/dist/avatar/__tests__/avatar.ssr.test.cjs +0 -103
  133. package/dist/avatar/__tests__/avatar.ssr.test.mjs +0 -108
  134. package/dist/avatar/__tests__/avatar.test.cjs +0 -146
  135. package/dist/avatar/__tests__/avatar.test.mjs +0 -125
  136. package/dist/back-top/__tests__/back-top.ssr.test.cjs +0 -13
  137. package/dist/back-top/__tests__/back-top.ssr.test.mjs +0 -10
  138. package/dist/back-top/__tests__/back-top.test.cjs +0 -88
  139. package/dist/back-top/__tests__/back-top.test.mjs +0 -76
  140. package/dist/badge/__tests__/badge.ssr.test.cjs +0 -36
  141. package/dist/badge/__tests__/badge.ssr.test.mjs +0 -33
  142. package/dist/badge/__tests__/badge.test.cjs +0 -115
  143. package/dist/badge/__tests__/badge.test.mjs +0 -112
  144. package/dist/breadcrumb/__tests__/breadcrumb.ssr.test.cjs +0 -22
  145. package/dist/breadcrumb/__tests__/breadcrumb.ssr.test.mjs +0 -20
  146. package/dist/breadcrumb/__tests__/breadcrumb.test.cjs +0 -64
  147. package/dist/breadcrumb/__tests__/breadcrumb.test.mjs +0 -51
  148. package/dist/button/__tests__/button.ssr.test.cjs +0 -52
  149. package/dist/button/__tests__/button.ssr.test.mjs +0 -55
  150. package/dist/button/__tests__/button.test.cjs +0 -207
  151. package/dist/button/__tests__/button.test.mjs +0 -141
  152. package/dist/calendar/__tests__/calendar.ssr.test.cjs +0 -65
  153. package/dist/calendar/__tests__/calendar.ssr.test.mjs +0 -63
  154. package/dist/calendar/__tests__/calendar.test.cjs +0 -263
  155. package/dist/calendar/__tests__/calendar.test.mjs +0 -255
  156. package/dist/card/__tests__/card.ssr.test.cjs +0 -37
  157. package/dist/card/__tests__/card.ssr.test.mjs +0 -40
  158. package/dist/card/__tests__/card.test.cjs +0 -131
  159. package/dist/card/__tests__/card.test.mjs +0 -124
  160. package/dist/carousel/__tests__/carousel.ssr.test.cjs +0 -27
  161. package/dist/carousel/__tests__/carousel.ssr.test.mjs +0 -27
  162. package/dist/carousel/__tests__/carousel.test.cjs +0 -115
  163. package/dist/carousel/__tests__/carousel.test.mjs +0 -98
  164. package/dist/cascader/__tests__/cascader-panel.test.cjs +0 -162
  165. package/dist/cascader/__tests__/cascader-panel.test.mjs +0 -151
  166. package/dist/cascader/__tests__/cascader.ssr.test.cjs +0 -61
  167. package/dist/cascader/__tests__/cascader.ssr.test.mjs +0 -55
  168. package/dist/cascader/__tests__/cascader.test.cjs +0 -342
  169. package/dist/cascader/__tests__/cascader.test.mjs +0 -316
  170. package/dist/category-nav/__tests__/category-nav.ssr.test.cjs +0 -35
  171. package/dist/category-nav/__tests__/category-nav.ssr.test.mjs +0 -21
  172. package/dist/category-nav/__tests__/category-nav.test.cjs +0 -53
  173. package/dist/category-nav/__tests__/category-nav.test.mjs +0 -33
  174. package/dist/checkbox/__tests__/checkbox.ssr.test.cjs +0 -52
  175. package/dist/checkbox/__tests__/checkbox.ssr.test.mjs +0 -57
  176. package/dist/checkbox/__tests__/checkbox.test.cjs +0 -173
  177. package/dist/checkbox/__tests__/checkbox.test.mjs +0 -133
  178. package/dist/col/__tests__/col.ssr.test.cjs +0 -44
  179. package/dist/col/__tests__/col.ssr.test.mjs +0 -42
  180. package/dist/col/__tests__/col.test.cjs +0 -128
  181. package/dist/col/__tests__/col.test.mjs +0 -116
  182. package/dist/color-picker/__tests__/color-picker.ssr.test.cjs +0 -34
  183. package/dist/color-picker/__tests__/color-picker.ssr.test.mjs +0 -39
  184. package/dist/color-picker/__tests__/color-picker.test.cjs +0 -227
  185. package/dist/color-picker/__tests__/color-picker.test.mjs +0 -176
  186. package/dist/config-provider/__tests__/config-provider.ssr.test.cjs +0 -43
  187. package/dist/config-provider/__tests__/config-provider.ssr.test.mjs +0 -42
  188. package/dist/config-provider/__tests__/config-provider.test.cjs +0 -75
  189. package/dist/config-provider/__tests__/config-provider.test.mjs +0 -64
  190. package/dist/container/__tests__/container.ssr.test.cjs +0 -71
  191. package/dist/container/__tests__/container.ssr.test.mjs +0 -50
  192. package/dist/container/__tests__/container.test.cjs +0 -111
  193. package/dist/container/__tests__/container.test.mjs +0 -84
  194. package/dist/countdown/__tests__/countdown.ssr.test.cjs +0 -86
  195. package/dist/countdown/__tests__/countdown.ssr.test.mjs +0 -78
  196. package/dist/countdown/__tests__/countdown.test.cjs +0 -767
  197. package/dist/countdown/__tests__/countdown.test.mjs +0 -722
  198. package/dist/coupon-card/__tests__/coupon-card.ssr.test.cjs +0 -21
  199. package/dist/coupon-card/__tests__/coupon-card.ssr.test.mjs +0 -18
  200. package/dist/coupon-card/__tests__/coupon-card.test.cjs +0 -67
  201. package/dist/coupon-card/__tests__/coupon-card.test.mjs +0 -64
  202. package/dist/date-picker/__tests__/date-picker-extended.test.cjs +0 -581
  203. package/dist/date-picker/__tests__/date-picker-extended.test.mjs +0 -455
  204. package/dist/date-picker/__tests__/date-picker.ssr.test.cjs +0 -26
  205. package/dist/date-picker/__tests__/date-picker.ssr.test.mjs +0 -23
  206. package/dist/date-picker/__tests__/date-picker.test.cjs +0 -170
  207. package/dist/date-picker/__tests__/date-picker.test.mjs +0 -136
  208. package/dist/descriptions/__tests__/descriptions.ssr.test.cjs +0 -67
  209. package/dist/descriptions/__tests__/descriptions.ssr.test.mjs +0 -72
  210. package/dist/descriptions/__tests__/descriptions.test.cjs +0 -150
  211. package/dist/descriptions/__tests__/descriptions.test.mjs +0 -130
  212. package/dist/dialog/__tests__/dialog.functional.test.cjs +0 -49
  213. package/dist/dialog/__tests__/dialog.functional.test.mjs +0 -49
  214. package/dist/dialog/__tests__/dialog.ssr.test.cjs +0 -31
  215. package/dist/dialog/__tests__/dialog.ssr.test.mjs +0 -29
  216. package/dist/dialog/__tests__/dialog.test.cjs +0 -561
  217. package/dist/dialog/__tests__/dialog.test.mjs +0 -388
  218. package/dist/divider/__tests__/divider.ssr.test.cjs +0 -41
  219. package/dist/divider/__tests__/divider.ssr.test.mjs +0 -44
  220. package/dist/divider/__tests__/divider.test.cjs +0 -71
  221. package/dist/divider/__tests__/divider.test.mjs +0 -68
  222. package/dist/drawer/__tests__/drawer.ssr.test.cjs +0 -25
  223. package/dist/drawer/__tests__/drawer.ssr.test.mjs +0 -23
  224. package/dist/drawer/__tests__/drawer.test.cjs +0 -145
  225. package/dist/drawer/__tests__/drawer.test.mjs +0 -122
  226. package/dist/dropdown/__tests__/dropdown.ssr.test.cjs +0 -49
  227. package/dist/dropdown/__tests__/dropdown.ssr.test.mjs +0 -64
  228. package/dist/dropdown/__tests__/dropdown.test.cjs +0 -310
  229. package/dist/dropdown/__tests__/dropdown.test.mjs +0 -269
  230. package/dist/empty/__tests__/empty.ssr.test.cjs +0 -96
  231. package/dist/empty/__tests__/empty.ssr.test.mjs +0 -99
  232. package/dist/empty/__tests__/empty.test.cjs +0 -110
  233. package/dist/empty/__tests__/empty.test.mjs +0 -101
  234. package/dist/filter-bar/__tests__/filter-bar.ssr.test.cjs +0 -29
  235. package/dist/filter-bar/__tests__/filter-bar.ssr.test.mjs +0 -16
  236. package/dist/filter-bar/__tests__/filter-bar.test.cjs +0 -51
  237. package/dist/filter-bar/__tests__/filter-bar.test.mjs +0 -29
  238. package/dist/form/__tests__/form-schema.test.cjs +0 -636
  239. package/dist/form/__tests__/form-schema.test.mjs +0 -366
  240. package/dist/form/__tests__/form.ssr.test.cjs +0 -74
  241. package/dist/form/__tests__/form.ssr.test.mjs +0 -73
  242. package/dist/form/__tests__/form.test.cjs +0 -208
  243. package/dist/form/__tests__/form.test.mjs +0 -128
  244. package/dist/gantt-chart/__tests__/debug_ssr.test.cjs +0 -51
  245. package/dist/gantt-chart/__tests__/debug_ssr.test.mjs +0 -37
  246. package/dist/gantt-chart/__tests__/gantt-chart.ssr.test.cjs +0 -95
  247. package/dist/gantt-chart/__tests__/gantt-chart.ssr.test.mjs +0 -94
  248. package/dist/gantt-chart/__tests__/gantt-chart.test.cjs +0 -86
  249. package/dist/gantt-chart/__tests__/gantt-chart.test.mjs +0 -79
  250. package/dist/grid/__tests__/grid.ssr.test.cjs +0 -81
  251. package/dist/grid/__tests__/grid.ssr.test.mjs +0 -63
  252. package/dist/grid/__tests__/grid.test.cjs +0 -142
  253. package/dist/grid/__tests__/grid.test.mjs +0 -89
  254. package/dist/icon/__tests__/icon.ssr.test.cjs +0 -35
  255. package/dist/icon/__tests__/icon.ssr.test.mjs +0 -26
  256. package/dist/icon/__tests__/icon.test.cjs +0 -144
  257. package/dist/icon/__tests__/icon.test.mjs +0 -123
  258. package/dist/image/__tests__/image-viewer.test.cjs +0 -101
  259. package/dist/image/__tests__/image-viewer.test.mjs +0 -94
  260. package/dist/image/__tests__/image.ssr.test.cjs +0 -73
  261. package/dist/image/__tests__/image.ssr.test.mjs +0 -72
  262. package/dist/image/__tests__/image.test.cjs +0 -171
  263. package/dist/image/__tests__/image.test.mjs +0 -159
  264. package/dist/image-magnifier/__tests__/image-magnifier.ssr.test.cjs +0 -54
  265. package/dist/image-magnifier/__tests__/image-magnifier.ssr.test.mjs +0 -35
  266. package/dist/image-magnifier/__tests__/image-magnifier.test.cjs +0 -257
  267. package/dist/image-magnifier/__tests__/image-magnifier.test.mjs +0 -177
  268. package/dist/infinite-scroll/__tests__/infinite-scroll.ssr.test.cjs +0 -59
  269. package/dist/infinite-scroll/__tests__/infinite-scroll.ssr.test.mjs +0 -84
  270. package/dist/infinite-scroll/__tests__/infinite-scroll.test.cjs +0 -255
  271. package/dist/infinite-scroll/__tests__/infinite-scroll.test.mjs +0 -187
  272. package/dist/input/__tests__/input-utils.test.cjs +0 -77
  273. package/dist/input/__tests__/input-utils.test.mjs +0 -75
  274. package/dist/input/__tests__/input.ssr.test.cjs +0 -100
  275. package/dist/input/__tests__/input.ssr.test.mjs +0 -85
  276. package/dist/input/__tests__/input.test.cjs +0 -127
  277. package/dist/input/__tests__/input.test.mjs +0 -112
  278. package/dist/input-number/__tests__/input-number.hydration.test.cjs +0 -24
  279. package/dist/input-number/__tests__/input-number.hydration.test.mjs +0 -21
  280. package/dist/input-number/__tests__/input-number.ssr.test.cjs +0 -95
  281. package/dist/input-number/__tests__/input-number.ssr.test.mjs +0 -92
  282. package/dist/input-number/__tests__/input-number.test.cjs +0 -199
  283. package/dist/input-number/__tests__/input-number.test.mjs +0 -173
  284. package/dist/input-tag/__tests__/input-tag.ssr.test.cjs +0 -47
  285. package/dist/input-tag/__tests__/input-tag.ssr.test.mjs +0 -41
  286. package/dist/input-tag/__tests__/input-tag.test.cjs +0 -268
  287. package/dist/input-tag/__tests__/input-tag.test.mjs +0 -201
  288. package/dist/loading/__tests__/loading.ssr.test.cjs +0 -37
  289. package/dist/loading/__tests__/loading.ssr.test.mjs +0 -27
  290. package/dist/loading/__tests__/loading.test.cjs +0 -91
  291. package/dist/loading/__tests__/loading.test.mjs +0 -75
  292. package/dist/lucky-draw/__tests__/lucky-draw.ssr.test.cjs +0 -33
  293. package/dist/lucky-draw/__tests__/lucky-draw.ssr.test.mjs +0 -31
  294. package/dist/lucky-draw/__tests__/lucky-draw.test.cjs +0 -56
  295. package/dist/lucky-draw/__tests__/lucky-draw.test.mjs +0 -48
  296. package/dist/marquee/__tests__/marquee.ssr.test.cjs +0 -59
  297. package/dist/marquee/__tests__/marquee.ssr.test.mjs +0 -60
  298. package/dist/marquee/__tests__/marquee.test.cjs +0 -94
  299. package/dist/marquee/__tests__/marquee.test.mjs +0 -92
  300. package/dist/mention/__tests__/mention.ssr.test.cjs +0 -92
  301. package/dist/mention/__tests__/mention.ssr.test.mjs +0 -70
  302. package/dist/mention/__tests__/mention.test.cjs +0 -650
  303. package/dist/mention/__tests__/mention.test.mjs +0 -523
  304. package/dist/menu/__tests__/menu.ssr.test.cjs +0 -92
  305. package/dist/menu/__tests__/menu.ssr.test.mjs +0 -124
  306. package/dist/menu/__tests__/menu.test.cjs +0 -209
  307. package/dist/menu/__tests__/menu.test.mjs +0 -182
  308. package/dist/message/__tests__/message.ssr.test.cjs +0 -29
  309. package/dist/message/__tests__/message.ssr.test.mjs +0 -23
  310. package/dist/message/__tests__/message.test.cjs +0 -170
  311. package/dist/message/__tests__/message.test.mjs +0 -154
  312. package/dist/message-box/__tests__/message-box.ssr.test.cjs +0 -33
  313. package/dist/message-box/__tests__/message-box.ssr.test.mjs +0 -30
  314. package/dist/message-box/__tests__/message-box.test.cjs +0 -100
  315. package/dist/message-box/__tests__/message-box.test.mjs +0 -95
  316. package/dist/notification/__tests__/notification.ssr.test.cjs +0 -31
  317. package/dist/notification/__tests__/notification.ssr.test.mjs +0 -25
  318. package/dist/notification/__tests__/notification.test.cjs +0 -248
  319. package/dist/notification/__tests__/notification.test.mjs +0 -206
  320. package/dist/pagination/__tests__/pagination.ssr.test.cjs +0 -61
  321. package/dist/pagination/__tests__/pagination.ssr.test.mjs +0 -59
  322. package/dist/pagination/__tests__/pagination.test.cjs +0 -135
  323. package/dist/pagination/__tests__/pagination.test.mjs +0 -131
  324. package/dist/popconfirm/__tests__/popconfirm.ssr.test.cjs +0 -48
  325. package/dist/popconfirm/__tests__/popconfirm.ssr.test.mjs +0 -63
  326. package/dist/popconfirm/__tests__/popconfirm.test.cjs +0 -62
  327. package/dist/popconfirm/__tests__/popconfirm.test.mjs +0 -56
  328. package/dist/popover/__tests__/popover.ssr.test.cjs +0 -48
  329. package/dist/popover/__tests__/popover.ssr.test.mjs +0 -63
  330. package/dist/popover/__tests__/popover.test.cjs +0 -107
  331. package/dist/popover/__tests__/popover.test.mjs +0 -93
  332. package/dist/price/__tests__/price.ssr.test.cjs +0 -20
  333. package/dist/price/__tests__/price.ssr.test.mjs +0 -19
  334. package/dist/price/__tests__/price.test.cjs +0 -45
  335. package/dist/price/__tests__/price.test.mjs +0 -42
  336. package/dist/product-card/__tests__/product-card.ssr.test.cjs +0 -21
  337. package/dist/product-card/__tests__/product-card.ssr.test.mjs +0 -18
  338. package/dist/product-card/__tests__/product-card.test.cjs +0 -54
  339. package/dist/product-card/__tests__/product-card.test.mjs +0 -53
  340. package/dist/progress/__tests__/progress.ssr.test.cjs +0 -31
  341. package/dist/progress/__tests__/progress.ssr.test.mjs +0 -29
  342. package/dist/progress/__tests__/progress.test.cjs +0 -119
  343. package/dist/progress/__tests__/progress.test.mjs +0 -77
  344. package/dist/radio/__tests__/radio-button.test.cjs +0 -99
  345. package/dist/radio/__tests__/radio-button.test.mjs +0 -83
  346. package/dist/radio/__tests__/radio.ssr.test.cjs +0 -132
  347. package/dist/radio/__tests__/radio.ssr.test.mjs +0 -165
  348. package/dist/radio/__tests__/radio.test.cjs +0 -170
  349. package/dist/radio/__tests__/radio.test.mjs +0 -143
  350. package/dist/rate/__tests__/rate.ssr.test.cjs +0 -106
  351. package/dist/rate/__tests__/rate.ssr.test.mjs +0 -103
  352. package/dist/rate/__tests__/rate.test.cjs +0 -88
  353. package/dist/rate/__tests__/rate.test.mjs +0 -85
  354. package/dist/result/__tests__/result.ssr.test.cjs +0 -62
  355. package/dist/result/__tests__/result.ssr.test.mjs +0 -51
  356. package/dist/result/__tests__/result.test.cjs +0 -135
  357. package/dist/result/__tests__/result.test.mjs +0 -92
  358. package/dist/row/__tests__/row.ssr.test.cjs +0 -29
  359. package/dist/row/__tests__/row.ssr.test.mjs +0 -30
  360. package/dist/row/__tests__/row.test.cjs +0 -89
  361. package/dist/row/__tests__/row.test.mjs +0 -86
  362. package/dist/row/__tests__/row_ts.test.cjs +0 -31
  363. package/dist/row/__tests__/row_ts.test.mjs +0 -28
  364. package/dist/scrollbar/__tests__/scrollbar.ssr.test.cjs +0 -49
  365. package/dist/scrollbar/__tests__/scrollbar.ssr.test.mjs +0 -54
  366. package/dist/scrollbar/__tests__/scrollbar.test.cjs +0 -43
  367. package/dist/scrollbar/__tests__/scrollbar.test.mjs +0 -40
  368. package/dist/select/__tests__/select.perf.test.cjs +0 -191
  369. package/dist/select/__tests__/select.perf.test.mjs +0 -185
  370. package/dist/select/__tests__/select.ssr.test.cjs +0 -58
  371. package/dist/select/__tests__/select.ssr.test.mjs +0 -52
  372. package/dist/select/__tests__/select.test.cjs +0 -414
  373. package/dist/select/__tests__/select.test.mjs +0 -345
  374. package/dist/skeleton/__tests__/skeleton.ssr.test.cjs +0 -81
  375. package/dist/skeleton/__tests__/skeleton.ssr.test.mjs +0 -83
  376. package/dist/skeleton/__tests__/skeleton.test.cjs +0 -72
  377. package/dist/skeleton/__tests__/skeleton.test.mjs +0 -65
  378. package/dist/sku-selector/__tests__/sku-selector.ssr.test.cjs +0 -32
  379. package/dist/sku-selector/__tests__/sku-selector.ssr.test.mjs +0 -19
  380. package/dist/sku-selector/__tests__/sku-selector.test.cjs +0 -64
  381. package/dist/sku-selector/__tests__/sku-selector.test.mjs +0 -53
  382. package/dist/slider/__tests__/repro.test.cjs +0 -25
  383. package/dist/slider/__tests__/repro.test.mjs +0 -22
  384. package/dist/slider/__tests__/slider.ssr.test.cjs +0 -118
  385. package/dist/slider/__tests__/slider.ssr.test.mjs +0 -115
  386. package/dist/slider/__tests__/slider.test.cjs +0 -155
  387. package/dist/slider/__tests__/slider.test.mjs +0 -120
  388. package/dist/smart-address/__tests__/smart-address.ssr.test.cjs +0 -28
  389. package/dist/smart-address/__tests__/smart-address.ssr.test.mjs +0 -25
  390. package/dist/smart-address/__tests__/smart-address.test.cjs +0 -68
  391. package/dist/smart-address/__tests__/smart-address.test.mjs +0 -56
  392. package/dist/space/__tests__/space.ssr.test.cjs +0 -115
  393. package/dist/space/__tests__/space.ssr.test.mjs +0 -150
  394. package/dist/space/__tests__/space.test.cjs +0 -227
  395. package/dist/space/__tests__/space.test.mjs +0 -187
  396. package/dist/spin/__tests__/spin.ssr.test.cjs +0 -46
  397. package/dist/spin/__tests__/spin.ssr.test.mjs +0 -43
  398. package/dist/spin/__tests__/spin.test.cjs +0 -65
  399. package/dist/spin/__tests__/spin.test.mjs +0 -63
  400. package/dist/steps/__tests__/steps.ssr.test.cjs +0 -73
  401. package/dist/steps/__tests__/steps.ssr.test.mjs +0 -55
  402. package/dist/steps/__tests__/steps.test.cjs +0 -152
  403. package/dist/steps/__tests__/steps.test.mjs +0 -123
  404. package/dist/submit-bar/__tests__/submit-bar.ssr.test.cjs +0 -21
  405. package/dist/submit-bar/__tests__/submit-bar.ssr.test.mjs +0 -18
  406. package/dist/submit-bar/__tests__/submit-bar.test.cjs +0 -50
  407. package/dist/submit-bar/__tests__/submit-bar.test.mjs +0 -36
  408. package/dist/switch/__tests__/switch.ssr.test.cjs +0 -105
  409. package/dist/switch/__tests__/switch.ssr.test.mjs +0 -102
  410. package/dist/switch/__tests__/switch.test.cjs +0 -251
  411. package/dist/switch/__tests__/switch.test.mjs +0 -193
  412. package/dist/table/__tests__/table-advance.test.cjs +0 -180
  413. package/dist/table/__tests__/table-advance.test.mjs +0 -118
  414. package/dist/table/__tests__/table-interaction.test.cjs +0 -236
  415. package/dist/table/__tests__/table-interaction.test.mjs +0 -162
  416. package/dist/table/__tests__/table-utils.test.cjs +0 -690
  417. package/dist/table/__tests__/table-utils.test.mjs +0 -485
  418. package/dist/table/__tests__/table.perf.test.cjs +0 -231
  419. package/dist/table/__tests__/table.perf.test.mjs +0 -225
  420. package/dist/table/__tests__/table.ssr.test.cjs +0 -296
  421. package/dist/table/__tests__/table.ssr.test.mjs +0 -265
  422. package/dist/table/__tests__/table.test.cjs +0 -682
  423. package/dist/table/__tests__/table.test.mjs +0 -617
  424. package/dist/table/__tests__/use-column-drag.test.cjs +0 -238
  425. package/dist/table/__tests__/use-column-drag.test.mjs +0 -150
  426. package/dist/table/__tests__/use-table-export.test.cjs +0 -179
  427. package/dist/table/__tests__/use-table-export.test.mjs +0 -105
  428. package/dist/table/__tests__/use-table-import.test.cjs +0 -206
  429. package/dist/table/__tests__/use-table-import.test.mjs +0 -144
  430. package/dist/table/__tests__/use-table-print.test.cjs +0 -190
  431. package/dist/table/__tests__/use-table-print.test.mjs +0 -134
  432. package/dist/table/__tests__/use-virtual-scroll.test.cjs +0 -286
  433. package/dist/table/__tests__/use-virtual-scroll.test.mjs +0 -196
  434. package/dist/tabs/__tests__/tabs.ssr.test.cjs +0 -57
  435. package/dist/tabs/__tests__/tabs.ssr.test.mjs +0 -41
  436. package/dist/tabs/__tests__/tabs.test.cjs +0 -171
  437. package/dist/tabs/__tests__/tabs.test.mjs +0 -134
  438. package/dist/tag/__tests__/tag.ssr.test.cjs +0 -45
  439. package/dist/tag/__tests__/tag.ssr.test.mjs +0 -48
  440. package/dist/tag/__tests__/tag.test.cjs +0 -194
  441. package/dist/tag/__tests__/tag.test.mjs +0 -167
  442. package/dist/time-picker/__tests__/time-picker.ssr.test.cjs +0 -46
  443. package/dist/time-picker/__tests__/time-picker.ssr.test.mjs +0 -43
  444. package/dist/time-picker/__tests__/time-picker.test.cjs +0 -228
  445. package/dist/time-picker/__tests__/time-picker.test.mjs +0 -218
  446. package/dist/time-picker/__tests__/time-spinner.test.cjs +0 -196
  447. package/dist/time-picker/__tests__/time-spinner.test.mjs +0 -162
  448. package/dist/time-select/__tests__/time-select.ssr.test.cjs +0 -42
  449. package/dist/time-select/__tests__/time-select.ssr.test.mjs +0 -37
  450. package/dist/time-select/__tests__/time-select.test.cjs +0 -390
  451. package/dist/time-select/__tests__/time-select.test.mjs +0 -374
  452. package/dist/tooltip/__tests__/tooltip.ssr.test.cjs +0 -55
  453. package/dist/tooltip/__tests__/tooltip.ssr.test.mjs +0 -76
  454. package/dist/tooltip/__tests__/tooltip.test.cjs +0 -132
  455. package/dist/tooltip/__tests__/tooltip.test.mjs +0 -121
  456. package/dist/transfer/__tests__/transfer.ssr.test.cjs +0 -47
  457. package/dist/transfer/__tests__/transfer.ssr.test.mjs +0 -44
  458. package/dist/transfer/__tests__/transfer.test.cjs +0 -422
  459. package/dist/transfer/__tests__/transfer.test.mjs +0 -405
  460. package/dist/tree/__tests__/tree.perf.test.cjs +0 -182
  461. package/dist/tree/__tests__/tree.perf.test.mjs +0 -198
  462. package/dist/tree/__tests__/tree.ssr.test.cjs +0 -56
  463. package/dist/tree/__tests__/tree.ssr.test.mjs +0 -45
  464. package/dist/tree/__tests__/tree.test.cjs +0 -488
  465. package/dist/tree/__tests__/tree.test.mjs +0 -333
  466. package/dist/tree-select/__tests__/tree-select.ssr.test.cjs +0 -52
  467. package/dist/tree-select/__tests__/tree-select.ssr.test.mjs +0 -55
  468. package/dist/tree-select/__tests__/tree-select.test.cjs +0 -231
  469. package/dist/tree-select/__tests__/tree-select.test.mjs +0 -189
  470. package/dist/typography/__tests__/typography.ssr.test.cjs +0 -85
  471. package/dist/typography/__tests__/typography.ssr.test.mjs +0 -63
  472. package/dist/typography/__tests__/typography.test.cjs +0 -362
  473. package/dist/typography/__tests__/typography.test.mjs +0 -161
  474. package/dist/upload/__tests__/upload.ssr.test.cjs +0 -28
  475. package/dist/upload/__tests__/upload.ssr.test.mjs +0 -26
  476. package/dist/upload/__tests__/upload.test.cjs +0 -467
  477. package/dist/upload/__tests__/upload.test.mjs +0 -336
  478. package/dist/waterfall/__tests__/waterfall.ssr.test.cjs +0 -38
  479. package/dist/waterfall/__tests__/waterfall.ssr.test.mjs +0 -39
  480. package/dist/waterfall/__tests__/waterfall.test.cjs +0 -122
  481. package/dist/waterfall/__tests__/waterfall.test.mjs +0 -85
  482. package/dist/watermark/__tests__/watermark.ssr.test.cjs +0 -32
  483. package/dist/watermark/__tests__/watermark.ssr.test.mjs +0 -30
  484. package/dist/watermark/__tests__/watermark.test.cjs +0 -127
  485. package/dist/watermark/__tests__/watermark.test.mjs +0 -124
@@ -1,636 +0,0 @@
1
- "use strict";
2
-
3
- var _testUtils = require("@vue/test-utils");
4
- var _vitest = require("vitest");
5
- var _formSchema = _interopRequireDefault(require("../src/form-schema.vue"));
6
- var _vue = require("vue");
7
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
8
- const YhInput = {
9
- name: "YhInput",
10
- props: ["modelValue", "placeholder", "disabled"],
11
- template: `<input class="yh-input" :value="modelValue" @input="$emit('update:modelValue', $event.target.value)" :placeholder="placeholder" :disabled="disabled" />`
12
- };
13
- const YhSelect = {
14
- name: "YhSelect",
15
- props: ["modelValue", "options", "loading"],
16
- template: `<select class="yh-select" :value="modelValue" @change="$emit('update:modelValue', $event.target.value)"><option v-for="opt in options" :key="opt.value" :value="opt.value">{{opt.label}}</option></select>`
17
- };
18
- const YhSwitch = {
19
- name: "YhSwitch",
20
- props: ["modelValue"],
21
- template: `<input type="checkbox" class="yh-switch" :checked="modelValue" @change="$emit('update:modelValue', $event.target.checked)" />`
22
- };
23
- const YhButton = {
24
- name: "YhButton",
25
- props: ["type", "text", "disabled"],
26
- emits: ["click"],
27
- template: `<button class="yh-button" :disabled="disabled" @click="$emit('click')"><slot /></button>`
28
- };
29
- const globalComponents = {
30
- "yh-input": YhInput,
31
- "yh-select": YhSelect,
32
- "yh-switch": YhSwitch,
33
- "yh-button": YhButton
34
- };
35
- (0, _vitest.describe)("FormSchema", () => {
36
- (0, _vitest.it)("\u57FA\u7840\u6E32\u67D3 - \u6309 schema \u6E32\u67D3\u8868\u5355\u9879", async () => {
37
- const model = {
38
- username: "ant",
39
- role: ""
40
- };
41
- const schema = [{
42
- field: "username",
43
- label: "Username",
44
- component: "input",
45
- props: {
46
- placeholder: "Enter username"
47
- }
48
- }];
49
- const wrapper = (0, _testUtils.mount)(_formSchema.default, {
50
- props: {
51
- modelValue: model,
52
- schema
53
- },
54
- global: {
55
- components: globalComponents
56
- }
57
- });
58
- (0, _vitest.expect)(wrapper.find(".yh-form").exists()).toBe(true);
59
- const input = wrapper.find("input");
60
- (0, _vitest.expect)(input.attributes("placeholder")).toBe("Enter username");
61
- });
62
- (0, _vitest.it)("\u53CC\u5411\u7ED1\u5B9A - v-model \u540C\u6B65\u66F4\u65B0", async () => {
63
- const model = {
64
- username: ""
65
- };
66
- const schema = [{
67
- field: "username",
68
- component: "input"
69
- }];
70
- const wrapper = (0, _testUtils.mount)(_formSchema.default, {
71
- props: {
72
- modelValue: model,
73
- schema
74
- },
75
- global: {
76
- components: globalComponents
77
- }
78
- });
79
- const input = wrapper.find("input");
80
- await input.setValue("new_user");
81
- (0, _vitest.expect)(wrapper.emitted("update:modelValue")).toBeTruthy();
82
- const lastEmitted = wrapper.emitted("update:modelValue").slice(-1)[0][0];
83
- (0, _vitest.expect)(lastEmitted.username).toBe("new_user");
84
- });
85
- (0, _vitest.it)("change \u4E8B\u4EF6 - \u89E6\u53D1 change \u5E76\u5305\u542B field \u548C val", async () => {
86
- const wrapper = (0, _testUtils.mount)(_formSchema.default, {
87
- props: {
88
- modelValue: {
89
- name: ""
90
- },
91
- schema: [{
92
- field: "name",
93
- component: "input"
94
- }]
95
- },
96
- global: {
97
- components: globalComponents
98
- }
99
- });
100
- await wrapper.find("input").setValue("test");
101
- const changeEvents = wrapper.emitted("change");
102
- (0, _vitest.expect)(changeEvents.length).toBeGreaterThan(0);
103
- (0, _vitest.expect)(changeEvents[0][0]).toBe("name");
104
- (0, _vitest.expect)(changeEvents[0][1]).toBe("test");
105
- });
106
- (0, _vitest.it)("\u52A8\u6001\u663E\u9690 - hidden \u51FD\u6570\u652F\u6301\u8054\u52A8", async () => {
107
- const schema = [{
108
- field: "showExtra",
109
- component: "input"
110
- }, {
111
- field: "extra",
112
- label: "Extra Label",
113
- component: "input",
114
- hidden: m => !m.showExtra
115
- }];
116
- const wrapper = (0, _testUtils.mount)(_formSchema.default, {
117
- props: {
118
- modelValue: {
119
- showExtra: false,
120
- extra: ""
121
- },
122
- schema
123
- },
124
- global: {
125
- components: globalComponents
126
- }
127
- });
128
- (0, _vitest.expect)(wrapper.text()).not.toContain("Extra Label");
129
- await wrapper.setProps({
130
- modelValue: {
131
- showExtra: true,
132
- extra: "visible"
133
- }
134
- });
135
- await (0, _vue.nextTick)();
136
- (0, _vitest.expect)(wrapper.text()).toContain("Extra Label");
137
- });
138
- (0, _vitest.it)("\u52A8\u6001\u8054\u52A8 - required \u548C rules \u652F\u6301\u4F20\u5165\u51FD\u6570\u8BA1\u7B97", async () => {
139
- const schema = [{
140
- field: "type",
141
- component: "input"
142
- }, {
143
- field: "reason",
144
- component: "input",
145
- required: model => model.type === "other",
146
- rules: model => {
147
- return model.type === "other" ? [{
148
- min: 5,
149
- message: "\u81F3\u5C11 5 \u4E2A\u5B57\u7B26",
150
- trigger: "blur"
151
- }] : [];
152
- }
153
- }];
154
- const wrapper = (0, _testUtils.mount)(_formSchema.default, {
155
- props: {
156
- modelValue: {
157
- type: "normal",
158
- reason: ""
159
- },
160
- schema
161
- },
162
- global: {
163
- components: globalComponents
164
- }
165
- });
166
- const reasonItem = wrapper.findAll(".yh-form-item")[1];
167
- (0, _vitest.expect)(reasonItem.classes()).not.toContain("is-required");
168
- await wrapper.setProps({
169
- modelValue: {
170
- type: "other",
171
- reason: ""
172
- }
173
- });
174
- (0, _vitest.expect)(reasonItem.classes()).toContain("is-required");
175
- });
176
- (0, _vitest.it)("\u5206\u7EC4\u6E32\u67D3 - \u5C55\u793A group title \u5E76\u652F\u6301\u6298\u53E0", async () => {
177
- const schema = [{
178
- title: "Basic Info",
179
- items: [{
180
- field: "name",
181
- component: "input"
182
- }],
183
- collapsible: true
184
- }];
185
- const wrapper = (0, _testUtils.mount)(_formSchema.default, {
186
- props: {
187
- modelValue: {
188
- name: ""
189
- },
190
- schema
191
- },
192
- global: {
193
- components: globalComponents
194
- }
195
- });
196
- (0, _vitest.expect)(wrapper.find(".yh-form-schema__group-title").text()).toContain("Basic Info");
197
- await wrapper.find(".yh-form-schema__group-title").trigger("click");
198
- (0, _vitest.expect)(wrapper.find(".yh-form-schema__group").classes()).toContain("is-collapsed");
199
- });
200
- (0, _vitest.it)("\u5F02\u6B65\u9009\u9879 - asyncOptions \u81EA\u52A8\u52A0\u8F7D\u5E76\u6CE8\u5165", async () => {
201
- const asyncOptions = _vitest.vi.fn().mockResolvedValue([{
202
- label: "Option A",
203
- value: "a"
204
- }]);
205
- const schema = [{
206
- field: "type",
207
- component: "select",
208
- asyncOptions
209
- }];
210
- const wrapper = (0, _testUtils.mount)(_formSchema.default, {
211
- props: {
212
- modelValue: {
213
- type: ""
214
- },
215
- schema
216
- },
217
- global: {
218
- components: globalComponents
219
- }
220
- });
221
- await (0, _vue.nextTick)();
222
- await (0, _vue.nextTick)();
223
- await (0, _vue.nextTick)();
224
- (0, _vitest.expect)(asyncOptions).toHaveBeenCalled();
225
- const options = wrapper.findAll("option");
226
- (0, _vitest.expect)(options.length).toBeGreaterThan(0);
227
- });
228
- (0, _vitest.it)("render \u51FD\u6570 - \u81EA\u5B9A\u4E49\u6E32\u67D3", () => {
229
- const schema = [{
230
- field: "custom",
231
- render: m => (0, _vue.h)("div", {
232
- class: "custom-render"
233
- }, `Val: ${m.custom}`)
234
- }];
235
- const wrapper = (0, _testUtils.mount)(_formSchema.default, {
236
- props: {
237
- modelValue: {
238
- custom: "hello"
239
- },
240
- schema
241
- },
242
- global: {
243
- components: globalComponents
244
- }
245
- });
246
- (0, _vitest.expect)(wrapper.find(".custom-render").text()).toBe("Val: hello");
247
- });
248
- (0, _vitest.it)("\u66B4\u9732 API - validate/resetFields/clearValidate/getModel/setFieldValue", () => {
249
- const wrapper = (0, _testUtils.mount)(_formSchema.default, {
250
- props: {
251
- modelValue: {},
252
- schema: []
253
- },
254
- global: {
255
- components: globalComponents
256
- }
257
- });
258
- const vm = wrapper.vm;
259
- (0, _vitest.expect)(typeof vm.validate).toBe("function");
260
- (0, _vitest.expect)(typeof vm.resetFields).toBe("function");
261
- (0, _vitest.expect)(typeof vm.clearValidate).toBe("function");
262
- (0, _vitest.expect)(typeof vm.getModel).toBe("function");
263
- (0, _vitest.expect)(typeof vm.setFieldValue).toBe("function");
264
- });
265
- (0, _vitest.it)("getModel - \u8FD4\u56DE\u5F53\u524D\u5B8C\u6574 model \u5FEB\u7167", async () => {
266
- const wrapper = (0, _testUtils.mount)(_formSchema.default, {
267
- props: {
268
- modelValue: {
269
- city: "BJ"
270
- },
271
- schema: [{
272
- field: "city",
273
- component: "input"
274
- }]
275
- },
276
- global: {
277
- components: globalComponents
278
- }
279
- });
280
- const model = wrapper.vm.getModel();
281
- (0, _vitest.expect)(model.city).toBe("BJ");
282
- });
283
- (0, _vitest.it)("setFieldValue - \u52A8\u6001\u66F4\u65B0\u5355\u5B57\u6BB5\u503C", async () => {
284
- const wrapper = (0, _testUtils.mount)(_formSchema.default, {
285
- props: {
286
- modelValue: {
287
- city: ""
288
- },
289
- schema: [{
290
- field: "city",
291
- component: "input"
292
- }]
293
- },
294
- global: {
295
- components: globalComponents
296
- }
297
- });
298
- wrapper.vm.setFieldValue("city", "SH");
299
- await (0, _vue.nextTick)();
300
- const emitted = wrapper.emitted("update:modelValue");
301
- const last = emitted[emitted.length - 1][0];
302
- (0, _vitest.expect)(last.city).toBe("SH");
303
- });
304
- (0, _vitest.it)("required \u7B80\u5199 - \u81EA\u52A8\u6DFB\u52A0\u5FC5\u586B\u89C4\u5219\u5E76\u89E6\u53D1\u6821\u9A8C", async () => {
305
- const schema = [{
306
- field: "name",
307
- label: "\u59D3\u540D",
308
- component: "input",
309
- required: true
310
- }];
311
- const wrapper = (0, _testUtils.mount)(_formSchema.default, {
312
- props: {
313
- modelValue: {
314
- name: ""
315
- },
316
- schema
317
- },
318
- global: {
319
- components: globalComponents
320
- }
321
- });
322
- let isValid = true;
323
- try {
324
- isValid = await wrapper.vm.validate();
325
- } catch (_) {
326
- isValid = false;
327
- }
328
- (0, _vitest.expect)(isValid).toBe(false);
329
- });
330
- (0, _vitest.it)("type divider - \u6E32\u67D3\u5206\u9694\u7EBF", () => {
331
- const schema = [{
332
- type: "divider",
333
- label: "\u57FA\u672C\u4FE1\u606F",
334
- field: "_d"
335
- }];
336
- const wrapper = (0, _testUtils.mount)(_formSchema.default, {
337
- props: {
338
- modelValue: {},
339
- schema
340
- },
341
- global: {
342
- components: globalComponents
343
- }
344
- });
345
- (0, _vitest.expect)(wrapper.find(".yh-form-schema__divider").exists()).toBe(true);
346
- (0, _vitest.expect)(wrapper.find(".yh-form-schema__divider-label").text()).toBe("\u57FA\u672C\u4FE1\u606F");
347
- });
348
- (0, _vitest.it)("type text - \u53EA\u8BFB\u663E\u793A\u5B57\u6BB5\u503C", () => {
349
- const schema = [{
350
- type: "text",
351
- label: "\u59D3\u540D",
352
- field: "name"
353
- }];
354
- const wrapper = (0, _testUtils.mount)(_formSchema.default, {
355
- props: {
356
- modelValue: {
357
- name: "Alice"
358
- },
359
- schema
360
- },
361
- global: {
362
- components: globalComponents
363
- }
364
- });
365
- (0, _vitest.expect)(wrapper.find(".yh-form-schema__text-value").text()).toBe("Alice");
366
- });
367
- (0, _vitest.it)("type text - emptyValue \u7A7A\u6001\u5360\u4F4D\u7B26", async () => {
368
- const schema = [{
369
- type: "text",
370
- label: "\u7535\u8BDD",
371
- field: "phone",
372
- emptyValue: "\u6682\u65E0"
373
- }, {
374
- type: "text",
375
- label: "\u5730\u5740",
376
- field: "addr"
377
- }];
378
- const wrapper = (0, _testUtils.mount)(_formSchema.default, {
379
- props: {
380
- modelValue: {
381
- phone: null,
382
- addr: void 0
383
- },
384
- schema
385
- },
386
- global: {
387
- components: globalComponents
388
- }
389
- });
390
- await (0, _vue.nextTick)();
391
- const items = wrapper.findAll(".yh-form-schema__text-value");
392
- (0, _vitest.expect)(items[0].text()).toBe("\u6682\u65E0");
393
- (0, _vitest.expect)(items[1].text()).toBe("-");
394
- });
395
- (0, _vitest.it)("defaultValue - \u672A\u8BBE\u7F6E\u5B57\u6BB5\u65F6\u586B\u5145\u9ED8\u8BA4\u503C", async () => {
396
- const schema = [{
397
- field: "city",
398
- component: "input",
399
- defaultValue: "Beijing"
400
- }];
401
- const wrapper = (0, _testUtils.mount)(_formSchema.default, {
402
- props: {
403
- modelValue: {},
404
- schema
405
- },
406
- global: {
407
- components: globalComponents
408
- }
409
- });
410
- await (0, _vue.nextTick)();
411
- const emitted = wrapper.emitted("update:modelValue");
412
- (0, _vitest.expect)(emitted).toBeTruthy();
413
- const last = emitted[emitted.length - 1][0];
414
- (0, _vitest.expect)(last.city).toBe("Beijing");
415
- });
416
- (0, _vitest.it)("disabled \u51FD\u6570 - \u6839\u636E model \u52A8\u6001\u7981\u7528\u5B57\u6BB5", async () => {
417
- const schema = [{
418
- field: "toggle",
419
- component: "switch"
420
- }, {
421
- field: "target",
422
- component: "input",
423
- disabled: m => !m.toggle
424
- }];
425
- const wrapper = (0, _testUtils.mount)(_formSchema.default, {
426
- props: {
427
- modelValue: {
428
- toggle: false,
429
- target: ""
430
- },
431
- schema
432
- },
433
- global: {
434
- components: globalComponents
435
- }
436
- });
437
- const input = wrapper.find('input[type="text"], input:not([type="checkbox"])').element;
438
- (0, _vitest.expect)(input.disabled).toBe(true);
439
- });
440
- (0, _vitest.it)("\u5916\u90E8 modelValue \u66F4\u65B0 - localModel \u540C\u6B65\u54CD\u5E94", async () => {
441
- const wrapper = (0, _testUtils.mount)(_formSchema.default, {
442
- props: {
443
- modelValue: {
444
- name: "old"
445
- },
446
- schema: [{
447
- field: "name",
448
- component: "input"
449
- }]
450
- },
451
- global: {
452
- components: globalComponents
453
- }
454
- });
455
- await wrapper.setProps({
456
- modelValue: {
457
- name: "new"
458
- }
459
- });
460
- await (0, _vue.nextTick)();
461
- const input = wrapper.find("input");
462
- (0, _vitest.expect)(input.element.value).toBe("new");
463
- });
464
- (0, _vitest.describe)("type list - \u52A8\u6001\u589E\u51CF\u5217\u8868", () => {
465
- const listSchema = [{
466
- field: "name",
467
- label: "\u59D3\u540D",
468
- component: "input"
469
- }, {
470
- field: "phone",
471
- label: "\u7535\u8BDD",
472
- component: "input"
473
- }];
474
- (0, _vitest.it)("\u521D\u59CB\u6E32\u67D3 - \u6309\u5DF2\u6709\u5217\u8868\u6570\u636E\u6E32\u67D3\u884C", async () => {
475
- const schema = [{
476
- field: "contacts",
477
- label: "\u8054\u7CFB\u4EBA",
478
- type: "list",
479
- listSchema,
480
- listProps: {}
481
- }];
482
- const wrapper = (0, _testUtils.mount)(_formSchema.default, {
483
- props: {
484
- modelValue: {
485
- contacts: [{
486
- name: "Alice",
487
- phone: "111"
488
- }, {
489
- name: "Bob",
490
- phone: "222"
491
- }]
492
- },
493
- schema
494
- },
495
- global: {
496
- components: globalComponents
497
- }
498
- });
499
- await (0, _vue.nextTick)();
500
- (0, _vitest.expect)(wrapper.findAll(".yh-form-schema__list-row").length).toBe(2);
501
- });
502
- (0, _vitest.it)("\u6DFB\u52A0\u5217\u8868\u9879 - \u70B9\u51FB\u6DFB\u52A0\u6309\u94AE\u589E\u52A0\u4E00\u884C", async () => {
503
- const schema = [{
504
- field: "contacts",
505
- label: "\u8054\u7CFB\u4EBA",
506
- type: "list",
507
- listSchema,
508
- listProps: {}
509
- }];
510
- const wrapper = (0, _testUtils.mount)(_formSchema.default, {
511
- props: {
512
- modelValue: {
513
- contacts: []
514
- },
515
- schema
516
- },
517
- global: {
518
- components: globalComponents
519
- }
520
- });
521
- await wrapper.find(".yh-form-schema__list-add").trigger("click");
522
- await (0, _vue.nextTick)();
523
- const emitted = wrapper.emitted("update:modelValue");
524
- const last = emitted[emitted.length - 1][0];
525
- (0, _vitest.expect)(last.contacts.length).toBe(1);
526
- });
527
- (0, _vitest.it)("\u5220\u9664\u5217\u8868\u9879 - \u70B9\u51FB\u5220\u9664\u6309\u94AE\u79FB\u9664\u5BF9\u5E94\u884C", async () => {
528
- const schema = [{
529
- field: "contacts",
530
- label: "\u8054\u7CFB\u4EBA",
531
- type: "list",
532
- listSchema,
533
- listProps: {}
534
- }];
535
- const wrapper = (0, _testUtils.mount)(_formSchema.default, {
536
- props: {
537
- modelValue: {
538
- contacts: [{
539
- name: "Alice",
540
- phone: "111"
541
- }]
542
- },
543
- schema
544
- },
545
- global: {
546
- components: globalComponents
547
- }
548
- });
549
- await (0, _vue.nextTick)();
550
- await wrapper.find(".yh-form-schema__list-delete").trigger("click");
551
- await (0, _vue.nextTick)();
552
- const emitted = wrapper.emitted("update:modelValue");
553
- const last = emitted[emitted.length - 1][0];
554
- (0, _vitest.expect)(last.contacts.length).toBe(0);
555
- });
556
- (0, _vitest.it)("max \u9650\u5236 - \u8D85\u51FA\u6700\u5927\u6570\u91CF\u65F6\u7981\u7528\u6DFB\u52A0\u6309\u94AE", async () => {
557
- const schema = [{
558
- field: "contacts",
559
- label: "\u8054\u7CFB\u4EBA",
560
- type: "list",
561
- listSchema,
562
- listProps: {
563
- max: 1
564
- }
565
- }];
566
- const wrapper = (0, _testUtils.mount)(_formSchema.default, {
567
- props: {
568
- modelValue: {
569
- contacts: [{
570
- name: "Alice",
571
- phone: "111"
572
- }]
573
- },
574
- schema
575
- },
576
- global: {
577
- components: globalComponents
578
- }
579
- });
580
- await (0, _vue.nextTick)();
581
- const addBtn = wrapper.find(".yh-form-schema__list-add");
582
- (0, _vitest.expect)(addBtn.attributes("disabled")).toBeDefined();
583
- });
584
- (0, _vitest.it)("min \u9650\u5236 - \u672A\u8FBE\u5230\u6700\u5C0F\u6570\u91CF\u65F6\u7981\u7528\u5220\u9664\u6309\u94AE", async () => {
585
- const schema = [{
586
- field: "contacts",
587
- label: "\u8054\u7CFB\u4EBA",
588
- type: "list",
589
- listSchema,
590
- listProps: {
591
- min: 1
592
- }
593
- }];
594
- const wrapper = (0, _testUtils.mount)(_formSchema.default, {
595
- props: {
596
- modelValue: {
597
- contacts: [{
598
- name: "Alice",
599
- phone: "111"
600
- }]
601
- },
602
- schema
603
- },
604
- global: {
605
- components: globalComponents
606
- }
607
- });
608
- await (0, _vue.nextTick)();
609
- const delBtn = wrapper.find(".yh-form-schema__list-delete");
610
- (0, _vitest.expect)(delBtn.attributes("disabled")).toBeDefined();
611
- });
612
- (0, _vitest.it)("addButtonText - \u81EA\u5B9A\u4E49\u6DFB\u52A0\u6309\u94AE\u6587\u6848", async () => {
613
- const schema = [{
614
- field: "contacts",
615
- label: "\u8054\u7CFB\u4EBA",
616
- type: "list",
617
- listSchema,
618
- listProps: {
619
- addButtonText: "\u65B0\u589E\u8054\u7CFB\u4EBA"
620
- }
621
- }];
622
- const wrapper = (0, _testUtils.mount)(_formSchema.default, {
623
- props: {
624
- modelValue: {
625
- contacts: []
626
- },
627
- schema
628
- },
629
- global: {
630
- components: globalComponents
631
- }
632
- });
633
- (0, _vitest.expect)(wrapper.find(".yh-form-schema__list-add").text()).toContain("\u65B0\u589E\u8054\u7CFB\u4EBA");
634
- });
635
- });
636
- });