@baishuyun/chat-sdk 0.1.9 → 1.0.0
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/.turbo/turbo-build.log +8 -107
- package/CHANGELOG.md +12 -0
- package/dist/chat-sdk.js +14087 -13890
- package/dist/chat-sdk.js.map +1 -1
- package/dist/chat-sdk.umd.cjs +150 -150
- package/dist/chat-sdk.umd.cjs.map +1 -1
- package/dist/index.css +1 -1
- package/dist/src/chat.d.ts +5 -0
- package/dist/src/chat.d.ts.map +1 -0
- package/dist/src/components/biz-comp/FakeBotMsg.d.ts +8 -0
- package/dist/src/components/biz-comp/FakeBotMsg.d.ts.map +1 -0
- package/dist/src/components/biz-comp/FieldChecker.d.ts +19 -0
- package/dist/src/components/biz-comp/FieldChecker.d.ts.map +1 -0
- package/dist/src/components/biz-comp/FieldCheckerListMsg.d.ts +19 -0
- package/dist/src/components/biz-comp/FieldCheckerListMsg.d.ts.map +1 -0
- package/dist/src/components/biz-comp/FieldValueChecker.d.ts +16 -0
- package/dist/src/components/biz-comp/FieldValueChecker.d.ts.map +1 -0
- package/dist/src/components/biz-comp/SubformFieldsValueChecker.d.ts +22 -0
- package/dist/src/components/biz-comp/SubformFieldsValueChecker.d.ts.map +1 -0
- package/dist/src/components/biz-comp/chat-client.d.ts +13 -0
- package/dist/src/components/biz-comp/chat-client.d.ts.map +1 -0
- package/dist/src/components/biz-comp/chat-frame.d.ts +6 -0
- package/dist/src/components/biz-comp/chat-frame.d.ts.map +1 -0
- package/dist/src/components/biz-comp/conversation.d.ts +10 -0
- package/dist/src/components/biz-comp/conversation.d.ts.map +1 -0
- package/dist/src/components/biz-comp/dash-widget-icon.d.ts +7 -0
- package/dist/src/components/biz-comp/dash-widget-icon.d.ts.map +1 -0
- package/dist/src/components/biz-comp/dock-btn.d.ts +2 -0
- package/dist/src/components/biz-comp/dock-btn.d.ts.map +1 -0
- package/dist/src/components/biz-comp/error-boundary.d.ts +15 -0
- package/dist/src/components/biz-comp/error-boundary.d.ts.map +1 -0
- package/dist/src/components/biz-comp/error-msg.d.ts +4 -0
- package/dist/src/components/biz-comp/error-msg.d.ts.map +1 -0
- package/dist/src/components/biz-comp/field-icon.d.ts +5 -0
- package/dist/src/components/biz-comp/field-icon.d.ts.map +1 -0
- package/dist/src/components/biz-comp/highlight-msg.d.ts +4 -0
- package/dist/src/components/biz-comp/highlight-msg.d.ts.map +1 -0
- package/dist/src/components/biz-comp/markdown-part.d.ts +7 -0
- package/dist/src/components/biz-comp/markdown-part.d.ts.map +1 -0
- package/dist/src/components/biz-comp/markdown.d.ts +5 -0
- package/dist/src/components/biz-comp/markdown.d.ts.map +1 -0
- package/dist/src/components/biz-comp/message-content.d.ts +6 -0
- package/dist/src/components/biz-comp/message-content.d.ts.map +1 -0
- package/dist/src/components/biz-comp/messages.d.ts +3 -0
- package/dist/src/components/biz-comp/messages.d.ts.map +1 -0
- package/dist/src/components/biz-comp/multi-modal-input/attachment-btn.d.ts +9 -0
- package/dist/src/components/biz-comp/multi-modal-input/attachment-btn.d.ts.map +1 -0
- package/dist/src/components/biz-comp/multi-modal-input/clear-btn.d.ts +8 -0
- package/dist/src/components/biz-comp/multi-modal-input/clear-btn.d.ts.map +1 -0
- package/dist/src/components/biz-comp/multi-modal-input/index.d.ts +22 -0
- package/dist/src/components/biz-comp/multi-modal-input/index.d.ts.map +1 -0
- package/dist/src/components/biz-comp/multi-modal-input/preview-attachment.d.ts +12 -0
- package/dist/src/components/biz-comp/multi-modal-input/preview-attachment.d.ts.map +1 -0
- package/dist/src/components/biz-comp/multi-modal-input/prompt-input.d.ts +36 -0
- package/dist/src/components/biz-comp/multi-modal-input/prompt-input.d.ts.map +1 -0
- package/dist/src/components/biz-comp/multi-modal-input/voice-btn.d.ts +9 -0
- package/dist/src/components/biz-comp/multi-modal-input/voice-btn.d.ts.map +1 -0
- package/dist/src/components/biz-comp/opening-lines.d.ts +3 -0
- package/dist/src/components/biz-comp/opening-lines.d.ts.map +1 -0
- package/dist/src/components/biz-comp/preview-message-wrapper.d.ts +12 -0
- package/dist/src/components/biz-comp/preview-message-wrapper.d.ts.map +1 -0
- package/dist/src/components/biz-comp/preview-message.d.ts +13 -0
- package/dist/src/components/biz-comp/preview-message.d.ts.map +1 -0
- package/dist/src/components/biz-comp/response.d.ts +6 -0
- package/dist/src/components/biz-comp/response.d.ts.map +1 -0
- package/dist/src/components/biz-comp/suggestions.d.ts +8 -0
- package/dist/src/components/biz-comp/suggestions.d.ts.map +1 -0
- package/dist/src/components/ui/badge.d.ts +10 -0
- package/dist/src/components/ui/badge.d.ts.map +1 -0
- package/dist/src/components/ui/button.d.ts +12 -0
- package/dist/src/components/ui/button.d.ts.map +1 -0
- package/dist/src/components/ui/card.d.ts +9 -0
- package/dist/src/components/ui/card.d.ts.map +1 -0
- package/dist/src/components/ui/checkbox.d.ts +5 -0
- package/dist/src/components/ui/checkbox.d.ts.map +1 -0
- package/dist/src/components/ui/collapsible.d.ts +6 -0
- package/dist/src/components/ui/collapsible.d.ts.map +1 -0
- package/dist/src/components/ui/dialog.d.ts +24 -0
- package/dist/src/components/ui/dialog.d.ts.map +1 -0
- package/dist/src/components/ui/dropdown-menu.d.ts +28 -0
- package/dist/src/components/ui/dropdown-menu.d.ts.map +1 -0
- package/dist/src/components/ui/icons.d.ts +176 -0
- package/dist/src/components/ui/icons.d.ts.map +1 -0
- package/dist/src/components/ui/input-group.d.ts +17 -0
- package/dist/src/components/ui/input-group.d.ts.map +1 -0
- package/dist/src/components/ui/input.d.ts +4 -0
- package/dist/src/components/ui/input.d.ts.map +1 -0
- package/dist/src/components/ui/label.d.ts +6 -0
- package/dist/src/components/ui/label.d.ts.map +1 -0
- package/dist/src/components/ui/one-time-click-btn.d.ts +4 -0
- package/dist/src/components/ui/one-time-click-btn.d.ts.map +1 -0
- package/dist/src/components/ui/select.d.ts +14 -0
- package/dist/src/components/ui/select.d.ts.map +1 -0
- package/dist/src/components/ui/spinner.d.ts +3 -0
- package/dist/src/components/ui/spinner.d.ts.map +1 -0
- package/dist/src/components/ui/tabs.d.ts +8 -0
- package/dist/src/components/ui/tabs.d.ts.map +1 -0
- package/dist/src/components/ui/textarea.d.ts +4 -0
- package/dist/src/components/ui/textarea.d.ts.map +1 -0
- package/dist/src/components/ui/tooltip.d.ts +13 -0
- package/dist/src/components/ui/tooltip.d.ts.map +1 -0
- package/dist/src/components/web-comp/fields-previewer-web-component.d.ts +60 -0
- package/dist/src/components/web-comp/fields-previewer-web-component.d.ts.map +1 -0
- package/dist/src/const/index.d.ts +5 -0
- package/dist/src/const/index.d.ts.map +1 -0
- package/dist/src/const/ui.d.ts +7 -0
- package/dist/src/const/ui.d.ts.map +1 -0
- package/dist/src/hooks/use-chat-preference.d.ts +3 -0
- package/dist/src/hooks/use-chat-preference.d.ts.map +1 -0
- package/dist/src/hooks/use-draggable.d.ts +24 -0
- package/dist/src/hooks/use-draggable.d.ts.map +1 -0
- package/dist/src/hooks/use-evt-bus.d.ts +2 -0
- package/dist/src/hooks/use-evt-bus.d.ts.map +1 -0
- package/dist/src/hooks/use-evt.d.ts +3 -0
- package/dist/src/hooks/use-evt.d.ts.map +1 -0
- package/dist/src/hooks/use-frame-mode.d.ts +20 -0
- package/dist/src/hooks/use-frame-mode.d.ts.map +1 -0
- package/dist/src/hooks/use-merged-chat.d.ts +7 -0
- package/dist/src/hooks/use-merged-chat.d.ts.map +1 -0
- package/dist/src/hooks/use-msg-status-broadcast.d.ts +3 -0
- package/dist/src/hooks/use-msg-status-broadcast.d.ts.map +1 -0
- package/dist/src/hooks/use-plugin-component.d.ts +5 -0
- package/dist/src/hooks/use-plugin-component.d.ts.map +1 -0
- package/dist/src/hooks/use-plugin-ctx.d.ts +3 -0
- package/dist/src/hooks/use-plugin-ctx.d.ts.map +1 -0
- package/dist/src/hooks/use-plugin-custom-components.d.ts +5 -0
- package/dist/src/hooks/use-plugin-custom-components.d.ts.map +1 -0
- package/dist/src/hooks/use-plugin-life-cycle-chain-runner.d.ts +5 -0
- package/dist/src/hooks/use-plugin-life-cycle-chain-runner.d.ts.map +1 -0
- package/dist/src/hooks/use-plugin-list.d.ts +2 -0
- package/dist/src/hooks/use-plugin-list.d.ts.map +1 -0
- package/dist/src/hooks/use-plugin.d.ts +2 -0
- package/dist/src/hooks/use-plugin.d.ts.map +1 -0
- package/dist/src/hooks/use-scroll-to-bottom.d.ts +9 -0
- package/dist/src/hooks/use-scroll-to-bottom.d.ts.map +1 -0
- package/dist/src/hooks/use-shadow.d.ts +25 -0
- package/dist/src/hooks/use-shadow.d.ts.map +1 -0
- package/dist/src/hooks/use-streaming-anchor.d.ts +11 -0
- package/dist/src/hooks/use-streaming-anchor.d.ts.map +1 -0
- package/dist/src/hooks/use-toast.d.ts +3 -0
- package/dist/src/hooks/use-toast.d.ts.map +1 -0
- package/dist/src/hooks/use-voice-input.d.ts +31 -0
- package/dist/src/hooks/use-voice-input.d.ts.map +1 -0
- package/dist/src/index.d.ts +6 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/lib/clone.d.ts +32 -0
- package/dist/src/lib/clone.d.ts.map +1 -0
- package/dist/src/lib/event-emitter.d.ts +39 -0
- package/dist/src/lib/event-emitter.d.ts.map +1 -0
- package/dist/src/lib/parse-design-doc.d.ts +16 -0
- package/dist/src/lib/parse-design-doc.d.ts.map +1 -0
- package/dist/src/lib/readonly.d.ts +14 -0
- package/dist/src/lib/readonly.d.ts.map +1 -0
- package/dist/src/lib/utils.d.ts +72 -0
- package/dist/src/lib/utils.d.ts.map +1 -0
- package/dist/src/plugins/form-builder-base-plugin/const.d.ts +3 -0
- package/dist/src/plugins/form-builder-base-plugin/const.d.ts.map +1 -0
- package/dist/src/plugins/form-builder-base-plugin/index.d.ts +7 -0
- package/dist/src/plugins/form-builder-base-plugin/index.d.ts.map +1 -0
- package/dist/src/plugins/form-builder-base-plugin/types.d.ts +12 -0
- package/dist/src/plugins/form-builder-base-plugin/types.d.ts.map +1 -0
- package/dist/src/plugins/form-builder-plugin/components/create-form-confirm.d.ts +7 -0
- package/dist/src/plugins/form-builder-plugin/components/create-form-confirm.d.ts.map +1 -0
- package/dist/src/plugins/form-builder-plugin/components/design-doc-part.d.ts +4 -0
- package/dist/src/plugins/form-builder-plugin/components/design-doc-part.d.ts.map +1 -0
- package/dist/src/plugins/form-builder-plugin/components/design-info.d.ts +6 -0
- package/dist/src/plugins/form-builder-plugin/components/design-info.d.ts.map +1 -0
- package/dist/src/plugins/form-builder-plugin/components/entry-btn.d.ts +3 -0
- package/dist/src/plugins/form-builder-plugin/components/entry-btn.d.ts.map +1 -0
- package/dist/src/plugins/form-builder-plugin/components/fields-part.d.ts +4 -0
- package/dist/src/plugins/form-builder-plugin/components/fields-part.d.ts.map +1 -0
- package/dist/src/plugins/form-builder-plugin/components/follow-up.d.ts +3 -0
- package/dist/src/plugins/form-builder-plugin/components/follow-up.d.ts.map +1 -0
- package/dist/src/plugins/form-builder-plugin/components/msg-part.d.ts +3 -0
- package/dist/src/plugins/form-builder-plugin/components/msg-part.d.ts.map +1 -0
- package/dist/src/plugins/form-builder-plugin/components/opening-lines.d.ts +3 -0
- package/dist/src/plugins/form-builder-plugin/components/opening-lines.d.ts.map +1 -0
- package/dist/src/plugins/form-builder-plugin/components/suggestion-part.d.ts +5 -0
- package/dist/src/plugins/form-builder-plugin/components/suggestion-part.d.ts.map +1 -0
- package/dist/src/plugins/form-builder-plugin/const/index.d.ts +12 -0
- package/dist/src/plugins/form-builder-plugin/const/index.d.ts.map +1 -0
- package/dist/src/plugins/form-builder-plugin/hooks/index.d.ts +4 -0
- package/dist/src/plugins/form-builder-plugin/hooks/index.d.ts.map +1 -0
- package/dist/src/plugins/form-builder-plugin/hooks/use-fields-confirmed.d.ts +2 -0
- package/dist/src/plugins/form-builder-plugin/hooks/use-fields-confirmed.d.ts.map +1 -0
- package/dist/src/plugins/form-builder-plugin/index.d.ts +30 -0
- package/dist/src/plugins/form-builder-plugin/index.d.ts.map +1 -0
- package/dist/src/plugins/form-builder-plugin/types.d.ts +28 -0
- package/dist/src/plugins/form-builder-plugin/types.d.ts.map +1 -0
- package/dist/src/plugins/form-builder-plugin/utils/get-render-strategy.d.ts +3 -0
- package/dist/src/plugins/form-builder-plugin/utils/get-render-strategy.d.ts.map +1 -0
- package/dist/src/plugins/form-builder-plugin/utils/index.d.ts +57 -0
- package/dist/src/plugins/form-builder-plugin/utils/index.d.ts.map +1 -0
- package/dist/src/plugins/form-filling-plugin/batch-filling-data-manager.d.ts +26 -0
- package/dist/src/plugins/form-filling-plugin/batch-filling-data-manager.d.ts.map +1 -0
- package/dist/src/plugins/form-filling-plugin/components/FormFillingOpeningLines.d.ts +3 -0
- package/dist/src/plugins/form-filling-plugin/components/FormFillingOpeningLines.d.ts.map +1 -0
- package/dist/src/plugins/form-filling-plugin/components/avatar.d.ts +5 -0
- package/dist/src/plugins/form-filling-plugin/components/avatar.d.ts.map +1 -0
- package/dist/src/plugins/form-filling-plugin/components/batch-fill-part.d.ts +4 -0
- package/dist/src/plugins/form-filling-plugin/components/batch-fill-part.d.ts.map +1 -0
- package/dist/src/plugins/form-filling-plugin/components/batch-generator-action.d.ts +14 -0
- package/dist/src/plugins/form-filling-plugin/components/batch-generator-action.d.ts.map +1 -0
- package/dist/src/plugins/form-filling-plugin/components/entry-btn.d.ts +3 -0
- package/dist/src/plugins/form-filling-plugin/components/entry-btn.d.ts.map +1 -0
- package/dist/src/plugins/form-filling-plugin/components/first-batch-generating-animation.d.ts +2 -0
- package/dist/src/plugins/form-filling-plugin/components/first-batch-generating-animation.d.ts.map +1 -0
- package/dist/src/plugins/form-filling-plugin/components/generated-data-counter.d.ts +5 -0
- package/dist/src/plugins/form-filling-plugin/components/generated-data-counter.d.ts.map +1 -0
- package/dist/src/plugins/form-filling-plugin/components/mode-select.d.ts +2 -0
- package/dist/src/plugins/form-filling-plugin/components/mode-select.d.ts.map +1 -0
- package/dist/src/plugins/form-filling-plugin/components/msg-part.d.ts +3 -0
- package/dist/src/plugins/form-filling-plugin/components/msg-part.d.ts.map +1 -0
- package/dist/src/plugins/form-filling-plugin/components/non-first-batch-generating-animation.d.ts +2 -0
- package/dist/src/plugins/form-filling-plugin/components/non-first-batch-generating-animation.d.ts.map +1 -0
- package/dist/src/plugins/form-filling-plugin/components/single-fill-part.d.ts +4 -0
- package/dist/src/plugins/form-filling-plugin/components/single-fill-part.d.ts.map +1 -0
- package/dist/src/plugins/form-filling-plugin/const.d.ts +615 -0
- package/dist/src/plugins/form-filling-plugin/const.d.ts.map +1 -0
- package/dist/src/plugins/form-filling-plugin/hooks/use-conversation-id-in-ctx.d.ts +3 -0
- package/dist/src/plugins/form-filling-plugin/hooks/use-conversation-id-in-ctx.d.ts.map +1 -0
- package/dist/src/plugins/form-filling-plugin/hooks/use-fields-data.d.ts +4 -0
- package/dist/src/plugins/form-filling-plugin/hooks/use-fields-data.d.ts.map +1 -0
- package/dist/src/plugins/form-filling-plugin/index.d.ts +22 -0
- package/dist/src/plugins/form-filling-plugin/index.d.ts.map +1 -0
- package/dist/src/plugins/form-filling-plugin/types.d.ts +22 -0
- package/dist/src/plugins/form-filling-plugin/types.d.ts.map +1 -0
- package/dist/src/plugins/form-filling-plugin/utils.d.ts +6 -0
- package/dist/src/plugins/form-filling-plugin/utils.d.ts.map +1 -0
- package/dist/src/plugins/report-query-plugin/components/avatar.d.ts +5 -0
- package/dist/src/plugins/report-query-plugin/components/avatar.d.ts.map +1 -0
- package/dist/src/plugins/report-query-plugin/components/query-entry-btn.d.ts +3 -0
- package/dist/src/plugins/report-query-plugin/components/query-entry-btn.d.ts.map +1 -0
- package/dist/src/plugins/report-query-plugin/components/query-msg-part.d.ts +3 -0
- package/dist/src/plugins/report-query-plugin/components/query-msg-part.d.ts.map +1 -0
- package/dist/src/plugins/report-query-plugin/components/query-opening-lines.d.ts +2 -0
- package/dist/src/plugins/report-query-plugin/components/query-opening-lines.d.ts.map +1 -0
- package/dist/src/plugins/report-query-plugin/components/result-cards/CreatedSourceMsg.d.ts +7 -0
- package/dist/src/plugins/report-query-plugin/components/result-cards/CreatedSourceMsg.d.ts.map +1 -0
- package/dist/src/plugins/report-query-plugin/components/result-cards/DataTableCard.d.ts +5 -0
- package/dist/src/plugins/report-query-plugin/components/result-cards/DataTableCard.d.ts.map +1 -0
- package/dist/src/plugins/report-query-plugin/components/result-cards/DataTableFields.d.ts +18 -0
- package/dist/src/plugins/report-query-plugin/components/result-cards/DataTableFields.d.ts.map +1 -0
- package/dist/src/plugins/report-query-plugin/components/result-cards/FilterCondition.d.ts +4 -0
- package/dist/src/plugins/report-query-plugin/components/result-cards/FilterCondition.d.ts.map +1 -0
- package/dist/src/plugins/report-query-plugin/components/result-cards/FormulaField.d.ts +8 -0
- package/dist/src/plugins/report-query-plugin/components/result-cards/FormulaField.d.ts.map +1 -0
- package/dist/src/plugins/report-query-plugin/const.d.ts +5 -0
- package/dist/src/plugins/report-query-plugin/const.d.ts.map +1 -0
- package/dist/src/plugins/report-query-plugin/index.d.ts +19 -0
- package/dist/src/plugins/report-query-plugin/index.d.ts.map +1 -0
- package/dist/src/plugins/report-query-plugin/types.d.ts +18 -0
- package/dist/src/plugins/report-query-plugin/types.d.ts.map +1 -0
- package/dist/src/plugins/report-query-plugin/utils/build-dash-component.d.ts +17 -0
- package/dist/src/plugins/report-query-plugin/utils/build-dash-component.d.ts.map +1 -0
- package/dist/src/plugins/report-query-plugin/utils/create-default-dash-styles.d.ts +30 -0
- package/dist/src/plugins/report-query-plugin/utils/create-default-dash-styles.d.ts.map +1 -0
- package/dist/src/plugins/report-query-plugin/utils/create-default-widget-attr-list.d.ts +60 -0
- package/dist/src/plugins/report-query-plugin/utils/create-default-widget-attr-list.d.ts.map +1 -0
- package/dist/src/plugins/report-query-plugin/utils/field-enhance.d.ts +31 -0
- package/dist/src/plugins/report-query-plugin/utils/field-enhance.d.ts.map +1 -0
- package/dist/src/plugins/report-query-plugin/utils/get-field-group.d.ts +208 -0
- package/dist/src/plugins/report-query-plugin/utils/get-field-group.d.ts.map +1 -0
- package/dist/src/plugins/report-query-plugin/utils/get-field-icon.d.ts +4 -0
- package/dist/src/plugins/report-query-plugin/utils/get-field-icon.d.ts.map +1 -0
- package/dist/src/plugins/report-query-plugin/utils/get-group-rule.d.ts +4 -0
- package/dist/src/plugins/report-query-plugin/utils/get-group-rule.d.ts.map +1 -0
- package/dist/src/plugins/report-query-plugin/utils/index.d.ts +5 -0
- package/dist/src/plugins/report-query-plugin/utils/index.d.ts.map +1 -0
- package/dist/src/sdk.impl.d.ts +44 -0
- package/dist/src/sdk.impl.d.ts.map +1 -0
- package/dist/src/store/context.d.ts +12 -0
- package/dist/src/store/context.d.ts.map +1 -0
- package/dist/src/store/index.d.ts +14 -0
- package/dist/src/store/index.d.ts.map +1 -0
- package/dist/src/stories/FormulaField.stories.d.ts +24 -0
- package/dist/src/stories/FormulaField.stories.d.ts.map +1 -0
- package/package.json +5 -4
- package/src/components/biz-comp/FakeBotMsg.tsx +1 -1
- package/src/components/biz-comp/FieldChecker.tsx +2 -2
- package/src/components/biz-comp/FieldCheckerListMsg.tsx +3 -3
- package/src/components/biz-comp/FieldValueChecker.tsx +1 -1
- package/src/components/biz-comp/SubformFieldsValueChecker.tsx +1 -1
- package/src/components/biz-comp/chat-client.tsx +3 -3
- package/src/components/biz-comp/conversation.tsx +1 -1
- package/src/components/biz-comp/dash-widget-icon.tsx +1 -1
- package/src/components/biz-comp/field-icon.tsx +2 -2
- package/src/components/biz-comp/markdown-part.tsx +3 -3
- package/src/components/biz-comp/message-content.tsx +1 -1
- package/src/components/biz-comp/messages.tsx +5 -2
- package/src/components/biz-comp/multi-modal-input/clear-btn.tsx +2 -2
- package/src/components/biz-comp/multi-modal-input/index.tsx +4 -4
- package/src/components/biz-comp/multi-modal-input/prompt-input.tsx +2 -2
- package/src/components/biz-comp/multi-modal-input/voice-btn.tsx +2 -2
- package/src/components/biz-comp/preview-message-wrapper.tsx +14 -7
- package/src/components/biz-comp/preview-message.tsx +5 -5
- package/src/components/biz-comp/suggestions.tsx +2 -2
- package/src/components/web-comp/fields-previewer-web-component.ts +1 -1
- package/src/const/ui.ts +1 -1
- package/src/hooks/use-streaming-anchor.ts +42 -0
- package/src/plugins/form-builder-plugin/components/create-form-confirm.tsx +4 -4
- package/src/plugins/form-builder-plugin/components/design-info.tsx +3 -3
- package/src/plugins/form-builder-plugin/components/entry-btn.tsx +3 -3
- package/src/plugins/form-builder-plugin/components/fields-part.tsx +2 -2
- package/src/plugins/form-builder-plugin/components/follow-up.tsx +2 -2
- package/src/plugins/form-filling-plugin/components/FormFillingOpeningLines.tsx +1 -1
- package/src/plugins/form-filling-plugin/components/avatar.tsx +2 -2
- package/src/plugins/form-filling-plugin/components/batch-generator-action.tsx +1 -1
- package/src/plugins/form-filling-plugin/components/entry-btn.tsx +3 -3
- package/src/plugins/form-filling-plugin/components/first-batch-generating-animation.tsx +2 -2
- package/src/plugins/form-filling-plugin/components/generated-data-counter.tsx +1 -1
- package/src/plugins/form-filling-plugin/components/mode-select.tsx +1 -1
- package/src/plugins/form-filling-plugin/components/non-first-batch-generating-animation.tsx +3 -3
- package/src/plugins/form-filling-plugin/components/single-fill-part.tsx +1 -1
- package/src/plugins/report-query-plugin/components/avatar.tsx +2 -2
- package/src/plugins/report-query-plugin/components/query-entry-btn.tsx +2 -2
- package/src/plugins/report-query-plugin/components/query-opening-lines.tsx +1 -1
- package/src/plugins/report-query-plugin/components/result-cards/CreatedSourceMsg.tsx +1 -1
- package/src/plugins/report-query-plugin/components/result-cards/DataTableCard.tsx +3 -3
- package/src/plugins/report-query-plugin/components/result-cards/DataTableFields.tsx +3 -3
- package/src/plugins/report-query-plugin/components/result-cards/FormulaField.tsx +2 -2
- package/src/plugins/report-query-plugin/const.ts +1 -1
- package/src/style.css +2 -0
- package/tsconfig.json +5 -5
- package/src/components/bs-ui/abs-fullscreen-gradient-bg.tsx +0 -35
- package/src/components/bs-ui/attachment-part-group.tsx +0 -35
- package/src/components/bs-ui/attachment-part.tsx +0 -179
- package/src/components/bs-ui/attachments-previewer.tsx +0 -324
- package/src/components/bs-ui/base-button.tsx +0 -49
- package/src/components/bs-ui/border-animation.tsx +0 -107
- package/src/components/bs-ui/border-color-animation.tsx +0 -66
- package/src/components/bs-ui/bot-avatar-name.tsx +0 -25
- package/src/components/bs-ui/bot-icon.tsx +0 -23
- package/src/components/bs-ui/bs-icons.tsx +0 -1115
- package/src/components/bs-ui/card-field.tsx +0 -23
- package/src/components/bs-ui/card.tsx +0 -36
- package/src/components/bs-ui/chat-area-header.tsx +0 -65
- package/src/components/bs-ui/circle-checker.tsx +0 -66
- package/src/components/bs-ui/collapsible-txt-msg.tsx +0 -63
- package/src/components/bs-ui/confirm-dialog.tsx +0 -139
- package/src/components/bs-ui/fields-design-info-table.tsx +0 -160
- package/src/components/bs-ui/fields-generating-indicator.tsx +0 -95
- package/src/components/bs-ui/fields-portal.tsx +0 -18
- package/src/components/bs-ui/fields-previewer.tsx +0 -210
- package/src/components/bs-ui/font-icon.tsx +0 -17
- package/src/components/bs-ui/form-info-editor.tsx +0 -259
- package/src/components/bs-ui/formula-tag.tsx +0 -32
- package/src/components/bs-ui/generate-animation.tsx +0 -56
- package/src/components/bs-ui/icon-btn.tsx +0 -43
- package/src/components/bs-ui/img-part.tsx +0 -27
- package/src/components/bs-ui/line-checker.tsx +0 -160
- package/src/components/bs-ui/linear-gradient-border-btn.tsx +0 -48
- package/src/components/bs-ui/linear-gradient-color-bg-animation.tsx +0 -103
- package/src/components/bs-ui/number-part.tsx +0 -46
- package/src/components/bs-ui/option-item.tsx +0 -28
- package/src/components/bs-ui/previewer-header.tsx +0 -233
- package/src/components/bs-ui/primary-confirm-btn.tsx +0 -58
- package/src/components/bs-ui/primary-entry-btn.tsx +0 -48
- package/src/components/bs-ui/scroll-to-bottom-btn.tsx +0 -28
- package/src/components/bs-ui/split-line.tsx +0 -9
- package/src/components/bs-ui/square-checker.tsx +0 -87
- package/src/components/bs-ui/tab-radio-group.tsx +0 -82
- package/src/components/bs-ui/tooltip.tsx +0 -53
- package/src/components/bs-ui/user-txt-msg-bubble.tsx +0 -19
- package/src/components/bs-ui/warning-msg.tsx +0 -27
- package/src/stories/AbsFullscreenGradientBg.stories.tsx +0 -36
- package/src/stories/AttachmentPart.stories.tsx +0 -122
- package/src/stories/AttachmentPartGroup.stories.tsx +0 -151
- package/src/stories/AttachmentsPreviewer.stories.tsx +0 -306
- package/src/stories/BaseButton.stories.tsx +0 -33
- package/src/stories/BorderAnimation.stories.tsx +0 -116
- package/src/stories/BorderColorAnimation.stories.tsx +0 -63
- package/src/stories/BotAvatarAndName.stories.ts +0 -24
- package/src/stories/BotIcon.stories.ts +0 -22
- package/src/stories/BsTooltip.stories.tsx +0 -32
- package/src/stories/Card.stories.tsx +0 -28
- package/src/stories/CardField.stories.tsx +0 -87
- package/src/stories/ChatAreaHeader.stories.ts +0 -26
- package/src/stories/CircleChecker.stories.tsx +0 -89
- package/src/stories/CollapsibleTextMsg.stories.ts +0 -44
- package/src/stories/ConfirmDialog.stories.tsx +0 -123
- package/src/stories/DashWidgetIcon.stories.tsx +0 -132
- package/src/stories/FormInfoEditor.stories.tsx +0 -173
- package/src/stories/FormulaTag.stories.tsx +0 -68
- package/src/stories/GenerateAnimation.stories.ts +0 -20
- package/src/stories/IconBtn.stories.tsx +0 -32
- package/src/stories/IconLib.tsx +0 -45
- package/src/stories/Icons.stories.ts +0 -22
- package/src/stories/ImgMsgPart.stories.tsx +0 -42
- package/src/stories/LineChecker.stories.tsx +0 -134
- package/src/stories/LinearGradientBorderBtn.stories.tsx +0 -86
- package/src/stories/LinearGradientColorBgAnimation.stories.tsx +0 -60
- package/src/stories/NumbersMsgPart.stories.tsx +0 -42
- package/src/stories/OptionItem.stories.tsx +0 -77
- package/src/stories/PreviewerHeader.stories.tsx +0 -91
- package/src/stories/PrimaryConfirmBtn.stories.tsx +0 -60
- package/src/stories/PrimaryEntryBtn.stories.tsx +0 -74
- package/src/stories/ScrollToBottom.stories.tsx +0 -24
- package/src/stories/SplitLine.stories.tsx +0 -40
- package/src/stories/SquareChecker.stories.tsx +0 -96
- package/src/stories/TabRadioGroup.stories.tsx +0 -84
- package/src/stories/UserTextMsgBubble.stories.ts +0 -24
- package/src/stories/WarningMessage.stories.tsx +0 -23
- package/src/stories/assets/accessibility.png +0 -0
- package/src/stories/assets/accessibility.svg +0 -1
- package/src/stories/assets/addon-library.png +0 -0
- package/src/stories/assets/assets.png +0 -0
- package/src/stories/assets/avif-test-image.avif +0 -0
- package/src/stories/assets/context.png +0 -0
- package/src/stories/assets/demo.css +0 -539
- package/src/stories/assets/demo_index.html +0 -7988
- package/src/stories/assets/discord.svg +0 -1
- package/src/stories/assets/docs.png +0 -0
- package/src/stories/assets/figma-plugin.png +0 -0
- package/src/stories/assets/github.svg +0 -1
- package/src/stories/assets/iconfont.css +0 -1377
- package/src/stories/assets/iconfont.eot +0 -0
- package/src/stories/assets/iconfont.json +0 -2382
- package/src/stories/assets/iconfont.svg +0 -697
- package/src/stories/assets/iconfont.ttf +0 -0
- package/src/stories/assets/iconfont.woff +0 -0
- package/src/stories/assets/iconfont.woff2 +0 -0
- package/src/stories/assets/share.png +0 -0
- package/src/stories/assets/styling.png +0 -0
- package/src/stories/assets/testing.png +0 -0
- package/src/stories/assets/theming.png +0 -0
- package/src/stories/assets/tutorials.svg +0 -1
- package/src/stories/assets/youtube.svg +0 -1
- package/src/stories/fields-design-info-table.stories.tsx +0 -203
- package/src/stories/fields-generating.stories.tsx +0 -41
- package/src/stories/fields-previewer.stories.tsx +0 -77
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
-
|
|
3
|
-
import { CardField } from '@/components/bs-ui/card-field';
|
|
4
|
-
|
|
5
|
-
const meta: Meta<typeof CardField> = {
|
|
6
|
-
title: 'Example/Chat/CardField',
|
|
7
|
-
component: CardField,
|
|
8
|
-
tags: ['autodocs'],
|
|
9
|
-
parameters: {
|
|
10
|
-
layout: 'centered',
|
|
11
|
-
},
|
|
12
|
-
args: {},
|
|
13
|
-
decorators: [
|
|
14
|
-
(Story) => (
|
|
15
|
-
<div className="w-[400px]">
|
|
16
|
-
<Story />
|
|
17
|
-
</div>
|
|
18
|
-
),
|
|
19
|
-
],
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
export default meta;
|
|
23
|
-
type Story = StoryObj<typeof CardField>;
|
|
24
|
-
|
|
25
|
-
// 基础用法
|
|
26
|
-
export const Base: Story = {
|
|
27
|
-
args: {
|
|
28
|
-
label: '维度(行)',
|
|
29
|
-
children: '仓库、产品名称、产品编码、日期(年-月)',
|
|
30
|
-
},
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
// label 过长省略展示
|
|
34
|
-
export const LongLabel: Story = {
|
|
35
|
-
args: {
|
|
36
|
-
label: '这是一个非常长的标签文字需要省略展示',
|
|
37
|
-
children: '内容区域',
|
|
38
|
-
},
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
// 无 children 时显示「无」
|
|
42
|
-
export const NoChildren: Story = {
|
|
43
|
-
args: {
|
|
44
|
-
label: '空字段',
|
|
45
|
-
},
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
// children 为空字符串
|
|
49
|
-
export const EmptyChildren: Story = {
|
|
50
|
-
args: {
|
|
51
|
-
label: '字段名称',
|
|
52
|
-
children: '',
|
|
53
|
-
},
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
// children 内容较长换行展示
|
|
57
|
-
export const LongContent: Story = {
|
|
58
|
-
args: {
|
|
59
|
-
label: '详细描述',
|
|
60
|
-
children:
|
|
61
|
-
'这是一段很长的内容,用于测试换行效果。内容区域支持自动换行,确保文字不会溢出容器,保持良好的阅读体验。',
|
|
62
|
-
},
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
// 多个 CardField 组合使用
|
|
66
|
-
export const MultipleFields: Story = {
|
|
67
|
-
args: {
|
|
68
|
-
label: '维度(行)',
|
|
69
|
-
children: '仓库、产品名称、产品编码、日期(年-月)',
|
|
70
|
-
},
|
|
71
|
-
render: () => (
|
|
72
|
-
<div className="flex flex-col gap-2">
|
|
73
|
-
<CardField label="维度(行)">仓库、产品名称、产品编码、日期(年-月)</CardField>
|
|
74
|
-
<CardField label="维度(列)">产品类别</CardField>
|
|
75
|
-
<CardField label="指标">销售额、销售量、库存量</CardField>
|
|
76
|
-
<CardField label="筛选条件" />
|
|
77
|
-
</div>
|
|
78
|
-
),
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
// children 为自定义 ReactNode
|
|
82
|
-
export const CustomChildren: Story = {
|
|
83
|
-
args: {
|
|
84
|
-
label: '状态',
|
|
85
|
-
children: <span className="text-green-500 font-medium">已完成</span>,
|
|
86
|
-
},
|
|
87
|
-
};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
2
|
-
|
|
3
|
-
// import { Header } from "./Header";
|
|
4
|
-
import { ChatAreaHeader } from "@/components/bs-ui/chat-area-header";
|
|
5
|
-
|
|
6
|
-
const meta = {
|
|
7
|
-
title: "Example/Chat/ChatAreaHeader",
|
|
8
|
-
component: ChatAreaHeader,
|
|
9
|
-
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs
|
|
10
|
-
tags: ["autodocs"],
|
|
11
|
-
parameters: {
|
|
12
|
-
// More on how to position stories at: https://storybook.js.org/docs/configure/story-layout
|
|
13
|
-
layout: "centered",
|
|
14
|
-
},
|
|
15
|
-
args: {},
|
|
16
|
-
} satisfies Meta<typeof ChatAreaHeader>;
|
|
17
|
-
|
|
18
|
-
export default meta;
|
|
19
|
-
type Story = StoryObj<typeof meta>;
|
|
20
|
-
|
|
21
|
-
export const Base: Story = {
|
|
22
|
-
args: {
|
|
23
|
-
title: "TEST",
|
|
24
|
-
width: 0,
|
|
25
|
-
},
|
|
26
|
-
};
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
-
import { useState } from 'react';
|
|
3
|
-
|
|
4
|
-
import { CircleChecker } from '@/components/bs-ui/circle-checker';
|
|
5
|
-
|
|
6
|
-
const meta = {
|
|
7
|
-
title: 'Example/Chat/CircleChecker',
|
|
8
|
-
component: CircleChecker,
|
|
9
|
-
tags: ['autodocs'],
|
|
10
|
-
parameters: {
|
|
11
|
-
layout: 'centered',
|
|
12
|
-
},
|
|
13
|
-
args: {},
|
|
14
|
-
} satisfies Meta<typeof CircleChecker>;
|
|
15
|
-
|
|
16
|
-
export default meta;
|
|
17
|
-
type Story = StoryObj<typeof meta>;
|
|
18
|
-
|
|
19
|
-
export const Default: Story = {
|
|
20
|
-
args: {
|
|
21
|
-
children: 'TEST',
|
|
22
|
-
},
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
export const Checked: Story = {
|
|
26
|
-
args: {
|
|
27
|
-
defaultChecked: true,
|
|
28
|
-
children: 'TEST',
|
|
29
|
-
},
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
export const Unchecked: Story = {
|
|
33
|
-
args: {
|
|
34
|
-
defaultChecked: false,
|
|
35
|
-
children: 'TEST',
|
|
36
|
-
},
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
export const WithoutLabel: Story = {
|
|
40
|
-
args: {
|
|
41
|
-
defaultChecked: true,
|
|
42
|
-
},
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
export const Disabled: Story = {
|
|
46
|
-
args: {
|
|
47
|
-
disabled: true,
|
|
48
|
-
children: 'Disabled',
|
|
49
|
-
},
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
export const DisabledChecked: Story = {
|
|
53
|
-
args: {
|
|
54
|
-
disabled: true,
|
|
55
|
-
defaultChecked: true,
|
|
56
|
-
children: 'Disabled Checked',
|
|
57
|
-
},
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
const ControlledComponent = () => {
|
|
61
|
-
const [checked, setChecked] = useState(false);
|
|
62
|
-
return (
|
|
63
|
-
<div className="flex flex-col gap-4">
|
|
64
|
-
<CircleChecker checked={checked} onCheckedChange={setChecked}>
|
|
65
|
-
Controlled: {checked ? 'Checked' : 'Unchecked'}
|
|
66
|
-
</CircleChecker>
|
|
67
|
-
<button
|
|
68
|
-
className="px-3 py-1 bg-gray-200 rounded text-sm"
|
|
69
|
-
onClick={() => setChecked(!checked)}
|
|
70
|
-
>
|
|
71
|
-
Toggle from outside
|
|
72
|
-
</button>
|
|
73
|
-
</div>
|
|
74
|
-
);
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
export const Controlled: Story = {
|
|
78
|
-
render: () => <ControlledComponent />,
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
export const MultipleOptions: Story = {
|
|
82
|
-
render: () => (
|
|
83
|
-
<div className="flex flex-col gap-2">
|
|
84
|
-
<CircleChecker>Option A</CircleChecker>
|
|
85
|
-
<CircleChecker>Option B</CircleChecker>
|
|
86
|
-
<CircleChecker defaultChecked>Option C (default checked)</CircleChecker>
|
|
87
|
-
</div>
|
|
88
|
-
),
|
|
89
|
-
};
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
2
|
-
|
|
3
|
-
import { CollapsibleTxtMsg } from "@/components/bs-ui/collapsible-txt-msg";
|
|
4
|
-
|
|
5
|
-
const meta = {
|
|
6
|
-
title: "Example/Chat/CollapsibleTxtMsg",
|
|
7
|
-
component: CollapsibleTxtMsg,
|
|
8
|
-
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs
|
|
9
|
-
tags: ["autodocs"],
|
|
10
|
-
parameters: {
|
|
11
|
-
// More on how to position stories at: https://storybook.js.org/docs/configure/story-layout
|
|
12
|
-
layout: "centered",
|
|
13
|
-
},
|
|
14
|
-
args: {},
|
|
15
|
-
} satisfies Meta<typeof CollapsibleTxtMsg>;
|
|
16
|
-
|
|
17
|
-
export default meta;
|
|
18
|
-
type Story = StoryObj<typeof meta>;
|
|
19
|
-
|
|
20
|
-
export const Base: Story = {
|
|
21
|
-
args: {
|
|
22
|
-
title: "表单分析",
|
|
23
|
-
content:
|
|
24
|
-
"一些文字描述,字段分析\n设计说明:表单按供应商管理逻辑设计,先填写供应商基础信息(ID、名称、联系人等),再通过子表单填写关联的产品信息(名称、型号、单价等),最后留备注补充。核心字段均设为必填确保信息完整。?试试下面建议吧!",
|
|
25
|
-
defaultOpen: true,
|
|
26
|
-
},
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
export const Collapsed: Story = {
|
|
30
|
-
args: {
|
|
31
|
-
title: "表单分析",
|
|
32
|
-
content:
|
|
33
|
-
"一些文字描述,字段分析\n设计说明:表单按供应商管理逻辑设计,先填写供应商基础信息(ID、名称、联系人等),再通过子表单填写关联的产品信息(名称、型号、单价等),最后留备注补充。核心字段均设为必填确保信息完整。?试试下面建议吧!",
|
|
34
|
-
defaultOpen: false,
|
|
35
|
-
},
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
export const ShortContent: Story = {
|
|
39
|
-
args: {
|
|
40
|
-
title: "简短说明",
|
|
41
|
-
content: "这是一个简短的内容示例。",
|
|
42
|
-
defaultOpen: true,
|
|
43
|
-
},
|
|
44
|
-
};
|
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
-
import { useState } from 'react';
|
|
3
|
-
import { ConfirmDialog } from '@/components/bs-ui/confirm-dialog';
|
|
4
|
-
|
|
5
|
-
const meta = {
|
|
6
|
-
title: 'Example/Chat/ConfirmDialog',
|
|
7
|
-
component: ConfirmDialog,
|
|
8
|
-
tags: ['autodocs'],
|
|
9
|
-
parameters: {
|
|
10
|
-
layout: 'centered',
|
|
11
|
-
},
|
|
12
|
-
args: {
|
|
13
|
-
open: true,
|
|
14
|
-
title: 'AI表单搭建有修改,是否保存?',
|
|
15
|
-
description: '您修改了AI表单搭建但没有保存,是否需要保存并继续?',
|
|
16
|
-
},
|
|
17
|
-
argTypes: {
|
|
18
|
-
open: { control: 'boolean' },
|
|
19
|
-
title: { control: 'text' },
|
|
20
|
-
description: { control: 'text' },
|
|
21
|
-
linkText: { control: 'text' },
|
|
22
|
-
cancelText: { control: 'text' },
|
|
23
|
-
confirmText: { control: 'text' },
|
|
24
|
-
showLink: { control: 'boolean' },
|
|
25
|
-
showCancel: { control: 'boolean' },
|
|
26
|
-
onLinkClick: { action: 'onLinkClick' },
|
|
27
|
-
onCancel: { action: 'onCancel' },
|
|
28
|
-
onConfirm: { action: 'onConfirm' },
|
|
29
|
-
onOpenChange: { action: 'onOpenChange' },
|
|
30
|
-
},
|
|
31
|
-
} satisfies Meta<typeof ConfirmDialog>;
|
|
32
|
-
|
|
33
|
-
export default meta;
|
|
34
|
-
type Story = StoryObj<typeof meta>;
|
|
35
|
-
|
|
36
|
-
// Default story matching the Figma design
|
|
37
|
-
export const Default: Story = {
|
|
38
|
-
args: {
|
|
39
|
-
open: true,
|
|
40
|
-
title: 'AI表单搭建有修改,是否保存?',
|
|
41
|
-
description: '您修改了AI表单搭建但没有保存,是否需要保存并继续?',
|
|
42
|
-
linkText: '留在此页',
|
|
43
|
-
cancelText: '不保存',
|
|
44
|
-
confirmText: '保存并继续',
|
|
45
|
-
},
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
// Without link button
|
|
49
|
-
export const WithoutLink: Story = {
|
|
50
|
-
args: {
|
|
51
|
-
open: true,
|
|
52
|
-
title: '确认删除?',
|
|
53
|
-
description: '删除后将无法恢复,请确认是否继续。',
|
|
54
|
-
showLink: false,
|
|
55
|
-
cancelText: '取消',
|
|
56
|
-
confirmText: '删除',
|
|
57
|
-
},
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
// Without cancel button
|
|
61
|
-
export const WithoutCancel: Story = {
|
|
62
|
-
args: {
|
|
63
|
-
open: true,
|
|
64
|
-
title: '操作成功',
|
|
65
|
-
description: '您的更改已保存。',
|
|
66
|
-
showLink: false,
|
|
67
|
-
showCancel: false,
|
|
68
|
-
confirmText: '确定',
|
|
69
|
-
},
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
// Simple confirmation
|
|
73
|
-
export const SimpleConfirm: Story = {
|
|
74
|
-
args: {
|
|
75
|
-
open: true,
|
|
76
|
-
title: '确认退出?',
|
|
77
|
-
description: '退出后未保存的内容将会丢失。',
|
|
78
|
-
showLink: false,
|
|
79
|
-
cancelText: '取消',
|
|
80
|
-
confirmText: '确认退出',
|
|
81
|
-
},
|
|
82
|
-
};
|
|
83
|
-
|
|
84
|
-
// Interactive example with state management
|
|
85
|
-
const InteractiveDialogWrapper = () => {
|
|
86
|
-
const [open, setOpen] = useState(false);
|
|
87
|
-
|
|
88
|
-
return (
|
|
89
|
-
<div>
|
|
90
|
-
<button
|
|
91
|
-
onClick={() => setOpen(true)}
|
|
92
|
-
className="px-4 py-2 bg-[#0265ff] text-white rounded cursor-pointer"
|
|
93
|
-
>
|
|
94
|
-
打开对话框
|
|
95
|
-
</button>
|
|
96
|
-
<ConfirmDialog
|
|
97
|
-
open={open}
|
|
98
|
-
onOpenChange={setOpen}
|
|
99
|
-
title="AI表单搭建有修改,是否保存?"
|
|
100
|
-
description="您修改了AI表单搭建但没有保存,是否需要保存并继续?"
|
|
101
|
-
onLinkClick={() => {
|
|
102
|
-
console.log('Link clicked');
|
|
103
|
-
setOpen(false);
|
|
104
|
-
}}
|
|
105
|
-
onCancel={() => {
|
|
106
|
-
console.log('Cancel clicked');
|
|
107
|
-
setOpen(false);
|
|
108
|
-
}}
|
|
109
|
-
onConfirm={() => {
|
|
110
|
-
console.log('Confirm clicked');
|
|
111
|
-
setOpen(false);
|
|
112
|
-
}}
|
|
113
|
-
/>
|
|
114
|
-
</div>
|
|
115
|
-
);
|
|
116
|
-
};
|
|
117
|
-
|
|
118
|
-
export const Interactive: Story = {
|
|
119
|
-
render: () => <InteractiveDialogWrapper />,
|
|
120
|
-
args: {
|
|
121
|
-
open: false,
|
|
122
|
-
},
|
|
123
|
-
};
|
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
-
import { IDashWidgetType } from '@baishuyun/types';
|
|
3
|
-
import { DashWidgetIcon } from '@/components/biz-comp/dash-widget-icon';
|
|
4
|
-
|
|
5
|
-
const DASH_WIDGET_TYPES: IDashWidgetType[] = [
|
|
6
|
-
'metric_table',
|
|
7
|
-
'gauge_chart',
|
|
8
|
-
'column_chart',
|
|
9
|
-
'funnel_chart',
|
|
10
|
-
'line_chart',
|
|
11
|
-
'pie_chart',
|
|
12
|
-
'area_chart',
|
|
13
|
-
'radar_chart',
|
|
14
|
-
'bar_chart',
|
|
15
|
-
'gantt',
|
|
16
|
-
'multi_axes_chart',
|
|
17
|
-
'data_table',
|
|
18
|
-
'background_table',
|
|
19
|
-
'pivot_table',
|
|
20
|
-
'map_chart',
|
|
21
|
-
'newMap',
|
|
22
|
-
'card',
|
|
23
|
-
'rili',
|
|
24
|
-
'description',
|
|
25
|
-
'image',
|
|
26
|
-
'gauge_imageMore',
|
|
27
|
-
];
|
|
28
|
-
|
|
29
|
-
const DASH_WIDGET_TYPE_LABEL: Record<IDashWidgetType, string> = {
|
|
30
|
-
metric_table: '指标图',
|
|
31
|
-
gauge_chart: '仪表盘',
|
|
32
|
-
column_chart: '柱形图',
|
|
33
|
-
funnel_chart: '漏斗图',
|
|
34
|
-
line_chart: '折线图',
|
|
35
|
-
pie_chart: '饼图',
|
|
36
|
-
area_chart: '面积图',
|
|
37
|
-
radar_chart: '雷达图',
|
|
38
|
-
bar_chart: '条形图',
|
|
39
|
-
gantt: '甘特图',
|
|
40
|
-
multi_axes_chart: '双轴图',
|
|
41
|
-
data_table: '数据表',
|
|
42
|
-
background_table: '背景表',
|
|
43
|
-
pivot_table: '透视图',
|
|
44
|
-
map_chart: '地图',
|
|
45
|
-
newMap: '新地图',
|
|
46
|
-
card: '卡片',
|
|
47
|
-
rili: '日历',
|
|
48
|
-
description: '富文本',
|
|
49
|
-
image: '图片',
|
|
50
|
-
gauge_imageMore: '仪表盘更多',
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
const meta: Meta<typeof DashWidgetIcon> = {
|
|
54
|
-
title: 'Example/Icons/DashWidgetIcon',
|
|
55
|
-
component: DashWidgetIcon,
|
|
56
|
-
tags: ['autodocs'],
|
|
57
|
-
parameters: {
|
|
58
|
-
layout: 'centered',
|
|
59
|
-
},
|
|
60
|
-
argTypes: {
|
|
61
|
-
type: {
|
|
62
|
-
control: 'select',
|
|
63
|
-
options: DASH_WIDGET_TYPES,
|
|
64
|
-
},
|
|
65
|
-
},
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
export default meta;
|
|
69
|
-
type Story = StoryObj<typeof DashWidgetIcon>;
|
|
70
|
-
|
|
71
|
-
// 默认:指标图
|
|
72
|
-
export const MetricTable: Story = {
|
|
73
|
-
args: { type: 'metric_table' },
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
// 仪表盘
|
|
77
|
-
export const GaugeChart: Story = {
|
|
78
|
-
args: { type: 'gauge_chart' },
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
// 柱形图
|
|
82
|
-
export const ColumnChart: Story = {
|
|
83
|
-
args: { type: 'column_chart' },
|
|
84
|
-
};
|
|
85
|
-
|
|
86
|
-
// 折线图
|
|
87
|
-
export const LineChart: Story = {
|
|
88
|
-
args: { type: 'line_chart' },
|
|
89
|
-
};
|
|
90
|
-
|
|
91
|
-
// 饼图
|
|
92
|
-
export const PieChart: Story = {
|
|
93
|
-
args: { type: 'pie_chart' },
|
|
94
|
-
};
|
|
95
|
-
|
|
96
|
-
// 条形图
|
|
97
|
-
export const BarChart: Story = {
|
|
98
|
-
args: { type: 'bar_chart' },
|
|
99
|
-
};
|
|
100
|
-
|
|
101
|
-
// 所有图标类型一览
|
|
102
|
-
export const AllTypes: Story = {
|
|
103
|
-
args: { type: 'metric_table' },
|
|
104
|
-
render: () => (
|
|
105
|
-
<div
|
|
106
|
-
style={{
|
|
107
|
-
display: 'grid',
|
|
108
|
-
gridTemplateColumns: 'repeat(4, 1fr)',
|
|
109
|
-
gap: '16px',
|
|
110
|
-
}}
|
|
111
|
-
>
|
|
112
|
-
{DASH_WIDGET_TYPES.map((t) => (
|
|
113
|
-
<div
|
|
114
|
-
key={t}
|
|
115
|
-
style={{
|
|
116
|
-
display: 'flex',
|
|
117
|
-
flexDirection: 'column',
|
|
118
|
-
alignItems: 'center',
|
|
119
|
-
gap: '4px',
|
|
120
|
-
padding: '12px',
|
|
121
|
-
border: '1px solid #eee',
|
|
122
|
-
borderRadius: '8px',
|
|
123
|
-
}}
|
|
124
|
-
>
|
|
125
|
-
<DashWidgetIcon type={t} style={{ fontSize: 24 }} />
|
|
126
|
-
<span style={{ fontSize: 12, color: '#666' }}>{DASH_WIDGET_TYPE_LABEL[t]}</span>
|
|
127
|
-
<span style={{ fontSize: 10, color: '#aaa' }}>{t}</span>
|
|
128
|
-
</div>
|
|
129
|
-
))}
|
|
130
|
-
</div>
|
|
131
|
-
),
|
|
132
|
-
};
|
|
@@ -1,173 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
-
import { useState } from 'react';
|
|
3
|
-
|
|
4
|
-
import { FormInfoEditor, FormIconOption } from '@/components/bs-ui/form-info-editor';
|
|
5
|
-
import { FORM_ICON_OPTIONS } from '@/const/ui';
|
|
6
|
-
|
|
7
|
-
const meta: Meta<typeof FormInfoEditor> = {
|
|
8
|
-
title: 'Example/Chat/FormInfoEditor',
|
|
9
|
-
component: FormInfoEditor,
|
|
10
|
-
tags: ['autodocs'],
|
|
11
|
-
parameters: {
|
|
12
|
-
layout: 'centered',
|
|
13
|
-
},
|
|
14
|
-
args: {
|
|
15
|
-
name: '供应商管理表',
|
|
16
|
-
},
|
|
17
|
-
decorators: [
|
|
18
|
-
(Story) => (
|
|
19
|
-
<div className="w-[328px]">
|
|
20
|
-
<Story />
|
|
21
|
-
</div>
|
|
22
|
-
),
|
|
23
|
-
],
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
export default meta;
|
|
27
|
-
type Story = StoryObj<typeof meta>;
|
|
28
|
-
|
|
29
|
-
// Default collapsed state
|
|
30
|
-
export const Default: Story = {
|
|
31
|
-
args: {
|
|
32
|
-
name: '供应商管理表',
|
|
33
|
-
selectedIcon: FORM_ICON_OPTIONS[0],
|
|
34
|
-
},
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
// Expanded edit state
|
|
38
|
-
export const Expanded: Story = {
|
|
39
|
-
args: {
|
|
40
|
-
name: '供应商管理表',
|
|
41
|
-
expanded: true,
|
|
42
|
-
selectedIcon: FORM_ICON_OPTIONS[0],
|
|
43
|
-
},
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
// With icon options in expanded state (using all 36 form icons)
|
|
47
|
-
export const WithIconOptions: Story = {
|
|
48
|
-
args: {
|
|
49
|
-
name: '供应商管理表',
|
|
50
|
-
expanded: true,
|
|
51
|
-
iconOptions: FORM_ICON_OPTIONS,
|
|
52
|
-
selectedIcon: FORM_ICON_OPTIONS[20],
|
|
53
|
-
},
|
|
54
|
-
decorators: [
|
|
55
|
-
(Story) => (
|
|
56
|
-
<div className="w-[360px]">
|
|
57
|
-
<Story />
|
|
58
|
-
</div>
|
|
59
|
-
),
|
|
60
|
-
],
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
// Interactive example with state management
|
|
64
|
-
const InteractiveTemplate = () => {
|
|
65
|
-
const [name, setName] = useState('供应商管理表');
|
|
66
|
-
const [expanded, setExpanded] = useState(false);
|
|
67
|
-
const [selectedIcon, setSelectedIcon] = useState<FormIconOption>(FORM_ICON_OPTIONS[0]);
|
|
68
|
-
|
|
69
|
-
return (
|
|
70
|
-
<FormInfoEditor
|
|
71
|
-
name={name}
|
|
72
|
-
onNameChange={setName}
|
|
73
|
-
expanded={expanded}
|
|
74
|
-
onExpandedChange={setExpanded}
|
|
75
|
-
iconOptions={FORM_ICON_OPTIONS}
|
|
76
|
-
selectedIcon={selectedIcon}
|
|
77
|
-
onIconChange={setSelectedIcon}
|
|
78
|
-
onConfirm={() => {
|
|
79
|
-
alert(`表单名称: ${name}\n图标: ${selectedIcon.label}`);
|
|
80
|
-
}}
|
|
81
|
-
/>
|
|
82
|
-
);
|
|
83
|
-
};
|
|
84
|
-
|
|
85
|
-
export const Interactive: Story = {
|
|
86
|
-
render: () => <InteractiveTemplate />,
|
|
87
|
-
decorators: [
|
|
88
|
-
(Story) => (
|
|
89
|
-
<div className="w-[360px]">
|
|
90
|
-
<Story />
|
|
91
|
-
</div>
|
|
92
|
-
),
|
|
93
|
-
],
|
|
94
|
-
};
|
|
95
|
-
|
|
96
|
-
// Long form name - test ellipsis
|
|
97
|
-
export const LongName: Story = {
|
|
98
|
-
args: {
|
|
99
|
-
name: '这是一个很长的表单名称用于测试文本溢出情况显示省略号',
|
|
100
|
-
selectedIcon: FORM_ICON_OPTIONS[5],
|
|
101
|
-
},
|
|
102
|
-
};
|
|
103
|
-
|
|
104
|
-
// Custom width
|
|
105
|
-
export const CustomWidth: Story = {
|
|
106
|
-
args: {
|
|
107
|
-
name: '供应商管理表',
|
|
108
|
-
className: 'w-[400px]',
|
|
109
|
-
selectedIcon: FORM_ICON_OPTIONS[0],
|
|
110
|
-
},
|
|
111
|
-
decorators: [
|
|
112
|
-
(Story) => (
|
|
113
|
-
<div className="w-[420px]">
|
|
114
|
-
<Story />
|
|
115
|
-
</div>
|
|
116
|
-
),
|
|
117
|
-
],
|
|
118
|
-
};
|
|
119
|
-
|
|
120
|
-
// Expanded with long name
|
|
121
|
-
export const ExpandedLongName: Story = {
|
|
122
|
-
args: {
|
|
123
|
-
name: '这是一个很长的表单名称用于测试文本溢出情况',
|
|
124
|
-
expanded: true,
|
|
125
|
-
iconOptions: FORM_ICON_OPTIONS.slice(0, 18), // Show 18 icons (3 rows)
|
|
126
|
-
selectedIcon: FORM_ICON_OPTIONS[0],
|
|
127
|
-
},
|
|
128
|
-
};
|
|
129
|
-
|
|
130
|
-
// Empty name
|
|
131
|
-
export const EmptyName: Story = {
|
|
132
|
-
args: {
|
|
133
|
-
name: '',
|
|
134
|
-
expanded: true,
|
|
135
|
-
selectedIcon: FORM_ICON_OPTIONS[0],
|
|
136
|
-
},
|
|
137
|
-
};
|
|
138
|
-
|
|
139
|
-
// Side by side comparison
|
|
140
|
-
export const SideBySide: Story = {
|
|
141
|
-
render: () => (
|
|
142
|
-
<div className="flex flex-col gap-4 w-[328px]">
|
|
143
|
-
<div>
|
|
144
|
-
<p className="text-sm text-gray-500 mb-2">默认状态 (收起)</p>
|
|
145
|
-
<FormInfoEditor name="供应商管理表" expanded={false} selectedIcon={FORM_ICON_OPTIONS[0]} />
|
|
146
|
-
</div>
|
|
147
|
-
<div>
|
|
148
|
-
<p className="text-sm text-gray-500 mb-2">长名称 (带省略号)</p>
|
|
149
|
-
<FormInfoEditor
|
|
150
|
-
name="这是一个超长的表单名称用于测试省略号效果"
|
|
151
|
-
expanded={false}
|
|
152
|
-
selectedIcon={FORM_ICON_OPTIONS[10]}
|
|
153
|
-
/>
|
|
154
|
-
</div>
|
|
155
|
-
<div>
|
|
156
|
-
<p className="text-sm text-gray-500 mb-2">展开状态 (编辑)</p>
|
|
157
|
-
<FormInfoEditor
|
|
158
|
-
name="供应商管理表"
|
|
159
|
-
expanded={true}
|
|
160
|
-
iconOptions={FORM_ICON_OPTIONS}
|
|
161
|
-
selectedIcon={FORM_ICON_OPTIONS[5]}
|
|
162
|
-
/>
|
|
163
|
-
</div>
|
|
164
|
-
</div>
|
|
165
|
-
),
|
|
166
|
-
decorators: [
|
|
167
|
-
(Story) => (
|
|
168
|
-
<div className="w-[380px]">
|
|
169
|
-
<Story />
|
|
170
|
-
</div>
|
|
171
|
-
),
|
|
172
|
-
],
|
|
173
|
-
};
|