cx-chat 0.0.1
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/.cursor/rules/i18n-cn-gloss-comments.mdc +31 -0
- package/.cursor/rules/list-page-view-pageconfig.mdc +32 -0
- package/.cursor/rules/no-over-defensive-programming.mdc +90 -0
- package/.cursor/rules/requirement-description-for-agent.mdc +33 -0
- package/.cursor/rules/use-showToast-not-antd-message.mdc +28 -0
- package/.docker/Dockerfile +7 -0
- package/.env +9 -0
- package/.env.development +7 -0
- package/.env.production +7 -0
- package/.gitlab-ci/docker-build.yaml +28 -0
- package/.gitlab-ci/k8s-deploy-dev-master.yaml +42 -0
- package/.gitlab-ci/npm-build.yaml +17 -0
- package/.gitlab-ci.yml +8 -0
- package/.k8s/0-namespace.yaml +6 -0
- package/.k8s/1-configmap-web.yaml +7 -0
- package/.k8s/1-nginx-conf-dev.yaml +110 -0
- package/.k8s/2-deployment.yaml +27 -0
- package/.k8s/3-service.yaml +16 -0
- package/.k8s/4-ingress-dev.yaml +30 -0
- package/.lingma/rules/use-showToast-not-antd-message.md +34 -0
- package/.nginx/nginx.conf +52 -0
- package/.prettierrc +9 -0
- package/README.md +1 -0
- package/eslint.config.js +32 -0
- package/index.html +13 -0
- package/package.json +67 -0
- package/postcss.config.js +6 -0
- package/public/favicon.ico +0 -0
- package/public/vite.svg +1 -0
- package/src/App.tsx +96 -0
- package/src/_doc/0.docs-overview.md +28 -0
- package/src/_doc/cx-ui/0.docs-overview.md +30 -0
- package/src/_doc/cx-ui/comp.1.cx-ui-overview.md +82 -0
- package/src/_doc/cx-ui/comp.2.cx-modal.md +82 -0
- package/src/_doc/cx-ui/comp.3.cx-button.md +89 -0
- package/src/_doc/cx-ui/comp.4.cx-form.md +72 -0
- package/src/_doc/cx-ui/comp.5.cx-fields.md +76 -0
- package/src/_doc/cx-ui/comp.6.cx-tag.md +57 -0
- package/src/_doc/cx-ui/comp.7.cx-empty-state.md +29 -0
- package/src/_doc/meta/0.docs-overview.md +24 -0
- package/src/_doc/meta/comp.1.enum-runtime.md +33 -0
- package/src/_doc/meta/comp.2.dict-runtime.md +39 -0
- package/src/_doc/router/0.docs-overview.md +14 -0
- package/src/_doc/router/guide.1.menu-component-config.md +181 -0
- package/src/_doc/router/guide.2.router-auto-registration.md +114 -0
- package/src/_doc/table-view/0.docs-overview.md +30 -0
- package/src/_doc/table-view/comp.1.table-view.md +542 -0
- package/src/_doc/table-view/props.1.create-table-view-config.md +193 -0
- package/src/_doc/table-view/props.2.table-view-search-fields.md +106 -0
- package/src/api/_mock/README.md +340 -0
- package/src/api/_mock/api.ts +1642 -0
- package/src/api/_mock/bundle-shim.ts +16 -0
- package/src/api/_mock/handler-shim.ts +6 -0
- package/src/api/_mock/handler.ts +458 -0
- package/src/api/_mock/index.ts +711 -0
- package/src/api/_mock/interceptor.ts +15 -0
- package/src/api/_mock/mod.ts +12 -0
- package/src/api/_mock/utils.ts +65 -0
- package/src/api/base/memory.js +24 -0
- package/src/api/chat.js +210 -0
- package/src/api/common/auth.js +70 -0
- package/src/api/menus/business-rules.js +76 -0
- package/src/api/menus/feedback.js +102 -0
- package/src/api/menus/knowledge.js +159 -0
- package/src/api/menus/model-metadata/manage.js +70 -0
- package/src/api/menus/model-metadata/role.js +50 -0
- package/src/api/menus/model-metadata/training-detail-mock-data.js +569 -0
- package/src/api/menus/model-metadata/training.js +28 -0
- package/src/api/menus/skill.js +40 -0
- package/src/api/system/agent-config.js +16 -0
- package/src/api/system/department.js +94 -0
- package/src/api/system/dict.js +86 -0
- package/src/api/system/menu.js +37 -0
- package/src/api/system/permission.js +26 -0
- package/src/api/system/role.js +34 -0
- package/src/api/system/sys-config.js +16 -0
- package/src/api/system/sys-log.js +17 -0
- package/src/api/system/user.js +75 -0
- package/src/api/upload.js +39 -0
- package/src/assets/react.svg +1 -0
- package/src/components/auth/current-user-avatar.tsx +77 -0
- package/src/components/common/code-view.tsx +149 -0
- package/src/components/common/detail-link.tsx +67 -0
- package/src/components/common/error-boundary.tsx +98 -0
- package/src/components/common/language-switcher.tsx +91 -0
- package/src/components/common/lite-table/index.tsx +135 -0
- package/src/components/common/md-editor.tsx +126 -0
- package/src/components/common/modal/confirm-dialog.tsx +113 -0
- package/src/components/common/modal/dep-user-select-multi.tsx +324 -0
- package/src/components/common/modal/dep-user-select.tsx +249 -0
- package/src/components/common/modal/user-select-multi.tsx +266 -0
- package/src/components/common/pagination.tsx +472 -0
- package/src/components/common/path.tsx +175 -0
- package/src/components/common/system-logo-mark.tsx +48 -0
- package/src/components/cx-ui/button/index.less +208 -0
- package/src/components/cx-ui/button/index.tsx +611 -0
- package/src/components/cx-ui/checkbox/index.tsx +78 -0
- package/src/components/cx-ui/date-picker/index.less +17 -0
- package/src/components/cx-ui/date-picker/index.tsx +193 -0
- package/src/components/cx-ui/drawer/index.tsx +47 -0
- package/src/components/cx-ui/empty-state/index.tsx +20 -0
- package/src/components/cx-ui/floating-shell/CxFloatingShell.tsx +89 -0
- package/src/components/cx-ui/floating-shell/cx-floating-shell.less +283 -0
- package/src/components/cx-ui/floating-shell/has-floating-value.ts +41 -0
- package/src/components/cx-ui/form/CxForm.tsx +15 -0
- package/src/components/cx-ui/form/index.tsx +20 -0
- package/src/components/cx-ui/form-item/index.less +26 -0
- package/src/components/cx-ui/form-item/index.tsx +36 -0
- package/src/components/cx-ui/index.ts +70 -0
- package/src/components/cx-ui/input/auto-complete.tsx +134 -0
- package/src/components/cx-ui/input/index.tsx +259 -0
- package/src/components/cx-ui/input-number/index.jsx +66 -0
- package/src/components/cx-ui/modal/index.jsx +212 -0
- package/src/components/cx-ui/modal/index.less +144 -0
- package/src/components/cx-ui/modal/useCxModal.ts +125 -0
- package/src/components/cx-ui/multi-select/index.jsx +74 -0
- package/src/components/cx-ui/multi-select/index.less +40 -0
- package/src/components/cx-ui/multi-select/index2.tsx +361 -0
- package/src/components/cx-ui/radio/index.tsx +33 -0
- package/src/components/cx-ui/range-picker/index.less +65 -0
- package/src/components/cx-ui/range-picker/index.tsx +219 -0
- package/src/components/cx-ui/select/index.less +34 -0
- package/src/components/cx-ui/select/index.tsx +196 -0
- package/src/components/cx-ui/skeleton/index.tsx +12 -0
- package/src/components/cx-ui/steps/index.tsx +14 -0
- package/src/components/cx-ui/styles/_tokens.less +79 -0
- package/src/components/cx-ui/styles/index.less +246 -0
- package/src/components/cx-ui/switch/index.less +106 -0
- package/src/components/cx-ui/switch/index.tsx +120 -0
- package/src/components/cx-ui/table/index.less +160 -0
- package/src/components/cx-ui/table/index.tsx +152 -0
- package/src/components/cx-ui/tabs/index.less +15 -0
- package/src/components/cx-ui/tabs/index.tsx +34 -0
- package/src/components/cx-ui/tag/index.less +51 -0
- package/src/components/cx-ui/tag/index.tsx +140 -0
- package/src/components/cx-ui/timeline/index.tsx +14 -0
- package/src/components/cx-ui/tooltip/index.tsx +67 -0
- package/src/components/cx-ui/tree/index.tsx +193 -0
- package/src/components/cx-ui/tree-select/index.jsx +91 -0
- package/src/components/cx-ui/tree-select/index.less +27 -0
- package/src/components/cx-ui/upload-file/index.less +223 -0
- package/src/components/cx-ui/upload-file/index.tsx +640 -0
- package/src/components/cx-ui/upload-img/index.tsx +291 -0
- package/src/components/layout/components/Header.tsx +216 -0
- package/src/components/layout/components/Sidebar.tsx +717 -0
- package/src/components/layout/index.tsx +95 -0
- package/src/components/table-view/components/search-area.tsx +411 -0
- package/src/components/table-view/components/table-view-config.tsx +528 -0
- package/src/components/table-view/components/table-view.types.ts +478 -0
- package/src/components/table-view/components/tree-api-normalize.ts +38 -0
- package/src/components/table-view/components/tree-data-annotate.ts +31 -0
- package/src/components/table-view/components/tree-sidebar.tsx +74 -0
- package/src/components/table-view/index.tsx +61 -0
- package/src/components/table-view/list-page-view.tsx +1049 -0
- package/src/components/table-view/select-table-view.tsx +1094 -0
- package/src/components/table-view/styles/select-table-view.less +51 -0
- package/src/config/default-system-name.ts +9 -0
- package/src/config/system.ts +165 -0
- package/src/constants/countryCodes.ts +3 -0
- package/src/contexts/AuthContext.tsx +256 -0
- package/src/contexts/ChatContext.tsx +839 -0
- package/src/contexts/MenuContext.tsx +62 -0
- package/src/contexts/ToastContext.tsx +181 -0
- package/src/hooks/useCopyToClipboard.ts +47 -0
- package/src/hooks/useModalSubmit.ts +104 -0
- package/src/hooks/useRouter.ts +240 -0
- package/src/hooks/useStepForm.ts +46 -0
- package/src/hooks/useStickyHeader.ts +42 -0
- package/src/hooks/useThreadActions.ts +105 -0
- package/src/hooks/useUserPreferences.ts +101 -0
- package/src/http/axios.js +372 -0
- package/src/http/mock.interceptor.ts +9 -0
- package/src/http/obfuscationKey.ts +41 -0
- package/src/i18n.ts +60 -0
- package/src/index.js +1 -0
- package/src/index.less +169 -0
- package/src/locales/en/auth.ts +70 -0
- package/src/locales/en/base/memory.ts +28 -0
- package/src/locales/en/base/settings.ts +41 -0
- package/src/locales/en/chat.ts +40 -0
- package/src/locales/en/common.ts +173 -0
- package/src/locales/en/enum.ts +27 -0
- package/src/locales/en/menus/business-rules.ts +48 -0
- package/src/locales/en/menus/feedback.ts +62 -0
- package/src/locales/en/menus/knowledge.ts +120 -0
- package/src/locales/en/menus/model-metadata/index.ts +10 -0
- package/src/locales/en/menus/model-metadata/manage.ts +151 -0
- package/src/locales/en/menus/model-metadata/role.ts +48 -0
- package/src/locales/en/menus/model-metadata/training.ts +65 -0
- package/src/locales/en/menus/skill.ts +34 -0
- package/src/locales/en/system/agent-config.ts +34 -0
- package/src/locales/en/system/department.ts +68 -0
- package/src/locales/en/system/dict.ts +44 -0
- package/src/locales/en/system/menu.ts +45 -0
- package/src/locales/en/system/permission.ts +89 -0
- package/src/locales/en/system/role.ts +25 -0
- package/src/locales/en/system/sys-config.ts +33 -0
- package/src/locales/en/system/sys-log.ts +38 -0
- package/src/locales/en/system/user.ts +113 -0
- package/src/locales/en.ts +68 -0
- package/src/locales/zh/auth.ts +70 -0
- package/src/locales/zh/base/memory.ts +29 -0
- package/src/locales/zh/base/settings.ts +41 -0
- package/src/locales/zh/chat.ts +47 -0
- package/src/locales/zh/common.ts +178 -0
- package/src/locales/zh/enum.ts +28 -0
- package/src/locales/zh/menus/business-rules.ts +47 -0
- package/src/locales/zh/menus/feedback.ts +62 -0
- package/src/locales/zh/menus/knowledge.ts +117 -0
- package/src/locales/zh/menus/model-metadata/index.ts +10 -0
- package/src/locales/zh/menus/model-metadata/manage.ts +151 -0
- package/src/locales/zh/menus/model-metadata/role.ts +47 -0
- package/src/locales/zh/menus/model-metadata/training.ts +64 -0
- package/src/locales/zh/menus/skill.ts +34 -0
- package/src/locales/zh/system/agent-config.ts +33 -0
- package/src/locales/zh/system/department.ts +69 -0
- package/src/locales/zh/system/dict.ts +44 -0
- package/src/locales/zh/system/menu.ts +47 -0
- package/src/locales/zh/system/permission.ts +94 -0
- package/src/locales/zh/system/role.ts +25 -0
- package/src/locales/zh/system/sys-config.ts +32 -0
- package/src/locales/zh/system/sys-log.ts +38 -0
- package/src/locales/zh/system/user.ts +114 -0
- package/src/locales/zh.ts +67 -0
- package/src/main.tsx +50 -0
- package/src/meta/const/index.ts +40 -0
- package/src/meta/index-dict.ts +56 -0
- package/src/meta/index-enum.ts +95 -0
- package/src/meta/index.ts +14 -0
- package/src/meta/module/dict-data/runtime.ts +199 -0
- package/src/meta/module/dict-data/types.ts +17 -0
- package/src/meta/module/enum-data/runtime.ts +75 -0
- package/src/meta/module/enum-data/types.ts +18 -0
- package/src/router/index.tsx +312 -0
- package/src/styles/AntdThemeProvider.tsx +40 -0
- package/src/styles/antd-theme.ts +20 -0
- package/src/styles/global.less +107 -0
- package/src/styles/variable.less +103 -0
- package/src/types/feedback.ts +43 -0
- package/src/types/index.ts +85 -0
- package/src/types/menu.ts +43 -0
- package/src/utils/aesUtil.ts +123 -0
- package/src/utils/chatUtils.ts +524 -0
- package/src/utils/cn.ts +6 -0
- package/src/utils/crypto.ts +164 -0
- package/src/utils/date.ts +72 -0
- package/src/utils/file-icons.tsx +79 -0
- package/src/utils/index.ts +168 -0
- package/src/utils/markdown-math-plugins.ts +21 -0
- package/src/utils/menuI18n.ts +305 -0
- package/src/utils/menuRouteRegistry.ts +78 -0
- package/src/utils/permission-crud.ts +147 -0
- package/src/utils/routeConfig.ts +350 -0
- package/src/utils/storage.ts +135 -0
- package/src/utils/toastBridge.ts +26 -0
- package/src/utils/url.ts +38 -0
- package/src/utils/validation.ts +16 -0
- package/src/views/auth/auth-code/index.less +169 -0
- package/src/views/auth/auth-code/index.module.less +174 -0
- package/src/views/auth/auth-code/index.tsx +233 -0
- package/src/views/auth/login.tsx +498 -0
- package/src/views/auth/register.tsx +388 -0
- package/src/views/base/memory/index.tsx +136 -0
- package/src/views/base/memory/modal/detail-modal.tsx +89 -0
- package/src/views/base/memory/modal/submit-modal.tsx +134 -0
- package/src/views/base/settings/index.tsx +657 -0
- package/src/views/chat/chat.less +323 -0
- package/src/views/chat/components/chat-input.tsx +298 -0
- package/src/views/chat/components/header-thread-title.tsx +210 -0
- package/src/views/chat/components/message-list/content-answer.tsx +100 -0
- package/src/views/chat/components/message-list/content-question.tsx +18 -0
- package/src/views/chat/components/message-list/index.tsx +520 -0
- package/src/views/chat/components/message-list/message-item.tsx +199 -0
- package/src/views/chat/components/message-list/preparation-demo-items.ts +147 -0
- package/src/views/chat/components/message-list/preparation-steps.tsx +506 -0
- package/src/views/chat/components/message-list/suggestion-list.tsx +36 -0
- package/src/views/chat/components/message-list/thinking-process.tsx +49 -0
- package/src/views/chat/components/message-list/toolbar.tsx +224 -0
- package/src/views/chat/components/message-list/use-message-list-scroll.ts +214 -0
- package/src/views/chat/components/references-knowledge/context.tsx +57 -0
- package/src/views/chat/components/references-knowledge/index.ts +9 -0
- package/src/views/chat/components/references-knowledge/modal/knowledge-detail-drawer.tsx +556 -0
- package/src/views/chat/components/references-knowledge/modal/knowledge-doc-detail-drawer.tsx +529 -0
- package/src/views/chat/components/references-knowledge/panel.tsx +115 -0
- package/src/views/chat/hooks/use-chat-common.ts +19 -0
- package/src/views/chat/index-session.tsx +647 -0
- package/src/views/chat/index.tsx +127 -0
- package/src/views/page-error/401.tsx +56 -0
- package/src/views/page-error/404.tsx +56 -0
- package/src/views/page-menus/business-rules/index.tsx +376 -0
- package/src/views/page-menus/business-rules/modal/detail-modal.tsx +186 -0
- package/src/views/page-menus/business-rules/modal/scope-modal.tsx +272 -0
- package/src/views/page-menus/business-rules/modal/submit-modal.tsx +142 -0
- package/src/views/page-menus/feedback/components/feedback-dataset-list.tsx +471 -0
- package/src/views/page-menus/feedback/index.tsx +166 -0
- package/src/views/page-menus/feedback/modal/export-feedback-modal.tsx +367 -0
- package/src/views/page-menus/knowledge/components/doc-editor-by-type.tsx +32 -0
- package/src/views/page-menus/knowledge/components/doc-editor-type-file.tsx +330 -0
- package/src/views/page-menus/knowledge/detail.tsx +600 -0
- package/src/views/page-menus/knowledge/index.tsx +337 -0
- package/src/views/page-menus/knowledge/modal/detail-modal.tsx +618 -0
- package/src/views/page-menus/knowledge/modal/doc-detail-modal.tsx +550 -0
- package/src/views/page-menus/knowledge/modal/doc-parse.ts +99 -0
- package/src/views/page-menus/knowledge/modal/doc-submit-modal.tsx +349 -0
- package/src/views/page-menus/knowledge/modal/doc-type-picker-modal.tsx +88 -0
- package/src/views/page-menus/knowledge/modal/knowledge-user-select-modal.tsx +283 -0
- package/src/views/page-menus/knowledge/modal/submit-modal.tsx +179 -0
- package/src/views/page-menus/model-metadata/manage/components/metadata-detail-schema-tab.tsx +114 -0
- package/src/views/page-menus/model-metadata/manage/components/step1-basic-info.tsx +232 -0
- package/src/views/page-menus/model-metadata/manage/components/step2-schema.tsx +316 -0
- package/src/views/page-menus/model-metadata/manage/components/step3-permissions.tsx +134 -0
- package/src/views/page-menus/model-metadata/manage/components/step4-documents.tsx +134 -0
- package/src/views/page-menus/model-metadata/manage/components/step5-example-sql.tsx +101 -0
- package/src/views/page-menus/model-metadata/manage/components/submit-add.tsx +338 -0
- package/src/views/page-menus/model-metadata/manage/components/submit-edit.tsx +276 -0
- package/src/views/page-menus/model-metadata/manage/detail.tsx +298 -0
- package/src/views/page-menus/model-metadata/manage/hooks/model-metadata-submit-shared.ts +113 -0
- package/src/views/page-menus/model-metadata/manage/hooks/use-model-metadata-item-state.ts +20 -0
- package/src/views/page-menus/model-metadata/manage/index.tsx +304 -0
- package/src/views/page-menus/model-metadata/manage/modal/components/table-schema.ts +374 -0
- package/src/views/page-menus/model-metadata/manage/modal/components/use-table-detail-tabs.tsx +151 -0
- package/src/views/page-menus/model-metadata/manage/modal/components/use-table-submit-tabs.tsx +423 -0
- package/src/views/page-menus/model-metadata/manage/modal/detail-modal.tsx +218 -0
- package/src/views/page-menus/model-metadata/manage/modal/submit-modal.tsx +261 -0
- package/src/views/page-menus/model-metadata/manage/modal/table-detail-modal.tsx +196 -0
- package/src/views/page-menus/model-metadata/manage/modal/table-submit-modal.tsx +229 -0
- package/src/views/page-menus/model-metadata/manage/submit.tsx +31 -0
- package/src/views/page-menus/model-metadata/role/index.tsx +207 -0
- package/src/views/page-menus/model-metadata/role/modal/detail-modal.tsx +97 -0
- package/src/views/page-menus/model-metadata/role/modal/role-assign-users-modal.tsx +254 -0
- package/src/views/page-menus/model-metadata/role/modal/role-assign-users-panel.tsx +393 -0
- package/src/views/page-menus/model-metadata/role/modal/role-assign-users-utils.ts +120 -0
- package/src/views/page-menus/model-metadata/role/modal/role-permission-assign-panel.tsx +698 -0
- package/src/views/page-menus/model-metadata/role/modal/role-permission-modal.tsx +237 -0
- package/src/views/page-menus/model-metadata/role/modal/submit-modal.tsx +135 -0
- package/src/views/page-menus/model-metadata/training/components/detail-records/index.ts +4 -0
- package/src/views/page-menus/model-metadata/training/components/detail-records/node-card.tsx +72 -0
- package/src/views/page-menus/model-metadata/training/components/detail-records/summary-lines.ts +196 -0
- package/src/views/page-menus/model-metadata/training/components/detail-records/summary-list.tsx +153 -0
- package/src/views/page-menus/model-metadata/training/components/detail-records/timeline.tsx +103 -0
- package/src/views/page-menus/model-metadata/training/components/detail-records/types.ts +82 -0
- package/src/views/page-menus/model-metadata/training/detail.tsx +159 -0
- package/src/views/page-menus/model-metadata/training/index.tsx +236 -0
- package/src/views/page-menus/model-metadata/training/modal/update-detail-modal.tsx +154 -0
- package/src/views/page-menus/skill/index.tsx +201 -0
- package/src/views/page-menus/skill/modal/detail-modal.tsx +156 -0
- package/src/views/page-menus/skill/modal/submit-modal.tsx +214 -0
- package/src/views/page-system/agent-config/index.tsx +370 -0
- package/src/views/page-system/department/departmentFormShared.ts +36 -0
- package/src/views/page-system/department/index.tsx +541 -0
- package/src/views/page-system/department/modal/detail-modal.tsx +94 -0
- package/src/views/page-system/department/modal/member-role-modal.tsx +128 -0
- package/src/views/page-system/department/modal/submit-modal.tsx +265 -0
- package/src/views/page-system/dict/index.tsx +440 -0
- package/src/views/page-system/dict/modal/cate-submit-modal.tsx +315 -0
- package/src/views/page-system/dict/modal/submit-modal.tsx +184 -0
- package/src/views/page-system/logs/components/index.ts +3 -0
- package/src/views/page-system/logs/components/log-message-demo.tsx +30 -0
- package/src/views/page-system/logs/components/log-message-stream.ts +184 -0
- package/src/views/page-system/logs/components/message-list/content-answer.tsx +100 -0
- package/src/views/page-system/logs/components/message-list/content-question.tsx +18 -0
- package/src/views/page-system/logs/components/message-list/index.tsx +515 -0
- package/src/views/page-system/logs/components/message-list/message-item.tsx +193 -0
- package/src/views/page-system/logs/components/message-list/preparation-demo-items.ts +147 -0
- package/src/views/page-system/logs/components/message-list/preparation-steps.tsx +506 -0
- package/src/views/page-system/logs/components/message-list/suggestion-list.tsx +36 -0
- package/src/views/page-system/logs/components/message-list/thinking-process.tsx +49 -0
- package/src/views/page-system/logs/components/message-list/toolbar.tsx +134 -0
- package/src/views/page-system/logs/components/message-list/use-message-list-scroll.ts +214 -0
- package/src/views/page-system/logs/components/message-modal.tsx +239 -0
- package/src/views/page-system/logs/index.tsx +132 -0
- package/src/views/page-system/logs/modal/detail-modal.tsx +157 -0
- package/src/views/page-system/menu/components/menuFormShared.ts +283 -0
- package/src/views/page-system/menu/index.less +12 -0
- package/src/views/page-system/menu/index.tsx +410 -0
- package/src/views/page-system/menu/modal/icon-modal.less +51 -0
- package/src/views/page-system/menu/modal/icon-modal.tsx +87 -0
- package/src/views/page-system/menu/modal/submit-modal.tsx +263 -0
- package/src/views/page-system/permission/index.tsx +562 -0
- package/src/views/page-system/permission/modal/detail-modal.tsx +179 -0
- package/src/views/page-system/permission/modal/submit-modal.less +146 -0
- package/src/views/page-system/permission/modal/submit-modal.tsx +650 -0
- package/src/views/page-system/role/index.tsx +163 -0
- package/src/views/page-system/role/modal/detail-modal.tsx +127 -0
- package/src/views/page-system/role/modal/permission-assign-group-rules.ts +86 -0
- package/src/views/page-system/role/modal/permission-modal.tsx +111 -0
- package/src/views/page-system/role/modal/role-modal-shell-styles.ts +21 -0
- package/src/views/page-system/role/modal/role-permission-assign-panel.tsx +916 -0
- package/src/views/page-system/role/modal/role-permission-assign-shared.ts +1047 -0
- package/src/views/page-system/role/modal/submit-modal.tsx +193 -0
- package/src/views/page-system/sys-config/index.tsx +294 -0
- package/src/views/page-system/user/components/user-role-column.tsx +87 -0
- package/src/views/page-system/user/index.tsx +439 -0
- package/src/views/page-system/user/modal/assign-roles-modal.tsx +389 -0
- package/src/views/page-system/user/modal/detail-modal.tsx +72 -0
- package/src/views/page-system/user/modal/modal-style/submit-modal.less +40 -0
- package/src/views/page-system/user/modal/submit-modal.less +40 -0
- package/src/views/page-system/user/modal/submit-modal.tsx +287 -0
- package/src/views/page-system/user/userFormShared.ts +51 -0
- package/tailwind.config.js +17 -0
- package/tsconfig.app.json +48 -0
- package/tsconfig.json +11 -0
- package/tsconfig.node.json +26 -0
- package/vite.config.ts +264 -0
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
.ant-select-dropdown {
|
|
2
|
+
.ant-select-item,
|
|
3
|
+
.ant-select-item-option {
|
|
4
|
+
height: 36px!important;
|
|
5
|
+
font-size: 14px!important;
|
|
6
|
+
line-height: 26px;
|
|
7
|
+
border-radius: 6px;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.ant-select-item:last-child,
|
|
11
|
+
.ant-select-item-option:last-child {
|
|
12
|
+
height: 36px!important;
|
|
13
|
+
font-size: 14px!important;
|
|
14
|
+
line-height: 26px;
|
|
15
|
+
border-radius: 6px;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/* hover:未选中项 */
|
|
19
|
+
.ant-select-item-option:hover:not(.ant-select-item-option-disabled),
|
|
20
|
+
.ant-select-item-option-active:not(.ant-select-item-option-selected):not(.ant-select-item-option-disabled) {
|
|
21
|
+
background-color: var(--cx-option-hover-bg) !important;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/* 选中项 */
|
|
25
|
+
.ant-select-item-option-selected:not(.ant-select-item-option-disabled) {
|
|
26
|
+
background-color: var(--cx-option-selected-bg) !important;
|
|
27
|
+
color: var(--cx-option-selected-text) !important;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.ant-select-item-option-selected:not(.ant-select-item-option-disabled):hover {
|
|
31
|
+
background-color: var(--cx-option-selected-bg) !important;
|
|
32
|
+
color: var(--cx-option-selected-text) !important;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
import type { GetProps } from 'antd'
|
|
2
|
+
import { Select } from 'antd'
|
|
3
|
+
import clsx from 'clsx'
|
|
4
|
+
import React, { useMemo, useState } from 'react'
|
|
5
|
+
|
|
6
|
+
import { CxFloatingShell } from '../floating-shell/CxFloatingShell'
|
|
7
|
+
import { hasCxFloatingValue } from '../floating-shell/has-floating-value'
|
|
8
|
+
import { CxEmptyState } from '../empty-state'
|
|
9
|
+
import './index.less'
|
|
10
|
+
|
|
11
|
+
type AntSelectProps = GetProps<typeof Select>
|
|
12
|
+
|
|
13
|
+
type CxSelectOwn = {
|
|
14
|
+
cxFloatingLabel?: React.ReactNode
|
|
15
|
+
cxFocusPlaceholder?: string
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export type CxSelectProps = Omit<AntSelectProps, 'variant'> & CxSelectOwn
|
|
19
|
+
|
|
20
|
+
type CxSelectBaseProps = Omit<AntSelectProps, 'variant'> & CxSelectOwn
|
|
21
|
+
|
|
22
|
+
/** 判断浮动标签是否有效(避免 String() / Number() 这类强转)。 */
|
|
23
|
+
const hasNonEmptyFloatingLabel = (label: React.ReactNode): boolean => {
|
|
24
|
+
if (label == null || label === false) return false
|
|
25
|
+
if (typeof label === 'string') return label.trim().length > 0
|
|
26
|
+
return true
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/** 获取浮动壳聚焦占位:优先 cxFocusPlaceholder,其次仅接受 string placeholder。 */
|
|
30
|
+
const resolveFocusPlaceholder = (
|
|
31
|
+
cxFocusPlaceholder: string | undefined,
|
|
32
|
+
placeholder: AntSelectProps['placeholder'] | undefined,
|
|
33
|
+
): string | undefined => {
|
|
34
|
+
if (cxFocusPlaceholder) return cxFocusPlaceholder
|
|
35
|
+
if (typeof placeholder === 'string') return placeholder
|
|
36
|
+
return undefined
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/** CxSelect 基础组件:统一 Select 与浮动标签能力。 */
|
|
40
|
+
const CxSelectPrimitive: React.FC<CxSelectProps> = (props) => {
|
|
41
|
+
const {
|
|
42
|
+
style = undefined,
|
|
43
|
+
cxFloatingLabel,
|
|
44
|
+
cxFocusPlaceholder,
|
|
45
|
+
placeholder,
|
|
46
|
+
value,
|
|
47
|
+
disabled,
|
|
48
|
+
className,
|
|
49
|
+
size: sizeProp,
|
|
50
|
+
mode,
|
|
51
|
+
onDropdownVisibleChange,
|
|
52
|
+
onOpenChange,
|
|
53
|
+
notFoundContent,
|
|
54
|
+
...rest
|
|
55
|
+
} = props
|
|
56
|
+
|
|
57
|
+
/** 解析高度:须与 `size` 一致,否则小号下箭头会上下错位(表格内常用 size=small)。 */
|
|
58
|
+
const resolveHeight = () => {
|
|
59
|
+
const h = style && typeof style === 'object' ? (style as { height?: unknown }).height : undefined
|
|
60
|
+
if (typeof h === 'number') return h
|
|
61
|
+
if (sizeProp === 'small') return 32
|
|
62
|
+
if (sizeProp === 'middle') return 40
|
|
63
|
+
return 42
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/** 根据高度推导浮动壳的布局类型:40 及以下按搜索区,其他按表单区。 */
|
|
67
|
+
const shellVariant: 'cxForm' | 'cxSearch' = resolveHeight() <= 40 ? 'cxSearch' : 'cxForm'
|
|
68
|
+
|
|
69
|
+
const height = resolveHeight()
|
|
70
|
+
/** 多选 / tags:行高随 Tag 换行增高,各 size 仅保 minHeight 与控件刻度一致 */
|
|
71
|
+
const multiOrTags = mode === 'multiple' || mode === 'tags'
|
|
72
|
+
const useFloat = hasNonEmptyFloatingLabel(cxFloatingLabel)
|
|
73
|
+
const [dropdownOpen, setDropdownOpen] = useState(false)
|
|
74
|
+
|
|
75
|
+
const hasValue = useMemo(() => hasCxFloatingValue(value, 'select'), [value])
|
|
76
|
+
|
|
77
|
+
const mergedStyle: React.CSSProperties =
|
|
78
|
+
style && typeof style === 'object' ? { ...(style as React.CSSProperties) } : {}
|
|
79
|
+
|
|
80
|
+
const selectStyle: React.CSSProperties = {
|
|
81
|
+
boxSizing: 'border-box',
|
|
82
|
+
borderRadius: 8,
|
|
83
|
+
...mergedStyle,
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
if (useFloat) {
|
|
87
|
+
Object.assign(selectStyle, { minHeight: 49 })
|
|
88
|
+
} else if (multiOrTags) {
|
|
89
|
+
const rawMin = mergedStyle.minHeight
|
|
90
|
+
const n =
|
|
91
|
+
typeof rawMin === 'number'
|
|
92
|
+
? rawMin
|
|
93
|
+
: typeof rawMin === 'string'
|
|
94
|
+
? Number.parseFloat(rawMin)
|
|
95
|
+
: Number.NaN
|
|
96
|
+
const minH = Number.isFinite(n) && n > 0 ? Math.max(n, height) : height
|
|
97
|
+
Object.assign(selectStyle, { minHeight: minH, height: 'auto' })
|
|
98
|
+
} else {
|
|
99
|
+
Object.assign(selectStyle, { height, minHeight: height })
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
const selectSize = sizeProp || (useFloat ? 'middle' : 'large')
|
|
103
|
+
const selectNotFoundContent =
|
|
104
|
+
notFoundContent === undefined
|
|
105
|
+
? <CxEmptyState message="暂无数据" />
|
|
106
|
+
: notFoundContent
|
|
107
|
+
|
|
108
|
+
const selectEl = (
|
|
109
|
+
<Select
|
|
110
|
+
{...rest}
|
|
111
|
+
mode={mode}
|
|
112
|
+
disabled={disabled}
|
|
113
|
+
value={value}
|
|
114
|
+
size={selectSize}
|
|
115
|
+
className={clsx('cx-select', 'cx-select-selector', className)}
|
|
116
|
+
style={selectStyle}
|
|
117
|
+
placeholder={useFloat ? undefined : placeholder}
|
|
118
|
+
fieldNames={{ label: 'label', value: 'value' }}
|
|
119
|
+
notFoundContent={selectNotFoundContent}
|
|
120
|
+
onOpenChange={(open) => {
|
|
121
|
+
setDropdownOpen(open)
|
|
122
|
+
onOpenChange?.(open)
|
|
123
|
+
onDropdownVisibleChange?.(open)
|
|
124
|
+
}}
|
|
125
|
+
/>
|
|
126
|
+
)
|
|
127
|
+
|
|
128
|
+
if (!useFloat) return selectEl
|
|
129
|
+
|
|
130
|
+
return (
|
|
131
|
+
<CxFloatingShell
|
|
132
|
+
disabled={disabled}
|
|
133
|
+
focusPlaceholder={resolveFocusPlaceholder(cxFocusPlaceholder, placeholder)}
|
|
134
|
+
hasValue={hasValue}
|
|
135
|
+
label={cxFloatingLabel}
|
|
136
|
+
overlayOpen={dropdownOpen}
|
|
137
|
+
variant={shellVariant}
|
|
138
|
+
>
|
|
139
|
+
{selectEl}
|
|
140
|
+
</CxFloatingShell>
|
|
141
|
+
)
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/** Large:42px,高度偏表单主输入。 */
|
|
145
|
+
export function CxSelectLarge(props: CxSelectBaseProps): React.ReactElement
|
|
146
|
+
export function CxSelectLarge(props: CxSelectProps) {
|
|
147
|
+
return (
|
|
148
|
+
<CxSelectPrimitive
|
|
149
|
+
{...(props as any)}
|
|
150
|
+
style={{ ...(props as any)?.style, height: 42, minHeight: 42 }}
|
|
151
|
+
/>
|
|
152
|
+
)
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/** Medium:40px,高度偏搜索区输入。 */
|
|
156
|
+
export function CxSelectMedium(props: CxSelectBaseProps): React.ReactElement
|
|
157
|
+
export function CxSelectMedium(props: CxSelectProps) {
|
|
158
|
+
return (
|
|
159
|
+
<CxSelectPrimitive
|
|
160
|
+
{...(props as any)}
|
|
161
|
+
style={{ ...(props as any)?.style, height: 40, minHeight: 40 }}
|
|
162
|
+
/>
|
|
163
|
+
)
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/** Small:32px,更紧凑。 */
|
|
167
|
+
export function CxSelectSmall(props: CxSelectBaseProps): React.ReactElement
|
|
168
|
+
export function CxSelectSmall(props: CxSelectProps) {
|
|
169
|
+
return (
|
|
170
|
+
<CxSelectPrimitive
|
|
171
|
+
{...(props as any)}
|
|
172
|
+
style={{ ...(props as any)?.style, height: 32, minHeight: 32 }}
|
|
173
|
+
/>
|
|
174
|
+
)
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
/** Float:第 4 种类型,浮动标签下拉(使用 CxFloatingShell)。 */
|
|
178
|
+
export function CxSelectFloat(props: CxSelectBaseProps): React.ReactElement
|
|
179
|
+
export function CxSelectFloat(props: CxSelectBaseProps) {
|
|
180
|
+
const hasLabel = hasNonEmptyFloatingLabel((props as any)?.cxFloatingLabel)
|
|
181
|
+
return (
|
|
182
|
+
<CxSelectPrimitive
|
|
183
|
+
{...(props as any)}
|
|
184
|
+
cxFloatingLabel={hasLabel ? (props as any)?.cxFloatingLabel : (props as any)?.placeholder}
|
|
185
|
+
/>
|
|
186
|
+
)
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
const ExportedCxSelect = Object.assign(CxSelectPrimitive, {
|
|
190
|
+
Large: CxSelectLarge,
|
|
191
|
+
Medium: CxSelectMedium,
|
|
192
|
+
Small: CxSelectSmall,
|
|
193
|
+
Float: CxSelectFloat,
|
|
194
|
+
})
|
|
195
|
+
|
|
196
|
+
export default ExportedCxSelect
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Skeleton } from 'antd'
|
|
2
|
+
import type { SkeletonProps } from 'antd'
|
|
3
|
+
import clsx from 'clsx'
|
|
4
|
+
|
|
5
|
+
export type CxSkeletonProps = SkeletonProps & {
|
|
6
|
+
className?: string
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
/** antd Skeleton 薄封装,便于统一 class 与后续主题扩展 */
|
|
10
|
+
export function CxSkeleton({ className, ...rest }: CxSkeletonProps) {
|
|
11
|
+
return <Skeleton className={clsx('cx-skeleton', className)} {...rest} />
|
|
12
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { StepsProps } from 'antd'
|
|
2
|
+
import { Steps } from 'antd'
|
|
3
|
+
import type { CSSProperties } from 'react'
|
|
4
|
+
|
|
5
|
+
export type CxStepsProps = Omit<StepsProps, 'className' | 'style'> & {
|
|
6
|
+
className?: string
|
|
7
|
+
style?: CSSProperties
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export function CxSteps(props: CxStepsProps) {
|
|
11
|
+
const { className, style, ...restProps } = props
|
|
12
|
+
|
|
13
|
+
return <Steps className={className} style={style} {...restProps} />
|
|
14
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cx UI 设计令牌(--cx-*)
|
|
3
|
+
* 业务或主题可在 :root 或局部容器上覆盖这些变量,无需改组件源码。
|
|
4
|
+
*
|
|
5
|
+
* 根类约定(供 index.less 作用域覆盖 antd):
|
|
6
|
+
* - CxInput → .cx-input + rootClassName `.cx-input-root`(单行焦点环)
|
|
7
|
+
* - CxSelect → 根节点 `.ant-select.cx-select`(antd 6+ 边框在根上;`cx-select-selector` 仅作兼容类名,勿当作子节点)
|
|
8
|
+
* - CxDatePicker → .cx-datepicker + .cx-date-picker
|
|
9
|
+
* - CxRangePicker → .cx-range-picker
|
|
10
|
+
* - CxInputNumber → .cx-input-number + rootClassName `.cx-input-number-root`
|
|
11
|
+
* - CxTreeSelect → .cx-tree-select
|
|
12
|
+
* - CxMultiSelect → .cx-multi-select
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
:root {
|
|
16
|
+
/* 字号 */
|
|
17
|
+
--cx-font-size-base: 14px;
|
|
18
|
+
--cx-font-size-sm: 12px;
|
|
19
|
+
/** 浮动搜索等:比 sm 再小一档 */
|
|
20
|
+
--cx-font-size-xs: 11px;
|
|
21
|
+
|
|
22
|
+
/* 表单/搜索控件内文字(对齐原 ant 默认约 14px,由 index.less 落到具体节点) */
|
|
23
|
+
--cx-input-font-size: var(--cx-font-size-base);
|
|
24
|
+
--cx-select-font-size: var(--cx-font-size-base);
|
|
25
|
+
--cx-select-option-font-size: var(--cx-font-size-base);
|
|
26
|
+
--cx-picker-font-size: var(--cx-font-size-base);
|
|
27
|
+
--cx-input-number-font-size: var(--cx-font-size-base);
|
|
28
|
+
--cx-tree-select-font-size: var(--cx-font-size-base);
|
|
29
|
+
|
|
30
|
+
/* 浮动壳内:略小于 label,且略小于普通 sm */
|
|
31
|
+
--cx-floating-control-font-size: var(--cx-font-size-xs);
|
|
32
|
+
--cx-floating-label-font-size: var(--cx-font-size-base);
|
|
33
|
+
|
|
34
|
+
/* 控件高度(与组件内联高度策略一致时可再抽) */
|
|
35
|
+
--cx-control-height: 42px;
|
|
36
|
+
--cx-control-height-sm: 40px;
|
|
37
|
+
|
|
38
|
+
--cx-border-radius-control: 8px;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* 控件聚焦:对齐 `focus:ring-2 focus:ring-blue-500`(仅 ring,不把边框改成蓝)
|
|
42
|
+
* 与 `border-gray-200` 并存;避免「蓝边框 + 蓝 ring」叠成更粗的一圈
|
|
43
|
+
* ring:三层 box-shadow(offset / ring / tw-shadow 占位)
|
|
44
|
+
*/
|
|
45
|
+
--cx-control-focus-keep-border: #e5e7eb; /* gray-200,与 Admin 原生输入一致 */
|
|
46
|
+
--cx-control-focus-ring-color: rgb(59, 130, 246);
|
|
47
|
+
--cx-control-focus-ring-width: 2px;
|
|
48
|
+
--cx-control-focus-ring-box: 0 0 #0000, 0 0 0 var(--cx-control-focus-ring-width)
|
|
49
|
+
var(--cx-control-focus-ring-color), 0 0 #0000;
|
|
50
|
+
|
|
51
|
+
--cx-control-transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);
|
|
52
|
+
|
|
53
|
+
/* 尝试映射 antd 5 组件级 CSS 变量(存在则生效,便于与 ant 主题对齐) */
|
|
54
|
+
--cx-ant-input-font-size: var(--cx-input-font-size);
|
|
55
|
+
--cx-ant-select-font-size: var(--cx-select-font-size);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
html.dark,
|
|
59
|
+
.dark {
|
|
60
|
+
--cx-control-focus-keep-border: #374151; /* gray-700 */
|
|
61
|
+
--cx-control-focus-ring-color: rgb(96, 165, 250);
|
|
62
|
+
/** 浏览器自动填充:覆盖默认浅黄/白底(与 antd 暗色容器接近) */
|
|
63
|
+
--cx-autofill-bg: #1f1f1f;
|
|
64
|
+
--cx-autofill-text: #e5e7eb;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* 登录/注册等:外层用 ConfigProvider darkAlgorithm,但 document 未挂 `html.dark` 时,
|
|
69
|
+
* 仍须用暗色「保持边框」与 ring,否则 LESS 仍用 :root 的 gray-200,聚焦会像白边闪一下。
|
|
70
|
+
*/
|
|
71
|
+
.auth-dark-cx {
|
|
72
|
+
--cx-control-focus-keep-border: #3f3f46;
|
|
73
|
+
--cx-control-focus-ring-color: rgb(96, 165, 250);
|
|
74
|
+
--cx-control-focus-ring-width: 2px;
|
|
75
|
+
--cx-control-focus-ring-box: 0 0 #0000, 0 0 0 var(--cx-control-focus-ring-width)
|
|
76
|
+
var(--cx-control-focus-ring-color), 0 0 #0000;
|
|
77
|
+
--cx-autofill-bg: rgba(19, 19, 20, 0.96);
|
|
78
|
+
--cx-autofill-text: #e5e7eb;
|
|
79
|
+
}
|
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
@import './_tokens.less';
|
|
2
|
+
@import '../floating-shell/cx-floating-shell.less';
|
|
3
|
+
|
|
4
|
+
/* ========== 覆盖 antd 默认:仅作用于带 cx- 根类的 Cx 封装 ========== */
|
|
5
|
+
|
|
6
|
+
/* ---------- 焦点高亮与过渡(对齐 Tailwind ring-2 + ring-blue-500 + transition-all)---------- */
|
|
7
|
+
.cx-input-root {
|
|
8
|
+
transition: var(--cx-control-transition);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/* 内层原生 input:去掉浏览器 / antd 额外 outline,避免暗色底上闪白边 */
|
|
12
|
+
.cx-input-root .ant-input,
|
|
13
|
+
.cx-input-root input.ant-input {
|
|
14
|
+
outline: none !important;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.cx-input-root:focus-within:not(.ant-input-disabled):not(.ant-input-status-error):not(
|
|
18
|
+
.ant-input-affix-wrapper-disabled
|
|
19
|
+
):not(.ant-input-affix-wrapper-status-error),
|
|
20
|
+
.cx-input-root.ant-input-affix-wrapper-focused:not(.ant-input-affix-wrapper-disabled):not(
|
|
21
|
+
.ant-input-affix-wrapper-status-error
|
|
22
|
+
) {
|
|
23
|
+
border-color: var(--cx-control-focus-keep-border) !important;
|
|
24
|
+
box-shadow: var(--cx-control-focus-ring-box) !important;
|
|
25
|
+
outline: 2px solid transparent;
|
|
26
|
+
outline-offset: 2px;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.cx-input-root .ant-input:focus,
|
|
30
|
+
.cx-input-root .ant-input:focus-visible {
|
|
31
|
+
outline: 2px solid transparent;
|
|
32
|
+
outline-offset: 2px;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* 暗黑 / 落地页暗壳:Chrome 等自动填充默认白底、黄底,用 inset box-shadow 盖住(WebKit)
|
|
37
|
+
* 变量见 _tokens:`html.dark` / `.dark` / `.auth-dark-cx` 下的 --cx-autofill-*
|
|
38
|
+
*/
|
|
39
|
+
.auth-dark-cx .cx-input-root input.ant-input:-webkit-autofill,
|
|
40
|
+
.auth-dark-cx .cx-input-root input.ant-input:-webkit-autofill:hover,
|
|
41
|
+
.auth-dark-cx .cx-input-root input.ant-input:-webkit-autofill:focus,
|
|
42
|
+
.auth-dark-cx .cx-input-root input.ant-input:-webkit-autofill:active,
|
|
43
|
+
html.dark .cx-input-root input.ant-input:-webkit-autofill,
|
|
44
|
+
html.dark .cx-input-root input.ant-input:-webkit-autofill:hover,
|
|
45
|
+
html.dark .cx-input-root input.ant-input:-webkit-autofill:focus,
|
|
46
|
+
html.dark .cx-input-root input.ant-input:-webkit-autofill:active,
|
|
47
|
+
.dark .cx-input-root input.ant-input:-webkit-autofill,
|
|
48
|
+
.dark .cx-input-root input.ant-input:-webkit-autofill:hover,
|
|
49
|
+
.dark .cx-input-root input.ant-input:-webkit-autofill:focus,
|
|
50
|
+
.dark .cx-input-root input.ant-input:-webkit-autofill:active {
|
|
51
|
+
-webkit-box-shadow: 0 0 0 1000px var(--cx-autofill-bg) inset !important;
|
|
52
|
+
-webkit-text-fill-color: var(--cx-autofill-text) !important;
|
|
53
|
+
caret-color: var(--cx-autofill-text);
|
|
54
|
+
transition: background-color 99999s ease-out;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.auth-dark-cx textarea.cx-input:-webkit-autofill,
|
|
58
|
+
html.dark textarea.cx-input:-webkit-autofill,
|
|
59
|
+
.dark textarea.cx-input:-webkit-autofill {
|
|
60
|
+
-webkit-box-shadow: 0 0 0 1000px var(--cx-autofill-bg) inset !important;
|
|
61
|
+
-webkit-text-fill-color: var(--cx-autofill-text) !important;
|
|
62
|
+
caret-color: var(--cx-autofill-text);
|
|
63
|
+
transition: background-color 99999s ease-out;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/* 落地页内原生 input(非 ant Input) */
|
|
67
|
+
.auth-dark-cx input:-webkit-autofill,
|
|
68
|
+
.auth-dark-cx input:-webkit-autofill:hover,
|
|
69
|
+
.auth-dark-cx input:-webkit-autofill:focus,
|
|
70
|
+
.auth-dark-cx input:-webkit-autofill:active {
|
|
71
|
+
-webkit-box-shadow: 0 0 0 1000px var(--cx-autofill-bg) inset !important;
|
|
72
|
+
-webkit-text-fill-color: var(--cx-autofill-text) !important;
|
|
73
|
+
caret-color: var(--cx-autofill-text);
|
|
74
|
+
transition: background-color 99999s ease-out;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/* 全站挂 html.dark / .dark 时的普通 input */
|
|
78
|
+
html.dark input:-webkit-autofill,
|
|
79
|
+
html.dark input:-webkit-autofill:hover,
|
|
80
|
+
html.dark input:-webkit-autofill:focus,
|
|
81
|
+
html.dark input:-webkit-autofill:active,
|
|
82
|
+
.dark input:-webkit-autofill,
|
|
83
|
+
.dark input:-webkit-autofill:hover,
|
|
84
|
+
.dark input:-webkit-autofill:focus,
|
|
85
|
+
.dark input:-webkit-autofill:active {
|
|
86
|
+
-webkit-box-shadow: 0 0 0 1000px var(--cx-autofill-bg) inset !important;
|
|
87
|
+
-webkit-text-fill-color: var(--cx-autofill-text) !important;
|
|
88
|
+
caret-color: var(--cx-autofill-text);
|
|
89
|
+
transition: background-color 99999s ease-out;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
textarea.cx-input.cx-input--textarea {
|
|
93
|
+
transition: var(--cx-control-transition);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
textarea.cx-input.cx-input--textarea:focus:not(:disabled):not(.ant-input-status-error) {
|
|
97
|
+
border-color: var(--cx-control-focus-keep-border) !important;
|
|
98
|
+
box-shadow: var(--cx-control-focus-ring-box) !important;
|
|
99
|
+
outline: 2px solid transparent;
|
|
100
|
+
outline-offset: 2px;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/* Input:affix 包裹层与原生 input */
|
|
104
|
+
span.cx-input.ant-input-affix-wrapper {
|
|
105
|
+
font-size: var(--cx-input-font-size);
|
|
106
|
+
border-radius: var(--cx-border-radius-control);
|
|
107
|
+
/* antd 5 部分版本在根上消费该变量 */
|
|
108
|
+
--ant-input-input-font-size: var(--cx-ant-input-font-size);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
span.cx-input.ant-input-affix-wrapper > input.ant-input,
|
|
112
|
+
input.cx-input.ant-input {
|
|
113
|
+
font-size: var(--cx-input-font-size);
|
|
114
|
+
--ant-input-input-font-size: var(--cx-ant-input-font-size);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
textarea.cx-input {
|
|
118
|
+
font-size: var(--cx-input-font-size);
|
|
119
|
+
border-radius: var(--cx-border-radius-control);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Select(antd 6+):边框与 focus 光晕在根节点 `.ant-select` 上,不在子级 `.ant-select-selector`。
|
|
124
|
+
* 故 Cx 的 ring / 过渡须作用在 `.ant-select.cx-select` 根上(与 class 列表一致)。
|
|
125
|
+
*/
|
|
126
|
+
.ant-select.cx-select {
|
|
127
|
+
font-size: var(--cx-select-font-size);
|
|
128
|
+
border-radius: var(--cx-border-radius-control);
|
|
129
|
+
--ant-select-font-size: var(--cx-ant-select-font-size);
|
|
130
|
+
transition: var(--cx-control-transition);
|
|
131
|
+
/* antd 6 默认 flex-start,与 CxSelect 根上固定高度叠加时箭头易偏;首列 AutoComplete 用 Input.suffix 无此问题 */
|
|
132
|
+
align-items: center !important;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.ant-select.cx-select .ant-select-suffix {
|
|
136
|
+
display: inline-flex;
|
|
137
|
+
align-items: center;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/* 仍挂在根上的箭头节点(与 suffix 并存或旧结构) */
|
|
141
|
+
.ant-select.cx-select .ant-select-arrow {
|
|
142
|
+
display: inline-flex !important;
|
|
143
|
+
align-items: center !important;
|
|
144
|
+
justify-content: center !important;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/* 根节点 flex 对齐后,清除钮相对视觉中心略偏下,微上移(保留 antd translateZ 防闪烁) */
|
|
148
|
+
.ant-select.cx-select .ant-select-clear {
|
|
149
|
+
transform: translateZ(0) translateY(-3px) !important;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.ant-select.cx-select.ant-select-focused:not(.ant-select-disabled):not(.ant-select-status-error),
|
|
153
|
+
.ant-select.cx-select.ant-select-open:not(.ant-select-disabled):not(.ant-select-status-error),
|
|
154
|
+
.ant-select.cx-select:not(.ant-select-disabled):not(.ant-select-status-error):focus-within {
|
|
155
|
+
border-color: var(--cx-control-focus-keep-border) !important;
|
|
156
|
+
box-shadow: var(--cx-control-focus-ring-box) !important;
|
|
157
|
+
outline: 2px solid transparent;
|
|
158
|
+
outline-offset: 2px;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* Select(兼容旧结构):部分 antd 版本边框仍在 `.ant-select-selector` 上,
|
|
163
|
+
* 这里同步一份 ring/边框,避免 Float 场景出现“边框颜色不对”。
|
|
164
|
+
*/
|
|
165
|
+
.ant-select.cx-select.ant-select-focused:not(.ant-select-disabled):not(.ant-select-status-error)
|
|
166
|
+
.ant-select-selector,
|
|
167
|
+
.ant-select.cx-select.ant-select-open:not(.ant-select-disabled):not(.ant-select-status-error)
|
|
168
|
+
.ant-select-selector,
|
|
169
|
+
.ant-select.cx-select:not(.ant-select-disabled):not(.ant-select-status-error):focus-within
|
|
170
|
+
.ant-select-selector {
|
|
171
|
+
border-color: var(--cx-control-focus-keep-border) !important;
|
|
172
|
+
box-shadow: var(--cx-control-focus-ring-box) !important;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
.ant-select.cx-select.ant-select-lg {
|
|
176
|
+
font-size: var(--cx-select-font-size);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
/* DatePicker / RangePicker */
|
|
180
|
+
.cx-datepicker.cx-date-picker.ant-picker,
|
|
181
|
+
.cx-range-picker.ant-picker {
|
|
182
|
+
font-size: var(--cx-picker-font-size);
|
|
183
|
+
border-radius: var(--cx-border-radius-control);
|
|
184
|
+
transition: var(--cx-control-transition);
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
.cx-datepicker.cx-date-picker.ant-picker.ant-picker-focused:not(.ant-picker-disabled):not(
|
|
188
|
+
.ant-picker-status-error
|
|
189
|
+
),
|
|
190
|
+
.cx-range-picker.ant-picker.ant-picker-focused:not(.ant-picker-disabled):not(
|
|
191
|
+
.ant-picker-status-error
|
|
192
|
+
) {
|
|
193
|
+
border-color: var(--cx-control-focus-keep-border) !important;
|
|
194
|
+
box-shadow: var(--cx-control-focus-ring-box) !important;
|
|
195
|
+
outline: 2px solid transparent;
|
|
196
|
+
outline-offset: 2px;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
.cx-datepicker.cx-date-picker .ant-picker-input > input,
|
|
200
|
+
.cx-range-picker.ant-picker .ant-picker-input > input {
|
|
201
|
+
font-size: var(--cx-picker-font-size);
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
/* InputNumber */
|
|
205
|
+
.cx-input-number.ant-input-number {
|
|
206
|
+
font-size: var(--cx-input-number-font-size);
|
|
207
|
+
border-radius: var(--cx-border-radius-control);
|
|
208
|
+
transition: var(--cx-control-transition);
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
.cx-input-number-root.ant-input-number-focused:not(.ant-input-number-disabled):not(
|
|
212
|
+
.ant-input-number-status-error
|
|
213
|
+
) {
|
|
214
|
+
border-color: var(--cx-control-focus-keep-border) !important;
|
|
215
|
+
box-shadow: var(--cx-control-focus-ring-box) !important;
|
|
216
|
+
outline: 2px solid transparent;
|
|
217
|
+
outline-offset: 2px;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
.cx-input-number.ant-input-number .ant-input-number-input {
|
|
221
|
+
font-size: var(--cx-input-number-font-size);
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
/* TreeSelect:与 Select 同源,边框在根 `.ant-select.cx-tree-select` */
|
|
225
|
+
.cx-tree-select.ant-select {
|
|
226
|
+
font-size: var(--cx-tree-select-font-size);
|
|
227
|
+
border-radius: var(--cx-border-radius-control);
|
|
228
|
+
transition: var(--cx-control-transition);
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
.cx-tree-select.ant-select.ant-select-focused:not(.ant-select-disabled):not(.ant-select-status-error),
|
|
232
|
+
.cx-tree-select.ant-select.ant-select-open:not(.ant-select-disabled):not(.ant-select-status-error),
|
|
233
|
+
.cx-tree-select.ant-select:not(.ant-select-disabled):not(.ant-select-status-error):focus-within {
|
|
234
|
+
border-color: var(--cx-control-focus-keep-border) !important;
|
|
235
|
+
box-shadow: var(--cx-control-focus-ring-box) !important;
|
|
236
|
+
outline: 2px solid transparent;
|
|
237
|
+
outline-offset: 2px;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
/* MultiSelect(自定义结构,仅按钮区) */
|
|
241
|
+
.cx-multi-select {
|
|
242
|
+
font-size: var(--cx-select-font-size);
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
@import '../tag/index.less';
|
|
246
|
+
@import '../tabs/index.less';
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
.cx-switch.ant-switch {
|
|
2
|
+
min-height: 22px;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
/* 轨道内文案(开启/关闭 等) */
|
|
6
|
+
.cx-switch--text.ant-switch {
|
|
7
|
+
min-width: 64px;
|
|
8
|
+
min-height: 26px;
|
|
9
|
+
line-height: 24px;
|
|
10
|
+
|
|
11
|
+
.ant-switch-handle {
|
|
12
|
+
top: 2px;
|
|
13
|
+
width: 20px;
|
|
14
|
+
height: 20px;
|
|
15
|
+
|
|
16
|
+
&::before {
|
|
17
|
+
border-radius: 10px;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
&.ant-switch-checked .ant-switch-handle {
|
|
22
|
+
inset-inline-start: calc(100% - 20px - 2px);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.ant-switch-inner {
|
|
26
|
+
padding-inline: 8px 26px;
|
|
27
|
+
font-size: 13px;
|
|
28
|
+
color: rgba(255, 255, 255, 0.92);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
&.ant-switch-checked .ant-switch-inner {
|
|
32
|
+
padding-inline: 26px 8px;
|
|
33
|
+
color: rgba(255, 255, 255, 0.95);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
&:not(.ant-switch-checked) {
|
|
37
|
+
background: rgba(0, 0, 0, 0.22);
|
|
38
|
+
|
|
39
|
+
.ant-switch-inner {
|
|
40
|
+
color: rgba(255, 255, 255, 0.92);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
&.ant-switch-checked {
|
|
45
|
+
background: var(--cx-color-primary-solid);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
html.dark {
|
|
50
|
+
.cx-switch--text.ant-switch:not(.ant-switch-checked) {
|
|
51
|
+
background: rgba(255, 255, 255, 0.22);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/* 左右文案 + 中间开关(接口类型等) */
|
|
56
|
+
.cx-switch-dual {
|
|
57
|
+
display: inline-flex;
|
|
58
|
+
align-items: center;
|
|
59
|
+
gap: 10px;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.cx-switch-dual__side {
|
|
63
|
+
margin: 0;
|
|
64
|
+
padding: 0 2px;
|
|
65
|
+
font-size: 14px;
|
|
66
|
+
line-height: 22px;
|
|
67
|
+
color: rgba(0, 0, 0, 0.55);
|
|
68
|
+
background: transparent;
|
|
69
|
+
border: none;
|
|
70
|
+
cursor: pointer;
|
|
71
|
+
transition: color 0.2s ease;
|
|
72
|
+
|
|
73
|
+
&:hover {
|
|
74
|
+
color: rgba(0, 0, 0, 0.75);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
&--active {
|
|
78
|
+
color: var(--cx-color-primary-solid);
|
|
79
|
+
font-weight: 500;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
html.dark .cx-switch-dual__side {
|
|
84
|
+
color: rgba(255, 255, 255, 0.55);
|
|
85
|
+
|
|
86
|
+
&:hover {
|
|
87
|
+
color: rgba(255, 255, 255, 0.75);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
&--active {
|
|
91
|
+
color: var(--cx-color-primary-solid);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.cx-switch--dual-track.ant-switch {
|
|
96
|
+
min-width: 44px;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/* dual:整组禁用(如未选菜单不可切接口类型) */
|
|
100
|
+
.cx-switch-dual--disabled {
|
|
101
|
+
opacity: 0.68;
|
|
102
|
+
|
|
103
|
+
.cx-switch-dual__side:disabled {
|
|
104
|
+
cursor: not-allowed;
|
|
105
|
+
}
|
|
106
|
+
}
|