@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,485 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect, vi, beforeEach, afterEach } from "vitest";
|
|
2
|
-
import {
|
|
3
|
-
getRowKey,
|
|
4
|
-
getColumnKey,
|
|
5
|
-
flattenColumns,
|
|
6
|
-
getColumnDepth,
|
|
7
|
-
buildHeaderRows,
|
|
8
|
-
calculateColumnWidth,
|
|
9
|
-
defaultSortMethod,
|
|
10
|
-
multiColumnSort,
|
|
11
|
-
defaultFilterMethod,
|
|
12
|
-
multiValueFilter,
|
|
13
|
-
flattenTreeData,
|
|
14
|
-
getAllTreeKeys,
|
|
15
|
-
formatSize,
|
|
16
|
-
calculateSpan,
|
|
17
|
-
throttle,
|
|
18
|
-
debounce,
|
|
19
|
-
deepClone,
|
|
20
|
-
isEmpty,
|
|
21
|
-
generateId,
|
|
22
|
-
formatCellValue,
|
|
23
|
-
getFixedStyle,
|
|
24
|
-
exportToCSV
|
|
25
|
-
} from "../src/utils.mjs";
|
|
26
|
-
describe("table/utils", () => {
|
|
27
|
-
describe("getRowKey", () => {
|
|
28
|
-
it("should return key via string rowKey", () => {
|
|
29
|
-
expect(getRowKey({ id: 1, name: "a" }, "id")).toBe(1);
|
|
30
|
-
});
|
|
31
|
-
it("should return key via function rowKey", () => {
|
|
32
|
-
expect(getRowKey({ id: 2 }, (row) => row.id)).toBe(2);
|
|
33
|
-
});
|
|
34
|
-
});
|
|
35
|
-
describe("getColumnKey", () => {
|
|
36
|
-
it("should prefer key over prop", () => {
|
|
37
|
-
expect(getColumnKey({ key: "myKey", prop: "myProp", label: "Label" })).toBe("myKey");
|
|
38
|
-
});
|
|
39
|
-
it("should fall back to prop when key is missing", () => {
|
|
40
|
-
expect(getColumnKey({ prop: "name", label: "Name" })).toBe("name");
|
|
41
|
-
});
|
|
42
|
-
it("should return empty string when both missing", () => {
|
|
43
|
-
expect(getColumnKey({ label: "Test" })).toBe("");
|
|
44
|
-
});
|
|
45
|
-
});
|
|
46
|
-
describe("flattenColumns", () => {
|
|
47
|
-
it("should flatten nested columns", () => {
|
|
48
|
-
const cols = [
|
|
49
|
-
{
|
|
50
|
-
label: "Group",
|
|
51
|
-
children: [
|
|
52
|
-
{ prop: "a", label: "A" },
|
|
53
|
-
{ prop: "b", label: "B" }
|
|
54
|
-
]
|
|
55
|
-
},
|
|
56
|
-
{ prop: "c", label: "C" }
|
|
57
|
-
];
|
|
58
|
-
const flat = flattenColumns(cols);
|
|
59
|
-
expect(flat).toHaveLength(3);
|
|
60
|
-
expect(flat.map((c) => c.prop)).toEqual(["a", "b", "c"]);
|
|
61
|
-
});
|
|
62
|
-
it("should return leaf columns as-is", () => {
|
|
63
|
-
const cols = [{ prop: "x", label: "X" }];
|
|
64
|
-
expect(flattenColumns(cols)).toHaveLength(1);
|
|
65
|
-
});
|
|
66
|
-
});
|
|
67
|
-
describe("getColumnDepth", () => {
|
|
68
|
-
it("should return 1 for flat columns", () => {
|
|
69
|
-
const cols = [{ prop: "a", label: "A" }];
|
|
70
|
-
expect(getColumnDepth(cols)).toBe(1);
|
|
71
|
-
});
|
|
72
|
-
it("should return correct depth for nested columns", () => {
|
|
73
|
-
const cols = [
|
|
74
|
-
{
|
|
75
|
-
label: "Level1",
|
|
76
|
-
children: [
|
|
77
|
-
{
|
|
78
|
-
label: "Level2",
|
|
79
|
-
children: [{ prop: "leaf", label: "Leaf" }]
|
|
80
|
-
}
|
|
81
|
-
]
|
|
82
|
-
}
|
|
83
|
-
];
|
|
84
|
-
expect(getColumnDepth(cols)).toBe(3);
|
|
85
|
-
});
|
|
86
|
-
});
|
|
87
|
-
describe("buildHeaderRows", () => {
|
|
88
|
-
it("should return empty array for single-level columns", () => {
|
|
89
|
-
const cols = [{ prop: "a", label: "A" }];
|
|
90
|
-
expect(buildHeaderRows(cols)).toHaveLength(0);
|
|
91
|
-
});
|
|
92
|
-
it("should build correct header rows for grouped columns", () => {
|
|
93
|
-
const cols = [
|
|
94
|
-
{
|
|
95
|
-
label: "Group",
|
|
96
|
-
children: [
|
|
97
|
-
{ prop: "a", label: "A" },
|
|
98
|
-
{ prop: "b", label: "B" }
|
|
99
|
-
]
|
|
100
|
-
},
|
|
101
|
-
{ prop: "c", label: "C" }
|
|
102
|
-
];
|
|
103
|
-
const rows = buildHeaderRows(cols);
|
|
104
|
-
expect(rows).toHaveLength(2);
|
|
105
|
-
expect(rows[0][0].colspan).toBe(2);
|
|
106
|
-
expect(rows[0][1].rowspan).toBe(2);
|
|
107
|
-
});
|
|
108
|
-
});
|
|
109
|
-
describe("calculateColumnWidth", () => {
|
|
110
|
-
it("should return numeric width directly", () => {
|
|
111
|
-
const col = { prop: "a", label: "A", width: 100 };
|
|
112
|
-
expect(calculateColumnWidth(col, 800, [col])).toBe(100);
|
|
113
|
-
});
|
|
114
|
-
it("should compute percentage width", () => {
|
|
115
|
-
const col = { prop: "a", label: "A", width: "50%" };
|
|
116
|
-
expect(calculateColumnWidth(col, 800, [col])).toBe(400);
|
|
117
|
-
});
|
|
118
|
-
it("should parse string pixel width", () => {
|
|
119
|
-
const col = { prop: "a", label: "A", width: "120px" };
|
|
120
|
-
expect(calculateColumnWidth(col, 800, [col])).toBe(120);
|
|
121
|
-
});
|
|
122
|
-
it("should distribute remaining width evenly for flex columns", () => {
|
|
123
|
-
const fixedCol = { prop: "a", label: "A", width: 200 };
|
|
124
|
-
const flexCol = { prop: "b", label: "B" };
|
|
125
|
-
const all = [fixedCol, flexCol];
|
|
126
|
-
const width = calculateColumnWidth(flexCol, 800, all);
|
|
127
|
-
expect(width).toBe(600);
|
|
128
|
-
});
|
|
129
|
-
it("should respect minWidth", () => {
|
|
130
|
-
const col = { prop: "a", label: "A", minWidth: 150 };
|
|
131
|
-
const width = calculateColumnWidth(col, 100, [col]);
|
|
132
|
-
expect(width).toBe(150);
|
|
133
|
-
});
|
|
134
|
-
});
|
|
135
|
-
describe("defaultSortMethod", () => {
|
|
136
|
-
it("should return 0 when no order", () => {
|
|
137
|
-
expect(defaultSortMethod({ age: 1 }, { age: 2 }, "age", null)).toBe(0);
|
|
138
|
-
});
|
|
139
|
-
it("should sort numbers ascending", () => {
|
|
140
|
-
expect(defaultSortMethod({ age: 1 }, { age: 2 }, "age", "asc")).toBeLessThan(0);
|
|
141
|
-
expect(defaultSortMethod({ age: 2 }, { age: 1 }, "age", "asc")).toBeGreaterThan(0);
|
|
142
|
-
});
|
|
143
|
-
it("should sort numbers descending", () => {
|
|
144
|
-
expect(defaultSortMethod({ age: 1 }, { age: 2 }, "age", "desc")).toBeGreaterThan(0);
|
|
145
|
-
});
|
|
146
|
-
it("should sort strings", () => {
|
|
147
|
-
expect(defaultSortMethod({ name: "b" }, { name: "a" }, "name", "asc")).toBeGreaterThan(0);
|
|
148
|
-
});
|
|
149
|
-
it("should handle null/undefined values", () => {
|
|
150
|
-
expect(defaultSortMethod({ v: null }, { v: 1 }, "v", "asc")).toBeGreaterThan(0);
|
|
151
|
-
expect(defaultSortMethod({ v: 1 }, { v: null }, "v", "asc")).toBeLessThan(0);
|
|
152
|
-
expect(defaultSortMethod({ v: null }, { v: null }, "v", "asc")).toBe(0);
|
|
153
|
-
});
|
|
154
|
-
});
|
|
155
|
-
describe("multiColumnSort", () => {
|
|
156
|
-
it("should return original data when no sort states", () => {
|
|
157
|
-
const data = [{ a: 2 }, { a: 1 }];
|
|
158
|
-
expect(multiColumnSort(data, [])).toEqual(data);
|
|
159
|
-
});
|
|
160
|
-
it("should sort by single column", () => {
|
|
161
|
-
const data = [{ age: 3 }, { age: 1 }, { age: 2 }];
|
|
162
|
-
const sorted = multiColumnSort(data, [{ prop: "age", order: "asc" }]);
|
|
163
|
-
expect(sorted.map((r) => r.age)).toEqual([1, 2, 3]);
|
|
164
|
-
});
|
|
165
|
-
it("should respect custom sortMethod", () => {
|
|
166
|
-
const data = [{ v: "b" }, { v: "a" }];
|
|
167
|
-
const sortMethod = vi.fn((a, b) => a.v.localeCompare(b.v));
|
|
168
|
-
multiColumnSort(data, [{ prop: "v", order: "asc", sortMethod }]);
|
|
169
|
-
expect(sortMethod).toHaveBeenCalled();
|
|
170
|
-
});
|
|
171
|
-
it("should skip columns with no order", () => {
|
|
172
|
-
const data = [{ a: 2 }, { a: 1 }];
|
|
173
|
-
const sorted = multiColumnSort(data, [{ prop: "a", order: null }]);
|
|
174
|
-
expect(sorted).toHaveLength(2);
|
|
175
|
-
});
|
|
176
|
-
});
|
|
177
|
-
describe("defaultFilterMethod", () => {
|
|
178
|
-
it("should match exact value", () => {
|
|
179
|
-
const col = { prop: "status", label: "Status" };
|
|
180
|
-
expect(defaultFilterMethod("active", { status: "active" }, col)).toBe(true);
|
|
181
|
-
expect(defaultFilterMethod("inactive", { status: "active" }, col)).toBe(false);
|
|
182
|
-
});
|
|
183
|
-
it("should return true when no prop", () => {
|
|
184
|
-
expect(defaultFilterMethod("x", { a: "x" }, { label: "Test" })).toBe(true);
|
|
185
|
-
});
|
|
186
|
-
});
|
|
187
|
-
describe("multiValueFilter", () => {
|
|
188
|
-
const data = [
|
|
189
|
-
{ name: "Alice", status: "active", age: 25 },
|
|
190
|
-
{ name: "Bob", status: "inactive", age: 30 },
|
|
191
|
-
{ name: "Charlie", status: "active", age: 35 }
|
|
192
|
-
];
|
|
193
|
-
const columns = [
|
|
194
|
-
{ prop: "status", label: "Status" },
|
|
195
|
-
{ prop: "age", label: "Age" }
|
|
196
|
-
];
|
|
197
|
-
it("should return all data when no active filters", () => {
|
|
198
|
-
expect(multiValueFilter(data, {}, columns)).toHaveLength(3);
|
|
199
|
-
});
|
|
200
|
-
it("should filter by single value", () => {
|
|
201
|
-
const result = multiValueFilter(data, { status: ["active"] }, columns);
|
|
202
|
-
expect(result).toHaveLength(2);
|
|
203
|
-
expect(result.every((r) => r.status === "active")).toBe(true);
|
|
204
|
-
});
|
|
205
|
-
it("should filter by multiple columns", () => {
|
|
206
|
-
const result = multiValueFilter(data, { status: ["active"], age: [25] }, columns);
|
|
207
|
-
expect(result).toHaveLength(1);
|
|
208
|
-
expect(result[0].name).toBe("Alice");
|
|
209
|
-
});
|
|
210
|
-
it("should handle missing column gracefully", () => {
|
|
211
|
-
const result = multiValueFilter(data, { missing: ["x"] }, columns);
|
|
212
|
-
expect(result).toHaveLength(3);
|
|
213
|
-
});
|
|
214
|
-
});
|
|
215
|
-
describe("flattenTreeData", () => {
|
|
216
|
-
const treeData = [
|
|
217
|
-
{
|
|
218
|
-
id: 1,
|
|
219
|
-
name: "Parent",
|
|
220
|
-
children: [
|
|
221
|
-
{ id: 11, name: "Child1" },
|
|
222
|
-
{ id: 12, name: "Child2" }
|
|
223
|
-
]
|
|
224
|
-
},
|
|
225
|
-
{ id: 2, name: "Leaf" }
|
|
226
|
-
];
|
|
227
|
-
it("should flatten visible expanded nodes", () => {
|
|
228
|
-
const expanded = /* @__PURE__ */ new Set([1]);
|
|
229
|
-
const flat = flattenTreeData(treeData, "children", expanded, "id");
|
|
230
|
-
expect(flat).toHaveLength(4);
|
|
231
|
-
expect(flat[0]._level).toBe(0);
|
|
232
|
-
expect(flat[1]._level).toBe(1);
|
|
233
|
-
});
|
|
234
|
-
it("should not show children when not expanded", () => {
|
|
235
|
-
const expanded = /* @__PURE__ */ new Set();
|
|
236
|
-
const flat = flattenTreeData(treeData, "children", expanded, "id");
|
|
237
|
-
expect(flat).toHaveLength(2);
|
|
238
|
-
});
|
|
239
|
-
it("should mark leaf nodes correctly", () => {
|
|
240
|
-
const expanded = /* @__PURE__ */ new Set([1]);
|
|
241
|
-
const flat = flattenTreeData(treeData, "children", expanded, "id");
|
|
242
|
-
expect(flat[0]._hasChildren).toBe(true);
|
|
243
|
-
expect(flat[0]._isLeaf).toBe(false);
|
|
244
|
-
expect(flat[1]._isLeaf).toBe(true);
|
|
245
|
-
});
|
|
246
|
-
it("should support function rowKey", () => {
|
|
247
|
-
const expanded = /* @__PURE__ */ new Set([1]);
|
|
248
|
-
const flat = flattenTreeData(treeData, "children", expanded, (row) => row.id);
|
|
249
|
-
expect(flat).toHaveLength(4);
|
|
250
|
-
});
|
|
251
|
-
});
|
|
252
|
-
describe("getAllTreeKeys", () => {
|
|
253
|
-
it("should get all tree node keys recursively", () => {
|
|
254
|
-
const data = [{ id: 1, children: [{ id: 11 }, { id: 12 }] }, { id: 2 }];
|
|
255
|
-
const keys = getAllTreeKeys(data, "children", "id");
|
|
256
|
-
expect(keys).toEqual([1, 11, 12, 2]);
|
|
257
|
-
});
|
|
258
|
-
});
|
|
259
|
-
describe("formatSize", () => {
|
|
260
|
-
it("should return empty string for undefined", () => {
|
|
261
|
-
expect(formatSize(void 0)).toBe("");
|
|
262
|
-
});
|
|
263
|
-
it("should append px for numbers", () => {
|
|
264
|
-
expect(formatSize(100)).toBe("100px");
|
|
265
|
-
});
|
|
266
|
-
it("should append px for pure numeric strings", () => {
|
|
267
|
-
expect(formatSize("200")).toBe("200px");
|
|
268
|
-
});
|
|
269
|
-
it("should return string as-is when has unit", () => {
|
|
270
|
-
expect(formatSize("50%")).toBe("50%");
|
|
271
|
-
expect(formatSize("100px")).toBe("100px");
|
|
272
|
-
});
|
|
273
|
-
});
|
|
274
|
-
describe("calculateSpan", () => {
|
|
275
|
-
const col = { prop: "a", label: "A" };
|
|
276
|
-
const row = { a: 1 };
|
|
277
|
-
it("should return default span when no spanMethod", () => {
|
|
278
|
-
expect(calculateSpan(row, col, 0, 0)).toEqual({ rowspan: 1, colspan: 1 });
|
|
279
|
-
});
|
|
280
|
-
it("should handle array return from spanMethod", () => {
|
|
281
|
-
const result = calculateSpan(row, col, 0, 0, () => [2, 3]);
|
|
282
|
-
expect(result).toEqual({ rowspan: 2, colspan: 3 });
|
|
283
|
-
});
|
|
284
|
-
it("should handle object return from spanMethod", () => {
|
|
285
|
-
const result = calculateSpan(row, col, 0, 0, () => ({ rowspan: 3, colspan: 1 }));
|
|
286
|
-
expect(result).toEqual({ rowspan: 3, colspan: 1 });
|
|
287
|
-
});
|
|
288
|
-
it("should use default when spanMethod returns void", () => {
|
|
289
|
-
const result = calculateSpan(row, col, 0, 0, () => void 0);
|
|
290
|
-
expect(result).toEqual({ rowspan: 1, colspan: 1 });
|
|
291
|
-
});
|
|
292
|
-
});
|
|
293
|
-
describe("throttle", () => {
|
|
294
|
-
beforeEach(() => {
|
|
295
|
-
vi.useFakeTimers();
|
|
296
|
-
});
|
|
297
|
-
afterEach(() => {
|
|
298
|
-
vi.useRealTimers();
|
|
299
|
-
});
|
|
300
|
-
it("should call function immediately on first invocation", () => {
|
|
301
|
-
const fn = vi.fn();
|
|
302
|
-
const throttled = throttle(fn, 100);
|
|
303
|
-
throttled();
|
|
304
|
-
expect(fn).toHaveBeenCalledTimes(1);
|
|
305
|
-
});
|
|
306
|
-
it("should not call again within delay", () => {
|
|
307
|
-
const fn = vi.fn();
|
|
308
|
-
const throttled = throttle(fn, 100);
|
|
309
|
-
throttled();
|
|
310
|
-
throttled();
|
|
311
|
-
throttled();
|
|
312
|
-
expect(fn).toHaveBeenCalledTimes(1);
|
|
313
|
-
});
|
|
314
|
-
it("should call again after delay", () => {
|
|
315
|
-
const fn = vi.fn();
|
|
316
|
-
const throttled = throttle(fn, 100);
|
|
317
|
-
throttled();
|
|
318
|
-
vi.advanceTimersByTime(150);
|
|
319
|
-
throttled();
|
|
320
|
-
expect(fn).toHaveBeenCalledTimes(2);
|
|
321
|
-
});
|
|
322
|
-
});
|
|
323
|
-
describe("debounce", () => {
|
|
324
|
-
beforeEach(() => {
|
|
325
|
-
vi.useFakeTimers();
|
|
326
|
-
});
|
|
327
|
-
afterEach(() => {
|
|
328
|
-
vi.useRealTimers();
|
|
329
|
-
});
|
|
330
|
-
it("should delay function invocation", () => {
|
|
331
|
-
const fn = vi.fn();
|
|
332
|
-
const debounced = debounce(fn, 100);
|
|
333
|
-
debounced();
|
|
334
|
-
debounced();
|
|
335
|
-
debounced();
|
|
336
|
-
expect(fn).not.toHaveBeenCalled();
|
|
337
|
-
vi.advanceTimersByTime(100);
|
|
338
|
-
expect(fn).toHaveBeenCalledTimes(1);
|
|
339
|
-
});
|
|
340
|
-
it("should reset delay on repeated calls", () => {
|
|
341
|
-
const fn = vi.fn();
|
|
342
|
-
const debounced = debounce(fn, 100);
|
|
343
|
-
debounced();
|
|
344
|
-
vi.advanceTimersByTime(50);
|
|
345
|
-
debounced();
|
|
346
|
-
vi.advanceTimersByTime(50);
|
|
347
|
-
expect(fn).not.toHaveBeenCalled();
|
|
348
|
-
vi.advanceTimersByTime(50);
|
|
349
|
-
expect(fn).toHaveBeenCalledTimes(1);
|
|
350
|
-
});
|
|
351
|
-
});
|
|
352
|
-
describe("deepClone", () => {
|
|
353
|
-
it("should clone primitives", () => {
|
|
354
|
-
expect(deepClone(42)).toBe(42);
|
|
355
|
-
expect(deepClone("hello")).toBe("hello");
|
|
356
|
-
expect(deepClone(null)).toBeNull();
|
|
357
|
-
});
|
|
358
|
-
it("should deep clone arrays", () => {
|
|
359
|
-
const arr = [1, [2, 3]];
|
|
360
|
-
const cloned = deepClone(arr);
|
|
361
|
-
expect(cloned).toEqual(arr);
|
|
362
|
-
cloned[1][0] = 999;
|
|
363
|
-
expect(arr[1][0]).toBe(2);
|
|
364
|
-
});
|
|
365
|
-
it("should deep clone objects", () => {
|
|
366
|
-
const obj = { a: 1, b: { c: 2 } };
|
|
367
|
-
const cloned = deepClone(obj);
|
|
368
|
-
cloned.b.c = 999;
|
|
369
|
-
expect(obj.b.c).toBe(2);
|
|
370
|
-
});
|
|
371
|
-
});
|
|
372
|
-
describe("isEmpty", () => {
|
|
373
|
-
it("should identify empty values", () => {
|
|
374
|
-
expect(isEmpty(null)).toBe(true);
|
|
375
|
-
expect(isEmpty(void 0)).toBe(true);
|
|
376
|
-
expect(isEmpty("")).toBe(true);
|
|
377
|
-
expect(isEmpty(" ")).toBe(true);
|
|
378
|
-
expect(isEmpty([])).toBe(true);
|
|
379
|
-
expect(isEmpty({})).toBe(true);
|
|
380
|
-
});
|
|
381
|
-
it("should identify non-empty values", () => {
|
|
382
|
-
expect(isEmpty("a")).toBe(false);
|
|
383
|
-
expect(isEmpty([1])).toBe(false);
|
|
384
|
-
expect(isEmpty({ a: 1 })).toBe(false);
|
|
385
|
-
expect(isEmpty(0)).toBe(false);
|
|
386
|
-
});
|
|
387
|
-
});
|
|
388
|
-
describe("generateId", () => {
|
|
389
|
-
it("should generate unique IDs", () => {
|
|
390
|
-
const id1 = generateId();
|
|
391
|
-
const id2 = generateId();
|
|
392
|
-
expect(id1).toMatch(/^yh-table-/);
|
|
393
|
-
expect(id1).not.toBe(id2);
|
|
394
|
-
});
|
|
395
|
-
});
|
|
396
|
-
describe("formatCellValue", () => {
|
|
397
|
-
it("should return empty string for missing prop", () => {
|
|
398
|
-
expect(formatCellValue({ a: 1 }, { label: "Test" }, 0)).toBe("");
|
|
399
|
-
});
|
|
400
|
-
it("should format with formatter function", () => {
|
|
401
|
-
const col = {
|
|
402
|
-
prop: "age",
|
|
403
|
-
label: "Age",
|
|
404
|
-
formatter: (row, col2, val) => `${val}\u5C81`
|
|
405
|
-
};
|
|
406
|
-
expect(formatCellValue({ age: 25 }, col, 0)).toBe("25\u5C81");
|
|
407
|
-
});
|
|
408
|
-
it("should return empty string for null/undefined value", () => {
|
|
409
|
-
expect(formatCellValue({ age: null }, { prop: "age", label: "Age" }, 0)).toBe("");
|
|
410
|
-
expect(formatCellValue({ age: void 0 }, { prop: "age", label: "Age" }, 0)).toBe("");
|
|
411
|
-
});
|
|
412
|
-
it("should stringify value as default", () => {
|
|
413
|
-
expect(formatCellValue({ count: 42 }, { prop: "count", label: "Count" }, 0)).toBe("42");
|
|
414
|
-
});
|
|
415
|
-
});
|
|
416
|
-
describe("getFixedStyle", () => {
|
|
417
|
-
const columns = [
|
|
418
|
-
{ prop: "a", label: "A", fixed: "left", width: 100 },
|
|
419
|
-
{ prop: "b", label: "B", fixed: "left", width: 80 },
|
|
420
|
-
{ prop: "c", label: "C" },
|
|
421
|
-
{ prop: "d", label: "D", fixed: "right", width: 90 }
|
|
422
|
-
];
|
|
423
|
-
it("should compute left offset for left-fixed column", () => {
|
|
424
|
-
const style = getFixedStyle(columns[1], columns, "left");
|
|
425
|
-
expect(style.left).toBe("100px");
|
|
426
|
-
});
|
|
427
|
-
it("should compute right offset for right-fixed column", () => {
|
|
428
|
-
const style = getFixedStyle(columns[3], columns, "right");
|
|
429
|
-
expect(style.right).toBe("0px");
|
|
430
|
-
});
|
|
431
|
-
it("should return empty when column not found", () => {
|
|
432
|
-
const notFound = { prop: "z", label: "Z" };
|
|
433
|
-
expect(getFixedStyle(notFound, columns, "left")).toEqual({});
|
|
434
|
-
});
|
|
435
|
-
});
|
|
436
|
-
describe("exportToCSV", () => {
|
|
437
|
-
it("should trigger download", () => {
|
|
438
|
-
const createElementSpy = vi.spyOn(document, "createElement");
|
|
439
|
-
const clickMock = vi.fn();
|
|
440
|
-
const linkMock = {
|
|
441
|
-
href: "",
|
|
442
|
-
download: "",
|
|
443
|
-
click: clickMock
|
|
444
|
-
};
|
|
445
|
-
createElementSpy.mockReturnValue(linkMock);
|
|
446
|
-
vi.stubGlobal("URL", {
|
|
447
|
-
createObjectURL: vi.fn().mockReturnValue("blob:url"),
|
|
448
|
-
revokeObjectURL: vi.fn()
|
|
449
|
-
});
|
|
450
|
-
exportToCSV(
|
|
451
|
-
[
|
|
452
|
-
{ name: "Alice", age: 25 },
|
|
453
|
-
{ name: "Bob, Jr.", age: 30 }
|
|
454
|
-
],
|
|
455
|
-
[
|
|
456
|
-
{ prop: "name", label: "\u59D3\u540D" },
|
|
457
|
-
{ prop: "age", label: "\u5E74\u9F84" }
|
|
458
|
-
],
|
|
459
|
-
"test-export"
|
|
460
|
-
);
|
|
461
|
-
expect(clickMock).toHaveBeenCalled();
|
|
462
|
-
expect(linkMock.download).toBe("test-export.csv");
|
|
463
|
-
vi.restoreAllMocks();
|
|
464
|
-
});
|
|
465
|
-
it("should skip hidden columns (visible=false)", () => {
|
|
466
|
-
const createElementSpy = vi.spyOn(document, "createElement");
|
|
467
|
-
const clickMock = vi.fn();
|
|
468
|
-
const linkMock = { href: "", download: "", click: clickMock };
|
|
469
|
-
createElementSpy.mockReturnValue(linkMock);
|
|
470
|
-
vi.stubGlobal("URL", {
|
|
471
|
-
createObjectURL: vi.fn().mockReturnValue("blob:url"),
|
|
472
|
-
revokeObjectURL: vi.fn()
|
|
473
|
-
});
|
|
474
|
-
exportToCSV(
|
|
475
|
-
[{ name: "Alice", age: 25 }],
|
|
476
|
-
[
|
|
477
|
-
{ prop: "name", label: "\u59D3\u540D" },
|
|
478
|
-
{ prop: "age", label: "\u5E74\u9F84", visible: false }
|
|
479
|
-
]
|
|
480
|
-
);
|
|
481
|
-
expect(clickMock).toHaveBeenCalled();
|
|
482
|
-
vi.restoreAllMocks();
|
|
483
|
-
});
|
|
484
|
-
});
|
|
485
|
-
});
|