@yh-ui/components 0.1.21 → 0.1.22

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 (484) hide show
  1. package/README.md +2 -0
  2. package/dist/form/index.cjs +1 -1
  3. package/dist/form/index.d.ts +1 -1
  4. package/dist/form/index.mjs +1 -1
  5. package/dist/icon/index.cjs +1 -1
  6. package/dist/icon/index.d.ts +1 -1
  7. package/dist/icon/index.mjs +1 -1
  8. package/dist/loading/index.cjs +1 -1
  9. package/dist/loading/index.d.ts +1 -1
  10. package/dist/loading/index.mjs +1 -1
  11. package/dist/message/src/method.cjs +1 -1
  12. package/dist/message/src/method.d.ts +1 -1
  13. package/dist/message/src/method.mjs +1 -1
  14. package/dist/message-box/index.cjs +1 -1
  15. package/dist/message-box/index.d.ts +1 -1
  16. package/dist/message-box/index.mjs +1 -1
  17. package/dist/notification/src/method.cjs +1 -1
  18. package/dist/notification/src/method.d.ts +1 -1
  19. package/dist/notification/src/method.mjs +1 -1
  20. package/dist/resolver.cjs +1 -1
  21. package/dist/resolver.d.ts +7 -5
  22. package/dist/resolver.mjs +1 -1
  23. package/dist/style.css +584 -0
  24. package/package.json +6 -6
  25. package/dist/affix/__tests__/affix.bottom.test.cjs +0 -101
  26. package/dist/affix/__tests__/affix.bottom.test.mjs +0 -88
  27. package/dist/affix/__tests__/affix.ssr.test.cjs +0 -38
  28. package/dist/affix/__tests__/affix.ssr.test.mjs +0 -51
  29. package/dist/affix/__tests__/affix.test.cjs +0 -185
  30. package/dist/affix/__tests__/affix.test.mjs +0 -180
  31. package/dist/ai-action-group/__tests__/ai-action-group.ssr.test.cjs +0 -55
  32. package/dist/ai-action-group/__tests__/ai-action-group.ssr.test.mjs +0 -39
  33. package/dist/ai-action-group/__tests__/ai-action-group.test.cjs +0 -235
  34. package/dist/ai-action-group/__tests__/ai-action-group.test.mjs +0 -157
  35. package/dist/ai-agent-card/__tests__/ai-agent-card.ssr.test.cjs +0 -61
  36. package/dist/ai-agent-card/__tests__/ai-agent-card.ssr.test.mjs +0 -65
  37. package/dist/ai-agent-card/__tests__/ai-agent-card.test.cjs +0 -205
  38. package/dist/ai-agent-card/__tests__/ai-agent-card.test.mjs +0 -133
  39. package/dist/ai-artifacts/__tests__/ai-artifacts.ssr.test.cjs +0 -73
  40. package/dist/ai-artifacts/__tests__/ai-artifacts.ssr.test.mjs +0 -68
  41. package/dist/ai-artifacts/__tests__/ai-artifacts.test.cjs +0 -128
  42. package/dist/ai-artifacts/__tests__/ai-artifacts.test.mjs +0 -109
  43. package/dist/ai-attachments/__tests__/ai-attachments.ssr.test.cjs +0 -50
  44. package/dist/ai-attachments/__tests__/ai-attachments.ssr.test.mjs +0 -33
  45. package/dist/ai-attachments/__tests__/ai-attachments.test.cjs +0 -113
  46. package/dist/ai-attachments/__tests__/ai-attachments.test.mjs +0 -81
  47. package/dist/ai-bubble/__tests__/ai-bubble.ssr.test.cjs +0 -95
  48. package/dist/ai-bubble/__tests__/ai-bubble.ssr.test.mjs +0 -66
  49. package/dist/ai-bubble/__tests__/ai-bubble.test.cjs +0 -624
  50. package/dist/ai-bubble/__tests__/ai-bubble.test.mjs +0 -393
  51. package/dist/ai-bubble-list/__tests__/ai-bubble-list.ssr.test.cjs +0 -51
  52. package/dist/ai-bubble-list/__tests__/ai-bubble-list.ssr.test.mjs +0 -51
  53. package/dist/ai-bubble-list/__tests__/ai-bubble-list.test.cjs +0 -138
  54. package/dist/ai-bubble-list/__tests__/ai-bubble-list.test.mjs +0 -112
  55. package/dist/ai-chat/__tests__/ai-chat.ssr.test.cjs +0 -90
  56. package/dist/ai-chat/__tests__/ai-chat.ssr.test.mjs +0 -77
  57. package/dist/ai-chat/__tests__/ai-chat.test.cjs +0 -177
  58. package/dist/ai-chat/__tests__/ai-chat.test.mjs +0 -129
  59. package/dist/ai-code-block/__tests__/ai-code-block.ssr.test.cjs +0 -75
  60. package/dist/ai-code-block/__tests__/ai-code-block.ssr.test.mjs +0 -57
  61. package/dist/ai-code-block/__tests__/ai-code-block.test.cjs +0 -174
  62. package/dist/ai-code-block/__tests__/ai-code-block.test.mjs +0 -108
  63. package/dist/ai-code-editor/__tests__/ai-code-editor.ssr.test.cjs +0 -46
  64. package/dist/ai-code-editor/__tests__/ai-code-editor.ssr.test.mjs +0 -39
  65. package/dist/ai-code-editor/__tests__/ai-code-editor.test.cjs +0 -90
  66. package/dist/ai-code-editor/__tests__/ai-code-editor.test.mjs +0 -78
  67. package/dist/ai-code-runner/__tests__/ai-code-runner.ssr.test.cjs +0 -28
  68. package/dist/ai-code-runner/__tests__/ai-code-runner.ssr.test.mjs +0 -26
  69. package/dist/ai-code-runner/__tests__/ai-code-runner.test.cjs +0 -69
  70. package/dist/ai-code-runner/__tests__/ai-code-runner.test.mjs +0 -66
  71. package/dist/ai-conversations/__tests__/ai-conversations.ssr.test.cjs +0 -50
  72. package/dist/ai-conversations/__tests__/ai-conversations.ssr.test.mjs +0 -42
  73. package/dist/ai-conversations/__tests__/ai-conversations.test.cjs +0 -67
  74. package/dist/ai-conversations/__tests__/ai-conversations.test.mjs +0 -51
  75. package/dist/ai-editor-sender/__tests__/ai-editor-sender.ssr.test.cjs +0 -62
  76. package/dist/ai-editor-sender/__tests__/ai-editor-sender.ssr.test.mjs +0 -50
  77. package/dist/ai-editor-sender/__tests__/ai-editor-sender.test.cjs +0 -315
  78. package/dist/ai-editor-sender/__tests__/ai-editor-sender.test.mjs +0 -226
  79. package/dist/ai-file-card/__tests__/ai-file-card.ssr.test.cjs +0 -45
  80. package/dist/ai-file-card/__tests__/ai-file-card.ssr.test.mjs +0 -29
  81. package/dist/ai-file-card/__tests__/ai-file-card.test.cjs +0 -160
  82. package/dist/ai-file-card/__tests__/ai-file-card.test.mjs +0 -109
  83. package/dist/ai-mention/__tests__/ai-mention.ssr.test.cjs +0 -38
  84. package/dist/ai-mention/__tests__/ai-mention.ssr.test.mjs +0 -37
  85. package/dist/ai-mention/__tests__/ai-mention.test.cjs +0 -113
  86. package/dist/ai-mention/__tests__/ai-mention.test.mjs +0 -84
  87. package/dist/ai-mermaid/__tests__/ai-mermaid.ssr.test.cjs +0 -43
  88. package/dist/ai-mermaid/__tests__/ai-mermaid.ssr.test.mjs +0 -33
  89. package/dist/ai-mermaid/__tests__/ai-mermaid.test.cjs +0 -113
  90. package/dist/ai-mermaid/__tests__/ai-mermaid.test.mjs +0 -92
  91. package/dist/ai-prompts/__tests__/ai-prompts.ssr.test.cjs +0 -49
  92. package/dist/ai-prompts/__tests__/ai-prompts.ssr.test.mjs +0 -41
  93. package/dist/ai-prompts/__tests__/ai-prompts.test.cjs +0 -54
  94. package/dist/ai-prompts/__tests__/ai-prompts.test.mjs +0 -38
  95. package/dist/ai-provider/__tests__/ai-provider.ssr.test.cjs +0 -33
  96. package/dist/ai-provider/__tests__/ai-provider.ssr.test.mjs +0 -34
  97. package/dist/ai-provider/__tests__/ai-provider.test.cjs +0 -38
  98. package/dist/ai-provider/__tests__/ai-provider.test.mjs +0 -33
  99. package/dist/ai-sender/__tests__/ai-sender.ssr.test.cjs +0 -46
  100. package/dist/ai-sender/__tests__/ai-sender.ssr.test.mjs +0 -37
  101. package/dist/ai-sender/__tests__/ai-sender.test.cjs +0 -511
  102. package/dist/ai-sender/__tests__/ai-sender.test.mjs +0 -322
  103. package/dist/ai-sources/__tests__/ai-sources.ssr.test.cjs +0 -72
  104. package/dist/ai-sources/__tests__/ai-sources.ssr.test.mjs +0 -82
  105. package/dist/ai-sources/__tests__/ai-sources.test.cjs +0 -200
  106. package/dist/ai-sources/__tests__/ai-sources.test.mjs +0 -160
  107. package/dist/ai-thinking/__tests__/ai-thinking.ssr.test.cjs +0 -56
  108. package/dist/ai-thinking/__tests__/ai-thinking.ssr.test.mjs +0 -42
  109. package/dist/ai-thinking/__tests__/ai-thinking.test.cjs +0 -151
  110. package/dist/ai-thinking/__tests__/ai-thinking.test.mjs +0 -96
  111. package/dist/ai-thought-chain/__tests__/ai-thought-chain.ssr.test.cjs +0 -88
  112. package/dist/ai-thought-chain/__tests__/ai-thought-chain.ssr.test.mjs +0 -55
  113. package/dist/ai-thought-chain/__tests__/ai-thought-chain.test.cjs +0 -344
  114. package/dist/ai-thought-chain/__tests__/ai-thought-chain.test.mjs +0 -237
  115. package/dist/ai-voice-trigger/__tests__/ai-voice-trigger.ssr.test.cjs +0 -32
  116. package/dist/ai-voice-trigger/__tests__/ai-voice-trigger.ssr.test.mjs +0 -25
  117. package/dist/ai-voice-trigger/__tests__/ai-voice-trigger.test.cjs +0 -130
  118. package/dist/ai-voice-trigger/__tests__/ai-voice-trigger.test.mjs +0 -103
  119. package/dist/ai-welcome/__tests__/ai-welcome.ssr.test.cjs +0 -57
  120. package/dist/ai-welcome/__tests__/ai-welcome.ssr.test.mjs +0 -39
  121. package/dist/ai-welcome/__tests__/ai-welcome.test.cjs +0 -169
  122. package/dist/ai-welcome/__tests__/ai-welcome.test.mjs +0 -113
  123. package/dist/alert/__tests__/alert.ssr.test.cjs +0 -28
  124. package/dist/alert/__tests__/alert.ssr.test.mjs +0 -29
  125. package/dist/alert/__tests__/alert.test.cjs +0 -123
  126. package/dist/alert/__tests__/alert.test.mjs +0 -110
  127. package/dist/autocomplete/__tests__/autocomplete.ssr.test.cjs +0 -54
  128. package/dist/autocomplete/__tests__/autocomplete.ssr.test.mjs +0 -47
  129. package/dist/autocomplete/__tests__/autocomplete.test.cjs +0 -299
  130. package/dist/autocomplete/__tests__/autocomplete.test.mjs +0 -263
  131. package/dist/avatar/__tests__/avatar.ssr.test.cjs +0 -103
  132. package/dist/avatar/__tests__/avatar.ssr.test.mjs +0 -108
  133. package/dist/avatar/__tests__/avatar.test.cjs +0 -146
  134. package/dist/avatar/__tests__/avatar.test.mjs +0 -125
  135. package/dist/back-top/__tests__/back-top.ssr.test.cjs +0 -13
  136. package/dist/back-top/__tests__/back-top.ssr.test.mjs +0 -10
  137. package/dist/back-top/__tests__/back-top.test.cjs +0 -88
  138. package/dist/back-top/__tests__/back-top.test.mjs +0 -76
  139. package/dist/badge/__tests__/badge.ssr.test.cjs +0 -36
  140. package/dist/badge/__tests__/badge.ssr.test.mjs +0 -33
  141. package/dist/badge/__tests__/badge.test.cjs +0 -115
  142. package/dist/badge/__tests__/badge.test.mjs +0 -112
  143. package/dist/breadcrumb/__tests__/breadcrumb.ssr.test.cjs +0 -22
  144. package/dist/breadcrumb/__tests__/breadcrumb.ssr.test.mjs +0 -20
  145. package/dist/breadcrumb/__tests__/breadcrumb.test.cjs +0 -64
  146. package/dist/breadcrumb/__tests__/breadcrumb.test.mjs +0 -51
  147. package/dist/button/__tests__/button.ssr.test.cjs +0 -52
  148. package/dist/button/__tests__/button.ssr.test.mjs +0 -55
  149. package/dist/button/__tests__/button.test.cjs +0 -207
  150. package/dist/button/__tests__/button.test.mjs +0 -141
  151. package/dist/calendar/__tests__/calendar.ssr.test.cjs +0 -65
  152. package/dist/calendar/__tests__/calendar.ssr.test.mjs +0 -63
  153. package/dist/calendar/__tests__/calendar.test.cjs +0 -263
  154. package/dist/calendar/__tests__/calendar.test.mjs +0 -255
  155. package/dist/card/__tests__/card.ssr.test.cjs +0 -37
  156. package/dist/card/__tests__/card.ssr.test.mjs +0 -40
  157. package/dist/card/__tests__/card.test.cjs +0 -131
  158. package/dist/card/__tests__/card.test.mjs +0 -124
  159. package/dist/carousel/__tests__/carousel.ssr.test.cjs +0 -27
  160. package/dist/carousel/__tests__/carousel.ssr.test.mjs +0 -27
  161. package/dist/carousel/__tests__/carousel.test.cjs +0 -115
  162. package/dist/carousel/__tests__/carousel.test.mjs +0 -98
  163. package/dist/cascader/__tests__/cascader-panel.test.cjs +0 -162
  164. package/dist/cascader/__tests__/cascader-panel.test.mjs +0 -151
  165. package/dist/cascader/__tests__/cascader.ssr.test.cjs +0 -61
  166. package/dist/cascader/__tests__/cascader.ssr.test.mjs +0 -55
  167. package/dist/cascader/__tests__/cascader.test.cjs +0 -342
  168. package/dist/cascader/__tests__/cascader.test.mjs +0 -316
  169. package/dist/category-nav/__tests__/category-nav.ssr.test.cjs +0 -35
  170. package/dist/category-nav/__tests__/category-nav.ssr.test.mjs +0 -21
  171. package/dist/category-nav/__tests__/category-nav.test.cjs +0 -53
  172. package/dist/category-nav/__tests__/category-nav.test.mjs +0 -33
  173. package/dist/checkbox/__tests__/checkbox.ssr.test.cjs +0 -52
  174. package/dist/checkbox/__tests__/checkbox.ssr.test.mjs +0 -57
  175. package/dist/checkbox/__tests__/checkbox.test.cjs +0 -173
  176. package/dist/checkbox/__tests__/checkbox.test.mjs +0 -133
  177. package/dist/col/__tests__/col.ssr.test.cjs +0 -44
  178. package/dist/col/__tests__/col.ssr.test.mjs +0 -42
  179. package/dist/col/__tests__/col.test.cjs +0 -128
  180. package/dist/col/__tests__/col.test.mjs +0 -116
  181. package/dist/color-picker/__tests__/color-picker.ssr.test.cjs +0 -34
  182. package/dist/color-picker/__tests__/color-picker.ssr.test.mjs +0 -39
  183. package/dist/color-picker/__tests__/color-picker.test.cjs +0 -227
  184. package/dist/color-picker/__tests__/color-picker.test.mjs +0 -176
  185. package/dist/config-provider/__tests__/config-provider.ssr.test.cjs +0 -43
  186. package/dist/config-provider/__tests__/config-provider.ssr.test.mjs +0 -42
  187. package/dist/config-provider/__tests__/config-provider.test.cjs +0 -75
  188. package/dist/config-provider/__tests__/config-provider.test.mjs +0 -64
  189. package/dist/container/__tests__/container.ssr.test.cjs +0 -71
  190. package/dist/container/__tests__/container.ssr.test.mjs +0 -50
  191. package/dist/container/__tests__/container.test.cjs +0 -111
  192. package/dist/container/__tests__/container.test.mjs +0 -84
  193. package/dist/countdown/__tests__/countdown.ssr.test.cjs +0 -86
  194. package/dist/countdown/__tests__/countdown.ssr.test.mjs +0 -78
  195. package/dist/countdown/__tests__/countdown.test.cjs +0 -767
  196. package/dist/countdown/__tests__/countdown.test.mjs +0 -722
  197. package/dist/coupon-card/__tests__/coupon-card.ssr.test.cjs +0 -21
  198. package/dist/coupon-card/__tests__/coupon-card.ssr.test.mjs +0 -18
  199. package/dist/coupon-card/__tests__/coupon-card.test.cjs +0 -67
  200. package/dist/coupon-card/__tests__/coupon-card.test.mjs +0 -64
  201. package/dist/date-picker/__tests__/date-picker-extended.test.cjs +0 -581
  202. package/dist/date-picker/__tests__/date-picker-extended.test.mjs +0 -455
  203. package/dist/date-picker/__tests__/date-picker.ssr.test.cjs +0 -26
  204. package/dist/date-picker/__tests__/date-picker.ssr.test.mjs +0 -23
  205. package/dist/date-picker/__tests__/date-picker.test.cjs +0 -170
  206. package/dist/date-picker/__tests__/date-picker.test.mjs +0 -136
  207. package/dist/descriptions/__tests__/descriptions.ssr.test.cjs +0 -67
  208. package/dist/descriptions/__tests__/descriptions.ssr.test.mjs +0 -72
  209. package/dist/descriptions/__tests__/descriptions.test.cjs +0 -150
  210. package/dist/descriptions/__tests__/descriptions.test.mjs +0 -130
  211. package/dist/dialog/__tests__/dialog.functional.test.cjs +0 -49
  212. package/dist/dialog/__tests__/dialog.functional.test.mjs +0 -49
  213. package/dist/dialog/__tests__/dialog.ssr.test.cjs +0 -31
  214. package/dist/dialog/__tests__/dialog.ssr.test.mjs +0 -29
  215. package/dist/dialog/__tests__/dialog.test.cjs +0 -561
  216. package/dist/dialog/__tests__/dialog.test.mjs +0 -388
  217. package/dist/divider/__tests__/divider.ssr.test.cjs +0 -41
  218. package/dist/divider/__tests__/divider.ssr.test.mjs +0 -44
  219. package/dist/divider/__tests__/divider.test.cjs +0 -71
  220. package/dist/divider/__tests__/divider.test.mjs +0 -68
  221. package/dist/drawer/__tests__/drawer.ssr.test.cjs +0 -25
  222. package/dist/drawer/__tests__/drawer.ssr.test.mjs +0 -23
  223. package/dist/drawer/__tests__/drawer.test.cjs +0 -145
  224. package/dist/drawer/__tests__/drawer.test.mjs +0 -122
  225. package/dist/dropdown/__tests__/dropdown.ssr.test.cjs +0 -49
  226. package/dist/dropdown/__tests__/dropdown.ssr.test.mjs +0 -64
  227. package/dist/dropdown/__tests__/dropdown.test.cjs +0 -310
  228. package/dist/dropdown/__tests__/dropdown.test.mjs +0 -269
  229. package/dist/empty/__tests__/empty.ssr.test.cjs +0 -96
  230. package/dist/empty/__tests__/empty.ssr.test.mjs +0 -99
  231. package/dist/empty/__tests__/empty.test.cjs +0 -110
  232. package/dist/empty/__tests__/empty.test.mjs +0 -101
  233. package/dist/filter-bar/__tests__/filter-bar.ssr.test.cjs +0 -29
  234. package/dist/filter-bar/__tests__/filter-bar.ssr.test.mjs +0 -16
  235. package/dist/filter-bar/__tests__/filter-bar.test.cjs +0 -51
  236. package/dist/filter-bar/__tests__/filter-bar.test.mjs +0 -29
  237. package/dist/form/__tests__/form-schema.test.cjs +0 -636
  238. package/dist/form/__tests__/form-schema.test.mjs +0 -366
  239. package/dist/form/__tests__/form.ssr.test.cjs +0 -74
  240. package/dist/form/__tests__/form.ssr.test.mjs +0 -73
  241. package/dist/form/__tests__/form.test.cjs +0 -208
  242. package/dist/form/__tests__/form.test.mjs +0 -128
  243. package/dist/gantt-chart/__tests__/debug_ssr.test.cjs +0 -51
  244. package/dist/gantt-chart/__tests__/debug_ssr.test.mjs +0 -37
  245. package/dist/gantt-chart/__tests__/gantt-chart.ssr.test.cjs +0 -95
  246. package/dist/gantt-chart/__tests__/gantt-chart.ssr.test.mjs +0 -94
  247. package/dist/gantt-chart/__tests__/gantt-chart.test.cjs +0 -86
  248. package/dist/gantt-chart/__tests__/gantt-chart.test.mjs +0 -79
  249. package/dist/grid/__tests__/grid.ssr.test.cjs +0 -81
  250. package/dist/grid/__tests__/grid.ssr.test.mjs +0 -63
  251. package/dist/grid/__tests__/grid.test.cjs +0 -142
  252. package/dist/grid/__tests__/grid.test.mjs +0 -89
  253. package/dist/icon/__tests__/icon.ssr.test.cjs +0 -35
  254. package/dist/icon/__tests__/icon.ssr.test.mjs +0 -26
  255. package/dist/icon/__tests__/icon.test.cjs +0 -144
  256. package/dist/icon/__tests__/icon.test.mjs +0 -123
  257. package/dist/image/__tests__/image-viewer.test.cjs +0 -101
  258. package/dist/image/__tests__/image-viewer.test.mjs +0 -94
  259. package/dist/image/__tests__/image.ssr.test.cjs +0 -73
  260. package/dist/image/__tests__/image.ssr.test.mjs +0 -72
  261. package/dist/image/__tests__/image.test.cjs +0 -171
  262. package/dist/image/__tests__/image.test.mjs +0 -159
  263. package/dist/image-magnifier/__tests__/image-magnifier.ssr.test.cjs +0 -54
  264. package/dist/image-magnifier/__tests__/image-magnifier.ssr.test.mjs +0 -35
  265. package/dist/image-magnifier/__tests__/image-magnifier.test.cjs +0 -257
  266. package/dist/image-magnifier/__tests__/image-magnifier.test.mjs +0 -177
  267. package/dist/infinite-scroll/__tests__/infinite-scroll.ssr.test.cjs +0 -59
  268. package/dist/infinite-scroll/__tests__/infinite-scroll.ssr.test.mjs +0 -84
  269. package/dist/infinite-scroll/__tests__/infinite-scroll.test.cjs +0 -255
  270. package/dist/infinite-scroll/__tests__/infinite-scroll.test.mjs +0 -187
  271. package/dist/input/__tests__/input-utils.test.cjs +0 -77
  272. package/dist/input/__tests__/input-utils.test.mjs +0 -75
  273. package/dist/input/__tests__/input.ssr.test.cjs +0 -100
  274. package/dist/input/__tests__/input.ssr.test.mjs +0 -85
  275. package/dist/input/__tests__/input.test.cjs +0 -127
  276. package/dist/input/__tests__/input.test.mjs +0 -112
  277. package/dist/input-number/__tests__/input-number.hydration.test.cjs +0 -24
  278. package/dist/input-number/__tests__/input-number.hydration.test.mjs +0 -21
  279. package/dist/input-number/__tests__/input-number.ssr.test.cjs +0 -95
  280. package/dist/input-number/__tests__/input-number.ssr.test.mjs +0 -92
  281. package/dist/input-number/__tests__/input-number.test.cjs +0 -199
  282. package/dist/input-number/__tests__/input-number.test.mjs +0 -173
  283. package/dist/input-tag/__tests__/input-tag.ssr.test.cjs +0 -47
  284. package/dist/input-tag/__tests__/input-tag.ssr.test.mjs +0 -41
  285. package/dist/input-tag/__tests__/input-tag.test.cjs +0 -268
  286. package/dist/input-tag/__tests__/input-tag.test.mjs +0 -201
  287. package/dist/loading/__tests__/loading.ssr.test.cjs +0 -37
  288. package/dist/loading/__tests__/loading.ssr.test.mjs +0 -27
  289. package/dist/loading/__tests__/loading.test.cjs +0 -91
  290. package/dist/loading/__tests__/loading.test.mjs +0 -75
  291. package/dist/lucky-draw/__tests__/lucky-draw.ssr.test.cjs +0 -33
  292. package/dist/lucky-draw/__tests__/lucky-draw.ssr.test.mjs +0 -31
  293. package/dist/lucky-draw/__tests__/lucky-draw.test.cjs +0 -56
  294. package/dist/lucky-draw/__tests__/lucky-draw.test.mjs +0 -48
  295. package/dist/marquee/__tests__/marquee.ssr.test.cjs +0 -59
  296. package/dist/marquee/__tests__/marquee.ssr.test.mjs +0 -60
  297. package/dist/marquee/__tests__/marquee.test.cjs +0 -94
  298. package/dist/marquee/__tests__/marquee.test.mjs +0 -92
  299. package/dist/mention/__tests__/mention.ssr.test.cjs +0 -92
  300. package/dist/mention/__tests__/mention.ssr.test.mjs +0 -70
  301. package/dist/mention/__tests__/mention.test.cjs +0 -650
  302. package/dist/mention/__tests__/mention.test.mjs +0 -523
  303. package/dist/menu/__tests__/menu.ssr.test.cjs +0 -92
  304. package/dist/menu/__tests__/menu.ssr.test.mjs +0 -124
  305. package/dist/menu/__tests__/menu.test.cjs +0 -209
  306. package/dist/menu/__tests__/menu.test.mjs +0 -182
  307. package/dist/message/__tests__/message.ssr.test.cjs +0 -29
  308. package/dist/message/__tests__/message.ssr.test.mjs +0 -23
  309. package/dist/message/__tests__/message.test.cjs +0 -170
  310. package/dist/message/__tests__/message.test.mjs +0 -154
  311. package/dist/message-box/__tests__/message-box.ssr.test.cjs +0 -33
  312. package/dist/message-box/__tests__/message-box.ssr.test.mjs +0 -30
  313. package/dist/message-box/__tests__/message-box.test.cjs +0 -100
  314. package/dist/message-box/__tests__/message-box.test.mjs +0 -95
  315. package/dist/notification/__tests__/notification.ssr.test.cjs +0 -31
  316. package/dist/notification/__tests__/notification.ssr.test.mjs +0 -25
  317. package/dist/notification/__tests__/notification.test.cjs +0 -248
  318. package/dist/notification/__tests__/notification.test.mjs +0 -206
  319. package/dist/pagination/__tests__/pagination.ssr.test.cjs +0 -61
  320. package/dist/pagination/__tests__/pagination.ssr.test.mjs +0 -59
  321. package/dist/pagination/__tests__/pagination.test.cjs +0 -135
  322. package/dist/pagination/__tests__/pagination.test.mjs +0 -131
  323. package/dist/popconfirm/__tests__/popconfirm.ssr.test.cjs +0 -48
  324. package/dist/popconfirm/__tests__/popconfirm.ssr.test.mjs +0 -63
  325. package/dist/popconfirm/__tests__/popconfirm.test.cjs +0 -62
  326. package/dist/popconfirm/__tests__/popconfirm.test.mjs +0 -56
  327. package/dist/popover/__tests__/popover.ssr.test.cjs +0 -48
  328. package/dist/popover/__tests__/popover.ssr.test.mjs +0 -63
  329. package/dist/popover/__tests__/popover.test.cjs +0 -107
  330. package/dist/popover/__tests__/popover.test.mjs +0 -93
  331. package/dist/price/__tests__/price.ssr.test.cjs +0 -20
  332. package/dist/price/__tests__/price.ssr.test.mjs +0 -19
  333. package/dist/price/__tests__/price.test.cjs +0 -45
  334. package/dist/price/__tests__/price.test.mjs +0 -42
  335. package/dist/product-card/__tests__/product-card.ssr.test.cjs +0 -21
  336. package/dist/product-card/__tests__/product-card.ssr.test.mjs +0 -18
  337. package/dist/product-card/__tests__/product-card.test.cjs +0 -54
  338. package/dist/product-card/__tests__/product-card.test.mjs +0 -53
  339. package/dist/progress/__tests__/progress.ssr.test.cjs +0 -31
  340. package/dist/progress/__tests__/progress.ssr.test.mjs +0 -29
  341. package/dist/progress/__tests__/progress.test.cjs +0 -119
  342. package/dist/progress/__tests__/progress.test.mjs +0 -77
  343. package/dist/radio/__tests__/radio-button.test.cjs +0 -99
  344. package/dist/radio/__tests__/radio-button.test.mjs +0 -83
  345. package/dist/radio/__tests__/radio.ssr.test.cjs +0 -132
  346. package/dist/radio/__tests__/radio.ssr.test.mjs +0 -165
  347. package/dist/radio/__tests__/radio.test.cjs +0 -170
  348. package/dist/radio/__tests__/radio.test.mjs +0 -143
  349. package/dist/rate/__tests__/rate.ssr.test.cjs +0 -106
  350. package/dist/rate/__tests__/rate.ssr.test.mjs +0 -103
  351. package/dist/rate/__tests__/rate.test.cjs +0 -88
  352. package/dist/rate/__tests__/rate.test.mjs +0 -85
  353. package/dist/result/__tests__/result.ssr.test.cjs +0 -62
  354. package/dist/result/__tests__/result.ssr.test.mjs +0 -51
  355. package/dist/result/__tests__/result.test.cjs +0 -135
  356. package/dist/result/__tests__/result.test.mjs +0 -92
  357. package/dist/row/__tests__/row.ssr.test.cjs +0 -29
  358. package/dist/row/__tests__/row.ssr.test.mjs +0 -30
  359. package/dist/row/__tests__/row.test.cjs +0 -89
  360. package/dist/row/__tests__/row.test.mjs +0 -86
  361. package/dist/row/__tests__/row_ts.test.cjs +0 -31
  362. package/dist/row/__tests__/row_ts.test.mjs +0 -28
  363. package/dist/scrollbar/__tests__/scrollbar.ssr.test.cjs +0 -49
  364. package/dist/scrollbar/__tests__/scrollbar.ssr.test.mjs +0 -54
  365. package/dist/scrollbar/__tests__/scrollbar.test.cjs +0 -43
  366. package/dist/scrollbar/__tests__/scrollbar.test.mjs +0 -40
  367. package/dist/select/__tests__/select.perf.test.cjs +0 -191
  368. package/dist/select/__tests__/select.perf.test.mjs +0 -185
  369. package/dist/select/__tests__/select.ssr.test.cjs +0 -58
  370. package/dist/select/__tests__/select.ssr.test.mjs +0 -52
  371. package/dist/select/__tests__/select.test.cjs +0 -414
  372. package/dist/select/__tests__/select.test.mjs +0 -345
  373. package/dist/skeleton/__tests__/skeleton.ssr.test.cjs +0 -81
  374. package/dist/skeleton/__tests__/skeleton.ssr.test.mjs +0 -83
  375. package/dist/skeleton/__tests__/skeleton.test.cjs +0 -72
  376. package/dist/skeleton/__tests__/skeleton.test.mjs +0 -65
  377. package/dist/sku-selector/__tests__/sku-selector.ssr.test.cjs +0 -32
  378. package/dist/sku-selector/__tests__/sku-selector.ssr.test.mjs +0 -19
  379. package/dist/sku-selector/__tests__/sku-selector.test.cjs +0 -64
  380. package/dist/sku-selector/__tests__/sku-selector.test.mjs +0 -53
  381. package/dist/slider/__tests__/repro.test.cjs +0 -25
  382. package/dist/slider/__tests__/repro.test.mjs +0 -22
  383. package/dist/slider/__tests__/slider.ssr.test.cjs +0 -118
  384. package/dist/slider/__tests__/slider.ssr.test.mjs +0 -115
  385. package/dist/slider/__tests__/slider.test.cjs +0 -155
  386. package/dist/slider/__tests__/slider.test.mjs +0 -120
  387. package/dist/smart-address/__tests__/smart-address.ssr.test.cjs +0 -28
  388. package/dist/smart-address/__tests__/smart-address.ssr.test.mjs +0 -25
  389. package/dist/smart-address/__tests__/smart-address.test.cjs +0 -68
  390. package/dist/smart-address/__tests__/smart-address.test.mjs +0 -56
  391. package/dist/space/__tests__/space.ssr.test.cjs +0 -115
  392. package/dist/space/__tests__/space.ssr.test.mjs +0 -150
  393. package/dist/space/__tests__/space.test.cjs +0 -227
  394. package/dist/space/__tests__/space.test.mjs +0 -187
  395. package/dist/spin/__tests__/spin.ssr.test.cjs +0 -46
  396. package/dist/spin/__tests__/spin.ssr.test.mjs +0 -43
  397. package/dist/spin/__tests__/spin.test.cjs +0 -65
  398. package/dist/spin/__tests__/spin.test.mjs +0 -63
  399. package/dist/steps/__tests__/steps.ssr.test.cjs +0 -73
  400. package/dist/steps/__tests__/steps.ssr.test.mjs +0 -55
  401. package/dist/steps/__tests__/steps.test.cjs +0 -152
  402. package/dist/steps/__tests__/steps.test.mjs +0 -123
  403. package/dist/submit-bar/__tests__/submit-bar.ssr.test.cjs +0 -21
  404. package/dist/submit-bar/__tests__/submit-bar.ssr.test.mjs +0 -18
  405. package/dist/submit-bar/__tests__/submit-bar.test.cjs +0 -50
  406. package/dist/submit-bar/__tests__/submit-bar.test.mjs +0 -36
  407. package/dist/switch/__tests__/switch.ssr.test.cjs +0 -105
  408. package/dist/switch/__tests__/switch.ssr.test.mjs +0 -102
  409. package/dist/switch/__tests__/switch.test.cjs +0 -251
  410. package/dist/switch/__tests__/switch.test.mjs +0 -193
  411. package/dist/table/__tests__/table-advance.test.cjs +0 -180
  412. package/dist/table/__tests__/table-advance.test.mjs +0 -118
  413. package/dist/table/__tests__/table-interaction.test.cjs +0 -236
  414. package/dist/table/__tests__/table-interaction.test.mjs +0 -162
  415. package/dist/table/__tests__/table-utils.test.cjs +0 -690
  416. package/dist/table/__tests__/table-utils.test.mjs +0 -485
  417. package/dist/table/__tests__/table.perf.test.cjs +0 -231
  418. package/dist/table/__tests__/table.perf.test.mjs +0 -225
  419. package/dist/table/__tests__/table.ssr.test.cjs +0 -296
  420. package/dist/table/__tests__/table.ssr.test.mjs +0 -265
  421. package/dist/table/__tests__/table.test.cjs +0 -682
  422. package/dist/table/__tests__/table.test.mjs +0 -617
  423. package/dist/table/__tests__/use-column-drag.test.cjs +0 -238
  424. package/dist/table/__tests__/use-column-drag.test.mjs +0 -150
  425. package/dist/table/__tests__/use-table-export.test.cjs +0 -179
  426. package/dist/table/__tests__/use-table-export.test.mjs +0 -105
  427. package/dist/table/__tests__/use-table-import.test.cjs +0 -206
  428. package/dist/table/__tests__/use-table-import.test.mjs +0 -144
  429. package/dist/table/__tests__/use-table-print.test.cjs +0 -190
  430. package/dist/table/__tests__/use-table-print.test.mjs +0 -134
  431. package/dist/table/__tests__/use-virtual-scroll.test.cjs +0 -286
  432. package/dist/table/__tests__/use-virtual-scroll.test.mjs +0 -196
  433. package/dist/tabs/__tests__/tabs.ssr.test.cjs +0 -57
  434. package/dist/tabs/__tests__/tabs.ssr.test.mjs +0 -41
  435. package/dist/tabs/__tests__/tabs.test.cjs +0 -171
  436. package/dist/tabs/__tests__/tabs.test.mjs +0 -134
  437. package/dist/tag/__tests__/tag.ssr.test.cjs +0 -45
  438. package/dist/tag/__tests__/tag.ssr.test.mjs +0 -48
  439. package/dist/tag/__tests__/tag.test.cjs +0 -194
  440. package/dist/tag/__tests__/tag.test.mjs +0 -167
  441. package/dist/time-picker/__tests__/time-picker.ssr.test.cjs +0 -46
  442. package/dist/time-picker/__tests__/time-picker.ssr.test.mjs +0 -43
  443. package/dist/time-picker/__tests__/time-picker.test.cjs +0 -228
  444. package/dist/time-picker/__tests__/time-picker.test.mjs +0 -218
  445. package/dist/time-picker/__tests__/time-spinner.test.cjs +0 -196
  446. package/dist/time-picker/__tests__/time-spinner.test.mjs +0 -162
  447. package/dist/time-select/__tests__/time-select.ssr.test.cjs +0 -42
  448. package/dist/time-select/__tests__/time-select.ssr.test.mjs +0 -37
  449. package/dist/time-select/__tests__/time-select.test.cjs +0 -390
  450. package/dist/time-select/__tests__/time-select.test.mjs +0 -374
  451. package/dist/tooltip/__tests__/tooltip.ssr.test.cjs +0 -55
  452. package/dist/tooltip/__tests__/tooltip.ssr.test.mjs +0 -76
  453. package/dist/tooltip/__tests__/tooltip.test.cjs +0 -132
  454. package/dist/tooltip/__tests__/tooltip.test.mjs +0 -121
  455. package/dist/transfer/__tests__/transfer.ssr.test.cjs +0 -47
  456. package/dist/transfer/__tests__/transfer.ssr.test.mjs +0 -44
  457. package/dist/transfer/__tests__/transfer.test.cjs +0 -422
  458. package/dist/transfer/__tests__/transfer.test.mjs +0 -405
  459. package/dist/tree/__tests__/tree.perf.test.cjs +0 -182
  460. package/dist/tree/__tests__/tree.perf.test.mjs +0 -198
  461. package/dist/tree/__tests__/tree.ssr.test.cjs +0 -56
  462. package/dist/tree/__tests__/tree.ssr.test.mjs +0 -45
  463. package/dist/tree/__tests__/tree.test.cjs +0 -488
  464. package/dist/tree/__tests__/tree.test.mjs +0 -333
  465. package/dist/tree-select/__tests__/tree-select.ssr.test.cjs +0 -52
  466. package/dist/tree-select/__tests__/tree-select.ssr.test.mjs +0 -55
  467. package/dist/tree-select/__tests__/tree-select.test.cjs +0 -231
  468. package/dist/tree-select/__tests__/tree-select.test.mjs +0 -189
  469. package/dist/typography/__tests__/typography.ssr.test.cjs +0 -85
  470. package/dist/typography/__tests__/typography.ssr.test.mjs +0 -63
  471. package/dist/typography/__tests__/typography.test.cjs +0 -362
  472. package/dist/typography/__tests__/typography.test.mjs +0 -161
  473. package/dist/upload/__tests__/upload.ssr.test.cjs +0 -28
  474. package/dist/upload/__tests__/upload.ssr.test.mjs +0 -26
  475. package/dist/upload/__tests__/upload.test.cjs +0 -467
  476. package/dist/upload/__tests__/upload.test.mjs +0 -336
  477. package/dist/waterfall/__tests__/waterfall.ssr.test.cjs +0 -38
  478. package/dist/waterfall/__tests__/waterfall.ssr.test.mjs +0 -39
  479. package/dist/waterfall/__tests__/waterfall.test.cjs +0 -122
  480. package/dist/waterfall/__tests__/waterfall.test.mjs +0 -85
  481. package/dist/watermark/__tests__/watermark.ssr.test.cjs +0 -32
  482. package/dist/watermark/__tests__/watermark.ssr.test.mjs +0 -30
  483. package/dist/watermark/__tests__/watermark.test.cjs +0 -127
  484. package/dist/watermark/__tests__/watermark.test.mjs +0 -124
