@yh-ui/components 0.1.21 → 0.1.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- 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 +6 -6
- 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,366 +0,0 @@
|
|
|
1
|
-
import { mount } from "@vue/test-utils";
|
|
2
|
-
import { describe, it, expect, vi } from "vitest";
|
|
3
|
-
import YhFormSchema from "../src/form-schema.vue";
|
|
4
|
-
import { nextTick, h } from "vue";
|
|
5
|
-
const YhInput = {
|
|
6
|
-
name: "YhInput",
|
|
7
|
-
props: ["modelValue", "placeholder", "disabled"],
|
|
8
|
-
template: `<input class="yh-input" :value="modelValue" @input="$emit('update:modelValue', $event.target.value)" :placeholder="placeholder" :disabled="disabled" />`
|
|
9
|
-
};
|
|
10
|
-
const YhSelect = {
|
|
11
|
-
name: "YhSelect",
|
|
12
|
-
props: ["modelValue", "options", "loading"],
|
|
13
|
-
template: `<select class="yh-select" :value="modelValue" @change="$emit('update:modelValue', $event.target.value)"><option v-for="opt in options" :key="opt.value" :value="opt.value">{{opt.label}}</option></select>`
|
|
14
|
-
};
|
|
15
|
-
const YhSwitch = {
|
|
16
|
-
name: "YhSwitch",
|
|
17
|
-
props: ["modelValue"],
|
|
18
|
-
template: `<input type="checkbox" class="yh-switch" :checked="modelValue" @change="$emit('update:modelValue', $event.target.checked)" />`
|
|
19
|
-
};
|
|
20
|
-
const YhButton = {
|
|
21
|
-
name: "YhButton",
|
|
22
|
-
props: ["type", "text", "disabled"],
|
|
23
|
-
emits: ["click"],
|
|
24
|
-
template: `<button class="yh-button" :disabled="disabled" @click="$emit('click')"><slot /></button>`
|
|
25
|
-
};
|
|
26
|
-
const globalComponents = {
|
|
27
|
-
"yh-input": YhInput,
|
|
28
|
-
"yh-select": YhSelect,
|
|
29
|
-
"yh-switch": YhSwitch,
|
|
30
|
-
"yh-button": YhButton
|
|
31
|
-
};
|
|
32
|
-
describe("FormSchema", () => {
|
|
33
|
-
it("\u57FA\u7840\u6E32\u67D3 - \u6309 schema \u6E32\u67D3\u8868\u5355\u9879", async () => {
|
|
34
|
-
const model = { username: "ant", role: "" };
|
|
35
|
-
const schema = [
|
|
36
|
-
{
|
|
37
|
-
field: "username",
|
|
38
|
-
label: "Username",
|
|
39
|
-
component: "input",
|
|
40
|
-
props: { placeholder: "Enter username" }
|
|
41
|
-
}
|
|
42
|
-
];
|
|
43
|
-
const wrapper = mount(YhFormSchema, {
|
|
44
|
-
props: { modelValue: model, schema },
|
|
45
|
-
global: { components: globalComponents }
|
|
46
|
-
});
|
|
47
|
-
expect(wrapper.find(".yh-form").exists()).toBe(true);
|
|
48
|
-
const input = wrapper.find("input");
|
|
49
|
-
expect(input.attributes("placeholder")).toBe("Enter username");
|
|
50
|
-
});
|
|
51
|
-
it("\u53CC\u5411\u7ED1\u5B9A - v-model \u540C\u6B65\u66F4\u65B0", async () => {
|
|
52
|
-
const model = { username: "" };
|
|
53
|
-
const schema = [{ field: "username", component: "input" }];
|
|
54
|
-
const wrapper = mount(YhFormSchema, {
|
|
55
|
-
props: { modelValue: model, schema },
|
|
56
|
-
global: { components: globalComponents }
|
|
57
|
-
});
|
|
58
|
-
const input = wrapper.find("input");
|
|
59
|
-
await input.setValue("new_user");
|
|
60
|
-
expect(wrapper.emitted("update:modelValue")).toBeTruthy();
|
|
61
|
-
const lastEmitted = wrapper.emitted("update:modelValue").slice(-1)[0][0];
|
|
62
|
-
expect(lastEmitted.username).toBe("new_user");
|
|
63
|
-
});
|
|
64
|
-
it("change \u4E8B\u4EF6 - \u89E6\u53D1 change \u5E76\u5305\u542B field \u548C val", async () => {
|
|
65
|
-
const wrapper = mount(YhFormSchema, {
|
|
66
|
-
props: { modelValue: { name: "" }, schema: [{ field: "name", component: "input" }] },
|
|
67
|
-
global: { components: globalComponents }
|
|
68
|
-
});
|
|
69
|
-
await wrapper.find("input").setValue("test");
|
|
70
|
-
const changeEvents = wrapper.emitted("change");
|
|
71
|
-
expect(changeEvents.length).toBeGreaterThan(0);
|
|
72
|
-
expect(changeEvents[0][0]).toBe("name");
|
|
73
|
-
expect(changeEvents[0][1]).toBe("test");
|
|
74
|
-
});
|
|
75
|
-
it("\u52A8\u6001\u663E\u9690 - hidden \u51FD\u6570\u652F\u6301\u8054\u52A8", async () => {
|
|
76
|
-
const schema = [
|
|
77
|
-
{ field: "showExtra", component: "input" },
|
|
78
|
-
{
|
|
79
|
-
field: "extra",
|
|
80
|
-
label: "Extra Label",
|
|
81
|
-
component: "input",
|
|
82
|
-
hidden: (m) => !m.showExtra
|
|
83
|
-
}
|
|
84
|
-
];
|
|
85
|
-
const wrapper = mount(YhFormSchema, {
|
|
86
|
-
props: { modelValue: { showExtra: false, extra: "" }, schema },
|
|
87
|
-
global: { components: globalComponents }
|
|
88
|
-
});
|
|
89
|
-
expect(wrapper.text()).not.toContain("Extra Label");
|
|
90
|
-
await wrapper.setProps({ modelValue: { showExtra: true, extra: "visible" } });
|
|
91
|
-
await nextTick();
|
|
92
|
-
expect(wrapper.text()).toContain("Extra Label");
|
|
93
|
-
});
|
|
94
|
-
it("\u52A8\u6001\u8054\u52A8 - required \u548C rules \u652F\u6301\u4F20\u5165\u51FD\u6570\u8BA1\u7B97", async () => {
|
|
95
|
-
const schema = [
|
|
96
|
-
{ field: "type", component: "input" },
|
|
97
|
-
{
|
|
98
|
-
field: "reason",
|
|
99
|
-
component: "input",
|
|
100
|
-
required: (model) => model.type === "other",
|
|
101
|
-
rules: (model) => {
|
|
102
|
-
return model.type === "other" ? [{ min: 5, message: "\u81F3\u5C11 5 \u4E2A\u5B57\u7B26", trigger: "blur" }] : [];
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
];
|
|
106
|
-
const wrapper = mount(YhFormSchema, {
|
|
107
|
-
props: { modelValue: { type: "normal", reason: "" }, schema },
|
|
108
|
-
global: { components: globalComponents }
|
|
109
|
-
});
|
|
110
|
-
const reasonItem = wrapper.findAll(".yh-form-item")[1];
|
|
111
|
-
expect(reasonItem.classes()).not.toContain("is-required");
|
|
112
|
-
await wrapper.setProps({ modelValue: { type: "other", reason: "" } });
|
|
113
|
-
expect(reasonItem.classes()).toContain("is-required");
|
|
114
|
-
});
|
|
115
|
-
it("\u5206\u7EC4\u6E32\u67D3 - \u5C55\u793A group title \u5E76\u652F\u6301\u6298\u53E0", async () => {
|
|
116
|
-
const schema = [
|
|
117
|
-
{
|
|
118
|
-
title: "Basic Info",
|
|
119
|
-
items: [{ field: "name", component: "input" }],
|
|
120
|
-
collapsible: true
|
|
121
|
-
}
|
|
122
|
-
];
|
|
123
|
-
const wrapper = mount(YhFormSchema, {
|
|
124
|
-
props: { modelValue: { name: "" }, schema },
|
|
125
|
-
global: { components: globalComponents }
|
|
126
|
-
});
|
|
127
|
-
expect(wrapper.find(".yh-form-schema__group-title").text()).toContain("Basic Info");
|
|
128
|
-
await wrapper.find(".yh-form-schema__group-title").trigger("click");
|
|
129
|
-
expect(wrapper.find(".yh-form-schema__group").classes()).toContain("is-collapsed");
|
|
130
|
-
});
|
|
131
|
-
it("\u5F02\u6B65\u9009\u9879 - asyncOptions \u81EA\u52A8\u52A0\u8F7D\u5E76\u6CE8\u5165", async () => {
|
|
132
|
-
const asyncOptions = vi.fn().mockResolvedValue([{ label: "Option A", value: "a" }]);
|
|
133
|
-
const schema = [{ field: "type", component: "select", asyncOptions }];
|
|
134
|
-
const wrapper = mount(YhFormSchema, {
|
|
135
|
-
props: { modelValue: { type: "" }, schema },
|
|
136
|
-
global: { components: globalComponents }
|
|
137
|
-
});
|
|
138
|
-
await nextTick();
|
|
139
|
-
await nextTick();
|
|
140
|
-
await nextTick();
|
|
141
|
-
expect(asyncOptions).toHaveBeenCalled();
|
|
142
|
-
const options = wrapper.findAll("option");
|
|
143
|
-
expect(options.length).toBeGreaterThan(0);
|
|
144
|
-
});
|
|
145
|
-
it("render \u51FD\u6570 - \u81EA\u5B9A\u4E49\u6E32\u67D3", () => {
|
|
146
|
-
const schema = [
|
|
147
|
-
{
|
|
148
|
-
field: "custom",
|
|
149
|
-
render: (m) => h("div", { class: "custom-render" }, `Val: ${m.custom}`)
|
|
150
|
-
}
|
|
151
|
-
];
|
|
152
|
-
const wrapper = mount(YhFormSchema, {
|
|
153
|
-
props: { modelValue: { custom: "hello" }, schema },
|
|
154
|
-
global: { components: globalComponents }
|
|
155
|
-
});
|
|
156
|
-
expect(wrapper.find(".custom-render").text()).toBe("Val: hello");
|
|
157
|
-
});
|
|
158
|
-
it("\u66B4\u9732 API - validate/resetFields/clearValidate/getModel/setFieldValue", () => {
|
|
159
|
-
const wrapper = mount(YhFormSchema, {
|
|
160
|
-
props: { modelValue: {}, schema: [] },
|
|
161
|
-
global: { components: globalComponents }
|
|
162
|
-
});
|
|
163
|
-
const vm = wrapper.vm;
|
|
164
|
-
expect(typeof vm.validate).toBe("function");
|
|
165
|
-
expect(typeof vm.resetFields).toBe("function");
|
|
166
|
-
expect(typeof vm.clearValidate).toBe("function");
|
|
167
|
-
expect(typeof vm.getModel).toBe("function");
|
|
168
|
-
expect(typeof vm.setFieldValue).toBe("function");
|
|
169
|
-
});
|
|
170
|
-
it("getModel - \u8FD4\u56DE\u5F53\u524D\u5B8C\u6574 model \u5FEB\u7167", async () => {
|
|
171
|
-
const wrapper = mount(YhFormSchema, {
|
|
172
|
-
props: { modelValue: { city: "BJ" }, schema: [{ field: "city", component: "input" }] },
|
|
173
|
-
global: { components: globalComponents }
|
|
174
|
-
});
|
|
175
|
-
const model = wrapper.vm.getModel();
|
|
176
|
-
expect(model.city).toBe("BJ");
|
|
177
|
-
});
|
|
178
|
-
it("setFieldValue - \u52A8\u6001\u66F4\u65B0\u5355\u5B57\u6BB5\u503C", async () => {
|
|
179
|
-
const wrapper = mount(YhFormSchema, {
|
|
180
|
-
props: { modelValue: { city: "" }, schema: [{ field: "city", component: "input" }] },
|
|
181
|
-
global: { components: globalComponents }
|
|
182
|
-
});
|
|
183
|
-
wrapper.vm.setFieldValue("city", "SH");
|
|
184
|
-
await nextTick();
|
|
185
|
-
const emitted = wrapper.emitted("update:modelValue");
|
|
186
|
-
const last = emitted[emitted.length - 1][0];
|
|
187
|
-
expect(last.city).toBe("SH");
|
|
188
|
-
});
|
|
189
|
-
it("required \u7B80\u5199 - \u81EA\u52A8\u6DFB\u52A0\u5FC5\u586B\u89C4\u5219\u5E76\u89E6\u53D1\u6821\u9A8C", async () => {
|
|
190
|
-
const schema = [{ field: "name", label: "\u59D3\u540D", component: "input", required: true }];
|
|
191
|
-
const wrapper = mount(YhFormSchema, {
|
|
192
|
-
props: { modelValue: { name: "" }, schema },
|
|
193
|
-
global: { components: globalComponents }
|
|
194
|
-
});
|
|
195
|
-
let isValid = true;
|
|
196
|
-
try {
|
|
197
|
-
isValid = await wrapper.vm.validate();
|
|
198
|
-
} catch (_) {
|
|
199
|
-
isValid = false;
|
|
200
|
-
}
|
|
201
|
-
expect(isValid).toBe(false);
|
|
202
|
-
});
|
|
203
|
-
it("type divider - \u6E32\u67D3\u5206\u9694\u7EBF", () => {
|
|
204
|
-
const schema = [{ type: "divider", label: "\u57FA\u672C\u4FE1\u606F", field: "_d" }];
|
|
205
|
-
const wrapper = mount(YhFormSchema, {
|
|
206
|
-
props: { modelValue: {}, schema },
|
|
207
|
-
global: { components: globalComponents }
|
|
208
|
-
});
|
|
209
|
-
expect(wrapper.find(".yh-form-schema__divider").exists()).toBe(true);
|
|
210
|
-
expect(wrapper.find(".yh-form-schema__divider-label").text()).toBe("\u57FA\u672C\u4FE1\u606F");
|
|
211
|
-
});
|
|
212
|
-
it("type text - \u53EA\u8BFB\u663E\u793A\u5B57\u6BB5\u503C", () => {
|
|
213
|
-
const schema = [{ type: "text", label: "\u59D3\u540D", field: "name" }];
|
|
214
|
-
const wrapper = mount(YhFormSchema, {
|
|
215
|
-
props: { modelValue: { name: "Alice" }, schema },
|
|
216
|
-
global: { components: globalComponents }
|
|
217
|
-
});
|
|
218
|
-
expect(wrapper.find(".yh-form-schema__text-value").text()).toBe("Alice");
|
|
219
|
-
});
|
|
220
|
-
it("type text - emptyValue \u7A7A\u6001\u5360\u4F4D\u7B26", async () => {
|
|
221
|
-
const schema = [
|
|
222
|
-
{ type: "text", label: "\u7535\u8BDD", field: "phone", emptyValue: "\u6682\u65E0" },
|
|
223
|
-
{ type: "text", label: "\u5730\u5740", field: "addr" }
|
|
224
|
-
];
|
|
225
|
-
const wrapper = mount(YhFormSchema, {
|
|
226
|
-
props: { modelValue: { phone: null, addr: void 0 }, schema },
|
|
227
|
-
global: { components: globalComponents }
|
|
228
|
-
});
|
|
229
|
-
await nextTick();
|
|
230
|
-
const items = wrapper.findAll(".yh-form-schema__text-value");
|
|
231
|
-
expect(items[0].text()).toBe("\u6682\u65E0");
|
|
232
|
-
expect(items[1].text()).toBe("-");
|
|
233
|
-
});
|
|
234
|
-
it("defaultValue - \u672A\u8BBE\u7F6E\u5B57\u6BB5\u65F6\u586B\u5145\u9ED8\u8BA4\u503C", async () => {
|
|
235
|
-
const schema = [{ field: "city", component: "input", defaultValue: "Beijing" }];
|
|
236
|
-
const wrapper = mount(YhFormSchema, {
|
|
237
|
-
props: { modelValue: {}, schema },
|
|
238
|
-
global: { components: globalComponents }
|
|
239
|
-
});
|
|
240
|
-
await nextTick();
|
|
241
|
-
const emitted = wrapper.emitted("update:modelValue");
|
|
242
|
-
expect(emitted).toBeTruthy();
|
|
243
|
-
const last = emitted[emitted.length - 1][0];
|
|
244
|
-
expect(last.city).toBe("Beijing");
|
|
245
|
-
});
|
|
246
|
-
it("disabled \u51FD\u6570 - \u6839\u636E model \u52A8\u6001\u7981\u7528\u5B57\u6BB5", async () => {
|
|
247
|
-
const schema = [
|
|
248
|
-
{ field: "toggle", component: "switch" },
|
|
249
|
-
{
|
|
250
|
-
field: "target",
|
|
251
|
-
component: "input",
|
|
252
|
-
disabled: (m) => !m.toggle
|
|
253
|
-
}
|
|
254
|
-
];
|
|
255
|
-
const wrapper = mount(YhFormSchema, {
|
|
256
|
-
props: { modelValue: { toggle: false, target: "" }, schema },
|
|
257
|
-
global: { components: globalComponents }
|
|
258
|
-
});
|
|
259
|
-
const input = wrapper.find('input[type="text"], input:not([type="checkbox"])').element;
|
|
260
|
-
expect(input.disabled).toBe(true);
|
|
261
|
-
});
|
|
262
|
-
it("\u5916\u90E8 modelValue \u66F4\u65B0 - localModel \u540C\u6B65\u54CD\u5E94", async () => {
|
|
263
|
-
const wrapper = mount(YhFormSchema, {
|
|
264
|
-
props: { modelValue: { name: "old" }, schema: [{ field: "name", component: "input" }] },
|
|
265
|
-
global: { components: globalComponents }
|
|
266
|
-
});
|
|
267
|
-
await wrapper.setProps({ modelValue: { name: "new" } });
|
|
268
|
-
await nextTick();
|
|
269
|
-
const input = wrapper.find("input");
|
|
270
|
-
expect(input.element.value).toBe("new");
|
|
271
|
-
});
|
|
272
|
-
describe("type list - \u52A8\u6001\u589E\u51CF\u5217\u8868", () => {
|
|
273
|
-
const listSchema = [
|
|
274
|
-
{ field: "name", label: "\u59D3\u540D", component: "input" },
|
|
275
|
-
{ field: "phone", label: "\u7535\u8BDD", component: "input" }
|
|
276
|
-
];
|
|
277
|
-
it("\u521D\u59CB\u6E32\u67D3 - \u6309\u5DF2\u6709\u5217\u8868\u6570\u636E\u6E32\u67D3\u884C", async () => {
|
|
278
|
-
const schema = [
|
|
279
|
-
{ field: "contacts", label: "\u8054\u7CFB\u4EBA", type: "list", listSchema, listProps: {} }
|
|
280
|
-
];
|
|
281
|
-
const wrapper = mount(YhFormSchema, {
|
|
282
|
-
props: {
|
|
283
|
-
modelValue: {
|
|
284
|
-
contacts: [
|
|
285
|
-
{ name: "Alice", phone: "111" },
|
|
286
|
-
{ name: "Bob", phone: "222" }
|
|
287
|
-
]
|
|
288
|
-
},
|
|
289
|
-
schema
|
|
290
|
-
},
|
|
291
|
-
global: { components: globalComponents }
|
|
292
|
-
});
|
|
293
|
-
await nextTick();
|
|
294
|
-
expect(wrapper.findAll(".yh-form-schema__list-row").length).toBe(2);
|
|
295
|
-
});
|
|
296
|
-
it("\u6DFB\u52A0\u5217\u8868\u9879 - \u70B9\u51FB\u6DFB\u52A0\u6309\u94AE\u589E\u52A0\u4E00\u884C", async () => {
|
|
297
|
-
const schema = [
|
|
298
|
-
{ field: "contacts", label: "\u8054\u7CFB\u4EBA", type: "list", listSchema, listProps: {} }
|
|
299
|
-
];
|
|
300
|
-
const wrapper = mount(YhFormSchema, {
|
|
301
|
-
props: { modelValue: { contacts: [] }, schema },
|
|
302
|
-
global: { components: globalComponents }
|
|
303
|
-
});
|
|
304
|
-
await wrapper.find(".yh-form-schema__list-add").trigger("click");
|
|
305
|
-
await nextTick();
|
|
306
|
-
const emitted = wrapper.emitted("update:modelValue");
|
|
307
|
-
const last = emitted[emitted.length - 1][0];
|
|
308
|
-
expect(last.contacts.length).toBe(1);
|
|
309
|
-
});
|
|
310
|
-
it("\u5220\u9664\u5217\u8868\u9879 - \u70B9\u51FB\u5220\u9664\u6309\u94AE\u79FB\u9664\u5BF9\u5E94\u884C", async () => {
|
|
311
|
-
const schema = [
|
|
312
|
-
{ field: "contacts", label: "\u8054\u7CFB\u4EBA", type: "list", listSchema, listProps: {} }
|
|
313
|
-
];
|
|
314
|
-
const wrapper = mount(YhFormSchema, {
|
|
315
|
-
props: { modelValue: { contacts: [{ name: "Alice", phone: "111" }] }, schema },
|
|
316
|
-
global: { components: globalComponents }
|
|
317
|
-
});
|
|
318
|
-
await nextTick();
|
|
319
|
-
await wrapper.find(".yh-form-schema__list-delete").trigger("click");
|
|
320
|
-
await nextTick();
|
|
321
|
-
const emitted = wrapper.emitted("update:modelValue");
|
|
322
|
-
const last = emitted[emitted.length - 1][0];
|
|
323
|
-
expect(last.contacts.length).toBe(0);
|
|
324
|
-
});
|
|
325
|
-
it("max \u9650\u5236 - \u8D85\u51FA\u6700\u5927\u6570\u91CF\u65F6\u7981\u7528\u6DFB\u52A0\u6309\u94AE", async () => {
|
|
326
|
-
const schema = [
|
|
327
|
-
{ field: "contacts", label: "\u8054\u7CFB\u4EBA", type: "list", listSchema, listProps: { max: 1 } }
|
|
328
|
-
];
|
|
329
|
-
const wrapper = mount(YhFormSchema, {
|
|
330
|
-
props: { modelValue: { contacts: [{ name: "Alice", phone: "111" }] }, schema },
|
|
331
|
-
global: { components: globalComponents }
|
|
332
|
-
});
|
|
333
|
-
await nextTick();
|
|
334
|
-
const addBtn = wrapper.find(".yh-form-schema__list-add");
|
|
335
|
-
expect(addBtn.attributes("disabled")).toBeDefined();
|
|
336
|
-
});
|
|
337
|
-
it("min \u9650\u5236 - \u672A\u8FBE\u5230\u6700\u5C0F\u6570\u91CF\u65F6\u7981\u7528\u5220\u9664\u6309\u94AE", async () => {
|
|
338
|
-
const schema = [
|
|
339
|
-
{ field: "contacts", label: "\u8054\u7CFB\u4EBA", type: "list", listSchema, listProps: { min: 1 } }
|
|
340
|
-
];
|
|
341
|
-
const wrapper = mount(YhFormSchema, {
|
|
342
|
-
props: { modelValue: { contacts: [{ name: "Alice", phone: "111" }] }, schema },
|
|
343
|
-
global: { components: globalComponents }
|
|
344
|
-
});
|
|
345
|
-
await nextTick();
|
|
346
|
-
const delBtn = wrapper.find(".yh-form-schema__list-delete");
|
|
347
|
-
expect(delBtn.attributes("disabled")).toBeDefined();
|
|
348
|
-
});
|
|
349
|
-
it("addButtonText - \u81EA\u5B9A\u4E49\u6DFB\u52A0\u6309\u94AE\u6587\u6848", async () => {
|
|
350
|
-
const schema = [
|
|
351
|
-
{
|
|
352
|
-
field: "contacts",
|
|
353
|
-
label: "\u8054\u7CFB\u4EBA",
|
|
354
|
-
type: "list",
|
|
355
|
-
listSchema,
|
|
356
|
-
listProps: { addButtonText: "\u65B0\u589E\u8054\u7CFB\u4EBA" }
|
|
357
|
-
}
|
|
358
|
-
];
|
|
359
|
-
const wrapper = mount(YhFormSchema, {
|
|
360
|
-
props: { modelValue: { contacts: [] }, schema },
|
|
361
|
-
global: { components: globalComponents }
|
|
362
|
-
});
|
|
363
|
-
expect(wrapper.find(".yh-form-schema__list-add").text()).toContain("\u65B0\u589E\u8054\u7CFB\u4EBA");
|
|
364
|
-
});
|
|
365
|
-
});
|
|
366
|
-
});
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _vitest = require("vitest");
|
|
4
|
-
var _form = _interopRequireDefault(require("../src/form.vue"));
|
|
5
|
-
var _formItem = _interopRequireDefault(require("../src/form-item.vue"));
|
|
6
|
-
var _input = _interopRequireDefault(require("../../input/src/input.vue"));
|
|
7
|
-
var _ssr = require("../../__tests__/utils/ssr.cjs");
|
|
8
|
-
var _vue = require("vue");
|
|
9
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
-
(0, _vitest.describe)("YhForm SSR", () => {
|
|
11
|
-
(0, _vitest.it)("should render form correctly in SSR", async () => {
|
|
12
|
-
const html = await (0, _ssr.renderSSR)(_form.default, {
|
|
13
|
-
model: {
|
|
14
|
-
name: ""
|
|
15
|
-
},
|
|
16
|
-
labelWidth: "100px"
|
|
17
|
-
}, {
|
|
18
|
-
default: () => (0, _vue.h)(_formItem.default, {
|
|
19
|
-
label: "Name",
|
|
20
|
-
prop: "name"
|
|
21
|
-
}, {
|
|
22
|
-
default: () => (0, _vue.h)(_input.default, {
|
|
23
|
-
modelValue: ""
|
|
24
|
-
})
|
|
25
|
-
})
|
|
26
|
-
});
|
|
27
|
-
(0, _ssr.expectSSRHasClass)(html, "yh-form");
|
|
28
|
-
(0, _vitest.expect)(html).toContain("Name");
|
|
29
|
-
});
|
|
30
|
-
(0, _vitest.it)("should render inline form in SSR", async () => {
|
|
31
|
-
const html = await (0, _ssr.renderSSR)(_form.default, {
|
|
32
|
-
layout: "inline",
|
|
33
|
-
model: {}
|
|
34
|
-
});
|
|
35
|
-
(0, _ssr.expectSSRHasClass)(html, "yh-form--inline");
|
|
36
|
-
});
|
|
37
|
-
(0, _vitest.it)("should render different label positions in SSR", async () => {
|
|
38
|
-
const positions = ["left", "right", "top"];
|
|
39
|
-
for (const pos of positions) {
|
|
40
|
-
const html = await (0, _ssr.renderSSR)(_form.default, {
|
|
41
|
-
labelPosition: pos,
|
|
42
|
-
model: {}
|
|
43
|
-
});
|
|
44
|
-
(0, _ssr.expectSSRHasClass)(html, `yh-form--label-${pos}`);
|
|
45
|
-
}
|
|
46
|
-
});
|
|
47
|
-
(0, _vitest.it)("should hydrate form without mismatch", async () => {
|
|
48
|
-
const result = await (0, _ssr.testHydration)(_form.default, {
|
|
49
|
-
model: {
|
|
50
|
-
test: "123"
|
|
51
|
-
}
|
|
52
|
-
}, {
|
|
53
|
-
default: () => (0, _vue.h)(_formItem.default, {
|
|
54
|
-
label: "Test",
|
|
55
|
-
prop: "test"
|
|
56
|
-
}, {
|
|
57
|
-
default: () => (0, _vue.h)(_input.default, {
|
|
58
|
-
modelValue: "123"
|
|
59
|
-
})
|
|
60
|
-
})
|
|
61
|
-
});
|
|
62
|
-
(0, _vitest.expect)(result.isMatch).toBe(true);
|
|
63
|
-
});
|
|
64
|
-
(0, _vitest.it)("should render validation states in SSR", async () => {
|
|
65
|
-
const html = await (0, _ssr.renderSSR)(_formItem.default, {
|
|
66
|
-
label: "Email",
|
|
67
|
-
error: "Invalid email",
|
|
68
|
-
showMessage: true,
|
|
69
|
-
validateStatus: "error"
|
|
70
|
-
});
|
|
71
|
-
(0, _ssr.expectSSRHasClass)(html, "is-error");
|
|
72
|
-
(0, _vitest.expect)(html).toContain("Invalid email");
|
|
73
|
-
});
|
|
74
|
-
});
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect } from "vitest";
|
|
2
|
-
import Form from "../src/form.vue";
|
|
3
|
-
import FormItem from "../src/form-item.vue";
|
|
4
|
-
import Input from "../../input/src/input.vue";
|
|
5
|
-
import { renderSSR, expectSSRHasClass, testHydration } from "../../__tests__/utils/ssr.mjs";
|
|
6
|
-
import { h } from "vue";
|
|
7
|
-
describe("YhForm SSR", () => {
|
|
8
|
-
it("should render form correctly in SSR", async () => {
|
|
9
|
-
const html = await renderSSR(
|
|
10
|
-
Form,
|
|
11
|
-
{
|
|
12
|
-
model: { name: "" },
|
|
13
|
-
labelWidth: "100px"
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
default: () => h(
|
|
17
|
-
FormItem,
|
|
18
|
-
{ label: "Name", prop: "name" },
|
|
19
|
-
{
|
|
20
|
-
default: () => h(Input, { modelValue: "" })
|
|
21
|
-
}
|
|
22
|
-
)
|
|
23
|
-
}
|
|
24
|
-
);
|
|
25
|
-
expectSSRHasClass(html, "yh-form");
|
|
26
|
-
expect(html).toContain("Name");
|
|
27
|
-
});
|
|
28
|
-
it("should render inline form in SSR", async () => {
|
|
29
|
-
const html = await renderSSR(Form, {
|
|
30
|
-
layout: "inline",
|
|
31
|
-
model: {}
|
|
32
|
-
});
|
|
33
|
-
expectSSRHasClass(html, "yh-form--inline");
|
|
34
|
-
});
|
|
35
|
-
it("should render different label positions in SSR", async () => {
|
|
36
|
-
const positions = ["left", "right", "top"];
|
|
37
|
-
for (const pos of positions) {
|
|
38
|
-
const html = await renderSSR(Form, {
|
|
39
|
-
labelPosition: pos,
|
|
40
|
-
model: {}
|
|
41
|
-
});
|
|
42
|
-
expectSSRHasClass(html, `yh-form--label-${pos}`);
|
|
43
|
-
}
|
|
44
|
-
});
|
|
45
|
-
it("should hydrate form without mismatch", async () => {
|
|
46
|
-
const result = await testHydration(
|
|
47
|
-
Form,
|
|
48
|
-
{
|
|
49
|
-
model: { test: "123" }
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
default: () => h(
|
|
53
|
-
FormItem,
|
|
54
|
-
{ label: "Test", prop: "test" },
|
|
55
|
-
{
|
|
56
|
-
default: () => h(Input, { modelValue: "123" })
|
|
57
|
-
}
|
|
58
|
-
)
|
|
59
|
-
}
|
|
60
|
-
);
|
|
61
|
-
expect(result.isMatch).toBe(true);
|
|
62
|
-
});
|
|
63
|
-
it("should render validation states in SSR", async () => {
|
|
64
|
-
const html = await renderSSR(FormItem, {
|
|
65
|
-
label: "Email",
|
|
66
|
-
error: "Invalid email",
|
|
67
|
-
showMessage: true,
|
|
68
|
-
validateStatus: "error"
|
|
69
|
-
});
|
|
70
|
-
expectSSRHasClass(html, "is-error");
|
|
71
|
-
expect(html).toContain("Invalid email");
|
|
72
|
-
});
|
|
73
|
-
});
|