@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,101 +0,0 @@
1
- "use strict";
2
-
3
- var _vitest = require("vitest");
4
- var _testUtils = require("@vue/test-utils");
5
- var _vue = require("vue");
6
- var _index = require("../index.cjs");
7
- (0, _vitest.describe)("Affix Bottom Logic", () => {
8
- let mockRect = {
9
- top: 500,
10
- bottom: 600,
11
- left: 100,
12
- width: 200,
13
- height: 100
14
- };
15
- (0, _vitest.beforeEach)(() => {
16
- _vitest.vi.stubGlobal("innerHeight", 800);
17
- Element.prototype.getBoundingClientRect = _vitest.vi.fn(() => ({
18
- ...mockRect,
19
- right: mockRect.left + mockRect.width,
20
- toJSON: () => {}
21
- }));
22
- class IntersectionObserverMock {
23
- constructor(callback) {
24
- this.callback = callback;
25
- }
26
- observe() {
27
- this.callback([{
28
- isIntersecting: true
29
- }]);
30
- }
31
- unobserve() {}
32
- disconnect() {}
33
- }
34
- class ResizeObserverMock {
35
- observe() {}
36
- unobserve() {}
37
- disconnect() {}
38
- }
39
- _vitest.vi.stubGlobal("IntersectionObserver", IntersectionObserverMock);
40
- _vitest.vi.stubGlobal("ResizeObserver", ResizeObserverMock);
41
- });
42
- (0, _vitest.afterEach)(() => {
43
- _vitest.vi.unstubAllGlobals();
44
- _vitest.vi.restoreAllMocks();
45
- });
46
- (0, _vitest.it)("should not be fixed when distance from bottom is large", async () => {
47
- mockRect.bottom = 600;
48
- const wrapper = (0, _testUtils.mount)(_index.YhAffix, {
49
- props: {
50
- position: "bottom",
51
- offset: 20
52
- },
53
- slots: {
54
- default: () => (0, _vue.h)("div", "content")
55
- }
56
- });
57
- await new Promise(resolve => setTimeout(resolve, 0));
58
- await (0, _vue.nextTick)();
59
- wrapper.vm.update();
60
- await (0, _vue.nextTick)();
61
- (0, _vitest.expect)(wrapper.vm.fixed).toBe(false);
62
- });
63
- (0, _vitest.it)("should be fixed when distance from bottom is small", async () => {
64
- mockRect.bottom = 790;
65
- const wrapper = (0, _testUtils.mount)(_index.YhAffix, {
66
- props: {
67
- position: "bottom",
68
- offset: 20
69
- },
70
- slots: {
71
- default: () => (0, _vue.h)("div", "content")
72
- }
73
- });
74
- await new Promise(resolve => setTimeout(resolve, 0));
75
- await (0, _vue.nextTick)();
76
- wrapper.vm.update();
77
- await (0, _vue.nextTick)();
78
- (0, _vitest.expect)(wrapper.vm.fixed).toBe(true);
79
- });
80
- (0, _vitest.it)("should apply correct fixed style for bottom", async () => {
81
- mockRect.bottom = 790;
82
- const wrapper = (0, _testUtils.mount)(_index.YhAffix, {
83
- props: {
84
- position: "bottom",
85
- offset: 20
86
- },
87
- slots: {
88
- default: () => (0, _vue.h)("div", "content")
89
- }
90
- });
91
- await new Promise(resolve => setTimeout(resolve, 0));
92
- await (0, _vue.nextTick)();
93
- wrapper.vm.update();
94
- await (0, _vue.nextTick)();
95
- const inner = wrapper.find(".yh-affix__inner");
96
- const style = inner.attributes("style");
97
- (0, _vitest.expect)(style).toContain("position: fixed");
98
- (0, _vitest.expect)(style).toContain("bottom: 20px");
99
- (0, _vitest.expect)(style).toContain("left: 100px");
100
- });
101
- });
@@ -1,88 +0,0 @@
1
- import { describe, it, expect, vi, beforeEach, afterEach } from "vitest";
2
- import { mount } from "@vue/test-utils";
3
- import { nextTick, h } from "vue";
4
- import { YhAffix } from "../index.mjs";
5
- describe("Affix Bottom Logic", () => {
6
- let mockRect = {
7
- top: 500,
8
- bottom: 600,
9
- left: 100,
10
- width: 200,
11
- height: 100
12
- };
13
- beforeEach(() => {
14
- vi.stubGlobal("innerHeight", 800);
15
- Element.prototype.getBoundingClientRect = vi.fn(() => ({
16
- ...mockRect,
17
- right: mockRect.left + mockRect.width,
18
- toJSON: () => {
19
- }
20
- }));
21
- class IntersectionObserverMock {
22
- constructor(callback) {
23
- this.callback = callback;
24
- }
25
- observe() {
26
- this.callback([{ isIntersecting: true }]);
27
- }
28
- unobserve() {
29
- }
30
- disconnect() {
31
- }
32
- }
33
- class ResizeObserverMock {
34
- observe() {
35
- }
36
- unobserve() {
37
- }
38
- disconnect() {
39
- }
40
- }
41
- vi.stubGlobal("IntersectionObserver", IntersectionObserverMock);
42
- vi.stubGlobal("ResizeObserver", ResizeObserverMock);
43
- });
44
- afterEach(() => {
45
- vi.unstubAllGlobals();
46
- vi.restoreAllMocks();
47
- });
48
- it("should not be fixed when distance from bottom is large", async () => {
49
- mockRect.bottom = 600;
50
- const wrapper = mount(YhAffix, {
51
- props: { position: "bottom", offset: 20 },
52
- slots: { default: () => h("div", "content") }
53
- });
54
- await new Promise((resolve) => setTimeout(resolve, 0));
55
- await nextTick();
56
- wrapper.vm.update();
57
- await nextTick();
58
- expect(wrapper.vm.fixed).toBe(false);
59
- });
60
- it("should be fixed when distance from bottom is small", async () => {
61
- mockRect.bottom = 790;
62
- const wrapper = mount(YhAffix, {
63
- props: { position: "bottom", offset: 20 },
64
- slots: { default: () => h("div", "content") }
65
- });
66
- await new Promise((resolve) => setTimeout(resolve, 0));
67
- await nextTick();
68
- wrapper.vm.update();
69
- await nextTick();
70
- expect(wrapper.vm.fixed).toBe(true);
71
- });
72
- it("should apply correct fixed style for bottom", async () => {
73
- mockRect.bottom = 790;
74
- const wrapper = mount(YhAffix, {
75
- props: { position: "bottom", offset: 20 },
76
- slots: { default: () => h("div", "content") }
77
- });
78
- await new Promise((resolve) => setTimeout(resolve, 0));
79
- await nextTick();
80
- wrapper.vm.update();
81
- await nextTick();
82
- const inner = wrapper.find(".yh-affix__inner");
83
- const style = inner.attributes("style");
84
- expect(style).toContain("position: fixed");
85
- expect(style).toContain("bottom: 20px");
86
- expect(style).toContain("left: 100px");
87
- });
88
- });
@@ -1,38 +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 _affix = _interopRequireDefault(require("../src/affix.vue"));
7
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
8
- (0, _vitest.describe)("YhAffix SSR", () => {
9
- (0, _vitest.it)("should render on server without errors", async () => {
10
- const html = await (0, _serverRenderer.renderToString)((0, _vue.h)(_affix.default, {
11
- offset: 20,
12
- position: "top"
13
- }, {
14
- default: () => (0, _vue.h)("div", {
15
- class: "affix-content"
16
- }, "Affix Content")
17
- }));
18
- (0, _vitest.expect)(html).toContain("yh-affix");
19
- (0, _vitest.expect)(html).toContain("affix-content");
20
- (0, _vitest.expect)(html).toContain("Affix Content");
21
- });
22
- (0, _vitest.it)("should render with bottom position on server", async () => {
23
- const html = await (0, _serverRenderer.renderToString)((0, _vue.h)(_affix.default, {
24
- position: "bottom",
25
- offset: 10
26
- }, {
27
- default: () => (0, _vue.h)("button", "Back to top")
28
- }));
29
- (0, _vitest.expect)(html).toContain("yh-affix");
30
- (0, _vitest.expect)(html).toContain("Back to top");
31
- });
32
- (0, _vitest.it)("should not have fixed state on server render", async () => {
33
- const html = await (0, _serverRenderer.renderToString)((0, _vue.h)(_affix.default, {}, {
34
- default: () => (0, _vue.h)("div", "Content")
35
- }));
36
- (0, _vitest.expect)(html).not.toContain("is-fixed");
37
- });
38
- });
@@ -1,51 +0,0 @@
1
- import { renderToString } from "@vue/server-renderer";
2
- import { describe, it, expect } from "vitest";
3
- import { h } from "vue";
4
- import YhAffix from "../src/affix.vue";
5
- describe("YhAffix SSR", () => {
6
- it("should render on server without errors", async () => {
7
- const html = await renderToString(
8
- h(
9
- YhAffix,
10
- {
11
- offset: 20,
12
- position: "top"
13
- },
14
- {
15
- default: () => h("div", { class: "affix-content" }, "Affix Content")
16
- }
17
- )
18
- );
19
- expect(html).toContain("yh-affix");
20
- expect(html).toContain("affix-content");
21
- expect(html).toContain("Affix Content");
22
- });
23
- it("should render with bottom position on server", async () => {
24
- const html = await renderToString(
25
- h(
26
- YhAffix,
27
- {
28
- position: "bottom",
29
- offset: 10
30
- },
31
- {
32
- default: () => h("button", "Back to top")
33
- }
34
- )
35
- );
36
- expect(html).toContain("yh-affix");
37
- expect(html).toContain("Back to top");
38
- });
39
- it("should not have fixed state on server render", async () => {
40
- const html = await renderToString(
41
- h(
42
- YhAffix,
43
- {},
44
- {
45
- default: () => h("div", "Content")
46
- }
47
- )
48
- );
49
- expect(html).not.toContain("is-fixed");
50
- });
51
- });
@@ -1,185 +0,0 @@
1
- "use strict";
2
-
3
- var _vitest = require("vitest");
4
- var _testUtils = require("@vue/test-utils");
5
- var _vue = require("vue");
6
- var _index = require("../index.cjs");
7
- let ioCallback;
8
- class IntersectionObserverMock {
9
- constructor(callback) {
10
- this.callback = callback;
11
- ioCallback = callback;
12
- }
13
- observe = _vitest.vi.fn(() => {
14
- ioCallback([{
15
- isIntersecting: true
16
- }]);
17
- });
18
- unobserve = _vitest.vi.fn();
19
- disconnect = _vitest.vi.fn();
20
- }
21
- class ResizeObserverMock {
22
- observe = _vitest.vi.fn();
23
- unobserve = _vitest.vi.fn();
24
- disconnect = _vitest.vi.fn();
25
- }
26
- _vitest.vi.stubGlobal("IntersectionObserver", IntersectionObserverMock);
27
- _vitest.vi.stubGlobal("ResizeObserver", ResizeObserverMock);
28
- (0, _vitest.describe)("Affix", () => {
29
- (0, _vitest.beforeEach)(() => {
30
- _vitest.vi.useFakeTimers();
31
- Object.defineProperty(window, "innerHeight", {
32
- value: 1e3,
33
- configurable: true
34
- });
35
- Object.defineProperty(document.documentElement, "clientHeight", {
36
- value: 1e3,
37
- configurable: true
38
- });
39
- });
40
- (0, _vitest.afterEach)(() => {
41
- _vitest.vi.useRealTimers();
42
- _vitest.vi.restoreAllMocks();
43
- });
44
- (0, _vitest.it)("should render correctly", () => {
45
- const wrapper = (0, _testUtils.mount)(_index.YhAffix, {
46
- slots: {
47
- default: () => (0, _vue.h)("div", {
48
- class: "content"
49
- }, "Affix Content")
50
- }
51
- });
52
- (0, _vitest.expect)(wrapper.find(".yh-affix").exists()).toBe(true);
53
- });
54
- (0, _vitest.it)("should pin to top when scrolled past offset", async () => {
55
- const wrapper = (0, _testUtils.mount)(_index.YhAffix, {
56
- props: {
57
- offset: 50,
58
- position: "top"
59
- }
60
- });
61
- const vm = wrapper.vm;
62
- const rootEl = wrapper.element;
63
- rootEl.getBoundingClientRect = _vitest.vi.fn(() => ({
64
- top: 100,
65
- bottom: 200,
66
- left: 0,
67
- width: 100,
68
- height: 100,
69
- right: 100,
70
- x: 0,
71
- y: 0,
72
- toJSON: () => {}
73
- }));
74
- vm.update();
75
- (0, _vitest.expect)(vm.fixed).toBe(false);
76
- rootEl.getBoundingClientRect = _vitest.vi.fn(() => ({
77
- top: 40,
78
- bottom: 140,
79
- left: 0,
80
- width: 100,
81
- height: 100,
82
- right: 100,
83
- x: 0,
84
- y: 0,
85
- toJSON: () => {}
86
- }));
87
- vm.update();
88
- await (0, _vue.nextTick)();
89
- (0, _vitest.expect)(vm.fixed).toBe(true);
90
- const inner = wrapper.find(".yh-affix__inner");
91
- (0, _vitest.expect)(inner.classes()).toContain("is-fixed");
92
- (0, _vitest.expect)(inner.element.style.top).toBe("50px");
93
- });
94
- (0, _vitest.it)("should pin to bottom correctly", async () => {
95
- const wrapper = (0, _testUtils.mount)(_index.YhAffix, {
96
- props: {
97
- offset: 50,
98
- position: "bottom"
99
- }
100
- });
101
- const vm = wrapper.vm;
102
- const rootEl = wrapper.element;
103
- rootEl.getBoundingClientRect = _vitest.vi.fn(() => ({
104
- top: 900,
105
- bottom: 1e3,
106
- left: 0,
107
- width: 100,
108
- height: 100,
109
- right: 100,
110
- x: 0,
111
- y: 0,
112
- toJSON: () => {}
113
- }));
114
- vm.update();
115
- await (0, _vue.nextTick)();
116
- (0, _vitest.expect)(vm.fixed).toBe(true);
117
- const inner = wrapper.find(".yh-affix__inner");
118
- (0, _vitest.expect)(inner.element.style.bottom).toBe("50px");
119
- });
120
- (0, _vitest.it)("should handle target container", async () => {
121
- const container = document.createElement("div");
122
- container.id = "container";
123
- document.body.appendChild(container);
124
- const wrapper = (0, _testUtils.mount)(_index.YhAffix, {
125
- props: {
126
- target: "#container",
127
- offset: 0
128
- },
129
- attachTo: document.body
130
- });
131
- const vm = wrapper.vm;
132
- const rootEl = wrapper.element;
133
- rootEl.getBoundingClientRect = _vitest.vi.fn(() => ({
134
- top: -100,
135
- bottom: 0,
136
- width: 100,
137
- height: 100,
138
- left: 0,
139
- right: 100,
140
- x: 0,
141
- y: 0,
142
- toJSON: () => {}
143
- }));
144
- container.getBoundingClientRect = _vitest.vi.fn(() => ({
145
- top: -200,
146
- bottom: 50,
147
- width: 100,
148
- height: 250,
149
- left: 0,
150
- right: 100,
151
- x: 0,
152
- y: 0,
153
- toJSON: () => {}
154
- }));
155
- vm.update();
156
- await (0, _vue.nextTick)();
157
- (0, _vitest.expect)(vm.fixed).toBe(true);
158
- (0, _vitest.expect)(vm.transform).toBe(-50);
159
- document.body.removeChild(container);
160
- wrapper.unmount();
161
- });
162
- (0, _vitest.it)("should emit events", async () => {
163
- const wrapper = (0, _testUtils.mount)(_index.YhAffix, {
164
- props: {
165
- offset: 0
166
- }
167
- });
168
- const vm = wrapper.vm;
169
- const rootEl = wrapper.element;
170
- rootEl.getBoundingClientRect = _vitest.vi.fn(() => ({
171
- top: -10,
172
- bottom: 90,
173
- width: 100,
174
- height: 100,
175
- left: 0,
176
- right: 100,
177
- x: 0,
178
- y: 0,
179
- toJSON: () => {}
180
- }));
181
- vm.update();
182
- (0, _vitest.expect)(wrapper.emitted("change")).toBeTruthy();
183
- (0, _vitest.expect)(wrapper.emitted("scroll")).toBeTruthy();
184
- });
185
- });
@@ -1,180 +0,0 @@
1
- import { describe, it, expect, vi, beforeEach, afterEach } from "vitest";
2
- import { mount } from "@vue/test-utils";
3
- import { nextTick, h } from "vue";
4
- import { YhAffix } from "../index.mjs";
5
- let ioCallback;
6
- class IntersectionObserverMock {
7
- constructor(callback) {
8
- this.callback = callback;
9
- ioCallback = callback;
10
- }
11
- observe = vi.fn(() => {
12
- ioCallback([{ isIntersecting: true }]);
13
- });
14
- unobserve = vi.fn();
15
- disconnect = vi.fn();
16
- }
17
- class ResizeObserverMock {
18
- observe = vi.fn();
19
- unobserve = vi.fn();
20
- disconnect = vi.fn();
21
- }
22
- vi.stubGlobal("IntersectionObserver", IntersectionObserverMock);
23
- vi.stubGlobal("ResizeObserver", ResizeObserverMock);
24
- describe("Affix", () => {
25
- beforeEach(() => {
26
- vi.useFakeTimers();
27
- Object.defineProperty(window, "innerHeight", { value: 1e3, configurable: true });
28
- Object.defineProperty(document.documentElement, "clientHeight", {
29
- value: 1e3,
30
- configurable: true
31
- });
32
- });
33
- afterEach(() => {
34
- vi.useRealTimers();
35
- vi.restoreAllMocks();
36
- });
37
- it("should render correctly", () => {
38
- const wrapper = mount(YhAffix, {
39
- slots: {
40
- default: () => h("div", { class: "content" }, "Affix Content")
41
- }
42
- });
43
- expect(wrapper.find(".yh-affix").exists()).toBe(true);
44
- });
45
- it("should pin to top when scrolled past offset", async () => {
46
- const wrapper = mount(YhAffix, {
47
- props: {
48
- offset: 50,
49
- position: "top"
50
- }
51
- });
52
- const vm = wrapper.vm;
53
- const rootEl = wrapper.element;
54
- rootEl.getBoundingClientRect = vi.fn(() => ({
55
- top: 100,
56
- bottom: 200,
57
- left: 0,
58
- width: 100,
59
- height: 100,
60
- right: 100,
61
- x: 0,
62
- y: 0,
63
- toJSON: () => {
64
- }
65
- }));
66
- vm.update();
67
- expect(vm.fixed).toBe(false);
68
- rootEl.getBoundingClientRect = vi.fn(() => ({
69
- top: 40,
70
- bottom: 140,
71
- left: 0,
72
- width: 100,
73
- height: 100,
74
- right: 100,
75
- x: 0,
76
- y: 0,
77
- toJSON: () => {
78
- }
79
- }));
80
- vm.update();
81
- await nextTick();
82
- expect(vm.fixed).toBe(true);
83
- const inner = wrapper.find(".yh-affix__inner");
84
- expect(inner.classes()).toContain("is-fixed");
85
- expect(inner.element.style.top).toBe("50px");
86
- });
87
- it("should pin to bottom correctly", async () => {
88
- const wrapper = mount(YhAffix, {
89
- props: {
90
- offset: 50,
91
- position: "bottom"
92
- }
93
- });
94
- const vm = wrapper.vm;
95
- const rootEl = wrapper.element;
96
- rootEl.getBoundingClientRect = vi.fn(() => ({
97
- top: 900,
98
- bottom: 1e3,
99
- left: 0,
100
- width: 100,
101
- height: 100,
102
- right: 100,
103
- x: 0,
104
- y: 0,
105
- toJSON: () => {
106
- }
107
- }));
108
- vm.update();
109
- await nextTick();
110
- expect(vm.fixed).toBe(true);
111
- const inner = wrapper.find(".yh-affix__inner");
112
- expect(inner.element.style.bottom).toBe("50px");
113
- });
114
- it("should handle target container", async () => {
115
- const container = document.createElement("div");
116
- container.id = "container";
117
- document.body.appendChild(container);
118
- const wrapper = mount(YhAffix, {
119
- props: {
120
- target: "#container",
121
- offset: 0
122
- },
123
- attachTo: document.body
124
- });
125
- const vm = wrapper.vm;
126
- const rootEl = wrapper.element;
127
- rootEl.getBoundingClientRect = vi.fn(() => ({
128
- top: -100,
129
- bottom: 0,
130
- width: 100,
131
- height: 100,
132
- left: 0,
133
- right: 100,
134
- x: 0,
135
- y: 0,
136
- toJSON: () => {
137
- }
138
- }));
139
- container.getBoundingClientRect = vi.fn(() => ({
140
- top: -200,
141
- bottom: 50,
142
- width: 100,
143
- height: 250,
144
- left: 0,
145
- right: 100,
146
- x: 0,
147
- y: 0,
148
- toJSON: () => {
149
- }
150
- }));
151
- vm.update();
152
- await nextTick();
153
- expect(vm.fixed).toBe(true);
154
- expect(vm.transform).toBe(-50);
155
- document.body.removeChild(container);
156
- wrapper.unmount();
157
- });
158
- it("should emit events", async () => {
159
- const wrapper = mount(YhAffix, {
160
- props: { offset: 0 }
161
- });
162
- const vm = wrapper.vm;
163
- const rootEl = wrapper.element;
164
- rootEl.getBoundingClientRect = vi.fn(() => ({
165
- top: -10,
166
- bottom: 90,
167
- width: 100,
168
- height: 100,
169
- left: 0,
170
- right: 100,
171
- x: 0,
172
- y: 0,
173
- toJSON: () => {
174
- }
175
- }));
176
- vm.update();
177
- expect(wrapper.emitted("change")).toBeTruthy();
178
- expect(wrapper.emitted("scroll")).toBeTruthy();
179
- });
180
- });
@@ -1,55 +0,0 @@
1
- "use strict";
2
-
3
- var _vitest = require("vitest");
4
- var _serverRenderer = require("@vue/server-renderer");
5
- var _vue = require("vue");
6
- var _aiActionGroup = _interopRequireDefault(require("../src/ai-action-group.vue"));
7
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
8
- (0, _vitest.describe)("YhAiActionGroup SSR", () => {
9
- (0, _vitest.it)("should render to string on server", async () => {
10
- const html = await (0, _serverRenderer.renderToString)((0, _vue.h)(_aiActionGroup.default, {
11
- items: ["copy", "regenerate"]
12
- }));
13
- (0, _vitest.expect)(html).toContain("yh-ai-action-group");
14
- (0, _vitest.expect)(html).toContain("yh-ai-action-group--horizontal");
15
- });
16
- (0, _vitest.it)("should render vertical direction on server", async () => {
17
- const html = await (0, _serverRenderer.renderToString)((0, _vue.h)(_aiActionGroup.default, {
18
- items: [],
19
- direction: "vertical"
20
- }));
21
- (0, _vitest.expect)(html).toContain("yh-ai-action-group--vertical");
22
- });
23
- (0, _vitest.it)("should render item count correctly on server", async () => {
24
- const html = await (0, _serverRenderer.renderToString)((0, _vue.h)(_aiActionGroup.default, {
25
- items: [{
26
- key: "share",
27
- icon: "share",
28
- label: "\u5206\u4EAB"
29
- }, {
30
- key: "edit",
31
- icon: "edit",
32
- label: "\u7F16\u8F91"
33
- }]
34
- }));
35
- (0, _vitest.expect)(html).toContain("\u5206\u4EAB");
36
- (0, _vitest.expect)(html).toContain("\u7F16\u8F91");
37
- });
38
- (0, _vitest.it)("should render disabled state on server", async () => {
39
- const html = await (0, _serverRenderer.renderToString)((0, _vue.h)(_aiActionGroup.default, {
40
- items: [{
41
- key: "delete",
42
- icon: "delete",
43
- disabled: true
44
- }]
45
- }));
46
- (0, _vitest.expect)(html).toContain("is-disabled");
47
- });
48
- (0, _vitest.it)("should render size class on server", async () => {
49
- const html = await (0, _serverRenderer.renderToString)((0, _vue.h)(_aiActionGroup.default, {
50
- items: [],
51
- size: "large"
52
- }));
53
- (0, _vitest.expect)(html).toContain("yh-ai-action-group--large");
54
- });
55
- });