@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.
- package/README.md +2 -0
- package/dist/breadcrumb/src/breadcrumb-item.vue +10 -6
- package/dist/form/index.cjs +1 -1
- package/dist/form/index.d.ts +1 -1
- package/dist/form/index.mjs +1 -1
- package/dist/icon/index.cjs +1 -1
- package/dist/icon/index.d.ts +1 -1
- package/dist/icon/index.mjs +1 -1
- package/dist/loading/index.cjs +1 -1
- package/dist/loading/index.d.ts +1 -1
- package/dist/loading/index.mjs +1 -1
- package/dist/message/src/method.cjs +1 -1
- package/dist/message/src/method.d.ts +1 -1
- package/dist/message/src/method.mjs +1 -1
- package/dist/message-box/index.cjs +1 -1
- package/dist/message-box/index.d.ts +1 -1
- package/dist/message-box/index.mjs +1 -1
- package/dist/notification/src/method.cjs +1 -1
- package/dist/notification/src/method.d.ts +1 -1
- package/dist/notification/src/method.mjs +1 -1
- package/dist/resolver.cjs +1 -1
- package/dist/resolver.d.ts +7 -5
- package/dist/resolver.mjs +1 -1
- package/dist/style.css +584 -0
- package/package.json +9 -8
- package/dist/affix/__tests__/affix.bottom.test.cjs +0 -101
- package/dist/affix/__tests__/affix.bottom.test.mjs +0 -88
- package/dist/affix/__tests__/affix.ssr.test.cjs +0 -38
- package/dist/affix/__tests__/affix.ssr.test.mjs +0 -51
- package/dist/affix/__tests__/affix.test.cjs +0 -185
- package/dist/affix/__tests__/affix.test.mjs +0 -180
- package/dist/ai-action-group/__tests__/ai-action-group.ssr.test.cjs +0 -55
- package/dist/ai-action-group/__tests__/ai-action-group.ssr.test.mjs +0 -39
- package/dist/ai-action-group/__tests__/ai-action-group.test.cjs +0 -235
- package/dist/ai-action-group/__tests__/ai-action-group.test.mjs +0 -157
- package/dist/ai-agent-card/__tests__/ai-agent-card.ssr.test.cjs +0 -61
- package/dist/ai-agent-card/__tests__/ai-agent-card.ssr.test.mjs +0 -65
- package/dist/ai-agent-card/__tests__/ai-agent-card.test.cjs +0 -205
- package/dist/ai-agent-card/__tests__/ai-agent-card.test.mjs +0 -133
- package/dist/ai-artifacts/__tests__/ai-artifacts.ssr.test.cjs +0 -73
- package/dist/ai-artifacts/__tests__/ai-artifacts.ssr.test.mjs +0 -68
- package/dist/ai-artifacts/__tests__/ai-artifacts.test.cjs +0 -128
- package/dist/ai-artifacts/__tests__/ai-artifacts.test.mjs +0 -109
- package/dist/ai-attachments/__tests__/ai-attachments.ssr.test.cjs +0 -50
- package/dist/ai-attachments/__tests__/ai-attachments.ssr.test.mjs +0 -33
- package/dist/ai-attachments/__tests__/ai-attachments.test.cjs +0 -113
- package/dist/ai-attachments/__tests__/ai-attachments.test.mjs +0 -81
- package/dist/ai-bubble/__tests__/ai-bubble.ssr.test.cjs +0 -95
- package/dist/ai-bubble/__tests__/ai-bubble.ssr.test.mjs +0 -66
- package/dist/ai-bubble/__tests__/ai-bubble.test.cjs +0 -624
- package/dist/ai-bubble/__tests__/ai-bubble.test.mjs +0 -393
- package/dist/ai-bubble-list/__tests__/ai-bubble-list.ssr.test.cjs +0 -51
- package/dist/ai-bubble-list/__tests__/ai-bubble-list.ssr.test.mjs +0 -51
- package/dist/ai-bubble-list/__tests__/ai-bubble-list.test.cjs +0 -138
- package/dist/ai-bubble-list/__tests__/ai-bubble-list.test.mjs +0 -112
- package/dist/ai-chat/__tests__/ai-chat.ssr.test.cjs +0 -90
- package/dist/ai-chat/__tests__/ai-chat.ssr.test.mjs +0 -77
- package/dist/ai-chat/__tests__/ai-chat.test.cjs +0 -177
- package/dist/ai-chat/__tests__/ai-chat.test.mjs +0 -129
- package/dist/ai-code-block/__tests__/ai-code-block.ssr.test.cjs +0 -75
- package/dist/ai-code-block/__tests__/ai-code-block.ssr.test.mjs +0 -57
- package/dist/ai-code-block/__tests__/ai-code-block.test.cjs +0 -174
- package/dist/ai-code-block/__tests__/ai-code-block.test.mjs +0 -108
- package/dist/ai-code-editor/__tests__/ai-code-editor.ssr.test.cjs +0 -46
- package/dist/ai-code-editor/__tests__/ai-code-editor.ssr.test.mjs +0 -39
- package/dist/ai-code-editor/__tests__/ai-code-editor.test.cjs +0 -90
- package/dist/ai-code-editor/__tests__/ai-code-editor.test.mjs +0 -78
- package/dist/ai-code-runner/__tests__/ai-code-runner.ssr.test.cjs +0 -28
- package/dist/ai-code-runner/__tests__/ai-code-runner.ssr.test.mjs +0 -26
- package/dist/ai-code-runner/__tests__/ai-code-runner.test.cjs +0 -69
- package/dist/ai-code-runner/__tests__/ai-code-runner.test.mjs +0 -66
- package/dist/ai-conversations/__tests__/ai-conversations.ssr.test.cjs +0 -50
- package/dist/ai-conversations/__tests__/ai-conversations.ssr.test.mjs +0 -42
- package/dist/ai-conversations/__tests__/ai-conversations.test.cjs +0 -67
- package/dist/ai-conversations/__tests__/ai-conversations.test.mjs +0 -51
- package/dist/ai-editor-sender/__tests__/ai-editor-sender.ssr.test.cjs +0 -62
- package/dist/ai-editor-sender/__tests__/ai-editor-sender.ssr.test.mjs +0 -50
- package/dist/ai-editor-sender/__tests__/ai-editor-sender.test.cjs +0 -315
- package/dist/ai-editor-sender/__tests__/ai-editor-sender.test.mjs +0 -226
- package/dist/ai-file-card/__tests__/ai-file-card.ssr.test.cjs +0 -45
- package/dist/ai-file-card/__tests__/ai-file-card.ssr.test.mjs +0 -29
- package/dist/ai-file-card/__tests__/ai-file-card.test.cjs +0 -160
- package/dist/ai-file-card/__tests__/ai-file-card.test.mjs +0 -109
- package/dist/ai-mention/__tests__/ai-mention.ssr.test.cjs +0 -38
- package/dist/ai-mention/__tests__/ai-mention.ssr.test.mjs +0 -37
- package/dist/ai-mention/__tests__/ai-mention.test.cjs +0 -113
- package/dist/ai-mention/__tests__/ai-mention.test.mjs +0 -84
- package/dist/ai-mermaid/__tests__/ai-mermaid.ssr.test.cjs +0 -43
- package/dist/ai-mermaid/__tests__/ai-mermaid.ssr.test.mjs +0 -33
- package/dist/ai-mermaid/__tests__/ai-mermaid.test.cjs +0 -113
- package/dist/ai-mermaid/__tests__/ai-mermaid.test.mjs +0 -92
- package/dist/ai-prompts/__tests__/ai-prompts.ssr.test.cjs +0 -49
- package/dist/ai-prompts/__tests__/ai-prompts.ssr.test.mjs +0 -41
- package/dist/ai-prompts/__tests__/ai-prompts.test.cjs +0 -54
- package/dist/ai-prompts/__tests__/ai-prompts.test.mjs +0 -38
- package/dist/ai-provider/__tests__/ai-provider.ssr.test.cjs +0 -33
- package/dist/ai-provider/__tests__/ai-provider.ssr.test.mjs +0 -34
- package/dist/ai-provider/__tests__/ai-provider.test.cjs +0 -38
- package/dist/ai-provider/__tests__/ai-provider.test.mjs +0 -33
- package/dist/ai-sender/__tests__/ai-sender.ssr.test.cjs +0 -46
- package/dist/ai-sender/__tests__/ai-sender.ssr.test.mjs +0 -37
- package/dist/ai-sender/__tests__/ai-sender.test.cjs +0 -511
- package/dist/ai-sender/__tests__/ai-sender.test.mjs +0 -322
- package/dist/ai-sources/__tests__/ai-sources.ssr.test.cjs +0 -72
- package/dist/ai-sources/__tests__/ai-sources.ssr.test.mjs +0 -82
- package/dist/ai-sources/__tests__/ai-sources.test.cjs +0 -200
- package/dist/ai-sources/__tests__/ai-sources.test.mjs +0 -160
- package/dist/ai-thinking/__tests__/ai-thinking.ssr.test.cjs +0 -56
- package/dist/ai-thinking/__tests__/ai-thinking.ssr.test.mjs +0 -42
- package/dist/ai-thinking/__tests__/ai-thinking.test.cjs +0 -151
- package/dist/ai-thinking/__tests__/ai-thinking.test.mjs +0 -96
- package/dist/ai-thought-chain/__tests__/ai-thought-chain.ssr.test.cjs +0 -88
- package/dist/ai-thought-chain/__tests__/ai-thought-chain.ssr.test.mjs +0 -55
- package/dist/ai-thought-chain/__tests__/ai-thought-chain.test.cjs +0 -344
- package/dist/ai-thought-chain/__tests__/ai-thought-chain.test.mjs +0 -237
- package/dist/ai-voice-trigger/__tests__/ai-voice-trigger.ssr.test.cjs +0 -32
- package/dist/ai-voice-trigger/__tests__/ai-voice-trigger.ssr.test.mjs +0 -25
- package/dist/ai-voice-trigger/__tests__/ai-voice-trigger.test.cjs +0 -130
- package/dist/ai-voice-trigger/__tests__/ai-voice-trigger.test.mjs +0 -103
- package/dist/ai-welcome/__tests__/ai-welcome.ssr.test.cjs +0 -57
- package/dist/ai-welcome/__tests__/ai-welcome.ssr.test.mjs +0 -39
- package/dist/ai-welcome/__tests__/ai-welcome.test.cjs +0 -169
- package/dist/ai-welcome/__tests__/ai-welcome.test.mjs +0 -113
- package/dist/alert/__tests__/alert.ssr.test.cjs +0 -28
- package/dist/alert/__tests__/alert.ssr.test.mjs +0 -29
- package/dist/alert/__tests__/alert.test.cjs +0 -123
- package/dist/alert/__tests__/alert.test.mjs +0 -110
- package/dist/autocomplete/__tests__/autocomplete.ssr.test.cjs +0 -54
- package/dist/autocomplete/__tests__/autocomplete.ssr.test.mjs +0 -47
- package/dist/autocomplete/__tests__/autocomplete.test.cjs +0 -299
- package/dist/autocomplete/__tests__/autocomplete.test.mjs +0 -263
- package/dist/avatar/__tests__/avatar.ssr.test.cjs +0 -103
- package/dist/avatar/__tests__/avatar.ssr.test.mjs +0 -108
- package/dist/avatar/__tests__/avatar.test.cjs +0 -146
- package/dist/avatar/__tests__/avatar.test.mjs +0 -125
- package/dist/back-top/__tests__/back-top.ssr.test.cjs +0 -13
- package/dist/back-top/__tests__/back-top.ssr.test.mjs +0 -10
- package/dist/back-top/__tests__/back-top.test.cjs +0 -88
- package/dist/back-top/__tests__/back-top.test.mjs +0 -76
- package/dist/badge/__tests__/badge.ssr.test.cjs +0 -36
- package/dist/badge/__tests__/badge.ssr.test.mjs +0 -33
- package/dist/badge/__tests__/badge.test.cjs +0 -115
- package/dist/badge/__tests__/badge.test.mjs +0 -112
- package/dist/breadcrumb/__tests__/breadcrumb.ssr.test.cjs +0 -22
- package/dist/breadcrumb/__tests__/breadcrumb.ssr.test.mjs +0 -20
- package/dist/breadcrumb/__tests__/breadcrumb.test.cjs +0 -64
- package/dist/breadcrumb/__tests__/breadcrumb.test.mjs +0 -51
- package/dist/button/__tests__/button.ssr.test.cjs +0 -52
- package/dist/button/__tests__/button.ssr.test.mjs +0 -55
- package/dist/button/__tests__/button.test.cjs +0 -207
- package/dist/button/__tests__/button.test.mjs +0 -141
- package/dist/calendar/__tests__/calendar.ssr.test.cjs +0 -65
- package/dist/calendar/__tests__/calendar.ssr.test.mjs +0 -63
- package/dist/calendar/__tests__/calendar.test.cjs +0 -263
- package/dist/calendar/__tests__/calendar.test.mjs +0 -255
- package/dist/card/__tests__/card.ssr.test.cjs +0 -37
- package/dist/card/__tests__/card.ssr.test.mjs +0 -40
- package/dist/card/__tests__/card.test.cjs +0 -131
- package/dist/card/__tests__/card.test.mjs +0 -124
- package/dist/carousel/__tests__/carousel.ssr.test.cjs +0 -27
- package/dist/carousel/__tests__/carousel.ssr.test.mjs +0 -27
- package/dist/carousel/__tests__/carousel.test.cjs +0 -115
- package/dist/carousel/__tests__/carousel.test.mjs +0 -98
- package/dist/cascader/__tests__/cascader-panel.test.cjs +0 -162
- package/dist/cascader/__tests__/cascader-panel.test.mjs +0 -151
- package/dist/cascader/__tests__/cascader.ssr.test.cjs +0 -61
- package/dist/cascader/__tests__/cascader.ssr.test.mjs +0 -55
- package/dist/cascader/__tests__/cascader.test.cjs +0 -342
- package/dist/cascader/__tests__/cascader.test.mjs +0 -316
- package/dist/category-nav/__tests__/category-nav.ssr.test.cjs +0 -35
- package/dist/category-nav/__tests__/category-nav.ssr.test.mjs +0 -21
- package/dist/category-nav/__tests__/category-nav.test.cjs +0 -53
- package/dist/category-nav/__tests__/category-nav.test.mjs +0 -33
- package/dist/checkbox/__tests__/checkbox.ssr.test.cjs +0 -52
- package/dist/checkbox/__tests__/checkbox.ssr.test.mjs +0 -57
- package/dist/checkbox/__tests__/checkbox.test.cjs +0 -173
- package/dist/checkbox/__tests__/checkbox.test.mjs +0 -133
- package/dist/col/__tests__/col.ssr.test.cjs +0 -44
- package/dist/col/__tests__/col.ssr.test.mjs +0 -42
- package/dist/col/__tests__/col.test.cjs +0 -128
- package/dist/col/__tests__/col.test.mjs +0 -116
- package/dist/color-picker/__tests__/color-picker.ssr.test.cjs +0 -34
- package/dist/color-picker/__tests__/color-picker.ssr.test.mjs +0 -39
- package/dist/color-picker/__tests__/color-picker.test.cjs +0 -227
- package/dist/color-picker/__tests__/color-picker.test.mjs +0 -176
- package/dist/config-provider/__tests__/config-provider.ssr.test.cjs +0 -43
- package/dist/config-provider/__tests__/config-provider.ssr.test.mjs +0 -42
- package/dist/config-provider/__tests__/config-provider.test.cjs +0 -75
- package/dist/config-provider/__tests__/config-provider.test.mjs +0 -64
- package/dist/container/__tests__/container.ssr.test.cjs +0 -71
- package/dist/container/__tests__/container.ssr.test.mjs +0 -50
- package/dist/container/__tests__/container.test.cjs +0 -111
- package/dist/container/__tests__/container.test.mjs +0 -84
- package/dist/countdown/__tests__/countdown.ssr.test.cjs +0 -86
- package/dist/countdown/__tests__/countdown.ssr.test.mjs +0 -78
- package/dist/countdown/__tests__/countdown.test.cjs +0 -767
- package/dist/countdown/__tests__/countdown.test.mjs +0 -722
- package/dist/coupon-card/__tests__/coupon-card.ssr.test.cjs +0 -21
- package/dist/coupon-card/__tests__/coupon-card.ssr.test.mjs +0 -18
- package/dist/coupon-card/__tests__/coupon-card.test.cjs +0 -67
- package/dist/coupon-card/__tests__/coupon-card.test.mjs +0 -64
- package/dist/date-picker/__tests__/date-picker-extended.test.cjs +0 -581
- package/dist/date-picker/__tests__/date-picker-extended.test.mjs +0 -455
- package/dist/date-picker/__tests__/date-picker.ssr.test.cjs +0 -26
- package/dist/date-picker/__tests__/date-picker.ssr.test.mjs +0 -23
- package/dist/date-picker/__tests__/date-picker.test.cjs +0 -170
- package/dist/date-picker/__tests__/date-picker.test.mjs +0 -136
- package/dist/descriptions/__tests__/descriptions.ssr.test.cjs +0 -67
- package/dist/descriptions/__tests__/descriptions.ssr.test.mjs +0 -72
- package/dist/descriptions/__tests__/descriptions.test.cjs +0 -150
- package/dist/descriptions/__tests__/descriptions.test.mjs +0 -130
- package/dist/dialog/__tests__/dialog.functional.test.cjs +0 -49
- package/dist/dialog/__tests__/dialog.functional.test.mjs +0 -49
- package/dist/dialog/__tests__/dialog.ssr.test.cjs +0 -31
- package/dist/dialog/__tests__/dialog.ssr.test.mjs +0 -29
- package/dist/dialog/__tests__/dialog.test.cjs +0 -561
- package/dist/dialog/__tests__/dialog.test.mjs +0 -388
- package/dist/divider/__tests__/divider.ssr.test.cjs +0 -41
- package/dist/divider/__tests__/divider.ssr.test.mjs +0 -44
- package/dist/divider/__tests__/divider.test.cjs +0 -71
- package/dist/divider/__tests__/divider.test.mjs +0 -68
- package/dist/drawer/__tests__/drawer.ssr.test.cjs +0 -25
- package/dist/drawer/__tests__/drawer.ssr.test.mjs +0 -23
- package/dist/drawer/__tests__/drawer.test.cjs +0 -145
- package/dist/drawer/__tests__/drawer.test.mjs +0 -122
- package/dist/dropdown/__tests__/dropdown.ssr.test.cjs +0 -49
- package/dist/dropdown/__tests__/dropdown.ssr.test.mjs +0 -64
- package/dist/dropdown/__tests__/dropdown.test.cjs +0 -310
- package/dist/dropdown/__tests__/dropdown.test.mjs +0 -269
- package/dist/empty/__tests__/empty.ssr.test.cjs +0 -96
- package/dist/empty/__tests__/empty.ssr.test.mjs +0 -99
- package/dist/empty/__tests__/empty.test.cjs +0 -110
- package/dist/empty/__tests__/empty.test.mjs +0 -101
- package/dist/filter-bar/__tests__/filter-bar.ssr.test.cjs +0 -29
- package/dist/filter-bar/__tests__/filter-bar.ssr.test.mjs +0 -16
- package/dist/filter-bar/__tests__/filter-bar.test.cjs +0 -51
- package/dist/filter-bar/__tests__/filter-bar.test.mjs +0 -29
- package/dist/form/__tests__/form-schema.test.cjs +0 -636
- package/dist/form/__tests__/form-schema.test.mjs +0 -366
- package/dist/form/__tests__/form.ssr.test.cjs +0 -74
- package/dist/form/__tests__/form.ssr.test.mjs +0 -73
- package/dist/form/__tests__/form.test.cjs +0 -208
- package/dist/form/__tests__/form.test.mjs +0 -128
- package/dist/gantt-chart/__tests__/debug_ssr.test.cjs +0 -51
- package/dist/gantt-chart/__tests__/debug_ssr.test.mjs +0 -37
- package/dist/gantt-chart/__tests__/gantt-chart.ssr.test.cjs +0 -95
- package/dist/gantt-chart/__tests__/gantt-chart.ssr.test.mjs +0 -94
- package/dist/gantt-chart/__tests__/gantt-chart.test.cjs +0 -86
- package/dist/gantt-chart/__tests__/gantt-chart.test.mjs +0 -79
- package/dist/grid/__tests__/grid.ssr.test.cjs +0 -81
- package/dist/grid/__tests__/grid.ssr.test.mjs +0 -63
- package/dist/grid/__tests__/grid.test.cjs +0 -142
- package/dist/grid/__tests__/grid.test.mjs +0 -89
- package/dist/icon/__tests__/icon.ssr.test.cjs +0 -35
- package/dist/icon/__tests__/icon.ssr.test.mjs +0 -26
- package/dist/icon/__tests__/icon.test.cjs +0 -144
- package/dist/icon/__tests__/icon.test.mjs +0 -123
- package/dist/image/__tests__/image-viewer.test.cjs +0 -101
- package/dist/image/__tests__/image-viewer.test.mjs +0 -94
- package/dist/image/__tests__/image.ssr.test.cjs +0 -73
- package/dist/image/__tests__/image.ssr.test.mjs +0 -72
- package/dist/image/__tests__/image.test.cjs +0 -171
- package/dist/image/__tests__/image.test.mjs +0 -159
- package/dist/image-magnifier/__tests__/image-magnifier.ssr.test.cjs +0 -54
- package/dist/image-magnifier/__tests__/image-magnifier.ssr.test.mjs +0 -35
- package/dist/image-magnifier/__tests__/image-magnifier.test.cjs +0 -257
- package/dist/image-magnifier/__tests__/image-magnifier.test.mjs +0 -177
- package/dist/infinite-scroll/__tests__/infinite-scroll.ssr.test.cjs +0 -59
- package/dist/infinite-scroll/__tests__/infinite-scroll.ssr.test.mjs +0 -84
- package/dist/infinite-scroll/__tests__/infinite-scroll.test.cjs +0 -255
- package/dist/infinite-scroll/__tests__/infinite-scroll.test.mjs +0 -187
- package/dist/input/__tests__/input-utils.test.cjs +0 -77
- package/dist/input/__tests__/input-utils.test.mjs +0 -75
- package/dist/input/__tests__/input.ssr.test.cjs +0 -100
- package/dist/input/__tests__/input.ssr.test.mjs +0 -85
- package/dist/input/__tests__/input.test.cjs +0 -127
- package/dist/input/__tests__/input.test.mjs +0 -112
- package/dist/input-number/__tests__/input-number.hydration.test.cjs +0 -24
- package/dist/input-number/__tests__/input-number.hydration.test.mjs +0 -21
- package/dist/input-number/__tests__/input-number.ssr.test.cjs +0 -95
- package/dist/input-number/__tests__/input-number.ssr.test.mjs +0 -92
- package/dist/input-number/__tests__/input-number.test.cjs +0 -199
- package/dist/input-number/__tests__/input-number.test.mjs +0 -173
- package/dist/input-tag/__tests__/input-tag.ssr.test.cjs +0 -47
- package/dist/input-tag/__tests__/input-tag.ssr.test.mjs +0 -41
- package/dist/input-tag/__tests__/input-tag.test.cjs +0 -268
- package/dist/input-tag/__tests__/input-tag.test.mjs +0 -201
- package/dist/loading/__tests__/loading.ssr.test.cjs +0 -37
- package/dist/loading/__tests__/loading.ssr.test.mjs +0 -27
- package/dist/loading/__tests__/loading.test.cjs +0 -91
- package/dist/loading/__tests__/loading.test.mjs +0 -75
- package/dist/lucky-draw/__tests__/lucky-draw.ssr.test.cjs +0 -33
- package/dist/lucky-draw/__tests__/lucky-draw.ssr.test.mjs +0 -31
- package/dist/lucky-draw/__tests__/lucky-draw.test.cjs +0 -56
- package/dist/lucky-draw/__tests__/lucky-draw.test.mjs +0 -48
- package/dist/marquee/__tests__/marquee.ssr.test.cjs +0 -59
- package/dist/marquee/__tests__/marquee.ssr.test.mjs +0 -60
- package/dist/marquee/__tests__/marquee.test.cjs +0 -94
- package/dist/marquee/__tests__/marquee.test.mjs +0 -92
- package/dist/mention/__tests__/mention.ssr.test.cjs +0 -92
- package/dist/mention/__tests__/mention.ssr.test.mjs +0 -70
- package/dist/mention/__tests__/mention.test.cjs +0 -650
- package/dist/mention/__tests__/mention.test.mjs +0 -523
- package/dist/menu/__tests__/menu.ssr.test.cjs +0 -92
- package/dist/menu/__tests__/menu.ssr.test.mjs +0 -124
- package/dist/menu/__tests__/menu.test.cjs +0 -209
- package/dist/menu/__tests__/menu.test.mjs +0 -182
- package/dist/message/__tests__/message.ssr.test.cjs +0 -29
- package/dist/message/__tests__/message.ssr.test.mjs +0 -23
- package/dist/message/__tests__/message.test.cjs +0 -170
- package/dist/message/__tests__/message.test.mjs +0 -154
- package/dist/message-box/__tests__/message-box.ssr.test.cjs +0 -33
- package/dist/message-box/__tests__/message-box.ssr.test.mjs +0 -30
- package/dist/message-box/__tests__/message-box.test.cjs +0 -100
- package/dist/message-box/__tests__/message-box.test.mjs +0 -95
- package/dist/notification/__tests__/notification.ssr.test.cjs +0 -31
- package/dist/notification/__tests__/notification.ssr.test.mjs +0 -25
- package/dist/notification/__tests__/notification.test.cjs +0 -248
- package/dist/notification/__tests__/notification.test.mjs +0 -206
- package/dist/pagination/__tests__/pagination.ssr.test.cjs +0 -61
- package/dist/pagination/__tests__/pagination.ssr.test.mjs +0 -59
- package/dist/pagination/__tests__/pagination.test.cjs +0 -135
- package/dist/pagination/__tests__/pagination.test.mjs +0 -131
- package/dist/popconfirm/__tests__/popconfirm.ssr.test.cjs +0 -48
- package/dist/popconfirm/__tests__/popconfirm.ssr.test.mjs +0 -63
- package/dist/popconfirm/__tests__/popconfirm.test.cjs +0 -62
- package/dist/popconfirm/__tests__/popconfirm.test.mjs +0 -56
- package/dist/popover/__tests__/popover.ssr.test.cjs +0 -48
- package/dist/popover/__tests__/popover.ssr.test.mjs +0 -63
- package/dist/popover/__tests__/popover.test.cjs +0 -107
- package/dist/popover/__tests__/popover.test.mjs +0 -93
- package/dist/price/__tests__/price.ssr.test.cjs +0 -20
- package/dist/price/__tests__/price.ssr.test.mjs +0 -19
- package/dist/price/__tests__/price.test.cjs +0 -45
- package/dist/price/__tests__/price.test.mjs +0 -42
- package/dist/product-card/__tests__/product-card.ssr.test.cjs +0 -21
- package/dist/product-card/__tests__/product-card.ssr.test.mjs +0 -18
- package/dist/product-card/__tests__/product-card.test.cjs +0 -54
- package/dist/product-card/__tests__/product-card.test.mjs +0 -53
- package/dist/progress/__tests__/progress.ssr.test.cjs +0 -31
- package/dist/progress/__tests__/progress.ssr.test.mjs +0 -29
- package/dist/progress/__tests__/progress.test.cjs +0 -119
- package/dist/progress/__tests__/progress.test.mjs +0 -77
- package/dist/radio/__tests__/radio-button.test.cjs +0 -99
- package/dist/radio/__tests__/radio-button.test.mjs +0 -83
- package/dist/radio/__tests__/radio.ssr.test.cjs +0 -132
- package/dist/radio/__tests__/radio.ssr.test.mjs +0 -165
- package/dist/radio/__tests__/radio.test.cjs +0 -170
- package/dist/radio/__tests__/radio.test.mjs +0 -143
- package/dist/rate/__tests__/rate.ssr.test.cjs +0 -106
- package/dist/rate/__tests__/rate.ssr.test.mjs +0 -103
- package/dist/rate/__tests__/rate.test.cjs +0 -88
- package/dist/rate/__tests__/rate.test.mjs +0 -85
- package/dist/result/__tests__/result.ssr.test.cjs +0 -62
- package/dist/result/__tests__/result.ssr.test.mjs +0 -51
- package/dist/result/__tests__/result.test.cjs +0 -135
- package/dist/result/__tests__/result.test.mjs +0 -92
- package/dist/row/__tests__/row.ssr.test.cjs +0 -29
- package/dist/row/__tests__/row.ssr.test.mjs +0 -30
- package/dist/row/__tests__/row.test.cjs +0 -89
- package/dist/row/__tests__/row.test.mjs +0 -86
- package/dist/row/__tests__/row_ts.test.cjs +0 -31
- package/dist/row/__tests__/row_ts.test.mjs +0 -28
- package/dist/scrollbar/__tests__/scrollbar.ssr.test.cjs +0 -49
- package/dist/scrollbar/__tests__/scrollbar.ssr.test.mjs +0 -54
- package/dist/scrollbar/__tests__/scrollbar.test.cjs +0 -43
- package/dist/scrollbar/__tests__/scrollbar.test.mjs +0 -40
- package/dist/select/__tests__/select.perf.test.cjs +0 -191
- package/dist/select/__tests__/select.perf.test.mjs +0 -185
- package/dist/select/__tests__/select.ssr.test.cjs +0 -58
- package/dist/select/__tests__/select.ssr.test.mjs +0 -52
- package/dist/select/__tests__/select.test.cjs +0 -414
- package/dist/select/__tests__/select.test.mjs +0 -345
- package/dist/skeleton/__tests__/skeleton.ssr.test.cjs +0 -81
- package/dist/skeleton/__tests__/skeleton.ssr.test.mjs +0 -83
- package/dist/skeleton/__tests__/skeleton.test.cjs +0 -72
- package/dist/skeleton/__tests__/skeleton.test.mjs +0 -65
- package/dist/sku-selector/__tests__/sku-selector.ssr.test.cjs +0 -32
- package/dist/sku-selector/__tests__/sku-selector.ssr.test.mjs +0 -19
- package/dist/sku-selector/__tests__/sku-selector.test.cjs +0 -64
- package/dist/sku-selector/__tests__/sku-selector.test.mjs +0 -53
- package/dist/slider/__tests__/repro.test.cjs +0 -25
- package/dist/slider/__tests__/repro.test.mjs +0 -22
- package/dist/slider/__tests__/slider.ssr.test.cjs +0 -118
- package/dist/slider/__tests__/slider.ssr.test.mjs +0 -115
- package/dist/slider/__tests__/slider.test.cjs +0 -155
- package/dist/slider/__tests__/slider.test.mjs +0 -120
- package/dist/smart-address/__tests__/smart-address.ssr.test.cjs +0 -28
- package/dist/smart-address/__tests__/smart-address.ssr.test.mjs +0 -25
- package/dist/smart-address/__tests__/smart-address.test.cjs +0 -68
- package/dist/smart-address/__tests__/smart-address.test.mjs +0 -56
- package/dist/space/__tests__/space.ssr.test.cjs +0 -115
- package/dist/space/__tests__/space.ssr.test.mjs +0 -150
- package/dist/space/__tests__/space.test.cjs +0 -227
- package/dist/space/__tests__/space.test.mjs +0 -187
- package/dist/spin/__tests__/spin.ssr.test.cjs +0 -46
- package/dist/spin/__tests__/spin.ssr.test.mjs +0 -43
- package/dist/spin/__tests__/spin.test.cjs +0 -65
- package/dist/spin/__tests__/spin.test.mjs +0 -63
- package/dist/steps/__tests__/steps.ssr.test.cjs +0 -73
- package/dist/steps/__tests__/steps.ssr.test.mjs +0 -55
- package/dist/steps/__tests__/steps.test.cjs +0 -152
- package/dist/steps/__tests__/steps.test.mjs +0 -123
- package/dist/submit-bar/__tests__/submit-bar.ssr.test.cjs +0 -21
- package/dist/submit-bar/__tests__/submit-bar.ssr.test.mjs +0 -18
- package/dist/submit-bar/__tests__/submit-bar.test.cjs +0 -50
- package/dist/submit-bar/__tests__/submit-bar.test.mjs +0 -36
- package/dist/switch/__tests__/switch.ssr.test.cjs +0 -105
- package/dist/switch/__tests__/switch.ssr.test.mjs +0 -102
- package/dist/switch/__tests__/switch.test.cjs +0 -251
- package/dist/switch/__tests__/switch.test.mjs +0 -193
- package/dist/table/__tests__/table-advance.test.cjs +0 -180
- package/dist/table/__tests__/table-advance.test.mjs +0 -118
- package/dist/table/__tests__/table-interaction.test.cjs +0 -236
- package/dist/table/__tests__/table-interaction.test.mjs +0 -162
- package/dist/table/__tests__/table-utils.test.cjs +0 -690
- package/dist/table/__tests__/table-utils.test.mjs +0 -485
- package/dist/table/__tests__/table.perf.test.cjs +0 -231
- package/dist/table/__tests__/table.perf.test.mjs +0 -225
- package/dist/table/__tests__/table.ssr.test.cjs +0 -296
- package/dist/table/__tests__/table.ssr.test.mjs +0 -265
- package/dist/table/__tests__/table.test.cjs +0 -682
- package/dist/table/__tests__/table.test.mjs +0 -617
- package/dist/table/__tests__/use-column-drag.test.cjs +0 -238
- package/dist/table/__tests__/use-column-drag.test.mjs +0 -150
- package/dist/table/__tests__/use-table-export.test.cjs +0 -179
- package/dist/table/__tests__/use-table-export.test.mjs +0 -105
- package/dist/table/__tests__/use-table-import.test.cjs +0 -206
- package/dist/table/__tests__/use-table-import.test.mjs +0 -144
- package/dist/table/__tests__/use-table-print.test.cjs +0 -190
- package/dist/table/__tests__/use-table-print.test.mjs +0 -134
- package/dist/table/__tests__/use-virtual-scroll.test.cjs +0 -286
- package/dist/table/__tests__/use-virtual-scroll.test.mjs +0 -196
- package/dist/tabs/__tests__/tabs.ssr.test.cjs +0 -57
- package/dist/tabs/__tests__/tabs.ssr.test.mjs +0 -41
- package/dist/tabs/__tests__/tabs.test.cjs +0 -171
- package/dist/tabs/__tests__/tabs.test.mjs +0 -134
- package/dist/tag/__tests__/tag.ssr.test.cjs +0 -45
- package/dist/tag/__tests__/tag.ssr.test.mjs +0 -48
- package/dist/tag/__tests__/tag.test.cjs +0 -194
- package/dist/tag/__tests__/tag.test.mjs +0 -167
- package/dist/time-picker/__tests__/time-picker.ssr.test.cjs +0 -46
- package/dist/time-picker/__tests__/time-picker.ssr.test.mjs +0 -43
- package/dist/time-picker/__tests__/time-picker.test.cjs +0 -228
- package/dist/time-picker/__tests__/time-picker.test.mjs +0 -218
- package/dist/time-picker/__tests__/time-spinner.test.cjs +0 -196
- package/dist/time-picker/__tests__/time-spinner.test.mjs +0 -162
- package/dist/time-select/__tests__/time-select.ssr.test.cjs +0 -42
- package/dist/time-select/__tests__/time-select.ssr.test.mjs +0 -37
- package/dist/time-select/__tests__/time-select.test.cjs +0 -390
- package/dist/time-select/__tests__/time-select.test.mjs +0 -374
- package/dist/tooltip/__tests__/tooltip.ssr.test.cjs +0 -55
- package/dist/tooltip/__tests__/tooltip.ssr.test.mjs +0 -76
- package/dist/tooltip/__tests__/tooltip.test.cjs +0 -132
- package/dist/tooltip/__tests__/tooltip.test.mjs +0 -121
- package/dist/transfer/__tests__/transfer.ssr.test.cjs +0 -47
- package/dist/transfer/__tests__/transfer.ssr.test.mjs +0 -44
- package/dist/transfer/__tests__/transfer.test.cjs +0 -422
- package/dist/transfer/__tests__/transfer.test.mjs +0 -405
- package/dist/tree/__tests__/tree.perf.test.cjs +0 -182
- package/dist/tree/__tests__/tree.perf.test.mjs +0 -198
- package/dist/tree/__tests__/tree.ssr.test.cjs +0 -56
- package/dist/tree/__tests__/tree.ssr.test.mjs +0 -45
- package/dist/tree/__tests__/tree.test.cjs +0 -488
- package/dist/tree/__tests__/tree.test.mjs +0 -333
- package/dist/tree-select/__tests__/tree-select.ssr.test.cjs +0 -52
- package/dist/tree-select/__tests__/tree-select.ssr.test.mjs +0 -55
- package/dist/tree-select/__tests__/tree-select.test.cjs +0 -231
- package/dist/tree-select/__tests__/tree-select.test.mjs +0 -189
- package/dist/typography/__tests__/typography.ssr.test.cjs +0 -85
- package/dist/typography/__tests__/typography.ssr.test.mjs +0 -63
- package/dist/typography/__tests__/typography.test.cjs +0 -362
- package/dist/typography/__tests__/typography.test.mjs +0 -161
- package/dist/upload/__tests__/upload.ssr.test.cjs +0 -28
- package/dist/upload/__tests__/upload.ssr.test.mjs +0 -26
- package/dist/upload/__tests__/upload.test.cjs +0 -467
- package/dist/upload/__tests__/upload.test.mjs +0 -336
- package/dist/waterfall/__tests__/waterfall.ssr.test.cjs +0 -38
- package/dist/waterfall/__tests__/waterfall.ssr.test.mjs +0 -39
- package/dist/waterfall/__tests__/waterfall.test.cjs +0 -122
- package/dist/waterfall/__tests__/waterfall.test.mjs +0 -85
- package/dist/watermark/__tests__/watermark.ssr.test.cjs +0 -32
- package/dist/watermark/__tests__/watermark.ssr.test.mjs +0 -30
- package/dist/watermark/__tests__/watermark.test.cjs +0 -127
- package/dist/watermark/__tests__/watermark.test.mjs +0 -124
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import { mount } from "@vue/test-utils";
|
|
2
|
-
import { describe, it, expect } from "vitest";
|
|
3
|
-
import { YhGanttChart } from "../index.mjs";
|
|
4
|
-
describe("GanttChart", () => {
|
|
5
|
-
const data = [
|
|
6
|
-
{
|
|
7
|
-
id: "1",
|
|
8
|
-
name: "Task 1",
|
|
9
|
-
startDate: "2024-01-01",
|
|
10
|
-
endDate: "2024-01-05",
|
|
11
|
-
progress: 50
|
|
12
|
-
}
|
|
13
|
-
];
|
|
14
|
-
it("renders correctly", () => {
|
|
15
|
-
const wrapper = mount(YhGanttChart, {
|
|
16
|
-
props: {
|
|
17
|
-
data
|
|
18
|
-
}
|
|
19
|
-
});
|
|
20
|
-
expect(wrapper.find(".yh-gantt-chart").exists()).toBe(true);
|
|
21
|
-
expect(wrapper.find(".yh-gantt-chart__sidebar").exists()).toBe(true);
|
|
22
|
-
expect(wrapper.find(".yh-gantt-chart__timeline").exists()).toBe(true);
|
|
23
|
-
});
|
|
24
|
-
it("renders task rows", () => {
|
|
25
|
-
const wrapper = mount(YhGanttChart, {
|
|
26
|
-
props: {
|
|
27
|
-
data
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
const rows = wrapper.findAll(".yh-gantt-chart__row");
|
|
31
|
-
expect(rows.length).toBe(data.length);
|
|
32
|
-
expect(rows[0].text()).toContain("Task 1");
|
|
33
|
-
});
|
|
34
|
-
it("renders task bar in timeline", () => {
|
|
35
|
-
const wrapper = mount(YhGanttChart, {
|
|
36
|
-
props: {
|
|
37
|
-
data
|
|
38
|
-
}
|
|
39
|
-
});
|
|
40
|
-
expect(wrapper.find(".yh-gantt-chart__task-wrapper").exists()).toBe(true);
|
|
41
|
-
});
|
|
42
|
-
it("emits task-click event", async () => {
|
|
43
|
-
const wrapper = mount(YhGanttChart, {
|
|
44
|
-
props: {
|
|
45
|
-
data
|
|
46
|
-
}
|
|
47
|
-
});
|
|
48
|
-
const taskBar = wrapper.find(".yh-gantt-chart__task-inner");
|
|
49
|
-
await taskBar.trigger("click");
|
|
50
|
-
expect(wrapper.emitted("task-click")).toBeTruthy();
|
|
51
|
-
expect(wrapper.emitted("task-click")[0][0]).toEqual(expect.objectContaining({ id: "1" }));
|
|
52
|
-
});
|
|
53
|
-
it("handles view mode changes", async () => {
|
|
54
|
-
const wrapper = mount(YhGanttChart, {
|
|
55
|
-
props: {
|
|
56
|
-
data,
|
|
57
|
-
viewMode: "day"
|
|
58
|
-
}
|
|
59
|
-
});
|
|
60
|
-
const weekButton = wrapper.findAll(".yh-radio-button").find((b) => b.text().includes("\u5468"));
|
|
61
|
-
if (weekButton) {
|
|
62
|
-
await weekButton.find("input").trigger("change");
|
|
63
|
-
expect(wrapper.emitted("update:viewMode")).toBeTruthy();
|
|
64
|
-
expect(wrapper.emitted("update:viewMode")[0][0]).toBe("week");
|
|
65
|
-
}
|
|
66
|
-
});
|
|
67
|
-
it("filters tasks via search", async () => {
|
|
68
|
-
const wrapper = mount(YhGanttChart, {
|
|
69
|
-
props: {
|
|
70
|
-
data: [...data, { id: "2", name: "Other", startDate: "2024-01-01", endDate: "2024-01-02" }]
|
|
71
|
-
}
|
|
72
|
-
});
|
|
73
|
-
const input = wrapper.find('input[placeholder="\u641C\u7D22\u4EFB\u52A1..."]');
|
|
74
|
-
await input.setValue("Task 1");
|
|
75
|
-
const rows = wrapper.findAll(".yh-gantt-chart__row");
|
|
76
|
-
expect(rows.length).toBe(1);
|
|
77
|
-
expect(rows[0].text()).toContain("Task 1");
|
|
78
|
-
});
|
|
79
|
-
});
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _vitest = require("vitest");
|
|
4
|
-
var _vue = require("vue");
|
|
5
|
-
var _grid = _interopRequireDefault(require("../src/grid.vue"));
|
|
6
|
-
var _gridItem = _interopRequireDefault(require("../src/grid-item.vue"));
|
|
7
|
-
var _ssr = require("../../__tests__/utils/ssr.cjs");
|
|
8
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
-
(0, _vitest.describe)("YhGrid SSR", () => {
|
|
10
|
-
(0, _vitest.it)("should render grid in SSR", async () => {
|
|
11
|
-
const html = await (0, _ssr.renderSSR)(_grid.default, {
|
|
12
|
-
cols: 3,
|
|
13
|
-
gap: 16
|
|
14
|
-
}, {
|
|
15
|
-
default: () => [(0, _vue.h)(_gridItem.default, null, {
|
|
16
|
-
default: () => "A"
|
|
17
|
-
}), (0, _vue.h)(_gridItem.default, null, {
|
|
18
|
-
default: () => "B"
|
|
19
|
-
}), (0, _vue.h)(_gridItem.default, null, {
|
|
20
|
-
default: () => "C"
|
|
21
|
-
})]
|
|
22
|
-
});
|
|
23
|
-
(0, _ssr.expectSSRHasClass)(html, "yh-grid");
|
|
24
|
-
(0, _vitest.expect)(html).toContain("repeat(3, 1fr)");
|
|
25
|
-
(0, _vitest.expect)(html).toMatch(/gap:\s*16px/);
|
|
26
|
-
(0, _vitest.expect)(html).toContain("A");
|
|
27
|
-
(0, _vitest.expect)(html).toContain("B");
|
|
28
|
-
});
|
|
29
|
-
(0, _vitest.it)("should render grid item with span in SSR", async () => {
|
|
30
|
-
const html = await (0, _ssr.renderSSR)(_grid.default, {
|
|
31
|
-
cols: 4
|
|
32
|
-
}, {
|
|
33
|
-
default: () => (0, _vue.h)(_gridItem.default, {
|
|
34
|
-
span: 2
|
|
35
|
-
}, {
|
|
36
|
-
default: () => "Wide"
|
|
37
|
-
})
|
|
38
|
-
});
|
|
39
|
-
(0, _vitest.expect)(html).toContain("grid-column");
|
|
40
|
-
(0, _vitest.expect)(html).toContain("span 2");
|
|
41
|
-
});
|
|
42
|
-
(0, _vitest.it)("should hydrate without mismatch", async () => {
|
|
43
|
-
const result = await (0, _ssr.testHydration)(_grid.default, {
|
|
44
|
-
cols: 3,
|
|
45
|
-
gap: 12
|
|
46
|
-
}, {
|
|
47
|
-
default: () => [(0, _vue.h)(_gridItem.default, {
|
|
48
|
-
key: 1
|
|
49
|
-
}, {
|
|
50
|
-
default: () => "1"
|
|
51
|
-
}), (0, _vue.h)(_gridItem.default, {
|
|
52
|
-
key: 2
|
|
53
|
-
}, {
|
|
54
|
-
default: () => "2"
|
|
55
|
-
}), (0, _vue.h)(_gridItem.default, {
|
|
56
|
-
key: 3
|
|
57
|
-
}, {
|
|
58
|
-
default: () => "3"
|
|
59
|
-
})]
|
|
60
|
-
});
|
|
61
|
-
(0, _vitest.expect)(result.isMatch).toBe(true);
|
|
62
|
-
});
|
|
63
|
-
(0, _vitest.it)("should hydrate with span without mismatch", async () => {
|
|
64
|
-
const result = await (0, _ssr.testHydration)(_grid.default, {
|
|
65
|
-
cols: 6
|
|
66
|
-
}, {
|
|
67
|
-
default: () => [(0, _vue.h)(_gridItem.default, {
|
|
68
|
-
span: 3,
|
|
69
|
-
key: 1
|
|
70
|
-
}, {
|
|
71
|
-
default: () => "A"
|
|
72
|
-
}), (0, _vue.h)(_gridItem.default, {
|
|
73
|
-
span: 3,
|
|
74
|
-
key: 2
|
|
75
|
-
}, {
|
|
76
|
-
default: () => "B"
|
|
77
|
-
})]
|
|
78
|
-
});
|
|
79
|
-
(0, _vitest.expect)(result.isMatch).toBe(true);
|
|
80
|
-
});
|
|
81
|
-
});
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect } from "vitest";
|
|
2
|
-
import { h } from "vue";
|
|
3
|
-
import Grid from "../src/grid.vue";
|
|
4
|
-
import GridItem from "../src/grid-item.vue";
|
|
5
|
-
import { renderSSR, expectSSRHasClass, testHydration } from "../../__tests__/utils/ssr.mjs";
|
|
6
|
-
describe("YhGrid SSR", () => {
|
|
7
|
-
it("should render grid in SSR", async () => {
|
|
8
|
-
const html = await renderSSR(
|
|
9
|
-
Grid,
|
|
10
|
-
{ cols: 3, gap: 16 },
|
|
11
|
-
{
|
|
12
|
-
default: () => [
|
|
13
|
-
h(GridItem, null, { default: () => "A" }),
|
|
14
|
-
h(GridItem, null, { default: () => "B" }),
|
|
15
|
-
h(GridItem, null, { default: () => "C" })
|
|
16
|
-
]
|
|
17
|
-
}
|
|
18
|
-
);
|
|
19
|
-
expectSSRHasClass(html, "yh-grid");
|
|
20
|
-
expect(html).toContain("repeat(3, 1fr)");
|
|
21
|
-
expect(html).toMatch(/gap:\s*16px/);
|
|
22
|
-
expect(html).toContain("A");
|
|
23
|
-
expect(html).toContain("B");
|
|
24
|
-
});
|
|
25
|
-
it("should render grid item with span in SSR", async () => {
|
|
26
|
-
const html = await renderSSR(
|
|
27
|
-
Grid,
|
|
28
|
-
{ cols: 4 },
|
|
29
|
-
{
|
|
30
|
-
default: () => h(GridItem, { span: 2 }, { default: () => "Wide" })
|
|
31
|
-
}
|
|
32
|
-
);
|
|
33
|
-
expect(html).toContain("grid-column");
|
|
34
|
-
expect(html).toContain("span 2");
|
|
35
|
-
});
|
|
36
|
-
it("should hydrate without mismatch", async () => {
|
|
37
|
-
const result = await testHydration(
|
|
38
|
-
Grid,
|
|
39
|
-
{ cols: 3, gap: 12 },
|
|
40
|
-
{
|
|
41
|
-
default: () => [
|
|
42
|
-
h(GridItem, { key: 1 }, { default: () => "1" }),
|
|
43
|
-
h(GridItem, { key: 2 }, { default: () => "2" }),
|
|
44
|
-
h(GridItem, { key: 3 }, { default: () => "3" })
|
|
45
|
-
]
|
|
46
|
-
}
|
|
47
|
-
);
|
|
48
|
-
expect(result.isMatch).toBe(true);
|
|
49
|
-
});
|
|
50
|
-
it("should hydrate with span without mismatch", async () => {
|
|
51
|
-
const result = await testHydration(
|
|
52
|
-
Grid,
|
|
53
|
-
{ cols: 6 },
|
|
54
|
-
{
|
|
55
|
-
default: () => [
|
|
56
|
-
h(GridItem, { span: 3, key: 1 }, { default: () => "A" }),
|
|
57
|
-
h(GridItem, { span: 3, key: 2 }, { default: () => "B" })
|
|
58
|
-
]
|
|
59
|
-
}
|
|
60
|
-
);
|
|
61
|
-
expect(result.isMatch).toBe(true);
|
|
62
|
-
});
|
|
63
|
-
});
|
|
@@ -1,142 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _vitest = require("vitest");
|
|
4
|
-
var _testUtils = require("@vue/test-utils");
|
|
5
|
-
var _grid = _interopRequireDefault(require("../src/grid.vue"));
|
|
6
|
-
var _gridItem = _interopRequireDefault(require("../src/grid-item.vue"));
|
|
7
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
8
|
-
(0, _vitest.describe)("YhGrid", () => {
|
|
9
|
-
(0, _vitest.it)("\u5E94\u8BE5\u6E32\u67D3\u57FA\u7840\u7ED3\u6784", () => {
|
|
10
|
-
const wrapper = (0, _testUtils.mount)(_grid.default);
|
|
11
|
-
(0, _vitest.expect)(wrapper.find(".yh-grid").exists()).toBe(true);
|
|
12
|
-
});
|
|
13
|
-
(0, _vitest.it)("\u9ED8\u8BA4 12 \u5217", () => {
|
|
14
|
-
const wrapper = (0, _testUtils.mount)(_grid.default);
|
|
15
|
-
const style = wrapper.find(".yh-grid").attributes("style");
|
|
16
|
-
(0, _vitest.expect)(style).toContain("grid-template-columns: repeat(12, 1fr)");
|
|
17
|
-
});
|
|
18
|
-
(0, _vitest.it)("\u5E94\u8BE5\u652F\u6301\u81EA\u5B9A\u4E49\u5217\u6570", () => {
|
|
19
|
-
const wrapper = (0, _testUtils.mount)(_grid.default, {
|
|
20
|
-
props: {
|
|
21
|
-
cols: 4
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
const style = wrapper.find(".yh-grid").attributes("style");
|
|
25
|
-
(0, _vitest.expect)(style).toContain("grid-template-columns: repeat(4, 1fr)");
|
|
26
|
-
});
|
|
27
|
-
(0, _vitest.it)("\u5E94\u8BE5\u652F\u6301\u5B57\u7B26\u4E32\u5217\u5B9A\u4E49", () => {
|
|
28
|
-
const wrapper = (0, _testUtils.mount)(_grid.default, {
|
|
29
|
-
props: {
|
|
30
|
-
cols: "200px 1fr 200px"
|
|
31
|
-
}
|
|
32
|
-
});
|
|
33
|
-
const style = wrapper.find(".yh-grid").attributes("style");
|
|
34
|
-
(0, _vitest.expect)(style).toContain("grid-template-columns: 200px 1fr 200px");
|
|
35
|
-
});
|
|
36
|
-
(0, _vitest.it)("\u5E94\u8BE5\u652F\u6301 gap \u5C5E\u6027", () => {
|
|
37
|
-
const wrapper = (0, _testUtils.mount)(_grid.default, {
|
|
38
|
-
props: {
|
|
39
|
-
gap: 16
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
const style = wrapper.find(".yh-grid").attributes("style");
|
|
43
|
-
(0, _vitest.expect)(style).toContain("gap: 16px");
|
|
44
|
-
});
|
|
45
|
-
(0, _vitest.it)("\u5E94\u8BE5\u652F\u6301\u6570\u7EC4 gap [col, row]", () => {
|
|
46
|
-
const wrapper = (0, _testUtils.mount)(_grid.default, {
|
|
47
|
-
props: {
|
|
48
|
-
gap: [8, 16]
|
|
49
|
-
}
|
|
50
|
-
});
|
|
51
|
-
const style = wrapper.find(".yh-grid").attributes("style");
|
|
52
|
-
(0, _vitest.expect)(style).toContain("column-gap: 8px");
|
|
53
|
-
(0, _vitest.expect)(style).toContain("row-gap: 16px");
|
|
54
|
-
});
|
|
55
|
-
(0, _vitest.it)("\u5E94\u8BE5\u652F\u6301 colGap/rowGap", () => {
|
|
56
|
-
const wrapper = (0, _testUtils.mount)(_grid.default, {
|
|
57
|
-
props: {
|
|
58
|
-
colGap: 10,
|
|
59
|
-
rowGap: 20
|
|
60
|
-
}
|
|
61
|
-
});
|
|
62
|
-
const style = wrapper.find(".yh-grid").attributes("style");
|
|
63
|
-
(0, _vitest.expect)(style).toContain("column-gap: 10px");
|
|
64
|
-
(0, _vitest.expect)(style).toContain("row-gap: 20px");
|
|
65
|
-
});
|
|
66
|
-
(0, _vitest.it)("\u5E94\u8BE5\u652F\u6301 justifyItems", () => {
|
|
67
|
-
const wrapper = (0, _testUtils.mount)(_grid.default, {
|
|
68
|
-
props: {
|
|
69
|
-
justifyItems: "center"
|
|
70
|
-
}
|
|
71
|
-
});
|
|
72
|
-
const style = wrapper.find(".yh-grid").attributes("style");
|
|
73
|
-
(0, _vitest.expect)(style).toContain("justify-items: center");
|
|
74
|
-
});
|
|
75
|
-
(0, _vitest.it)("\u5E94\u8BE5\u652F\u6301 alignItems", () => {
|
|
76
|
-
const wrapper = (0, _testUtils.mount)(_grid.default, {
|
|
77
|
-
props: {
|
|
78
|
-
alignItems: "end"
|
|
79
|
-
}
|
|
80
|
-
});
|
|
81
|
-
const style = wrapper.find(".yh-grid").attributes("style");
|
|
82
|
-
(0, _vitest.expect)(style).toContain("align-items: end");
|
|
83
|
-
});
|
|
84
|
-
(0, _vitest.it)("\u5E94\u8BE5\u6E32\u67D3\u63D2\u69FD\u5185\u5BB9", () => {
|
|
85
|
-
const wrapper = (0, _testUtils.mount)(_grid.default, {
|
|
86
|
-
slots: {
|
|
87
|
-
default: '<div class="child">\u5185\u5BB9</div>'
|
|
88
|
-
}
|
|
89
|
-
});
|
|
90
|
-
(0, _vitest.expect)(wrapper.find(".child").exists()).toBe(true);
|
|
91
|
-
});
|
|
92
|
-
});
|
|
93
|
-
(0, _vitest.describe)("YhGridItem", () => {
|
|
94
|
-
(0, _vitest.it)("\u5E94\u8BE5\u6E32\u67D3\u57FA\u7840\u7ED3\u6784", () => {
|
|
95
|
-
const wrapper = (0, _testUtils.mount)(_gridItem.default);
|
|
96
|
-
(0, _vitest.expect)(wrapper.find(".yh-grid-item").exists()).toBe(true);
|
|
97
|
-
});
|
|
98
|
-
(0, _vitest.it)("\u5E94\u8BE5\u652F\u6301 span \u8DE8\u5217", () => {
|
|
99
|
-
const wrapper = (0, _testUtils.mount)(_gridItem.default, {
|
|
100
|
-
props: {
|
|
101
|
-
span: 3
|
|
102
|
-
}
|
|
103
|
-
});
|
|
104
|
-
const style = wrapper.find(".yh-grid-item").attributes("style");
|
|
105
|
-
(0, _vitest.expect)(style).toContain("grid-column: span 3");
|
|
106
|
-
});
|
|
107
|
-
(0, _vitest.it)("span \u4E3A 1 \u65F6\u4E0D\u8BBE\u7F6E grid-column", () => {
|
|
108
|
-
const wrapper = (0, _testUtils.mount)(_gridItem.default, {
|
|
109
|
-
props: {
|
|
110
|
-
span: 1
|
|
111
|
-
}
|
|
112
|
-
});
|
|
113
|
-
const style = wrapper.find(".yh-grid-item").attributes("style") || "";
|
|
114
|
-
(0, _vitest.expect)(style).not.toContain("grid-column");
|
|
115
|
-
});
|
|
116
|
-
(0, _vitest.it)("\u5E94\u8BE5\u652F\u6301 offset \u504F\u79FB", () => {
|
|
117
|
-
const wrapper = (0, _testUtils.mount)(_gridItem.default, {
|
|
118
|
-
props: {
|
|
119
|
-
offset: 2,
|
|
120
|
-
span: 3
|
|
121
|
-
}
|
|
122
|
-
});
|
|
123
|
-
const style = wrapper.find(".yh-grid-item").attributes("style");
|
|
124
|
-
(0, _vitest.expect)(style).toContain("grid-column: 3 / span 3");
|
|
125
|
-
});
|
|
126
|
-
(0, _vitest.it)("\u5E94\u8BE5\u652F\u6301 suffix \u5B9A\u4F4D\u5230\u884C\u672B", () => {
|
|
127
|
-
const wrapper = (0, _testUtils.mount)(_gridItem.default, {
|
|
128
|
-
props: {
|
|
129
|
-
suffix: true
|
|
130
|
-
}
|
|
131
|
-
});
|
|
132
|
-
(0, _vitest.expect)(wrapper.find(".yh-grid-item").classes()).toContain("is-suffix");
|
|
133
|
-
});
|
|
134
|
-
(0, _vitest.it)("\u5E94\u8BE5\u6E32\u67D3\u63D2\u69FD\u5185\u5BB9", () => {
|
|
135
|
-
const wrapper = (0, _testUtils.mount)(_gridItem.default, {
|
|
136
|
-
slots: {
|
|
137
|
-
default: "<span>\u7F51\u683C\u9879</span>"
|
|
138
|
-
}
|
|
139
|
-
});
|
|
140
|
-
(0, _vitest.expect)(wrapper.text()).toBe("\u7F51\u683C\u9879");
|
|
141
|
-
});
|
|
142
|
-
});
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect } from "vitest";
|
|
2
|
-
import { mount } from "@vue/test-utils";
|
|
3
|
-
import Grid from "../src/grid.vue";
|
|
4
|
-
import GridItem from "../src/grid-item.vue";
|
|
5
|
-
describe("YhGrid", () => {
|
|
6
|
-
it("\u5E94\u8BE5\u6E32\u67D3\u57FA\u7840\u7ED3\u6784", () => {
|
|
7
|
-
const wrapper = mount(Grid);
|
|
8
|
-
expect(wrapper.find(".yh-grid").exists()).toBe(true);
|
|
9
|
-
});
|
|
10
|
-
it("\u9ED8\u8BA4 12 \u5217", () => {
|
|
11
|
-
const wrapper = mount(Grid);
|
|
12
|
-
const style = wrapper.find(".yh-grid").attributes("style");
|
|
13
|
-
expect(style).toContain("grid-template-columns: repeat(12, 1fr)");
|
|
14
|
-
});
|
|
15
|
-
it("\u5E94\u8BE5\u652F\u6301\u81EA\u5B9A\u4E49\u5217\u6570", () => {
|
|
16
|
-
const wrapper = mount(Grid, { props: { cols: 4 } });
|
|
17
|
-
const style = wrapper.find(".yh-grid").attributes("style");
|
|
18
|
-
expect(style).toContain("grid-template-columns: repeat(4, 1fr)");
|
|
19
|
-
});
|
|
20
|
-
it("\u5E94\u8BE5\u652F\u6301\u5B57\u7B26\u4E32\u5217\u5B9A\u4E49", () => {
|
|
21
|
-
const wrapper = mount(Grid, { props: { cols: "200px 1fr 200px" } });
|
|
22
|
-
const style = wrapper.find(".yh-grid").attributes("style");
|
|
23
|
-
expect(style).toContain("grid-template-columns: 200px 1fr 200px");
|
|
24
|
-
});
|
|
25
|
-
it("\u5E94\u8BE5\u652F\u6301 gap \u5C5E\u6027", () => {
|
|
26
|
-
const wrapper = mount(Grid, { props: { gap: 16 } });
|
|
27
|
-
const style = wrapper.find(".yh-grid").attributes("style");
|
|
28
|
-
expect(style).toContain("gap: 16px");
|
|
29
|
-
});
|
|
30
|
-
it("\u5E94\u8BE5\u652F\u6301\u6570\u7EC4 gap [col, row]", () => {
|
|
31
|
-
const wrapper = mount(Grid, { props: { gap: [8, 16] } });
|
|
32
|
-
const style = wrapper.find(".yh-grid").attributes("style");
|
|
33
|
-
expect(style).toContain("column-gap: 8px");
|
|
34
|
-
expect(style).toContain("row-gap: 16px");
|
|
35
|
-
});
|
|
36
|
-
it("\u5E94\u8BE5\u652F\u6301 colGap/rowGap", () => {
|
|
37
|
-
const wrapper = mount(Grid, { props: { colGap: 10, rowGap: 20 } });
|
|
38
|
-
const style = wrapper.find(".yh-grid").attributes("style");
|
|
39
|
-
expect(style).toContain("column-gap: 10px");
|
|
40
|
-
expect(style).toContain("row-gap: 20px");
|
|
41
|
-
});
|
|
42
|
-
it("\u5E94\u8BE5\u652F\u6301 justifyItems", () => {
|
|
43
|
-
const wrapper = mount(Grid, { props: { justifyItems: "center" } });
|
|
44
|
-
const style = wrapper.find(".yh-grid").attributes("style");
|
|
45
|
-
expect(style).toContain("justify-items: center");
|
|
46
|
-
});
|
|
47
|
-
it("\u5E94\u8BE5\u652F\u6301 alignItems", () => {
|
|
48
|
-
const wrapper = mount(Grid, { props: { alignItems: "end" } });
|
|
49
|
-
const style = wrapper.find(".yh-grid").attributes("style");
|
|
50
|
-
expect(style).toContain("align-items: end");
|
|
51
|
-
});
|
|
52
|
-
it("\u5E94\u8BE5\u6E32\u67D3\u63D2\u69FD\u5185\u5BB9", () => {
|
|
53
|
-
const wrapper = mount(Grid, {
|
|
54
|
-
slots: { default: '<div class="child">\u5185\u5BB9</div>' }
|
|
55
|
-
});
|
|
56
|
-
expect(wrapper.find(".child").exists()).toBe(true);
|
|
57
|
-
});
|
|
58
|
-
});
|
|
59
|
-
describe("YhGridItem", () => {
|
|
60
|
-
it("\u5E94\u8BE5\u6E32\u67D3\u57FA\u7840\u7ED3\u6784", () => {
|
|
61
|
-
const wrapper = mount(GridItem);
|
|
62
|
-
expect(wrapper.find(".yh-grid-item").exists()).toBe(true);
|
|
63
|
-
});
|
|
64
|
-
it("\u5E94\u8BE5\u652F\u6301 span \u8DE8\u5217", () => {
|
|
65
|
-
const wrapper = mount(GridItem, { props: { span: 3 } });
|
|
66
|
-
const style = wrapper.find(".yh-grid-item").attributes("style");
|
|
67
|
-
expect(style).toContain("grid-column: span 3");
|
|
68
|
-
});
|
|
69
|
-
it("span \u4E3A 1 \u65F6\u4E0D\u8BBE\u7F6E grid-column", () => {
|
|
70
|
-
const wrapper = mount(GridItem, { props: { span: 1 } });
|
|
71
|
-
const style = wrapper.find(".yh-grid-item").attributes("style") || "";
|
|
72
|
-
expect(style).not.toContain("grid-column");
|
|
73
|
-
});
|
|
74
|
-
it("\u5E94\u8BE5\u652F\u6301 offset \u504F\u79FB", () => {
|
|
75
|
-
const wrapper = mount(GridItem, { props: { offset: 2, span: 3 } });
|
|
76
|
-
const style = wrapper.find(".yh-grid-item").attributes("style");
|
|
77
|
-
expect(style).toContain("grid-column: 3 / span 3");
|
|
78
|
-
});
|
|
79
|
-
it("\u5E94\u8BE5\u652F\u6301 suffix \u5B9A\u4F4D\u5230\u884C\u672B", () => {
|
|
80
|
-
const wrapper = mount(GridItem, { props: { suffix: true } });
|
|
81
|
-
expect(wrapper.find(".yh-grid-item").classes()).toContain("is-suffix");
|
|
82
|
-
});
|
|
83
|
-
it("\u5E94\u8BE5\u6E32\u67D3\u63D2\u69FD\u5185\u5BB9", () => {
|
|
84
|
-
const wrapper = mount(GridItem, {
|
|
85
|
-
slots: { default: "<span>\u7F51\u683C\u9879</span>" }
|
|
86
|
-
});
|
|
87
|
-
expect(wrapper.text()).toBe("\u7F51\u683C\u9879");
|
|
88
|
-
});
|
|
89
|
-
});
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _vitest = require("vitest");
|
|
4
|
-
var _icon = _interopRequireDefault(require("../src/icon.vue"));
|
|
5
|
-
var _ssr = require("../../__tests__/utils/ssr.cjs");
|
|
6
|
-
var _icon2 = require("../src/icon.cjs");
|
|
7
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
8
|
-
(0, _vitest.describe)("YhIcon SSR", () => {
|
|
9
|
-
(0, _icon2.registerIcon)({
|
|
10
|
-
name: "user",
|
|
11
|
-
svg: '<path d="user" />'
|
|
12
|
-
});
|
|
13
|
-
(0, _icon2.registerIcon)({
|
|
14
|
-
name: "star",
|
|
15
|
-
svg: '<path d="star" />'
|
|
16
|
-
});
|
|
17
|
-
(0, _vitest.it)("should render correctly in SSR", async () => {
|
|
18
|
-
const html = await (0, _ssr.renderSSR)(_icon.default, {
|
|
19
|
-
name: "user",
|
|
20
|
-
size: 20,
|
|
21
|
-
color: "red"
|
|
22
|
-
});
|
|
23
|
-
(0, _vitest.expect)(html).toContain("yh-icon");
|
|
24
|
-
(0, _vitest.expect)(html).toContain("font-size:20px");
|
|
25
|
-
(0, _vitest.expect)(html).toContain("color:red");
|
|
26
|
-
(0, _vitest.expect)(html).toContain('d="user"');
|
|
27
|
-
});
|
|
28
|
-
(0, _vitest.it)("should hydrate without mismatch", async () => {
|
|
29
|
-
const result = await (0, _ssr.testHydration)(_icon.default, {
|
|
30
|
-
name: "star",
|
|
31
|
-
size: "2em"
|
|
32
|
-
});
|
|
33
|
-
(0, _vitest.expect)(result.isMatch).toBe(true);
|
|
34
|
-
});
|
|
35
|
-
});
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect } from "vitest";
|
|
2
|
-
import Icon from "../src/icon.vue";
|
|
3
|
-
import { renderSSR, testHydration } from "../../__tests__/utils/ssr.mjs";
|
|
4
|
-
import { registerIcon } from "../src/icon.mjs";
|
|
5
|
-
describe("YhIcon SSR", () => {
|
|
6
|
-
registerIcon({ name: "user", svg: '<path d="user" />' });
|
|
7
|
-
registerIcon({ name: "star", svg: '<path d="star" />' });
|
|
8
|
-
it("should render correctly in SSR", async () => {
|
|
9
|
-
const html = await renderSSR(Icon, {
|
|
10
|
-
name: "user",
|
|
11
|
-
size: 20,
|
|
12
|
-
color: "red"
|
|
13
|
-
});
|
|
14
|
-
expect(html).toContain("yh-icon");
|
|
15
|
-
expect(html).toContain("font-size:20px");
|
|
16
|
-
expect(html).toContain("color:red");
|
|
17
|
-
expect(html).toContain('d="user"');
|
|
18
|
-
});
|
|
19
|
-
it("should hydrate without mismatch", async () => {
|
|
20
|
-
const result = await testHydration(Icon, {
|
|
21
|
-
name: "star",
|
|
22
|
-
size: "2em"
|
|
23
|
-
});
|
|
24
|
-
expect(result.isMatch).toBe(true);
|
|
25
|
-
});
|
|
26
|
-
});
|
|
@@ -1,144 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _testUtils = require("@vue/test-utils");
|
|
4
|
-
var _vitest = require("vitest");
|
|
5
|
-
var _index = require("../index.cjs");
|
|
6
|
-
var _icon = require("../src/icon.cjs");
|
|
7
|
-
var _vue = require("vue");
|
|
8
|
-
(0, _vitest.describe)("Icon", () => {
|
|
9
|
-
(0, _vitest.it)("render test", () => {
|
|
10
|
-
const wrapper = (0, _testUtils.mount)(_index.YhIcon);
|
|
11
|
-
(0, _vitest.expect)(wrapper.find(".yh-icon").exists()).toBe(true);
|
|
12
|
-
});
|
|
13
|
-
(0, _vitest.it)("size test", () => {
|
|
14
|
-
const wrapper = (0, _testUtils.mount)(_index.YhIcon, {
|
|
15
|
-
props: {
|
|
16
|
-
size: 20
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
const style = wrapper.attributes("style");
|
|
20
|
-
(0, _vitest.expect)(style).toContain("font-size: 20px");
|
|
21
|
-
(0, _vitest.expect)(style).toContain("width: 20px");
|
|
22
|
-
(0, _vitest.expect)(style).toContain("height: 20px");
|
|
23
|
-
const wrapper2 = (0, _testUtils.mount)(_index.YhIcon, {
|
|
24
|
-
props: {
|
|
25
|
-
size: "2em"
|
|
26
|
-
}
|
|
27
|
-
});
|
|
28
|
-
(0, _vitest.expect)(wrapper2.attributes("style")).toContain("font-size: 2em");
|
|
29
|
-
});
|
|
30
|
-
(0, _vitest.it)("color test", () => {
|
|
31
|
-
const wrapper = (0, _testUtils.mount)(_index.YhIcon, {
|
|
32
|
-
props: {
|
|
33
|
-
color: "rgb(255, 0, 0)"
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
(0, _vitest.expect)(wrapper.attributes("style")).toContain("color: rgb(255, 0, 0)");
|
|
37
|
-
});
|
|
38
|
-
(0, _vitest.it)("spin test", () => {
|
|
39
|
-
const wrapper = (0, _testUtils.mount)(_index.YhIcon, {
|
|
40
|
-
props: {
|
|
41
|
-
spin: true
|
|
42
|
-
}
|
|
43
|
-
});
|
|
44
|
-
(0, _vitest.expect)(wrapper.classes()).toContain("yh-icon--spin");
|
|
45
|
-
});
|
|
46
|
-
(0, _vitest.it)("rotate test", () => {
|
|
47
|
-
const wrapper = (0, _testUtils.mount)(_index.YhIcon, {
|
|
48
|
-
props: {
|
|
49
|
-
rotate: 90
|
|
50
|
-
}
|
|
51
|
-
});
|
|
52
|
-
(0, _vitest.expect)(wrapper.attributes("style")).toContain("transform: rotate(90deg)");
|
|
53
|
-
});
|
|
54
|
-
(0, _vitest.it)("svg prop test", () => {
|
|
55
|
-
const svgStr = '<path d="M10 10l5 5" />';
|
|
56
|
-
const wrapper = (0, _testUtils.mount)(_index.YhIcon, {
|
|
57
|
-
props: {
|
|
58
|
-
svg: svgStr
|
|
59
|
-
}
|
|
60
|
-
});
|
|
61
|
-
(0, _vitest.expect)(wrapper.find("svg").exists()).toBe(true);
|
|
62
|
-
(0, _vitest.expect)(wrapper.find("svg").html()).toContain('d="M10 10l5 5"');
|
|
63
|
-
});
|
|
64
|
-
(0, _vitest.it)("name registration test", () => {
|
|
65
|
-
(0, _icon.registerIcon)({
|
|
66
|
-
name: "test-icon",
|
|
67
|
-
svg: '<circle cx="12" cy="12" r="10" />'
|
|
68
|
-
});
|
|
69
|
-
const wrapper = (0, _testUtils.mount)(_index.YhIcon, {
|
|
70
|
-
props: {
|
|
71
|
-
name: "test-icon"
|
|
72
|
-
}
|
|
73
|
-
});
|
|
74
|
-
(0, _vitest.expect)(wrapper.find("svg").html()).toContain("circle");
|
|
75
|
-
});
|
|
76
|
-
(0, _vitest.it)("icon component test", () => {
|
|
77
|
-
const iconComp = (0, _vue.markRaw)((0, _icon.createIconComponent)('<rect width="10" height="10" />'));
|
|
78
|
-
const renderResult = iconComp.render();
|
|
79
|
-
(0, _vitest.expect)(renderResult).toBeNull();
|
|
80
|
-
const wrapper = (0, _testUtils.mount)(_index.YhIcon, {
|
|
81
|
-
props: {
|
|
82
|
-
icon: iconComp
|
|
83
|
-
}
|
|
84
|
-
});
|
|
85
|
-
(0, _vitest.expect)(wrapper.find("svg").html()).toContain("rect");
|
|
86
|
-
const UserIcon = (0, _vue.markRaw)({
|
|
87
|
-
render() {
|
|
88
|
-
return (0, _vue.h)("svg", {
|
|
89
|
-
class: "user-icon"
|
|
90
|
-
}, [(0, _vue.h)("path", {
|
|
91
|
-
d: "M1 1l2 2"
|
|
92
|
-
})]);
|
|
93
|
-
}
|
|
94
|
-
});
|
|
95
|
-
const wrapper2 = (0, _testUtils.mount)(_index.YhIcon, {
|
|
96
|
-
props: {
|
|
97
|
-
icon: UserIcon
|
|
98
|
-
}
|
|
99
|
-
});
|
|
100
|
-
(0, _vitest.expect)(wrapper2.find(".user-icon").exists()).toBe(true);
|
|
101
|
-
});
|
|
102
|
-
(0, _vitest.it)("registerIcons and registerIconSet test", async () => {
|
|
103
|
-
const {
|
|
104
|
-
registerIcons,
|
|
105
|
-
registerIconSet
|
|
106
|
-
} = await Promise.resolve().then(() => require("../src/icon.cjs"));
|
|
107
|
-
registerIcons([{
|
|
108
|
-
name: "batch-1",
|
|
109
|
-
svg: '<path d="M1" />'
|
|
110
|
-
}, {
|
|
111
|
-
name: "batch-2",
|
|
112
|
-
svg: '<path d="M2" />'
|
|
113
|
-
}]);
|
|
114
|
-
const iconSet = {
|
|
115
|
-
prefix: "custom",
|
|
116
|
-
icons: {
|
|
117
|
-
"icon-1": {
|
|
118
|
-
name: "icon-1",
|
|
119
|
-
svg: '<path d="M1 1" />'
|
|
120
|
-
},
|
|
121
|
-
"icon-2": {
|
|
122
|
-
name: "icon-2",
|
|
123
|
-
svg: '<path d="M2 2" />'
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
};
|
|
127
|
-
registerIconSet(iconSet);
|
|
128
|
-
const wrapper = (0, _testUtils.mount)(_index.YhIcon, {
|
|
129
|
-
props: {
|
|
130
|
-
name: "custom:icon-1"
|
|
131
|
-
}
|
|
132
|
-
});
|
|
133
|
-
(0, _vitest.expect)(wrapper.find("svg").html()).toContain('d="M1 1"');
|
|
134
|
-
});
|
|
135
|
-
(0, _vitest.it)("slot test", () => {
|
|
136
|
-
const wrapper = (0, _testUtils.mount)(_index.YhIcon, {
|
|
137
|
-
slots: {
|
|
138
|
-
default: '<span class="custom-slot">custom</span>'
|
|
139
|
-
}
|
|
140
|
-
});
|
|
141
|
-
(0, _vitest.expect)(wrapper.find(".custom-slot").exists()).toBe(true);
|
|
142
|
-
(0, _vitest.expect)(wrapper.text()).toBe("custom");
|
|
143
|
-
});
|
|
144
|
-
});
|