@yh-ui/components 0.1.10 → 0.1.12
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/dist/ai-action-group/__tests__/ai-action-group.ssr.test.cjs +55 -0
- package/dist/ai-action-group/__tests__/ai-action-group.ssr.test.d.ts +1 -0
- package/dist/ai-action-group/__tests__/ai-action-group.ssr.test.mjs +39 -0
- package/dist/ai-action-group/__tests__/ai-action-group.test.cjs +149 -0
- package/dist/ai-action-group/__tests__/ai-action-group.test.d.ts +1 -0
- package/dist/ai-action-group/__tests__/ai-action-group.test.mjs +104 -0
- package/dist/ai-action-group/index.cjs +26 -0
- package/dist/ai-action-group/index.d.ts +3 -0
- package/dist/ai-action-group/index.mjs +5 -0
- package/dist/ai-action-group/src/ai-action-group.cjs +50 -0
- package/dist/ai-action-group/src/ai-action-group.css +517 -0
- package/dist/ai-action-group/src/ai-action-group.d.ts +55 -0
- package/dist/ai-action-group/src/ai-action-group.d.vue.ts +40 -0
- package/dist/ai-action-group/src/ai-action-group.mjs +44 -0
- package/dist/ai-action-group/src/ai-action-group.vue +602 -0
- package/dist/ai-action-group/src/ai-action-group.vue.d.ts +40 -0
- package/dist/ai-agent-card/__tests__/ai-agent-card.ssr.test.cjs +61 -0
- package/dist/ai-agent-card/__tests__/ai-agent-card.ssr.test.d.ts +1 -0
- package/dist/ai-agent-card/__tests__/ai-agent-card.ssr.test.mjs +65 -0
- package/dist/ai-agent-card/__tests__/ai-agent-card.test.cjs +70 -0
- package/dist/ai-agent-card/__tests__/ai-agent-card.test.d.ts +1 -0
- package/dist/ai-agent-card/__tests__/ai-agent-card.test.mjs +64 -0
- package/dist/ai-agent-card/index.cjs +26 -0
- package/dist/ai-agent-card/index.d.ts +3 -0
- package/dist/ai-agent-card/index.mjs +5 -0
- package/dist/ai-agent-card/src/ai-agent-card.cjs +74 -0
- package/dist/ai-agent-card/src/ai-agent-card.css +859 -0
- package/dist/ai-agent-card/src/ai-agent-card.d.ts +122 -0
- package/dist/ai-agent-card/src/ai-agent-card.d.vue.ts +62 -0
- package/dist/ai-agent-card/src/ai-agent-card.mjs +68 -0
- package/dist/ai-agent-card/src/ai-agent-card.vue +1029 -0
- package/dist/ai-agent-card/src/ai-agent-card.vue.d.ts +62 -0
- package/dist/ai-artifacts/__tests__/ai-artifacts.ssr.test.cjs +73 -0
- package/dist/ai-artifacts/__tests__/ai-artifacts.ssr.test.d.ts +1 -0
- package/dist/ai-artifacts/__tests__/ai-artifacts.ssr.test.mjs +68 -0
- package/dist/ai-artifacts/__tests__/ai-artifacts.test.cjs +128 -0
- package/dist/ai-artifacts/__tests__/ai-artifacts.test.d.ts +1 -0
- package/dist/ai-artifacts/__tests__/ai-artifacts.test.mjs +109 -0
- package/dist/ai-artifacts/index.cjs +26 -0
- package/dist/ai-artifacts/index.d.ts +3 -0
- package/dist/ai-artifacts/index.mjs +5 -0
- package/dist/ai-artifacts/src/ai-artifacts.cjs +55 -0
- package/dist/ai-artifacts/src/ai-artifacts.css +633 -0
- package/dist/ai-artifacts/src/ai-artifacts.d.ts +93 -0
- package/dist/ai-artifacts/src/ai-artifacts.d.vue.ts +33 -0
- package/dist/ai-artifacts/src/ai-artifacts.mjs +49 -0
- package/dist/ai-artifacts/src/ai-artifacts.vue +803 -0
- package/dist/ai-artifacts/src/ai-artifacts.vue.d.ts +33 -0
- package/dist/ai-bubble/__tests__/ai-bubble.ssr.test.cjs +87 -0
- package/dist/ai-bubble/__tests__/ai-bubble.ssr.test.d.ts +1 -0
- package/dist/ai-bubble/__tests__/ai-bubble.ssr.test.mjs +58 -0
- package/dist/ai-bubble/__tests__/ai-bubble.test.cjs +227 -0
- package/dist/ai-bubble/__tests__/ai-bubble.test.d.ts +1 -0
- package/dist/ai-bubble/__tests__/ai-bubble.test.mjs +123 -0
- package/dist/ai-bubble/index.cjs +26 -0
- package/dist/ai-bubble/index.d.ts +3 -0
- package/dist/ai-bubble/index.mjs +5 -0
- package/dist/ai-bubble/src/ai-bubble.cjs +86 -0
- package/dist/ai-bubble/src/ai-bubble.css +932 -0
- package/dist/ai-bubble/src/ai-bubble.d.ts +126 -0
- package/dist/ai-bubble/src/ai-bubble.d.vue.ts +110 -0
- package/dist/ai-bubble/src/ai-bubble.mjs +80 -0
- package/dist/ai-bubble/src/ai-bubble.vue +1300 -0
- package/dist/ai-bubble/src/ai-bubble.vue.d.ts +110 -0
- package/dist/ai-chat/__tests__/ai-chat.ssr.test.cjs +82 -0
- package/dist/ai-chat/__tests__/ai-chat.ssr.test.d.ts +1 -0
- package/dist/ai-chat/__tests__/ai-chat.ssr.test.mjs +69 -0
- package/dist/ai-chat/__tests__/ai-chat.test.cjs +169 -0
- package/dist/ai-chat/__tests__/ai-chat.test.d.ts +1 -0
- package/dist/ai-chat/__tests__/ai-chat.test.mjs +121 -0
- package/dist/ai-chat/index.cjs +26 -0
- package/dist/ai-chat/index.d.ts +3 -0
- package/dist/ai-chat/index.mjs +5 -0
- package/dist/ai-chat/src/ai-chat.cjs +41 -0
- package/dist/ai-chat/src/ai-chat.css +503 -0
- package/dist/ai-chat/src/ai-chat.d.ts +57 -0
- package/dist/ai-chat/src/ai-chat.d.vue.ts +43 -0
- package/dist/ai-chat/src/ai-chat.mjs +35 -0
- package/dist/ai-chat/src/ai-chat.vue +606 -0
- package/dist/ai-chat/src/ai-chat.vue.d.ts +43 -0
- package/dist/ai-code-block/__tests__/ai-code-block.ssr.test.cjs +66 -0
- package/dist/ai-code-block/__tests__/ai-code-block.ssr.test.d.ts +1 -0
- package/dist/ai-code-block/__tests__/ai-code-block.ssr.test.mjs +48 -0
- package/dist/ai-code-block/__tests__/ai-code-block.test.cjs +174 -0
- package/dist/ai-code-block/__tests__/ai-code-block.test.d.ts +1 -0
- package/dist/ai-code-block/__tests__/ai-code-block.test.mjs +108 -0
- package/dist/ai-code-block/index.cjs +26 -0
- package/dist/ai-code-block/index.d.ts +3 -0
- package/dist/ai-code-block/index.mjs +5 -0
- package/dist/ai-code-block/src/ai-code-block.cjs +79 -0
- package/dist/ai-code-block/src/ai-code-block.css +589 -0
- package/dist/ai-code-block/src/ai-code-block.d.ts +76 -0
- package/dist/ai-code-block/src/ai-code-block.d.vue.ts +63 -0
- package/dist/ai-code-block/src/ai-code-block.mjs +73 -0
- package/dist/ai-code-block/src/ai-code-block.vue +706 -0
- package/dist/ai-code-block/src/ai-code-block.vue.d.ts +63 -0
- package/dist/ai-conversations/__tests__/ai-conversations.ssr.test.cjs +50 -0
- package/dist/ai-conversations/__tests__/ai-conversations.ssr.test.d.ts +1 -0
- package/dist/ai-conversations/__tests__/ai-conversations.ssr.test.mjs +42 -0
- package/dist/ai-conversations/__tests__/ai-conversations.test.cjs +67 -0
- package/dist/ai-conversations/__tests__/ai-conversations.test.d.ts +1 -0
- package/dist/ai-conversations/__tests__/ai-conversations.test.mjs +51 -0
- package/dist/ai-conversations/index.cjs +26 -0
- package/dist/ai-conversations/index.d.ts +3 -0
- package/dist/ai-conversations/index.mjs +5 -0
- package/dist/ai-conversations/src/ai-conversations.cjs +69 -0
- package/dist/ai-conversations/src/ai-conversations.css +679 -0
- package/dist/ai-conversations/src/ai-conversations.d.ts +67 -0
- package/dist/ai-conversations/src/ai-conversations.d.vue.ts +52 -0
- package/dist/ai-conversations/src/ai-conversations.mjs +63 -0
- package/dist/ai-conversations/src/ai-conversations.vue +949 -0
- package/dist/ai-conversations/src/ai-conversations.vue.d.ts +52 -0
- package/dist/ai-editor-sender/__tests__/ai-editor-sender.ssr.test.cjs +62 -0
- package/dist/ai-editor-sender/__tests__/ai-editor-sender.ssr.test.d.ts +1 -0
- package/dist/ai-editor-sender/__tests__/ai-editor-sender.ssr.test.mjs +50 -0
- package/dist/ai-editor-sender/__tests__/ai-editor-sender.test.cjs +315 -0
- package/dist/ai-editor-sender/__tests__/ai-editor-sender.test.d.ts +1 -0
- package/dist/ai-editor-sender/__tests__/ai-editor-sender.test.mjs +226 -0
- package/dist/ai-editor-sender/index.cjs +26 -0
- package/dist/ai-editor-sender/index.d.ts +3 -0
- package/dist/ai-editor-sender/index.mjs +5 -0
- package/dist/ai-editor-sender/src/ai-editor-sender.cjs +66 -0
- package/dist/ai-editor-sender/src/ai-editor-sender.css +566 -0
- package/dist/ai-editor-sender/src/ai-editor-sender.d.ts +70 -0
- package/dist/ai-editor-sender/src/ai-editor-sender.d.vue.ts +70 -0
- package/dist/ai-editor-sender/src/ai-editor-sender.mjs +60 -0
- package/dist/ai-editor-sender/src/ai-editor-sender.vue +713 -0
- package/dist/ai-editor-sender/src/ai-editor-sender.vue.d.ts +70 -0
- package/dist/ai-prompts/__tests__/ai-prompts.ssr.test.cjs +49 -0
- package/dist/ai-prompts/__tests__/ai-prompts.ssr.test.d.ts +1 -0
- package/dist/ai-prompts/__tests__/ai-prompts.ssr.test.mjs +41 -0
- package/dist/ai-prompts/__tests__/ai-prompts.test.cjs +54 -0
- package/dist/ai-prompts/__tests__/ai-prompts.test.d.ts +1 -0
- package/dist/ai-prompts/__tests__/ai-prompts.test.mjs +38 -0
- package/dist/ai-prompts/index.cjs +26 -0
- package/dist/ai-prompts/index.d.ts +3 -0
- package/dist/ai-prompts/index.mjs +5 -0
- package/dist/ai-prompts/src/ai-prompts.cjs +42 -0
- package/dist/ai-prompts/src/ai-prompts.css +572 -0
- package/dist/ai-prompts/src/ai-prompts.d.ts +45 -0
- package/dist/ai-prompts/src/ai-prompts.d.vue.ts +44 -0
- package/dist/ai-prompts/src/ai-prompts.mjs +36 -0
- package/dist/ai-prompts/src/ai-prompts.vue +646 -0
- package/dist/ai-prompts/src/ai-prompts.vue.d.ts +44 -0
- package/dist/ai-provider/__tests__/ai-provider.ssr.test.cjs +33 -0
- package/dist/ai-provider/__tests__/ai-provider.ssr.test.d.ts +1 -0
- package/dist/ai-provider/__tests__/ai-provider.ssr.test.mjs +34 -0
- package/dist/ai-provider/__tests__/ai-provider.test.cjs +38 -0
- package/dist/ai-provider/__tests__/ai-provider.test.d.ts +1 -0
- package/dist/ai-provider/__tests__/ai-provider.test.mjs +33 -0
- package/dist/ai-provider/index.cjs +38 -0
- package/dist/ai-provider/index.d.ts +4 -0
- package/dist/ai-provider/index.mjs +6 -0
- package/dist/ai-provider/src/ai-provider.cjs +7 -0
- package/dist/ai-provider/src/ai-provider.d.ts +88 -0
- package/dist/ai-provider/src/ai-provider.d.vue.ts +48 -0
- package/dist/ai-provider/src/ai-provider.mjs +1 -0
- package/dist/ai-provider/src/ai-provider.vue +24 -0
- package/dist/ai-provider/src/ai-provider.vue.d.ts +48 -0
- package/dist/ai-provider/src/use-ai-provider.cjs +11 -0
- package/dist/ai-provider/src/use-ai-provider.d.ts +10 -0
- package/dist/ai-provider/src/use-ai-provider.mjs +5 -0
- package/dist/ai-sender/__tests__/ai-sender.ssr.test.cjs +46 -0
- package/dist/ai-sender/__tests__/ai-sender.ssr.test.d.ts +1 -0
- package/dist/ai-sender/__tests__/ai-sender.ssr.test.mjs +37 -0
- package/dist/ai-sender/__tests__/ai-sender.test.cjs +388 -0
- package/dist/ai-sender/__tests__/ai-sender.test.d.ts +1 -0
- package/dist/ai-sender/__tests__/ai-sender.test.mjs +248 -0
- package/dist/ai-sender/index.cjs +26 -0
- package/dist/ai-sender/index.d.ts +3 -0
- package/dist/ai-sender/index.mjs +5 -0
- package/dist/ai-sender/src/ai-sender.cjs +91 -0
- package/dist/ai-sender/src/ai-sender.css +754 -0
- package/dist/ai-sender/src/ai-sender.d.ts +140 -0
- package/dist/ai-sender/src/ai-sender.d.vue.ts +69 -0
- package/dist/ai-sender/src/ai-sender.mjs +85 -0
- package/dist/ai-sender/src/ai-sender.vue +1032 -0
- package/dist/ai-sender/src/ai-sender.vue.d.ts +69 -0
- package/dist/ai-sources/__tests__/ai-sources.ssr.test.cjs +72 -0
- package/dist/ai-sources/__tests__/ai-sources.ssr.test.d.ts +1 -0
- package/dist/ai-sources/__tests__/ai-sources.ssr.test.mjs +82 -0
- package/dist/ai-sources/__tests__/ai-sources.test.cjs +93 -0
- package/dist/ai-sources/__tests__/ai-sources.test.d.ts +1 -0
- package/dist/ai-sources/__tests__/ai-sources.test.mjs +89 -0
- package/dist/ai-sources/index.cjs +26 -0
- package/dist/ai-sources/index.d.ts +3 -0
- package/dist/ai-sources/index.mjs +5 -0
- package/dist/ai-sources/src/ai-sources.cjs +59 -0
- package/dist/ai-sources/src/ai-sources.css +830 -0
- package/dist/ai-sources/src/ai-sources.d.ts +79 -0
- package/dist/ai-sources/src/ai-sources.d.vue.ts +45 -0
- package/dist/ai-sources/src/ai-sources.mjs +53 -0
- package/dist/ai-sources/src/ai-sources.vue +1109 -0
- package/dist/ai-sources/src/ai-sources.vue.d.ts +45 -0
- package/dist/ai-thinking/__tests__/ai-thinking.ssr.test.cjs +56 -0
- package/dist/ai-thinking/__tests__/ai-thinking.ssr.test.d.ts +1 -0
- package/dist/ai-thinking/__tests__/ai-thinking.ssr.test.mjs +42 -0
- package/dist/ai-thinking/__tests__/ai-thinking.test.cjs +151 -0
- package/dist/ai-thinking/__tests__/ai-thinking.test.d.ts +1 -0
- package/dist/ai-thinking/__tests__/ai-thinking.test.mjs +96 -0
- package/dist/ai-thinking/index.cjs +26 -0
- package/dist/ai-thinking/index.d.ts +3 -0
- package/dist/ai-thinking/index.mjs +5 -0
- package/dist/ai-thinking/src/ai-thinking.cjs +44 -0
- package/dist/ai-thinking/src/ai-thinking.css +543 -0
- package/dist/ai-thinking/src/ai-thinking.d.ts +42 -0
- package/dist/ai-thinking/src/ai-thinking.d.vue.ts +33 -0
- package/dist/ai-thinking/src/ai-thinking.mjs +38 -0
- package/dist/ai-thinking/src/ai-thinking.vue +631 -0
- package/dist/ai-thinking/src/ai-thinking.vue.d.ts +33 -0
- package/dist/ai-thought-chain/__tests__/ai-thought-chain.ssr.test.cjs +83 -0
- package/dist/ai-thought-chain/__tests__/ai-thought-chain.ssr.test.d.ts +1 -0
- package/dist/ai-thought-chain/__tests__/ai-thought-chain.ssr.test.mjs +52 -0
- package/dist/ai-thought-chain/__tests__/ai-thought-chain.test.cjs +204 -0
- package/dist/ai-thought-chain/__tests__/ai-thought-chain.test.d.ts +1 -0
- package/dist/ai-thought-chain/__tests__/ai-thought-chain.test.mjs +134 -0
- package/dist/ai-thought-chain/index.cjs +26 -0
- package/dist/ai-thought-chain/index.d.ts +3 -0
- package/dist/ai-thought-chain/index.mjs +5 -0
- package/dist/ai-thought-chain/src/ai-thought-chain.cjs +68 -0
- package/dist/ai-thought-chain/src/ai-thought-chain.css +668 -0
- package/dist/ai-thought-chain/src/ai-thought-chain.d.ts +82 -0
- package/dist/ai-thought-chain/src/ai-thought-chain.d.vue.ts +83 -0
- package/dist/ai-thought-chain/src/ai-thought-chain.mjs +62 -0
- package/dist/ai-thought-chain/src/ai-thought-chain.vue +813 -0
- package/dist/ai-thought-chain/src/ai-thought-chain.vue.d.ts +83 -0
- package/dist/ai-voice-trigger/__tests__/ai-voice-trigger.ssr.test.cjs +32 -0
- package/dist/ai-voice-trigger/__tests__/ai-voice-trigger.ssr.test.d.ts +1 -0
- package/dist/ai-voice-trigger/__tests__/ai-voice-trigger.ssr.test.mjs +25 -0
- package/dist/ai-voice-trigger/__tests__/ai-voice-trigger.test.cjs +113 -0
- package/dist/ai-voice-trigger/__tests__/ai-voice-trigger.test.d.ts +1 -0
- package/dist/ai-voice-trigger/__tests__/ai-voice-trigger.test.mjs +93 -0
- package/dist/ai-voice-trigger/index.cjs +26 -0
- package/dist/ai-voice-trigger/index.d.ts +3 -0
- package/dist/ai-voice-trigger/index.mjs +5 -0
- package/dist/ai-voice-trigger/src/ai-voice-trigger.cjs +35 -0
- package/dist/ai-voice-trigger/src/ai-voice-trigger.css +603 -0
- package/dist/ai-voice-trigger/src/ai-voice-trigger.d.ts +37 -0
- package/dist/ai-voice-trigger/src/ai-voice-trigger.d.vue.ts +29 -0
- package/dist/ai-voice-trigger/src/ai-voice-trigger.mjs +29 -0
- package/dist/ai-voice-trigger/src/ai-voice-trigger.vue +708 -0
- package/dist/ai-voice-trigger/src/ai-voice-trigger.vue.d.ts +29 -0
- package/dist/ai-welcome/__tests__/ai-welcome.ssr.test.cjs +57 -0
- package/dist/ai-welcome/__tests__/ai-welcome.ssr.test.d.ts +1 -0
- package/dist/ai-welcome/__tests__/ai-welcome.ssr.test.mjs +39 -0
- package/dist/ai-welcome/__tests__/ai-welcome.test.cjs +169 -0
- package/dist/ai-welcome/__tests__/ai-welcome.test.d.ts +1 -0
- package/dist/ai-welcome/__tests__/ai-welcome.test.mjs +113 -0
- package/dist/ai-welcome/index.cjs +26 -0
- package/dist/ai-welcome/index.d.ts +3 -0
- package/dist/ai-welcome/index.mjs +5 -0
- package/dist/ai-welcome/src/ai-welcome.cjs +56 -0
- package/dist/ai-welcome/src/ai-welcome.css +591 -0
- package/dist/ai-welcome/src/ai-welcome.d.ts +59 -0
- package/dist/ai-welcome/src/ai-welcome.d.vue.ts +51 -0
- package/dist/ai-welcome/src/ai-welcome.mjs +50 -0
- package/dist/ai-welcome/src/ai-welcome.vue +655 -0
- package/dist/ai-welcome/src/ai-welcome.vue.d.ts +51 -0
- package/dist/alert/src/alert.d.vue.ts +5 -5
- package/dist/alert/src/alert.vue.d.ts +5 -5
- package/dist/autocomplete/src/autocomplete.d.vue.ts +2 -2
- package/dist/autocomplete/src/autocomplete.vue.d.ts +2 -2
- package/dist/avatar/index.d.ts +39 -1
- package/dist/back-top/src/back-top.d.vue.ts +1 -1
- package/dist/back-top/src/back-top.vue.d.ts +1 -1
- package/dist/button/index.d.ts +3 -3
- package/dist/button/src/button.css +3 -3
- package/dist/button/src/button.d.vue.ts +1 -1
- package/dist/button/src/button.vue +3 -3
- package/dist/button/src/button.vue.d.ts +1 -1
- package/dist/calendar/src/calendar.d.vue.ts +2 -2
- package/dist/calendar/src/calendar.vue.d.ts +2 -2
- package/dist/cascader/src/cascader-panel.d.vue.ts +2 -2
- package/dist/cascader/src/cascader-panel.vue.d.ts +2 -2
- package/dist/checkbox/index.d.ts +3 -3
- package/dist/checkbox/src/checkbox-group.d.vue.ts +1 -1
- package/dist/checkbox/src/checkbox-group.vue +13 -1
- package/dist/checkbox/src/checkbox-group.vue.d.ts +1 -1
- package/dist/checkbox/src/checkbox.d.ts +12 -0
- package/dist/col/src/col.d.vue.ts +4 -4
- package/dist/col/src/col.vue.d.ts +4 -4
- package/dist/color-picker/src/color-picker.d.vue.ts +1 -1
- package/dist/color-picker/src/color-picker.vue.d.ts +1 -1
- package/dist/component.d.ts +63 -0
- package/dist/date-picker/src/date-picker.d.vue.ts +4 -4
- package/dist/date-picker/src/date-picker.vue.d.ts +4 -4
- package/dist/descriptions/src/description-item.d.vue.ts +1 -1
- package/dist/descriptions/src/description-item.vue.d.ts +1 -1
- package/dist/dialog/src/dialog.d.vue.ts +6 -6
- package/dist/dialog/src/dialog.vue.d.ts +6 -6
- package/dist/drawer/src/drawer.d.vue.ts +3 -3
- package/dist/drawer/src/drawer.vue.d.ts +3 -3
- package/dist/dropdown/src/dropdown-item.d.vue.ts +1 -1
- package/dist/dropdown/src/dropdown-item.vue.d.ts +1 -1
- package/dist/dropdown/src/dropdown.d.vue.ts +8 -8
- package/dist/dropdown/src/dropdown.vue.d.ts +8 -8
- package/dist/form/__tests__/form-schema.test.cjs +477 -24
- package/dist/form/__tests__/form-schema.test.mjs +277 -57
- package/dist/form/index.cjs +12 -0
- package/dist/form/index.d.ts +1 -2
- package/dist/form/index.mjs +1 -0
- package/dist/form/src/form-item.d.vue.ts +2 -1
- package/dist/form/src/form-item.vue +3 -1
- package/dist/form/src/form-item.vue.d.ts +2 -1
- package/dist/form/src/form-schema.cjs +2 -1
- package/dist/form/src/form-schema.d.ts +124 -19
- package/dist/form/src/form-schema.d.vue.ts +69 -19
- package/dist/form/src/form-schema.mjs +2 -1
- package/dist/form/src/form-schema.vue +522 -160
- package/dist/form/src/form-schema.vue.d.ts +69 -19
- package/dist/form/src/form.cjs +7 -0
- package/dist/form/src/form.d.ts +20 -0
- package/dist/form/src/form.d.vue.ts +10 -1
- package/dist/form/src/form.mjs +7 -0
- package/dist/form/src/form.vue +22 -10
- package/dist/form/src/form.vue.d.ts +10 -1
- package/dist/grid/src/grid.d.vue.ts +1 -1
- package/dist/grid/src/grid.vue.d.ts +1 -1
- package/dist/icon/src/icons/index.cjs +122 -2
- package/dist/icon/src/icons/index.d.ts +24 -0
- package/dist/icon/src/icons/index.mjs +145 -1
- package/dist/image/index.d.ts +356 -2
- package/dist/image/src/image-viewer.d.vue.ts +3 -3
- package/dist/image/src/image-viewer.vue.d.ts +3 -3
- package/dist/image/src/image.d.vue.ts +4 -4
- package/dist/image/src/image.vue.d.ts +4 -4
- package/dist/index.cjs +193 -1
- package/dist/index.d.ts +16 -0
- package/dist/index.mjs +49 -1
- package/dist/input/index.d.ts +18 -18
- package/dist/input/src/input.d.vue.ts +6 -6
- package/dist/input/src/input.vue.d.ts +6 -6
- package/dist/input-tag/src/input-tag.d.vue.ts +2 -2
- package/dist/input-tag/src/input-tag.vue.d.ts +2 -2
- package/dist/mention/src/mention.d.vue.ts +8 -8
- package/dist/mention/src/mention.vue.d.ts +8 -8
- package/dist/menu/src/menu.d.vue.ts +4 -4
- package/dist/menu/src/menu.vue.d.ts +4 -4
- package/dist/message/src/message.d.vue.ts +1 -1
- package/dist/message/src/message.vue.d.ts +1 -1
- package/dist/popconfirm/src/popconfirm.d.vue.ts +5 -5
- package/dist/popconfirm/src/popconfirm.vue.d.ts +5 -5
- package/dist/popover/src/popover.d.vue.ts +4 -4
- package/dist/popover/src/popover.vue.d.ts +4 -4
- package/dist/progress/src/progress.d.vue.ts +1 -1
- package/dist/progress/src/progress.vue.d.ts +1 -1
- package/dist/radio/src/radio-group.d.vue.ts +1 -1
- package/dist/radio/src/radio-group.vue +25 -4
- package/dist/radio/src/radio-group.vue.d.ts +1 -1
- package/dist/radio/src/radio.d.ts +12 -0
- package/dist/rate/src/rate.d.vue.ts +1 -1
- package/dist/rate/src/rate.vue.d.ts +1 -1
- package/dist/select/src/select.d.vue.ts +1 -1
- package/dist/select/src/select.vue.d.ts +1 -1
- package/dist/skeleton/src/skeleton.d.vue.ts +1 -1
- package/dist/skeleton/src/skeleton.vue.d.ts +1 -1
- package/dist/slider/src/slider.d.vue.ts +1 -1
- package/dist/slider/src/slider.vue.d.ts +1 -1
- package/dist/steps/src/step.d.vue.ts +1 -1
- package/dist/steps/src/step.vue.d.ts +1 -1
- package/dist/switch/src/switch.d.vue.ts +2 -2
- package/dist/switch/src/switch.vue.d.ts +2 -2
- package/dist/table/__tests__/table.perf.test.cjs +2 -2
- package/dist/table/__tests__/table.perf.test.mjs +2 -2
- package/dist/table/__tests__/table.test.cjs +18 -0
- package/dist/table/__tests__/table.test.mjs +18 -0
- package/dist/table/__tests__/use-table-import.test.cjs +6 -0
- package/dist/table/__tests__/use-table-import.test.mjs +8 -1
- package/dist/table/src/table-column.d.vue.ts +1 -1
- package/dist/table/src/table-column.vue.d.ts +1 -1
- package/dist/table/src/table.d.vue.ts +1 -1
- package/dist/table/src/table.vue.d.ts +1 -1
- package/dist/tabs/src/tab-pane.d.vue.ts +1 -1
- package/dist/tabs/src/tab-pane.vue.d.ts +1 -1
- package/dist/tabs/src/tabs.d.vue.ts +2 -2
- package/dist/tabs/src/tabs.vue.d.ts +2 -2
- package/dist/tooltip/index.d.ts +7 -7
- package/dist/tooltip/src/tooltip.d.vue.ts +7 -7
- package/dist/tooltip/src/tooltip.vue.d.ts +7 -7
- package/dist/tree/src/tree.d.vue.ts +1 -1
- package/dist/tree/src/tree.vue.d.ts +1 -1
- package/dist/tree-select/src/tree-select.d.vue.ts +3 -3
- package/dist/tree-select/src/tree-select.vue.d.ts +3 -3
- package/dist/upload/src/upload.d.vue.ts +1 -1
- package/dist/upload/src/upload.vue.d.ts +1 -1
- package/package.json +8 -5
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { type AiSourceItem } from './ai-sources';
|
|
2
|
+
declare var __VLS_77: {};
|
|
3
|
+
type __VLS_Slots = {} & {
|
|
4
|
+
default?: (props: typeof __VLS_77) => any;
|
|
5
|
+
};
|
|
6
|
+
declare const __VLS_component: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
7
|
+
readonly sources: {
|
|
8
|
+
readonly type: import("vue").PropType<AiSourceItem[]>;
|
|
9
|
+
readonly default: () => never[];
|
|
10
|
+
};
|
|
11
|
+
readonly mode: {
|
|
12
|
+
readonly type: import("vue").PropType<"inline" | "card" | "badge">;
|
|
13
|
+
readonly default: "inline";
|
|
14
|
+
};
|
|
15
|
+
readonly maxVisible: {
|
|
16
|
+
readonly type: NumberConstructor;
|
|
17
|
+
readonly default: 5;
|
|
18
|
+
};
|
|
19
|
+
readonly showScore: {
|
|
20
|
+
readonly type: BooleanConstructor;
|
|
21
|
+
readonly default: true;
|
|
22
|
+
};
|
|
23
|
+
readonly showFileType: {
|
|
24
|
+
readonly type: BooleanConstructor;
|
|
25
|
+
readonly default: true;
|
|
26
|
+
};
|
|
27
|
+
readonly themeOverrides: {
|
|
28
|
+
readonly type: import("vue").PropType<import("@yh-ui/theme").ComponentThemeVars>;
|
|
29
|
+
readonly default: undefined;
|
|
30
|
+
};
|
|
31
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, any, string, import("vue").PublicProps, any, {
|
|
32
|
+
readonly themeOverrides: import("@yh-ui/theme").ComponentThemeVars;
|
|
33
|
+
readonly mode: "inline" | "card" | "badge";
|
|
34
|
+
readonly sources: AiSourceItem[];
|
|
35
|
+
readonly maxVisible: number;
|
|
36
|
+
readonly showScore: boolean;
|
|
37
|
+
readonly showFileType: boolean;
|
|
38
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
39
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
40
|
+
export default _default;
|
|
41
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
42
|
+
new (): {
|
|
43
|
+
$slots: S;
|
|
44
|
+
};
|
|
45
|
+
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _vitest = require("vitest");
|
|
4
|
+
var _serverRenderer = require("@vue/server-renderer");
|
|
5
|
+
var _vue = require("vue");
|
|
6
|
+
var _aiThinking = _interopRequireDefault(require("../src/ai-thinking.vue"));
|
|
7
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
8
|
+
(0, _vitest.describe)("YhAiThinking SSR", () => {
|
|
9
|
+
(0, _vitest.it)("should render to string on server", async () => {
|
|
10
|
+
const html = await (0, _serverRenderer.renderToString)((0, _vue.h)(_aiThinking.default));
|
|
11
|
+
(0, _vitest.expect)(html).toContain("yh-ai-thinking");
|
|
12
|
+
});
|
|
13
|
+
(0, _vitest.it)("should render header on server", async () => {
|
|
14
|
+
const html = await (0, _serverRenderer.renderToString)((0, _vue.h)(_aiThinking.default));
|
|
15
|
+
(0, _vitest.expect)(html).toContain("yh-ai-thinking__header");
|
|
16
|
+
});
|
|
17
|
+
(0, _vitest.it)("should render thinking status class on server", async () => {
|
|
18
|
+
const html = await (0, _serverRenderer.renderToString)((0, _vue.h)(_aiThinking.default, {
|
|
19
|
+
status: "thinking"
|
|
20
|
+
}));
|
|
21
|
+
(0, _vitest.expect)(html).toContain("yh-ai-thinking--thinking");
|
|
22
|
+
});
|
|
23
|
+
(0, _vitest.it)("should render end status class on server", async () => {
|
|
24
|
+
const html = await (0, _serverRenderer.renderToString)((0, _vue.h)(_aiThinking.default, {
|
|
25
|
+
status: "end"
|
|
26
|
+
}));
|
|
27
|
+
(0, _vitest.expect)(html).toContain("yh-ai-thinking--end");
|
|
28
|
+
});
|
|
29
|
+
(0, _vitest.it)("should render error status class on server", async () => {
|
|
30
|
+
const html = await (0, _serverRenderer.renderToString)((0, _vue.h)(_aiThinking.default, {
|
|
31
|
+
status: "error"
|
|
32
|
+
}));
|
|
33
|
+
(0, _vitest.expect)(html).toContain("yh-ai-thinking--error");
|
|
34
|
+
});
|
|
35
|
+
(0, _vitest.it)("should render custom title on server", async () => {
|
|
36
|
+
const html = await (0, _serverRenderer.renderToString)((0, _vue.h)(_aiThinking.default, {
|
|
37
|
+
title: "SSR Thinking Title",
|
|
38
|
+
status: "thinking"
|
|
39
|
+
}));
|
|
40
|
+
(0, _vitest.expect)(html).toContain("SSR Thinking Title");
|
|
41
|
+
});
|
|
42
|
+
(0, _vitest.it)("should render expanded class on server when modelValue=true", async () => {
|
|
43
|
+
const html = await (0, _serverRenderer.renderToString)((0, _vue.h)(_aiThinking.default, {
|
|
44
|
+
modelValue: true,
|
|
45
|
+
content: "some thought"
|
|
46
|
+
}));
|
|
47
|
+
(0, _vitest.expect)(html).toContain("is-expanded");
|
|
48
|
+
});
|
|
49
|
+
(0, _vitest.it)("should render content on server", async () => {
|
|
50
|
+
const html = await (0, _serverRenderer.renderToString)((0, _vue.h)(_aiThinking.default, {
|
|
51
|
+
modelValue: true,
|
|
52
|
+
content: "Server thought content"
|
|
53
|
+
}));
|
|
54
|
+
(0, _vitest.expect)(html).toContain("Server thought content");
|
|
55
|
+
});
|
|
56
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { describe, it, expect } from "vitest";
|
|
2
|
+
import { renderToString } from "@vue/server-renderer";
|
|
3
|
+
import { h } from "vue";
|
|
4
|
+
import AiThinking from "../src/ai-thinking.vue";
|
|
5
|
+
describe("YhAiThinking SSR", () => {
|
|
6
|
+
it("should render to string on server", async () => {
|
|
7
|
+
const html = await renderToString(h(AiThinking));
|
|
8
|
+
expect(html).toContain("yh-ai-thinking");
|
|
9
|
+
});
|
|
10
|
+
it("should render header on server", async () => {
|
|
11
|
+
const html = await renderToString(h(AiThinking));
|
|
12
|
+
expect(html).toContain("yh-ai-thinking__header");
|
|
13
|
+
});
|
|
14
|
+
it("should render thinking status class on server", async () => {
|
|
15
|
+
const html = await renderToString(h(AiThinking, { status: "thinking" }));
|
|
16
|
+
expect(html).toContain("yh-ai-thinking--thinking");
|
|
17
|
+
});
|
|
18
|
+
it("should render end status class on server", async () => {
|
|
19
|
+
const html = await renderToString(h(AiThinking, { status: "end" }));
|
|
20
|
+
expect(html).toContain("yh-ai-thinking--end");
|
|
21
|
+
});
|
|
22
|
+
it("should render error status class on server", async () => {
|
|
23
|
+
const html = await renderToString(h(AiThinking, { status: "error" }));
|
|
24
|
+
expect(html).toContain("yh-ai-thinking--error");
|
|
25
|
+
});
|
|
26
|
+
it("should render custom title on server", async () => {
|
|
27
|
+
const html = await renderToString(
|
|
28
|
+
h(AiThinking, { title: "SSR Thinking Title", status: "thinking" })
|
|
29
|
+
);
|
|
30
|
+
expect(html).toContain("SSR Thinking Title");
|
|
31
|
+
});
|
|
32
|
+
it("should render expanded class on server when modelValue=true", async () => {
|
|
33
|
+
const html = await renderToString(h(AiThinking, { modelValue: true, content: "some thought" }));
|
|
34
|
+
expect(html).toContain("is-expanded");
|
|
35
|
+
});
|
|
36
|
+
it("should render content on server", async () => {
|
|
37
|
+
const html = await renderToString(
|
|
38
|
+
h(AiThinking, { modelValue: true, content: "Server thought content" })
|
|
39
|
+
);
|
|
40
|
+
expect(html).toContain("Server thought content");
|
|
41
|
+
});
|
|
42
|
+
});
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _vitest = require("vitest");
|
|
4
|
+
var _testUtils = require("@vue/test-utils");
|
|
5
|
+
var _vue = require("vue");
|
|
6
|
+
var _aiThinking = _interopRequireDefault(require("../src/ai-thinking.vue"));
|
|
7
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
8
|
+
(0, _vitest.describe)("YhAiThinking", () => {
|
|
9
|
+
(0, _vitest.it)("should render with base class", () => {
|
|
10
|
+
const wrapper = (0, _testUtils.mount)(_aiThinking.default);
|
|
11
|
+
(0, _vitest.expect)(wrapper.find(".yh-ai-thinking").exists()).toBe(true);
|
|
12
|
+
});
|
|
13
|
+
(0, _vitest.it)("should render header", () => {
|
|
14
|
+
const wrapper = (0, _testUtils.mount)(_aiThinking.default);
|
|
15
|
+
(0, _vitest.expect)(wrapper.find(".yh-ai-thinking__header").exists()).toBe(true);
|
|
16
|
+
});
|
|
17
|
+
(0, _vitest.it)("should apply thinking status class by default", () => {
|
|
18
|
+
const wrapper = (0, _testUtils.mount)(_aiThinking.default, {
|
|
19
|
+
props: {
|
|
20
|
+
status: "thinking"
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
(0, _vitest.expect)(wrapper.classes()).toContain("yh-ai-thinking--thinking");
|
|
24
|
+
});
|
|
25
|
+
(0, _vitest.it)("should apply start status class", () => {
|
|
26
|
+
const wrapper = (0, _testUtils.mount)(_aiThinking.default, {
|
|
27
|
+
props: {
|
|
28
|
+
status: "start"
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
(0, _vitest.expect)(wrapper.classes()).toContain("yh-ai-thinking--start");
|
|
32
|
+
});
|
|
33
|
+
(0, _vitest.it)("should apply end status class", () => {
|
|
34
|
+
const wrapper = (0, _testUtils.mount)(_aiThinking.default, {
|
|
35
|
+
props: {
|
|
36
|
+
status: "end"
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
(0, _vitest.expect)(wrapper.classes()).toContain("yh-ai-thinking--end");
|
|
40
|
+
});
|
|
41
|
+
(0, _vitest.it)("should apply error status class", () => {
|
|
42
|
+
const wrapper = (0, _testUtils.mount)(_aiThinking.default, {
|
|
43
|
+
props: {
|
|
44
|
+
status: "error"
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
(0, _vitest.expect)(wrapper.classes()).toContain("yh-ai-thinking--error");
|
|
48
|
+
});
|
|
49
|
+
(0, _vitest.it)("should render custom title when provided", () => {
|
|
50
|
+
const wrapper = (0, _testUtils.mount)(_aiThinking.default, {
|
|
51
|
+
props: {
|
|
52
|
+
title: "My Custom Title",
|
|
53
|
+
status: "thinking"
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
(0, _vitest.expect)(wrapper.find(".yh-ai-thinking__title").text()).toBe("My Custom Title");
|
|
57
|
+
});
|
|
58
|
+
(0, _vitest.it)("should show default title based on status when no title provided", () => {
|
|
59
|
+
const wrapper = (0, _testUtils.mount)(_aiThinking.default, {
|
|
60
|
+
props: {
|
|
61
|
+
status: "end"
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
(0, _vitest.expect)(wrapper.find(".yh-ai-thinking__title").text().length).toBeGreaterThan(0);
|
|
65
|
+
});
|
|
66
|
+
(0, _vitest.it)("should start collapsed when modelValue=false", () => {
|
|
67
|
+
const wrapper = (0, _testUtils.mount)(_aiThinking.default, {
|
|
68
|
+
props: {
|
|
69
|
+
modelValue: false,
|
|
70
|
+
content: "Some content"
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
(0, _vitest.expect)(wrapper.classes()).not.toContain("is-expanded");
|
|
74
|
+
});
|
|
75
|
+
(0, _vitest.it)("should start expanded when modelValue=true", () => {
|
|
76
|
+
const wrapper = (0, _testUtils.mount)(_aiThinking.default, {
|
|
77
|
+
props: {
|
|
78
|
+
modelValue: true,
|
|
79
|
+
content: "Some content"
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
(0, _vitest.expect)(wrapper.classes()).toContain("is-expanded");
|
|
83
|
+
});
|
|
84
|
+
(0, _vitest.it)("should toggle expansion on header click and emit update:modelValue", async () => {
|
|
85
|
+
const wrapper = (0, _testUtils.mount)(_aiThinking.default, {
|
|
86
|
+
props: {
|
|
87
|
+
modelValue: false
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
await wrapper.find(".yh-ai-thinking__header").trigger("click");
|
|
91
|
+
(0, _vitest.expect)(wrapper.emitted("update:modelValue")).toBeTruthy();
|
|
92
|
+
(0, _vitest.expect)(wrapper.emitted("update:modelValue")[0][0]).toBe(true);
|
|
93
|
+
});
|
|
94
|
+
(0, _vitest.it)("should collapse when header clicked again", async () => {
|
|
95
|
+
const wrapper = (0, _testUtils.mount)(_aiThinking.default, {
|
|
96
|
+
props: {
|
|
97
|
+
modelValue: true
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
await wrapper.find(".yh-ai-thinking__header").trigger("click");
|
|
101
|
+
(0, _vitest.expect)(wrapper.emitted("update:modelValue")[0][0]).toBe(false);
|
|
102
|
+
});
|
|
103
|
+
(0, _vitest.it)("should render content in body when expanded", () => {
|
|
104
|
+
const wrapper = (0, _testUtils.mount)(_aiThinking.default, {
|
|
105
|
+
props: {
|
|
106
|
+
modelValue: true,
|
|
107
|
+
content: "Detailed thought process"
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
(0, _vitest.expect)(wrapper.find(".yh-ai-thinking__content").text()).toBe("Detailed thought process");
|
|
111
|
+
});
|
|
112
|
+
(0, _vitest.it)("should auto collapse when status changes to end and autoCollapse=true", async () => {
|
|
113
|
+
const wrapper = (0, _testUtils.mount)(_aiThinking.default, {
|
|
114
|
+
props: {
|
|
115
|
+
status: "thinking",
|
|
116
|
+
modelValue: true,
|
|
117
|
+
autoCollapse: true
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
await wrapper.setProps({
|
|
121
|
+
status: "end"
|
|
122
|
+
});
|
|
123
|
+
await (0, _vue.nextTick)();
|
|
124
|
+
(0, _vitest.expect)(wrapper.emitted("update:modelValue")[0][0]).toBe(false);
|
|
125
|
+
});
|
|
126
|
+
(0, _vitest.it)("should NOT auto collapse when autoCollapse=false", async () => {
|
|
127
|
+
const wrapper = (0, _testUtils.mount)(_aiThinking.default, {
|
|
128
|
+
props: {
|
|
129
|
+
status: "thinking",
|
|
130
|
+
modelValue: true,
|
|
131
|
+
autoCollapse: false
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
await wrapper.setProps({
|
|
135
|
+
status: "end"
|
|
136
|
+
});
|
|
137
|
+
await (0, _vue.nextTick)();
|
|
138
|
+
(0, _vitest.expect)(wrapper.emitted("update:modelValue")).toBeFalsy();
|
|
139
|
+
});
|
|
140
|
+
(0, _vitest.it)("should render default slot as body content", () => {
|
|
141
|
+
const wrapper = (0, _testUtils.mount)(_aiThinking.default, {
|
|
142
|
+
props: {
|
|
143
|
+
modelValue: true
|
|
144
|
+
},
|
|
145
|
+
slots: {
|
|
146
|
+
default: '<p class="custom-thought">Custom content</p>'
|
|
147
|
+
}
|
|
148
|
+
});
|
|
149
|
+
(0, _vitest.expect)(wrapper.find(".custom-thought").exists()).toBe(true);
|
|
150
|
+
});
|
|
151
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { describe, it, expect } from "vitest";
|
|
2
|
+
import { mount } from "@vue/test-utils";
|
|
3
|
+
import { nextTick } from "vue";
|
|
4
|
+
import AiThinking from "../src/ai-thinking.vue";
|
|
5
|
+
describe("YhAiThinking", () => {
|
|
6
|
+
it("should render with base class", () => {
|
|
7
|
+
const wrapper = mount(AiThinking);
|
|
8
|
+
expect(wrapper.find(".yh-ai-thinking").exists()).toBe(true);
|
|
9
|
+
});
|
|
10
|
+
it("should render header", () => {
|
|
11
|
+
const wrapper = mount(AiThinking);
|
|
12
|
+
expect(wrapper.find(".yh-ai-thinking__header").exists()).toBe(true);
|
|
13
|
+
});
|
|
14
|
+
it("should apply thinking status class by default", () => {
|
|
15
|
+
const wrapper = mount(AiThinking, { props: { status: "thinking" } });
|
|
16
|
+
expect(wrapper.classes()).toContain("yh-ai-thinking--thinking");
|
|
17
|
+
});
|
|
18
|
+
it("should apply start status class", () => {
|
|
19
|
+
const wrapper = mount(AiThinking, { props: { status: "start" } });
|
|
20
|
+
expect(wrapper.classes()).toContain("yh-ai-thinking--start");
|
|
21
|
+
});
|
|
22
|
+
it("should apply end status class", () => {
|
|
23
|
+
const wrapper = mount(AiThinking, { props: { status: "end" } });
|
|
24
|
+
expect(wrapper.classes()).toContain("yh-ai-thinking--end");
|
|
25
|
+
});
|
|
26
|
+
it("should apply error status class", () => {
|
|
27
|
+
const wrapper = mount(AiThinking, { props: { status: "error" } });
|
|
28
|
+
expect(wrapper.classes()).toContain("yh-ai-thinking--error");
|
|
29
|
+
});
|
|
30
|
+
it("should render custom title when provided", () => {
|
|
31
|
+
const wrapper = mount(AiThinking, {
|
|
32
|
+
props: { title: "My Custom Title", status: "thinking" }
|
|
33
|
+
});
|
|
34
|
+
expect(wrapper.find(".yh-ai-thinking__title").text()).toBe("My Custom Title");
|
|
35
|
+
});
|
|
36
|
+
it("should show default title based on status when no title provided", () => {
|
|
37
|
+
const wrapper = mount(AiThinking, { props: { status: "end" } });
|
|
38
|
+
expect(wrapper.find(".yh-ai-thinking__title").text().length).toBeGreaterThan(0);
|
|
39
|
+
});
|
|
40
|
+
it("should start collapsed when modelValue=false", () => {
|
|
41
|
+
const wrapper = mount(AiThinking, {
|
|
42
|
+
props: { modelValue: false, content: "Some content" }
|
|
43
|
+
});
|
|
44
|
+
expect(wrapper.classes()).not.toContain("is-expanded");
|
|
45
|
+
});
|
|
46
|
+
it("should start expanded when modelValue=true", () => {
|
|
47
|
+
const wrapper = mount(AiThinking, {
|
|
48
|
+
props: { modelValue: true, content: "Some content" }
|
|
49
|
+
});
|
|
50
|
+
expect(wrapper.classes()).toContain("is-expanded");
|
|
51
|
+
});
|
|
52
|
+
it("should toggle expansion on header click and emit update:modelValue", async () => {
|
|
53
|
+
const wrapper = mount(AiThinking, {
|
|
54
|
+
props: { modelValue: false }
|
|
55
|
+
});
|
|
56
|
+
await wrapper.find(".yh-ai-thinking__header").trigger("click");
|
|
57
|
+
expect(wrapper.emitted("update:modelValue")).toBeTruthy();
|
|
58
|
+
expect(wrapper.emitted("update:modelValue")[0][0]).toBe(true);
|
|
59
|
+
});
|
|
60
|
+
it("should collapse when header clicked again", async () => {
|
|
61
|
+
const wrapper = mount(AiThinking, {
|
|
62
|
+
props: { modelValue: true }
|
|
63
|
+
});
|
|
64
|
+
await wrapper.find(".yh-ai-thinking__header").trigger("click");
|
|
65
|
+
expect(wrapper.emitted("update:modelValue")[0][0]).toBe(false);
|
|
66
|
+
});
|
|
67
|
+
it("should render content in body when expanded", () => {
|
|
68
|
+
const wrapper = mount(AiThinking, {
|
|
69
|
+
props: { modelValue: true, content: "Detailed thought process" }
|
|
70
|
+
});
|
|
71
|
+
expect(wrapper.find(".yh-ai-thinking__content").text()).toBe("Detailed thought process");
|
|
72
|
+
});
|
|
73
|
+
it("should auto collapse when status changes to end and autoCollapse=true", async () => {
|
|
74
|
+
const wrapper = mount(AiThinking, {
|
|
75
|
+
props: { status: "thinking", modelValue: true, autoCollapse: true }
|
|
76
|
+
});
|
|
77
|
+
await wrapper.setProps({ status: "end" });
|
|
78
|
+
await nextTick();
|
|
79
|
+
expect(wrapper.emitted("update:modelValue")[0][0]).toBe(false);
|
|
80
|
+
});
|
|
81
|
+
it("should NOT auto collapse when autoCollapse=false", async () => {
|
|
82
|
+
const wrapper = mount(AiThinking, {
|
|
83
|
+
props: { status: "thinking", modelValue: true, autoCollapse: false }
|
|
84
|
+
});
|
|
85
|
+
await wrapper.setProps({ status: "end" });
|
|
86
|
+
await nextTick();
|
|
87
|
+
expect(wrapper.emitted("update:modelValue")).toBeFalsy();
|
|
88
|
+
});
|
|
89
|
+
it("should render default slot as body content", () => {
|
|
90
|
+
const wrapper = mount(AiThinking, {
|
|
91
|
+
props: { modelValue: true },
|
|
92
|
+
slots: { default: '<p class="custom-thought">Custom content</p>' }
|
|
93
|
+
});
|
|
94
|
+
expect(wrapper.find(".custom-thought").exists()).toBe(true);
|
|
95
|
+
});
|
|
96
|
+
});
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _exportNames = {
|
|
7
|
+
YhAiThinking: true
|
|
8
|
+
};
|
|
9
|
+
module.exports = exports.YhAiThinking = void 0;
|
|
10
|
+
var _utils = require("@yh-ui/utils");
|
|
11
|
+
var _aiThinking = _interopRequireDefault(require("./src/ai-thinking.vue"));
|
|
12
|
+
var _aiThinking2 = require("./src/ai-thinking.cjs");
|
|
13
|
+
Object.keys(_aiThinking2).forEach(function (key) {
|
|
14
|
+
if (key === "default" || key === "__esModule") return;
|
|
15
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
16
|
+
if (key in exports && exports[key] === _aiThinking2[key]) return;
|
|
17
|
+
Object.defineProperty(exports, key, {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function () {
|
|
20
|
+
return _aiThinking2[key];
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
25
|
+
const YhAiThinking = exports.YhAiThinking = (0, _utils.withInstall)(_aiThinking.default);
|
|
26
|
+
module.exports = YhAiThinking;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.aiThinkingProps = exports.aiThinkingEmits = void 0;
|
|
7
|
+
const aiThinkingProps = exports.aiThinkingProps = {
|
|
8
|
+
/**
|
|
9
|
+
* @description 思考状态
|
|
10
|
+
*/
|
|
11
|
+
status: {
|
|
12
|
+
type: String,
|
|
13
|
+
default: "thinking"
|
|
14
|
+
},
|
|
15
|
+
/**
|
|
16
|
+
* @description 思考标题
|
|
17
|
+
*/
|
|
18
|
+
title: String,
|
|
19
|
+
/**
|
|
20
|
+
* @description 思考详情内容
|
|
21
|
+
*/
|
|
22
|
+
content: String,
|
|
23
|
+
/**
|
|
24
|
+
* @description 是否展开详情 (v-model)
|
|
25
|
+
*/
|
|
26
|
+
modelValue: Boolean,
|
|
27
|
+
/**
|
|
28
|
+
* @description 完成后是否自动收起
|
|
29
|
+
*/
|
|
30
|
+
autoCollapse: {
|
|
31
|
+
type: Boolean,
|
|
32
|
+
default: true
|
|
33
|
+
},
|
|
34
|
+
/**
|
|
35
|
+
* @description 主题覆盖变量
|
|
36
|
+
*/
|
|
37
|
+
themeOverrides: {
|
|
38
|
+
type: Object,
|
|
39
|
+
default: void 0
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
const aiThinkingEmits = exports.aiThinkingEmits = {
|
|
43
|
+
"update:modelValue": value => typeof value === "boolean"
|
|
44
|
+
};
|