@@ -1,374 +0,0 @@
1
- import { mount } from "@vue/test-utils";
2
- import { describe, it, expect, vi, beforeEach, afterEach } from "vitest";
3
- import { nextTick } from "vue";
4
- import YhTimeSelect from "../src/time-select.vue";
5
- import {
6
- parseTimeToMinutes,
7
- formatMinutesToTime,
8
- compareTime,
9
- isTimeInRange,
10
- generateTimeOptions
11
- } from "../src/time-select.mjs";
12
- vi.mock("@yh-ui/hooks", async () => {
13
- const actual = await vi.importActual("@yh-ui/hooks");
14
- return {
15
- ...actual,
16
- useNamespace: (name) => ({
17
- b: (modifier) => modifier ? `yh-${name}--${modifier}` : `yh-${name}`,
18
- e: (element) => `yh-${name}__${element}`,
19
- m: (modifier) => `yh-${name}--${modifier}`,
20
- is: (state, val) => val !== false ? `is-${state}` : ""
21
- }),
22
- useFormItem: () => ({
23
- form: null,
24
- formItem: null,
25
- validate: vi.fn()
26
- }),
27
- useId: () => "test-id",
28
- useLocale: () => ({ t: (key) => key }),
29
- useConfig: () => ({ globalSize: "default" }),
30
- useZIndex: () => ({ currentZIndex: 2e3, nextZIndex: () => 2e3 })
31
- };
32
- });
33
- describe("TimeSelect \u5DE5\u5177\u51FD\u6570\u6D4B\u8BD5", () => {
34
- describe("parseTimeToMinutes", () => {
35
- it("\u5E94\u6B63\u786E\u89E3\u6790 HH:mm \u683C\u5F0F", () => {
36
- expect(parseTimeToMinutes("09:00")).toBe(9 * 60);
37
- expect(parseTimeToMinutes("12:30")).toBe(12 * 60 + 30);
38
- expect(parseTimeToMinutes("23:59")).toBe(23 * 60 + 59);
39
- });
40
- it("\u5E94\u6B63\u786E\u89E3\u6790 00:00", () => {
41
- expect(parseTimeToMinutes("00:00")).toBe(0);
42
- });
43
- it("\u5E94\u5904\u7406\u7A7A\u5B57\u7B26\u4E32", () => {
44
- expect(parseTimeToMinutes("")).toBe(0);
45
- });
46
- });
47
- describe("formatMinutesToTime", () => {
48
- it("\u5E94\u6B63\u786E\u683C\u5F0F\u5316\u4E3A HH:mm", () => {
49
- expect(formatMinutesToTime(9 * 60)).toBe("09:00");
50
- expect(formatMinutesToTime(12 * 60 + 30)).toBe("12:30");
51
- expect(formatMinutesToTime(0)).toBe("00:00");
52
- });
53
- it("\u5E94\u652F\u6301\u81EA\u5B9A\u4E49\u683C\u5F0F", () => {
54
- expect(formatMinutesToTime(9 * 60, "H:mm")).toBe("9:00");
55
- expect(formatMinutesToTime(12 * 60 + 5, "HH:m")).toBe("12:5");
56
- });
57
- });
58
- describe("compareTime", () => {
59
- it("\u5E94\u6B63\u786E\u6BD4\u8F83\u65F6\u95F4", () => {
60
- expect(compareTime("09:00", "10:00")).toBe(-1);
61
- expect(compareTime("10:00", "09:00")).toBe(1);
62
- expect(compareTime("09:00", "09:00")).toBe(0);
63
- });
64
- });
65
- describe("isTimeInRange", () => {
66
- it("\u5E94\u6B63\u786E\u5224\u65AD\u65F6\u95F4\u662F\u5426\u5728\u8303\u56F4\u5185", () => {
67
- expect(isTimeInRange("10:00", "09:00", "11:00")).toBe(true);
68
- expect(isTimeInRange("09:00", "09:00", "11:00")).toBe(true);
69
- expect(isTimeInRange("11:00", "09:00", "11:00")).toBe(true);
70
- expect(isTimeInRange("08:00", "09:00", "11:00")).toBe(false);
71
- expect(isTimeInRange("12:00", "09:00", "11:00")).toBe(false);
72
- });
73
- });
74
- describe("generateTimeOptions", () => {
75
- it("\u5E94\u6B63\u786E\u751F\u6210\u65F6\u95F4\u9009\u9879", () => {
76
- const options = generateTimeOptions("09:00", "11:00", "00:30");
77
- expect(options.length).toBe(5);
78
- expect(options[0].value).toBe("09:00");
79
- expect(options[1].value).toBe("09:30");
80
- expect(options[2].value).toBe("10:00");
81
- expect(options[3].value).toBe("10:30");
82
- expect(options[4].value).toBe("11:00");
83
- });
84
- it("includeEnd \u53C2\u6570\u5728\u6B64\u7248\u672C\u4E2D\u4E0D\u518D\u5F71\u54CD\u7ED3\u679C\uFF08\u59CB\u7EC8\u5305\u542B\uFF09", () => {
85
- const options = generateTimeOptions("09:00", "10:00", "00:30", "HH:mm", false);
86
- expect(options.length).toBe(3);
87
- expect(options[2].value).toBe("10:00");
88
- });
89
- it("\u5E94\u5904\u7406\u65E0\u6548\u7684 step", () => {
90
- const options = generateTimeOptions("09:00", "10:00", "00:00");
91
- expect(options.length).toBe(0);
92
- });
93
- });
94
- });
95
- describe("TimeSelect \u7EC4\u4EF6\u6D4B\u8BD5", () => {
96
- let wrapper;
97
- beforeEach(() => {
98
- document.body.innerHTML = "";
99
- });
100
- afterEach(() => {
101
- if (wrapper) {
102
- wrapper.unmount();
103
- }
104
- });
105
- describe("\u57FA\u7840\u6E32\u67D3", () => {
106
- it("\u5E94\u6B63\u786E\u6E32\u67D3\u7EC4\u4EF6", () => {
107
- wrapper = mount(YhTimeSelect);
108
- expect(wrapper.classes()).toContain("yh-time-select");
109
- });
110
- it("\u5E94\u663E\u793A\u5360\u4F4D\u6587\u672C", () => {
111
- wrapper = mount(YhTimeSelect, {
112
- props: {
113
- placeholder: "\u8BF7\u9009\u62E9\u65F6\u95F4"
114
- }
115
- });
116
- const input = wrapper.find("input");
117
- expect(input.attributes("placeholder")).toBe("\u8BF7\u9009\u62E9\u65F6\u95F4");
118
- });
119
- it("\u5E94\u6B63\u786E\u663E\u793A\u9009\u4E2D\u503C", async () => {
120
- wrapper = mount(YhTimeSelect, {
121
- props: {
122
- modelValue: "09:00",
123
- start: "08:00",
124
- end: "12:00",
125
- step: "00:30"
126
- }
127
- });
128
- await nextTick();
129
- const displayValue = wrapper.find(".yh-time-select__display-value");
130
- expect(displayValue.exists()).toBe(true);
131
- expect(displayValue.text()).toBe("09:00");
132
- });
133
- });
134
- describe("\u5C3A\u5BF8\u53D8\u4F53", () => {
135
- it.each(["large", "default", "small"])("\u5E94\u652F\u6301 %s \u5C3A\u5BF8", (size) => {
136
- wrapper = mount(YhTimeSelect, {
137
- props: { size }
138
- });
139
- expect(wrapper.classes()).toContain(`yh-time-select--${size}`);
140
- });
141
- });
142
- describe("\u7981\u7528\u72B6\u6001", () => {
143
- it("\u5E94\u6B63\u786E\u5E94\u7528\u7981\u7528\u72B6\u6001", () => {
144
- wrapper = mount(YhTimeSelect, {
145
- props: {
146
- disabled: true
147
- }
148
- });
149
- expect(wrapper.classes()).toContain("is-disabled");
150
- const input = wrapper.find("input");
151
- expect(input.attributes("disabled")).toBeDefined();
152
- });
153
- it("\u7981\u7528\u72B6\u6001\u4E0B\u4E0D\u5E94\u6253\u5F00\u4E0B\u62C9\u6846", async () => {
154
- wrapper = mount(YhTimeSelect, {
155
- props: {
156
- disabled: true,
157
- teleported: false
158
- }
159
- });
160
- await wrapper.trigger("click");
161
- await nextTick();
162
- expect(wrapper.emitted("visible-change")).toBeUndefined();
163
- });
164
- });
165
- describe("\u53EF\u6E05\u7A7A\u529F\u80FD", () => {
166
- it("\u5E94\u663E\u793A\u6E05\u7A7A\u6309\u94AE", async () => {
167
- wrapper = mount(YhTimeSelect, {
168
- props: {
169
- modelValue: "09:00",
170
- clearable: true
171
- }
172
- });
173
- await wrapper.trigger("mouseenter");
174
- await nextTick();
175
- const clearBtn = wrapper.find(".yh-time-select__clear");
176
- expect(clearBtn.exists()).toBe(true);
177
- });
178
- it("\u70B9\u51FB\u6E05\u7A7A\u6309\u94AE\u5E94\u6E05\u9664\u503C", async () => {
179
- wrapper = mount(YhTimeSelect, {
180
- props: {
181
- modelValue: "09:00",
182
- clearable: true
183
- }
184
- });
185
- await wrapper.trigger("mouseenter");
186
- await nextTick();
187
- const clearBtn = wrapper.find(".yh-time-select__clear");
188
- await clearBtn.trigger("click");
189
- expect(wrapper.emitted("update:modelValue")?.[0]).toEqual([void 0]);
190
- expect(wrapper.emitted("clear")).toBeTruthy();
191
- });
192
- });
193
- describe("\u4E0B\u62C9\u6846\u4EA4\u4E92", () => {
194
- it("\u70B9\u51FB\u5E94\u6253\u5F00\u4E0B\u62C9\u6846", async () => {
195
- wrapper = mount(YhTimeSelect, {
196
- props: {
197
- teleported: false
198
- }
199
- });
200
- await wrapper.trigger("click");
201
- await nextTick();
202
- expect(wrapper.emitted("visible-change")?.[0]).toEqual([true]);
203
- });
204
- it("\u5E94\u751F\u6210\u6B63\u786E\u7684\u65F6\u95F4\u9009\u9879", async () => {
205
- wrapper = mount(YhTimeSelect, {
206
- props: {
207
- start: "09:00",
208
- end: "12:00",
209
- step: "01:00",
210
- teleported: false
211
- }
212
- });
213
- await wrapper.trigger("click");
214
- await nextTick();
215
- const options = wrapper.findAll(".yh-time-select__option");
216
- expect(options.length).toBe(4);
217
- });
218
- });
219
- describe("\u952E\u76D8\u5BFC\u822A", () => {
220
- it("\u6309\u4E0B\u56DE\u8F66\u952E\u5E94\u6253\u5F00\u4E0B\u62C9\u6846", async () => {
221
- wrapper = mount(YhTimeSelect, {
222
- props: {
223
- teleported: false
224
- }
225
- });
226
- const input = wrapper.find("input");
227
- await input.trigger("keydown", { key: "Enter" });
228
- await nextTick();
229
- expect(wrapper.emitted("visible-change")?.[0]).toEqual([true]);
230
- });
231
- it("\u6309\u4E0B Escape \u952E\u5E94\u5173\u95ED\u4E0B\u62C9\u6846", async () => {
232
- wrapper = mount(YhTimeSelect, {
233
- props: {
234
- teleported: false
235
- }
236
- });
237
- await wrapper.trigger("click");
238
- await nextTick();
239
- const input = wrapper.find("input");
240
- await input.trigger("keydown", { key: "Escape" });
241
- await nextTick();
242
- const events = wrapper.emitted("visible-change");
243
- expect(events?.length).toBeGreaterThanOrEqual(1);
244
- });
245
- });
246
- describe("\u4E8B\u4EF6\u89E6\u53D1", () => {
247
- it("\u9009\u62E9\u9009\u9879\u5E94\u89E6\u53D1 change \u4E8B\u4EF6", async () => {
248
- wrapper = mount(YhTimeSelect, {
249
- props: {
250
- start: "09:00",
251
- end: "12:00",
252
- step: "01:00",
253
- teleported: false
254
- }
255
- });
256
- await wrapper.trigger("click");
257
- await nextTick();
258
- const options = wrapper.findAll(".yh-time-select__option");
259
- await options[0].trigger("click");
260
- expect(wrapper.emitted("change")?.[0]).toEqual(["09:00"]);
261
- expect(wrapper.emitted("update:modelValue")?.[0]).toEqual(["09:00"]);
262
- });
263
- it("\u5E94\u89E6\u53D1 focus \u548C blur \u4E8B\u4EF6", async () => {
264
- wrapper = mount(YhTimeSelect);
265
- const input = wrapper.find("input");
266
- await input.trigger("focus");
267
- expect(wrapper.emitted("focus")).toBeTruthy();
268
- await input.trigger("blur");
269
- expect(wrapper.emitted("blur")).toBeTruthy();
270
- });
271
- });
272
- describe("minTime \u548C maxTime", () => {
273
- it("\u5E94\u7981\u7528 minTime \u4E4B\u524D\u7684\u9009\u9879", async () => {
274
- wrapper = mount(YhTimeSelect, {
275
- props: {
276
- start: "08:00",
277
- end: "12:00",
278
- step: "01:00",
279
- minTime: "10:00",
280
- teleported: false
281
- }
282
- });
283
- await wrapper.trigger("click");
284
- await nextTick();
285
- const options = wrapper.findAll(".yh-time-select__option");
286
- expect(options[0].classes()).toContain("is-disabled");
287
- expect(options[1].classes()).toContain("is-disabled");
288
- expect(options[2].classes()).not.toContain("is-disabled");
289
- });
290
- it("\u5E94\u7981\u7528 maxTime \u4E4B\u540E\u7684\u9009\u9879", async () => {
291
- wrapper = mount(YhTimeSelect, {
292
- props: {
293
- start: "08:00",
294
- end: "12:00",
295
- step: "01:00",
296
- maxTime: "10:00",
297
- teleported: false
298
- }
299
- });
300
- await wrapper.trigger("click");
301
- await nextTick();
302
- const options = wrapper.findAll(".yh-time-select__option");
303
- expect(options[3].classes()).toContain("is-disabled");
304
- expect(options[2].classes()).not.toContain("is-disabled");
305
- });
306
- });
307
- describe("disabledHours", () => {
308
- it("\u5E94\u7981\u7528\u6307\u5B9A\u65F6\u95F4\u6BB5", async () => {
309
- wrapper = mount(YhTimeSelect, {
310
- props: {
311
- start: "08:00",
312
- end: "14:00",
313
- step: "01:00",
314
- disabledHours: [["10:00", "11:00"]],
315
- teleported: false
316
- }
317
- });
318
- await wrapper.trigger("click");
319
- await nextTick();
320
- const options = wrapper.findAll(".yh-time-select__option");
321
- expect(options[2].classes()).toContain("is-disabled");
322
- expect(options[3].classes()).toContain("is-disabled");
323
- expect(options[1].classes()).not.toContain("is-disabled");
324
- expect(options[4].classes()).not.toContain("is-disabled");
325
- });
326
- });
327
- describe("\u81EA\u5B9A\u4E49\u9009\u9879", () => {
328
- it("\u5E94\u652F\u6301\u81EA\u5B9A\u4E49\u9009\u9879", async () => {
329
- const customOptions = [
330
- { value: "08:00", label: "\u65E9\u4E0A 8 \u70B9" },
331
- { value: "12:00", label: "\u4E2D\u5348 12 \u70B9" },
332
- { value: "18:00", label: "\u4E0B\u5348 6 \u70B9", disabled: true }
333
- ];
334
- wrapper = mount(YhTimeSelect, {
335
- props: {
336
- options: customOptions,
337
- teleported: false
338
- }
339
- });
340
- await wrapper.trigger("click");
341
- await nextTick();
342
- const options = wrapper.findAll(".yh-time-select__option");
343
- expect(options.length).toBe(3);
344
- expect(options[0].text()).toContain("\u65E9\u4E0A 8 \u70B9");
345
- expect(options[2].classes()).toContain("is-disabled");
346
- });
347
- });
348
- describe("includeEndTime", () => {
349
- it("\u9ED8\u8BA4\u5E94\u5305\u542B\u7ED3\u675F\u65F6\u95F4", async () => {
350
- wrapper = mount(YhTimeSelect, {
351
- props: {
352
- start: "09:00",
353
- end: "10:00",
354
- step: "00:30",
355
- teleported: false
356
- }
357
- });
358
- await wrapper.trigger("click");
359
- await nextTick();
360
- const options = wrapper.findAll(".yh-time-select__option");
361
- expect(options.length).toBe(3);
362
- });
363
- });
364
- describe("expose \u65B9\u6CD5", () => {
365
- it("\u5E94\u66B4\u9732 focus \u65B9\u6CD5", () => {
366
- wrapper = mount(YhTimeSelect);
367
- expect(typeof wrapper.vm.focus).toBe("function");
368
- });
369
- it("\u5E94\u66B4\u9732 blur \u65B9\u6CD5", () => {
370
- wrapper = mount(YhTimeSelect);
371
- expect(typeof wrapper.vm.blur).toBe("function");
372
- });
373
- });
374
- });
@@ -1,55 +0,0 @@
1
- "use strict";
2
-
3
- var _serverRenderer = require("@vue/server-renderer");
4
- var _vitest = require("vitest");
5
- var _vue = require("vue");
6
- var _tooltip = _interopRequireDefault(require("../src/tooltip.vue"));
7
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
8
- (0, _vitest.describe)("YhTooltip SSR", () => {
9
- (0, _vitest.it)("should render trigger on server and suppress popper by default", async () => {
10
- const html = await (0, _serverRenderer.renderToString)((0, _vue.h)(_tooltip.default, {
11
- content: "ssr content"
12
- }, {
13
- default: () => (0, _vue.h)("button", "Trigger")
14
- }));
15
- (0, _vitest.expect)(html).toContain("yh-tooltip");
16
- (0, _vitest.expect)(html).toContain("Trigger");
17
- (0, _vitest.expect)(html).not.toContain("yh-tooltip__popper");
18
- });
19
- (0, _vitest.it)("should render content on server when visible is true", async () => {
20
- const html = await (0, _serverRenderer.renderToString)((0, _vue.h)(_tooltip.default, {
21
- content: "SSR Visible Content",
22
- visible: true,
23
- teleported: false
24
- }, {
25
- default: () => (0, _vue.h)("button", "Trigger")
26
- }));
27
- (0, _vitest.expect)(html).toContain("yh-tooltip__popper");
28
- (0, _vitest.expect)(html).toContain("SSR Visible Content");
29
- });
30
- (0, _vitest.it)("should support effect and custom class on server", async () => {
31
- const html = await (0, _serverRenderer.renderToString)((0, _vue.h)(_tooltip.default, {
32
- content: "theme test",
33
- effect: "light",
34
- popperClass: "custom-ssr-class",
35
- visible: true,
36
- teleported: false
37
- }, {
38
- default: () => (0, _vue.h)("button", "Trigger")
39
- }));
40
- (0, _vitest.expect)(html).toContain("yh-tooltip__popper--light");
41
- (0, _vitest.expect)(html).toContain("custom-ssr-class");
42
- });
43
- (0, _vitest.it)("should support raw HTML content on server", async () => {
44
- const html = await (0, _serverRenderer.renderToString)((0, _vue.h)(_tooltip.default, {
45
- content: '<span class="html-content">HTML</span>',
46
- rawContent: true,
47
- visible: true,
48
- teleported: false
49
- }, {
50
- default: () => (0, _vue.h)("button", "Trigger")
51
- }));
52
- (0, _vitest.expect)(html).toContain('class="html-content"');
53
- (0, _vitest.expect)(html).toContain("HTML");
54
- });
55
- });
@@ -1,76 +0,0 @@
1
- import { renderToString } from "@vue/server-renderer";
2
- import { describe, it, expect } from "vitest";
3
- import { h } from "vue";
4
- import YhTooltip from "../src/tooltip.vue";
5
- describe("YhTooltip SSR", () => {
6
- it("should render trigger on server and suppress popper by default", async () => {
7
- const html = await renderToString(
8
- h(
9
- YhTooltip,
10
- {
11
- content: "ssr content"
12
- },
13
- {
14
- default: () => h("button", "Trigger")
15
- }
16
- )
17
- );
18
- expect(html).toContain("yh-tooltip");
19
- expect(html).toContain("Trigger");
20
- expect(html).not.toContain("yh-tooltip__popper");
21
- });
22
- it("should render content on server when visible is true", async () => {
23
- const html = await renderToString(
24
- h(
25
- YhTooltip,
26
- {
27
- content: "SSR Visible Content",
28
- visible: true,
29
- teleported: false
30
- },
31
- {
32
- default: () => h("button", "Trigger")
33
- }
34
- )
35
- );
36
- expect(html).toContain("yh-tooltip__popper");
37
- expect(html).toContain("SSR Visible Content");
38
- });
39
- it("should support effect and custom class on server", async () => {
40
- const html = await renderToString(
41
- h(
42
- YhTooltip,
43
- {
44
- content: "theme test",
45
- effect: "light",
46
- popperClass: "custom-ssr-class",
47
- visible: true,
48
- teleported: false
49
- },
50
- {
51
- default: () => h("button", "Trigger")
52
- }
53
- )
54
- );
55
- expect(html).toContain("yh-tooltip__popper--light");
56
- expect(html).toContain("custom-ssr-class");
57
- });
58
- it("should support raw HTML content on server", async () => {
59
- const html = await renderToString(
60
- h(
61
- YhTooltip,
62
- {
63
- content: '<span class="html-content">HTML</span>',
64
- rawContent: true,
65
- visible: true,
66
- teleported: false
67
- },
68
- {
69
- default: () => h("button", "Trigger")
70
- }
71
- )
72
- );
73
- expect(html).toContain('class="html-content"');
74
- expect(html).toContain("HTML");
75
- });
76
- });
@@ -1,132 +0,0 @@
1
- "use strict";
2
-
3
- var _testUtils = require("@vue/test-utils");
4
- var _vitest = require("vitest");
5
- var _tooltip = _interopRequireDefault(require("../src/tooltip.vue"));
6
- var _vue = require("vue");
7
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
8
- _vitest.vi.mock("@floating-ui/dom", () => ({
9
- computePosition: _vitest.vi.fn(() => Promise.resolve({
10
- x: 0,
11
- y: 0,
12
- placement: "top",
13
- middlewareData: {
14
- arrow: {
15
- x: 0,
16
- y: 0
17
- }
18
- }
19
- })),
20
- offset: _vitest.vi.fn(),
21
- flip: _vitest.vi.fn(),
22
- shift: _vitest.vi.fn(),
23
- arrow: _vitest.vi.fn(),
24
- autoUpdate: _vitest.vi.fn(() => _vitest.vi.fn())
25
- }));
26
- (0, _vitest.describe)("YhTooltip", () => {
27
- (0, _vitest.beforeEach)(() => {
28
- _vitest.vi.useFakeTimers();
29
- document.body.innerHTML = "";
30
- _vitest.vi.clearAllMocks();
31
- });
32
- (0, _vitest.afterEach)(() => {
33
- _vitest.vi.useRealTimers();
34
- });
35
- (0, _vitest.it)("should render content correctly via prop and slot", async () => {
36
- const wrapper = (0, _testUtils.mount)(_tooltip.default, {
37
- props: {
38
- content: "prop content",
39
- visible: true,
40
- showAfter: 0
41
- },
42
- slots: {
43
- default: '<button id="trigger">trigger</button>'
44
- }
45
- });
46
- await (0, _vue.nextTick)();
47
- await (0, _vue.nextTick)();
48
- const popper = document.querySelector(".yh-tooltip__popper");
49
- (0, _vitest.expect)(popper).toBeTruthy();
50
- (0, _vitest.expect)(popper.textContent).toContain("prop content");
51
- });
52
- (0, _vitest.it)("should handle show-after and hide-after delays", async () => {
53
- const wrapper = (0, _testUtils.mount)(_tooltip.default, {
54
- props: {
55
- content: "delayed",
56
- showAfter: 500,
57
- hideAfter: 500,
58
- persistent: false
59
- },
60
- slots: {
61
- default: '<button id="trigger">trigger</button>'
62
- }
63
- });
64
- await wrapper.find(".yh-tooltip").trigger("mouseenter");
65
- (0, _vitest.expect)(document.querySelector(".yh-tooltip__popper")).toBeFalsy();
66
- _vitest.vi.advanceTimersByTime(510);
67
- await (0, _vue.nextTick)();
68
- await (0, _vue.nextTick)();
69
- (0, _vitest.expect)(document.querySelector(".yh-tooltip__popper")).toBeTruthy();
70
- await wrapper.find(".yh-tooltip").trigger("mouseleave");
71
- (0, _vitest.expect)(document.querySelector(".yh-tooltip__popper")).toBeTruthy();
72
- _vitest.vi.advanceTimersByTime(510);
73
- await (0, _vue.nextTick)();
74
- await (0, _vue.nextTick)();
75
- (0, _vitest.expect)(document.querySelector(".yh-tooltip__popper")).toBeFalsy();
76
- });
77
- (0, _vitest.it)("should support manual trigger via visible prop", async () => {
78
- const wrapper = (0, _testUtils.mount)(_tooltip.default, {
79
- props: {
80
- content: "manual",
81
- visible: false,
82
- persistent: false
83
- },
84
- slots: {
85
- default: "<button>trigger</button>"
86
- }
87
- });
88
- (0, _vitest.expect)(document.querySelector(".yh-tooltip__popper")).toBeFalsy();
89
- await wrapper.setProps({
90
- visible: true
91
- });
92
- await (0, _vue.nextTick)();
93
- await (0, _vue.nextTick)();
94
- (0, _vitest.expect)(document.querySelector(".yh-tooltip__popper")).toBeTruthy();
95
- });
96
- (0, _vitest.it)("should support follow-cursor mode", async () => {
97
- const floating = await Promise.resolve().then(() => require("@floating-ui/dom"));
98
- const wrapper = (0, _testUtils.mount)(_tooltip.default, {
99
- props: {
100
- content: "following",
101
- followCursor: true,
102
- showAfter: 0,
103
- visible: true
104
- },
105
- slots: {
106
- default: '<button id="trigger">trigger</button>'
107
- }
108
- });
109
- await (0, _vue.nextTick)();
110
- await (0, _vue.nextTick)();
111
- window.dispatchEvent(new MouseEvent("mousemove", {
112
- clientX: 100,
113
- clientY: 100
114
- }));
115
- (0, _vitest.expect)(floating.computePosition).toHaveBeenCalled();
116
- });
117
- (0, _vitest.it)("should not show when disabled", async () => {
118
- const wrapper = (0, _testUtils.mount)(_tooltip.default, {
119
- props: {
120
- content: "disabled",
121
- disabled: true,
122
- persistent: false
123
- },
124
- slots: {
125
- default: '<button id="trigger">trigger</button>'
126
- }
127
- });
128
- await wrapper.find(".yh-tooltip").trigger("mouseenter");
129
- await (0, _vue.nextTick)();
130
- (0, _vitest.expect)(document.querySelector(".yh-tooltip__popper")).toBeFalsy();
131
- });
132
- });