@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,69 @@
|
|
|
1
|
+
import { type AiCommand } from './ai-sender';
|
|
2
|
+
declare var __VLS_9: {}, __VLS_23: {}, __VLS_37: {
|
|
3
|
+
disabled: any;
|
|
4
|
+
loading: any;
|
|
5
|
+
submit: any;
|
|
6
|
+
};
|
|
7
|
+
type __VLS_Slots = {} & {
|
|
8
|
+
prefix?: (props: typeof __VLS_9) => any;
|
|
9
|
+
} & {
|
|
10
|
+
actions?: (props: typeof __VLS_23) => any;
|
|
11
|
+
} & {
|
|
12
|
+
submit?: (props: typeof __VLS_37) => any;
|
|
13
|
+
};
|
|
14
|
+
declare const __VLS_component: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
15
|
+
readonly modelValue: {
|
|
16
|
+
readonly type: StringConstructor;
|
|
17
|
+
readonly default: "";
|
|
18
|
+
};
|
|
19
|
+
readonly placeholder: {
|
|
20
|
+
readonly type: StringConstructor;
|
|
21
|
+
readonly default: "Send a message...";
|
|
22
|
+
};
|
|
23
|
+
readonly disabled: {
|
|
24
|
+
readonly type: BooleanConstructor;
|
|
25
|
+
readonly default: false;
|
|
26
|
+
};
|
|
27
|
+
readonly loading: {
|
|
28
|
+
readonly type: BooleanConstructor;
|
|
29
|
+
readonly default: false;
|
|
30
|
+
};
|
|
31
|
+
readonly clearable: {
|
|
32
|
+
readonly type: BooleanConstructor;
|
|
33
|
+
readonly default: false;
|
|
34
|
+
};
|
|
35
|
+
readonly maxLength: NumberConstructor;
|
|
36
|
+
readonly showWordLimit: {
|
|
37
|
+
readonly type: BooleanConstructor;
|
|
38
|
+
readonly default: false;
|
|
39
|
+
};
|
|
40
|
+
readonly commands: {
|
|
41
|
+
readonly type: import("vue").PropType<AiCommand[]>;
|
|
42
|
+
readonly default: () => never[];
|
|
43
|
+
};
|
|
44
|
+
readonly attachments: {
|
|
45
|
+
readonly type: import("vue").PropType<import("./ai-sender").AiAttachment[]>;
|
|
46
|
+
readonly default: () => never[];
|
|
47
|
+
};
|
|
48
|
+
readonly themeOverrides: {
|
|
49
|
+
readonly type: import("vue").PropType<import("@yh-ui/theme").ComponentThemeVars>;
|
|
50
|
+
readonly default: undefined;
|
|
51
|
+
};
|
|
52
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, any, string, import("vue").PublicProps, any, {
|
|
53
|
+
readonly disabled: boolean;
|
|
54
|
+
readonly themeOverrides: import("@yh-ui/theme").ComponentThemeVars;
|
|
55
|
+
readonly loading: boolean;
|
|
56
|
+
readonly placeholder: string;
|
|
57
|
+
readonly modelValue: string;
|
|
58
|
+
readonly clearable: boolean;
|
|
59
|
+
readonly showWordLimit: boolean;
|
|
60
|
+
readonly commands: AiCommand[];
|
|
61
|
+
readonly attachments: import("./ai-sender").AiAttachment[];
|
|
62
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
63
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
64
|
+
export default _default;
|
|
65
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
66
|
+
new (): {
|
|
67
|
+
$slots: S;
|
|
68
|
+
};
|
|
69
|
+
};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _vitest = require("vitest");
|
|
4
|
+
var _serverRenderer = require("@vue/server-renderer");
|
|
5
|
+
var _vue = require("vue");
|
|
6
|
+
var _aiSources = _interopRequireDefault(require("../src/ai-sources.vue"));
|
|
7
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
8
|
+
(0, _vitest.describe)("YhAiSources SSR", () => {
|
|
9
|
+
const mockSources = [{
|
|
10
|
+
id: 1,
|
|
11
|
+
title: "SSR Source 1",
|
|
12
|
+
source: "vuejs.org",
|
|
13
|
+
fileType: "web",
|
|
14
|
+
score: 0.95,
|
|
15
|
+
excerpt: "Excerpt 1"
|
|
16
|
+
}, {
|
|
17
|
+
id: 2,
|
|
18
|
+
title: "SSR Source 2",
|
|
19
|
+
source: "github.com",
|
|
20
|
+
fileType: "code",
|
|
21
|
+
score: 0.85,
|
|
22
|
+
excerpt: "Excerpt 2"
|
|
23
|
+
}];
|
|
24
|
+
(0, _vitest.it)("should render basic structure in inline mode on server", async () => {
|
|
25
|
+
const html = await (0, _serverRenderer.renderToString)((0, _vue.h)(_aiSources.default, {
|
|
26
|
+
sources: mockSources,
|
|
27
|
+
mode: "inline"
|
|
28
|
+
}));
|
|
29
|
+
(0, _vitest.expect)(html).toContain("yh-ai-sources");
|
|
30
|
+
(0, _vitest.expect)(html).toContain("yh-ai-sources--inline");
|
|
31
|
+
(0, _vitest.expect)(html).toContain("SSR Source 1");
|
|
32
|
+
(0, _vitest.expect)(html).toContain("SSR Source 2");
|
|
33
|
+
(0, _vitest.expect)(html).toContain("2");
|
|
34
|
+
(0, _vitest.expect)(html).toContain("\u53C2\u8003\u6765\u6E90");
|
|
35
|
+
});
|
|
36
|
+
(0, _vitest.it)("should render in card mode on server", async () => {
|
|
37
|
+
const html = await (0, _serverRenderer.renderToString)((0, _vue.h)(_aiSources.default, {
|
|
38
|
+
sources: mockSources,
|
|
39
|
+
mode: "card"
|
|
40
|
+
}));
|
|
41
|
+
(0, _vitest.expect)(html).toContain("yh-ai-sources--card");
|
|
42
|
+
(0, _vitest.expect)(html).toContain("yh-ai-sources__source-card");
|
|
43
|
+
(0, _vitest.expect)(html).toContain("\u5F15\u7528\u6765\u6E90");
|
|
44
|
+
});
|
|
45
|
+
(0, _vitest.it)("should render in badge mode on server", async () => {
|
|
46
|
+
const html = await (0, _serverRenderer.renderToString)((0, _vue.h)(_aiSources.default, {
|
|
47
|
+
sources: mockSources,
|
|
48
|
+
mode: "badge"
|
|
49
|
+
}));
|
|
50
|
+
(0, _vitest.expect)(html).toContain("yh-ai-sources--badge");
|
|
51
|
+
(0, _vitest.expect)(html).toContain("yh-ai-sources__badge");
|
|
52
|
+
});
|
|
53
|
+
(0, _vitest.it)("should render relevance score, file types and excerpt on server", async () => {
|
|
54
|
+
const html = await (0, _serverRenderer.renderToString)((0, _vue.h)(_aiSources.default, {
|
|
55
|
+
sources: mockSources,
|
|
56
|
+
mode: "card",
|
|
57
|
+
showScore: true
|
|
58
|
+
}));
|
|
59
|
+
(0, _vitest.expect)(html).toContain("95%");
|
|
60
|
+
(0, _vitest.expect)(html).toContain("\u76F8\u5173\u5EA6");
|
|
61
|
+
(0, _vitest.expect)(html).toContain("Excerpt 1");
|
|
62
|
+
});
|
|
63
|
+
(0, _vitest.it)("should handle expansion text on server", async () => {
|
|
64
|
+
const html = await (0, _serverRenderer.renderToString)((0, _vue.h)(_aiSources.default, {
|
|
65
|
+
sources: mockSources,
|
|
66
|
+
mode: "card",
|
|
67
|
+
maxVisible: 1
|
|
68
|
+
}));
|
|
69
|
+
(0, _vitest.expect)(html).toContain("\u663E\u793A\u5168\u90E8");
|
|
70
|
+
(0, _vitest.expect)(html).toContain("(2)");
|
|
71
|
+
});
|
|
72
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { describe, it, expect } from "vitest";
|
|
2
|
+
import { renderToString } from "@vue/server-renderer";
|
|
3
|
+
import { h } from "vue";
|
|
4
|
+
import AiSources from "../src/ai-sources.vue";
|
|
5
|
+
describe("YhAiSources SSR", () => {
|
|
6
|
+
const mockSources = [
|
|
7
|
+
{
|
|
8
|
+
id: 1,
|
|
9
|
+
title: "SSR Source 1",
|
|
10
|
+
source: "vuejs.org",
|
|
11
|
+
fileType: "web",
|
|
12
|
+
score: 0.95,
|
|
13
|
+
excerpt: "Excerpt 1"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
id: 2,
|
|
17
|
+
title: "SSR Source 2",
|
|
18
|
+
source: "github.com",
|
|
19
|
+
fileType: "code",
|
|
20
|
+
score: 0.85,
|
|
21
|
+
excerpt: "Excerpt 2"
|
|
22
|
+
}
|
|
23
|
+
];
|
|
24
|
+
it("should render basic structure in inline mode on server", async () => {
|
|
25
|
+
const html = await renderToString(
|
|
26
|
+
h(AiSources, {
|
|
27
|
+
sources: mockSources,
|
|
28
|
+
mode: "inline"
|
|
29
|
+
})
|
|
30
|
+
);
|
|
31
|
+
expect(html).toContain("yh-ai-sources");
|
|
32
|
+
expect(html).toContain("yh-ai-sources--inline");
|
|
33
|
+
expect(html).toContain("SSR Source 1");
|
|
34
|
+
expect(html).toContain("SSR Source 2");
|
|
35
|
+
expect(html).toContain("2");
|
|
36
|
+
expect(html).toContain("\u53C2\u8003\u6765\u6E90");
|
|
37
|
+
});
|
|
38
|
+
it("should render in card mode on server", async () => {
|
|
39
|
+
const html = await renderToString(
|
|
40
|
+
h(AiSources, {
|
|
41
|
+
sources: mockSources,
|
|
42
|
+
mode: "card"
|
|
43
|
+
})
|
|
44
|
+
);
|
|
45
|
+
expect(html).toContain("yh-ai-sources--card");
|
|
46
|
+
expect(html).toContain("yh-ai-sources__source-card");
|
|
47
|
+
expect(html).toContain("\u5F15\u7528\u6765\u6E90");
|
|
48
|
+
});
|
|
49
|
+
it("should render in badge mode on server", async () => {
|
|
50
|
+
const html = await renderToString(
|
|
51
|
+
h(AiSources, {
|
|
52
|
+
sources: mockSources,
|
|
53
|
+
mode: "badge"
|
|
54
|
+
})
|
|
55
|
+
);
|
|
56
|
+
expect(html).toContain("yh-ai-sources--badge");
|
|
57
|
+
expect(html).toContain("yh-ai-sources__badge");
|
|
58
|
+
});
|
|
59
|
+
it("should render relevance score, file types and excerpt on server", async () => {
|
|
60
|
+
const html = await renderToString(
|
|
61
|
+
h(AiSources, {
|
|
62
|
+
sources: mockSources,
|
|
63
|
+
mode: "card",
|
|
64
|
+
showScore: true
|
|
65
|
+
})
|
|
66
|
+
);
|
|
67
|
+
expect(html).toContain("95%");
|
|
68
|
+
expect(html).toContain("\u76F8\u5173\u5EA6");
|
|
69
|
+
expect(html).toContain("Excerpt 1");
|
|
70
|
+
});
|
|
71
|
+
it("should handle expansion text on server", async () => {
|
|
72
|
+
const html = await renderToString(
|
|
73
|
+
h(AiSources, {
|
|
74
|
+
sources: mockSources,
|
|
75
|
+
mode: "card",
|
|
76
|
+
maxVisible: 1
|
|
77
|
+
})
|
|
78
|
+
);
|
|
79
|
+
expect(html).toContain("\u663E\u793A\u5168\u90E8");
|
|
80
|
+
expect(html).toContain("(2)");
|
|
81
|
+
});
|
|
82
|
+
});
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _testUtils = require("@vue/test-utils");
|
|
4
|
+
var _vitest = require("vitest");
|
|
5
|
+
var _aiSources = _interopRequireDefault(require("../src/ai-sources.vue"));
|
|
6
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
7
|
+
(0, _vitest.describe)("AiSources", () => {
|
|
8
|
+
const mockSources = [{
|
|
9
|
+
id: 1,
|
|
10
|
+
title: "Source 1",
|
|
11
|
+
source: "vuejs.org",
|
|
12
|
+
fileType: "web",
|
|
13
|
+
score: 0.95,
|
|
14
|
+
excerpt: "Excerpt 1"
|
|
15
|
+
}, {
|
|
16
|
+
id: 2,
|
|
17
|
+
title: "Source 2",
|
|
18
|
+
source: "github.com",
|
|
19
|
+
fileType: "code",
|
|
20
|
+
score: 0.85,
|
|
21
|
+
excerpt: "Excerpt 2"
|
|
22
|
+
}, {
|
|
23
|
+
id: 3,
|
|
24
|
+
title: "Source 3",
|
|
25
|
+
fileType: "pdf",
|
|
26
|
+
score: 0.75
|
|
27
|
+
}];
|
|
28
|
+
(0, _vitest.it)("renders inline mode by default", () => {
|
|
29
|
+
const wrapper = (0, _testUtils.mount)(_aiSources.default, {
|
|
30
|
+
props: {
|
|
31
|
+
sources: mockSources
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
(0, _vitest.expect)(wrapper.classes()).toContain("yh-ai-sources--inline");
|
|
35
|
+
(0, _vitest.expect)(wrapper.find(".yh-ai-sources__inline-item").exists()).toBe(true);
|
|
36
|
+
(0, _vitest.expect)(wrapper.findAll(".yh-ai-sources__inline-item")).toHaveLength(3);
|
|
37
|
+
});
|
|
38
|
+
(0, _vitest.it)("renders card mode correctly", () => {
|
|
39
|
+
const wrapper = (0, _testUtils.mount)(_aiSources.default, {
|
|
40
|
+
props: {
|
|
41
|
+
sources: mockSources,
|
|
42
|
+
mode: "card"
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
(0, _vitest.expect)(wrapper.classes()).toContain("yh-ai-sources--card");
|
|
46
|
+
(0, _vitest.expect)(wrapper.find(".yh-ai-sources__source-card").exists()).toBe(true);
|
|
47
|
+
});
|
|
48
|
+
(0, _vitest.it)("renders badge mode correctly", () => {
|
|
49
|
+
const wrapper = (0, _testUtils.mount)(_aiSources.default, {
|
|
50
|
+
props: {
|
|
51
|
+
sources: mockSources,
|
|
52
|
+
mode: "badge"
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
(0, _vitest.expect)(wrapper.classes()).toContain("yh-ai-sources--badge");
|
|
56
|
+
(0, _vitest.expect)(wrapper.findAll(".yh-ai-sources__badge")).toHaveLength(3);
|
|
57
|
+
});
|
|
58
|
+
(0, _vitest.it)("handles expansion correctly", async () => {
|
|
59
|
+
const wrapper = (0, _testUtils.mount)(_aiSources.default, {
|
|
60
|
+
props: {
|
|
61
|
+
sources: mockSources,
|
|
62
|
+
maxVisible: 1,
|
|
63
|
+
mode: "card"
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
(0, _vitest.expect)(wrapper.findAll(".yh-ai-sources__source-card")).toHaveLength(1);
|
|
67
|
+
const expandBtn = wrapper.find(".yh-ai-sources__expand-btn");
|
|
68
|
+
(0, _vitest.expect)(expandBtn.exists()).toBe(true);
|
|
69
|
+
await expandBtn.trigger("click");
|
|
70
|
+
(0, _vitest.expect)(wrapper.findAll(".yh-ai-sources__source-card")).toHaveLength(3);
|
|
71
|
+
});
|
|
72
|
+
(0, _vitest.it)("emits events on interaction", async () => {
|
|
73
|
+
const wrapper = (0, _testUtils.mount)(_aiSources.default, {
|
|
74
|
+
props: {
|
|
75
|
+
sources: mockSources,
|
|
76
|
+
mode: "card"
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
await wrapper.find(".yh-ai-sources__source-card").trigger("click");
|
|
80
|
+
(0, _vitest.expect)(wrapper.emitted("click")).toBeTruthy();
|
|
81
|
+
(0, _vitest.expect)(wrapper.emitted("click")[0][0]).toEqual(mockSources[0]);
|
|
82
|
+
});
|
|
83
|
+
(0, _vitest.it)("shows relevance score when enabled", () => {
|
|
84
|
+
const wrapper = (0, _testUtils.mount)(_aiSources.default, {
|
|
85
|
+
props: {
|
|
86
|
+
sources: mockSources,
|
|
87
|
+
showScore: true,
|
|
88
|
+
mode: "card"
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
(0, _vitest.expect)(wrapper.find(".yh-ai-sources__score-badge").text()).toContain("95%");
|
|
92
|
+
});
|
|
93
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { mount } from "@vue/test-utils";
|
|
2
|
+
import { describe, it, expect } from "vitest";
|
|
3
|
+
import AiSources from "../src/ai-sources.vue";
|
|
4
|
+
describe("AiSources", () => {
|
|
5
|
+
const mockSources = [
|
|
6
|
+
{
|
|
7
|
+
id: 1,
|
|
8
|
+
title: "Source 1",
|
|
9
|
+
source: "vuejs.org",
|
|
10
|
+
fileType: "web",
|
|
11
|
+
score: 0.95,
|
|
12
|
+
excerpt: "Excerpt 1"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
id: 2,
|
|
16
|
+
title: "Source 2",
|
|
17
|
+
source: "github.com",
|
|
18
|
+
fileType: "code",
|
|
19
|
+
score: 0.85,
|
|
20
|
+
excerpt: "Excerpt 2"
|
|
21
|
+
},
|
|
22
|
+
{ id: 3, title: "Source 3", fileType: "pdf", score: 0.75 }
|
|
23
|
+
];
|
|
24
|
+
it("renders inline mode by default", () => {
|
|
25
|
+
const wrapper = mount(AiSources, {
|
|
26
|
+
props: {
|
|
27
|
+
sources: mockSources
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
expect(wrapper.classes()).toContain("yh-ai-sources--inline");
|
|
31
|
+
expect(wrapper.find(".yh-ai-sources__inline-item").exists()).toBe(true);
|
|
32
|
+
expect(wrapper.findAll(".yh-ai-sources__inline-item")).toHaveLength(3);
|
|
33
|
+
});
|
|
34
|
+
it("renders card mode correctly", () => {
|
|
35
|
+
const wrapper = mount(AiSources, {
|
|
36
|
+
props: {
|
|
37
|
+
sources: mockSources,
|
|
38
|
+
mode: "card"
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
expect(wrapper.classes()).toContain("yh-ai-sources--card");
|
|
42
|
+
expect(wrapper.find(".yh-ai-sources__source-card").exists()).toBe(true);
|
|
43
|
+
});
|
|
44
|
+
it("renders badge mode correctly", () => {
|
|
45
|
+
const wrapper = mount(AiSources, {
|
|
46
|
+
props: {
|
|
47
|
+
sources: mockSources,
|
|
48
|
+
mode: "badge"
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
expect(wrapper.classes()).toContain("yh-ai-sources--badge");
|
|
52
|
+
expect(wrapper.findAll(".yh-ai-sources__badge")).toHaveLength(3);
|
|
53
|
+
});
|
|
54
|
+
it("handles expansion correctly", async () => {
|
|
55
|
+
const wrapper = mount(AiSources, {
|
|
56
|
+
props: {
|
|
57
|
+
sources: mockSources,
|
|
58
|
+
maxVisible: 1,
|
|
59
|
+
mode: "card"
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
expect(wrapper.findAll(".yh-ai-sources__source-card")).toHaveLength(1);
|
|
63
|
+
const expandBtn = wrapper.find(".yh-ai-sources__expand-btn");
|
|
64
|
+
expect(expandBtn.exists()).toBe(true);
|
|
65
|
+
await expandBtn.trigger("click");
|
|
66
|
+
expect(wrapper.findAll(".yh-ai-sources__source-card")).toHaveLength(3);
|
|
67
|
+
});
|
|
68
|
+
it("emits events on interaction", async () => {
|
|
69
|
+
const wrapper = mount(AiSources, {
|
|
70
|
+
props: {
|
|
71
|
+
sources: mockSources,
|
|
72
|
+
mode: "card"
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
await wrapper.find(".yh-ai-sources__source-card").trigger("click");
|
|
76
|
+
expect(wrapper.emitted("click")).toBeTruthy();
|
|
77
|
+
expect(wrapper.emitted("click")[0][0]).toEqual(mockSources[0]);
|
|
78
|
+
});
|
|
79
|
+
it("shows relevance score when enabled", () => {
|
|
80
|
+
const wrapper = mount(AiSources, {
|
|
81
|
+
props: {
|
|
82
|
+
sources: mockSources,
|
|
83
|
+
showScore: true,
|
|
84
|
+
mode: "card"
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
expect(wrapper.find(".yh-ai-sources__score-badge").text()).toContain("95%");
|
|
88
|
+
});
|
|
89
|
+
});
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _exportNames = {
|
|
7
|
+
YhAiSources: true
|
|
8
|
+
};
|
|
9
|
+
module.exports = exports.YhAiSources = void 0;
|
|
10
|
+
var _utils = require("@yh-ui/utils");
|
|
11
|
+
var _aiSources = _interopRequireDefault(require("./src/ai-sources.vue"));
|
|
12
|
+
var _aiSources2 = require("./src/ai-sources.cjs");
|
|
13
|
+
Object.keys(_aiSources2).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] === _aiSources2[key]) return;
|
|
17
|
+
Object.defineProperty(exports, key, {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function () {
|
|
20
|
+
return _aiSources2[key];
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
25
|
+
const YhAiSources = exports.YhAiSources = (0, _utils.withInstall)(_aiSources.default);
|
|
26
|
+
module.exports = YhAiSources;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.aiSourcesProps = exports.aiSourcesEmits = void 0;
|
|
7
|
+
const aiSourcesProps = exports.aiSourcesProps = {
|
|
8
|
+
/**
|
|
9
|
+
* @description 引用来源列表
|
|
10
|
+
*/
|
|
11
|
+
sources: {
|
|
12
|
+
type: Array,
|
|
13
|
+
default: () => []
|
|
14
|
+
},
|
|
15
|
+
/**
|
|
16
|
+
* @description 展示模式
|
|
17
|
+
* - 'inline': 内联气泡(紧凑,嵌入回复内)
|
|
18
|
+
* - 'card': 卡片列表(展开式详细)
|
|
19
|
+
* - 'badge': 仅角标数字(点击弹出抽屉)
|
|
20
|
+
*/
|
|
21
|
+
mode: {
|
|
22
|
+
type: String,
|
|
23
|
+
default: "inline"
|
|
24
|
+
},
|
|
25
|
+
/**
|
|
26
|
+
* @description 最多显示的卡片数(超出折叠)
|
|
27
|
+
*/
|
|
28
|
+
maxVisible: {
|
|
29
|
+
type: Number,
|
|
30
|
+
default: 5
|
|
31
|
+
},
|
|
32
|
+
/**
|
|
33
|
+
* @description 是否显示相关度分数
|
|
34
|
+
*/
|
|
35
|
+
showScore: {
|
|
36
|
+
type: Boolean,
|
|
37
|
+
default: true
|
|
38
|
+
},
|
|
39
|
+
/**
|
|
40
|
+
* @description 是否显示文件类型图标
|
|
41
|
+
*/
|
|
42
|
+
showFileType: {
|
|
43
|
+
type: Boolean,
|
|
44
|
+
default: true
|
|
45
|
+
},
|
|
46
|
+
/**
|
|
47
|
+
* @description 主题覆盖
|
|
48
|
+
*/
|
|
49
|
+
themeOverrides: {
|
|
50
|
+
type: Object,
|
|
51
|
+
default: void 0
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
const aiSourcesEmits = exports.aiSourcesEmits = {
|
|
55
|
+
/** 点击来源项 */
|
|
56
|
+
click: source => !!source,
|
|
57
|
+
/** 点击查看原文 */
|
|
58
|
+
open: source => !!source
|
|
59
|
+
};
|